@space-df/sdk 0.0.1-dev.4 → 0.0.1-dev.41
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/README.md +4 -7
- package/api.doc.md +2057 -20
- package/dist/README.md +4 -7
- package/dist/core.d.ts +1 -4
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +1 -3
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +1 -3
- package/dist/core.mjs.map +1 -1
- package/dist/index.d.mts +18 -6
- package/dist/index.d.ts +18 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -16
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/dist/resources/auth/auth.d.ts +20 -1
- package/dist/resources/auth/auth.d.ts.map +1 -1
- package/dist/resources/auth/auth.js +15 -0
- package/dist/resources/auth/auth.js.map +1 -1
- package/dist/resources/auth/auth.mjs +15 -0
- package/dist/resources/auth/auth.mjs.map +1 -1
- package/dist/resources/auth/index.d.ts +1 -0
- package/dist/resources/auth/index.d.ts.map +1 -1
- package/dist/resources/auth/index.js +1 -0
- package/dist/resources/auth/index.js.map +1 -1
- package/dist/resources/auth/index.mjs +1 -0
- package/dist/resources/auth/presigned-url.d.ts +10 -0
- package/dist/resources/auth/presigned-url.d.ts.map +1 -0
- package/dist/resources/auth/presigned-url.js +11 -0
- package/dist/resources/auth/presigned-url.js.map +1 -0
- package/dist/resources/auth/presigned-url.mjs +7 -0
- package/dist/resources/auth/presigned-url.mjs.map +1 -0
- package/dist/resources/auth/space-policies.d.ts +6 -3
- package/dist/resources/auth/space-policies.d.ts.map +1 -1
- package/dist/resources/auth/space-policies.js +16 -5
- package/dist/resources/auth/space-policies.js.map +1 -1
- package/dist/resources/auth/space-policies.mjs +16 -5
- package/dist/resources/auth/space-policies.mjs.map +1 -1
- package/dist/resources/auth/space-role-users.d.ts +13 -3
- package/dist/resources/auth/space-role-users.d.ts.map +1 -1
- package/dist/resources/auth/space-role-users.js +31 -6
- package/dist/resources/auth/space-role-users.js.map +1 -1
- package/dist/resources/auth/space-role-users.mjs +31 -6
- package/dist/resources/auth/space-role-users.mjs.map +1 -1
- package/dist/resources/auth/space-roles.d.ts +14 -3
- package/dist/resources/auth/space-roles.d.ts.map +1 -1
- package/dist/resources/auth/space-roles.js +14 -12
- package/dist/resources/auth/space-roles.js.map +1 -1
- package/dist/resources/auth/space-roles.mjs +14 -12
- package/dist/resources/auth/space-roles.mjs.map +1 -1
- package/dist/resources/auth/spaces.d.ts +21 -8
- package/dist/resources/auth/spaces.d.ts.map +1 -1
- package/dist/resources/auth/spaces.js +18 -6
- package/dist/resources/auth/spaces.js.map +1 -1
- package/dist/resources/auth/spaces.mjs +18 -6
- package/dist/resources/auth/spaces.mjs.map +1 -1
- package/dist/resources/dashboard/index.d.ts +1 -0
- package/dist/resources/dashboard/index.d.ts.map +1 -1
- package/dist/resources/dashboard/index.js +1 -0
- package/dist/resources/dashboard/index.js.map +1 -1
- package/dist/resources/dashboard/index.mjs +1 -0
- package/dist/resources/dashboard/widget.d.ts +11 -0
- package/dist/resources/dashboard/widget.d.ts.map +1 -0
- package/dist/resources/dashboard/widget.js +15 -0
- package/dist/resources/dashboard/widget.js.map +1 -0
- package/dist/resources/dashboard/widget.mjs +11 -0
- package/dist/resources/dashboard/widget.mjs.map +1 -0
- package/dist/resources/device/device-connector.d.ts +25 -0
- package/dist/resources/device/device-connector.d.ts.map +1 -0
- package/dist/resources/device/device-connector.js +30 -0
- package/dist/resources/device/device-connector.js.map +1 -0
- package/dist/resources/device/device-connector.mjs +26 -0
- package/dist/resources/device/device-connector.mjs.map +1 -0
- package/dist/resources/device/device-model.d.ts +20 -0
- package/dist/resources/device/device-model.d.ts.map +1 -0
- package/dist/resources/device/device-model.js +52 -0
- package/dist/resources/device/device-model.js.map +1 -0
- package/dist/resources/device/device-model.mjs +48 -0
- package/dist/resources/device/device-model.mjs.map +1 -0
- package/dist/resources/device/device-spaces.d.ts +19 -0
- package/dist/resources/device/device-spaces.d.ts.map +1 -0
- package/dist/resources/device/device-spaces.js +30 -0
- package/dist/resources/device/device-spaces.js.map +1 -0
- package/dist/resources/device/device-spaces.mjs +26 -0
- package/dist/resources/device/device-spaces.mjs.map +1 -0
- package/dist/resources/device/devices.d.ts +19 -0
- package/dist/resources/device/devices.d.ts.map +1 -0
- package/dist/resources/device/devices.js +58 -0
- package/dist/resources/device/devices.js.map +1 -0
- package/dist/resources/device/devices.mjs +54 -0
- package/dist/resources/device/devices.mjs.map +1 -0
- package/dist/resources/device/index.d.ts +8 -0
- package/dist/resources/device/index.d.ts.map +1 -0
- package/dist/resources/device/index.js +24 -0
- package/dist/resources/device/index.js.map +1 -0
- package/dist/resources/device/index.mjs +8 -0
- package/dist/resources/device/index.mjs.map +1 -0
- package/dist/resources/device/manufacturers.d.ts +20 -0
- package/dist/resources/device/manufacturers.d.ts.map +1 -0
- package/dist/resources/device/manufacturers.js +52 -0
- package/dist/resources/device/manufacturers.js.map +1 -0
- package/dist/resources/device/manufacturers.mjs +48 -0
- package/dist/resources/device/manufacturers.mjs.map +1 -0
- package/dist/resources/device/network-server.d.ts +19 -0
- package/dist/resources/device/network-server.d.ts.map +1 -0
- package/dist/resources/device/network-server.js +52 -0
- package/dist/resources/device/network-server.js.map +1 -0
- package/dist/resources/device/network-server.mjs +48 -0
- package/dist/resources/device/network-server.mjs.map +1 -0
- package/dist/resources/device/trip.d.ts +24 -0
- package/dist/resources/device/trip.d.ts.map +1 -0
- package/dist/resources/device/trip.js +49 -0
- package/dist/resources/device/trip.js.map +1 -0
- package/dist/resources/device/trip.mjs +45 -0
- package/dist/resources/device/trip.mjs.map +1 -0
- package/dist/resources/index.d.ts +3 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +3 -0
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/index.mjs +3 -0
- package/dist/resources/organizations/index.d.ts +2 -0
- package/dist/resources/organizations/index.d.ts.map +1 -0
- package/dist/resources/organizations/index.js +18 -0
- package/dist/resources/organizations/index.js.map +1 -0
- package/dist/resources/organizations/index.mjs +2 -0
- package/dist/resources/organizations/index.mjs.map +1 -0
- package/dist/resources/organizations/organizations.d.ts +9 -0
- package/dist/resources/organizations/organizations.d.ts.map +1 -0
- package/dist/resources/organizations/organizations.js +11 -0
- package/dist/resources/organizations/organizations.js.map +1 -0
- package/dist/resources/organizations/organizations.mjs +7 -0
- package/dist/resources/organizations/organizations.mjs.map +1 -0
- package/dist/resources/telemetry/alerts.d.ts +17 -0
- package/dist/resources/telemetry/alerts.d.ts.map +1 -0
- package/dist/resources/telemetry/alerts.js +16 -0
- package/dist/resources/telemetry/alerts.js.map +1 -0
- package/dist/resources/telemetry/alerts.mjs +12 -0
- package/dist/resources/telemetry/alerts.mjs.map +1 -0
- package/dist/resources/telemetry/entities.d.ts +40 -0
- package/dist/resources/telemetry/entities.d.ts.map +1 -0
- package/dist/resources/telemetry/entities.js +16 -0
- package/dist/resources/telemetry/entities.js.map +1 -0
- package/dist/resources/telemetry/entities.mjs +12 -0
- package/dist/resources/telemetry/entities.mjs.map +1 -0
- package/dist/resources/telemetry/geofences.d.ts +56 -0
- package/dist/resources/telemetry/geofences.d.ts.map +1 -0
- package/dist/resources/telemetry/geofences.js +52 -0
- package/dist/resources/telemetry/geofences.js.map +1 -0
- package/dist/resources/telemetry/geofences.mjs +48 -0
- package/dist/resources/telemetry/geofences.mjs.map +1 -0
- package/dist/resources/telemetry/index.d.ts +11 -0
- package/dist/resources/telemetry/index.d.ts.map +1 -0
- package/dist/resources/telemetry/index.js +32 -0
- package/dist/resources/telemetry/index.js.map +1 -0
- package/dist/resources/telemetry/index.mjs +14 -0
- package/dist/resources/telemetry/index.mjs.map +1 -0
- package/dist/src/core.ts +0 -6
- package/dist/src/index.ts +22 -22
- package/dist/src/resources/auth/auth.ts +42 -2
- package/dist/src/resources/auth/index.ts +1 -0
- package/dist/src/resources/auth/presigned-url.ts +13 -0
- package/dist/src/resources/auth/space-policies.ts +22 -7
- package/dist/src/resources/auth/space-role-users.ts +43 -6
- package/dist/src/resources/auth/space-roles.ts +27 -12
- package/dist/src/resources/auth/spaces.ts +42 -15
- package/dist/src/resources/dashboard/index.ts +1 -0
- package/dist/src/resources/dashboard/widget.ts +17 -0
- package/dist/src/resources/device/device-connector.ts +49 -0
- package/dist/src/resources/device/device-model.ts +65 -0
- package/dist/src/resources/device/device-spaces.ts +42 -0
- package/dist/src/resources/device/devices.ts +70 -0
- package/dist/src/resources/device/index.ts +7 -0
- package/dist/src/resources/device/manufacturers.ts +65 -0
- package/dist/src/resources/device/network-server.ts +64 -0
- package/dist/src/resources/device/trip.ts +69 -0
- package/dist/src/resources/index.ts +3 -0
- package/dist/src/resources/organizations/index.ts +1 -0
- package/dist/src/resources/organizations/organizations.ts +12 -0
- package/dist/src/resources/telemetry/alerts.ts +27 -0
- package/dist/src/resources/telemetry/entities.ts +51 -0
- package/dist/src/resources/telemetry/geofences.ts +92 -0
- package/dist/src/resources/telemetry/index.ts +12 -0
- package/dist/src/types/api.ts +5 -0
- package/dist/src/version.ts +1 -1
- package/dist/types/api.d.ts +4 -0
- package/dist/types/api.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +1 -1
- package/src/core.ts +0 -6
- package/src/index.ts +22 -22
- package/src/resources/auth/auth.ts +42 -2
- package/src/resources/auth/index.ts +1 -0
- package/src/resources/auth/presigned-url.ts +13 -0
- package/src/resources/auth/space-policies.ts +22 -7
- package/src/resources/auth/space-role-users.ts +43 -6
- package/src/resources/auth/space-roles.ts +27 -12
- package/src/resources/auth/spaces.ts +42 -15
- package/src/resources/dashboard/index.ts +1 -0
- package/src/resources/dashboard/widget.ts +17 -0
- package/src/resources/device/device-connector.ts +49 -0
- package/src/resources/device/device-model.ts +65 -0
- package/src/resources/device/device-spaces.ts +42 -0
- package/src/resources/device/devices.ts +70 -0
- package/src/resources/device/index.ts +7 -0
- package/src/resources/device/manufacturers.ts +65 -0
- package/src/resources/device/network-server.ts +64 -0
- package/src/resources/device/trip.ts +69 -0
- package/src/resources/index.ts +3 -0
- package/src/resources/organizations/index.ts +1 -0
- package/src/resources/organizations/organizations.ts +12 -0
- package/src/resources/telemetry/alerts.ts +27 -0
- package/src/resources/telemetry/entities.ts +51 -0
- package/src/resources/telemetry/geofences.ts +92 -0
- package/src/resources/telemetry/index.ts +12 -0
- package/src/types/api.ts +5 -0
- package/src/version.ts +1 -1
package/api.doc.md
CHANGED
|
@@ -18,7 +18,11 @@
|
|
|
18
18
|
- [Oauth2](#oauth2)
|
|
19
19
|
- [Dashboards](#dashboards)
|
|
20
20
|
- [Device States](#deviceStates)
|
|
21
|
+
- [Widgets](#widgets)
|
|
22
|
+
- [Device Spaces](#device-spaces)
|
|
21
23
|
- [Users](#users)
|
|
24
|
+
- [Trip](#trip)
|
|
25
|
+
- [Telemetry](#telemetry)
|
|
22
26
|
|
|
23
27
|
# Auth
|
|
24
28
|
|
|
@@ -89,6 +93,123 @@ const googleAuthResponse = await client.auth.oauth2Google({
|
|
|
89
93
|
|
|
90
94
|
</details>
|
|
91
95
|
|
|
96
|
+
<details>
|
|
97
|
+
<summary><strong>googleLogin</strong></summary>
|
|
98
|
+
|
|
99
|
+
Log in a user via Google using an authorization code.
|
|
100
|
+
|
|
101
|
+
**Signature:**
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
googleLogin(body: GoogleLogin, options?: Core.RequestOptions): Core.APIPromise<AuthTokenPair>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Parameters:**
|
|
108
|
+
|
|
109
|
+
- `body` _(GoogleLogin)_: Object containing the Google authorization code.
|
|
110
|
+
- `authorization_code` _(string)_: The authorization code received from Google OAuth2.
|
|
111
|
+
|
|
112
|
+
**Returns:** `Promise<AuthTokenPair>`
|
|
113
|
+
|
|
114
|
+
**Example:**
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
const tokenPair = await client.auth.googleLogin({
|
|
118
|
+
authorization_code: '4/0Ab_5qllO5QRK6Uct5jTNNfW2fcf2v76Ub9NCH348fOvL0UBts4c7kRjSoUqjCf_wT05VqA',
|
|
119
|
+
});
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
</details>
|
|
123
|
+
|
|
124
|
+
<details>
|
|
125
|
+
<summary><strong>oauthSendOtp</strong></summary>
|
|
126
|
+
|
|
127
|
+
Send a one-time password (OTP) to the user's email for OAuth login.
|
|
128
|
+
|
|
129
|
+
**Signature:**
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
oauthSendOtp(body: OAuthSendOtp, options?: Core.RequestOptions): Core.APIPromise<OAuthSendOtp>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Parameters:**
|
|
136
|
+
|
|
137
|
+
- `body` _(OAuthSendOtp)_: Object containing user email.
|
|
138
|
+
- `email` _(string)_: The email address to send the OTP to.
|
|
139
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
140
|
+
|
|
141
|
+
**Returns:** `Promise<OAuthSendOtp>`
|
|
142
|
+
|
|
143
|
+
**Example:**
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
await client.auth.oauthSendOtp({
|
|
147
|
+
email: 'user@example.com',
|
|
148
|
+
});
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
</details>
|
|
152
|
+
|
|
153
|
+
<details>
|
|
154
|
+
<summary><strong>forgetPassword</strong></summary>
|
|
155
|
+
|
|
156
|
+
Send a password reset request for a user's account using their token and password.
|
|
157
|
+
|
|
158
|
+
**Signature:**
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
forgetPassword(body: ForgetPasswordParams, options?: Core.RequestOptions): Core.APIPromise<ForgetPasswordParams>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**Parameters:**
|
|
165
|
+
|
|
166
|
+
- `body` _(ForgetPasswordParams)_: Object containing user credentials.
|
|
167
|
+
- `token` _(string)_: The token associated with the user's account.
|
|
168
|
+
- `password` _(string)_: The new password to set for the account.
|
|
169
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
170
|
+
|
|
171
|
+
**Returns:** `Promise<ForgetPasswordParams>`
|
|
172
|
+
|
|
173
|
+
**Example:**
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
await client.auth.forgetPassword({
|
|
177
|
+
token: 'token',
|
|
178
|
+
password: 'newSecurePassword123',
|
|
179
|
+
});
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
</details>
|
|
183
|
+
|
|
184
|
+
<details>
|
|
185
|
+
<summary><strong>sendEmailConfirm</strong></summary>
|
|
186
|
+
|
|
187
|
+
Send a confirmation email to the user's address to verify ownership.
|
|
188
|
+
|
|
189
|
+
**Signature:**
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
sendEmailConfirm(body: OAuthSendEmail, options?: Core.RequestOptions): Core.APIPromise<OAuthSendEmail>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Parameters:**
|
|
196
|
+
|
|
197
|
+
- `body` _(OAuthSendEmail)_: Object containing user email.
|
|
198
|
+
- `email` _(string)_: The email address to send the confirmation link to.
|
|
199
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
200
|
+
|
|
201
|
+
**Returns:** `Promise<OAuthSendEmail>`
|
|
202
|
+
|
|
203
|
+
**Example:**
|
|
204
|
+
|
|
205
|
+
```typescript
|
|
206
|
+
await client.auth.sendEmailConfirm({
|
|
207
|
+
email: 'user@example.com',
|
|
208
|
+
});
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
</details>
|
|
212
|
+
|
|
92
213
|
<details>
|
|
93
214
|
<summary><strong>refreshToken</strong></summary>
|
|
94
215
|
|
|
@@ -112,6 +233,7 @@ refreshToken(body: AuthRefreshTokenParams, options?: Core.RequestOptions): Core.
|
|
|
112
233
|
```typescript
|
|
113
234
|
const refreshResponse = await client.auth.refreshToken({
|
|
114
235
|
refresh: 'refresh_token',
|
|
236
|
+
space_slug_name: 'default-1fa0d173-9c7c-4460-afa0-5a524dfcdff6',
|
|
115
237
|
});
|
|
116
238
|
```
|
|
117
239
|
|
|
@@ -135,6 +257,7 @@ register(body: AuthRegisterParams, options?: Core.RequestOptions): Core.APIPromi
|
|
|
135
257
|
- `password` _(string)_: User's chosen password.
|
|
136
258
|
- `first_name` _(string)_: User's first name (optional).
|
|
137
259
|
- `last_name` _(string)_: User's last name (optional).
|
|
260
|
+
- `otp` _(string)_: User's OTP code (optional).
|
|
138
261
|
|
|
139
262
|
**Returns:** `Promise<Registration>`
|
|
140
263
|
|
|
@@ -215,6 +338,37 @@ const switchResponse = await client.auth.switchSpaces({
|
|
|
215
338
|
|
|
216
339
|
</details>
|
|
217
340
|
|
|
341
|
+
<details>
|
|
342
|
+
<summary><strong>changePassword</strong></summary>
|
|
343
|
+
|
|
344
|
+
Change the current user password.
|
|
345
|
+
|
|
346
|
+
**Signature:**
|
|
347
|
+
|
|
348
|
+
```typescript
|
|
349
|
+
changePassword(body: AuthChangePasswordParams, options?: Core.RequestOptions): Core.APIPromise<AuthChangePasswordParams>
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
**Parameters:**
|
|
353
|
+
|
|
354
|
+
- `body` _(AuthChangePasswordParams)_: Object containing the current password and new password.
|
|
355
|
+
- `password` _(string)_: Current password.
|
|
356
|
+
- `new_password` _(string)_: New password.
|
|
357
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
358
|
+
|
|
359
|
+
**Returns:** `Promise<AuthChangePasswordParams>`
|
|
360
|
+
|
|
361
|
+
**Example:**
|
|
362
|
+
|
|
363
|
+
```typescript
|
|
364
|
+
const switchResponse = await client.auth.switchSpaces({
|
|
365
|
+
password: 'current_password',
|
|
366
|
+
new_password: 'new_password',
|
|
367
|
+
});
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
</details>
|
|
371
|
+
|
|
218
372
|
---
|
|
219
373
|
|
|
220
374
|
# Space Policies
|
|
@@ -259,13 +413,14 @@ List all space policies or filter them based on query parameters.
|
|
|
259
413
|
**Signature:**
|
|
260
414
|
|
|
261
415
|
```typescript
|
|
262
|
-
list(query?: SpacePolicyListParams, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
263
|
-
list(options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
264
|
-
list(query: SpacePolicyListParams | Core.RequestOptions = {}, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>
|
|
416
|
+
list(spaceName: string, query?: SpacePolicyListParams, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
417
|
+
list(spaceName: string, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
418
|
+
list(spaceName: string, query: SpacePolicyListParams | Core.RequestOptions = {}, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>
|
|
265
419
|
```
|
|
266
420
|
|
|
267
421
|
**Parameters:**
|
|
268
422
|
|
|
423
|
+
- `spaceName` _string_: The space slug name.
|
|
269
424
|
- `query` _(SpacePolicyListParams)_: (optional) Filters to apply when listing policies.
|
|
270
425
|
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
271
426
|
|
|
@@ -274,7 +429,7 @@ list(query: SpacePolicyListParams | Core.RequestOptions = {}, options?: Core.Req
|
|
|
274
429
|
**Example:**
|
|
275
430
|
|
|
276
431
|
```typescript
|
|
277
|
-
const spacePolicies = await client.spacePolicies.list({ page: 1, limit: 10 });
|
|
432
|
+
const spacePolicies = await client.spacePolicies.list('your-space-slug', { page: 1, limit: 10 });
|
|
278
433
|
```
|
|
279
434
|
|
|
280
435
|
</details>
|
|
@@ -297,13 +452,13 @@ Retrieve a specific space role user by their ID.
|
|
|
297
452
|
**Signature:**
|
|
298
453
|
|
|
299
454
|
```typescript
|
|
300
|
-
retrieve(id: number, params:
|
|
455
|
+
retrieve(id: number, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUser>
|
|
301
456
|
```
|
|
302
457
|
|
|
303
458
|
**Parameters:**
|
|
304
459
|
|
|
305
460
|
- `id` _(number)_: The ID of the space role user to retrieve.
|
|
306
|
-
- `params` _(
|
|
461
|
+
- `params` _(SpaceRoleUsersParams)_: Parameters containing the space slug.
|
|
307
462
|
- `X-Space`: _(string)_: Space slug name.
|
|
308
463
|
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
309
464
|
|
|
@@ -325,13 +480,13 @@ List all space role users or filter them based on query parameters.
|
|
|
325
480
|
**Signature:**
|
|
326
481
|
|
|
327
482
|
```typescript
|
|
328
|
-
list(params:
|
|
483
|
+
list(spaceName: string, params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserListResponse>
|
|
329
484
|
```
|
|
330
485
|
|
|
331
486
|
**Parameters:**
|
|
332
487
|
|
|
333
|
-
- `
|
|
334
|
-
|
|
488
|
+
- `spaceName`: _(string)_: Header param for space slug name.
|
|
489
|
+
- `params` _(SpaceRoleUserListParams)_: Parameters containing any additional filters.
|
|
335
490
|
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
336
491
|
|
|
337
492
|
**Returns:** `Promise<SpaceRoleUserListResponse>`
|
|
@@ -339,7 +494,97 @@ list(params: SpaceRoleUserListParams, options?: Core.RequestOptions): Core.APIPr
|
|
|
339
494
|
**Example:**
|
|
340
495
|
|
|
341
496
|
```typescript
|
|
342
|
-
const spaceRoleUsers = await client.spaceRoleUsers.list(
|
|
497
|
+
const spaceRoleUsers = await client.spaceRoleUsers.list('example-space', { page: 1, limit: 10 });
|
|
498
|
+
console.log(spaceRoleUsers);
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
</details>
|
|
502
|
+
|
|
503
|
+
<details>
|
|
504
|
+
<summary><strong>update</strong></summary>
|
|
505
|
+
|
|
506
|
+
Update the details of a specific space role user.
|
|
507
|
+
|
|
508
|
+
**Signature:**
|
|
509
|
+
|
|
510
|
+
```typescript
|
|
511
|
+
update(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleParams>
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
**Parameters:**
|
|
515
|
+
|
|
516
|
+
- `id` _(number)_: The ID of the space role user to update.
|
|
517
|
+
- `params` _(SpaceRoleParams)_: Parameters containing updated space role details.
|
|
518
|
+
- `space_role`: _(string)_: The updated space role for the user.
|
|
519
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
520
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
521
|
+
|
|
522
|
+
**Returns:** `Promise<SpaceRoleParams>`
|
|
523
|
+
|
|
524
|
+
**Example:**
|
|
525
|
+
|
|
526
|
+
```typescript
|
|
527
|
+
const updatedRole = await client.spaceRoleUsers.update(1, { space_role: 'new-role', 'X-Space': 'your-space-slug' });
|
|
528
|
+
console.log(updatedRole);
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
</details>
|
|
532
|
+
|
|
533
|
+
<details>
|
|
534
|
+
<summary><strong>partialUpdate</strong></summary>
|
|
535
|
+
|
|
536
|
+
Partially update the details of a specific space role user.
|
|
537
|
+
|
|
538
|
+
**Signature:**
|
|
539
|
+
|
|
540
|
+
```typescript
|
|
541
|
+
partialUpdate(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleParams>
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
**Parameters:**
|
|
545
|
+
|
|
546
|
+
- `id` _(number)_: The ID of the space role user to partially update.
|
|
547
|
+
- `params` _(SpaceRoleParams)_: Parameters containing updated space role details.
|
|
548
|
+
- `space_role`: _(string)_: The updated space role for the user.
|
|
549
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
550
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
551
|
+
|
|
552
|
+
**Returns:** `Promise<SpaceRoleParams>`
|
|
553
|
+
|
|
554
|
+
**Example:**
|
|
555
|
+
|
|
556
|
+
```typescript
|
|
557
|
+
const partialUpdatedRole = await client.spaceRoleUsers.partialUpdate(1, { space_role: 'another-role', 'X-Space': 'your-space-slug' });
|
|
558
|
+
console.log(partialUpdatedRole);
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
</details>
|
|
562
|
+
|
|
563
|
+
<details>
|
|
564
|
+
<summary><strong>setSpaceDefault</strong></summary>
|
|
565
|
+
|
|
566
|
+
Set a specific space role user as the default for their space.
|
|
567
|
+
|
|
568
|
+
**Signature:**
|
|
569
|
+
|
|
570
|
+
```typescript
|
|
571
|
+
setSpaceDefault(id: String, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
**Parameters:**
|
|
575
|
+
|
|
576
|
+
- `id` _(string)_: The ID of the space role user to set as default.
|
|
577
|
+
- `params` _(SpaceRoleUsersParams)_: Parameters containing the space slug.
|
|
578
|
+
- `X-Space`: _(string)_: Space slug name.
|
|
579
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
580
|
+
|
|
581
|
+
**Returns:** `Promise<void>`
|
|
582
|
+
|
|
583
|
+
**Example:**
|
|
584
|
+
|
|
585
|
+
```typescript
|
|
586
|
+
await client.spaceRoleUsers.setSpaceDefault('3fa85f64-5717-4562-b3fc ...');
|
|
587
|
+
console.log('Space role user has been set as default.');
|
|
343
588
|
```
|
|
344
589
|
|
|
345
590
|
</details>
|
|
@@ -352,13 +597,13 @@ Delete a specific space role user by their ID.
|
|
|
352
597
|
**Signature:**
|
|
353
598
|
|
|
354
599
|
```typescript
|
|
355
|
-
delete(id: number, params:
|
|
600
|
+
delete(id: number, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
356
601
|
```
|
|
357
602
|
|
|
358
603
|
**Parameters:**
|
|
359
604
|
|
|
360
605
|
- `id` _(number)_: The ID of the space role user to delete.
|
|
361
|
-
- `params` _(
|
|
606
|
+
- `params` _(SpaceRoleUsersParams)_: Parameters containing the space slug.
|
|
362
607
|
- `X-Space`: _(string)_: Space slug name.
|
|
363
608
|
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
364
609
|
|
|
@@ -459,13 +704,13 @@ Retrieve a specific space role by its ID.
|
|
|
459
704
|
**Signature:**
|
|
460
705
|
|
|
461
706
|
```typescript
|
|
462
|
-
retrieve(id: number, params:
|
|
707
|
+
retrieve(id: number, params: SpaceRolesParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole>
|
|
463
708
|
```
|
|
464
709
|
|
|
465
710
|
**Parameters:**
|
|
466
711
|
|
|
467
712
|
- `id` _(number)_: The ID of the space role to retrieve.
|
|
468
|
-
- `params` _(
|
|
713
|
+
- `params` _(SpaceRolesParams)_: Parameters containing the space slug.
|
|
469
714
|
- `X-Space`: _(string)_: Space slug name.
|
|
470
715
|
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
471
716
|
|
|
@@ -521,13 +766,13 @@ List all space roles or filter them based on query parameters.
|
|
|
521
766
|
**Signature:**
|
|
522
767
|
|
|
523
768
|
```typescript
|
|
524
|
-
list(params:
|
|
769
|
+
list(spaceName: string, params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleListResponse>
|
|
525
770
|
```
|
|
526
771
|
|
|
527
772
|
**Parameters:**
|
|
528
773
|
|
|
529
|
-
- `
|
|
530
|
-
|
|
774
|
+
- `spaceName`: _(string)_: Header param for space slug name.
|
|
775
|
+
- `params` _(ListParamsResponse)_: Parameters containing the additional filters.
|
|
531
776
|
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
532
777
|
|
|
533
778
|
**Returns:** `Promise<SpaceRoleListResponse>`
|
|
@@ -535,7 +780,7 @@ list(params: SpaceRoleListParams, options?: Core.RequestOptions): Core.APIPromis
|
|
|
535
780
|
**Example:**
|
|
536
781
|
|
|
537
782
|
```typescript
|
|
538
|
-
const spaceRoles = await client.spaceRoles.list(
|
|
783
|
+
const spaceRoles = await client.spaceRoles.list('example-space', { page: 1, limit: 10 });
|
|
539
784
|
```
|
|
540
785
|
|
|
541
786
|
</details>
|
|
@@ -685,12 +930,12 @@ Delete a specific space.
|
|
|
685
930
|
**Signature:**
|
|
686
931
|
|
|
687
932
|
```typescript
|
|
688
|
-
delete(params:
|
|
933
|
+
delete(params: SpaceParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
689
934
|
```
|
|
690
935
|
|
|
691
936
|
**Parameters:**
|
|
692
937
|
|
|
693
|
-
- `params` _(
|
|
938
|
+
- `params` _(SpaceParams)_: Parameters containing the space slug.
|
|
694
939
|
- `X-Space`: _(string)_: Space slug name.
|
|
695
940
|
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
696
941
|
|
|
@@ -704,6 +949,89 @@ await client.spaces.delete({ 'X-Space': 'my-space' });
|
|
|
704
949
|
|
|
705
950
|
</details>
|
|
706
951
|
|
|
952
|
+
<details>
|
|
953
|
+
<summary><strong>invitation</strong></summary>
|
|
954
|
+
|
|
955
|
+
Send an invitation to users to join a space.
|
|
956
|
+
|
|
957
|
+
**Signature:**
|
|
958
|
+
|
|
959
|
+
```typescript
|
|
960
|
+
invitation(params: OAuthInvitationParams, options?: Core.RequestOptions): Core.APIPromise<OAuthInvitationParams>
|
|
961
|
+
```
|
|
962
|
+
|
|
963
|
+
**Parameters:**
|
|
964
|
+
|
|
965
|
+
- `params` _(OAuthInvitationParams)_: Contains a list of receivers with emails and role IDs.
|
|
966
|
+
- `receiver_list`: _(Receiver[])_: A list of invitation targets.
|
|
967
|
+
- `email` _(string)_: Email address of the user to invite.
|
|
968
|
+
- `space_role_id` _(string)_: Role ID assigned to the user in the space.
|
|
969
|
+
- `X-Space`: _(string)_: The space slug name.
|
|
970
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
971
|
+
|
|
972
|
+
**Returns:** `Promise<OAuthInvitationParams>`
|
|
973
|
+
|
|
974
|
+
**Example:**
|
|
975
|
+
|
|
976
|
+
```typescript
|
|
977
|
+
const invitationResponse = await client.spaces.invitation({
|
|
978
|
+
receiver_list: [
|
|
979
|
+
{
|
|
980
|
+
email: 'user1@example.com',
|
|
981
|
+
space_role_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
email: 'user2@example.com',
|
|
985
|
+
space_role_id: '3fa85f64-5717-4562-b3fc-2c963f66afb3',
|
|
986
|
+
},
|
|
987
|
+
],
|
|
988
|
+
'X-Space': 'your-space-slug',
|
|
989
|
+
});
|
|
990
|
+
```
|
|
991
|
+
|
|
992
|
+
</details>
|
|
993
|
+
|
|
994
|
+
<details>
|
|
995
|
+
<summary><strong>joinSpace</strong></summary>
|
|
996
|
+
|
|
997
|
+
Join a space using an invitation token.
|
|
998
|
+
|
|
999
|
+
**Signature:**
|
|
1000
|
+
|
|
1001
|
+
```typescript
|
|
1002
|
+
joinSpace(token: string, options?: Core.RequestOptions): Core.APIPromise<JoinSpaceResponse>
|
|
1003
|
+
```
|
|
1004
|
+
|
|
1005
|
+
**Parameters:**
|
|
1006
|
+
|
|
1007
|
+
- `token` _(string)_: The unique token received in the invitation link.
|
|
1008
|
+
- `options` _(Core.RequestOptions)_: Additional request options (e.g., headers).
|
|
1009
|
+
|
|
1010
|
+
**Returns:** `Promise<JoinSpaceResponse>`
|
|
1011
|
+
|
|
1012
|
+
Where `JoinSpaceResponse` is:
|
|
1013
|
+
|
|
1014
|
+
```typescript
|
|
1015
|
+
export interface JoinSpaceResponse {
|
|
1016
|
+
result?: string;
|
|
1017
|
+
error?: string;
|
|
1018
|
+
}
|
|
1019
|
+
```
|
|
1020
|
+
|
|
1021
|
+
**Example:**
|
|
1022
|
+
|
|
1023
|
+
```typescript
|
|
1024
|
+
const joinResponse = await client.spaces.joinSpace('eyJ0b2tlbiI6ICJ4eXo0NTYiIH0...');
|
|
1025
|
+
|
|
1026
|
+
if (joinResponse.error) {
|
|
1027
|
+
console.error('Failed to join space:', joinResponse.error);
|
|
1028
|
+
} else {
|
|
1029
|
+
console.log('Joined space successfully!', joinResponse.result);
|
|
1030
|
+
}
|
|
1031
|
+
```
|
|
1032
|
+
|
|
1033
|
+
</details>
|
|
1034
|
+
|
|
707
1035
|
---
|
|
708
1036
|
|
|
709
1037
|
# Oauth2
|
|
@@ -1319,3 +1647,1712 @@ console.log('User profile deleted.');
|
|
|
1319
1647
|
```
|
|
1320
1648
|
|
|
1321
1649
|
</details>
|
|
1650
|
+
|
|
1651
|
+
---
|
|
1652
|
+
|
|
1653
|
+
# PresignedUrl
|
|
1654
|
+
|
|
1655
|
+
## Overview
|
|
1656
|
+
|
|
1657
|
+
The `PresignedUrl` class provides a method for retrieving a presigned URL along with the associated file name.
|
|
1658
|
+
|
|
1659
|
+
## Methods
|
|
1660
|
+
|
|
1661
|
+
<details>
|
|
1662
|
+
<summary><strong>get</strong></summary>
|
|
1663
|
+
|
|
1664
|
+
Retrieve a presigned URL and its associated file name.
|
|
1665
|
+
|
|
1666
|
+
**Signature:**
|
|
1667
|
+
|
|
1668
|
+
```typescript
|
|
1669
|
+
get(options?: Core.RequestOptions): Core.APIPromise<PresignedUrlResponse>
|
|
1670
|
+
```
|
|
1671
|
+
|
|
1672
|
+
**Parameters:**
|
|
1673
|
+
|
|
1674
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1675
|
+
|
|
1676
|
+
**Returns:** `Promise<PresignedUrlResponse>`
|
|
1677
|
+
|
|
1678
|
+
**Example:**
|
|
1679
|
+
|
|
1680
|
+
```typescript
|
|
1681
|
+
const response = await client.presignedUrl.get();
|
|
1682
|
+
console.log(response.presigned_url);
|
|
1683
|
+
console.log(response.file_name);
|
|
1684
|
+
```
|
|
1685
|
+
|
|
1686
|
+
</details>
|
|
1687
|
+
|
|
1688
|
+
# DeviceConnector
|
|
1689
|
+
|
|
1690
|
+
## Overview
|
|
1691
|
+
|
|
1692
|
+
The `DeviceConnector` class provides methods for retrieving and listing connector. Below are the details for each method, including parameters, return types, and example usage.
|
|
1693
|
+
|
|
1694
|
+
## Methods
|
|
1695
|
+
|
|
1696
|
+
<details>
|
|
1697
|
+
<summary><strong>create</strong></summary>
|
|
1698
|
+
|
|
1699
|
+
Create a new device connector.
|
|
1700
|
+
|
|
1701
|
+
**Signature:**
|
|
1702
|
+
|
|
1703
|
+
```typescript
|
|
1704
|
+
create(params: DeviceConnectorParams, options?: Core.RequestOptions): Core.APIPromise<DeviceConnectorParams>
|
|
1705
|
+
```
|
|
1706
|
+
|
|
1707
|
+
**Parameters:**
|
|
1708
|
+
|
|
1709
|
+
- params (DeviceConnectorParams): Parameters for creating a device connector:
|
|
1710
|
+
- network_server (string): The URL or address of the network server.
|
|
1711
|
+
- name (string): The name of the device connector.
|
|
1712
|
+
- connector_type (string): The type of the connector (e.g., mqtt, http).
|
|
1713
|
+
- status? (string): Optional status of the connector.
|
|
1714
|
+
- deviceHttpConfig? (DeviceHttpConfig): Optional HTTP-specific configuration:
|
|
1715
|
+
- api_token (string): Token used to authenticate HTTP requests.
|
|
1716
|
+
- address_url (string): Base URL of the HTTP endpoint.
|
|
1717
|
+
- deviceMqttConfig? (DeviceMqttConfig): Optional MQTT-specific configuration:
|
|
1718
|
+
- mqtt_broker (string): Address of the MQTT broker.
|
|
1719
|
+
- username (string): Username for broker authentication.
|
|
1720
|
+
- password (string): Password for broker authentication.
|
|
1721
|
+
- options (Core.RequestOptions): Additional request options.
|
|
1722
|
+
|
|
1723
|
+
**Returns:** Promise `<DeviceConnectorParams>`
|
|
1724
|
+
|
|
1725
|
+
**Example:**
|
|
1726
|
+
|
|
1727
|
+
```typescript
|
|
1728
|
+
const newMqttConnector = await client.deviceConnector.create({
|
|
1729
|
+
network_server: 'poue4567-e89...',
|
|
1730
|
+
name: 'MQTT Connector 1',
|
|
1731
|
+
connector_type: 'mqtt_broker',
|
|
1732
|
+
deviceMqttConfig: {
|
|
1733
|
+
mqtt_broker: 'mqtt://broker.example.com',
|
|
1734
|
+
username: 'user123',
|
|
1735
|
+
password: 'secretpass',
|
|
1736
|
+
},
|
|
1737
|
+
});
|
|
1738
|
+
|
|
1739
|
+
const newHttpConnector = await client.deviceConnector.create({
|
|
1740
|
+
network_server: 'poue4567-e89...',
|
|
1741
|
+
name: 'HTTP Connector 1',
|
|
1742
|
+
connector_type: 'http_server',
|
|
1743
|
+
deviceHttpConfig: {
|
|
1744
|
+
api_token: 'your_api_token_here',
|
|
1745
|
+
address_url: 'http://api.example.com/data',
|
|
1746
|
+
},
|
|
1747
|
+
});
|
|
1748
|
+
```
|
|
1749
|
+
|
|
1750
|
+
</details>
|
|
1751
|
+
|
|
1752
|
+
<details>
|
|
1753
|
+
<summary><strong>testConnectionPreview</strong></summary>
|
|
1754
|
+
|
|
1755
|
+
Test connection to a device connector without saving it (preview only).
|
|
1756
|
+
|
|
1757
|
+
**Signature:**
|
|
1758
|
+
|
|
1759
|
+
```typescript
|
|
1760
|
+
testConnectionPreview(params: DeviceConnectorParams, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1761
|
+
```
|
|
1762
|
+
|
|
1763
|
+
**Parameters:**
|
|
1764
|
+
|
|
1765
|
+
- params (DeviceConnectorParams): Parameters for testing a device connector connection:
|
|
1766
|
+
- network_server (string): The URL or address of the network server.
|
|
1767
|
+
- name (string): The name of the device connector.
|
|
1768
|
+
- connector_type (string): The type of the connector (e.g., mqtt, http).
|
|
1769
|
+
- status? (string): Optional status of the connector.
|
|
1770
|
+
- deviceHttpConfig? (DeviceHttpConfig): Optional HTTP-specific configuration:
|
|
1771
|
+
- api_token (string): Token used to authenticate HTTP requests.
|
|
1772
|
+
- address_url (string): Base URL of the HTTP endpoint.
|
|
1773
|
+
- deviceMqttConfig? (DeviceMqttConfig): Optional MQTT-specific configuration:
|
|
1774
|
+
- mqtt_broker (string): Address of the MQTT broker.
|
|
1775
|
+
- username (string): Username for broker authentication.
|
|
1776
|
+
- password (string): Password for broker authentication.
|
|
1777
|
+
- options (Core.RequestOptions): Additional request options.
|
|
1778
|
+
|
|
1779
|
+
**Returns:** Promise `<void>`
|
|
1780
|
+
|
|
1781
|
+
**Example:**
|
|
1782
|
+
|
|
1783
|
+
```typescript
|
|
1784
|
+
await client.deviceConnector.testConnectionPreview({
|
|
1785
|
+
network_server: 'poue4567-e89...',
|
|
1786
|
+
name: 'MQTT Connector Preview',
|
|
1787
|
+
connector_type: 'mqtt_broker',
|
|
1788
|
+
deviceMqttConfig: {
|
|
1789
|
+
mqtt_broker: 'mqtt://broker.example.com',
|
|
1790
|
+
username: 'testuser',
|
|
1791
|
+
password: 'testpass',
|
|
1792
|
+
},
|
|
1793
|
+
});
|
|
1794
|
+
|
|
1795
|
+
await client.deviceConnector.testConnectionPreview({
|
|
1796
|
+
network_server: 'poue4567-e89...',
|
|
1797
|
+
name: 'HTTP Connector Preview',
|
|
1798
|
+
connector_type: 'http_server',
|
|
1799
|
+
deviceHttpConfig: {
|
|
1800
|
+
api_token: 'test_api_token',
|
|
1801
|
+
address_url: 'http://api.example.com/data',
|
|
1802
|
+
},
|
|
1803
|
+
});
|
|
1804
|
+
```
|
|
1805
|
+
|
|
1806
|
+
</details>
|
|
1807
|
+
|
|
1808
|
+
<details>
|
|
1809
|
+
<summary><strong>testConnection</strong></summary>
|
|
1810
|
+
|
|
1811
|
+
Test an existing device connector by ID.
|
|
1812
|
+
|
|
1813
|
+
**Signature:**
|
|
1814
|
+
|
|
1815
|
+
```typescript
|
|
1816
|
+
testConnection(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1817
|
+
```
|
|
1818
|
+
|
|
1819
|
+
**Parameters:**
|
|
1820
|
+
|
|
1821
|
+
- `id` (string): A UUID string identifying the device connector to test.
|
|
1822
|
+
- `options`? (Core.RequestOptions): Additional request options such as custom headers.
|
|
1823
|
+
|
|
1824
|
+
**Returns:** `Promise <void>`
|
|
1825
|
+
|
|
1826
|
+
**Example:**
|
|
1827
|
+
|
|
1828
|
+
```typescript
|
|
1829
|
+
await client.deviceConnector.testConnection('123e4567-e89b-12d3-a456-426614174000');
|
|
1830
|
+
```
|
|
1831
|
+
|
|
1832
|
+
</details>
|
|
1833
|
+
|
|
1834
|
+
---
|
|
1835
|
+
|
|
1836
|
+
# DeviceModel
|
|
1837
|
+
|
|
1838
|
+
## Overview
|
|
1839
|
+
|
|
1840
|
+
The `DeviceModel` class provides methods for retrieving and listing device model. Below are the details for each method, including parameters, return types, and example usage.
|
|
1841
|
+
|
|
1842
|
+
## Methods
|
|
1843
|
+
|
|
1844
|
+
<details>
|
|
1845
|
+
<summary><strong>create</strong></summary>
|
|
1846
|
+
|
|
1847
|
+
Create a new device model.
|
|
1848
|
+
|
|
1849
|
+
**Signature:**
|
|
1850
|
+
|
|
1851
|
+
```typescript
|
|
1852
|
+
create(params: DeviceModelParams, options?: Core.RequestOptions): Core.APIPromise<DeviceModelParams>
|
|
1853
|
+
```
|
|
1854
|
+
|
|
1855
|
+
**Parameters:**
|
|
1856
|
+
|
|
1857
|
+
- params (DeviceModelParams): Parameters for creating a device model:
|
|
1858
|
+
- name (string): The name of the device model.
|
|
1859
|
+
- alias (string): The alias of the device model.
|
|
1860
|
+
- image_url (string): The image URL of the device model.
|
|
1861
|
+
- default_config (object): The default configuration object.
|
|
1862
|
+
- manufacture (string): The manufacturer of the device model.
|
|
1863
|
+
- options (Core.RequestOptions): Additional request options.
|
|
1864
|
+
|
|
1865
|
+
**Returns:** Promise<DeviceModelParams>
|
|
1866
|
+
|
|
1867
|
+
**Example:**
|
|
1868
|
+
|
|
1869
|
+
```typescript
|
|
1870
|
+
const newDeviceModel = await client.deviceModel.create({
|
|
1871
|
+
name: 'Model X',
|
|
1872
|
+
alias: 'model_x',
|
|
1873
|
+
image_url: 'http://example.com/image.png',
|
|
1874
|
+
default_config: {},
|
|
1875
|
+
manufacture: '123e4567-e89...',
|
|
1876
|
+
});
|
|
1877
|
+
```
|
|
1878
|
+
|
|
1879
|
+
</details>
|
|
1880
|
+
|
|
1881
|
+
<details>
|
|
1882
|
+
<summary><strong>retrieve</strong></summary>
|
|
1883
|
+
|
|
1884
|
+
Retrieve a device model by its ID.
|
|
1885
|
+
|
|
1886
|
+
**Signature:**
|
|
1887
|
+
|
|
1888
|
+
```typescript
|
|
1889
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<DeviceModelParams>
|
|
1890
|
+
```
|
|
1891
|
+
|
|
1892
|
+
**Parameters:**
|
|
1893
|
+
|
|
1894
|
+
- `id` (string): The unique identifier of the device model to retrieve.
|
|
1895
|
+
- `options` (Core.RequestOptions): Additional request options.
|
|
1896
|
+
|
|
1897
|
+
**Returns:** `Promise<DeviceModelParams>`
|
|
1898
|
+
|
|
1899
|
+
**Example:**
|
|
1900
|
+
|
|
1901
|
+
```typescript
|
|
1902
|
+
const deviceModel = await client.deviceModel.retrieve('123e4567-e89b-12d3-a456-426614174000');
|
|
1903
|
+
console.log(deviceModel.name);
|
|
1904
|
+
```
|
|
1905
|
+
|
|
1906
|
+
</details>
|
|
1907
|
+
|
|
1908
|
+
<details>
|
|
1909
|
+
<summary><strong>update</strong></summary>
|
|
1910
|
+
|
|
1911
|
+
Update an existing device model by its ID.
|
|
1912
|
+
|
|
1913
|
+
**Signature:**
|
|
1914
|
+
|
|
1915
|
+
```typescript
|
|
1916
|
+
update(id: string, params: DeviceModelParams, options?: Core.RequestOptions): Core.APIPromise<DeviceModelParams>
|
|
1917
|
+
```
|
|
1918
|
+
|
|
1919
|
+
**Parameters:**
|
|
1920
|
+
|
|
1921
|
+
- `id` (string): The unique identifier of the device model to update.
|
|
1922
|
+
- `params` (DeviceModelParams): The data to update the device model with:
|
|
1923
|
+
- `name` (string): The name of the device model.
|
|
1924
|
+
- `alias` (string): The alias of the device model.
|
|
1925
|
+
- `image_url` (string): The image URL of the device model.
|
|
1926
|
+
- `default_config` (object): The default configuration object.
|
|
1927
|
+
- `manufacture` (string): The manufacturer of the device model.
|
|
1928
|
+
- `options` (Core.RequestOptions): Additional request options.
|
|
1929
|
+
|
|
1930
|
+
**Returns:** `Promise<DeviceModelParams>`
|
|
1931
|
+
|
|
1932
|
+
**Example:**
|
|
1933
|
+
|
|
1934
|
+
```typescript
|
|
1935
|
+
const updatedDeviceModel = await client.deviceModel.update('123e4567-e89b-12d3-a456-426614174000', {
|
|
1936
|
+
name: 'Model Y',
|
|
1937
|
+
alias: 'model_y',
|
|
1938
|
+
image_url: 'http://example.com/image2.png',
|
|
1939
|
+
default_config: { setting: true },
|
|
1940
|
+
manufacture: '123e4567-e89...',
|
|
1941
|
+
});
|
|
1942
|
+
console.log(updatedDeviceModel);
|
|
1943
|
+
```
|
|
1944
|
+
|
|
1945
|
+
</details>
|
|
1946
|
+
|
|
1947
|
+
<details>
|
|
1948
|
+
<summary><strong>list</strong></summary>
|
|
1949
|
+
|
|
1950
|
+
Retrieve a list of device models with optional filters.
|
|
1951
|
+
|
|
1952
|
+
**Signature:**
|
|
1953
|
+
|
|
1954
|
+
```typescript
|
|
1955
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<DeviceModelListResponse>
|
|
1956
|
+
```
|
|
1957
|
+
|
|
1958
|
+
**Parameters:**
|
|
1959
|
+
|
|
1960
|
+
- `params` (ListParamsResponse): Query parameters to filter and paginate the results:
|
|
1961
|
+
- `ordering` (string, optional): Which field to use when ordering the results.
|
|
1962
|
+
- `search` (string, optional): A search term.
|
|
1963
|
+
- `limit` (integer, optional): Number of results to return per page.
|
|
1964
|
+
- `offset` (integer, optional): The initial index from which to return the results.
|
|
1965
|
+
- `options` (Core.RequestOptions): Additional request options.
|
|
1966
|
+
|
|
1967
|
+
**Returns:** `Promise<DeviceModelListResponse>`
|
|
1968
|
+
|
|
1969
|
+
**Example:**
|
|
1970
|
+
|
|
1971
|
+
```typescript
|
|
1972
|
+
const deviceModels = await client.deviceModel.list({
|
|
1973
|
+
ordering: 'name',
|
|
1974
|
+
search: 'model',
|
|
1975
|
+
limit: 10,
|
|
1976
|
+
offset: 0,
|
|
1977
|
+
});
|
|
1978
|
+
console.log(deviceModels.results);
|
|
1979
|
+
```
|
|
1980
|
+
|
|
1981
|
+
</details>
|
|
1982
|
+
|
|
1983
|
+
<details>
|
|
1984
|
+
<summary><strong>delete</strong></summary>
|
|
1985
|
+
|
|
1986
|
+
Delete a device models by its ID.
|
|
1987
|
+
|
|
1988
|
+
**Signature:**
|
|
1989
|
+
|
|
1990
|
+
```typescript
|
|
1991
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
1992
|
+
```
|
|
1993
|
+
|
|
1994
|
+
**Parameters:**
|
|
1995
|
+
|
|
1996
|
+
- `id` _(string)_: A UUID string identifying this device models.
|
|
1997
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
1998
|
+
|
|
1999
|
+
**Returns:** `Promise<void>`
|
|
2000
|
+
|
|
2001
|
+
**Example:**
|
|
2002
|
+
|
|
2003
|
+
```typescript
|
|
2004
|
+
await client.deviceModel.delete('a557d013-f6...');
|
|
2005
|
+
```
|
|
2006
|
+
|
|
2007
|
+
</details>
|
|
2008
|
+
|
|
2009
|
+
---
|
|
2010
|
+
|
|
2011
|
+
# Device
|
|
2012
|
+
|
|
2013
|
+
## Overview
|
|
2014
|
+
|
|
2015
|
+
The `Device` class provides methods for retrieving and listing device. Below are the details for each method, including parameters, return types, and example usage.
|
|
2016
|
+
|
|
2017
|
+
## Methods
|
|
2018
|
+
|
|
2019
|
+
<details>
|
|
2020
|
+
<summary><strong>create</strong></summary>
|
|
2021
|
+
|
|
2022
|
+
Create a new device.
|
|
2023
|
+
|
|
2024
|
+
**Signature:**
|
|
2025
|
+
|
|
2026
|
+
```typescript
|
|
2027
|
+
create(params: DeviceParams, options?: Core.RequestOptions): Core.APIPromise<DeviceParams>
|
|
2028
|
+
```
|
|
2029
|
+
|
|
2030
|
+
**Parameters:**
|
|
2031
|
+
|
|
2032
|
+
- `params` _(DeviceParams)_: Parameters for creating a device:
|
|
2033
|
+
- `status` _(string, optional)_: The status of the device.
|
|
2034
|
+
- `device_connector` _(string)_: The connector type or identifier for the device.
|
|
2035
|
+
- `device_model` _(string)_: The model identifier of the device.
|
|
2036
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2037
|
+
|
|
2038
|
+
**Returns:** `Promise<DeviceParams>`
|
|
2039
|
+
|
|
2040
|
+
**Example:**
|
|
2041
|
+
|
|
2042
|
+
```typescript
|
|
2043
|
+
const newDevice = await client.devices.create({
|
|
2044
|
+
status: 'active',
|
|
2045
|
+
device_connector: '123e4567-e89...',
|
|
2046
|
+
device_model: 'poye4567-e89...',
|
|
2047
|
+
});
|
|
2048
|
+
```
|
|
2049
|
+
|
|
2050
|
+
</details>
|
|
2051
|
+
|
|
2052
|
+
<details>
|
|
2053
|
+
<summary><strong>retrieve</strong></summary>
|
|
2054
|
+
|
|
2055
|
+
Retrieve details of a device by its ID.
|
|
2056
|
+
|
|
2057
|
+
**Signature:**
|
|
2058
|
+
|
|
2059
|
+
```typescript
|
|
2060
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<DeviceParams>
|
|
2061
|
+
```
|
|
2062
|
+
|
|
2063
|
+
**Parameters:**
|
|
2064
|
+
|
|
2065
|
+
- `id` _(string)_: The unique identifier of the device to retrieve.
|
|
2066
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2067
|
+
|
|
2068
|
+
**Returns:** `Promise<DeviceParams>`
|
|
2069
|
+
|
|
2070
|
+
**Example:**
|
|
2071
|
+
|
|
2072
|
+
```typescript
|
|
2073
|
+
const device = await client.devices.retrieve('1l3e4567-e89...');
|
|
2074
|
+
console.log(device.device_model);
|
|
2075
|
+
```
|
|
2076
|
+
|
|
2077
|
+
</details>
|
|
2078
|
+
|
|
2079
|
+
<details>
|
|
2080
|
+
<summary><strong>update</strong></summary>
|
|
2081
|
+
|
|
2082
|
+
Update an existing device by its ID.
|
|
2083
|
+
|
|
2084
|
+
**Signature:**
|
|
2085
|
+
|
|
2086
|
+
```typescript
|
|
2087
|
+
update(id: string, params: DeviceParams, options?: Core.RequestOptions): Core.APIPromise<DeviceParams>
|
|
2088
|
+
```
|
|
2089
|
+
|
|
2090
|
+
**Parameters:**
|
|
2091
|
+
|
|
2092
|
+
- `id` _(string)_: The unique identifier of the device to update.
|
|
2093
|
+
- `params` _(DeviceParams)_: Parameters to update the device with:
|
|
2094
|
+
- `status` _(string, optional)_: The status of the device.
|
|
2095
|
+
- `device_connector` _(string)_: The connector type or identifier for the device.
|
|
2096
|
+
- `device_model` _(string)_: The model identifier of the device.
|
|
2097
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2098
|
+
|
|
2099
|
+
**Returns:** `Promise<DeviceParams>`
|
|
2100
|
+
|
|
2101
|
+
**Example:**
|
|
2102
|
+
|
|
2103
|
+
```typescript
|
|
2104
|
+
const updatedDevice = await client.devices.update('device-id-123', {
|
|
2105
|
+
status: 'active',
|
|
2106
|
+
device_connector: '123e4567-e89...',
|
|
2107
|
+
device_model: 'ks3e4567-e89...',
|
|
2108
|
+
});
|
|
2109
|
+
```
|
|
2110
|
+
|
|
2111
|
+
</details>
|
|
2112
|
+
|
|
2113
|
+
<details>
|
|
2114
|
+
<summary><strong>list</strong></summary>
|
|
2115
|
+
|
|
2116
|
+
List devices with optional pagination.
|
|
2117
|
+
|
|
2118
|
+
**Signature:**
|
|
2119
|
+
|
|
2120
|
+
```typescript
|
|
2121
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<DeviceListResponse>
|
|
2122
|
+
```
|
|
2123
|
+
|
|
2124
|
+
**Parameters:**
|
|
2125
|
+
|
|
2126
|
+
- `params` _(ListParamsResponse)_: Query parameters for listing devices:
|
|
2127
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2128
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2129
|
+
- `bbox` _(string, optional)_: A bounding box filter (for example: `minLon,minLat,maxLon,maxLat`).
|
|
2130
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2131
|
+
|
|
2132
|
+
**Returns:** `Promise<DeviceListResponse>`
|
|
2133
|
+
|
|
2134
|
+
**Example:**
|
|
2135
|
+
|
|
2136
|
+
```typescript
|
|
2137
|
+
const devices = await client.devices.list({ limit: 10, offset: 0 });
|
|
2138
|
+
console.log(devices.results);
|
|
2139
|
+
```
|
|
2140
|
+
|
|
2141
|
+
</details>
|
|
2142
|
+
|
|
2143
|
+
<details>
|
|
2144
|
+
<summary><strong>delete</strong></summary>
|
|
2145
|
+
|
|
2146
|
+
Delete a device by its ID.
|
|
2147
|
+
|
|
2148
|
+
**Signature:**
|
|
2149
|
+
|
|
2150
|
+
```typescript
|
|
2151
|
+
delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2152
|
+
```
|
|
2153
|
+
|
|
2154
|
+
**Parameters:**
|
|
2155
|
+
|
|
2156
|
+
- `id` _(number)_: The unique identifier of the device to delete.
|
|
2157
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2158
|
+
|
|
2159
|
+
**Returns:** `Promise<void>`
|
|
2160
|
+
|
|
2161
|
+
**Example:**
|
|
2162
|
+
|
|
2163
|
+
```typescript
|
|
2164
|
+
await client.devices.delete('123e4567-e89...');
|
|
2165
|
+
console.log('Device deleted successfully.');
|
|
2166
|
+
```
|
|
2167
|
+
|
|
2168
|
+
</details>
|
|
2169
|
+
|
|
2170
|
+
<details>
|
|
2171
|
+
<summary><strong>check claim code</strong></summary>
|
|
2172
|
+
|
|
2173
|
+
Check the device by claim code
|
|
2174
|
+
|
|
2175
|
+
**Signature:**
|
|
2176
|
+
|
|
2177
|
+
```typescript
|
|
2178
|
+
checkClaimCode(claim_code: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2179
|
+
```
|
|
2180
|
+
|
|
2181
|
+
**Parameters:**
|
|
2182
|
+
|
|
2183
|
+
- `claim_code` _(string)_: The unique code of the device.
|
|
2184
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2185
|
+
|
|
2186
|
+
**Returns:** `Promise<void>`
|
|
2187
|
+
|
|
2188
|
+
**Example:**
|
|
2189
|
+
|
|
2190
|
+
```typescript
|
|
2191
|
+
await client.devices.checkClaimCode('123e4567-e89...');
|
|
2192
|
+
```
|
|
2193
|
+
|
|
2194
|
+
</details>
|
|
2195
|
+
|
|
2196
|
+
---
|
|
2197
|
+
|
|
2198
|
+
# Manufacturers
|
|
2199
|
+
|
|
2200
|
+
## Overview
|
|
2201
|
+
|
|
2202
|
+
The `Manufacturers` class provides methods for retrieving and listing manufacturers of device. Below are the details for each method, including parameters, return types, and example usage.
|
|
2203
|
+
|
|
2204
|
+
## Methods
|
|
2205
|
+
|
|
2206
|
+
<details>
|
|
2207
|
+
<summary><strong>create</strong></summary>
|
|
2208
|
+
|
|
2209
|
+
Create a new manufacturer.
|
|
2210
|
+
|
|
2211
|
+
**Signature:**
|
|
2212
|
+
|
|
2213
|
+
```typescript
|
|
2214
|
+
create(params: ManufacturersParams, options?: Core.RequestOptions): Core.APIPromise<ManufacturersParams>
|
|
2215
|
+
```
|
|
2216
|
+
|
|
2217
|
+
**Parameters:**
|
|
2218
|
+
|
|
2219
|
+
- `params` _(ManufacturersParams)_: Parameters for creating a manufacturer:
|
|
2220
|
+
- `name` _(string)_: The name of the manufacturer.
|
|
2221
|
+
- `location` _(string)_: The location of the manufacturer.
|
|
2222
|
+
- `description` _(string)_: A description of the manufacturer.
|
|
2223
|
+
- `portal_url` _(string)_: The portal URL information of the manufacturer.
|
|
2224
|
+
- `national` _(string)_: The nationality or country of the manufacturer.
|
|
2225
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2226
|
+
|
|
2227
|
+
**Returns:** `Promise<ManufacturersParams>`
|
|
2228
|
+
|
|
2229
|
+
**Example:**
|
|
2230
|
+
|
|
2231
|
+
````typescript
|
|
2232
|
+
const newManufacturer = await client.manufacturers.create({
|
|
2233
|
+
name: 'Acme Corp',
|
|
2234
|
+
location: 'USA',
|
|
2235
|
+
description: 'Leading manufacturer of widgets',
|
|
2236
|
+
portal_url: 'https://acme.example.com',
|
|
2237
|
+
national: 'US',
|
|
2238
|
+
});
|
|
2239
|
+
```
|
|
2240
|
+
</details>
|
|
2241
|
+
|
|
2242
|
+
<details>
|
|
2243
|
+
<summary><strong>retrieve</strong></summary>
|
|
2244
|
+
|
|
2245
|
+
Retrieve details of a manufacturer by its ID.
|
|
2246
|
+
|
|
2247
|
+
**Signature:**
|
|
2248
|
+
```typescript
|
|
2249
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<ManufacturersParams>
|
|
2250
|
+
````
|
|
2251
|
+
|
|
2252
|
+
**Parameters:**
|
|
2253
|
+
|
|
2254
|
+
- `id` _(string)_: The unique identifier of the manufacturer to retrieve.
|
|
2255
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2256
|
+
|
|
2257
|
+
**Returns:** `Promise<ManufacturersParams>`
|
|
2258
|
+
|
|
2259
|
+
**Example:**
|
|
2260
|
+
|
|
2261
|
+
```typescript
|
|
2262
|
+
const manufacturer = await client.manufacturers.retrieve('123e4567-e89...');
|
|
2263
|
+
console.log(manufacturer.name);
|
|
2264
|
+
```
|
|
2265
|
+
|
|
2266
|
+
</details>
|
|
2267
|
+
|
|
2268
|
+
<details>
|
|
2269
|
+
<summary><strong>update</strong></summary>
|
|
2270
|
+
|
|
2271
|
+
Update an existing manufacturer by its ID.
|
|
2272
|
+
|
|
2273
|
+
**Signature:**
|
|
2274
|
+
|
|
2275
|
+
```typescript
|
|
2276
|
+
update(id: string, params: ManufacturersParams, options?: Core.RequestOptions): Core.APIPromise<ManufacturersParams>
|
|
2277
|
+
```
|
|
2278
|
+
|
|
2279
|
+
**Parameters:**
|
|
2280
|
+
|
|
2281
|
+
- `id` _(string)_: The unique identifier of the manufacturer to update.
|
|
2282
|
+
- `params` _(ManufacturersParams)_: Parameters for updating the manufacturer:
|
|
2283
|
+
- `name` _(string)_: The name of the manufacturer.
|
|
2284
|
+
- `location` _(string)_: The location of the manufacturer.
|
|
2285
|
+
- `description` _(string)_: A description of the manufacturer.
|
|
2286
|
+
- `portal_url` _(string)_: The portal URL information of the manufacturer.
|
|
2287
|
+
- `national` _(string)_: The nationality or country of the manufacturer.
|
|
2288
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2289
|
+
|
|
2290
|
+
**Returns:** `Promise<ManufacturersParams>`
|
|
2291
|
+
|
|
2292
|
+
**Example:**
|
|
2293
|
+
|
|
2294
|
+
```typescript
|
|
2295
|
+
const updatedManufacturer = await client.manufacturers.update('123e4567-e89...', {
|
|
2296
|
+
name: 'Acme Corp Updated',
|
|
2297
|
+
location: 'USA',
|
|
2298
|
+
description: 'Updated description',
|
|
2299
|
+
portal_url: 'https://acme.example.com',
|
|
2300
|
+
national: 'US',
|
|
2301
|
+
});
|
|
2302
|
+
```
|
|
2303
|
+
|
|
2304
|
+
</details>
|
|
2305
|
+
|
|
2306
|
+
<details>
|
|
2307
|
+
<summary><strong>list</strong></summary>
|
|
2308
|
+
|
|
2309
|
+
List manufacturers with optional filtering, ordering, and pagination.
|
|
2310
|
+
|
|
2311
|
+
**Signature:**
|
|
2312
|
+
|
|
2313
|
+
```typescript
|
|
2314
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<ManufacturersListResponse>
|
|
2315
|
+
```
|
|
2316
|
+
|
|
2317
|
+
**Parameters:**
|
|
2318
|
+
|
|
2319
|
+
- `params` _(ListParamsResponse)_: Query parameters for filtering, ordering, and pagination:
|
|
2320
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
2321
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
2322
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2323
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2324
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2325
|
+
|
|
2326
|
+
**Returns:** `Promise<ManufacturersListResponse>`
|
|
2327
|
+
|
|
2328
|
+
**Response shape:**
|
|
2329
|
+
|
|
2330
|
+
- `count` _(integer)_: Total number of manufacturers matching the query.
|
|
2331
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
2332
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
2333
|
+
- `results` _(ManufacturersParams[])_: Array of manufacturer objects.
|
|
2334
|
+
|
|
2335
|
+
**Example:**
|
|
2336
|
+
|
|
2337
|
+
```typescript
|
|
2338
|
+
const listResponse = await client.manufacturers.list({
|
|
2339
|
+
ordering: 'name',
|
|
2340
|
+
search: 'acme',
|
|
2341
|
+
limit: 10,
|
|
2342
|
+
offset: 0,
|
|
2343
|
+
});
|
|
2344
|
+
console.log(listResponse.results);
|
|
2345
|
+
```
|
|
2346
|
+
|
|
2347
|
+
</details>
|
|
2348
|
+
|
|
2349
|
+
<details>
|
|
2350
|
+
<summary><strong>delete</strong></summary>
|
|
2351
|
+
|
|
2352
|
+
Delete a manufacturer by its ID.
|
|
2353
|
+
|
|
2354
|
+
**Signature:**
|
|
2355
|
+
|
|
2356
|
+
```typescript
|
|
2357
|
+
delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2358
|
+
```
|
|
2359
|
+
|
|
2360
|
+
**Parameters:**
|
|
2361
|
+
|
|
2362
|
+
- `id` _(number)_: A UUID string identifying this manufacturer. (Note: Type is `number` in code but described as UUID string)
|
|
2363
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2364
|
+
|
|
2365
|
+
**Returns:** `Promise<void>` (No content on success)
|
|
2366
|
+
|
|
2367
|
+
**Example:**
|
|
2368
|
+
|
|
2369
|
+
```typescript
|
|
2370
|
+
await client.manufacturers.delete('123e4567-e89...');
|
|
2371
|
+
```
|
|
2372
|
+
|
|
2373
|
+
</details>
|
|
2374
|
+
|
|
2375
|
+
---
|
|
2376
|
+
|
|
2377
|
+
# NetworkServer
|
|
2378
|
+
|
|
2379
|
+
## Overview
|
|
2380
|
+
|
|
2381
|
+
The `NetworkServer` class provides methods for retrieving and listing network server. Below are the details for each method, including parameters, return types, and example usage.
|
|
2382
|
+
|
|
2383
|
+
## Methods
|
|
2384
|
+
|
|
2385
|
+
<details>
|
|
2386
|
+
<summary><strong>create</strong></summary>
|
|
2387
|
+
|
|
2388
|
+
Create a new network server.
|
|
2389
|
+
|
|
2390
|
+
**Signature:**
|
|
2391
|
+
|
|
2392
|
+
```typescript
|
|
2393
|
+
reate(params: NetworkServerParams, options?: Core.RequestOptions): Core.APIPromise<NetworkServerParams>
|
|
2394
|
+
```
|
|
2395
|
+
|
|
2396
|
+
**Parameters:**
|
|
2397
|
+
|
|
2398
|
+
- `params` _(NetworkServerParams)_: Parameters for creating a new network server.
|
|
2399
|
+
- `name`: _(string)_: The name of the network server.
|
|
2400
|
+
- `logo`: _(string)_: The logo of the network server.
|
|
2401
|
+
- `description`: _(string)_: The description of the network server.
|
|
2402
|
+
- `type_connect`: _(string[])_: An array of connection types supported by the network server.
|
|
2403
|
+
Possible values may include:
|
|
2404
|
+
- `"mqtt_broker"`: The server connects using MQTT protocol.
|
|
2405
|
+
- `"http_server"`: The server exposes HTTP endpoints.
|
|
2406
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2407
|
+
|
|
2408
|
+
**Returns:** `Promise<NetworkServerParams>`
|
|
2409
|
+
|
|
2410
|
+
**Example:**
|
|
2411
|
+
|
|
2412
|
+
```typescript
|
|
2413
|
+
const newNetworkServer = await client.networkServer.create({
|
|
2414
|
+
name: 'Chirpstack',
|
|
2415
|
+
logo: 'logo-url',
|
|
2416
|
+
description: 'example-description',
|
|
2417
|
+
type_connect: ['mqtt_broker', 'http_server'],
|
|
2418
|
+
});
|
|
2419
|
+
```
|
|
2420
|
+
|
|
2421
|
+
</details>
|
|
2422
|
+
|
|
2423
|
+
<details>
|
|
2424
|
+
<summary><strong>retrieve</strong></summary>
|
|
2425
|
+
Retrieve details of a network server by its ID.
|
|
2426
|
+
|
|
2427
|
+
**Signature:**
|
|
2428
|
+
|
|
2429
|
+
```typescript
|
|
2430
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<NetworkServerParams>
|
|
2431
|
+
```
|
|
2432
|
+
|
|
2433
|
+
**Parameters:**
|
|
2434
|
+
|
|
2435
|
+
- `id` _(string)_: The unique identifier of the network server to retrieve.
|
|
2436
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2437
|
+
|
|
2438
|
+
**Returns:** `Promise<NetworkServerParams>`
|
|
2439
|
+
|
|
2440
|
+
**Example:**
|
|
2441
|
+
|
|
2442
|
+
```typescript
|
|
2443
|
+
const networkServer = await client.networkServer.retrieve('a557d013-f6...');
|
|
2444
|
+
console.log(networkServer.name);
|
|
2445
|
+
```
|
|
2446
|
+
|
|
2447
|
+
</details>
|
|
2448
|
+
|
|
2449
|
+
<details>
|
|
2450
|
+
<summary><strong>update</strong></summary>
|
|
2451
|
+
|
|
2452
|
+
Update an existing network server by its ID.
|
|
2453
|
+
|
|
2454
|
+
**Signature:**
|
|
2455
|
+
|
|
2456
|
+
```typescript
|
|
2457
|
+
update(id: string, params: NetworkServerParams, options?: Core.RequestOptions): Core.APIPromise<NetworkServerParams>
|
|
2458
|
+
```
|
|
2459
|
+
|
|
2460
|
+
**Parameters:**
|
|
2461
|
+
|
|
2462
|
+
- `id` _(string)_: The unique identifier of the network server to update.
|
|
2463
|
+
- `params` _(NetworkServerParams)_: Parameters for updating the network server.
|
|
2464
|
+
- `name`: _(string)_: The name of the network server.
|
|
2465
|
+
- `logo`: _(string)_: The logo of the network server.
|
|
2466
|
+
- `description`: _(string)_: The description of the network server.
|
|
2467
|
+
- `type_connect`: _(string[])_: An array of connection types supported by the network server. Possible values include:
|
|
2468
|
+
- `"mqtt_broker"`: The server connects using MQTT protocol.
|
|
2469
|
+
- `"http_server"`: The server exposes HTTP endpoints.
|
|
2470
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2471
|
+
|
|
2472
|
+
**Returns:** `Promise<NetworkServerParams>`
|
|
2473
|
+
|
|
2474
|
+
**Example:**
|
|
2475
|
+
|
|
2476
|
+
```typescript
|
|
2477
|
+
const updatedNetworkServer = await client.networkServer.update('a557d013-f6 ...', {
|
|
2478
|
+
name: 'Chirpstack Updated',
|
|
2479
|
+
logo: 'new-logo-url',
|
|
2480
|
+
description: 'updated-description',
|
|
2481
|
+
type_connect: ['mqtt_broker'],
|
|
2482
|
+
});
|
|
2483
|
+
```
|
|
2484
|
+
|
|
2485
|
+
</details>
|
|
2486
|
+
|
|
2487
|
+
<details>
|
|
2488
|
+
<summary><strong>list</strong></summary>
|
|
2489
|
+
|
|
2490
|
+
List network servers with optional filtering, ordering, and pagination.
|
|
2491
|
+
|
|
2492
|
+
**Signature:**
|
|
2493
|
+
|
|
2494
|
+
```typescript
|
|
2495
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<NetworkServerListResponse>
|
|
2496
|
+
```
|
|
2497
|
+
|
|
2498
|
+
**Parameters:**
|
|
2499
|
+
|
|
2500
|
+
- `params` _(ListParamsResponse)_: Query parameters for filtering, ordering, and pagination:
|
|
2501
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
2502
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
2503
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2504
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2505
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2506
|
+
|
|
2507
|
+
**Returns:** `Promise<NetworkServerListResponse>`
|
|
2508
|
+
|
|
2509
|
+
**Response shape:**
|
|
2510
|
+
|
|
2511
|
+
- `count` _(integer)_: Total number of network servers matching the query.
|
|
2512
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
2513
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
2514
|
+
- `results` _(NetworkServer[])_: Array of network server objects.
|
|
2515
|
+
|
|
2516
|
+
**Example:**
|
|
2517
|
+
|
|
2518
|
+
```typescript
|
|
2519
|
+
const listResponse = await client.networkServer.list({
|
|
2520
|
+
ordering: 'name',
|
|
2521
|
+
search: 'chirpstack',
|
|
2522
|
+
limit: 10,
|
|
2523
|
+
offset: 0,
|
|
2524
|
+
});
|
|
2525
|
+
console.log(listResponse.results);
|
|
2526
|
+
```
|
|
2527
|
+
|
|
2528
|
+
</details>
|
|
2529
|
+
|
|
2530
|
+
<details>
|
|
2531
|
+
<summary><strong>delete</strong></summary>
|
|
2532
|
+
|
|
2533
|
+
Delete a network server by its ID.
|
|
2534
|
+
|
|
2535
|
+
**Signature:**
|
|
2536
|
+
|
|
2537
|
+
```typescript
|
|
2538
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2539
|
+
```
|
|
2540
|
+
|
|
2541
|
+
**Parameters:**
|
|
2542
|
+
|
|
2543
|
+
- `id` _(string)_: A UUID string identifying this network server.
|
|
2544
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2545
|
+
|
|
2546
|
+
**Returns:** `Promise<void>`
|
|
2547
|
+
|
|
2548
|
+
**Example:**
|
|
2549
|
+
|
|
2550
|
+
```typescript
|
|
2551
|
+
await client.networkServer.delete('a557d013-f6...');
|
|
2552
|
+
```
|
|
2553
|
+
|
|
2554
|
+
</details>
|
|
2555
|
+
|
|
2556
|
+
---
|
|
2557
|
+
|
|
2558
|
+
# Widgets
|
|
2559
|
+
|
|
2560
|
+
## Overview
|
|
2561
|
+
|
|
2562
|
+
The `Widgets` class provides methods to manage dashboard widgets, including bulk updating widget configurations. This class allows you to update multiple widgets at once with their respective configurations.
|
|
2563
|
+
|
|
2564
|
+
## Methods
|
|
2565
|
+
|
|
2566
|
+
<details>
|
|
2567
|
+
<summary><strong>updateWidgets</strong></summary>
|
|
2568
|
+
|
|
2569
|
+
Updates multiple widgets with their configurations in a single bulk operation.
|
|
2570
|
+
|
|
2571
|
+
**Signature:**
|
|
2572
|
+
|
|
2573
|
+
```typescript
|
|
2574
|
+
updateWidgets(params: WidgetsUpdateParams[], options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2575
|
+
```
|
|
2576
|
+
|
|
2577
|
+
**Parameters:**
|
|
2578
|
+
|
|
2579
|
+
- `params` _(WidgetsUpdateParams[])_: Array of widget update parameters.
|
|
2580
|
+
- `id` _(string)_: The unique identifier of the widget to update.
|
|
2581
|
+
- `configuration` _(any)_: The configuration object for the widget.
|
|
2582
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2583
|
+
|
|
2584
|
+
**Returns:**
|
|
2585
|
+
|
|
2586
|
+
- `Core.APIPromise<void>`: A promise that resolves when the bulk update is complete.
|
|
2587
|
+
|
|
2588
|
+
**Example Usage:**
|
|
2589
|
+
|
|
2590
|
+
```typescript
|
|
2591
|
+
import { SpaceDFSDK } from 'spacedf-sdk-node';
|
|
2592
|
+
|
|
2593
|
+
const client = new SpaceDFSDK({
|
|
2594
|
+
organization: 'your-org-id',
|
|
2595
|
+
});
|
|
2596
|
+
|
|
2597
|
+
// Update multiple widgets
|
|
2598
|
+
await client.widgets.updateWidgets([
|
|
2599
|
+
{
|
|
2600
|
+
id: 'widget-1',
|
|
2601
|
+
configuration: {
|
|
2602
|
+
title: 'Temperature Monitor',
|
|
2603
|
+
refreshInterval: 5000,
|
|
2604
|
+
chartType: 'line',
|
|
2605
|
+
},
|
|
2606
|
+
},
|
|
2607
|
+
{
|
|
2608
|
+
id: 'widget-2',
|
|
2609
|
+
configuration: {
|
|
2610
|
+
title: 'Device Status',
|
|
2611
|
+
showLegend: true,
|
|
2612
|
+
colorScheme: 'dark',
|
|
2613
|
+
},
|
|
2614
|
+
},
|
|
2615
|
+
]);
|
|
2616
|
+
```
|
|
2617
|
+
|
|
2618
|
+
**Error Handling:**
|
|
2619
|
+
|
|
2620
|
+
```typescript
|
|
2621
|
+
try {
|
|
2622
|
+
await client.widgets.updateWidgets(widgetUpdates);
|
|
2623
|
+
console.log('Widgets updated successfully');
|
|
2624
|
+
} catch (error) {
|
|
2625
|
+
if (error instanceof SpaceDFSDK.BadRequestError) {
|
|
2626
|
+
console.error('Invalid widget configuration:', error.message);
|
|
2627
|
+
} else if (error instanceof SpaceDFSDK.NotFoundError) {
|
|
2628
|
+
console.error('One or more widgets not found:', error.message);
|
|
2629
|
+
} else {
|
|
2630
|
+
console.error('Failed to update widgets:', error.message);
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
```
|
|
2634
|
+
|
|
2635
|
+
</details>
|
|
2636
|
+
|
|
2637
|
+
---
|
|
2638
|
+
|
|
2639
|
+
# Device Spaces
|
|
2640
|
+
|
|
2641
|
+
## Overview
|
|
2642
|
+
|
|
2643
|
+
The `DeviceSpaces` class provides methods for managing device spaces within an application. Device spaces allow for grouping and organizing devices within specific spaces. Below are the details for each method, including parameters, return types, and example usage.
|
|
2644
|
+
|
|
2645
|
+
## Methods
|
|
2646
|
+
|
|
2647
|
+
<details>
|
|
2648
|
+
<summary><strong>create</strong></summary>
|
|
2649
|
+
|
|
2650
|
+
Create a new device space.
|
|
2651
|
+
|
|
2652
|
+
**Signature:**
|
|
2653
|
+
|
|
2654
|
+
```typescript
|
|
2655
|
+
create(params: DeviceSpacesParams, options?: Core.RequestOptions): Core.APIPromise<DeviceSpacesParams>
|
|
2656
|
+
```
|
|
2657
|
+
|
|
2658
|
+
**Parameters:**
|
|
2659
|
+
|
|
2660
|
+
- `params` _(DeviceSpacesParams)_: Parameters for creating a new device space.
|
|
2661
|
+
- `name` _(string)_: The name of the device space.
|
|
2662
|
+
- `description` _(string)_: A description of the device space.
|
|
2663
|
+
- `dev_eui` _(string)_: A dev_eui of device space.
|
|
2664
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2665
|
+
|
|
2666
|
+
**Returns:** `Promise<DeviceSpacesParams>`
|
|
2667
|
+
|
|
2668
|
+
**Example:**
|
|
2669
|
+
|
|
2670
|
+
```typescript
|
|
2671
|
+
const newDeviceSpace = await client.deviceSpaces.create({
|
|
2672
|
+
name: 'Sensor Network A',
|
|
2673
|
+
description: 'Device space for temperature and humidity sensors',
|
|
2674
|
+
dev_eui: '8437687685476895',
|
|
2675
|
+
});
|
|
2676
|
+
```
|
|
2677
|
+
|
|
2678
|
+
</details>
|
|
2679
|
+
|
|
2680
|
+
<details>
|
|
2681
|
+
<summary><strong>list</strong></summary>
|
|
2682
|
+
|
|
2683
|
+
List device spaces with optional filtering, ordering, and pagination.
|
|
2684
|
+
|
|
2685
|
+
**Signature:**
|
|
2686
|
+
|
|
2687
|
+
```typescript
|
|
2688
|
+
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<DeviceSpacesListResponse>
|
|
2689
|
+
```
|
|
2690
|
+
|
|
2691
|
+
**Parameters:**
|
|
2692
|
+
|
|
2693
|
+
- `params` _(ListParamsResponse)_: Query parameters for filtering, ordering, and pagination:
|
|
2694
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
2695
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
2696
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2697
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2698
|
+
- `include_latest_checkpoint` _(boolean, optional)_: Include latest checkpoint
|
|
2699
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2700
|
+
|
|
2701
|
+
**Returns:** `Promise<DeviceSpacesListResponse>`
|
|
2702
|
+
|
|
2703
|
+
**Response shape:**
|
|
2704
|
+
|
|
2705
|
+
- `count` _(integer)_: Total number of device spaces matching the query.
|
|
2706
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
2707
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
2708
|
+
- `results` _(DeviceSpacesParams[])_: Array of device space objects.
|
|
2709
|
+
|
|
2710
|
+
**Example:**
|
|
2711
|
+
|
|
2712
|
+
```typescript
|
|
2713
|
+
const listResponse = await client.deviceSpaces.list(
|
|
2714
|
+
{
|
|
2715
|
+
ordering: 'name',
|
|
2716
|
+
search: 'sensor',
|
|
2717
|
+
limit: 10,
|
|
2718
|
+
offset: 0,
|
|
2719
|
+
},
|
|
2720
|
+
{
|
|
2721
|
+
'X-Space': 'space-slug-name',
|
|
2722
|
+
},
|
|
2723
|
+
);
|
|
2724
|
+
console.log(listResponse.results);
|
|
2725
|
+
```
|
|
2726
|
+
|
|
2727
|
+
</details>
|
|
2728
|
+
|
|
2729
|
+
<details>
|
|
2730
|
+
<summary><strong>delete</strong></summary>
|
|
2731
|
+
|
|
2732
|
+
Delete a device space by its ID.
|
|
2733
|
+
|
|
2734
|
+
**Signature:**
|
|
2735
|
+
|
|
2736
|
+
```typescript
|
|
2737
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2738
|
+
```
|
|
2739
|
+
|
|
2740
|
+
**Parameters:**
|
|
2741
|
+
|
|
2742
|
+
- `id` _(string)_: A UUID string identifying this device space.
|
|
2743
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2744
|
+
|
|
2745
|
+
**Returns:** `Promise<void>`
|
|
2746
|
+
|
|
2747
|
+
**Example:**
|
|
2748
|
+
|
|
2749
|
+
```typescript
|
|
2750
|
+
await client.deviceSpaces.delete('789e0123-e89b-12d3-a456-426614174002');
|
|
2751
|
+
```
|
|
2752
|
+
|
|
2753
|
+
</details>
|
|
2754
|
+
|
|
2755
|
+
---
|
|
2756
|
+
|
|
2757
|
+
# Trip
|
|
2758
|
+
|
|
2759
|
+
## Overview
|
|
2760
|
+
|
|
2761
|
+
The `Trip` class provides methods for managing device trips, including creating, retrieving, updating, listing, and deleting trip records. Trips represent journeys or data collection periods for devices. Below are the details for each method, including parameters, return types, and example usage.
|
|
2762
|
+
|
|
2763
|
+
## Types
|
|
2764
|
+
|
|
2765
|
+
### TripParams
|
|
2766
|
+
|
|
2767
|
+
```typescript
|
|
2768
|
+
interface TripParams {
|
|
2769
|
+
space_device: string; // The unique identifier of the device associated with this trip
|
|
2770
|
+
start_at: string; // The start timestamp of the trip (ISO 8601 format)
|
|
2771
|
+
ended_at: string; // The end timestamp of the trip (ISO 8601 format)
|
|
2772
|
+
}
|
|
2773
|
+
```
|
|
2774
|
+
|
|
2775
|
+
### TripListParams
|
|
2776
|
+
|
|
2777
|
+
```typescript
|
|
2778
|
+
interface TripListParams extends ListParamsResponse {
|
|
2779
|
+
include_checkpoints?: boolean; // Whether to include checkpoints in the response
|
|
2780
|
+
}
|
|
2781
|
+
```
|
|
2782
|
+
|
|
2783
|
+
This interface extends `ListParamsResponse` which includes:
|
|
2784
|
+
|
|
2785
|
+
- `limit?: number` - Number of results to return per page
|
|
2786
|
+
- `offset?: number` - The initial index from which to return the results
|
|
2787
|
+
- `ordering?: string` - Which field to use when ordering the results
|
|
2788
|
+
- `search?: string` - A search term to filter results
|
|
2789
|
+
|
|
2790
|
+
### TripListResponse
|
|
2791
|
+
|
|
2792
|
+
```typescript
|
|
2793
|
+
type TripListResponse = ListResponse<TripParams>;
|
|
2794
|
+
```
|
|
2795
|
+
|
|
2796
|
+
Where `ListResponse<T>` includes:
|
|
2797
|
+
|
|
2798
|
+
- `count: number` - Total number of trips matching the query
|
|
2799
|
+
- `results: TripParams[]` - Array of trip objects
|
|
2800
|
+
- `next?: string | null` - URL to the next page of results, or null
|
|
2801
|
+
- `previous?: string | null` - URL to the previous page of results, or null
|
|
2802
|
+
|
|
2803
|
+
<details>
|
|
2804
|
+
<summary><strong>create</strong></summary>
|
|
2805
|
+
|
|
2806
|
+
Create a new trip record.
|
|
2807
|
+
|
|
2808
|
+
**Signature:**
|
|
2809
|
+
|
|
2810
|
+
```typescript
|
|
2811
|
+
create(params: TripParams, options?: Core.RequestOptions): Core.APIPromise<TripParams>
|
|
2812
|
+
```
|
|
2813
|
+
|
|
2814
|
+
**Parameters:**
|
|
2815
|
+
|
|
2816
|
+
- `params` _(TripParams)_: Parameters for creating a new trip.
|
|
2817
|
+
- `space_device`: _(string)_: The unique identifier of the device associated with this trip.
|
|
2818
|
+
- `start_at`: _(string)_: The start timestamp of the trip (ISO 8601 format).
|
|
2819
|
+
- `ended_at`: _(string)_: The end timestamp of the trip (ISO 8601 format).
|
|
2820
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2821
|
+
|
|
2822
|
+
**Returns:** `Promise<TripParams>`
|
|
2823
|
+
|
|
2824
|
+
**Example:**
|
|
2825
|
+
|
|
2826
|
+
```typescript
|
|
2827
|
+
const newTrip = await client.trip.create({
|
|
2828
|
+
space_device: 'device-uuid-123',
|
|
2829
|
+
start_at: '2024-01-15T08:00:00Z',
|
|
2830
|
+
ended_at: '2024-01-15T18:30:00Z',
|
|
2831
|
+
});
|
|
2832
|
+
```
|
|
2833
|
+
|
|
2834
|
+
</details>
|
|
2835
|
+
|
|
2836
|
+
<details>
|
|
2837
|
+
<summary><strong>retrieve</strong></summary>
|
|
2838
|
+
|
|
2839
|
+
Retrieve details of a trip by its ID.
|
|
2840
|
+
|
|
2841
|
+
**Signature:**
|
|
2842
|
+
|
|
2843
|
+
```typescript
|
|
2844
|
+
retrieve(id: string, params: TripListParams, options?: Core.RequestOptions): Core.APIPromise<TripParams>
|
|
2845
|
+
```
|
|
2846
|
+
|
|
2847
|
+
**Parameters:**
|
|
2848
|
+
|
|
2849
|
+
- `id` _(string)_: The unique identifier of the trip to retrieve.
|
|
2850
|
+
- `params` _(TripListParams)_: Query parameters for the request.
|
|
2851
|
+
- `include_checkpoints` _(boolean, optional)_: Whether to include checkpoints in the response.
|
|
2852
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
2853
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
2854
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2855
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2856
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2857
|
+
|
|
2858
|
+
**Returns:** `Promise<TripParams>`
|
|
2859
|
+
|
|
2860
|
+
**Example:**
|
|
2861
|
+
|
|
2862
|
+
```typescript
|
|
2863
|
+
const trip = await client.trip.retrieve('trip-uuid-456', {
|
|
2864
|
+
include_checkpoints: true,
|
|
2865
|
+
});
|
|
2866
|
+
console.log(trip.space_device);
|
|
2867
|
+
```
|
|
2868
|
+
|
|
2869
|
+
</details>
|
|
2870
|
+
|
|
2871
|
+
<details>
|
|
2872
|
+
<summary><strong>list</strong></summary>
|
|
2873
|
+
|
|
2874
|
+
List trips with optional filtering, ordering, and pagination.
|
|
2875
|
+
|
|
2876
|
+
**Signature:**
|
|
2877
|
+
|
|
2878
|
+
```typescript
|
|
2879
|
+
list(params: TripListParams & { space_device__device_id: string }, options?: Core.RequestOptions): Core.APIPromise<TripListResponse>
|
|
2880
|
+
```
|
|
2881
|
+
|
|
2882
|
+
**Parameters:**
|
|
2883
|
+
|
|
2884
|
+
- `params` _(TripListParams & { space_device\_\_device_id: string })_: Query parameters for filtering, ordering, and pagination:
|
|
2885
|
+
- `space_device__device_id` _(string)_: **Required.** The device ID to filter trips by.
|
|
2886
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
2887
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
2888
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
2889
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
2890
|
+
- `include_checkpoints` _(boolean, optional)_: Whether to include checkpoints in the response.
|
|
2891
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2892
|
+
|
|
2893
|
+
**Returns:** `Promise<TripListResponse>`
|
|
2894
|
+
|
|
2895
|
+
**Response shape:**
|
|
2896
|
+
|
|
2897
|
+
- `count` _(integer)_: Total number of trips matching the query.
|
|
2898
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
2899
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
2900
|
+
- `results` _(TripParams[])_: Array of trip objects.
|
|
2901
|
+
|
|
2902
|
+
**Example:**
|
|
2903
|
+
|
|
2904
|
+
```typescript
|
|
2905
|
+
const listResponse = await client.trip.list({
|
|
2906
|
+
space_device__device_id: 'device-uuid-123',
|
|
2907
|
+
ordering: 'start_at',
|
|
2908
|
+
limit: 20,
|
|
2909
|
+
offset: 0,
|
|
2910
|
+
include_checkpoints: false,
|
|
2911
|
+
});
|
|
2912
|
+
console.log(listResponse.results);
|
|
2913
|
+
```
|
|
2914
|
+
|
|
2915
|
+
</details>
|
|
2916
|
+
|
|
2917
|
+
<details>
|
|
2918
|
+
<summary><strong>update</strong></summary>
|
|
2919
|
+
|
|
2920
|
+
Update an existing trip by its ID (full update).
|
|
2921
|
+
|
|
2922
|
+
**Signature:**
|
|
2923
|
+
|
|
2924
|
+
```typescript
|
|
2925
|
+
update(id: string, params: TripParams, options?: Core.RequestOptions): Core.APIPromise<TripParams>
|
|
2926
|
+
```
|
|
2927
|
+
|
|
2928
|
+
**Parameters:**
|
|
2929
|
+
|
|
2930
|
+
- `id` _(string)_: The unique identifier of the trip to update.
|
|
2931
|
+
- `params` _(TripParams)_: Parameters for updating the trip.
|
|
2932
|
+
- `space_device`: _(string)_: The unique identifier of the device associated with this trip.
|
|
2933
|
+
- `start_at`: _(string)_: The start timestamp of the trip (ISO 8601 format).
|
|
2934
|
+
- `ended_at`: _(string)_: The end timestamp of the trip (ISO 8601 format).
|
|
2935
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2936
|
+
|
|
2937
|
+
**Returns:** `Promise<TripParams>`
|
|
2938
|
+
|
|
2939
|
+
**Example:**
|
|
2940
|
+
|
|
2941
|
+
```typescript
|
|
2942
|
+
const updatedTrip = await client.trip.update('trip-uuid-456', {
|
|
2943
|
+
space_device: 'device-uuid-123',
|
|
2944
|
+
start_at: '2024-01-15T09:00:00Z',
|
|
2945
|
+
ended_at: '2024-01-15T19:00:00Z',
|
|
2946
|
+
});
|
|
2947
|
+
```
|
|
2948
|
+
|
|
2949
|
+
</details>
|
|
2950
|
+
|
|
2951
|
+
<details>
|
|
2952
|
+
<summary><strong>partialUpdate</strong></summary>
|
|
2953
|
+
|
|
2954
|
+
Partially update an existing trip by its ID.
|
|
2955
|
+
|
|
2956
|
+
**Signature:**
|
|
2957
|
+
|
|
2958
|
+
```typescript
|
|
2959
|
+
partialUpdate(id: string, params: Partial<TripParams>, options?: Core.RequestOptions): Core.APIPromise<TripParams>
|
|
2960
|
+
```
|
|
2961
|
+
|
|
2962
|
+
**Parameters:**
|
|
2963
|
+
|
|
2964
|
+
- `id` _(string)_: The unique identifier of the trip to update.
|
|
2965
|
+
- `params` _(Partial<TripParams>)_: Parameters for partially updating the trip. Only provided fields will be updated.
|
|
2966
|
+
- `space_device` _(string, optional)_: The unique identifier of the device associated with this trip.
|
|
2967
|
+
- `start_at` _(string, optional)_: The start timestamp of the trip (ISO 8601 format).
|
|
2968
|
+
- `ended_at` _(string, optional)_: The end timestamp of the trip (ISO 8601 format).
|
|
2969
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2970
|
+
|
|
2971
|
+
**Returns:** `Promise<TripParams>`
|
|
2972
|
+
|
|
2973
|
+
**Example:**
|
|
2974
|
+
|
|
2975
|
+
```typescript
|
|
2976
|
+
const partiallyUpdatedTrip = await client.trip.partialUpdate('trip-uuid-456', {
|
|
2977
|
+
ended_at: '2024-01-15T20:00:00Z',
|
|
2978
|
+
});
|
|
2979
|
+
```
|
|
2980
|
+
|
|
2981
|
+
</details>
|
|
2982
|
+
|
|
2983
|
+
<details>
|
|
2984
|
+
<summary><strong>delete</strong></summary>
|
|
2985
|
+
|
|
2986
|
+
Delete a trip by its ID.
|
|
2987
|
+
|
|
2988
|
+
**Signature:**
|
|
2989
|
+
|
|
2990
|
+
```typescript
|
|
2991
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
2992
|
+
```
|
|
2993
|
+
|
|
2994
|
+
**Parameters:**
|
|
2995
|
+
|
|
2996
|
+
- `id` _(string)_: The unique identifier of the trip to delete.
|
|
2997
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
2998
|
+
|
|
2999
|
+
**Returns:** `Promise<void>`
|
|
3000
|
+
|
|
3001
|
+
**Example:**
|
|
3002
|
+
|
|
3003
|
+
```typescript
|
|
3004
|
+
await client.trip.delete('trip-uuid-456');
|
|
3005
|
+
```
|
|
3006
|
+
|
|
3007
|
+
</details>
|
|
3008
|
+
|
|
3009
|
+
---
|
|
3010
|
+
|
|
3011
|
+
# Telemetry
|
|
3012
|
+
|
|
3013
|
+
## Overview
|
|
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).
|
|
3016
|
+
|
|
3017
|
+
## Methods
|
|
3018
|
+
|
|
3019
|
+
<details>
|
|
3020
|
+
<summary><strong>entities.list</strong></summary>
|
|
3021
|
+
|
|
3022
|
+
List telemetry entities with optional filtering, ordering, and pagination.
|
|
3023
|
+
|
|
3024
|
+
**Signature:**
|
|
3025
|
+
|
|
3026
|
+
```typescript
|
|
3027
|
+
list(params: EntitiesListParams, options?: Core.RequestOptions): Core.APIPromise<EntitiesListResponse>
|
|
3028
|
+
```
|
|
3029
|
+
|
|
3030
|
+
**Parameters:**
|
|
3031
|
+
|
|
3032
|
+
- `params` _(EntitiesListParams)_: Query parameters for filtering, ordering, and pagination:
|
|
3033
|
+
- `display_type` _(string, optional)_: Display type filter (e.g., "chart").
|
|
3034
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
3035
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
3036
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
3037
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
3038
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3039
|
+
|
|
3040
|
+
**Returns:** `Promise<EntitiesListResponse>`
|
|
3041
|
+
|
|
3042
|
+
**Response shape:**
|
|
3043
|
+
|
|
3044
|
+
- `count` _(integer)_: Total number of entities matching the query.
|
|
3045
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
3046
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
3047
|
+
- `results` _(Entity[])_: Array of entity objects.
|
|
3048
|
+
|
|
3049
|
+
**Example:**
|
|
3050
|
+
|
|
3051
|
+
```typescript
|
|
3052
|
+
const entities = await client.telemetry.entities.list({
|
|
3053
|
+
display_type: 'chart',
|
|
3054
|
+
search: 'Water Depth',
|
|
3055
|
+
limit: 10,
|
|
3056
|
+
offset: 0,
|
|
3057
|
+
});
|
|
3058
|
+
console.log(entities.results);
|
|
3059
|
+
```
|
|
3060
|
+
|
|
3061
|
+
**Example with minimal parameters:**
|
|
3062
|
+
|
|
3063
|
+
```typescript
|
|
3064
|
+
const entities = await client.telemetry.entities.list({
|
|
3065
|
+
display_type: 'chart',
|
|
3066
|
+
search: 'Water Depth',
|
|
3067
|
+
});
|
|
3068
|
+
console.log(entities.count);
|
|
3069
|
+
```
|
|
3070
|
+
|
|
3071
|
+
</details>
|
|
3072
|
+
|
|
3073
|
+
<details>
|
|
3074
|
+
<summary><strong>alerts.list</strong></summary>
|
|
3075
|
+
|
|
3076
|
+
List telemetry alerts with optional filtering, ordering, and pagination.
|
|
3077
|
+
|
|
3078
|
+
**Signature:**
|
|
3079
|
+
|
|
3080
|
+
```typescript
|
|
3081
|
+
list(params: AlertsListParams, options?: Core.RequestOptions): Core.APIPromise<AlertsListResponse>
|
|
3082
|
+
```
|
|
3083
|
+
|
|
3084
|
+
**Parameters:**
|
|
3085
|
+
|
|
3086
|
+
- `params` _(AlertsListParams)_: Query parameters for filtering, ordering, and pagination:
|
|
3087
|
+
- `search` _(string, optional)_: A search term to filter results.
|
|
3088
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
3089
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
3090
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
3091
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3092
|
+
|
|
3093
|
+
**Returns:** `Promise<AlertsListResponse>`
|
|
3094
|
+
|
|
3095
|
+
**Response shape:**
|
|
3096
|
+
|
|
3097
|
+
- `count` _(integer)_: Total number of alerts matching the query.
|
|
3098
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
3099
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
3100
|
+
- `results` _(Alert[])_: Array of alert objects.
|
|
3101
|
+
|
|
3102
|
+
**Example:**
|
|
3103
|
+
|
|
3104
|
+
```typescript
|
|
3105
|
+
const alerts = await client.telemetry.alerts.list({
|
|
3106
|
+
search: 'critical',
|
|
3107
|
+
limit: 10,
|
|
3108
|
+
offset: 0,
|
|
3109
|
+
});
|
|
3110
|
+
console.log(alerts.results);
|
|
3111
|
+
```
|
|
3112
|
+
|
|
3113
|
+
**Example with minimal parameters:**
|
|
3114
|
+
|
|
3115
|
+
```typescript
|
|
3116
|
+
const alerts = await client.telemetry.alerts.list({
|
|
3117
|
+
search: 'critical',
|
|
3118
|
+
});
|
|
3119
|
+
console.log(alerts.count);
|
|
3120
|
+
```
|
|
3121
|
+
|
|
3122
|
+
</details>
|
|
3123
|
+
|
|
3124
|
+
<details>
|
|
3125
|
+
<summary><strong>geofences.list</strong></summary>
|
|
3126
|
+
|
|
3127
|
+
List geofences with optional filtering and pagination.
|
|
3128
|
+
|
|
3129
|
+
**Signature:**
|
|
3130
|
+
|
|
3131
|
+
```typescript
|
|
3132
|
+
list(params: GeofencesListParams, options?: Core.RequestOptions): Core.APIPromise<GeofencesListResponse>
|
|
3133
|
+
```
|
|
3134
|
+
|
|
3135
|
+
**Parameters:**
|
|
3136
|
+
|
|
3137
|
+
- `params` _(GeofencesListParams)_: Query parameters for filtering and pagination:
|
|
3138
|
+
- `name` _(string, optional)_: Filter geofences by name.
|
|
3139
|
+
- `bbox` _(string, optional)_: Filter geofences by bounding box (format: `minLon,minLat,maxLon,maxLat`).
|
|
3140
|
+
- `ordering` _(string, optional)_: Which field to use when ordering the results.
|
|
3141
|
+
- `limit` _(integer, optional)_: Number of results to return per page.
|
|
3142
|
+
- `offset` _(integer, optional)_: The initial index from which to return the results.
|
|
3143
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3144
|
+
|
|
3145
|
+
**Returns:** `Promise<GeofencesListResponse>`
|
|
3146
|
+
|
|
3147
|
+
**Response shape:**
|
|
3148
|
+
|
|
3149
|
+
- `count` _(integer)_: Total number of geofences matching the query.
|
|
3150
|
+
- `next` _(string | null)_: URL to the next page of results, or `null`.
|
|
3151
|
+
- `previous` _(string | null)_: URL to the previous page of results, or `null`.
|
|
3152
|
+
- `results` _(Geofence[])_: Array of geofence objects.
|
|
3153
|
+
|
|
3154
|
+
**Example:**
|
|
3155
|
+
|
|
3156
|
+
```typescript
|
|
3157
|
+
const geofences = await client.telemetry.geofences.list({
|
|
3158
|
+
name: 'Warehouse',
|
|
3159
|
+
limit: 10,
|
|
3160
|
+
offset: 0,
|
|
3161
|
+
});
|
|
3162
|
+
console.log(geofences.results);
|
|
3163
|
+
```
|
|
3164
|
+
|
|
3165
|
+
</details>
|
|
3166
|
+
|
|
3167
|
+
<details>
|
|
3168
|
+
<summary><strong>geofences.create</strong></summary>
|
|
3169
|
+
|
|
3170
|
+
Create a new geofence.
|
|
3171
|
+
|
|
3172
|
+
**Signature:**
|
|
3173
|
+
|
|
3174
|
+
```typescript
|
|
3175
|
+
create(params: Omit<Geofence, 'id'>, options?: Core.RequestOptions): Core.APIPromise<Geofence>
|
|
3176
|
+
```
|
|
3177
|
+
|
|
3178
|
+
**Parameters:**
|
|
3179
|
+
|
|
3180
|
+
- `params` _(Omit<Geofence, 'id'>)_: Geofence data (all fields except `id`):
|
|
3181
|
+
- `name` _(string)_: The name of the geofence.
|
|
3182
|
+
- `color` _(string)_: Display color for the geofence.
|
|
3183
|
+
- `type_zone` _('safe' | 'danger')_: Zone type.
|
|
3184
|
+
- `definition` _(object)_: Conditions (e.g. `conditions.and`).
|
|
3185
|
+
- `features` _(PolygonGeometry[])_: Polygon features for the geofence.
|
|
3186
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3187
|
+
|
|
3188
|
+
**Returns:** `Promise<Geofence>`
|
|
3189
|
+
|
|
3190
|
+
**Example:**
|
|
3191
|
+
|
|
3192
|
+
```typescript
|
|
3193
|
+
const newGeofence = await client.telemetry.geofences.create({
|
|
3194
|
+
name: 'Safe Zone A',
|
|
3195
|
+
color: '#00ff00',
|
|
3196
|
+
type_zone: 'safe',
|
|
3197
|
+
definition: { conditions: { and: [] } },
|
|
3198
|
+
features: [/* PolygonGeometry[] */],
|
|
3199
|
+
});
|
|
3200
|
+
console.log(newGeofence.id);
|
|
3201
|
+
```
|
|
3202
|
+
|
|
3203
|
+
</details>
|
|
3204
|
+
|
|
3205
|
+
<details>
|
|
3206
|
+
<summary><strong>geofences.retrieve</strong></summary>
|
|
3207
|
+
|
|
3208
|
+
Retrieve a geofence by its ID.
|
|
3209
|
+
|
|
3210
|
+
**Signature:**
|
|
3211
|
+
|
|
3212
|
+
```typescript
|
|
3213
|
+
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Geofence>
|
|
3214
|
+
```
|
|
3215
|
+
|
|
3216
|
+
**Parameters:**
|
|
3217
|
+
|
|
3218
|
+
- `id` _(string)_: The unique identifier of the geofence to retrieve.
|
|
3219
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3220
|
+
|
|
3221
|
+
**Returns:** `Promise<Geofence>`
|
|
3222
|
+
|
|
3223
|
+
**Example:**
|
|
3224
|
+
|
|
3225
|
+
```typescript
|
|
3226
|
+
const geofence = await client.telemetry.geofences.retrieve('123e4567-e89b-12d3-a456-426614174000');
|
|
3227
|
+
console.log(geofence.name);
|
|
3228
|
+
```
|
|
3229
|
+
|
|
3230
|
+
</details>
|
|
3231
|
+
|
|
3232
|
+
<details>
|
|
3233
|
+
<summary><strong>geofences.update</strong></summary>
|
|
3234
|
+
|
|
3235
|
+
Update an existing geofence by its ID (full update).
|
|
3236
|
+
|
|
3237
|
+
**Signature:**
|
|
3238
|
+
|
|
3239
|
+
```typescript
|
|
3240
|
+
update(id: string, params: Omit<Geofence, 'id'>, options?: Core.RequestOptions): Core.APIPromise<Geofence>
|
|
3241
|
+
```
|
|
3242
|
+
|
|
3243
|
+
**Parameters:**
|
|
3244
|
+
|
|
3245
|
+
- `id` _(string)_: The unique identifier of the geofence to update.
|
|
3246
|
+
- `params` _(Omit<Geofence, 'id'>)_: Updated geofence data (same shape as create).
|
|
3247
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3248
|
+
|
|
3249
|
+
**Returns:** `Promise<Geofence>`
|
|
3250
|
+
|
|
3251
|
+
**Example:**
|
|
3252
|
+
|
|
3253
|
+
```typescript
|
|
3254
|
+
const updatedGeofence = await client.telemetry.geofences.update('123e4567-e89b-12d3-a456-426614174000', {
|
|
3255
|
+
name: 'Safe Zone A Updated',
|
|
3256
|
+
color: '#00ff00',
|
|
3257
|
+
type_zone: 'safe',
|
|
3258
|
+
definition: { conditions: { and: [] } },
|
|
3259
|
+
features: [/* PolygonGeometry[] */],
|
|
3260
|
+
});
|
|
3261
|
+
```
|
|
3262
|
+
|
|
3263
|
+
</details>
|
|
3264
|
+
|
|
3265
|
+
<details>
|
|
3266
|
+
<summary><strong>geofences.test</strong></summary>
|
|
3267
|
+
|
|
3268
|
+
Validate a geofence payload (conditions/features) without creating or updating a saved geofence.
|
|
3269
|
+
|
|
3270
|
+
**Signature:**
|
|
3271
|
+
|
|
3272
|
+
```typescript
|
|
3273
|
+
test(params: Omit<Geofence, 'id' | 'name' | 'color'>, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
3274
|
+
```
|
|
3275
|
+
|
|
3276
|
+
**Parameters:**
|
|
3277
|
+
|
|
3278
|
+
- `params` _(Omit<Geofence, 'id' | 'name' | 'color'>)_: Geofence data to test:
|
|
3279
|
+
- `type_zone` _('safe' | 'danger')_: Zone type.
|
|
3280
|
+
- `definition` _(object)_: Conditions (e.g. `conditions.and`).
|
|
3281
|
+
- `features` _(PolygonGeometry[])_: Polygon features for the geofence.
|
|
3282
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3283
|
+
|
|
3284
|
+
**Returns:** `Promise<void>`
|
|
3285
|
+
|
|
3286
|
+
**Example:**
|
|
3287
|
+
|
|
3288
|
+
```typescript
|
|
3289
|
+
await client.telemetry.geofences.test({
|
|
3290
|
+
type_zone: 'safe',
|
|
3291
|
+
definition: { conditions: { and: [] } },
|
|
3292
|
+
features: [/* PolygonGeometry[] */],
|
|
3293
|
+
});
|
|
3294
|
+
```
|
|
3295
|
+
|
|
3296
|
+
</details>
|
|
3297
|
+
|
|
3298
|
+
<details>
|
|
3299
|
+
<summary><strong>geofences.delete</strong></summary>
|
|
3300
|
+
|
|
3301
|
+
Delete a geofence by its ID.
|
|
3302
|
+
|
|
3303
|
+
**Signature:**
|
|
3304
|
+
|
|
3305
|
+
```typescript
|
|
3306
|
+
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
3307
|
+
```
|
|
3308
|
+
|
|
3309
|
+
**Parameters:**
|
|
3310
|
+
|
|
3311
|
+
- `id` _(string)_: The unique identifier of the geofence to delete.
|
|
3312
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3313
|
+
|
|
3314
|
+
**Returns:** `Promise<void>`
|
|
3315
|
+
|
|
3316
|
+
**Example:**
|
|
3317
|
+
|
|
3318
|
+
```typescript
|
|
3319
|
+
await client.telemetry.geofences.delete('123e4567-e89b-12d3-a456-426614174000');
|
|
3320
|
+
```
|
|
3321
|
+
|
|
3322
|
+
</details>
|
|
3323
|
+
|
|
3324
|
+
---
|
|
3325
|
+
|
|
3326
|
+
# Organizations
|
|
3327
|
+
|
|
3328
|
+
## Overview
|
|
3329
|
+
|
|
3330
|
+
The `Organizations` class provides methods for managing organizations within an application.
|
|
3331
|
+
|
|
3332
|
+
## Methods
|
|
3333
|
+
|
|
3334
|
+
<details>
|
|
3335
|
+
<summary><strong>checkSlugName</strong></summary>
|
|
3336
|
+
|
|
3337
|
+
Check organizations by slug name.
|
|
3338
|
+
|
|
3339
|
+
**Signature:**
|
|
3340
|
+
|
|
3341
|
+
```typescript
|
|
3342
|
+
checkSlugName(slugName: string, options?: Core.RequestOptions): Core.APIPromise<void>
|
|
3343
|
+
```
|
|
3344
|
+
|
|
3345
|
+
**Parameters:**
|
|
3346
|
+
|
|
3347
|
+
- `slugName` _(string)_: A slug name string identifying this organization.
|
|
3348
|
+
- `options` _(Core.RequestOptions)_: Additional request options.
|
|
3349
|
+
|
|
3350
|
+
**Returns:** `Promise<void>`
|
|
3351
|
+
|
|
3352
|
+
**Example:**
|
|
3353
|
+
|
|
3354
|
+
```typescript
|
|
3355
|
+
await client.organizations.checkSlugName('danang');
|
|
3356
|
+
```
|
|
3357
|
+
|
|
3358
|
+
</details>
|