Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 1.05 KB

BASEPOINT.md

File metadata and controls

53 lines (38 loc) · 1.05 KB

BasePoint Module

BasePoint is a parent class, for more information visit its children documentation.

Models

BasePoint

Defines the structure for BasePoint entities.

type BasePoint = {
  _id?: string | ObjectId;
  id: string | ObjectId;
  createdAt: Date | string;
  updatedAt: Date | string;
  deletedAt?: Date;
  adjacents: (string)[];
  tags: (string)[];
  kind: 'Pole' | 'Point' | 'JunctionBox';
  coords: [number, number];
};

Example Usage

Fetching BasePoints

import OZMapSDK from 'ozmapsdk';

const sdk = new OZMapSDK('ozmapURL', { apiKey: 'yourApiKey' });

sdk.basePoint.find({ page: 1, limit: 10 }).then((pagination) => {
  console.log('BasePoints:', pagination);
});

Fetching a BasePoint by ID

import OZMapSDK from 'ozmapsdk';

const sdk = new OZMapSDK('ozmapURL', { apiKey: 'yourApiKey' });

sdk.basePoint.findById('basePointId').then((basePoint) => {
  console.log('BasePoint:', basePoint);
});