@space-df/sdk 0.0.1-dev.4 → 0.0.1-dev.40
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 +2056 -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 +91 -0
- package/dist/src/resources/telemetry/index.ts +12 -0
- package/dist/src/version.ts +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 +91 -0
- package/src/resources/telemetry/index.ts +12 -0
- package/src/version.ts +1 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { APIResource } from '@space-df/sdk/resource';
|
|
2
|
+
import { Entities } from "./entities.js";
|
|
3
|
+
import { Alerts } from "./alerts.js";
|
|
4
|
+
import { Geofences } from "./geofences.js";
|
|
5
|
+
export declare class Telemetry extends APIResource {
|
|
6
|
+
entities: Entities;
|
|
7
|
+
alerts: Alerts;
|
|
8
|
+
geofences: Geofences;
|
|
9
|
+
}
|
|
10
|
+
export * from "./entities.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/telemetry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAAa,SAAU,SAAQ,WAAW;IACtC,QAAQ,EAAE,QAAQ,CAA8B;IAChD,MAAM,EAAE,MAAM,CAA4B;IAC1C,SAAS,EAAE,SAAS,CAA+B;CACtD;AAED,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Telemetry = void 0;
|
|
18
|
+
const resource_1 = require("@space-df/sdk/resource");
|
|
19
|
+
const entities_1 = require("./entities.js");
|
|
20
|
+
const alerts_1 = require("./alerts.js");
|
|
21
|
+
const geofences_1 = require("./geofences.js");
|
|
22
|
+
class Telemetry extends resource_1.APIResource {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.entities = new entities_1.Entities(this._client);
|
|
26
|
+
this.alerts = new alerts_1.Alerts(this._client);
|
|
27
|
+
this.geofences = new geofences_1.Geofences(this._client);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.Telemetry = Telemetry;
|
|
31
|
+
__exportStar(require("./entities.js"), exports);
|
|
32
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/telemetry/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAAqD;AACrD,4CAAsC;AACtC,wCAAkC;AAClC,8CAAwC;AAExC,MAAa,SAAU,SAAQ,sBAAW;IAA1C;;QACI,aAAQ,GAAa,IAAI,mBAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChD,WAAM,GAAW,IAAI,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,cAAS,GAAc,IAAI,qBAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;CAAA;AAJD,8BAIC;AAED,gDAA2B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { APIResource } from '@space-df/sdk/resource';
|
|
2
|
+
import { Entities } from "./entities.mjs";
|
|
3
|
+
import { Alerts } from "./alerts.mjs";
|
|
4
|
+
import { Geofences } from "./geofences.mjs";
|
|
5
|
+
export class Telemetry extends APIResource {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.entities = new Entities(this._client);
|
|
9
|
+
this.alerts = new Alerts(this._client);
|
|
10
|
+
this.geofences = new Geofences(this._client);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export * from "./entities.mjs";
|
|
14
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/telemetry/index.ts"],"names":[],"mappings":"OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB;OAC7C,EAAE,QAAQ,EAAE;OACZ,EAAE,MAAM,EAAE;OACV,EAAE,SAAS,EAAE;AAEpB,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QACI,aAAQ,GAAa,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAChD,WAAM,GAAW,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,cAAS,GAAc,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;CAAA"}
|
package/dist/src/core.ts
CHANGED
|
@@ -128,7 +128,6 @@ export abstract class APIClient {
|
|
|
128
128
|
timeout: number;
|
|
129
129
|
httpAgent: Agent | undefined;
|
|
130
130
|
allowMultiOrgs: boolean;
|
|
131
|
-
APIKey: string | undefined;
|
|
132
131
|
|
|
133
132
|
private fetch: Fetch;
|
|
134
133
|
protected idempotencyHeader?: string;
|
|
@@ -139,7 +138,6 @@ export abstract class APIClient {
|
|
|
139
138
|
timeout = 60 * 1000, // 1 minute
|
|
140
139
|
httpAgent,
|
|
141
140
|
fetch: overriddenFetch,
|
|
142
|
-
APIKey,
|
|
143
141
|
allowMultiOrgs = false,
|
|
144
142
|
}: {
|
|
145
143
|
baseURL: string;
|
|
@@ -147,14 +145,12 @@ export abstract class APIClient {
|
|
|
147
145
|
timeout: number | undefined;
|
|
148
146
|
httpAgent: Agent | undefined;
|
|
149
147
|
fetch: Fetch | undefined;
|
|
150
|
-
APIKey: string | undefined;
|
|
151
148
|
allowMultiOrgs: boolean;
|
|
152
149
|
}) {
|
|
153
150
|
this.baseURL = baseURL;
|
|
154
151
|
this.maxRetries = validatePositiveInteger('maxRetries', maxRetries);
|
|
155
152
|
this.timeout = validatePositiveInteger('timeout', timeout);
|
|
156
153
|
this.httpAgent = httpAgent;
|
|
157
|
-
this.APIKey = APIKey;
|
|
158
154
|
this.allowMultiOrgs = allowMultiOrgs;
|
|
159
155
|
|
|
160
156
|
this.fetch = overriddenFetch ?? fetch;
|
|
@@ -684,7 +680,6 @@ export type RequestOptions<Req = unknown | Record<string, unknown> | Readable |
|
|
|
684
680
|
idempotencyKey?: string;
|
|
685
681
|
organization?: string;
|
|
686
682
|
accessToken?: string;
|
|
687
|
-
APIKey?: string;
|
|
688
683
|
|
|
689
684
|
__binaryRequest?: boolean | undefined;
|
|
690
685
|
__binaryResponse?: boolean | undefined;
|
|
@@ -708,7 +703,6 @@ const requestOptionsKeys: KeysEnum<RequestOptions> = {
|
|
|
708
703
|
idempotencyKey: true,
|
|
709
704
|
organization: true,
|
|
710
705
|
accessToken: true,
|
|
711
|
-
APIKey: true,
|
|
712
706
|
|
|
713
707
|
__binaryRequest: true,
|
|
714
708
|
__binaryResponse: true,
|
package/dist/src/index.ts
CHANGED
|
@@ -8,10 +8,6 @@ export interface ClientOptions {
|
|
|
8
8
|
* Defaults to process.env['SPACEDF_ORG_ID'].
|
|
9
9
|
*/
|
|
10
10
|
organization?: string | null | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* Defaults to process.env['SPACEDF_API_KEY'].
|
|
13
|
-
*/
|
|
14
|
-
APIKey?: string | undefined;
|
|
15
11
|
/**
|
|
16
12
|
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
17
13
|
*
|
|
@@ -74,6 +70,13 @@ export interface ClientOptions {
|
|
|
74
70
|
* @default false
|
|
75
71
|
*/
|
|
76
72
|
allowMultiOrgs?: boolean;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* By default, use the development environment.
|
|
76
|
+
*
|
|
77
|
+
* @default false
|
|
78
|
+
*/
|
|
79
|
+
development?: boolean;
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
/**
|
|
@@ -89,7 +92,6 @@ export class SpaceDFSDK extends Core.APIClient {
|
|
|
89
92
|
* API Client for interfacing with the Spacedf SDK API.
|
|
90
93
|
*
|
|
91
94
|
* @param {string | null | undefined} [opts.organization=process.env['SPACEDF_ORG_ID'] ?? null]
|
|
92
|
-
* @param {string | undefined} [opts.APIKey=process.env['SPACEDF_API_KEY']]
|
|
93
95
|
* @param {string} [opts.baseURL=process.env['SPACEDF_SDK_BASE_URL'] ?? https://api.v0.spacedf.net/] - Override the default base URL for the API.
|
|
94
96
|
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
95
97
|
* @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections.
|
|
@@ -102,28 +104,16 @@ export class SpaceDFSDK extends Core.APIClient {
|
|
|
102
104
|
constructor({
|
|
103
105
|
baseURL = Core.readEnv('SPACEDF_SDK_BASE_URL'),
|
|
104
106
|
organization = Core.readEnv('SPACEDF_ORG_ID') ?? null,
|
|
105
|
-
APIKey = Core.readEnv('SPACEDF_API_KEY'),
|
|
106
107
|
allowMultiOrgs = false,
|
|
107
108
|
...opts
|
|
108
109
|
}: ClientOptions = {}) {
|
|
109
|
-
if (!allowMultiOrgs) {
|
|
110
|
-
if (baseURL && organization)
|
|
111
|
-
throw new Errors.SpaceDFError('`baseURL` will be overridden by `organization`. You should only configure a single property.');
|
|
112
|
-
|
|
113
|
-
if (organization) {
|
|
114
|
-
baseURL = `https://${organization}.api.v0.spacedf.net/api`;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
110
|
const options: ClientOptions = {
|
|
119
111
|
organization,
|
|
120
|
-
|
|
121
|
-
baseURL: baseURL || `https://api.v0.spacedf.net/api`,
|
|
112
|
+
baseURL,
|
|
122
113
|
...opts,
|
|
123
114
|
};
|
|
124
115
|
|
|
125
116
|
super({
|
|
126
|
-
APIKey: options.APIKey,
|
|
127
117
|
baseURL: options.baseURL!,
|
|
128
118
|
timeout: options.timeout ?? 60 * 1000 /* 1 minute */,
|
|
129
119
|
httpAgent: options.httpAgent,
|
|
@@ -133,7 +123,6 @@ export class SpaceDFSDK extends Core.APIClient {
|
|
|
133
123
|
});
|
|
134
124
|
|
|
135
125
|
this._options = options;
|
|
136
|
-
this.APIKey = APIKey;
|
|
137
126
|
this.organization = organization;
|
|
138
127
|
}
|
|
139
128
|
|
|
@@ -143,10 +132,21 @@ export class SpaceDFSDK extends Core.APIClient {
|
|
|
143
132
|
spaceRoles: API.SpaceRoles = new API.SpaceRoles(this);
|
|
144
133
|
spaces: API.Spaces = new API.Spaces(this);
|
|
145
134
|
dashboards: API.Dashboards = new API.Dashboards(this);
|
|
135
|
+
widgets: API.Widgets = new API.Widgets(this);
|
|
146
136
|
deviceStates: API.DeviceStates = new API.DeviceStates(this);
|
|
147
137
|
oauth2: API.OAuth2 = new API.OAuth2(this);
|
|
148
138
|
credentials: API.Credentials = new API.Credentials(this);
|
|
149
139
|
users: API.Users = new API.Users(this);
|
|
140
|
+
presignedUrl: API.PresignedUrl = new API.PresignedUrl(this);
|
|
141
|
+
deviceConnector: API.DeviceConnector = new API.DeviceConnector(this);
|
|
142
|
+
deviceModel: API.DeviceModel = new API.DeviceModel(this);
|
|
143
|
+
device: API.Device = new API.Device(this);
|
|
144
|
+
manufacturers: API.Manufacturers = new API.Manufacturers(this);
|
|
145
|
+
networkServer: API.NetworkServer = new API.NetworkServer(this);
|
|
146
|
+
deviceSpaces: API.DeviceSpaces = new API.DeviceSpaces(this);
|
|
147
|
+
trip: API.Trip = new API.Trip(this);
|
|
148
|
+
organizations: API.Organizations = new API.Organizations(this);
|
|
149
|
+
telemetry: API.Telemetry = new API.Telemetry(this);
|
|
150
150
|
|
|
151
151
|
protected override defaultQuery(): Core.DefaultQuery | undefined {
|
|
152
152
|
return this._options.defaultQuery;
|
|
@@ -160,10 +160,10 @@ export class SpaceDFSDK extends Core.APIClient {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
protected override authHeaders(opts: Core.FinalRequestOptions): Core.Headers {
|
|
163
|
-
const
|
|
164
|
-
const
|
|
163
|
+
const accessToken = (this.allowMultiOrgs && opts.accessToken) || this.accessToken || '';
|
|
164
|
+
const Authorization = `Bearer ${accessToken}`;
|
|
165
165
|
|
|
166
|
-
return { Authorization
|
|
166
|
+
return accessToken ? { Authorization } : {};
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
public setAccessToken(token: string | null): void {
|
|
@@ -10,6 +10,22 @@ export class Auth extends APIResource {
|
|
|
10
10
|
return this._client.post(`/auth/oauth2/google`, { body, ...options });
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
googleLogin(body: GoogleLogin, options?: Core.RequestOptions): Core.APIPromise<AuthTokenPair> {
|
|
14
|
+
return this._client.post(`/auth/google/login`, { body, ...options });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
oauthSendOtp(body: OAuthSendEmail, options?: Core.RequestOptions): Core.APIPromise<OAuthSendEmail> {
|
|
18
|
+
return this._client.post(`/auth/send-otp`, { body, ...options });
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
forgetPassword(body: ForgetPasswordParams, options?: Core.RequestOptions): Core.APIPromise<ForgetPasswordParams> {
|
|
22
|
+
return this._client.post(`/auth/forget-password`, { body, ...options });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
sendEmailConfirm(body: OAuthSendEmail, options?: Core.RequestOptions): Core.APIPromise<OAuthSendEmail> {
|
|
26
|
+
return this._client.post(`/auth/send-email-confirm`, { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
|
|
13
29
|
oauth2SpaceDF(body: OAuthSpaceDF, options?: Core.RequestOptions): Core.APIPromise<OAuthSpaceDF> {
|
|
14
30
|
return this._client.post(`/auth/oauth2/spacedf-console`, { body, ...options });
|
|
15
31
|
}
|
|
@@ -25,6 +41,10 @@ export class Auth extends APIResource {
|
|
|
25
41
|
switchSpaces(body: AuthRefreshTokenParams, options?: Core.RequestOptions): Core.APIPromise<CustomTokenRefresh> {
|
|
26
42
|
return this._client.post(`/auth/spaces/switch`, { body, ...options });
|
|
27
43
|
}
|
|
44
|
+
|
|
45
|
+
changePassword(body: AuthChangePasswordParams, options?: Core.RequestOptions): Core.APIPromise<AuthChangePasswordParams> {
|
|
46
|
+
return this._client.put(`/auth/change-password`, { body, ...options });
|
|
47
|
+
}
|
|
28
48
|
}
|
|
29
49
|
|
|
30
50
|
export interface AuthTokenPair {
|
|
@@ -49,6 +69,14 @@ export interface OAuthLogin {
|
|
|
49
69
|
code_verifier: string;
|
|
50
70
|
}
|
|
51
71
|
|
|
72
|
+
export interface GoogleLogin {
|
|
73
|
+
authorization_code: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface OAuthSendEmail {
|
|
77
|
+
email: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
52
80
|
export interface OAuthSpaceDF {
|
|
53
81
|
code_verifier: string;
|
|
54
82
|
|
|
@@ -75,10 +103,20 @@ export interface AuthLoginParams {
|
|
|
75
103
|
password: string;
|
|
76
104
|
}
|
|
77
105
|
|
|
106
|
+
export interface ForgetPasswordParams {
|
|
107
|
+
token: string;
|
|
108
|
+
|
|
109
|
+
password: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface AuthChangePasswordParams {
|
|
113
|
+
password: string;
|
|
114
|
+
|
|
115
|
+
new_password: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
78
118
|
export interface AuthRefreshTokenParams {
|
|
79
119
|
refresh: string;
|
|
80
|
-
|
|
81
|
-
space: string;
|
|
82
120
|
}
|
|
83
121
|
|
|
84
122
|
export interface AuthRegisterParams {
|
|
@@ -89,4 +127,6 @@ export interface AuthRegisterParams {
|
|
|
89
127
|
first_name: string;
|
|
90
128
|
|
|
91
129
|
last_name: string;
|
|
130
|
+
|
|
131
|
+
otp: string;
|
|
92
132
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { APIResource } from '../../resource';
|
|
2
|
+
import * as Core from '../../core';
|
|
3
|
+
|
|
4
|
+
export class PresignedUrl extends APIResource {
|
|
5
|
+
get(options?: Core.RequestOptions): Core.APIPromise<PresignedUrlResponse> {
|
|
6
|
+
return this._client.get('/presigned-url', options);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface PresignedUrlResponse {
|
|
11
|
+
presigned_url: string;
|
|
12
|
+
file_name: string;
|
|
13
|
+
}
|
|
@@ -4,17 +4,28 @@ import { ListParamsResponse, ListResponse } from '../../types/api';
|
|
|
4
4
|
import * as Core from '../../core';
|
|
5
5
|
|
|
6
6
|
export class SpacePolicies extends APIResource {
|
|
7
|
-
retrieve(id: number, options?: Core.RequestOptions): Core.APIPromise<SpacePolicy> {
|
|
8
|
-
|
|
7
|
+
retrieve(id: number, params: SpacePolicyParams, options?: Core.RequestOptions): Core.APIPromise<SpacePolicy> {
|
|
8
|
+
const { 'X-Space': xspace } = params;
|
|
9
|
+
return this._client.get(`/space-policies/${id}`, {
|
|
10
|
+
...options,
|
|
11
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
12
|
+
});
|
|
9
13
|
}
|
|
10
14
|
|
|
11
|
-
list(query?: SpacePolicyListParams, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
12
|
-
list(options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
13
|
-
list(query: SpacePolicyListParams | Core.RequestOptions = {}, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse> {
|
|
15
|
+
list(spaceName: string, query?: SpacePolicyListParams, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
16
|
+
list(spaceName: string, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse>;
|
|
17
|
+
list(spaceName: string, query: SpacePolicyListParams | Core.RequestOptions = {}, options?: Core.RequestOptions): Core.APIPromise<SpacePolicyListResponse> {
|
|
14
18
|
if (isRequestOptions(query)) {
|
|
15
|
-
return this.list({}, query);
|
|
19
|
+
return this.list(spaceName, {}, query);
|
|
16
20
|
}
|
|
17
|
-
|
|
21
|
+
const mergedOptions: Core.RequestOptions = {
|
|
22
|
+
...options,
|
|
23
|
+
headers: {
|
|
24
|
+
...(options?.headers || {}),
|
|
25
|
+
'X-Space': spaceName,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
return this._client.get(`/space-policies`, { query, ...mergedOptions });
|
|
18
29
|
}
|
|
19
30
|
}
|
|
20
31
|
|
|
@@ -53,3 +64,7 @@ export interface SpacePolicy {
|
|
|
53
64
|
export type SpacePolicyListResponse = ListResponse<SpacePolicy>;
|
|
54
65
|
|
|
55
66
|
export type SpacePolicyListParams = ListParamsResponse;
|
|
67
|
+
|
|
68
|
+
export interface SpacePolicyParams {
|
|
69
|
+
'X-Space': string;
|
|
70
|
+
}
|
|
@@ -3,26 +3,54 @@ import { ListParamsResponse, ListResponse } from '../../types/api';
|
|
|
3
3
|
import * as Core from '../../core';
|
|
4
4
|
|
|
5
5
|
export class SpaceRoleUsers extends APIResource {
|
|
6
|
-
retrieve(id: number, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUser> {
|
|
6
|
+
retrieve(id: number, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUser> {
|
|
7
|
+
const { 'X-Space': xspace } = params;
|
|
7
8
|
return this._client.get(`/space-role-users/${id}`, {
|
|
8
9
|
...options,
|
|
9
|
-
headers: { ...options?.headers },
|
|
10
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserListResponse> {
|
|
14
|
+
list(spaceName: string, params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserListResponse> {
|
|
14
15
|
const { ...query } = params;
|
|
15
16
|
return this._client.get(`/space-role-users`, {
|
|
16
17
|
query,
|
|
17
18
|
...options,
|
|
18
|
-
headers: { ...options?.headers },
|
|
19
|
+
headers: { ...options?.headers, 'X-Space': spaceName },
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
update(id: number, params: SpaceRoleUserUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserUpdateParams> {
|
|
24
|
+
const { 'X-Space': xspace, ...body } = params;
|
|
25
|
+
return this._client.put(`/space-role-users/${id}`, {
|
|
26
|
+
body,
|
|
27
|
+
...options,
|
|
28
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
partialUpdate(id: number, params: SpaceRoleUserUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleUserUpdateParams> {
|
|
33
|
+
const { 'X-Space': xspace, ...body } = params;
|
|
34
|
+
return this._client.patch(`/space-role-users/${id}`, {
|
|
35
|
+
body,
|
|
36
|
+
...options,
|
|
37
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
setSpaceDefault(id: String, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
42
|
+
const { 'X-Space': xspace } = params;
|
|
43
|
+
return this._client.post(`/space-role-users/${id}/default`, {
|
|
44
|
+
...options,
|
|
45
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
delete(id: number, params: SpaceRoleUsersParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
50
|
+
const { 'X-Space': xspace } = params;
|
|
23
51
|
return this._client.delete(`/space-role-users/${id}`, {
|
|
24
52
|
...options,
|
|
25
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
53
|
+
headers: { Accept: '*/*', ...options?.headers, 'X-Space': xspace },
|
|
26
54
|
});
|
|
27
55
|
}
|
|
28
56
|
}
|
|
@@ -39,4 +67,13 @@ export interface SpaceRoleUser {
|
|
|
39
67
|
readonly updated_at?: string;
|
|
40
68
|
}
|
|
41
69
|
|
|
70
|
+
export interface SpaceRoleUserUpdateParams {
|
|
71
|
+
space_role: string;
|
|
72
|
+
'X-Space': string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface SpaceRoleUsersParams {
|
|
76
|
+
'X-Space': string;
|
|
77
|
+
}
|
|
78
|
+
|
|
42
79
|
export type SpaceRoleUserListResponse = ListResponse<SpaceRoleUser>;
|
|
@@ -4,52 +4,54 @@ import * as Core from '../../core';
|
|
|
4
4
|
|
|
5
5
|
export class SpaceRoles extends APIResource {
|
|
6
6
|
create(params: SpaceRoleCreateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
|
|
7
|
-
const { ...body } = params;
|
|
7
|
+
const { 'X-Space': xspace, ...body } = params;
|
|
8
8
|
return this._client.post(`/space-roles`, {
|
|
9
9
|
body,
|
|
10
10
|
...options,
|
|
11
|
-
headers: { ...options?.headers },
|
|
11
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
retrieve(id: number, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
|
|
15
|
+
retrieve(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
|
|
16
|
+
const { 'X-Space': xspace } = params;
|
|
16
17
|
return this._client.get(`/space-roles/${id}`, {
|
|
17
18
|
...options,
|
|
18
|
-
headers: { ...options?.headers },
|
|
19
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
update(id: number, params: SpaceRoleUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
|
|
23
|
-
const { ...body } = params;
|
|
24
|
+
const { 'X-Space': xspace, ...body } = params;
|
|
24
25
|
return this._client.put(`/space-roles/${id}`, {
|
|
25
26
|
body,
|
|
26
27
|
...options,
|
|
27
|
-
headers: { ...options?.headers },
|
|
28
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
partialUpdate(id: number, params: SpaceRoleUpdateParams, options?: Core.RequestOptions): Core.APIPromise<SpaceRole> {
|
|
32
|
-
const { ...body } = params;
|
|
33
|
+
const { 'X-Space': xspace, ...body } = params;
|
|
33
34
|
return this._client.patch(`/space-roles/${id}`, {
|
|
34
35
|
body,
|
|
35
36
|
...options,
|
|
36
|
-
headers: { ...options?.headers },
|
|
37
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
list(params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleListResponse> {
|
|
41
|
+
list(spaceName: string, params: ListParamsResponse, options?: Core.RequestOptions): Core.APIPromise<SpaceRoleListResponse> {
|
|
41
42
|
const { ...query } = params;
|
|
42
43
|
return this._client.get(`/space-roles`, {
|
|
43
44
|
query,
|
|
44
45
|
...options,
|
|
45
|
-
headers: { ...options?.headers },
|
|
46
|
+
headers: { ...options?.headers, 'X-Space': spaceName },
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
delete(id: number, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
50
|
+
delete(id: number, params: SpaceRoleParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
51
|
+
const { 'X-Space': xspace } = params;
|
|
50
52
|
return this._client.delete(`/space-roles/${id}`, {
|
|
51
53
|
...options,
|
|
52
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
54
|
+
headers: { Accept: '*/*', ...options?.headers, 'X-Space': xspace },
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
57
|
}
|
|
@@ -80,6 +82,11 @@ export interface SpaceRoleCreateParams {
|
|
|
80
82
|
* Body param:
|
|
81
83
|
*/
|
|
82
84
|
policies: Array<number>;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Header param:
|
|
88
|
+
*/
|
|
89
|
+
'X-Space': string;
|
|
83
90
|
}
|
|
84
91
|
|
|
85
92
|
export interface SpaceRoleUpdateParams {
|
|
@@ -92,4 +99,12 @@ export interface SpaceRoleUpdateParams {
|
|
|
92
99
|
* Body param:
|
|
93
100
|
*/
|
|
94
101
|
policies: Array<number>;
|
|
102
|
+
/**
|
|
103
|
+
* Header param:
|
|
104
|
+
*/
|
|
105
|
+
'X-Space': string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface SpaceRoleParams {
|
|
109
|
+
'X-Space': string;
|
|
95
110
|
}
|
|
@@ -9,20 +9,20 @@ export class Spaces extends APIResource {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
update(params: SpaceUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Space> {
|
|
12
|
-
const { ...body } = params;
|
|
12
|
+
const { 'X-Space': xspace, ...body } = params;
|
|
13
13
|
return this._client.put(`/spaces`, {
|
|
14
14
|
body,
|
|
15
15
|
...options,
|
|
16
|
-
headers: { ...options?.headers },
|
|
16
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
partialUpdate(params: SpaceUpdateParams
|
|
21
|
-
const { ...body } = params;
|
|
20
|
+
partialUpdate(params: Partial<SpaceUpdateParams>, options?: Core.RequestOptions): Core.APIPromise<Space> {
|
|
21
|
+
const { 'X-Space': xspace, ...body } = params;
|
|
22
22
|
return this._client.patch(`/spaces`, {
|
|
23
23
|
body,
|
|
24
24
|
...options,
|
|
25
|
-
headers: { ...options?.headers },
|
|
25
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -39,13 +39,26 @@ export class Spaces extends APIResource {
|
|
|
39
39
|
headers: { ...options?.headers },
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
delete(params: SpaceParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
43
|
+
const { 'X-Space': xspace } = params;
|
|
44
44
|
return this._client.delete(`/spaces`, {
|
|
45
45
|
...options,
|
|
46
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
46
|
+
headers: { Accept: '*/*', ...options?.headers, 'X-Space': xspace },
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
+
|
|
50
|
+
invitation(params: OAuthInvitationParams, options?: Core.RequestOptions): Core.APIPromise<OAuthInvitationParams> {
|
|
51
|
+
const { 'X-Space': xspace, ...body } = params;
|
|
52
|
+
return this._client.post(`/spaces/invitation`, {
|
|
53
|
+
body,
|
|
54
|
+
...options,
|
|
55
|
+
headers: { ...options?.headers, 'X-Space': xspace },
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
joinSpace(token: string, options?: Core.RequestOptions): Core.APIPromise<JoinSpaceResponse> {
|
|
60
|
+
return this._client.get(`/spaces/join-space/${token}`, options);
|
|
61
|
+
}
|
|
49
62
|
}
|
|
50
63
|
|
|
51
64
|
export interface Space {
|
|
@@ -90,9 +103,13 @@ export interface SpaceUpdateParams {
|
|
|
90
103
|
name: string;
|
|
91
104
|
|
|
92
105
|
/**
|
|
93
|
-
*
|
|
106
|
+
* Header param:
|
|
94
107
|
*/
|
|
95
|
-
|
|
108
|
+
'X-Space': string;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface SpaceParams {
|
|
112
|
+
'X-Space': string;
|
|
96
113
|
}
|
|
97
114
|
|
|
98
115
|
export interface SpaceUpdateParams {
|
|
@@ -106,13 +123,23 @@ export interface SpaceUpdateParams {
|
|
|
106
123
|
*/
|
|
107
124
|
name: string;
|
|
108
125
|
|
|
109
|
-
/**
|
|
110
|
-
* Body param:
|
|
111
|
-
*/
|
|
112
|
-
slug_name: string;
|
|
113
|
-
|
|
114
126
|
/**
|
|
115
127
|
* Body param:
|
|
116
128
|
*/
|
|
117
129
|
is_active?: boolean;
|
|
118
130
|
}
|
|
131
|
+
|
|
132
|
+
export interface OAuthInvitationParams {
|
|
133
|
+
receiver_list: Receiver[];
|
|
134
|
+
'X-Space': string;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface Receiver {
|
|
138
|
+
email: string;
|
|
139
|
+
space_role_id: string;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface JoinSpaceResponse {
|
|
143
|
+
error?: string;
|
|
144
|
+
result?: string;
|
|
145
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { APIResource } from '../../resource';
|
|
2
|
+
import * as Core from '../../core';
|
|
3
|
+
|
|
4
|
+
export class Widgets extends APIResource {
|
|
5
|
+
updateWidgets(dashboardId: string, params: WidgetsUpdateParams[], options?: Core.RequestOptions): Core.APIPromise<WidgetsUpdateParams[]> {
|
|
6
|
+
return this._client.put(`/dashboards/${dashboardId}/widgets/bulk-update`, {
|
|
7
|
+
body: params,
|
|
8
|
+
...options,
|
|
9
|
+
headers: { ...options?.headers },
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface WidgetsUpdateParams {
|
|
15
|
+
id: string;
|
|
16
|
+
configuration: Record<string, unknown>;
|
|
17
|
+
}
|