@api-client/core 0.12.7 → 0.12.10
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/build/src/browser.d.ts +3 -2
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js +2 -1
- package/build/src/browser.js.map +1 -1
- package/build/src/index.d.ts +3 -2
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js +2 -1
- package/build/src/index.js.map +1 -1
- package/build/src/mocking/lib/User.d.ts.map +1 -1
- package/build/src/mocking/lib/User.js +1 -0
- package/build/src/mocking/lib/User.js.map +1 -1
- package/build/src/models/kinds.d.ts +2 -0
- package/build/src/models/kinds.d.ts.map +1 -1
- package/build/src/models/kinds.js +2 -0
- package/build/src/models/kinds.js.map +1 -1
- package/build/src/models/store/Invitation.d.ts +146 -0
- package/build/src/models/store/Invitation.d.ts.map +1 -0
- package/build/src/models/store/Invitation.js +186 -0
- package/build/src/models/store/Invitation.js.map +1 -0
- package/build/src/models/store/Organization.d.ts +4 -4
- package/build/src/models/store/Organization.d.ts.map +1 -1
- package/build/src/models/store/Organization.js +9 -9
- package/build/src/models/store/Organization.js.map +1 -1
- package/build/src/models/store/User.d.ts +14 -0
- package/build/src/models/store/User.d.ts.map +1 -1
- package/build/src/models/store/User.js.map +1 -1
- package/build/src/runtime/store/HttpWeb.js +5 -5
- package/build/src/runtime/store/HttpWeb.js.map +1 -1
- package/build/src/runtime/store/OrganizationsSdk.d.ts +77 -2
- package/build/src/runtime/store/OrganizationsSdk.d.ts.map +1 -1
- package/build/src/runtime/store/OrganizationsSdk.js +278 -3
- package/build/src/runtime/store/OrganizationsSdk.js.map +1 -1
- package/build/src/runtime/store/RouteBuilder.d.ts +15 -2
- package/build/src/runtime/store/RouteBuilder.d.ts.map +1 -1
- package/build/src/runtime/store/RouteBuilder.js +33 -6
- package/build/src/runtime/store/RouteBuilder.js.map +1 -1
- package/build/src/runtime/store/Sdk.d.ts +1 -1
- package/build/src/runtime/store/Sdk.d.ts.map +1 -1
- package/build/src/runtime/store/Sdk.js +1 -1
- package/build/src/runtime/store/Sdk.js.map +1 -1
- package/build/src/runtime/store/SdkBase.d.ts +2 -2
- package/build/src/runtime/store/SdkBase.d.ts.map +1 -1
- package/build/src/runtime/store/SdkBase.js +2 -2
- package/build/src/runtime/store/SdkBase.js.map +1 -1
- package/build/src/runtime/store/UsersSdk.d.ts +2 -0
- package/build/src/runtime/store/UsersSdk.d.ts.map +1 -1
- package/build/src/runtime/store/UsersSdk.js +6 -0
- package/build/src/runtime/store/UsersSdk.js.map +1 -1
- package/eslint.config.js +6 -5
- package/package.json +23 -5
- package/src/mocking/lib/User.ts +1 -0
- package/src/models/kinds.ts +2 -0
- package/src/models/store/Invitation.ts +287 -0
- package/src/models/store/Organization.ts +11 -12
- package/src/models/store/User.ts +16 -0
- package/src/runtime/store/HttpWeb.ts +5 -5
- package/src/runtime/store/OrganizationsSdk.ts +293 -5
- package/src/runtime/store/RouteBuilder.ts +42 -8
- package/src/runtime/store/Sdk.ts +1 -1
- package/src/runtime/store/SdkBase.ts +2 -2
- package/src/runtime/store/UsersSdk.ts +6 -0
- package/tests/unit/models/store/Invitation.spec.ts +223 -0
|
@@ -1,11 +1,86 @@
|
|
|
1
1
|
import { SdkBase, SdkOptions } from './SdkBase.js';
|
|
2
|
-
import { ContextListResult } from '../../events/BaseEvents.js';
|
|
3
|
-
import { IOrganization } from '../../models/store/Organization.js';
|
|
2
|
+
import type { ContextListOptions, ContextListResult } from '../../events/BaseEvents.js';
|
|
3
|
+
import type { IOrganization, UserOrganizationGrantType } from '../../models/store/Organization.js';
|
|
4
|
+
import type { InvitationSchema } from '../../models/store/Invitation.js';
|
|
5
|
+
import type { PatchInfo } from '../../patch/types.js';
|
|
6
|
+
import type { IUser } from '../../models/store/User.js';
|
|
4
7
|
export declare class OrganizationsSdk extends SdkBase {
|
|
5
8
|
/**
|
|
6
9
|
* Lists all user organizations.
|
|
7
10
|
*/
|
|
8
11
|
list(request?: SdkOptions): Promise<ContextListResult<IOrganization>>;
|
|
9
12
|
create(orgName: string, request?: SdkOptions): Promise<IOrganization>;
|
|
13
|
+
/**
|
|
14
|
+
* Lists all invitations for a given organization.
|
|
15
|
+
* @param oid The organization ID.
|
|
16
|
+
* @param request The request options.
|
|
17
|
+
* @returns A promise that resolves to a list of invitations.
|
|
18
|
+
*/
|
|
19
|
+
listInvitations(oid: string, request?: SdkOptions): Promise<ContextListResult<InvitationSchema>>;
|
|
20
|
+
/**
|
|
21
|
+
* Creates an invitation for a user to join an organization.
|
|
22
|
+
* @param oid The organization ID.
|
|
23
|
+
* @param email The email address of the user to invite.
|
|
24
|
+
* @param grant_type The type of grant for the user.
|
|
25
|
+
* @param name The name of the user (optional).
|
|
26
|
+
* @param request The request options.
|
|
27
|
+
* @returns A promise that resolves to the created invitation.
|
|
28
|
+
*/
|
|
29
|
+
createInvitation(oid: string, email: string, grant_type: UserOrganizationGrantType, name?: string, request?: SdkOptions): Promise<InvitationSchema>;
|
|
30
|
+
/**
|
|
31
|
+
* Finds an invitation by its token.
|
|
32
|
+
* @param oid The organization ID.
|
|
33
|
+
* @param token The invitation token.
|
|
34
|
+
* @param request The request options.
|
|
35
|
+
* @returns A promise that resolves to the found invitation.
|
|
36
|
+
*/
|
|
37
|
+
findInvitationByToken(oid: string, token: string, request?: SdkOptions): Promise<InvitationSchema>;
|
|
38
|
+
/**
|
|
39
|
+
* Declines an invitation.
|
|
40
|
+
* @param oid The organization ID.
|
|
41
|
+
* @param id The invitation ID.
|
|
42
|
+
* @param request The request options.
|
|
43
|
+
* @returns A promise that resolves when the invitation is declined.
|
|
44
|
+
*/
|
|
45
|
+
declineInvitation(oid: string, id: string, request?: SdkOptions): Promise<InvitationSchema>;
|
|
46
|
+
/**
|
|
47
|
+
* Soft-deletes an invitation.
|
|
48
|
+
* @param oid The organization ID.
|
|
49
|
+
* @param id The invitation ID.
|
|
50
|
+
* @param request The request options.
|
|
51
|
+
* @returns A promise that resolves to the deleted invitation.
|
|
52
|
+
*/
|
|
53
|
+
deleteInvitation(oid: string, id: string, request?: SdkOptions): Promise<InvitationSchema>;
|
|
54
|
+
/**
|
|
55
|
+
* Patches an invitation. The server performs the patch validation.
|
|
56
|
+
* The API only allows to patch some of the invitation properties:
|
|
57
|
+
* - name
|
|
58
|
+
* - expires_at
|
|
59
|
+
* - grant_type
|
|
60
|
+
* @param oid The organization ID.
|
|
61
|
+
* @param id The invitation ID.
|
|
62
|
+
* @param info The patch information.
|
|
63
|
+
* @param request The request options.
|
|
64
|
+
* @returns A promise that resolves to the patched invitation.
|
|
65
|
+
*/
|
|
66
|
+
patchInvitation(oid: string, id: string, info: PatchInfo, request?: SdkOptions): Promise<InvitationSchema>;
|
|
67
|
+
/**
|
|
68
|
+
* Lists users in the organization.
|
|
69
|
+
*
|
|
70
|
+
* @param oid The key of the organization we want to read the user from.
|
|
71
|
+
* @param options Optional query options.
|
|
72
|
+
* @param request Optional request options.
|
|
73
|
+
*/
|
|
74
|
+
listUsers(oid: string, options?: ContextListOptions, request?: SdkOptions): Promise<ContextListResult<IUser>>;
|
|
75
|
+
/**
|
|
76
|
+
* Gets a user by its key in the organization.
|
|
77
|
+
*
|
|
78
|
+
* @param oid The key of the organization parent organization.
|
|
79
|
+
* @param key The user key.
|
|
80
|
+
* @param request Optional request options.
|
|
81
|
+
* @returns The user object
|
|
82
|
+
* @deprecated Use `organizations.readUser()` instead.
|
|
83
|
+
*/
|
|
84
|
+
getUser(oid: string, key: string, request?: SdkOptions): Promise<IUser>;
|
|
10
85
|
}
|
|
11
86
|
//# sourceMappingURL=OrganizationsSdk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrganizationsSdk.d.ts","sourceRoot":"","sources":["../../../../src/runtime/store/OrganizationsSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAKP,UAAU,EACX,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BA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MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAuBrG;;;;;;OAMG;IACG,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAuBpG;;;;;;;;;;;OAWG;IACG,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA6BpH;;;;;;OAMG;IACG,SAAS,CACb,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,kBAAkB,EAC5B,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IA0BpC;;;;;;;;OAQG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,KAAK,CAAC;CAqBlF"}
|
|
@@ -28,10 +28,10 @@ export class OrganizationsSdk extends SdkBase {
|
|
|
28
28
|
data = JSON.parse(result.body);
|
|
29
29
|
}
|
|
30
30
|
catch {
|
|
31
|
-
throw new Error(`${E_PREFIX}${E_INVALID_JSON}
|
|
31
|
+
throw new Error(`${E_PREFIX}${E_INVALID_JSON}`);
|
|
32
32
|
}
|
|
33
33
|
if (!Array.isArray(data.items)) {
|
|
34
|
-
throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}
|
|
34
|
+
throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`);
|
|
35
35
|
}
|
|
36
36
|
return data;
|
|
37
37
|
}
|
|
@@ -61,12 +61,287 @@ export class OrganizationsSdk extends SdkBase {
|
|
|
61
61
|
data = JSON.parse(result.body);
|
|
62
62
|
}
|
|
63
63
|
catch {
|
|
64
|
-
throw new Error(`${E_PREFIX}${E_INVALID_JSON}
|
|
64
|
+
throw new Error(`${E_PREFIX}${E_INVALID_JSON}`);
|
|
65
|
+
}
|
|
66
|
+
if (!data.kind) {
|
|
67
|
+
throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`);
|
|
68
|
+
}
|
|
69
|
+
return data;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Lists all invitations for a given organization.
|
|
73
|
+
* @param oid The organization ID.
|
|
74
|
+
* @param request The request options.
|
|
75
|
+
* @returns A promise that resolves to a list of invitations.
|
|
76
|
+
*/
|
|
77
|
+
async listInvitations(oid, request = {}) {
|
|
78
|
+
const { token } = request;
|
|
79
|
+
const url = this.sdk.getUrl(RouteBuilder.invitations(oid));
|
|
80
|
+
const result = await this.sdk.http.get(url.toString(), { token });
|
|
81
|
+
this.inspectCommonStatusCodes(result);
|
|
82
|
+
const E_PREFIX = 'Unable to list organization invitations. ';
|
|
83
|
+
if (result.status !== 200) {
|
|
84
|
+
this.logInvalidResponse(result);
|
|
85
|
+
let e = this.createGenericSdkError(result.body);
|
|
86
|
+
if (!e) {
|
|
87
|
+
e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status);
|
|
88
|
+
e.response = result.body;
|
|
89
|
+
}
|
|
90
|
+
throw e;
|
|
91
|
+
}
|
|
92
|
+
if (!result.body) {
|
|
93
|
+
throw new Error(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`);
|
|
94
|
+
}
|
|
95
|
+
let data;
|
|
96
|
+
try {
|
|
97
|
+
data = JSON.parse(result.body);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
throw new Error(`${E_PREFIX}${E_INVALID_JSON}`);
|
|
101
|
+
}
|
|
102
|
+
if (!Array.isArray(data.items)) {
|
|
103
|
+
throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`);
|
|
104
|
+
}
|
|
105
|
+
return data;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Creates an invitation for a user to join an organization.
|
|
109
|
+
* @param oid The organization ID.
|
|
110
|
+
* @param email The email address of the user to invite.
|
|
111
|
+
* @param grant_type The type of grant for the user.
|
|
112
|
+
* @param name The name of the user (optional).
|
|
113
|
+
* @param request The request options.
|
|
114
|
+
* @returns A promise that resolves to the created invitation.
|
|
115
|
+
*/
|
|
116
|
+
async createInvitation(oid, email, grant_type, name, request = {}) {
|
|
117
|
+
const url = this.sdk.getUrl(RouteBuilder.invitations(oid));
|
|
118
|
+
const body = {
|
|
119
|
+
email,
|
|
120
|
+
name,
|
|
121
|
+
grant_type,
|
|
122
|
+
};
|
|
123
|
+
const result = await this.sdk.http.post(url.toString(), {
|
|
124
|
+
body: JSON.stringify(body),
|
|
125
|
+
token: request.token,
|
|
126
|
+
headers: {
|
|
127
|
+
'Content-Type': 'application/json',
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
this.inspectCommonStatusCodes(result);
|
|
131
|
+
const E_PREFIX = 'Unable to create an invitation. ';
|
|
132
|
+
if (result.status !== 200) {
|
|
133
|
+
throw new Error(`${E_PREFIX}Invalid response status: ${result.status}`);
|
|
134
|
+
}
|
|
135
|
+
if (!result.body) {
|
|
136
|
+
throw new Error(`${E_PREFIX}Response has no value.`);
|
|
137
|
+
}
|
|
138
|
+
let data;
|
|
139
|
+
try {
|
|
140
|
+
data = JSON.parse(result.body);
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
throw new Error(`${E_PREFIX}${E_INVALID_JSON}`);
|
|
65
144
|
}
|
|
66
145
|
if (!data.kind) {
|
|
146
|
+
throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`);
|
|
147
|
+
}
|
|
148
|
+
return data;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Finds an invitation by its token.
|
|
152
|
+
* @param oid The organization ID.
|
|
153
|
+
* @param token The invitation token.
|
|
154
|
+
* @param request The request options.
|
|
155
|
+
* @returns A promise that resolves to the found invitation.
|
|
156
|
+
*/
|
|
157
|
+
async findInvitationByToken(oid, token, request = {}) {
|
|
158
|
+
const url = this.sdk.getUrl(RouteBuilder.findInvitation(oid));
|
|
159
|
+
url.searchParams.append('token', token);
|
|
160
|
+
const result = await this.sdk.http.get(url.toString(), request);
|
|
161
|
+
this.inspectCommonStatusCodes(result);
|
|
162
|
+
const E_PREFIX = 'Unable to find invitation by token. ';
|
|
163
|
+
if (result.status !== 200) {
|
|
164
|
+
throw new Error(`${E_PREFIX}Invalid response status: ${result.status}`);
|
|
165
|
+
}
|
|
166
|
+
if (!result.body) {
|
|
167
|
+
throw new Error(`${E_PREFIX}Response has no value.`);
|
|
168
|
+
}
|
|
169
|
+
let data;
|
|
170
|
+
try {
|
|
171
|
+
data = JSON.parse(result.body);
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
throw new Error(`${E_PREFIX}${E_INVALID_JSON}`);
|
|
175
|
+
}
|
|
176
|
+
if (!data.kind) {
|
|
177
|
+
throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`);
|
|
178
|
+
}
|
|
179
|
+
return data;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Declines an invitation.
|
|
183
|
+
* @param oid The organization ID.
|
|
184
|
+
* @param id The invitation ID.
|
|
185
|
+
* @param request The request options.
|
|
186
|
+
* @returns A promise that resolves when the invitation is declined.
|
|
187
|
+
*/
|
|
188
|
+
async declineInvitation(oid, id, request = {}) {
|
|
189
|
+
const url = this.sdk.getUrl(RouteBuilder.declineInvitation(oid, id));
|
|
190
|
+
const result = await this.sdk.http.post(url.toString(), request);
|
|
191
|
+
this.inspectCommonStatusCodes(result);
|
|
192
|
+
const E_PREFIX = 'Unable to decline invitation. ';
|
|
193
|
+
if (result.status !== 200) {
|
|
194
|
+
throw new Error(`${E_PREFIX}Invalid response status: ${result.status}`);
|
|
195
|
+
}
|
|
196
|
+
if (!result.body) {
|
|
197
|
+
throw new Error(`${E_PREFIX}Response has no value.`);
|
|
198
|
+
}
|
|
199
|
+
let data;
|
|
200
|
+
try {
|
|
201
|
+
data = JSON.parse(result.body);
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
throw new Error(`${E_PREFIX}${E_INVALID_JSON}`);
|
|
205
|
+
}
|
|
206
|
+
if (!data.kind) {
|
|
207
|
+
throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`);
|
|
208
|
+
}
|
|
209
|
+
return data;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Soft-deletes an invitation.
|
|
213
|
+
* @param oid The organization ID.
|
|
214
|
+
* @param id The invitation ID.
|
|
215
|
+
* @param request The request options.
|
|
216
|
+
* @returns A promise that resolves to the deleted invitation.
|
|
217
|
+
*/
|
|
218
|
+
async deleteInvitation(oid, id, request = {}) {
|
|
219
|
+
const url = this.sdk.getUrl(RouteBuilder.invitation(oid, id));
|
|
220
|
+
const result = await this.sdk.http.delete(url.toString(), request);
|
|
221
|
+
this.inspectCommonStatusCodes(result);
|
|
222
|
+
const E_PREFIX = 'Unable to delete invitation. ';
|
|
223
|
+
if (result.status !== 200) {
|
|
224
|
+
throw new Error(`${E_PREFIX}Invalid response status: ${result.status}`);
|
|
225
|
+
}
|
|
226
|
+
if (!result.body) {
|
|
227
|
+
throw new Error(`${E_PREFIX}Response has no value.`);
|
|
228
|
+
}
|
|
229
|
+
let data;
|
|
230
|
+
try {
|
|
231
|
+
data = JSON.parse(result.body);
|
|
232
|
+
}
|
|
233
|
+
catch {
|
|
234
|
+
throw new Error(`${E_PREFIX}${E_INVALID_JSON}`);
|
|
235
|
+
}
|
|
236
|
+
if (!data.kind) {
|
|
237
|
+
throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`);
|
|
238
|
+
}
|
|
239
|
+
return data;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Patches an invitation. The server performs the patch validation.
|
|
243
|
+
* The API only allows to patch some of the invitation properties:
|
|
244
|
+
* - name
|
|
245
|
+
* - expires_at
|
|
246
|
+
* - grant_type
|
|
247
|
+
* @param oid The organization ID.
|
|
248
|
+
* @param id The invitation ID.
|
|
249
|
+
* @param info The patch information.
|
|
250
|
+
* @param request The request options.
|
|
251
|
+
* @returns A promise that resolves to the patched invitation.
|
|
252
|
+
*/
|
|
253
|
+
async patchInvitation(oid, id, info, request = {}) {
|
|
254
|
+
const url = this.sdk.getUrl(RouteBuilder.invitation(oid, id));
|
|
255
|
+
const result = await this.sdk.http.patch(url.toString(), {
|
|
256
|
+
body: JSON.stringify(info),
|
|
257
|
+
token: request.token,
|
|
258
|
+
headers: {
|
|
259
|
+
'Content-Type': 'application/json',
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
this.inspectCommonStatusCodes(result);
|
|
263
|
+
const E_PREFIX = 'Unable to update invitation. ';
|
|
264
|
+
if (result.status !== 200) {
|
|
265
|
+
throw new Error(`${E_PREFIX}Invalid response status: ${result.status}`);
|
|
266
|
+
}
|
|
267
|
+
if (!result.body) {
|
|
268
|
+
throw new Error(`${E_PREFIX}Response has no value.`);
|
|
269
|
+
}
|
|
270
|
+
let data;
|
|
271
|
+
try {
|
|
272
|
+
data = JSON.parse(result.body);
|
|
273
|
+
}
|
|
274
|
+
catch {
|
|
275
|
+
throw new Error(`${E_PREFIX}${E_INVALID_JSON}`);
|
|
276
|
+
}
|
|
277
|
+
if (!data.kind) {
|
|
278
|
+
throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`);
|
|
279
|
+
}
|
|
280
|
+
return data;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Lists users in the organization.
|
|
284
|
+
*
|
|
285
|
+
* @param oid The key of the organization we want to read the user from.
|
|
286
|
+
* @param options Optional query options.
|
|
287
|
+
* @param request Optional request options.
|
|
288
|
+
*/
|
|
289
|
+
async listUsers(oid, options, request = {}) {
|
|
290
|
+
const { token } = request;
|
|
291
|
+
const url = this.sdk.getUrl(RouteBuilder.organizationUsers(oid));
|
|
292
|
+
this.sdk.appendListOptions(url, options);
|
|
293
|
+
const result = await this.sdk.http.get(url.toString(), { token });
|
|
294
|
+
this.inspectCommonStatusCodes(result);
|
|
295
|
+
const E_PREFIX = 'Unable to list projects. ';
|
|
296
|
+
if (result.status !== 200) {
|
|
297
|
+
this.logInvalidResponse(result);
|
|
298
|
+
throw new Error(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`);
|
|
299
|
+
}
|
|
300
|
+
if (!result.body) {
|
|
301
|
+
throw new Error(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`);
|
|
302
|
+
}
|
|
303
|
+
let data;
|
|
304
|
+
try {
|
|
305
|
+
data = JSON.parse(result.body);
|
|
306
|
+
}
|
|
307
|
+
catch {
|
|
308
|
+
throw new Error(`${E_PREFIX}${E_INVALID_JSON}.`);
|
|
309
|
+
}
|
|
310
|
+
if (!Array.isArray(data.items)) {
|
|
67
311
|
throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}.`);
|
|
68
312
|
}
|
|
69
313
|
return data;
|
|
70
314
|
}
|
|
315
|
+
/**
|
|
316
|
+
* Gets a user by its key in the organization.
|
|
317
|
+
*
|
|
318
|
+
* @param oid The key of the organization parent organization.
|
|
319
|
+
* @param key The user key.
|
|
320
|
+
* @param request Optional request options.
|
|
321
|
+
* @returns The user object
|
|
322
|
+
* @deprecated Use `organizations.readUser()` instead.
|
|
323
|
+
*/
|
|
324
|
+
async getUser(oid, key, request = {}) {
|
|
325
|
+
const { token } = request;
|
|
326
|
+
const url = this.sdk.getUrl(RouteBuilder.organizationUser(oid, key));
|
|
327
|
+
const result = await this.sdk.http.get(url.toString(), { token });
|
|
328
|
+
this.inspectCommonStatusCodes(result);
|
|
329
|
+
const E_PREFIX = 'Unable to read the user info. ';
|
|
330
|
+
if (result.status !== 200) {
|
|
331
|
+
this.logInvalidResponse(result);
|
|
332
|
+
throw new Error(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`);
|
|
333
|
+
}
|
|
334
|
+
if (!result.body) {
|
|
335
|
+
throw new Error(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`);
|
|
336
|
+
}
|
|
337
|
+
let data;
|
|
338
|
+
try {
|
|
339
|
+
data = JSON.parse(result.body);
|
|
340
|
+
}
|
|
341
|
+
catch {
|
|
342
|
+
throw new Error(`${E_PREFIX}${E_INVALID_JSON}.`);
|
|
343
|
+
}
|
|
344
|
+
return data;
|
|
345
|
+
}
|
|
71
346
|
}
|
|
72
347
|
//# sourceMappingURL=OrganizationsSdk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrganizationsSdk.js","sourceRoot":"","sources":["../../../../src/runtime/store/OrganizationsSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,GAEnB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,OAAO,gBAAiB,SAAQ,OAAO;IAC3C;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,UAAsB,EAAE;QACjC,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAA;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC,CAAA;QACzD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAA;QACjE,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAA;QACrC,MAAM,QAAQ,GAAG,qCAAqC,CAAA;QACtD,IAAI,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1B,IAAI,CAAC,kBAAkB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,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE;YACtD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;YAC1B,KAAK;YACL,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;SACF,CAAC,CAAA;QACF,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAA;QACrC,MAAM,QAAQ,GAAG,oCAAoC,CAAA;QACrD,IAAI,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,4BAA4B,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QACzE,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,wBAAwB,CAAC,CAAA;QACtD,CAAC;QACD,IAAI,IAAmB,CAAA;QACvB,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,GAAG,cAAc,GAAG,CAAC,CAAA;QAClD,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,GAAG,kBAAkB,GAAG,CAAC,CAAA;QACtD,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import {\n SdkBase,\n E_RESPONSE_STATUS,\n E_RESPONSE_NO_VALUE,\n E_INVALID_JSON,\n E_RESPONSE_UNKNOWN,\n SdkOptions,\n} from './SdkBase.js'\nimport { RouteBuilder } from './RouteBuilder.js'\nimport { ContextListResult } from '../../events/BaseEvents.js'\nimport { IOrganization } from '../../models/store/Organization.js'\nimport { SdkError } from './Errors.js'\n\nexport class OrganizationsSdk extends SdkBase {\n /**\n * Lists all user organizations.\n */\n async list(request: SdkOptions = {}): Promise<ContextListResult<IOrganization>> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.organizations())\n const result = await this.sdk.http.get(url.toString(), { token })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to list your organizations. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n let e = this.createGenericSdkError(result.body)\n if (!e) {\n e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)\n e.response = result.body\n }\n throw e\n }\n if (!result.body) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`)\n }\n let data: ContextListResult<IOrganization>\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Error(`${E_PREFIX}${E_INVALID_JSON}.`)\n }\n if (!Array.isArray(data.items)) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}.`)\n }\n return data\n }\n\n async create(orgName: string, request: SdkOptions = {}): Promise<IOrganization> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.organizations())\n const body = {\n name: orgName,\n }\n const result = await this.sdk.http.post(url.toString(), {\n body: JSON.stringify(body),\n token,\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to create an organization. '\n if (result.status !== 200) {\n throw new Error(`${E_PREFIX}Invalid response status: ${result.status}`)\n }\n if (!result.body) {\n throw new Error(`${E_PREFIX}Response has no value.`)\n }\n let data: IOrganization\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Error(`${E_PREFIX}${E_INVALID_JSON}.`)\n }\n if (!data.kind) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}.`)\n }\n return data\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"OrganizationsSdk.js","sourceRoot":"","sources":["../../../../src/runtime/store/OrganizationsSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,i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AG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;QACpE,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,GAAG,mBAAmB,EAAE,CAAC,CAAA;QACtD,CAAC;QACD,IAAI,IAAW,CAAA;QACf,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;QAChC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,GAAG,QAAQ,GAAG,cAAc,GAAG,CAAC,CAAA;QAClD,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF","sourcesContent":["import {\n SdkBase,\n E_RESPONSE_STATUS,\n E_RESPONSE_NO_VALUE,\n E_INVALID_JSON,\n E_RESPONSE_UNKNOWN,\n SdkOptions,\n} from './SdkBase.js'\nimport { RouteBuilder } from './RouteBuilder.js'\nimport type { ContextListOptions, ContextListResult } from '../../events/BaseEvents.js'\nimport type { IOrganization, UserOrganizationGrantType } from '../../models/store/Organization.js'\nimport type { InvitationSchema } from '../../models/store/Invitation.js'\nimport { SdkError } from './Errors.js'\nimport type { PatchInfo } from '../../patch/types.js'\nimport type { IUser } from '../../models/store/User.js'\n\nexport class OrganizationsSdk extends SdkBase {\n /**\n * Lists all user organizations.\n */\n async list(request: SdkOptions = {}): Promise<ContextListResult<IOrganization>> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.organizations())\n const result = await this.sdk.http.get(url.toString(), { token })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to list your organizations. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n let e = this.createGenericSdkError(result.body)\n if (!e) {\n e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)\n e.response = result.body\n }\n throw e\n }\n if (!result.body) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`)\n }\n let data: ContextListResult<IOrganization>\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Error(`${E_PREFIX}${E_INVALID_JSON}`)\n }\n if (!Array.isArray(data.items)) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`)\n }\n return data\n }\n\n async create(orgName: string, request: SdkOptions = {}): Promise<IOrganization> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.organizations())\n const body = {\n name: orgName,\n }\n const result = await this.sdk.http.post(url.toString(), {\n body: JSON.stringify(body),\n token,\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to create an organization. '\n if (result.status !== 200) {\n throw new Error(`${E_PREFIX}Invalid response status: ${result.status}`)\n }\n if (!result.body) {\n throw new Error(`${E_PREFIX}Response has no value.`)\n }\n let data: IOrganization\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Error(`${E_PREFIX}${E_INVALID_JSON}`)\n }\n if (!data.kind) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`)\n }\n return data\n }\n\n /**\n * Lists all invitations for a given organization.\n * @param oid The organization ID.\n * @param request The request options.\n * @returns A promise that resolves to a list of invitations.\n */\n async listInvitations(oid: string, request: SdkOptions = {}): Promise<ContextListResult<InvitationSchema>> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.invitations(oid))\n const result = await this.sdk.http.get(url.toString(), { token })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to list organization invitations. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n let e = this.createGenericSdkError(result.body)\n if (!e) {\n e = new SdkError(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`, result.status)\n e.response = result.body\n }\n throw e\n }\n if (!result.body) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`)\n }\n let data: ContextListResult<InvitationSchema>\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Error(`${E_PREFIX}${E_INVALID_JSON}`)\n }\n if (!Array.isArray(data.items)) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`)\n }\n return data\n }\n\n /**\n * Creates an invitation for a user to join an organization.\n * @param oid The organization ID.\n * @param email The email address of the user to invite.\n * @param grant_type The type of grant for the user.\n * @param name The name of the user (optional).\n * @param request The request options.\n * @returns A promise that resolves to the created invitation.\n */\n async createInvitation(\n oid: string,\n email: string,\n grant_type: UserOrganizationGrantType,\n name?: string,\n request: SdkOptions = {}\n ): Promise<InvitationSchema> {\n const url = this.sdk.getUrl(RouteBuilder.invitations(oid))\n const body = {\n email,\n name,\n grant_type,\n }\n const result = await this.sdk.http.post(url.toString(), {\n body: JSON.stringify(body),\n token: request.token,\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to create an invitation. '\n if (result.status !== 200) {\n throw new Error(`${E_PREFIX}Invalid response status: ${result.status}`)\n }\n if (!result.body) {\n throw new Error(`${E_PREFIX}Response has no value.`)\n }\n let data: InvitationSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Error(`${E_PREFIX}${E_INVALID_JSON}`)\n }\n if (!data.kind) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`)\n }\n return data\n }\n\n /**\n * Finds an invitation by its token.\n * @param oid The organization ID.\n * @param token The invitation token.\n * @param request The request options.\n * @returns A promise that resolves to the found invitation.\n */\n async findInvitationByToken(oid: string, token: string, request: SdkOptions = {}): Promise<InvitationSchema> {\n const url = this.sdk.getUrl(RouteBuilder.findInvitation(oid))\n url.searchParams.append('token', token)\n const result = await this.sdk.http.get(url.toString(), request)\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to find invitation by token. '\n if (result.status !== 200) {\n throw new Error(`${E_PREFIX}Invalid response status: ${result.status}`)\n }\n if (!result.body) {\n throw new Error(`${E_PREFIX}Response has no value.`)\n }\n let data: InvitationSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Error(`${E_PREFIX}${E_INVALID_JSON}`)\n }\n if (!data.kind) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`)\n }\n return data\n }\n\n /**\n * Declines an invitation.\n * @param oid The organization ID.\n * @param id The invitation ID.\n * @param request The request options.\n * @returns A promise that resolves when the invitation is declined.\n */\n async declineInvitation(oid: string, id: string, request: SdkOptions = {}): Promise<InvitationSchema> {\n const url = this.sdk.getUrl(RouteBuilder.declineInvitation(oid, id))\n const result = await this.sdk.http.post(url.toString(), request)\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to decline invitation. '\n if (result.status !== 200) {\n throw new Error(`${E_PREFIX}Invalid response status: ${result.status}`)\n }\n if (!result.body) {\n throw new Error(`${E_PREFIX}Response has no value.`)\n }\n let data: InvitationSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Error(`${E_PREFIX}${E_INVALID_JSON}`)\n }\n if (!data.kind) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`)\n }\n return data\n }\n\n /**\n * Soft-deletes an invitation.\n * @param oid The organization ID.\n * @param id The invitation ID.\n * @param request The request options.\n * @returns A promise that resolves to the deleted invitation.\n */\n async deleteInvitation(oid: string, id: string, request: SdkOptions = {}): Promise<InvitationSchema> {\n const url = this.sdk.getUrl(RouteBuilder.invitation(oid, id))\n const result = await this.sdk.http.delete(url.toString(), request)\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to delete invitation. '\n if (result.status !== 200) {\n throw new Error(`${E_PREFIX}Invalid response status: ${result.status}`)\n }\n if (!result.body) {\n throw new Error(`${E_PREFIX}Response has no value.`)\n }\n let data: InvitationSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Error(`${E_PREFIX}${E_INVALID_JSON}`)\n }\n if (!data.kind) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`)\n }\n return data\n }\n\n /**\n * Patches an invitation. The server performs the patch validation.\n * The API only allows to patch some of the invitation properties:\n * - name\n * - expires_at\n * - grant_type\n * @param oid The organization ID.\n * @param id The invitation ID.\n * @param info The patch information.\n * @param request The request options.\n * @returns A promise that resolves to the patched invitation.\n */\n async patchInvitation(oid: string, id: string, info: PatchInfo, request: SdkOptions = {}): Promise<InvitationSchema> {\n const url = this.sdk.getUrl(RouteBuilder.invitation(oid, id))\n const result = await this.sdk.http.patch(url.toString(), {\n body: JSON.stringify(info),\n token: request.token,\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to update invitation. '\n if (result.status !== 200) {\n throw new Error(`${E_PREFIX}Invalid response status: ${result.status}`)\n }\n if (!result.body) {\n throw new Error(`${E_PREFIX}Response has no value.`)\n }\n let data: InvitationSchema\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Error(`${E_PREFIX}${E_INVALID_JSON}`)\n }\n if (!data.kind) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}`)\n }\n return data\n }\n\n /**\n * Lists users in the organization.\n *\n * @param oid The key of the organization we want to read the user from.\n * @param options Optional query options.\n * @param request Optional request options.\n */\n async listUsers(\n oid: string,\n options?: ContextListOptions,\n request: SdkOptions = {}\n ): Promise<ContextListResult<IUser>> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.organizationUsers(oid))\n this.sdk.appendListOptions(url, options)\n const result = await this.sdk.http.get(url.toString(), { token })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to list projects. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n throw new Error(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`)\n }\n if (!result.body) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`)\n }\n let data: ContextListResult<IUser>\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Error(`${E_PREFIX}${E_INVALID_JSON}.`)\n }\n if (!Array.isArray(data.items)) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_UNKNOWN}.`)\n }\n return data\n }\n\n /**\n * Gets a user by its key in the organization.\n *\n * @param oid The key of the organization parent organization.\n * @param key The user key.\n * @param request Optional request options.\n * @returns The user object\n * @deprecated Use `organizations.readUser()` instead.\n */\n async getUser(oid: string, key: string, request: SdkOptions = {}): Promise<IUser> {\n const { token } = request\n const url = this.sdk.getUrl(RouteBuilder.organizationUser(oid, key))\n const result = await this.sdk.http.get(url.toString(), { token })\n this.inspectCommonStatusCodes(result)\n const E_PREFIX = 'Unable to read the user info. '\n if (result.status !== 200) {\n this.logInvalidResponse(result)\n throw new Error(`${E_PREFIX}${E_RESPONSE_STATUS}${result.status}`)\n }\n if (!result.body) {\n throw new Error(`${E_PREFIX}${E_RESPONSE_NO_VALUE}`)\n }\n let data: IUser\n try {\n data = JSON.parse(result.body)\n } catch {\n throw new Error(`${E_PREFIX}${E_INVALID_JSON}.`)\n }\n return data\n }\n}\n"]}
|
|
@@ -69,6 +69,21 @@ export declare class RouteBuilder {
|
|
|
69
69
|
static projectExecutionBulkDelete(): string;
|
|
70
70
|
static projectExecutionClear(scope: 'organization' | 'project' | 'folder'): string;
|
|
71
71
|
static organizations(): string;
|
|
72
|
+
static organization(oid: string): string;
|
|
73
|
+
static organizationUsers(oid: string): string;
|
|
74
|
+
static organizationUser(oid: string, key: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated Use `organizationUsers` instead.
|
|
77
|
+
*/
|
|
78
|
+
static users(oid: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated Use `organizationUser` instead.
|
|
81
|
+
*/
|
|
82
|
+
static user(oid: string, key: string): string;
|
|
83
|
+
static invitations(oid: string): string;
|
|
84
|
+
static invitation(oid: string, id: string): string;
|
|
85
|
+
static findInvitation(oid: string): string;
|
|
86
|
+
static declineInvitation(oid: string, id: string): string;
|
|
72
87
|
/**
|
|
73
88
|
* @deprecated Not used anymore
|
|
74
89
|
*/
|
|
@@ -84,8 +99,6 @@ export declare class RouteBuilder {
|
|
|
84
99
|
*/
|
|
85
100
|
static authToken(code: string): string;
|
|
86
101
|
static usersMe(): string;
|
|
87
|
-
static users(oid: string): string;
|
|
88
|
-
static user(oid: string, key: string): string;
|
|
89
102
|
static dataCatalog(): string;
|
|
90
103
|
static dataCatalogStatus(domainId: string): string;
|
|
91
104
|
static dataCatalogEntry(domainId: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteBuilder.d.ts","sourceRoot":"","sources":["../../../../src/runtime/store/RouteBuilder.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,qBAAa,YAAY;IACvB;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAInC;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAIjC;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAIvC;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAItC;;OAEG;IACH,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAI7C;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAIlD;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAInD;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAIvD;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAIzD;;OAEG;IACH,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB;;OAEG;IACH,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RouteBuilder {
|
|
|
129
129
|
static organizations() {
|
|
130
130
|
return '/v1/orgs';
|
|
131
131
|
}
|
|
132
|
+
static organization(oid) {
|
|
133
|
+
return `/v1/orgs/${oid}`;
|
|
134
|
+
}
|
|
135
|
+
static organizationUsers(oid) {
|
|
136
|
+
return `${this.organization(oid)}/users`;
|
|
137
|
+
}
|
|
138
|
+
static organizationUser(oid, key) {
|
|
139
|
+
return `${this.organization(oid)}/users/${key}`;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated Use `organizationUsers` instead.
|
|
143
|
+
*/
|
|
144
|
+
static users(oid) {
|
|
145
|
+
return `${this.organization(oid)}/users`;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* @deprecated Use `organizationUser` instead.
|
|
149
|
+
*/
|
|
150
|
+
static user(oid, key) {
|
|
151
|
+
return `${this.organization(oid)}/users/${key}`;
|
|
152
|
+
}
|
|
153
|
+
static invitations(oid) {
|
|
154
|
+
return `${this.organization(oid)}/invitations`;
|
|
155
|
+
}
|
|
156
|
+
static invitation(oid, id) {
|
|
157
|
+
return `${this.invitations(oid)}/${id}`;
|
|
158
|
+
}
|
|
159
|
+
static findInvitation(oid) {
|
|
160
|
+
return `${this.invitations(oid)}/find`;
|
|
161
|
+
}
|
|
162
|
+
static declineInvitation(oid, id) {
|
|
163
|
+
return `${this.invitation(oid, id)}/decline`;
|
|
164
|
+
}
|
|
132
165
|
/**
|
|
133
166
|
* @deprecated Not used anymore
|
|
134
167
|
*/
|
|
@@ -156,12 +189,6 @@ export class RouteBuilder {
|
|
|
156
189
|
static usersMe() {
|
|
157
190
|
return '/v1/users/me';
|
|
158
191
|
}
|
|
159
|
-
static users(oid) {
|
|
160
|
-
return `/v1/orgs/${oid}/users`;
|
|
161
|
-
}
|
|
162
|
-
static user(oid, key) {
|
|
163
|
-
return `/v1/orgs/${oid}/users/${key}`;
|
|
164
|
-
}
|
|
165
192
|
static dataCatalog() {
|
|
166
193
|
return '/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AAe;QACjE,OAAO,GAAG,YAAY,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAA;IACzE,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-extraneous-class */\n/**\n * A helper class to make sure routes user and reported by this service are consistent.\n */\nexport class RouteBuilder {\n /**\n * @param oid The org id.\n * @returns The path to the /folders/{oid} route.\n */\n static folders(oid: string): string {\n return `/v1/orgs/${oid}/folders`\n }\n\n /**\n * @returns The path to the /files/{oid} route.\n */\n static files(oid: string): string {\n return `/v1/orgs/${oid}/files`\n }\n\n /**\n * Used for SSE or WS to inform clients about a file being shared with the user.\n * @returns The path to the /files/access route.\n */\n static filesAccess(oid: string): string {\n return `${RouteBuilder.files(oid)}/access`\n }\n\n /**\n * @returns The path to the /files/{oid}/batch route.\n */\n static filesBatch(oid: string): string {\n return `${RouteBuilder.files(oid)}/batch`\n }\n\n /**\n * @returns The path to the /files/{oid}/[id] route.\n */\n static file(oid: string, key: string): string {\n return `${RouteBuilder.files(oid)}/${key}`\n }\n\n /**\n * @returns The path to the /files/{oid}/[id] route.\n */\n static fileMedia(oid: string, key: string): string {\n return `${RouteBuilder.file(oid, key)}/media`\n }\n\n /**\n * @returns The path to the /files/{oid}/[id]/users route.\n */\n static fileUsers(oid: string, file: string): string {\n return `${RouteBuilder.file(oid, file)}/users`\n }\n\n /**\n * @returns The path to the /file/{oid}/[id]/revisions route.\n */\n static fileRevisions(oid: string, file: string): string {\n return `${RouteBuilder.file(oid, file)}/revisions`\n }\n\n /**\n * @returns The path to the /file/{oid}/[id]/revisions route.\n */\n static fileBreadcrumbs(oid: string, file: string): string {\n return `${RouteBuilder.file(oid, file)}/breadcrumbs`\n }\n\n /**\n * @deprecated Not used anymore\n */\n static backend(): string {\n return '/store'\n }\n\n /**\n * @deprecated Not used anymore\n */\n static sessions(): string {\n return '/sessions'\n }\n\n /**\n * @deprecated Not used anymore\n */\n static sessionRenew(): string {\n return '/sessions/renew'\n }\n\n static history(): string {\n return `/history`\n }\n\n static historyBatchCreate(): string {\n return `/history/batch/create`\n }\n\n static historyBatchDelete(): string {\n return `/history/batch/delete`\n }\n\n static historyItem(key: string): string {\n return `/history/${key}`\n }\n\n static historyClear(type: 'organization' | 'project' | 'request', ...key: string[]): string {\n return `/history/clear/${type}/${key.join('/')}`\n }\n\n static shared(oid: string): string {\n return `/v1/orgs/${oid}/shared`\n }\n\n static trash(oid: string): string {\n return `/v1/orgs/${oid}/trash`\n }\n\n static trashItem(oid: string, trashKey: string): string {\n // GET + DELETE (link to ./delete)\n return `${RouteBuilder.trash(oid)}/${trashKey}`\n }\n\n static trashRestore(oid: string, trashKey: string): string {\n return `${RouteBuilder.trashItem(oid, trashKey)}/restore`\n }\n\n static trashEmpty(oid: string): string {\n return `${RouteBuilder.trash(oid)}/empty`\n }\n\n static trashBatchRestore(oid: string): string {\n return `${RouteBuilder.trash(oid)}/restore`\n }\n\n static trashBatchDelete(oid: string): string {\n return `${RouteBuilder.trash(oid)}/delete`\n }\n\n static projectExecutions(): string {\n return `/project/execution`\n }\n\n static projectExecution(key: string): string {\n return `/project/execution/${key}`\n }\n\n static projectExecutionBulkDelete(): string {\n return `/project/execution/delete`\n }\n\n static projectExecutionClear(scope: 'organization' | 'project' | 'folder'): string {\n return `/project/execution/clear/${scope}`\n }\n\n static organizations(): string {\n return '/v1/orgs'\n }\n\n /**\n * @deprecated Not used anymore\n */\n static authLogin(): string {\n return '/auth/login'\n }\n\n static authGoogle(): string {\n return '/auth/google'\n }\n\n static authRenew(): string {\n return '/auth/renew'\n }\n\n /**\n * @deprecated Not used anymore\n */\n static authProvider(provider: string): string {\n return `/auth/${provider}`\n }\n\n /**\n * @deprecated Not used anymore\n */\n static authToken(code: string): string {\n return `/auth/token/${code}`\n }\n\n static usersMe(): string {\n return '/v1/users/me'\n }\n\n static users(oid: string): string {\n return `/v1/orgs/${oid}/users`\n }\n\n static user(oid: string, key: string): string {\n return `/v1/orgs/${oid}/users/${key}`\n }\n\n static dataCatalog(): string {\n return '/v1/datacatalog'\n }\n\n static dataCatalogStatus(domainId: string): string {\n return `${RouteBuilder.dataCatalog()}/status/${domainId}`\n }\n\n static dataCatalogEntry(domainId: string): string {\n return `${RouteBuilder.dataCatalog()}/${domainId}`\n }\n\n static dataCatalogEntryVersions(entryId: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/versions`\n }\n\n static dataCatalogDependencies(): string {\n return `${RouteBuilder.dataCatalog()}/dependencies`\n }\n\n static dataCatalogVersion(entryId: string, version: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/${version}`\n }\n\n static dataCatalogDeprecate(entryId: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/deprecate`\n }\n\n static dataCatalogUnpublish(entryId: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/unpublish`\n }\n\n static dataCatalogVersionDeprecate(entryId: string, version: string): string {\n return `${RouteBuilder.dataCatalogVersion(entryId, version)}/deprecate`\n }\n\n static dataCatalogVersionUnpublish(entryId: string, version: string): string {\n return `${RouteBuilder.dataCatalogVersion(entryId, version)}/unpublish`\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"RouteBuilder.js","sourceRoot":"","sources":["../../../../src/runtime/store/RouteBuilder.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D;;GAEG;AACH,MAAM,OAAO,YAAY;IACvB;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,GAAW;QACxB,OAAO,YAAY,GAAG,UAAU,CAAA;IAClC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,GAAW;QACtB,OAAO,YAAY,GAAG,QAAQ,CAAA;IAChC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,WAAW,CAAC,GAAW;QAC5B,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAA;IAC5C,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,GAAW;QAC3B,OA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,CAAC,gBAAgB,CAAC,OAAO,CAAC,YAAY,CAAA;IAC9D,CAAC;IAED,MAAM,CAAC,oBAAoB,CAAC,OAAe;QACzC,OAAO,GAAG,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,YAAY,CAAA;IAC9D,CAAC;IAED,MAAM,CAAC,2BAA2B,CAAC,OAAe,EAAE,OAAe;QACjE,OAAO,GAAG,YAAY,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAA;IACzE,CAAC;IAED,MAAM,CAAC,2BAA2B,CAAC,OAAe,EAAE,OAAe;QACjE,OAAO,GAAG,YAAY,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAA;IACzE,CAAC;CACF","sourcesContent":["/* eslint-disable @typescript-eslint/no-extraneous-class */\n/**\n * A helper class to make sure routes user and reported by this service are consistent.\n */\nexport class RouteBuilder {\n /**\n * @param oid The org id.\n * @returns The path to the /folders/{oid} route.\n */\n static folders(oid: string): string {\n return `/v1/orgs/${oid}/folders`\n }\n\n /**\n * @returns The path to the /files/{oid} route.\n */\n static files(oid: string): string {\n return `/v1/orgs/${oid}/files`\n }\n\n /**\n * Used for SSE or WS to inform clients about a file being shared with the user.\n * @returns The path to the /files/access route.\n */\n static filesAccess(oid: string): string {\n return `${RouteBuilder.files(oid)}/access`\n }\n\n /**\n * @returns The path to the /files/{oid}/batch route.\n */\n static filesBatch(oid: string): string {\n return `${RouteBuilder.files(oid)}/batch`\n }\n\n /**\n * @returns The path to the /files/{oid}/[id] route.\n */\n static file(oid: string, key: string): string {\n return `${RouteBuilder.files(oid)}/${key}`\n }\n\n /**\n * @returns The path to the /files/{oid}/[id] route.\n */\n static fileMedia(oid: string, key: string): string {\n return `${RouteBuilder.file(oid, key)}/media`\n }\n\n /**\n * @returns The path to the /files/{oid}/[id]/users route.\n */\n static fileUsers(oid: string, file: string): string {\n return `${RouteBuilder.file(oid, file)}/users`\n }\n\n /**\n * @returns The path to the /file/{oid}/[id]/revisions route.\n */\n static fileRevisions(oid: string, file: string): string {\n return `${RouteBuilder.file(oid, file)}/revisions`\n }\n\n /**\n * @returns The path to the /file/{oid}/[id]/revisions route.\n */\n static fileBreadcrumbs(oid: string, file: string): string {\n return `${RouteBuilder.file(oid, file)}/breadcrumbs`\n }\n\n /**\n * @deprecated Not used anymore\n */\n static backend(): string {\n return '/store'\n }\n\n /**\n * @deprecated Not used anymore\n */\n static sessions(): string {\n return '/sessions'\n }\n\n /**\n * @deprecated Not used anymore\n */\n static sessionRenew(): string {\n return '/sessions/renew'\n }\n\n static history(): string {\n return `/history`\n }\n\n static historyBatchCreate(): string {\n return `/history/batch/create`\n }\n\n static historyBatchDelete(): string {\n return `/history/batch/delete`\n }\n\n static historyItem(key: string): string {\n return `/history/${key}`\n }\n\n static historyClear(type: 'organization' | 'project' | 'request', ...key: string[]): string {\n return `/history/clear/${type}/${key.join('/')}`\n }\n\n static shared(oid: string): string {\n return `/v1/orgs/${oid}/shared`\n }\n\n static trash(oid: string): string {\n return `/v1/orgs/${oid}/trash`\n }\n\n static trashItem(oid: string, trashKey: string): string {\n // GET + DELETE (link to ./delete)\n return `${RouteBuilder.trash(oid)}/${trashKey}`\n }\n\n static trashRestore(oid: string, trashKey: string): string {\n return `${RouteBuilder.trashItem(oid, trashKey)}/restore`\n }\n\n static trashEmpty(oid: string): string {\n return `${RouteBuilder.trash(oid)}/empty`\n }\n\n static trashBatchRestore(oid: string): string {\n return `${RouteBuilder.trash(oid)}/restore`\n }\n\n static trashBatchDelete(oid: string): string {\n return `${RouteBuilder.trash(oid)}/delete`\n }\n\n static projectExecutions(): string {\n return `/project/execution`\n }\n\n static projectExecution(key: string): string {\n return `/project/execution/${key}`\n }\n\n static projectExecutionBulkDelete(): string {\n return `/project/execution/delete`\n }\n\n static projectExecutionClear(scope: 'organization' | 'project' | 'folder'): string {\n return `/project/execution/clear/${scope}`\n }\n\n static organizations(): string {\n return '/v1/orgs'\n }\n\n static organization(oid: string): string {\n return `/v1/orgs/${oid}`\n }\n\n static organizationUsers(oid: string): string {\n return `${this.organization(oid)}/users`\n }\n\n static organizationUser(oid: string, key: string): string {\n return `${this.organization(oid)}/users/${key}`\n }\n\n /**\n * @deprecated Use `organizationUsers` instead.\n */\n static users(oid: string): string {\n return `${this.organization(oid)}/users`\n }\n\n /**\n * @deprecated Use `organizationUser` instead.\n */\n static user(oid: string, key: string): string {\n return `${this.organization(oid)}/users/${key}`\n }\n\n static invitations(oid: string): string {\n return `${this.organization(oid)}/invitations`\n }\n\n static invitation(oid: string, id: string): string {\n return `${this.invitations(oid)}/${id}`\n }\n\n static findInvitation(oid: string): string {\n return `${this.invitations(oid)}/find`\n }\n\n static declineInvitation(oid: string, id: string): string {\n return `${this.invitation(oid, id)}/decline`\n }\n\n /**\n * @deprecated Not used anymore\n */\n static authLogin(): string {\n return '/auth/login'\n }\n\n static authGoogle(): string {\n return '/auth/google'\n }\n\n static authRenew(): string {\n return '/auth/renew'\n }\n\n /**\n * @deprecated Not used anymore\n */\n static authProvider(provider: string): string {\n return `/auth/${provider}`\n }\n\n /**\n * @deprecated Not used anymore\n */\n static authToken(code: string): string {\n return `/auth/token/${code}`\n }\n\n static usersMe(): string {\n return '/v1/users/me'\n }\n\n static dataCatalog(): string {\n return '/v1/datacatalog'\n }\n\n static dataCatalogStatus(domainId: string): string {\n return `${RouteBuilder.dataCatalog()}/status/${domainId}`\n }\n\n static dataCatalogEntry(domainId: string): string {\n return `${RouteBuilder.dataCatalog()}/${domainId}`\n }\n\n static dataCatalogEntryVersions(entryId: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/versions`\n }\n\n static dataCatalogDependencies(): string {\n return `${RouteBuilder.dataCatalog()}/dependencies`\n }\n\n static dataCatalogVersion(entryId: string, version: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/${version}`\n }\n\n static dataCatalogDeprecate(entryId: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/deprecate`\n }\n\n static dataCatalogUnpublish(entryId: string): string {\n return `${RouteBuilder.dataCatalogEntry(entryId)}/unpublish`\n }\n\n static dataCatalogVersionDeprecate(entryId: string, version: string): string {\n return `${RouteBuilder.dataCatalogVersion(entryId, version)}/deprecate`\n }\n\n static dataCatalogVersionUnpublish(entryId: string, version: string): string {\n return `${RouteBuilder.dataCatalogVersion(entryId, version)}/unpublish`\n }\n}\n"]}
|
|
@@ -55,7 +55,7 @@ export declare abstract class Sdk {
|
|
|
55
55
|
revisions: RevisionsSdk;
|
|
56
56
|
trash: TrashSdk;
|
|
57
57
|
projectExecution: ProjectExecutionSdk;
|
|
58
|
-
|
|
58
|
+
organizations: OrganizationsSdk;
|
|
59
59
|
dataCatalog: DataCatalogSdk;
|
|
60
60
|
/**
|
|
61
61
|
* When set it limits log output to minimum.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sdk.d.ts","sourceRoot":"","sources":["../../../../src/runtime/store/Sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,E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