@space-df/sdk 0.0.1-dev.43 → 0.0.1-dev.45
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 +244 -1
- package/dist/package.json +1 -1
- package/dist/resources/telemetry/actions.d.ts +23 -0
- package/dist/resources/telemetry/actions.d.ts.map +1 -0
- package/dist/resources/telemetry/actions.js +16 -0
- package/dist/resources/telemetry/actions.js.map +1 -0
- package/dist/resources/telemetry/actions.mjs +12 -0
- package/dist/resources/telemetry/actions.mjs.map +1 -0
- package/dist/resources/telemetry/automations.d.ts +65 -0
- package/dist/resources/telemetry/automations.d.ts.map +1 -0
- package/dist/resources/telemetry/automations.js +44 -0
- package/dist/resources/telemetry/automations.js.map +1 -0
- package/dist/resources/telemetry/automations.mjs +40 -0
- package/dist/resources/telemetry/automations.mjs.map +1 -0
- package/dist/resources/telemetry/index.d.ts +4 -0
- package/dist/resources/telemetry/index.d.ts.map +1 -1
- package/dist/resources/telemetry/index.js +4 -0
- package/dist/resources/telemetry/index.js.map +1 -1
- package/dist/resources/telemetry/index.mjs +4 -0
- package/dist/resources/telemetry/index.mjs.map +1 -1
- package/dist/src/resources/telemetry/actions.ts +33 -0
- package/dist/src/resources/telemetry/automations.ts +99 -0
- package/dist/src/resources/telemetry/index.ts +4 -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/actions.ts +33 -0
- package/src/resources/telemetry/automations.ts +99 -0
- package/src/resources/telemetry/index.ts +4 -0
- package/src/version.ts +1 -1
package/api.doc.md
CHANGED
|
@@ -3012,7 +3012,7 @@ await client.trip.delete('trip-uuid-456');
|
|
|
3012
3012
|
|
|
3013
3013
|
## Overview
|
|
3014
3014
|
|
|
3015
|
-
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, test).
|
|
3015
|
+
The `Telemetry` class provides methods for retrieving telemetry entities, alerts, events, automations, actions, and geofences. This class allows you to search and filter telemetry entities by display type and search terms, retrieve alerts, query events by device, list telemetry actions, manage automations (list, create, retrieve, update, delete), and manage geofences (list, create, retrieve, update, delete, test).
|
|
3016
3016
|
|
|
3017
3017
|
## Methods
|
|
3018
3018
|
|
|
@@ -3121,6 +3121,249 @@ console.log(alerts.count);
|
|
|
3121
3121
|
|
|
3122
3122
|
</details>
|
|
3123
3123
|
|
|
3124
|
+
<details>
|
|
3125
|
+
<summary><strong>automations.list</strong></summary>
|
|
3126
|
+
|
|
3127
|
+
List telemetry automations with optional filtering and pagination.
|
|
3128
|
+
|
|
3129
|
+
**Signature:**
|
|
3130
|
+
|
|
3131
|
+
```typescript
|
|
3132
|
+
list(params: AutomationsListParams, options?: Core.RequestOptions): Core.APIPromise<AutomationsListResponse>
|
|
3133
|
+
```
|
|
3134
|
+
|
|
3135
|
+
**Parameters:**
|
|
3136
|
+
|
|
3137
|
+
- `params` _(AutomationsListParams)_: Query parameters for filtering and pagination:
|
|
3138
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
3139
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
3140
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
3141
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
3142
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3143
|
+
|
|
3144
|
+
**Returns:** `Promise<AutomationsListResponse>`
|
|
3145
|
+
|
|
3146
|
+
**Response shape:**
|
|
3147
|
+
|
|
3148
|
+
- `count` _(integer)_: Total number of automations matching the query.
|
|
3149
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
3150
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
3151
|
+
- `results` _(Automation[])_: Array of automation objects.
|
|
3152
|
+
|
|
3153
|
+
**Example:**
|
|
3154
|
+
|
|
3155
|
+
```typescript
|
|
3156
|
+
const automations = await client.telemetry.automations.list({
|
|
3157
|
+
search: 'Low Battery',
|
|
3158
|
+
limit: 10,
|
|
3159
|
+
offset: 0,
|
|
3160
|
+
});
|
|
3161
|
+
console.log(automations.results);
|
|
3162
|
+
```
|
|
3163
|
+
|
|
3164
|
+
</details>
|
|
3165
|
+
|
|
3166
|
+
<details>
|
|
3167
|
+
<summary><strong>automations.create</strong></summary>
|
|
3168
|
+
|
|
3169
|
+
Create a new telemetry automation.
|
|
3170
|
+
|
|
3171
|
+
**Signature:**
|
|
3172
|
+
|
|
3173
|
+
```typescript
|
|
3174
|
+
create(params: AutomationParams, options?: Core.RequestOptions): Core.APIPromise<Automation>
|
|
3175
|
+
```
|
|
3176
|
+
|
|
3177
|
+
**Parameters:**
|
|
3178
|
+
|
|
3179
|
+
- `params` _(AutomationParams)_: Automation payload:
|
|
3180
|
+
- `name` _(string)_: The automation name.
|
|
3181
|
+
- `device_id` _(string)_: Device UUID that this automation applies to.
|
|
3182
|
+
- `action_ids` _(string[])_: Action IDs to execute when the rule is triggered.
|
|
3183
|
+
- `event_rule` _(AutomationEventRule)_: Event rule definition:
|
|
3184
|
+
- `rule_key` _(string)_: Rule key identifier.
|
|
3185
|
+
- `definition.conditions.and` _(AutomationRuleCondition[])_: Rule conditions.
|
|
3186
|
+
- `is_active` _(boolean)_: Whether the rule is currently active.
|
|
3187
|
+
- `repeat_able` _(boolean)_: Whether the rule can repeat.
|
|
3188
|
+
- `cooldown_sec` _(number)_: Cooldown time in seconds.
|
|
3189
|
+
- `description` _(string)_: Human-readable rule description.
|
|
3190
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3191
|
+
|
|
3192
|
+
**Returns:** `Promise<Automation>`
|
|
3193
|
+
|
|
3194
|
+
**Example:**
|
|
3195
|
+
|
|
3196
|
+
```typescript
|
|
3197
|
+
const automation = await client.telemetry.automations.create({
|
|
3198
|
+
name: 'Low Battery Alert',
|
|
3199
|
+
device_id: 'device-uuid-123',
|
|
3200
|
+
action_ids: ['action-uuid-1'],
|
|
3201
|
+
event_rule: {
|
|
3202
|
+
rule_key: 'battery_low',
|
|
3203
|
+
definition: {
|
|
3204
|
+
conditions: {
|
|
3205
|
+
and: [{ battery: { lte: 20 } }],
|
|
3206
|
+
},
|
|
3207
|
+
},
|
|
3208
|
+
is_active: true,
|
|
3209
|
+
repeat_able: true,
|
|
3210
|
+
cooldown_sec: 300,
|
|
3211
|
+
description: 'Trigger when battery is less than or equal to 20%',
|
|
3212
|
+
},
|
|
3213
|
+
});
|
|
3214
|
+
console.log(automation.id);
|
|
3215
|
+
```
|
|
3216
|
+
|
|
3217
|
+
</details>
|
|
3218
|
+
|
|
3219
|
+
<details>
|
|
3220
|
+
<summary><strong>automations.retrieve</strong></summary>
|
|
3221
|
+
|
|
3222
|
+
Retrieve an automation by its ID.
|
|
3223
|
+
|
|
3224
|
+
**Signature:**
|
|
3225
|
+
|
|
3226
|
+
```typescript
|
|
3227
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Automation>
|
|
3228
|
+
```
|
|
3229
|
+
|
|
3230
|
+
**Parameters:**
|
|
3231
|
+
|
|
3232
|
+
- `id` _(string)_: The unique identifier of the automation to retrieve.
|
|
3233
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3234
|
+
|
|
3235
|
+
**Returns:** `Promise<Automation>`
|
|
3236
|
+
|
|
3237
|
+
**Example:**
|
|
3238
|
+
|
|
3239
|
+
```typescript
|
|
3240
|
+
const automation = await client.telemetry.automations.retrieve('automation-uuid-123');
|
|
3241
|
+
console.log(automation.name);
|
|
3242
|
+
```
|
|
3243
|
+
|
|
3244
|
+
</details>
|
|
3245
|
+
|
|
3246
|
+
<details>
|
|
3247
|
+
<summary><strong>automations.update</strong></summary>
|
|
3248
|
+
|
|
3249
|
+
Update an existing automation by its ID (full update).
|
|
3250
|
+
|
|
3251
|
+
**Signature:**
|
|
3252
|
+
|
|
3253
|
+
```typescript
|
|
3254
|
+
update(id: string, params: AutomationParams, options?: Core.RequestOptions): Core.APIPromise<Automation>
|
|
3255
|
+
```
|
|
3256
|
+
|
|
3257
|
+
**Parameters:**
|
|
3258
|
+
|
|
3259
|
+
- `id` _(string)_: The unique identifier of the automation to update.
|
|
3260
|
+
- `params` _(AutomationParams)_: Updated automation payload.
|
|
3261
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3262
|
+
|
|
3263
|
+
**Returns:** `Promise<Automation>`
|
|
3264
|
+
|
|
3265
|
+
**Example:**
|
|
3266
|
+
|
|
3267
|
+
```typescript
|
|
3268
|
+
const updated = await client.telemetry.automations.update('automation-uuid-123', {
|
|
3269
|
+
name: 'Low Battery Alert Updated',
|
|
3270
|
+
device_id: 'device-uuid-123',
|
|
3271
|
+
action_ids: ['action-uuid-1', 'action-uuid-2'],
|
|
3272
|
+
event_rule: {
|
|
3273
|
+
rule_key: 'battery_low',
|
|
3274
|
+
definition: {
|
|
3275
|
+
conditions: {
|
|
3276
|
+
and: [{ battery: { lte: 15 } }],
|
|
3277
|
+
},
|
|
3278
|
+
},
|
|
3279
|
+
is_active: true,
|
|
3280
|
+
repeat_able: true,
|
|
3281
|
+
cooldown_sec: 180,
|
|
3282
|
+
description: 'Trigger when battery is less than or equal to 15%',
|
|
3283
|
+
},
|
|
3284
|
+
});
|
|
3285
|
+
console.log(updated.updated_at);
|
|
3286
|
+
```
|
|
3287
|
+
|
|
3288
|
+
</details>
|
|
3289
|
+
|
|
3290
|
+
<details>
|
|
3291
|
+
<summary><strong>automations.delete</strong></summary>
|
|
3292
|
+
|
|
3293
|
+
Delete an automation by its ID.
|
|
3294
|
+
|
|
3295
|
+
**Signature:**
|
|
3296
|
+
|
|
3297
|
+
```typescript
|
|
3298
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
3299
|
+
```
|
|
3300
|
+
|
|
3301
|
+
**Parameters:**
|
|
3302
|
+
|
|
3303
|
+
- `id` _(string)_: The unique identifier of the automation to delete.
|
|
3304
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3305
|
+
|
|
3306
|
+
**Returns:** `Promise<void>`
|
|
3307
|
+
|
|
3308
|
+
**Example:**
|
|
3309
|
+
|
|
3310
|
+
```typescript
|
|
3311
|
+
await client.telemetry.automations.delete('automation-uuid-123');
|
|
3312
|
+
```
|
|
3313
|
+
|
|
3314
|
+
</details>
|
|
3315
|
+
|
|
3316
|
+
<details>
|
|
3317
|
+
<summary><strong>actions.list</strong></summary>
|
|
3318
|
+
|
|
3319
|
+
List telemetry actions with optional filtering and pagination.
|
|
3320
|
+
|
|
3321
|
+
**Signature:**
|
|
3322
|
+
|
|
3323
|
+
```typescript
|
|
3324
|
+
list(params: ActionsListParams, options?: Core.RequestOptions): Core.APIPromise<ActionsListResponse>
|
|
3325
|
+
```
|
|
3326
|
+
|
|
3327
|
+
**Parameters:**
|
|
3328
|
+
|
|
3329
|
+
- `params` _(ActionsListParams)_: Query parameters for filtering and pagination:
|
|
3330
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
3331
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
3332
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
3333
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
3334
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3335
|
+
|
|
3336
|
+
**Returns:** `Promise<ActionsListResponse>`
|
|
3337
|
+
|
|
3338
|
+
**Response shape:**
|
|
3339
|
+
|
|
3340
|
+
- `count` _(integer)_: Total number of actions matching the query.
|
|
3341
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
3342
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
3343
|
+
- `results` _(Action[])_: Array of action objects.
|
|
3344
|
+
|
|
3345
|
+
**Action shape:**
|
|
3346
|
+
|
|
3347
|
+
- `id` _(string)_: Action UUID.
|
|
3348
|
+
- `name` _(string)_: Action name.
|
|
3349
|
+
- `created_at` _(string, optional)_: Creation timestamp.
|
|
3350
|
+
- `data` _(object)_: Action payload:
|
|
3351
|
+
- `channel` _(string)_: Channel identifier.
|
|
3352
|
+
- `message` _(string)_: Message content.
|
|
3353
|
+
|
|
3354
|
+
**Example:**
|
|
3355
|
+
|
|
3356
|
+
```typescript
|
|
3357
|
+
const actions = await client.telemetry.actions.list({
|
|
3358
|
+
search: 'battery',
|
|
3359
|
+
limit: 10,
|
|
3360
|
+
offset: 0,
|
|
3361
|
+
});
|
|
3362
|
+
console.log(actions.results);
|
|
3363
|
+
```
|
|
3364
|
+
|
|
3365
|
+
</details>
|
|
3366
|
+
|
|
3124
3367
|
<details>
|
|
3125
3368
|
<summary><strong>events.list</strong></summary>
|
|
3126
3369
|
|
package/dist/package.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { APIResource } from "../../resource.js";
|
|
2
|
+
import * as Core from "../../core.js";
|
|
3
|
+
import { ListParamsResponse, ListResponse } from "../../types/api.js";
|
|
4
|
+
export interface Action {
|
|
5
|
+
created_at?: string;
|
|
6
|
+
data: {
|
|
7
|
+
channel: string;
|
|
8
|
+
message: string;
|
|
9
|
+
};
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
key: string;
|
|
13
|
+
}
|
|
14
|
+
export type ActionsListResponse = ListResponse<Action>;
|
|
15
|
+
export interface ActionsListParams extends ListParamsResponse {
|
|
16
|
+
limit?: number;
|
|
17
|
+
offset?: number;
|
|
18
|
+
search?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare class Actions extends APIResource {
|
|
21
|
+
list(params: ActionsListParams, options?: Core.RequestOptions): Core.APIPromise<ActionsListResponse>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=actions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/resources/telemetry/actions.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,MAAM,WAAW,MAAM;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE;QACF,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;AAEvD,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,OAAQ,SAAQ,WAAW;IACpC,IAAI,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC;CAQvG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Actions = void 0;
|
|
4
|
+
const resource_1 = require("../../resource.js");
|
|
5
|
+
class Actions extends resource_1.APIResource {
|
|
6
|
+
list(params, options) {
|
|
7
|
+
const { ...query } = params;
|
|
8
|
+
return this._client.get(`/telemetry/v1/actions`, {
|
|
9
|
+
query,
|
|
10
|
+
...options,
|
|
11
|
+
headers: { ...options?.headers },
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Actions = Actions;
|
|
16
|
+
//# sourceMappingURL=actions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../src/resources/telemetry/actions.ts"],"names":[],"mappings":";;;AAAA,gDAA6C;AAuB7C,MAAa,OAAQ,SAAQ,sBAAW;IACpC,IAAI,CAAC,MAAyB,EAAE,OAA6B;QACzD,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE;YAC7C,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;CACJ;AATD,0BASC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { APIResource } from "../../resource.mjs";
|
|
2
|
+
export class Actions extends APIResource {
|
|
3
|
+
list(params, options) {
|
|
4
|
+
const { ...query } = params;
|
|
5
|
+
return this._client.get(`/telemetry/v1/actions`, {
|
|
6
|
+
query,
|
|
7
|
+
...options,
|
|
8
|
+
headers: { ...options?.headers },
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=actions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.mjs","sourceRoot":"","sources":["../../src/resources/telemetry/actions.ts"],"names":[],"mappings":"OAAO,EAAE,WAAW,EAAE;AAuBtB,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACpC,IAAI,CAAC,MAAyB,EAAE,OAA6B;QACzD,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE;YAC7C,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { APIResource } from "../../resource.js";
|
|
2
|
+
import * as Core from "../../core.js";
|
|
3
|
+
import { ListParamsResponse, ListResponse } from "../../types/api.js";
|
|
4
|
+
export type AutomationRuleCondition = {
|
|
5
|
+
weekday_between: {
|
|
6
|
+
from: number;
|
|
7
|
+
to: number;
|
|
8
|
+
};
|
|
9
|
+
} | {
|
|
10
|
+
battery: Record<string, number>;
|
|
11
|
+
} | {
|
|
12
|
+
and: AutomationRuleCondition[];
|
|
13
|
+
} | {
|
|
14
|
+
or: AutomationRuleCondition[];
|
|
15
|
+
} | {
|
|
16
|
+
not: AutomationRuleCondition[];
|
|
17
|
+
};
|
|
18
|
+
export interface AutomationEventRule {
|
|
19
|
+
rule_key: string;
|
|
20
|
+
definition: {
|
|
21
|
+
conditions: {
|
|
22
|
+
and: AutomationRuleCondition[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
is_active: boolean;
|
|
26
|
+
repeat_able: boolean;
|
|
27
|
+
cooldown_sec: number;
|
|
28
|
+
description: string;
|
|
29
|
+
}
|
|
30
|
+
/** Expanded action as returned on automation resources (e.g. list/retrieve). */
|
|
31
|
+
export interface AutomationAction {
|
|
32
|
+
id: string;
|
|
33
|
+
key: string;
|
|
34
|
+
name: string;
|
|
35
|
+
data: Record<string, unknown>;
|
|
36
|
+
created_at: string;
|
|
37
|
+
}
|
|
38
|
+
export interface Automation {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
device_id: string;
|
|
42
|
+
actions: AutomationAction[];
|
|
43
|
+
event_rule?: AutomationEventRule;
|
|
44
|
+
created_at: string;
|
|
45
|
+
updated_at: string;
|
|
46
|
+
}
|
|
47
|
+
/** Body for `create` and `update`; actions are referenced by id. */
|
|
48
|
+
export interface AutomationParams {
|
|
49
|
+
name: string;
|
|
50
|
+
device_id: string;
|
|
51
|
+
action_ids: string[];
|
|
52
|
+
event_rule: AutomationEventRule;
|
|
53
|
+
}
|
|
54
|
+
export type AutomationsListResponse = ListResponse<Automation>;
|
|
55
|
+
export interface AutomationsListParams extends ListParamsResponse {
|
|
56
|
+
search?: string;
|
|
57
|
+
}
|
|
58
|
+
export declare class Automations extends APIResource {
|
|
59
|
+
list(params: AutomationsListParams, options?: Core.RequestOptions): Core.APIPromise<AutomationsListResponse>;
|
|
60
|
+
create(params: AutomationParams, options?: Core.RequestOptions): Core.APIPromise<Automation>;
|
|
61
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Automation>;
|
|
62
|
+
update(id: string, params: AutomationParams, options?: Core.RequestOptions): Core.APIPromise<Automation>;
|
|
63
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=automations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automations.d.ts","sourceRoot":"","sources":["../../src/resources/telemetry/automations.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,MAAM,MAAM,uBAAuB,GAC7B;IAAE,eAAe,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,GACjD;IAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GACnC;IAAE,GAAG,EAAE,uBAAuB,EAAE,CAAA;CAAE,GAClC;IAAE,EAAE,EAAE,uBAAuB,EAAE,CAAA;CAAE,GACjC;IAAE,GAAG,EAAE,uBAAuB,EAAE,CAAA;CAAE,CAAC;AAEzC,MAAM,WAAW,mBAAmB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE;QACR,UAAU,EAAE;YACR,GAAG,EAAE,uBAAuB,EAAE,CAAC;SAClC,CAAC;KACL,CAAC;IACF,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,gFAAgF;AAChF,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,UAAU;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,oEAAoE;AACpE,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,mBAAmB,CAAC;CACnC;AAED,MAAM,MAAM,uBAAuB,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;AAE/D,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,WAAY,SAAQ,WAAW;IACxC,IAAI,CAAC,MAAM,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,uBAAuB,CAAC;IAS5G,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IAS5F,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IAOhF,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;IASxG,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.Automations = void 0;
|
|
4
|
+
const resource_1 = require("../../resource.js");
|
|
5
|
+
class Automations extends resource_1.APIResource {
|
|
6
|
+
list(params, options) {
|
|
7
|
+
const { ...query } = params;
|
|
8
|
+
return this._client.get(`/telemetry/v1/automations`, {
|
|
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/automations`, {
|
|
17
|
+
body,
|
|
18
|
+
...options,
|
|
19
|
+
headers: { ...options?.headers },
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
retrieve(id, options) {
|
|
23
|
+
return this._client.get(`/telemetry/v1/automations/${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/automations/${id}`, {
|
|
31
|
+
body,
|
|
32
|
+
...options,
|
|
33
|
+
headers: { ...options?.headers },
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
delete(id, options) {
|
|
37
|
+
return this._client.delete(`/telemetry/v1/automations/${id}`, {
|
|
38
|
+
...options,
|
|
39
|
+
headers: { ...options?.headers },
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.Automations = Automations;
|
|
44
|
+
//# sourceMappingURL=automations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automations.js","sourceRoot":"","sources":["../../src/resources/telemetry/automations.ts"],"names":[],"mappings":";;;AAAA,gDAA6C;AAyD7C,MAAa,WAAY,SAAQ,sBAAW;IACxC,IAAI,CAAC,MAA6B,EAAE,OAA6B;QAC7D,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE;YACjD,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,MAAwB,EAAE,OAA6B;QAC1D,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE;YAClD,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,6BAA6B,EAAE,EAAE,EAAE;YACvD,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,MAAwB,EAAE,OAA6B;QACtE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,EAAE,EAAE;YACvD,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,6BAA6B,EAAE,EAAE,EAAE;YAC1D,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;CACJ;AAzCD,kCAyCC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { APIResource } from "../../resource.mjs";
|
|
2
|
+
export class Automations extends APIResource {
|
|
3
|
+
list(params, options) {
|
|
4
|
+
const { ...query } = params;
|
|
5
|
+
return this._client.get(`/telemetry/v1/automations`, {
|
|
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/automations`, {
|
|
14
|
+
body,
|
|
15
|
+
...options,
|
|
16
|
+
headers: { ...options?.headers },
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
retrieve(id, options) {
|
|
20
|
+
return this._client.get(`/telemetry/v1/automations/${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/automations/${id}`, {
|
|
28
|
+
body,
|
|
29
|
+
...options,
|
|
30
|
+
headers: { ...options?.headers },
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
delete(id, options) {
|
|
34
|
+
return this._client.delete(`/telemetry/v1/automations/${id}`, {
|
|
35
|
+
...options,
|
|
36
|
+
headers: { ...options?.headers },
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=automations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automations.mjs","sourceRoot":"","sources":["../../src/resources/telemetry/automations.ts"],"names":[],"mappings":"OAAO,EAAE,WAAW,EAAE;AAyDtB,MAAM,OAAO,WAAY,SAAQ,WAAW;IACxC,IAAI,CAAC,MAA6B,EAAE,OAA6B;QAC7D,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE;YACjD,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,MAAwB,EAAE,OAA6B;QAC1D,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE;YAClD,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,6BAA6B,EAAE,EAAE,EAAE;YACvD,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;IAED,MAAM,CAAC,EAAU,EAAE,MAAwB,EAAE,OAA6B;QACtE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,EAAE,EAAE;YACvD,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,6BAA6B,EAAE,EAAE,EAAE;YAC1D,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SACnC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -2,11 +2,15 @@ import { APIResource } from '@space-df/sdk/resource';
|
|
|
2
2
|
import { Entities } from "./entities.js";
|
|
3
3
|
import { Alerts } from "./alerts.js";
|
|
4
4
|
import { Geofences } from "./geofences.js";
|
|
5
|
+
import { Automations } from "./automations.js";
|
|
5
6
|
import { Events } from "./events.js";
|
|
7
|
+
import { Actions } from "./actions.js";
|
|
6
8
|
export declare class Telemetry extends APIResource {
|
|
7
9
|
entities: Entities;
|
|
8
10
|
alerts: Alerts;
|
|
9
11
|
geofences: Geofences;
|
|
12
|
+
automations: Automations;
|
|
10
13
|
events: Events;
|
|
14
|
+
actions: Actions;
|
|
11
15
|
}
|
|
12
16
|
//# 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;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,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;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,qBAAa,SAAU,SAAQ,WAAW;IACtC,QAAQ,EAAE,QAAQ,CAA8B;IAChD,MAAM,EAAE,MAAM,CAA4B;IAC1C,SAAS,EAAE,SAAS,CAA+B;IACnD,WAAW,EAAE,WAAW,CAAiC;IACzD,MAAM,EAAE,MAAM,CAA4B;IAC1C,OAAO,EAAE,OAAO,CAA6B;CAChD"}
|
|
@@ -5,14 +5,18 @@ const resource_1 = require("@space-df/sdk/resource");
|
|
|
5
5
|
const entities_1 = require("./entities.js");
|
|
6
6
|
const alerts_1 = require("./alerts.js");
|
|
7
7
|
const geofences_1 = require("./geofences.js");
|
|
8
|
+
const automations_1 = require("./automations.js");
|
|
8
9
|
const events_1 = require("./events.js");
|
|
10
|
+
const actions_1 = require("./actions.js");
|
|
9
11
|
class Telemetry extends resource_1.APIResource {
|
|
10
12
|
constructor() {
|
|
11
13
|
super(...arguments);
|
|
12
14
|
this.entities = new entities_1.Entities(this._client);
|
|
13
15
|
this.alerts = new alerts_1.Alerts(this._client);
|
|
14
16
|
this.geofences = new geofences_1.Geofences(this._client);
|
|
17
|
+
this.automations = new automations_1.Automations(this._client);
|
|
15
18
|
this.events = new events_1.Events(this._client);
|
|
19
|
+
this.actions = new actions_1.Actions(this._client);
|
|
16
20
|
}
|
|
17
21
|
}
|
|
18
22
|
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;AAClC,8CAAwC;AACxC,wCAAkC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/telemetry/index.ts"],"names":[],"mappings":";;;AAAA,qDAAqD;AACrD,4CAAsC;AACtC,wCAAkC;AAClC,8CAAwC;AACxC,kDAA4C;AAC5C,wCAAkC;AAClC,0CAAoC;AAEpC,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;QACnD,gBAAW,GAAgB,IAAI,yBAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,WAAM,GAAW,IAAI,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,YAAO,GAAY,IAAI,iBAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;CAAA;AAPD,8BAOC"}
|
|
@@ -2,14 +2,18 @@ import { APIResource } from '@space-df/sdk/resource';
|
|
|
2
2
|
import { Entities } from "./entities.mjs";
|
|
3
3
|
import { Alerts } from "./alerts.mjs";
|
|
4
4
|
import { Geofences } from "./geofences.mjs";
|
|
5
|
+
import { Automations } from "./automations.mjs";
|
|
5
6
|
import { Events } from "./events.mjs";
|
|
7
|
+
import { Actions } from "./actions.mjs";
|
|
6
8
|
export class Telemetry extends APIResource {
|
|
7
9
|
constructor() {
|
|
8
10
|
super(...arguments);
|
|
9
11
|
this.entities = new Entities(this._client);
|
|
10
12
|
this.alerts = new Alerts(this._client);
|
|
11
13
|
this.geofences = new Geofences(this._client);
|
|
14
|
+
this.automations = new Automations(this._client);
|
|
12
15
|
this.events = new Events(this._client);
|
|
16
|
+
this.actions = new Actions(this._client);
|
|
13
17
|
}
|
|
14
18
|
}
|
|
15
19
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -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;OACV,EAAE,SAAS,EAAE;OACb,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;OACb,EAAE,WAAW,EAAE;OACf,EAAE,MAAM,EAAE;OACV,EAAE,OAAO,EAAE;AAElB,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;QACnD,gBAAW,GAAgB,IAAI,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACzD,WAAM,GAAW,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,YAAO,GAAY,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { APIResource } from '../../resource';
|
|
2
|
+
import * as Core from '../../core';
|
|
3
|
+
import { ListParamsResponse, ListResponse } from '../../types/api';
|
|
4
|
+
|
|
5
|
+
export interface Action {
|
|
6
|
+
created_at?: string;
|
|
7
|
+
data: {
|
|
8
|
+
channel: string;
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
key: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type ActionsListResponse = ListResponse<Action>;
|
|
17
|
+
|
|
18
|
+
export interface ActionsListParams extends ListParamsResponse {
|
|
19
|
+
limit?: number;
|
|
20
|
+
offset?: number;
|
|
21
|
+
search?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class Actions extends APIResource {
|
|
25
|
+
list(params: ActionsListParams, options?: Core.RequestOptions): Core.APIPromise<ActionsListResponse> {
|
|
26
|
+
const { ...query } = params;
|
|
27
|
+
return this._client.get(`/telemetry/v1/actions`, {
|
|
28
|
+
query,
|
|
29
|
+
...options,
|
|
30
|
+
headers: { ...options?.headers },
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { APIResource } from '../../resource';
|
|
2
|
+
import * as Core from '../../core';
|
|
3
|
+
import { ListParamsResponse, ListResponse } from '../../types/api';
|
|
4
|
+
|
|
5
|
+
export type AutomationRuleCondition =
|
|
6
|
+
| { weekday_between: { from: number; to: number } }
|
|
7
|
+
| { battery: Record<string, number> }
|
|
8
|
+
| { and: AutomationRuleCondition[] }
|
|
9
|
+
| { or: AutomationRuleCondition[] }
|
|
10
|
+
| { not: AutomationRuleCondition[] };
|
|
11
|
+
|
|
12
|
+
export interface AutomationEventRule {
|
|
13
|
+
rule_key: string;
|
|
14
|
+
definition: {
|
|
15
|
+
conditions: {
|
|
16
|
+
and: AutomationRuleCondition[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
is_active: boolean;
|
|
20
|
+
repeat_able: boolean;
|
|
21
|
+
cooldown_sec: number;
|
|
22
|
+
description: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Expanded action as returned on automation resources (e.g. list/retrieve). */
|
|
26
|
+
export interface AutomationAction {
|
|
27
|
+
id: string;
|
|
28
|
+
key: string;
|
|
29
|
+
name: string;
|
|
30
|
+
data: Record<string, unknown>;
|
|
31
|
+
created_at: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Automation {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
device_id: string;
|
|
38
|
+
actions: AutomationAction[];
|
|
39
|
+
event_rule?: AutomationEventRule;
|
|
40
|
+
created_at: string;
|
|
41
|
+
updated_at: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Body for `create` and `update`; actions are referenced by id. */
|
|
45
|
+
export interface AutomationParams {
|
|
46
|
+
name: string;
|
|
47
|
+
device_id: string;
|
|
48
|
+
action_ids: string[];
|
|
49
|
+
event_rule: AutomationEventRule;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type AutomationsListResponse = ListResponse<Automation>;
|
|
53
|
+
|
|
54
|
+
export interface AutomationsListParams extends ListParamsResponse {
|
|
55
|
+
search?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export class Automations extends APIResource {
|
|
59
|
+
list(params: AutomationsListParams, options?: Core.RequestOptions): Core.APIPromise<AutomationsListResponse> {
|
|
60
|
+
const { ...query } = params;
|
|
61
|
+
return this._client.get(`/telemetry/v1/automations`, {
|
|
62
|
+
query,
|
|
63
|
+
...options,
|
|
64
|
+
headers: { ...options?.headers },
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
create(params: AutomationParams, options?: Core.RequestOptions): Core.APIPromise<Automation> {
|
|
69
|
+
const { ...body } = params;
|
|
70
|
+
return this._client.post(`/telemetry/v1/automations`, {
|
|
71
|
+
body,
|
|
72
|
+
...options,
|
|
73
|
+
headers: { ...options?.headers },
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Automation> {
|
|
78
|
+
return this._client.get(`/telemetry/v1/automations/${id}`, {
|
|
79
|
+
...options,
|
|
80
|
+
headers: { ...options?.headers },
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
update(id: string, params: AutomationParams, options?: Core.RequestOptions): Core.APIPromise<Automation> {
|
|
85
|
+
const { ...body } = params;
|
|
86
|
+
return this._client.put(`/telemetry/v1/automations/${id}`, {
|
|
87
|
+
body,
|
|
88
|
+
...options,
|
|
89
|
+
headers: { ...options?.headers },
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
94
|
+
return this._client.delete(`/telemetry/v1/automations/${id}`, {
|
|
95
|
+
...options,
|
|
96
|
+
headers: { ...options?.headers },
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -2,11 +2,15 @@ import { APIResource } from "../../resource";
|
|
|
2
2
|
import { Entities } from './entities';
|
|
3
3
|
import { Alerts } from './alerts';
|
|
4
4
|
import { Geofences } from './geofences';
|
|
5
|
+
import { Automations } from './automations';
|
|
5
6
|
import { Events } from './events';
|
|
7
|
+
import { Actions } from './actions';
|
|
6
8
|
|
|
7
9
|
export class Telemetry extends APIResource {
|
|
8
10
|
entities: Entities = new Entities(this._client);
|
|
9
11
|
alerts: Alerts = new Alerts(this._client);
|
|
10
12
|
geofences: Geofences = new Geofences(this._client);
|
|
13
|
+
automations: Automations = new Automations(this._client);
|
|
11
14
|
events: Events = new Events(this._client);
|
|
15
|
+
actions: Actions = new Actions(this._client);
|
|
12
16
|
}
|
package/dist/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.0.1-dev.
|
|
1
|
+
export const VERSION = '0.0.1-dev.45';
|
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.45";
|
|
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.45';
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/package.json
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { APIResource } from '../../resource';
|
|
2
|
+
import * as Core from '../../core';
|
|
3
|
+
import { ListParamsResponse, ListResponse } from '../../types/api';
|
|
4
|
+
|
|
5
|
+
export interface Action {
|
|
6
|
+
created_at?: string;
|
|
7
|
+
data: {
|
|
8
|
+
channel: string;
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
key: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type ActionsListResponse = ListResponse<Action>;
|
|
17
|
+
|
|
18
|
+
export interface ActionsListParams extends ListParamsResponse {
|
|
19
|
+
limit?: number;
|
|
20
|
+
offset?: number;
|
|
21
|
+
search?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export class Actions extends APIResource {
|
|
25
|
+
list(params: ActionsListParams, options?: Core.RequestOptions): Core.APIPromise<ActionsListResponse> {
|
|
26
|
+
const { ...query } = params;
|
|
27
|
+
return this._client.get(`/telemetry/v1/actions`, {
|
|
28
|
+
query,
|
|
29
|
+
...options,
|
|
30
|
+
headers: { ...options?.headers },
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { APIResource } from '../../resource';
|
|
2
|
+
import * as Core from '../../core';
|
|
3
|
+
import { ListParamsResponse, ListResponse } from '../../types/api';
|
|
4
|
+
|
|
5
|
+
export type AutomationRuleCondition =
|
|
6
|
+
| { weekday_between: { from: number; to: number } }
|
|
7
|
+
| { battery: Record<string, number> }
|
|
8
|
+
| { and: AutomationRuleCondition[] }
|
|
9
|
+
| { or: AutomationRuleCondition[] }
|
|
10
|
+
| { not: AutomationRuleCondition[] };
|
|
11
|
+
|
|
12
|
+
export interface AutomationEventRule {
|
|
13
|
+
rule_key: string;
|
|
14
|
+
definition: {
|
|
15
|
+
conditions: {
|
|
16
|
+
and: AutomationRuleCondition[];
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
is_active: boolean;
|
|
20
|
+
repeat_able: boolean;
|
|
21
|
+
cooldown_sec: number;
|
|
22
|
+
description: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Expanded action as returned on automation resources (e.g. list/retrieve). */
|
|
26
|
+
export interface AutomationAction {
|
|
27
|
+
id: string;
|
|
28
|
+
key: string;
|
|
29
|
+
name: string;
|
|
30
|
+
data: Record<string, unknown>;
|
|
31
|
+
created_at: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Automation {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
device_id: string;
|
|
38
|
+
actions: AutomationAction[];
|
|
39
|
+
event_rule?: AutomationEventRule;
|
|
40
|
+
created_at: string;
|
|
41
|
+
updated_at: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Body for `create` and `update`; actions are referenced by id. */
|
|
45
|
+
export interface AutomationParams {
|
|
46
|
+
name: string;
|
|
47
|
+
device_id: string;
|
|
48
|
+
action_ids: string[];
|
|
49
|
+
event_rule: AutomationEventRule;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type AutomationsListResponse = ListResponse<Automation>;
|
|
53
|
+
|
|
54
|
+
export interface AutomationsListParams extends ListParamsResponse {
|
|
55
|
+
search?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export class Automations extends APIResource {
|
|
59
|
+
list(params: AutomationsListParams, options?: Core.RequestOptions): Core.APIPromise<AutomationsListResponse> {
|
|
60
|
+
const { ...query } = params;
|
|
61
|
+
return this._client.get(`/telemetry/v1/automations`, {
|
|
62
|
+
query,
|
|
63
|
+
...options,
|
|
64
|
+
headers: { ...options?.headers },
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
create(params: AutomationParams, options?: Core.RequestOptions): Core.APIPromise<Automation> {
|
|
69
|
+
const { ...body } = params;
|
|
70
|
+
return this._client.post(`/telemetry/v1/automations`, {
|
|
71
|
+
body,
|
|
72
|
+
...options,
|
|
73
|
+
headers: { ...options?.headers },
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Automation> {
|
|
78
|
+
return this._client.get(`/telemetry/v1/automations/${id}`, {
|
|
79
|
+
...options,
|
|
80
|
+
headers: { ...options?.headers },
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
update(id: string, params: AutomationParams, options?: Core.RequestOptions): Core.APIPromise<Automation> {
|
|
85
|
+
const { ...body } = params;
|
|
86
|
+
return this._client.put(`/telemetry/v1/automations/${id}`, {
|
|
87
|
+
body,
|
|
88
|
+
...options,
|
|
89
|
+
headers: { ...options?.headers },
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
94
|
+
return this._client.delete(`/telemetry/v1/automations/${id}`, {
|
|
95
|
+
...options,
|
|
96
|
+
headers: { ...options?.headers },
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -2,11 +2,15 @@ import { APIResource } from '@space-df/sdk/resource';
|
|
|
2
2
|
import { Entities } from './entities';
|
|
3
3
|
import { Alerts } from './alerts';
|
|
4
4
|
import { Geofences } from './geofences';
|
|
5
|
+
import { Automations } from './automations';
|
|
5
6
|
import { Events } from './events';
|
|
7
|
+
import { Actions } from './actions';
|
|
6
8
|
|
|
7
9
|
export class Telemetry extends APIResource {
|
|
8
10
|
entities: Entities = new Entities(this._client);
|
|
9
11
|
alerts: Alerts = new Alerts(this._client);
|
|
10
12
|
geofences: Geofences = new Geofences(this._client);
|
|
13
|
+
automations: Automations = new Automations(this._client);
|
|
11
14
|
events: Events = new Events(this._client);
|
|
15
|
+
actions: Actions = new Actions(this._client);
|
|
12
16
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.0.1-dev.
|
|
1
|
+
export const VERSION = '0.0.1-dev.45';
|