@space-df/sdk 0.0.1-dev.37 → 0.0.1-dev.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.doc.md +167 -1
- package/dist/package.json +1 -1
- package/dist/resources/telemetry/geofences.d.ts +61 -0
- package/dist/resources/telemetry/geofences.d.ts.map +1 -0
- package/dist/resources/telemetry/geofences.js +44 -0
- package/dist/resources/telemetry/geofences.js.map +1 -0
- package/dist/resources/telemetry/geofences.mjs +40 -0
- package/dist/resources/telemetry/geofences.mjs.map +1 -0
- package/dist/resources/telemetry/index.d.ts +2 -0
- package/dist/resources/telemetry/index.d.ts.map +1 -1
- package/dist/resources/telemetry/index.js +2 -0
- package/dist/resources/telemetry/index.js.map +1 -1
- package/dist/resources/telemetry/index.mjs +2 -0
- package/dist/resources/telemetry/index.mjs.map +1 -1
- package/dist/src/resources/telemetry/geofences.ts +91 -0
- package/dist/src/resources/telemetry/index.ts +2 -0
- package/dist/src/version.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +1 -1
- package/src/resources/telemetry/geofences.ts +91 -0
- package/src/resources/telemetry/index.ts +2 -0
- package/src/version.ts +1 -1
package/api.doc.md
CHANGED
|
@@ -3011,7 +3011,7 @@ await client.trip.delete('trip-uuid-456');
|
|
|
3011
3011
|
|
|
3012
3012
|
## Overview
|
|
3013
3013
|
|
|
3014
|
-
The `Telemetry` class provides methods for retrieving telemetry entities and
|
|
3014
|
+
The `Telemetry` class provides methods for retrieving telemetry entities, alerts, and geofences. This class allows you to search and filter telemetry entities by display type and search terms, retrieve alerts, and manage geofences (list, create, retrieve, update, delete).
|
|
3015
3015
|
|
|
3016
3016
|
## Methods
|
|
3017
3017
|
|
|
@@ -3120,6 +3120,172 @@ console.log(alerts.count);
|
|
|
3120
3120
|
|
|
3121
3121
|
</details>
|
|
3122
3122
|
|
|
3123
|
+
<details>
|
|
3124
|
+
<summary><strong>geofences.list</strong></summary>
|
|
3125
|
+
|
|
3126
|
+
List geofences with optional filtering by name and pagination.
|
|
3127
|
+
|
|
3128
|
+
**Signature:**
|
|
3129
|
+
|
|
3130
|
+
```typescript
|
|
3131
|
+
list(params: GeofencesListParams, options?: Core.RequestOptions): Core.APIPromise<GeofencesListResponse>
|
|
3132
|
+
```
|
|
3133
|
+
|
|
3134
|
+
**Parameters:**
|
|
3135
|
+
|
|
3136
|
+
- `params` _(GeofencesListParams)_: Query parameters for filtering and pagination:
|
|
3137
|
+
- `name` _(string, optional)_: Filter geofences by name.
|
|
3138
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
3139
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
3140
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
3141
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3142
|
+
|
|
3143
|
+
**Returns:** `Promise<GeofencesListResponse>`
|
|
3144
|
+
|
|
3145
|
+
**Response shape:**
|
|
3146
|
+
|
|
3147
|
+
- `count` _(integer)_: Total number of geofences matching the query.
|
|
3148
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
3149
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
3150
|
+
- `results` _(Geofence[])_: Array of geofence objects.
|
|
3151
|
+
|
|
3152
|
+
**Example:**
|
|
3153
|
+
|
|
3154
|
+
```typescript
|
|
3155
|
+
const geofences = await client.telemetry.geofences.list({
|
|
3156
|
+
name: 'Warehouse',
|
|
3157
|
+
limit: 10,
|
|
3158
|
+
offset: 0,
|
|
3159
|
+
});
|
|
3160
|
+
console.log(geofences.results);
|
|
3161
|
+
```
|
|
3162
|
+
|
|
3163
|
+
</details>
|
|
3164
|
+
|
|
3165
|
+
<details>
|
|
3166
|
+
<summary><strong>geofences.create</strong></summary>
|
|
3167
|
+
|
|
3168
|
+
Create a new geofence.
|
|
3169
|
+
|
|
3170
|
+
**Signature:**
|
|
3171
|
+
|
|
3172
|
+
```typescript
|
|
3173
|
+
create(params: Omit<Geofence, 'id'>, options?: Core.RequestOptions): Core.APIPromise<Geofence>
|
|
3174
|
+
```
|
|
3175
|
+
|
|
3176
|
+
**Parameters:**
|
|
3177
|
+
|
|
3178
|
+
- `params` _(Omit<Geofence, 'id'>)_: Geofence data (all fields except `id`):
|
|
3179
|
+
- `name` _(string)_: The name of the geofence.
|
|
3180
|
+
- `color` _(string)_: Display color for the geofence.
|
|
3181
|
+
- `type_zone` _('safe' | 'danger')_: Zone type.
|
|
3182
|
+
- `definition` _(object)_: Conditions (e.g. `conditions.and`).
|
|
3183
|
+
- `geometry` _(Feature[])_: GeoJSON-style features (polygon geometry).
|
|
3184
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3185
|
+
|
|
3186
|
+
**Returns:** `Promise<Geofence>`
|
|
3187
|
+
|
|
3188
|
+
**Example:**
|
|
3189
|
+
|
|
3190
|
+
```typescript
|
|
3191
|
+
const newGeofence = await client.telemetry.geofences.create({
|
|
3192
|
+
name: 'Safe Zone A',
|
|
3193
|
+
color: '#00ff00',
|
|
3194
|
+
type_zone: 'safe',
|
|
3195
|
+
definition: { conditions: { and: [] } },
|
|
3196
|
+
geometry: [/* GeoJSON Feature[] */],
|
|
3197
|
+
});
|
|
3198
|
+
console.log(newGeofence.id);
|
|
3199
|
+
```
|
|
3200
|
+
|
|
3201
|
+
</details>
|
|
3202
|
+
|
|
3203
|
+
<details>
|
|
3204
|
+
<summary><strong>geofences.retrieve</strong></summary>
|
|
3205
|
+
|
|
3206
|
+
Retrieve a geofence by its ID.
|
|
3207
|
+
|
|
3208
|
+
**Signature:**
|
|
3209
|
+
|
|
3210
|
+
```typescript
|
|
3211
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Geofence>
|
|
3212
|
+
```
|
|
3213
|
+
|
|
3214
|
+
**Parameters:**
|
|
3215
|
+
|
|
3216
|
+
- `id` _(string)_: The unique identifier of the geofence to retrieve.
|
|
3217
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3218
|
+
|
|
3219
|
+
**Returns:** `Promise<Geofence>`
|
|
3220
|
+
|
|
3221
|
+
**Example:**
|
|
3222
|
+
|
|
3223
|
+
```typescript
|
|
3224
|
+
const geofence = await client.telemetry.geofences.retrieve('123e4567-e89b-12d3-a456-426614174000');
|
|
3225
|
+
console.log(geofence.name);
|
|
3226
|
+
```
|
|
3227
|
+
|
|
3228
|
+
</details>
|
|
3229
|
+
|
|
3230
|
+
<details>
|
|
3231
|
+
<summary><strong>geofences.update</strong></summary>
|
|
3232
|
+
|
|
3233
|
+
Update an existing geofence by its ID (full update).
|
|
3234
|
+
|
|
3235
|
+
**Signature:**
|
|
3236
|
+
|
|
3237
|
+
```typescript
|
|
3238
|
+
update(id: string, params: Omit<Geofence, 'id'>, options?: Core.RequestOptions): Core.APIPromise<Geofence>
|
|
3239
|
+
```
|
|
3240
|
+
|
|
3241
|
+
**Parameters:**
|
|
3242
|
+
|
|
3243
|
+
- `id` _(string)_: The unique identifier of the geofence to update.
|
|
3244
|
+
- `params` _(Omit<Geofence, 'id'>)_: Updated geofence data (same shape as create).
|
|
3245
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3246
|
+
|
|
3247
|
+
**Returns:** `Promise<Geofence>`
|
|
3248
|
+
|
|
3249
|
+
**Example:**
|
|
3250
|
+
|
|
3251
|
+
```typescript
|
|
3252
|
+
const updatedGeofence = await client.telemetry.geofences.update('123e4567-e89b-12d3-a456-426614174000', {
|
|
3253
|
+
name: 'Safe Zone A Updated',
|
|
3254
|
+
color: '#00ff00',
|
|
3255
|
+
type_zone: 'safe',
|
|
3256
|
+
definition: { conditions: { and: [] } },
|
|
3257
|
+
geometry: [/* GeoJSON Feature[] */],
|
|
3258
|
+
});
|
|
3259
|
+
```
|
|
3260
|
+
|
|
3261
|
+
</details>
|
|
3262
|
+
|
|
3263
|
+
<details>
|
|
3264
|
+
<summary><strong>geofences.delete</strong></summary>
|
|
3265
|
+
|
|
3266
|
+
Delete a geofence by its ID.
|
|
3267
|
+
|
|
3268
|
+
**Signature:**
|
|
3269
|
+
|
|
3270
|
+
```typescript
|
|
3271
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
3272
|
+
```
|
|
3273
|
+
|
|
3274
|
+
**Parameters:**
|
|
3275
|
+
|
|
3276
|
+
- `id` _(string)_: The unique identifier of the geofence to delete.
|
|
3277
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3278
|
+
|
|
3279
|
+
**Returns:** `Promise<void>`
|
|
3280
|
+
|
|
3281
|
+
**Example:**
|
|
3282
|
+
|
|
3283
|
+
```typescript
|
|
3284
|
+
await client.telemetry.geofences.delete('123e4567-e89b-12d3-a456-426614174000');
|
|
3285
|
+
```
|
|
3286
|
+
|
|
3287
|
+
</details>
|
|
3288
|
+
|
|
3123
3289
|
---
|
|
3124
3290
|
|
|
3125
3291
|
# Organizations
|
package/dist/package.json
CHANGED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { APIResource } from "../../resource.js";
|
|
2
|
+
import * as Core from "../../core.js";
|
|
3
|
+
import { ListParamsResponse, ListResponse } from "../../types/api.js";
|
|
4
|
+
type Condition = {
|
|
5
|
+
time_between: {
|
|
6
|
+
start: string;
|
|
7
|
+
end: string;
|
|
8
|
+
};
|
|
9
|
+
} | {
|
|
10
|
+
weekday_in: number[];
|
|
11
|
+
} | {
|
|
12
|
+
distance_from_geofence_km: {
|
|
13
|
+
lte: number;
|
|
14
|
+
};
|
|
15
|
+
} | {
|
|
16
|
+
and: Condition[];
|
|
17
|
+
} | {
|
|
18
|
+
or: Condition[];
|
|
19
|
+
} | {
|
|
20
|
+
not: Condition[];
|
|
21
|
+
};
|
|
22
|
+
type Coordinate = [number, number];
|
|
23
|
+
type PolygonGeometry = {
|
|
24
|
+
type: 'Polygon';
|
|
25
|
+
coordinates: Coordinate[][][];
|
|
26
|
+
};
|
|
27
|
+
type FeatureProperties = {
|
|
28
|
+
mode: 'rectangle' | 'angled-rectangle' | string;
|
|
29
|
+
color: string;
|
|
30
|
+
};
|
|
31
|
+
interface Feature {
|
|
32
|
+
type: 'Feature';
|
|
33
|
+
geometry: PolygonGeometry;
|
|
34
|
+
properties: FeatureProperties;
|
|
35
|
+
id: string;
|
|
36
|
+
}
|
|
37
|
+
export interface Geofence {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
color: string;
|
|
41
|
+
type_zone: 'safe' | 'danger';
|
|
42
|
+
definition: {
|
|
43
|
+
conditions: {
|
|
44
|
+
and: Condition[];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
geometry: Feature[];
|
|
48
|
+
}
|
|
49
|
+
export type GeofencesListResponse = ListResponse<Geofence>;
|
|
50
|
+
export interface GeofencesListParams extends ListParamsResponse {
|
|
51
|
+
name?: string;
|
|
52
|
+
}
|
|
53
|
+
export declare class Geofences extends APIResource {
|
|
54
|
+
list(params: GeofencesListParams, options?: Core.RequestOptions): Core.APIPromise<GeofencesListResponse>;
|
|
55
|
+
create(params: Omit<Geofence, 'id'>, options?: Core.RequestOptions): Core.APIPromise<Geofence>;
|
|
56
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Geofence>;
|
|
57
|
+
update(id: string, params: Omit<Geofence, 'id'>, options?: Core.RequestOptions): Core.APIPromise<Geofence>;
|
|
58
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
59
|
+
}
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=geofences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geofences.d.ts","sourceRoot":"","sources":["../../src/resources/telemetry/geofences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEnE,KAAK,SAAS,GACR;IAAE,YAAY,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAChD;IAAE,UAAU,EAAE,MAAM,EAAE,CAAA;CAAE,GACxB;IAAE,yBAAyB,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GAC9C;IAAE,GAAG,EAAE,SAAS,EAAE,CAAA;CAAE,GACpB;IAAE,EAAE,EAAE,SAAS,EAAE,CAAA;CAAE,GACnB;IAAE,GAAG,EAAE,SAAS,EAAE,CAAA;CAAE,CAAC;AAE3B,KAAK,UAAU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEnC,KAAK,eAAe,GAAG;IACnB,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;CACjC,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACrB,IAAI,EAAE,WAAW,GAAG,kBAAkB,GAAG,MAAM,CAAC;IAChD,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,UAAU,OAAO;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,eAAe,CAAC;IAC1B,UAAU,EAAE,iBAAiB,CAAC;IAC9B,EAAE,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC7B,UAAU,EAAE;QACR,UAAU,EAAE;YACR,GAAG,EAAE,SAAS,EAAE,CAAC;SACpB,CAAC;KACL,CAAC;IACF,QAAQ,EAAE,OAAO,EAAE,CAAC;CACvB;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;AAE3D,MAAM,WAAW,mBAAoB,SAAQ,kBAAkB;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,SAAU,SAAQ,WAAW;IACtC,IAAI,CAAC,MAAM,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC;IAQxG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAS9F,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAO9E,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAS1G,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;CAM3E"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Geofences = void 0;
|
|
4
|
+
const resource_1 = require("../../resource.js");
|
|
5
|
+
class Geofences extends resource_1.APIResource {
|
|
6
|
+
list(params, options) {
|
|
7
|
+
const { ...query } = params;
|
|
8
|
+
return this._client.get(`/telemetry/v1/geofences`, {
|
|
9
|
+
query,
|
|
10
|
+
...options,
|
|
11
|
+
headers: { ...options?.headers },
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
create(params, options) {
|
|
15
|
+
const { ...body } = params;
|
|
16
|
+
return this._client.post(`/telemetry/v1/geofences`, {
|
|
17
|
+
body,
|
|
18
|
+
...options,
|
|
19
|
+
headers: { ...options?.headers },
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
retrieve(id, options) {
|
|
23
|
+
return this._client.get(`/telemetry/v1/geofences/${id}`, {
|
|
24
|
+
...options,
|
|
25
|
+
headers: { ...options?.headers },
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
update(id, params, options) {
|
|
29
|
+
const { ...body } = params;
|
|
30
|
+
return this._client.put(`/telemetry/v1/geofences/${id}`, {
|
|
31
|
+
body,
|
|
32
|
+
...options,
|
|
33
|
+
headers: { ...options?.headers },
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
delete(id, options) {
|
|
37
|
+
return this._client.delete(`/telemetry/v1/geofences/${id}`, {
|
|
38
|
+
...options,
|
|
39
|
+
headers: { ...options?.headers },
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.Geofences = Geofences;
|
|
44
|
+
//# sourceMappingURL=geofences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geofences.js","sourceRoot":"","sources":["../../src/resources/telemetry/geofences.ts"],"names":[],"mappings":";;;AAAA,gDAA6C;AAkD7C,MAAa,SAAU,SAAQ,sBAAW;IACtC,IAAI,CAAC,MAA2B,EAAE,OAA6B;QAC3D,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE;YAC/C,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;IACD,MAAM,CAAC,MAA4B,EAAE,OAA6B;QAC9D,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE;YAChD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;IAED,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,EAAE;YACrD,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,MAA4B,EAAE,OAA6B;QAC1E,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,EAAE;YACrD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,OAA6B;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,2BAA2B,EAAE,EAAE,EAAE;YACxD,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;CACJ;AAxCD,8BAwCC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { APIResource } from "../../resource.mjs";
|
|
2
|
+
export class Geofences extends APIResource {
|
|
3
|
+
list(params, options) {
|
|
4
|
+
const { ...query } = params;
|
|
5
|
+
return this._client.get(`/telemetry/v1/geofences`, {
|
|
6
|
+
query,
|
|
7
|
+
...options,
|
|
8
|
+
headers: { ...options?.headers },
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
create(params, options) {
|
|
12
|
+
const { ...body } = params;
|
|
13
|
+
return this._client.post(`/telemetry/v1/geofences`, {
|
|
14
|
+
body,
|
|
15
|
+
...options,
|
|
16
|
+
headers: { ...options?.headers },
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
retrieve(id, options) {
|
|
20
|
+
return this._client.get(`/telemetry/v1/geofences/${id}`, {
|
|
21
|
+
...options,
|
|
22
|
+
headers: { ...options?.headers },
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
update(id, params, options) {
|
|
26
|
+
const { ...body } = params;
|
|
27
|
+
return this._client.put(`/telemetry/v1/geofences/${id}`, {
|
|
28
|
+
body,
|
|
29
|
+
...options,
|
|
30
|
+
headers: { ...options?.headers },
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
delete(id, options) {
|
|
34
|
+
return this._client.delete(`/telemetry/v1/geofences/${id}`, {
|
|
35
|
+
...options,
|
|
36
|
+
headers: { ...options?.headers },
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=geofences.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geofences.mjs","sourceRoot":"","sources":["../../src/resources/telemetry/geofences.ts"],"names":[],"mappings":"OAAO,EAAE,WAAW,EAAE;AAkDtB,MAAM,OAAO,SAAU,SAAQ,WAAW;IACtC,IAAI,CAAC,MAA2B,EAAE,OAA6B;QAC3D,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE;YAC/C,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;IACD,MAAM,CAAC,MAA4B,EAAE,OAA6B;QAC9D,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE;YAChD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;IAED,QAAQ,CAAC,EAAU,EAAE,OAA6B;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,EAAE;YACrD,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,MAA4B,EAAE,OAA6B;QAC1E,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,EAAE;YACrD,IAAI;YACJ,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,OAA6B;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,2BAA2B,EAAE,EAAE,EAAE;YACxD,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { APIResource } from '@space-df/sdk/resource';
|
|
2
2
|
import { Entities } from "./entities.js";
|
|
3
3
|
import { Alerts } from "./alerts.js";
|
|
4
|
+
import { Geofences } from "./geofences.js";
|
|
4
5
|
export declare class Telemetry extends APIResource {
|
|
5
6
|
entities: Entities;
|
|
6
7
|
alerts: Alerts;
|
|
8
|
+
geofences: Geofences;
|
|
7
9
|
}
|
|
8
10
|
export * from "./entities.js";
|
|
9
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/telemetry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/telemetry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,SAAU,SAAQ,WAAW;IACtC,QAAQ,EAAE,QAAQ,CAA8B;IAChD,MAAM,EAAE,MAAM,CAA4B;IAC1C,SAAS,EAAE,SAAS,CAA+B;CACtD;AAED,cAAc,YAAY,CAAC"}
|
|
@@ -18,11 +18,13 @@ exports.Telemetry = void 0;
|
|
|
18
18
|
const resource_1 = require("@space-df/sdk/resource");
|
|
19
19
|
const entities_1 = require("./entities.js");
|
|
20
20
|
const alerts_1 = require("./alerts.js");
|
|
21
|
+
const geofences_1 = require("./geofences.js");
|
|
21
22
|
class Telemetry extends resource_1.APIResource {
|
|
22
23
|
constructor() {
|
|
23
24
|
super(...arguments);
|
|
24
25
|
this.entities = new entities_1.Entities(this._client);
|
|
25
26
|
this.alerts = new alerts_1.Alerts(this._client);
|
|
27
|
+
this.geofences = new geofences_1.Geofences(this._client);
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
exports.Telemetry = Telemetry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/telemetry/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,4CAAsC;AACtC,wCAAkC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/telemetry/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,4CAAsC;AACtC,wCAAkC;AAClC,8CAAwC;AAExC,MAAa,SAAU,SAAQ,sBAAW;IAA1C;;QACI,aAAQ,GAAa,IAAI,mBAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChD,WAAM,GAAW,IAAI,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,cAAS,GAAc,IAAI,qBAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;CAAA;AAJD,8BAIC;AAED,gDAA2B"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { APIResource } from '@space-df/sdk/resource';
|
|
2
2
|
import { Entities } from "./entities.mjs";
|
|
3
3
|
import { Alerts } from "./alerts.mjs";
|
|
4
|
+
import { Geofences } from "./geofences.mjs";
|
|
4
5
|
export class Telemetry extends APIResource {
|
|
5
6
|
constructor() {
|
|
6
7
|
super(...arguments);
|
|
7
8
|
this.entities = new Entities(this._client);
|
|
8
9
|
this.alerts = new Alerts(this._client);
|
|
10
|
+
this.geofences = new Geofences(this._client);
|
|
9
11
|
}
|
|
10
12
|
}
|
|
11
13
|
export * from "./entities.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/telemetry/index.ts"],"names":[],"mappings":"OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB;OAC7C,EAAE,QAAQ,EAAE;OACZ,EAAE,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/telemetry/index.ts"],"names":[],"mappings":"OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB;OAC7C,EAAE,QAAQ,EAAE;OACZ,EAAE,MAAM,EAAE;OACV,EAAE,SAAS,EAAE;AAEpB,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QACI,aAAQ,GAAa,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChD,WAAM,GAAW,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,cAAS,GAAc,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;CAAA"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { APIResource } from '../../resource';
|
|
2
|
+
import * as Core from '../../core';
|
|
3
|
+
import { ListParamsResponse, ListResponse } from '../../types/api';
|
|
4
|
+
|
|
5
|
+
type Condition =
|
|
6
|
+
| { time_between: { start: string; end: string } }
|
|
7
|
+
| { weekday_in: number[] }
|
|
8
|
+
| { distance_from_geofence_km: { lte: number } }
|
|
9
|
+
| { and: Condition[] }
|
|
10
|
+
| { or: Condition[] }
|
|
11
|
+
| { not: Condition[] };
|
|
12
|
+
|
|
13
|
+
type Coordinate = [number, number];
|
|
14
|
+
|
|
15
|
+
type PolygonGeometry = {
|
|
16
|
+
type: 'Polygon';
|
|
17
|
+
coordinates: Coordinate[][][];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type FeatureProperties = {
|
|
21
|
+
mode: 'rectangle' | 'angled-rectangle' | string;
|
|
22
|
+
color: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
interface Feature {
|
|
26
|
+
type: 'Feature';
|
|
27
|
+
geometry: PolygonGeometry;
|
|
28
|
+
properties: FeatureProperties;
|
|
29
|
+
id: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface Geofence {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
color: string;
|
|
36
|
+
type_zone: 'safe' | 'danger';
|
|
37
|
+
definition: {
|
|
38
|
+
conditions: {
|
|
39
|
+
and: Condition[];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
geometry: Feature[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type GeofencesListResponse = ListResponse<Geofence>;
|
|
46
|
+
|
|
47
|
+
export interface GeofencesListParams extends ListParamsResponse {
|
|
48
|
+
name?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export class Geofences extends APIResource {
|
|
52
|
+
list(params: GeofencesListParams, options?: Core.RequestOptions): Core.APIPromise<GeofencesListResponse> {
|
|
53
|
+
const { ...query } = params;
|
|
54
|
+
return this._client.get(`/telemetry/v1/geofences`, {
|
|
55
|
+
query,
|
|
56
|
+
...options,
|
|
57
|
+
headers: { ...options?.headers },
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
create(params: Omit<Geofence, 'id'>, options?: Core.RequestOptions): Core.APIPromise<Geofence> {
|
|
61
|
+
const { ...body } = params;
|
|
62
|
+
return this._client.post(`/telemetry/v1/geofences`, {
|
|
63
|
+
body,
|
|
64
|
+
...options,
|
|
65
|
+
headers: { ...options?.headers },
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Geofence> {
|
|
70
|
+
return this._client.get(`/telemetry/v1/geofences/${id}`, {
|
|
71
|
+
...options,
|
|
72
|
+
headers: { ...options?.headers },
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
update(id: string, params: Omit<Geofence, 'id'>, options?: Core.RequestOptions): Core.APIPromise<Geofence> {
|
|
77
|
+
const { ...body } = params;
|
|
78
|
+
return this._client.put(`/telemetry/v1/geofences/${id}`, {
|
|
79
|
+
body,
|
|
80
|
+
...options,
|
|
81
|
+
headers: { ...options?.headers },
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
86
|
+
return this._client.delete(`/telemetry/v1/geofences/${id}`, {
|
|
87
|
+
...options,
|
|
88
|
+
headers: { ...options?.headers },
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { APIResource } from "../../resource";
|
|
2
2
|
import { Entities } from './entities';
|
|
3
3
|
import { Alerts } from './alerts';
|
|
4
|
+
import { Geofences } from './geofences';
|
|
4
5
|
|
|
5
6
|
export class Telemetry extends APIResource {
|
|
6
7
|
entities: Entities = new Entities(this._client);
|
|
7
8
|
alerts: Alerts = new Alerts(this._client);
|
|
9
|
+
geofences: Geofences = new Geofences(this._client);
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
export * from './entities';
|
package/dist/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.0.1-dev.
|
|
1
|
+
export const VERSION = '0.0.1-dev.38';
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.0.1-dev.
|
|
1
|
+
export declare const VERSION = "0.0.1-dev.38";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
package/dist/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.0.1-dev.
|
|
1
|
+
export const VERSION = '0.0.1-dev.38';
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/package.json
CHANGED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { APIResource } from '../../resource';
|
|
2
|
+
import * as Core from '../../core';
|
|
3
|
+
import { ListParamsResponse, ListResponse } from '../../types/api';
|
|
4
|
+
|
|
5
|
+
type Condition =
|
|
6
|
+
| { time_between: { start: string; end: string } }
|
|
7
|
+
| { weekday_in: number[] }
|
|
8
|
+
| { distance_from_geofence_km: { lte: number } }
|
|
9
|
+
| { and: Condition[] }
|
|
10
|
+
| { or: Condition[] }
|
|
11
|
+
| { not: Condition[] };
|
|
12
|
+
|
|
13
|
+
type Coordinate = [number, number];
|
|
14
|
+
|
|
15
|
+
type PolygonGeometry = {
|
|
16
|
+
type: 'Polygon';
|
|
17
|
+
coordinates: Coordinate[][][];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type FeatureProperties = {
|
|
21
|
+
mode: 'rectangle' | 'angled-rectangle' | string;
|
|
22
|
+
color: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
interface Feature {
|
|
26
|
+
type: 'Feature';
|
|
27
|
+
geometry: PolygonGeometry;
|
|
28
|
+
properties: FeatureProperties;
|
|
29
|
+
id: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface Geofence {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
color: string;
|
|
36
|
+
type_zone: 'safe' | 'danger';
|
|
37
|
+
definition: {
|
|
38
|
+
conditions: {
|
|
39
|
+
and: Condition[];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
geometry: Feature[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type GeofencesListResponse = ListResponse<Geofence>;
|
|
46
|
+
|
|
47
|
+
export interface GeofencesListParams extends ListParamsResponse {
|
|
48
|
+
name?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export class Geofences extends APIResource {
|
|
52
|
+
list(params: GeofencesListParams, options?: Core.RequestOptions): Core.APIPromise<GeofencesListResponse> {
|
|
53
|
+
const { ...query } = params;
|
|
54
|
+
return this._client.get(`/telemetry/v1/geofences`, {
|
|
55
|
+
query,
|
|
56
|
+
...options,
|
|
57
|
+
headers: { ...options?.headers },
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
create(params: Omit<Geofence, 'id'>, options?: Core.RequestOptions): Core.APIPromise<Geofence> {
|
|
61
|
+
const { ...body } = params;
|
|
62
|
+
return this._client.post(`/telemetry/v1/geofences`, {
|
|
63
|
+
body,
|
|
64
|
+
...options,
|
|
65
|
+
headers: { ...options?.headers },
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Geofence> {
|
|
70
|
+
return this._client.get(`/telemetry/v1/geofences/${id}`, {
|
|
71
|
+
...options,
|
|
72
|
+
headers: { ...options?.headers },
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
update(id: string, params: Omit<Geofence, 'id'>, options?: Core.RequestOptions): Core.APIPromise<Geofence> {
|
|
77
|
+
const { ...body } = params;
|
|
78
|
+
return this._client.put(`/telemetry/v1/geofences/${id}`, {
|
|
79
|
+
body,
|
|
80
|
+
...options,
|
|
81
|
+
headers: { ...options?.headers },
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
86
|
+
return this._client.delete(`/telemetry/v1/geofences/${id}`, {
|
|
87
|
+
...options,
|
|
88
|
+
headers: { ...options?.headers },
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { APIResource } from '@space-df/sdk/resource';
|
|
2
2
|
import { Entities } from './entities';
|
|
3
3
|
import { Alerts } from './alerts';
|
|
4
|
+
import { Geofences } from './geofences';
|
|
4
5
|
|
|
5
6
|
export class Telemetry extends APIResource {
|
|
6
7
|
entities: Entities = new Entities(this._client);
|
|
7
8
|
alerts: Alerts = new Alerts(this._client);
|
|
9
|
+
geofences: Geofences = new Geofences(this._client);
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
export * from './entities';
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.0.1-dev.
|
|
1
|
+
export const VERSION = '0.0.1-dev.38';
|