hcloud-sdk 16.0.0 → 17.0.0
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/changelog.md +78 -51
- package/lib/Hcloud.d.ts +3 -0
- package/lib/Hcloud.js +7 -0
- package/lib/helper/ValidationHelper.d.ts +66 -0
- package/lib/helper/ValidationHelper.js +312 -0
- package/lib/interfaces/auditor/index.d.ts +6 -2
- package/lib/interfaces/auditor/index.js +4 -0
- package/lib/interfaces/friday/index.d.ts +3 -0
- package/lib/interfaces/friday/index.js +19 -0
- package/lib/interfaces/friday/space/database/document/index.d.ts +34 -0
- package/lib/interfaces/friday/space/database/document/index.js +13 -0
- package/lib/interfaces/friday/space/database/index.d.ts +12 -0
- package/lib/interfaces/friday/space/database/index.js +2 -0
- package/lib/interfaces/friday/space/index.d.ts +21 -0
- package/lib/interfaces/friday/space/index.js +11 -0
- package/lib/interfaces/frontend/config/index.d.ts +1 -0
- package/lib/interfaces/fuse/space/index.d.ts +1 -0
- package/lib/interfaces/global/Products.d.ts +3 -1
- package/lib/interfaces/global/Products.js +2 -0
- package/lib/interfaces/global/Views.d.ts +2 -1
- package/lib/interfaces/global/Views.js +1 -0
- package/lib/interfaces/high5/execution/index.d.ts +23 -2
- package/lib/interfaces/high5/execution/index.js +2 -0
- package/lib/interfaces/high5/space/event/stream/node/index.d.ts +10 -2
- package/lib/interfaces/high5/space/event/stream/node/index.js +6 -1
- package/lib/interfaces/high5/space/execution/index.d.ts +54 -1
- package/lib/interfaces/high5/space/execution/index.js +8 -0
- package/lib/interfaces/high5/space/index.d.ts +2 -0
- package/lib/interfaces/high5/space/pool/index.d.ts +5 -7
- package/lib/interfaces/high5/space/pool/index.js +0 -7
- package/lib/interfaces/high5/space/webhook/index.d.ts +3 -1
- package/lib/interfaces/high5/wave/index.d.ts +8 -3
- package/lib/interfaces/idp/index.d.ts +1 -0
- package/lib/interfaces/idp/index.js +1 -0
- package/lib/interfaces/idp/organization/license/index.d.ts +11 -0
- package/lib/interfaces/idp/organization/member/index.d.ts +1 -0
- package/lib/interfaces/idp/organization/service-accounts.d.ts +8 -0
- package/lib/interfaces/idp/organization/service-accounts.js +2 -0
- package/lib/interfaces/idp/user/GeneralSettings.d.ts +1 -0
- package/lib/interfaces/idp/user/GeneralSettings.js +1 -0
- package/lib/interfaces/idp/user/Scopes.d.ts +14 -2
- package/lib/interfaces/idp/user/Scopes.js +18 -0
- package/lib/interfaces/nats/index.d.ts +68 -9
- package/lib/interfaces/nats/index.js +100 -12
- package/lib/service/agent/context/index.d.ts +5 -0
- package/lib/service/agent/context/index.js +14 -0
- package/lib/service/dali/DaliAvatar.d.ts +12 -0
- package/lib/service/dali/DaliAvatar.js +20 -0
- package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +26 -0
- package/lib/service/dali/avatar/DaliCosmoSpace.js +58 -0
- package/lib/service/dali/avatar/DaliServiceAccount.d.ts +26 -0
- package/lib/service/dali/avatar/DaliServiceAccount.js +58 -0
- package/lib/service/friday/index.d.ts +13 -0
- package/lib/service/friday/index.js +35 -0
- package/lib/service/friday/space/database/document/index.d.ts +58 -0
- package/lib/service/friday/space/database/document/index.js +97 -0
- package/lib/service/friday/space/database/index.d.ts +55 -0
- package/lib/service/friday/space/database/index.js +101 -0
- package/lib/service/friday/space/index.d.ts +81 -0
- package/lib/service/friday/space/index.js +150 -0
- package/lib/service/high5/space/event/stream/design/DesignOperations.js +3 -1
- package/lib/service/high5/space/execution/index.d.ts +4 -1
- package/lib/service/high5/space/execution/index.js +8 -2
- package/lib/service/high5/space/execution/status/index.d.ts +13 -6
- package/lib/service/high5/space/execution/status/index.js +20 -8
- package/lib/service/high5/space/index.d.ts +15 -6
- package/lib/service/high5/space/index.js +23 -7
- package/lib/service/high5/wave/s3/index.js +17 -10
- package/lib/service/idp/organization/index.d.ts +6 -0
- package/lib/service/idp/organization/index.js +10 -0
- package/lib/service/idp/organization/member/index.d.ts +2 -1
- package/lib/service/idp/organization/member/index.js +2 -1
- package/lib/service/idp/organization/service-accounts/index.d.ts +64 -0
- package/lib/service/idp/organization/service-accounts/index.js +108 -0
- package/lib/service/idp/user/index.js +1 -0
- package/lib/service/idp/user/password/index.js +1 -1
- package/lib/service/mothership/index.js +0 -1
- package/lib/service/nats/index.js +2 -3
- package/lib/utils/bouncer/features/Provider.js +0 -3
- package/package.json +22 -24
|
@@ -20,6 +20,7 @@ declare enum NatsSubject {
|
|
|
20
20
|
IDP_ORGANIZATION_TEAM_MEMBERS = "hcloud.idp.organization.${base64orgName}.teams.${base64teamName}.members",
|
|
21
21
|
IDP_ORGANIZATION_LICENSE = "hcloud.idp.organization.${base64orgName}.license",
|
|
22
22
|
IDP_ORGANIZATION_SETTINGS_OAUTHAPP = "hcloud.idp.organization.${base64orgName}.settings.oauthapp.${oAuthAppId}",
|
|
23
|
+
IDP_ORGANIZATION_SERVICE_ACCOUNTS = "hcloud.idp.organization.${base64orgName}.serviceAccounts",
|
|
23
24
|
HIGH5_SPACES = "hcloud.high5.organization.${base64orgName}.spaces",
|
|
24
25
|
HIGH5_SPACE_PERMISSIONS = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.permissions",
|
|
25
26
|
HIGH5_STREAM_EXECUTE = "hcloud.high5.organization.${organizationId}.stream.execute.${base64email}",
|
|
@@ -36,14 +37,24 @@ declare enum NatsSubject {
|
|
|
36
37
|
HIGH5_CATALOGS = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.catalogs",
|
|
37
38
|
HIGH5_NODES = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.node",
|
|
38
39
|
High5_DESIGN = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.events.${base64eventName}.streams.${streamId}.design",
|
|
40
|
+
High5_DESIGN_DELTA = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.events.${base64eventName}.streams.${streamId}.design.delta",
|
|
39
41
|
HIGH5_SNAPSHOTS = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.events.${base64eventName}.streams.${streamId}.snapshots",
|
|
40
42
|
HIGH5_WAVE_ENGINE_LATEST = "hcloud.high5.wave.engine.latest",
|
|
41
|
-
HIGH5_SPACES_POOLS = "hcloud.high5.organization.${
|
|
42
|
-
HIGH5_SPACES_POOL = "hcloud.high5.organization.${
|
|
43
|
+
HIGH5_SPACES_POOLS = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.pools.>",
|
|
44
|
+
HIGH5_SPACES_POOL = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.pools.${base64poolName}",
|
|
43
45
|
FUSE_SPACES = "hcloud.fuse.organization.${base64orgName}.spaces",
|
|
44
46
|
FUSE_SPACE_PERMISSIONS = "hcloud.fuse.organization.${base64orgName}.spaces.${base64spaceName}.permissions",
|
|
45
47
|
FUSE_JOBS = "hcloud.fuse.organization.${base64orgName}.spaces.${base64spaceName}.jobs",
|
|
46
48
|
FUSE_JOB_LOGS = "hcloud.fuse.organization.${base64orgName}.spaces.${base64spaceName}.jobs.${jobId}.logs",
|
|
49
|
+
FRIDAY_SPACES = "hcloud.friday.organization.${base64orgName}.spaces",
|
|
50
|
+
FRIDAY_SPACE_PERMISSIONS = "hcloud.friday.organization.${base64orgName}.spaces.${base64spaceName}.permissions",
|
|
51
|
+
FRIDAY_DATABASES = "hcloud.friday.organization.${base64orgName}.spaces.${base64spaceName}.databases",
|
|
52
|
+
FRIDAY_DOCUMENTS = "hcloud.friday.organization.${base64orgName}.spaces.${base64spaceName}.databases.${base64databaseName}.documents",
|
|
53
|
+
COSMO_SPACES = "hcloud.cosmo.organization.${base64orgName}.spaces",
|
|
54
|
+
COSMO_NAMESPACES = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.namespaces",
|
|
55
|
+
COSMO_ASSETS = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.assets",
|
|
56
|
+
COSMO_COMMENTS = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.namespaces.${base64namespaceName}.assets.${assetId}.comments",
|
|
57
|
+
MOTHERSHIP_AGENT_CONNECTION = "hcloud.mothership.organization.${base64orgName}.agent.connection",
|
|
47
58
|
AUDITOR_LOGS = "hcloud.auditor.organization.${base64orgName}.logs",
|
|
48
59
|
DEBUG_NAMESPACE = "hcloud.debug.namespace.${product}"
|
|
49
60
|
}
|
|
@@ -83,14 +94,17 @@ declare enum NatsObjectType {
|
|
|
83
94
|
MAIL = "MAIL",
|
|
84
95
|
CRONJOB = "CRONJOB",
|
|
85
96
|
CRONJOB_ID = "CRONJOB_ID",
|
|
86
|
-
CRONJOB_LOG = "CRONJOB_LOG"
|
|
97
|
+
CRONJOB_LOG = "CRONJOB_LOG",
|
|
98
|
+
DATABASE = "DATABASE",
|
|
99
|
+
DOCUMENT = "DOCUMENT",
|
|
100
|
+
AGENT = "AGENT"
|
|
87
101
|
}
|
|
88
102
|
interface NatsMessage {
|
|
89
103
|
type: NatsMessageType;
|
|
90
104
|
object: NatsObject;
|
|
91
105
|
objectType: NatsObjectType;
|
|
92
106
|
}
|
|
93
|
-
interface NatsObject extends NatsNameObject, NatsIdObject, NatsMemberObject, NatsSecretObject, NatsExecTargetObject, High5ExecuteOnAgentRequest, High5ExecutionCancelRequest, NatsLicenseObject, NatsCustomNodeObject {
|
|
107
|
+
interface NatsObject extends NatsNameObject, NatsIdObject, NatsMemberObject, NatsSecretObject, NatsExecTargetObject, High5ExecuteOnAgentRequest, High5ExecutionCancelRequest, NatsLicenseObject, NatsCustomNodeObject, NatsAssetObject, NatsTargetObject {
|
|
94
108
|
[NatsSubject.IDP_USER_GENERAL]: NatsIdObject;
|
|
95
109
|
[NatsSubject.IDP_USER_PROFILE]: NatsIdObject;
|
|
96
110
|
[NatsSubject.IDP_USER_SECURITY_PATS]: NatsIdObject;
|
|
@@ -112,6 +126,7 @@ interface NatsObject extends NatsNameObject, NatsIdObject, NatsMemberObject, Nat
|
|
|
112
126
|
[NatsSubject.HIGH5_STREAMS]: NatsIdObject;
|
|
113
127
|
[NatsSubject.HIGH5_EVENT_STREAMS]: NatsIdObject;
|
|
114
128
|
[NatsSubject.High5_DESIGN]: NatsIdObject;
|
|
129
|
+
[NatsSubject.High5_DESIGN_DELTA]: NatsIdObject;
|
|
115
130
|
[NatsSubject.HIGH5_SNAPSHOTS]: NatsIdObject;
|
|
116
131
|
[NatsSubject.HIGH5_NODES]: NatsCustomNodeObject;
|
|
117
132
|
[NatsSubject.HIGH5_SECRETS]: NatsSecretObject;
|
|
@@ -124,6 +139,12 @@ interface NatsObject extends NatsNameObject, NatsIdObject, NatsMemberObject, Nat
|
|
|
124
139
|
[NatsSubject.FUSE_SPACE_PERMISSIONS]: NatsIdObject;
|
|
125
140
|
[NatsSubject.FUSE_JOBS]: NatsIdObject;
|
|
126
141
|
[NatsSubject.FUSE_JOB_LOGS]: NatsIdObject;
|
|
142
|
+
[NatsSubject.COSMO_ASSETS]: NatsAssetObject;
|
|
143
|
+
[NatsSubject.FRIDAY_SPACES]: NatsNameObject;
|
|
144
|
+
[NatsSubject.FRIDAY_SPACE_PERMISSIONS]: NatsIdObject;
|
|
145
|
+
[NatsSubject.FRIDAY_DATABASES]: NatsNameObject;
|
|
146
|
+
[NatsSubject.FRIDAY_DOCUMENTS]: NatsNameObject;
|
|
147
|
+
[NatsSubject.MOTHERSHIP_AGENT_CONNECTION]: NatsTargetObject;
|
|
127
148
|
[NatsSubject.AUDITOR_LOGS]: NatsIdObject;
|
|
128
149
|
[NatsSubject.DEBUG_NAMESPACE]: string;
|
|
129
150
|
}
|
|
@@ -134,6 +155,10 @@ interface NatsNameObject {
|
|
|
134
155
|
interface NatsIdObject {
|
|
135
156
|
_id: string;
|
|
136
157
|
}
|
|
158
|
+
interface NatsAssetObject {
|
|
159
|
+
_id: string;
|
|
160
|
+
type: "ASSET" | "SPACE" | "PRODUCTION" | "PROJECT" | "FOLDER";
|
|
161
|
+
}
|
|
137
162
|
interface NatsMemberObject {
|
|
138
163
|
userId: string;
|
|
139
164
|
}
|
|
@@ -146,14 +171,16 @@ interface NatsSecretObject {
|
|
|
146
171
|
interface NatsLicenseObject {
|
|
147
172
|
newTier: LicenseTier;
|
|
148
173
|
}
|
|
149
|
-
interface NatsCustomNodeObject {
|
|
150
|
-
_id: string;
|
|
174
|
+
interface NatsCustomNodeObject extends NatsIdObject {
|
|
151
175
|
updatedNodeId?: string;
|
|
152
176
|
}
|
|
153
177
|
interface NatsPoolObject extends NatsIdObject {
|
|
154
178
|
name: string;
|
|
155
179
|
targets: string[];
|
|
156
180
|
}
|
|
181
|
+
interface NatsTargetObject {
|
|
182
|
+
target: string;
|
|
183
|
+
}
|
|
157
184
|
type NatsCallback = (err: Error | null, msg?: NatsMessage, rawMsg?: Msg) => void;
|
|
158
185
|
/**
|
|
159
186
|
* This helper class creates subject strings to be used with nats.subscribe and nats.publish
|
|
@@ -196,6 +223,7 @@ declare class NatsSubjects {
|
|
|
196
223
|
Settings: (organizationName: string) => {
|
|
197
224
|
OAuthApp: (oAuthAppId: string) => string;
|
|
198
225
|
};
|
|
226
|
+
ServiceAccounts: (organizationName: string) => string;
|
|
199
227
|
};
|
|
200
228
|
};
|
|
201
229
|
static Fuse: {
|
|
@@ -225,8 +253,8 @@ declare class NatsSubjects {
|
|
|
225
253
|
SPACES: (organizationName: string) => string;
|
|
226
254
|
Space: {
|
|
227
255
|
new (): {};
|
|
228
|
-
POOLS: (
|
|
229
|
-
POOL: (
|
|
256
|
+
POOLS: (organizationName: string, spaceName: string) => string;
|
|
257
|
+
POOL: (organizationName: string, spaceName: string, poolName: string) => string;
|
|
230
258
|
PERMISSIONS: (organizationName: string, spaceName: string) => string;
|
|
231
259
|
EVENTS: (organizationName: string, spaceName: string) => string;
|
|
232
260
|
STREAMS: (organizationName: string, spaceName: string) => string;
|
|
@@ -236,6 +264,7 @@ declare class NatsSubjects {
|
|
|
236
264
|
Stream: {
|
|
237
265
|
new (): {};
|
|
238
266
|
DESIGN: (organizationName: string, spaceName: string, eventName: string, streamId: string) => string;
|
|
267
|
+
DESIGN_DELTA: (organizationName: string, spaceName: string, eventName: string, streamId: string) => string;
|
|
239
268
|
SNAPSHOTS: (organizationName: string, spaceName: string, eventName: string, streamId: string) => string;
|
|
240
269
|
};
|
|
241
270
|
};
|
|
@@ -257,11 +286,41 @@ declare class NatsSubjects {
|
|
|
257
286
|
};
|
|
258
287
|
};
|
|
259
288
|
};
|
|
289
|
+
static Friday: {
|
|
290
|
+
new (): {};
|
|
291
|
+
SPACES: (organizationName: string) => string;
|
|
292
|
+
Space: {
|
|
293
|
+
new (): {};
|
|
294
|
+
PERMISSIONS: (organizationName: string, spaceName: string) => string;
|
|
295
|
+
DATABASES: (organizationName: string, spaceName: string) => string;
|
|
296
|
+
Database: {
|
|
297
|
+
new (): {};
|
|
298
|
+
DOCUMENTS: (organizationName: string, spaceName: string, databaseName: string) => string;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
static Mothership: {
|
|
303
|
+
new (): {};
|
|
304
|
+
CONNECTION: (organizationName: string) => string;
|
|
305
|
+
};
|
|
260
306
|
static Auditor: {
|
|
261
307
|
new (): {};
|
|
262
308
|
LOGS: (organizationName: string) => string;
|
|
263
309
|
};
|
|
264
310
|
static Logging: (product: Products) => string;
|
|
311
|
+
static Cosmo: {
|
|
312
|
+
new (): {};
|
|
313
|
+
SPACES: (organizationName: string) => string;
|
|
314
|
+
Space: {
|
|
315
|
+
new (): {};
|
|
316
|
+
NAMESPACES: (organizationName: string, spaceName: string) => string;
|
|
317
|
+
Namespace: {
|
|
318
|
+
new (): {};
|
|
319
|
+
COMMENTS: (organizationName: string, spaceName: string, namespaceName: string, assetId: string) => string;
|
|
320
|
+
};
|
|
321
|
+
ASSETS: (organizationName: string, spaceName: string) => string;
|
|
322
|
+
};
|
|
323
|
+
};
|
|
265
324
|
private static replace;
|
|
266
325
|
}
|
|
267
|
-
export {
|
|
326
|
+
export { NatsCallback, NatsMessage, NatsMessageType, NatsObject, NatsObjectType, NatsSubject, NatsSubjects, Msg as RawMsg };
|
|
@@ -3,9 +3,9 @@ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, p
|
|
|
3
3
|
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
|
|
4
4
|
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
|
|
5
5
|
};
|
|
6
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
6
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
8
|
+
exports.NatsSubjects = exports.NatsSubject = exports.NatsObjectType = exports.NatsMessageType = void 0;
|
|
9
9
|
var NatsSubject;
|
|
10
10
|
(function (NatsSubject) {
|
|
11
11
|
NatsSubject["IDP_USER_GENERAL"] = "hcloud.idp.user.${userId}.general";
|
|
@@ -25,6 +25,7 @@ var NatsSubject;
|
|
|
25
25
|
NatsSubject["IDP_ORGANIZATION_TEAM_MEMBERS"] = "hcloud.idp.organization.${base64orgName}.teams.${base64teamName}.members";
|
|
26
26
|
NatsSubject["IDP_ORGANIZATION_LICENSE"] = "hcloud.idp.organization.${base64orgName}.license";
|
|
27
27
|
NatsSubject["IDP_ORGANIZATION_SETTINGS_OAUTHAPP"] = "hcloud.idp.organization.${base64orgName}.settings.oauthapp.${oAuthAppId}";
|
|
28
|
+
NatsSubject["IDP_ORGANIZATION_SERVICE_ACCOUNTS"] = "hcloud.idp.organization.${base64orgName}.serviceAccounts";
|
|
28
29
|
NatsSubject["HIGH5_SPACES"] = "hcloud.high5.organization.${base64orgName}.spaces";
|
|
29
30
|
NatsSubject["HIGH5_SPACE_PERMISSIONS"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.permissions";
|
|
30
31
|
NatsSubject["HIGH5_STREAM_EXECUTE"] = "hcloud.high5.organization.${organizationId}.stream.execute.${base64email}";
|
|
@@ -41,14 +42,24 @@ var NatsSubject;
|
|
|
41
42
|
NatsSubject["HIGH5_CATALOGS"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.catalogs";
|
|
42
43
|
NatsSubject["HIGH5_NODES"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.node";
|
|
43
44
|
NatsSubject["High5_DESIGN"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.events.${base64eventName}.streams.${streamId}.design";
|
|
45
|
+
NatsSubject["High5_DESIGN_DELTA"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.events.${base64eventName}.streams.${streamId}.design.delta";
|
|
44
46
|
NatsSubject["HIGH5_SNAPSHOTS"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.events.${base64eventName}.streams.${streamId}.snapshots";
|
|
45
47
|
NatsSubject["HIGH5_WAVE_ENGINE_LATEST"] = "hcloud.high5.wave.engine.latest";
|
|
46
|
-
NatsSubject["HIGH5_SPACES_POOLS"] = "hcloud.high5.organization.${
|
|
47
|
-
NatsSubject["HIGH5_SPACES_POOL"] = "hcloud.high5.organization.${
|
|
48
|
+
NatsSubject["HIGH5_SPACES_POOLS"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.pools.>";
|
|
49
|
+
NatsSubject["HIGH5_SPACES_POOL"] = "hcloud.high5.organization.${base64orgName}.spaces.${base64spaceName}.pools.${base64poolName}";
|
|
48
50
|
NatsSubject["FUSE_SPACES"] = "hcloud.fuse.organization.${base64orgName}.spaces";
|
|
49
51
|
NatsSubject["FUSE_SPACE_PERMISSIONS"] = "hcloud.fuse.organization.${base64orgName}.spaces.${base64spaceName}.permissions";
|
|
50
52
|
NatsSubject["FUSE_JOBS"] = "hcloud.fuse.organization.${base64orgName}.spaces.${base64spaceName}.jobs";
|
|
51
53
|
NatsSubject["FUSE_JOB_LOGS"] = "hcloud.fuse.organization.${base64orgName}.spaces.${base64spaceName}.jobs.${jobId}.logs";
|
|
54
|
+
NatsSubject["FRIDAY_SPACES"] = "hcloud.friday.organization.${base64orgName}.spaces";
|
|
55
|
+
NatsSubject["FRIDAY_SPACE_PERMISSIONS"] = "hcloud.friday.organization.${base64orgName}.spaces.${base64spaceName}.permissions";
|
|
56
|
+
NatsSubject["FRIDAY_DATABASES"] = "hcloud.friday.organization.${base64orgName}.spaces.${base64spaceName}.databases";
|
|
57
|
+
NatsSubject["FRIDAY_DOCUMENTS"] = "hcloud.friday.organization.${base64orgName}.spaces.${base64spaceName}.databases.${base64databaseName}.documents";
|
|
58
|
+
NatsSubject["COSMO_SPACES"] = "hcloud.cosmo.organization.${base64orgName}.spaces";
|
|
59
|
+
NatsSubject["COSMO_NAMESPACES"] = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.namespaces";
|
|
60
|
+
NatsSubject["COSMO_ASSETS"] = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.assets";
|
|
61
|
+
NatsSubject["COSMO_COMMENTS"] = "hcloud.cosmo.organization.${base64orgName}.spaces.${base64spaceName}.namespaces.${base64namespaceName}.assets.${assetId}.comments";
|
|
62
|
+
NatsSubject["MOTHERSHIP_AGENT_CONNECTION"] = "hcloud.mothership.organization.${base64orgName}.agent.connection";
|
|
52
63
|
NatsSubject["AUDITOR_LOGS"] = "hcloud.auditor.organization.${base64orgName}.logs";
|
|
53
64
|
NatsSubject["DEBUG_NAMESPACE"] = "hcloud.debug.namespace.${product}";
|
|
54
65
|
})(NatsSubject || (exports.NatsSubject = NatsSubject = {}));
|
|
@@ -91,6 +102,9 @@ var NatsObjectType;
|
|
|
91
102
|
NatsObjectType["CRONJOB"] = "CRONJOB";
|
|
92
103
|
NatsObjectType["CRONJOB_ID"] = "CRONJOB_ID";
|
|
93
104
|
NatsObjectType["CRONJOB_LOG"] = "CRONJOB_LOG";
|
|
105
|
+
NatsObjectType["DATABASE"] = "DATABASE";
|
|
106
|
+
NatsObjectType["DOCUMENT"] = "DOCUMENT";
|
|
107
|
+
NatsObjectType["AGENT"] = "AGENT";
|
|
94
108
|
})(NatsObjectType || (exports.NatsObjectType = NatsObjectType = {}));
|
|
95
109
|
/**
|
|
96
110
|
* This helper class creates subject strings to be used with nats.subscribe and nats.publish
|
|
@@ -184,6 +198,9 @@ NatsSubjects.IDP = (_a = class {
|
|
|
184
198
|
},
|
|
185
199
|
};
|
|
186
200
|
},
|
|
201
|
+
_d.ServiceAccounts = (organizationName) => {
|
|
202
|
+
return NatsSubjects.replace(NatsSubject.IDP_ORGANIZATION_SERVICE_ACCOUNTS, { organizationName });
|
|
203
|
+
},
|
|
187
204
|
_d),
|
|
188
205
|
_a);
|
|
189
206
|
NatsSubjects.Fuse = (_f = class {
|
|
@@ -247,11 +264,11 @@ NatsSubjects.High5 = (_j = class {
|
|
|
247
264
|
_j.Space = (_l = class {
|
|
248
265
|
},
|
|
249
266
|
__setFunctionName(_l, "Space"),
|
|
250
|
-
_l.POOLS = (
|
|
251
|
-
return NatsSubjects.replace(NatsSubject.HIGH5_SPACES_POOLS, {
|
|
267
|
+
_l.POOLS = (organizationName, spaceName) => {
|
|
268
|
+
return NatsSubjects.replace(NatsSubject.HIGH5_SPACES_POOLS, { organizationName, spaceName });
|
|
252
269
|
},
|
|
253
|
-
_l.POOL = (
|
|
254
|
-
return NatsSubjects.replace(NatsSubject.HIGH5_SPACES_POOL, {
|
|
270
|
+
_l.POOL = (organizationName, spaceName, poolName) => {
|
|
271
|
+
return NatsSubjects.replace(NatsSubject.HIGH5_SPACES_POOL, { organizationName, spaceName, poolName });
|
|
255
272
|
},
|
|
256
273
|
_l.PERMISSIONS = (organizationName, spaceName) => {
|
|
257
274
|
return NatsSubjects.replace(NatsSubject.HIGH5_SPACE_PERMISSIONS, { organizationName, spaceName });
|
|
@@ -283,6 +300,14 @@ NatsSubjects.High5 = (_j = class {
|
|
|
283
300
|
streamId,
|
|
284
301
|
});
|
|
285
302
|
},
|
|
303
|
+
_o.DESIGN_DELTA = (organizationName, spaceName, eventName, streamId) => {
|
|
304
|
+
return NatsSubjects.replace(NatsSubject.High5_DESIGN_DELTA, {
|
|
305
|
+
organizationName,
|
|
306
|
+
spaceName,
|
|
307
|
+
eventName,
|
|
308
|
+
streamId,
|
|
309
|
+
});
|
|
310
|
+
},
|
|
286
311
|
_o.SNAPSHOTS = (organizationName, spaceName, eventName, streamId) => {
|
|
287
312
|
return NatsSubjects.replace(NatsSubject.HIGH5_SNAPSHOTS, {
|
|
288
313
|
organizationName,
|
|
@@ -330,22 +355,82 @@ NatsSubjects.High5 = (_j = class {
|
|
|
330
355
|
_r),
|
|
331
356
|
_q),
|
|
332
357
|
_j);
|
|
333
|
-
NatsSubjects.
|
|
358
|
+
NatsSubjects.Friday = (_s = class {
|
|
334
359
|
},
|
|
335
|
-
__setFunctionName(_s, "
|
|
336
|
-
_s.
|
|
337
|
-
return NatsSubjects.replace(NatsSubject.
|
|
360
|
+
__setFunctionName(_s, "Friday"),
|
|
361
|
+
_s.SPACES = (organizationName) => {
|
|
362
|
+
return NatsSubjects.replace(NatsSubject.FRIDAY_SPACES, { organizationName });
|
|
338
363
|
},
|
|
364
|
+
_s.Space = (_t = class {
|
|
365
|
+
},
|
|
366
|
+
__setFunctionName(_t, "Space"),
|
|
367
|
+
_t.PERMISSIONS = (organizationName, spaceName) => {
|
|
368
|
+
return NatsSubjects.replace(NatsSubject.FRIDAY_SPACE_PERMISSIONS, { organizationName, spaceName });
|
|
369
|
+
},
|
|
370
|
+
_t.DATABASES = (organizationName, spaceName) => {
|
|
371
|
+
return NatsSubjects.replace(NatsSubject.FRIDAY_DATABASES, { organizationName, spaceName });
|
|
372
|
+
},
|
|
373
|
+
_t.Database = (_u = class {
|
|
374
|
+
},
|
|
375
|
+
__setFunctionName(_u, "Database"),
|
|
376
|
+
_u.DOCUMENTS = (organizationName, spaceName, databaseName) => {
|
|
377
|
+
return NatsSubjects.replace(NatsSubject.FRIDAY_DOCUMENTS, {
|
|
378
|
+
organizationName,
|
|
379
|
+
spaceName,
|
|
380
|
+
databaseName,
|
|
381
|
+
});
|
|
382
|
+
},
|
|
383
|
+
_u),
|
|
384
|
+
_t),
|
|
339
385
|
_s);
|
|
386
|
+
NatsSubjects.Mothership = (_v = class {
|
|
387
|
+
},
|
|
388
|
+
__setFunctionName(_v, "Mothership"),
|
|
389
|
+
_v.CONNECTION = (organizationName) => {
|
|
390
|
+
return NatsSubjects.replace(NatsSubject.MOTHERSHIP_AGENT_CONNECTION, { organizationName });
|
|
391
|
+
},
|
|
392
|
+
_v);
|
|
393
|
+
NatsSubjects.Auditor = (_w = class {
|
|
394
|
+
},
|
|
395
|
+
__setFunctionName(_w, "Auditor"),
|
|
396
|
+
_w.LOGS = (organizationName) => {
|
|
397
|
+
return NatsSubjects.replace(NatsSubject.AUDITOR_LOGS, { organizationName });
|
|
398
|
+
},
|
|
399
|
+
_w);
|
|
340
400
|
NatsSubjects.Logging = (product) => {
|
|
341
401
|
return NatsSubjects.replace(NatsSubject.DEBUG_NAMESPACE, { product });
|
|
342
402
|
};
|
|
403
|
+
NatsSubjects.Cosmo = (_x = class {
|
|
404
|
+
},
|
|
405
|
+
__setFunctionName(_x, "Cosmo"),
|
|
406
|
+
_x.SPACES = (organizationName) => {
|
|
407
|
+
return NatsSubjects.replace(NatsSubject.COSMO_SPACES, { organizationName });
|
|
408
|
+
},
|
|
409
|
+
_x.Space = (_y = class {
|
|
410
|
+
},
|
|
411
|
+
__setFunctionName(_y, "Space"),
|
|
412
|
+
_y.NAMESPACES = (organizationName, spaceName) => {
|
|
413
|
+
return NatsSubjects.replace(NatsSubject.COSMO_NAMESPACES, { organizationName, spaceName });
|
|
414
|
+
},
|
|
415
|
+
_y.Namespace = (_z = class {
|
|
416
|
+
},
|
|
417
|
+
__setFunctionName(_z, "Namespace"),
|
|
418
|
+
_z.COMMENTS = (organizationName, spaceName, namespaceName, assetId) => {
|
|
419
|
+
return NatsSubjects.replace(NatsSubject.COSMO_COMMENTS, { organizationName, spaceName, namespaceName, assetId });
|
|
420
|
+
},
|
|
421
|
+
_z),
|
|
422
|
+
_y.ASSETS = (organizationName, spaceName) => {
|
|
423
|
+
return NatsSubjects.replace(NatsSubject.COSMO_ASSETS, { organizationName, spaceName });
|
|
424
|
+
},
|
|
425
|
+
_y),
|
|
426
|
+
_x);
|
|
343
427
|
// eslint-disable-next-line complexity
|
|
344
428
|
NatsSubjects.replace = (subject, replacements) => {
|
|
345
429
|
subject = subject.replace("${userId}", replacements.userId || "null");
|
|
346
430
|
subject = subject.replace("${base64orgName}", replacements.organizationName ? (replacements.organizationName === "*" ? "*" : base64Encode(replacements.organizationName)) : "null");
|
|
347
431
|
subject = subject.replace("${organizationId}", replacements.organizationId || "null");
|
|
348
432
|
subject = subject.replace("${base64spaceName}", replacements.spaceName ? (replacements.spaceName === "*" ? "*" : base64Encode(replacements.spaceName)) : "null");
|
|
433
|
+
subject = subject.replace("${base64namespaceName}", replacements.namespaceName ? (replacements.namespaceName === "*" ? "*" : base64Encode(replacements.namespaceName)) : "null");
|
|
349
434
|
subject = subject.replace("${spaceId}", replacements.spaceId || "null");
|
|
350
435
|
subject = subject.replace("${base64eventName}", replacements.eventName ? (replacements.eventName === "*" ? "*" : base64Encode(replacements.eventName)) : "null");
|
|
351
436
|
subject = subject.replace("${streamId}", replacements.streamId || "null");
|
|
@@ -358,8 +443,11 @@ NatsSubjects.replace = (subject, replacements) => {
|
|
|
358
443
|
subject = subject.replace("${base64teamName}", replacements.teamName ? (replacements.teamName === "*" ? "*" : base64Encode(replacements.teamName)) : "null");
|
|
359
444
|
subject = subject.replace("${base64poolName}", replacements.poolName ? (replacements.poolName === "*" ? "*" : base64Encode(replacements.poolName)) : "null");
|
|
360
445
|
subject = subject.replace("${poolId}", replacements.poolId || "null");
|
|
446
|
+
subject = subject.replace("${poolName}", replacements.poolName || "null");
|
|
361
447
|
subject = subject.replace("${executionId}", replacements.executionId || "null");
|
|
362
448
|
subject = subject.replace("${executionSecret}", replacements.executionSecret || "null");
|
|
449
|
+
subject = subject.replace("${base64databaseName}", replacements.databaseName ? (replacements.databaseName === "*" ? "*" : base64Encode(replacements.databaseName)) : "null");
|
|
450
|
+
subject = subject.replace("${assetId}", replacements.assetId || "null");
|
|
363
451
|
return subject;
|
|
364
452
|
};
|
|
365
453
|
const base64Encode = (str) => {
|
|
@@ -11,6 +11,11 @@ export declare class AgentContext extends Base {
|
|
|
11
11
|
* @returns The newly created context
|
|
12
12
|
*/
|
|
13
13
|
addContext(server: string, email: string, token: string, enabled: boolean): Promise<Context>;
|
|
14
|
+
/**
|
|
15
|
+
* Add a new context by using a service accounts PAT token.
|
|
16
|
+
* @returns The newly created context
|
|
17
|
+
*/
|
|
18
|
+
addServiceAccountContext(server: string, token: string, enabled: boolean): Promise<Context>;
|
|
14
19
|
/**
|
|
15
20
|
* Update an existing context.
|
|
16
21
|
* @returns The updated context
|
|
@@ -37,6 +37,20 @@ class AgentContext extends Base_1.default {
|
|
|
37
37
|
return resp.data;
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Add a new context by using a service accounts PAT token.
|
|
42
|
+
* @returns The newly created context
|
|
43
|
+
*/
|
|
44
|
+
addServiceAccountContext(server, token, enabled) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/context`), {
|
|
47
|
+
server,
|
|
48
|
+
token: token.toLowerCase().startsWith("bearer") ? token : `Bearer ${token}`,
|
|
49
|
+
enabled,
|
|
50
|
+
});
|
|
51
|
+
return resp.data;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
40
54
|
/**
|
|
41
55
|
* Update an existing context.
|
|
42
56
|
* @returns The updated context
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import Base from "../../Base";
|
|
2
|
+
import { DaliCosmoSpace } from "./avatar/DaliCosmoSpace";
|
|
2
3
|
import { DaliFuseSpace } from "./avatar/DaliFuseSpace";
|
|
3
4
|
import { DaliHigh5Pool } from "./avatar/DaliHigh5Pool";
|
|
4
5
|
import { DaliHigh5Space } from "./avatar/DaliHigh5Space";
|
|
5
6
|
import { DaliOAuthApp } from "./avatar/DaliOAuthApp";
|
|
6
7
|
import { DaliOrganization } from "./avatar/DaliOrganization";
|
|
8
|
+
import { DaliServiceAccount } from "./avatar/DaliServiceAccount";
|
|
7
9
|
import { DaliTeam } from "./avatar/DaliTeam";
|
|
8
10
|
import { DaliUser } from "./avatar/DaliUser";
|
|
9
11
|
export declare class DaliAvatar extends Base {
|
|
@@ -17,6 +19,11 @@ export declare class DaliAvatar extends Base {
|
|
|
17
19
|
*/
|
|
18
20
|
get team(): DaliTeam;
|
|
19
21
|
private _team?;
|
|
22
|
+
/**
|
|
23
|
+
* Handles everything around service account avatars
|
|
24
|
+
*/
|
|
25
|
+
get serviceAccount(): DaliServiceAccount;
|
|
26
|
+
private _serviceAccount?;
|
|
20
27
|
/**
|
|
21
28
|
* Handles everything around organization avatars
|
|
22
29
|
*/
|
|
@@ -37,6 +44,11 @@ export declare class DaliAvatar extends Base {
|
|
|
37
44
|
*/
|
|
38
45
|
get fuseSpace(): DaliFuseSpace;
|
|
39
46
|
private _fuseSpace?;
|
|
47
|
+
/**
|
|
48
|
+
* Handles everything around cosmo spaces avatars
|
|
49
|
+
*/
|
|
50
|
+
get cosmoSpace(): DaliCosmoSpace;
|
|
51
|
+
private _cosmoSpace?;
|
|
40
52
|
/**
|
|
41
53
|
* Handles everything around OAuth applications avatars
|
|
42
54
|
*/
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DaliAvatar = void 0;
|
|
4
4
|
const Base_1 = require("../../Base");
|
|
5
|
+
const DaliCosmoSpace_1 = require("./avatar/DaliCosmoSpace");
|
|
5
6
|
const DaliFuseSpace_1 = require("./avatar/DaliFuseSpace");
|
|
6
7
|
const DaliHigh5Pool_1 = require("./avatar/DaliHigh5Pool");
|
|
7
8
|
const DaliHigh5Space_1 = require("./avatar/DaliHigh5Space");
|
|
8
9
|
const DaliOAuthApp_1 = require("./avatar/DaliOAuthApp");
|
|
9
10
|
const DaliOrganization_1 = require("./avatar/DaliOrganization");
|
|
11
|
+
const DaliServiceAccount_1 = require("./avatar/DaliServiceAccount");
|
|
10
12
|
const DaliTeam_1 = require("./avatar/DaliTeam");
|
|
11
13
|
const DaliUser_1 = require("./avatar/DaliUser");
|
|
12
14
|
class DaliAvatar extends Base_1.default {
|
|
@@ -28,6 +30,15 @@ class DaliAvatar extends Base_1.default {
|
|
|
28
30
|
}
|
|
29
31
|
return this._team;
|
|
30
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Handles everything around service account avatars
|
|
35
|
+
*/
|
|
36
|
+
get serviceAccount() {
|
|
37
|
+
if (this._serviceAccount === undefined) {
|
|
38
|
+
this._serviceAccount = new DaliServiceAccount_1.DaliServiceAccount(this.options, this.axios);
|
|
39
|
+
}
|
|
40
|
+
return this._serviceAccount;
|
|
41
|
+
}
|
|
31
42
|
/**
|
|
32
43
|
* Handles everything around organization avatars
|
|
33
44
|
*/
|
|
@@ -64,6 +75,15 @@ class DaliAvatar extends Base_1.default {
|
|
|
64
75
|
}
|
|
65
76
|
return this._fuseSpace;
|
|
66
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Handles everything around cosmo spaces avatars
|
|
80
|
+
*/
|
|
81
|
+
get cosmoSpace() {
|
|
82
|
+
if (this._cosmoSpace === undefined) {
|
|
83
|
+
this._cosmoSpace = new DaliCosmoSpace_1.DaliCosmoSpace(this.options, this.axios);
|
|
84
|
+
}
|
|
85
|
+
return this._cosmoSpace;
|
|
86
|
+
}
|
|
67
87
|
/**
|
|
68
88
|
* Handles everything around OAuth applications avatars
|
|
69
89
|
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Base from "../../../Base";
|
|
2
|
+
import { AvatarCreated } from "../../../interfaces/dali";
|
|
3
|
+
export declare class DaliCosmoSpace extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* Creates a default avatar for the specified Cosmo space.
|
|
6
|
+
* @param orgName Name of the organization
|
|
7
|
+
* @param spaceName Name of the space
|
|
8
|
+
* @returns Public URL of the created avatar
|
|
9
|
+
*/
|
|
10
|
+
createAvatar(orgName: string, spaceName: string): Promise<AvatarCreated>;
|
|
11
|
+
/**
|
|
12
|
+
* Deletes the avatar of the Cosmo space from cloud storage. If you want to update it instead, use updateAvatar().
|
|
13
|
+
* @param orgName Name of the organization
|
|
14
|
+
* @param spaceName Name of the space
|
|
15
|
+
*/
|
|
16
|
+
deleteAvatar(orgName: string, spaceName: string): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Updates the avatar of the specified Cosmo space
|
|
19
|
+
* @param orgName Name of the organization
|
|
20
|
+
* @param spaceName Name of the space
|
|
21
|
+
* @param file Image as Javascript File
|
|
22
|
+
* @returns Public URL of the new avatar
|
|
23
|
+
*/
|
|
24
|
+
updateAvatar(orgName: string, spaceName: string, file: File): Promise<AvatarCreated>;
|
|
25
|
+
protected getEndpoint(endpoint: string): string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DaliCosmoSpace = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
class DaliCosmoSpace extends Base_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Creates a default avatar for the specified Cosmo space.
|
|
17
|
+
* @param orgName Name of the organization
|
|
18
|
+
* @param spaceName Name of the space
|
|
19
|
+
* @returns Public URL of the created avatar
|
|
20
|
+
*/
|
|
21
|
+
createAvatar(orgName, spaceName) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/avatar/org/${orgName}/spaces/cosmo/${spaceName}`), {});
|
|
24
|
+
return resp.data;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Deletes the avatar of the Cosmo space from cloud storage. If you want to update it instead, use updateAvatar().
|
|
29
|
+
* @param orgName Name of the organization
|
|
30
|
+
* @param spaceName Name of the space
|
|
31
|
+
*/
|
|
32
|
+
deleteAvatar(orgName, spaceName) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
yield this.axios.delete(this.getEndpoint(`/v1/avatar/org/${orgName}/spaces/cosmo/${spaceName}`));
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Updates the avatar of the specified Cosmo space
|
|
39
|
+
* @param orgName Name of the organization
|
|
40
|
+
* @param spaceName Name of the space
|
|
41
|
+
* @param file Image as Javascript File
|
|
42
|
+
* @returns Public URL of the new avatar
|
|
43
|
+
*/
|
|
44
|
+
updateAvatar(orgName, spaceName, file) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const data = new FormData();
|
|
47
|
+
data.append("avatar", file);
|
|
48
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/avatar/org/${orgName}/spaces/cosmo/${spaceName}`), data, {
|
|
49
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
50
|
+
});
|
|
51
|
+
return resp.data;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
getEndpoint(endpoint) {
|
|
55
|
+
return `${this.options.server}/api/dali${endpoint}`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.DaliCosmoSpace = DaliCosmoSpace;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Base from "../../../Base";
|
|
2
|
+
import { AvatarCreated } from "../../../interfaces/dali";
|
|
3
|
+
export declare class DaliServiceAccount extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* Creates a default avatar for the specified service account.
|
|
6
|
+
* @param orgName Name of the organization
|
|
7
|
+
* @param serviceAccountId ID of the service account
|
|
8
|
+
* @returns Public URL of the created avatar
|
|
9
|
+
*/
|
|
10
|
+
createAvatar(orgName: string, serviceAccountId: string): Promise<AvatarCreated>;
|
|
11
|
+
/**
|
|
12
|
+
* Deletes the avatar of the service account from cloud storage. If you want to update it instead, use updateAvatar().
|
|
13
|
+
* @param orgName Name of the organization
|
|
14
|
+
* @param serviceAccountId ID of the service account
|
|
15
|
+
*/
|
|
16
|
+
deleteAvatar(orgName: string, serviceAccountId: string): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Updates the avatar of the specified service account.
|
|
19
|
+
* @param orgName Name of the organization
|
|
20
|
+
* @param serviceAccountId ID of the service account
|
|
21
|
+
* @param file Image as Javascript File
|
|
22
|
+
* @returns Public URL of the new avatar
|
|
23
|
+
*/
|
|
24
|
+
updateAvatar(orgName: string, serviceAccountId: string, file: File): Promise<AvatarCreated>;
|
|
25
|
+
protected getEndpoint(endpoint: string): string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DaliServiceAccount = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
class DaliServiceAccount extends Base_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Creates a default avatar for the specified service account.
|
|
17
|
+
* @param orgName Name of the organization
|
|
18
|
+
* @param serviceAccountId ID of the service account
|
|
19
|
+
* @returns Public URL of the created avatar
|
|
20
|
+
*/
|
|
21
|
+
createAvatar(orgName, serviceAccountId) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/avatar/org/${orgName}/service-accounts/${serviceAccountId}`), {});
|
|
24
|
+
return resp.data;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Deletes the avatar of the service account from cloud storage. If you want to update it instead, use updateAvatar().
|
|
29
|
+
* @param orgName Name of the organization
|
|
30
|
+
* @param serviceAccountId ID of the service account
|
|
31
|
+
*/
|
|
32
|
+
deleteAvatar(orgName, serviceAccountId) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
yield this.axios.delete(this.getEndpoint(`/v1/avatar/org/${orgName}/service-accounts/${serviceAccountId}`));
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Updates the avatar of the specified service account.
|
|
39
|
+
* @param orgName Name of the organization
|
|
40
|
+
* @param serviceAccountId ID of the service account
|
|
41
|
+
* @param file Image as Javascript File
|
|
42
|
+
* @returns Public URL of the new avatar
|
|
43
|
+
*/
|
|
44
|
+
updateAvatar(orgName, serviceAccountId, file) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const data = new FormData();
|
|
47
|
+
data.append("avatar", file);
|
|
48
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/avatar/org/${orgName}/service-accounts/${serviceAccountId}`), data, {
|
|
49
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
50
|
+
});
|
|
51
|
+
return resp.data;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
getEndpoint(endpoint) {
|
|
55
|
+
return `${this.options.server}/api/dali${endpoint}`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.DaliServiceAccount = DaliServiceAccount;
|