-
Notifications
You must be signed in to change notification settings - Fork 3
/
spaces.d.ts
564 lines (562 loc) · 21.2 KB
/
spaces.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
import { A as ApiCallOptions } from './invoke-fetch-types-0Dw3a71T.js';
import './auth-types-PkN9CAF_.js';
/**
* The supported actions for user-created spaces.
*/
type ActionName = "change_owner" | "create" | "read" | "update" | "delete" | "publish";
type Assignment = {
/** The userId or groupId based on the type. */
assigneeId: string;
/** The date and time when the space was created. */
readonly createdAt?: string;
/** The ID of the user who created the assignment. */
readonly createdBy?: string;
readonly id: string;
readonly links: {
self: Link;
space?: Link;
};
/** The roles assigned to a user or group. Must not be empty. */
roles: RoleType[];
/** The unique identifier for the space. */
readonly spaceId: string;
/** The unique identifier for the tenant. */
readonly tenantId: string;
/** The type of assignment such as user or group */
type: AssignmentType;
/** The date and time when the space was updated. */
readonly updatedAt?: string;
/** The ID of the user who updated the assignment. */
readonly updatedBy?: string;
};
type AssignmentCreate = {
/** The userId or groupId based on the type. */
assigneeId: string;
/** The roles assigned to the assigneeId. For the full list of roles assignable in this space type, call `GET /spaces/{spaceId}` and inspect the `meta.assignableRoles` object. */
roles: RoleType[];
/** The type of assignment such as user or group */
type: AssignmentType;
};
/**
* The type of assignment such as user or group
*/
type AssignmentType = "user" | "group";
type AssignmentUpdate = {
/** The roles assigned to the assigneeId. For the full list of roles assignable in this space type, call `GET /spaces/{spaceId}` and inspect the `meta.assignableRoles` object. */
roles?: RoleType[];
};
type Assignments = {
data?: Assignment[];
readonly links?: {
next?: Link;
prev?: Link;
self: Link;
};
readonly meta?: {
/** The total number of assignments matching the current filter. */
count: number;
};
};
/**
* An error object.
*/
type Error = {
/** The error code. */
code: string;
/** A human-readable explanation specific to the occurrence of this problem. */
detail?: string;
/** Additional properties relating to the error. */
meta?: {
/** References to the source of the error. */
source?: {
/** The URI query parameter that caused the error. */
parameter?: string;
/** A JSON pointer to the property that caused the error. */
pointer?: string;
};
};
/** Summary of the problem. */
title: string;
};
type Errors = {
/** @deprecated
* The error code. */
code?: string;
/** @deprecated
* A human-readable explanation specific to the occurrence of this problem. */
detail?: string;
errors?: Error[];
/** @deprecated
* Additional properties relating to the error. */
meta?: unknown;
/** @deprecated
* References to the source of the error. */
source?: {
/** The URI query parameter that caused the error. */
parameter?: string;
/** A JSON pointer to the property that caused the error. */
pointer?: string;
};
/** @deprecated
* Summary of the problem. */
title?: string;
traceId?: string;
};
type Link = {
/** URL that defines the resource. */
href: string;
};
/**
* Supported roles by space type:
* - Shared: codeveloper, consumer, dataconsumer, facilitator, producer
* - Managed: consumer, contributor, dataconsumer, facilitator, publisher, basicconsumer
* - Data: consumer, dataconsumer, datapreview, facilitator, operator, producer, publisher
*/
type RoleType = "consumer" | "contributor" | "dataconsumer" | "datapreview" | "facilitator" | "operator" | "producer" | "publisher" | "basicconsumer" | "codeveloper";
/**
* The supported roles for Shared spaces.
*/
type SharedSpaceRoleType = "facilitator" | "consumer" | "producer" | "dataconsumer" | "codeveloper";
/**
* A space is a security context simplifying the management of access control by allowing users to control it on the containers instead of on the resources themselves.
*/
type Space = {
/** The date and time when the space was created. */
readonly createdAt?: string;
/** The ID of the user who created the space. */
readonly createdBy?: string;
/** The description of the space. Personal spaces do not have a description. */
description?: string;
/** A unique identifier for the space, for example, 62716f4b39b865ece543cd45. */
readonly id: string;
readonly links: {
assignments: Link;
self: Link;
};
/** Information about the space settings. */
readonly meta?: {
/** The list of actions allowed by the current user in this space. */
actions: ActionName[];
/** The list of roles that could be assigned in this space. */
assignableRoles: RoleType[];
/** The list of roles assigned to the current user in this space. */
roles: RoleType[];
};
/** The name of the space. Personal spaces do not have a name. */
name: string;
/** The ID for the space owner. */
readonly ownerId?: string;
/** The ID for the tenant, for example, xqGQ0k66vSR8f9G7J-vYtHZQkiYrCpct. */
readonly tenantId: string;
/** The type of space such as shared, managed, and so on. */
readonly type?: "shared" | "managed" | "data";
/** The date and time when the space was updated. */
readonly updatedAt?: string;
};
type SpaceCreate = {
/** The description of the space. Personal spaces do not have a description. */
description?: string;
/** The name of the space. Personal spaces do not have a name. */
name: string;
/** The type of space such as shared, managed, and so on. */
type: "shared" | "managed" | "data";
};
type SpacePatch = {
/** The operation to be performed. */
op: "replace";
/** Field of space to be patched (updated). */
path: "/name" | "/ownerId" | "/description";
/** The value to be used within the operations.
* - name: The name (string) of space of maxLength 256 of pattern: ^[^\"\*\?\<\>\/\|\\\:]+$
* - description: The description (string) of the space. Personal spaces do not have a description.
* - ownerId: The user ID in uid format (string) of the space owner. */
value: string;
}[];
/**
* The name of the type.
*/
type SpaceType = "shared" | "managed" | "data";
/**
* The distinct types of spaces (shared, managed, and so on).
*/
type SpaceTypes = {
readonly data?: SpaceType[];
};
type SpaceUpdate = {
/** The description of the space. Personal spaces do not have a description. */
description?: string;
/** The name of the space. */
name?: string;
/** The user ID of the space owner. */
ownerId?: string;
};
type Spaces = {
data?: Space[];
readonly links?: {
next?: Link;
prev?: Link;
self: Link;
};
readonly meta?: {
/** The total number of spaces matching the current filter. */
count: number;
/** The meta related to personal space when applicable. */
readonly personalSpace?: {
/** The list of actions allowed by the current user in this space. */
actions: ActionName[];
/** resource type */
resourceType: string;
};
};
};
/**
* Retrieves spaces that the current user has access to and match the query.
*
* @param query an object with query parameters
* @throws GetSpacesHttpError
*/
declare const getSpaces: (query: {
/** Action on space. Supports only "?action=publish". */
action?: string;
/** Exact match filtering on space name using SCIM. Case insensitive on attribute name. For example ?filter=name eq "MySpace" and ?filter=NAME eq "MySpace" is both valid. */
filter?: string;
/** Maximum number of spaces to return. */
limit?: number;
/** Space name to search and filter for. Case-insensitive open search with wildcards both as prefix and suffix. For example, "?name=fin" will get "finance", "Final" and "Griffin". */
name?: string;
/** The next page cursor. Next links make use of this. */
next?: string;
/** Space ownerId to filter by. For example, "?ownerId=123". */
ownerId?: string;
/** The previous page cursor. Previous links make use of this. */
prev?: string;
/** Field to sort by. Prefix with +/- to indicate asc/desc. For example, "?sort=+name" to sort ascending on Name. Supported fields are "type", "name" and "createdAt". */
sort?: string;
/** Type(s) of space to filter. For example, "?type=managed,shared". */
type?: string;
}, options?: ApiCallOptions) => Promise<GetSpacesHttpResponse>;
type GetSpacesHttpResponse = {
data: Spaces;
headers: Headers;
status: number;
prev?: (options?: ApiCallOptions) => Promise<GetSpacesHttpResponse>;
next?: (options?: ApiCallOptions) => Promise<GetSpacesHttpResponse>;
};
type GetSpacesHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Creates a space. Spaces names must be unique. Spaces of type `data` should only be used for Qlik Talend Data Integration projects.
*
* @param body an object with the body content
* @throws CreateSpaceHttpError
*/
declare const createSpace: (body: SpaceCreate, options?: ApiCallOptions) => Promise<CreateSpaceHttpResponse>;
type CreateSpaceHttpResponse = {
data: Space;
headers: Headers;
status: number;
};
type CreateSpaceHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Gets a list of distinct space types available for use in the tenant.
*
* @throws GetSpaceTypesHttpError
*/
declare const getSpaceTypes: (options?: ApiCallOptions) => Promise<GetSpaceTypesHttpResponse>;
type GetSpaceTypesHttpResponse = {
data: SpaceTypes;
headers: Headers;
status: number;
};
type GetSpaceTypesHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Deletes a space.
*
* @param spaceId The ID of the space to delete.
* @throws DeleteSpaceHttpError
*/
declare const deleteSpace: (spaceId: string, options?: ApiCallOptions) => Promise<DeleteSpaceHttpResponse>;
type DeleteSpaceHttpResponse = {
data: void;
headers: Headers;
status: number;
};
type DeleteSpaceHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Retrieves a single space by ID.
*
* @param spaceId The ID of the space to retrieve.
* @throws GetSpaceHttpError
*/
declare const getSpace: (spaceId: string, options?: ApiCallOptions) => Promise<GetSpaceHttpResponse>;
type GetSpaceHttpResponse = {
data: Space;
headers: Headers;
status: number;
};
type GetSpaceHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Updates one or more properties of a space. To update all properties at once, use `PUT /spaces/{spaceId}`.
*
* @param spaceId The ID of the space to update.
* @param body an object with the body content
* @throws PatchSpaceHttpError
*/
declare const patchSpace: (spaceId: string, body: SpacePatch, options?: ApiCallOptions) => Promise<PatchSpaceHttpResponse>;
type PatchSpaceHttpResponse = {
data: Space;
headers: Headers;
status: number;
};
type PatchSpaceHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Updates a space. To update specific properties, use `PATCH /spaces/{spaceId}`.
*
* @param spaceId The ID of the space to update.
* @param body an object with the body content
* @throws UpdateSpaceHttpError
*/
declare const updateSpace: (spaceId: string, body: SpaceUpdate, options?: ApiCallOptions) => Promise<UpdateSpaceHttpResponse>;
type UpdateSpaceHttpResponse = {
data: Space;
headers: Headers;
status: number;
};
type UpdateSpaceHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Retrieves the assignments of the space matching the query. Each assignment represents one user or group and their corresponding roles in the space. Assignments are not shown for the owner of a space, who receive all `assignableRoles` by default.
*
* @param spaceId The ID of the space of the assignment.
* @param query an object with query parameters
* @throws GetSpaceAssignmentsHttpError
*/
declare const getSpaceAssignments: (spaceId: string, query: {
/** Filters assignment for a specific assigneeid. */
assigneeId?: string;
/** Maximum number of assignments to return. */
limit?: number;
/** The next page cursor. Next links make use of this. */
next?: string;
/** The previous page cursor. Previous links make use of this. */
prev?: string;
/** The type of assignment. Supported values are user or group. */
type?: AssignmentType;
}, options?: ApiCallOptions) => Promise<GetSpaceAssignmentsHttpResponse>;
type GetSpaceAssignmentsHttpResponse = {
data: Assignments;
headers: Headers;
status: number;
prev?: (options?: ApiCallOptions) => Promise<GetSpaceAssignmentsHttpResponse>;
next?: (options?: ApiCallOptions) => Promise<GetSpaceAssignmentsHttpResponse>;
};
type GetSpaceAssignmentsHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Creates an assignment for a user or group (assignee) to a space with the specified roles. Assignments are not required for space owners, who receive all `assignableRoles` by default. Only one assignment can exist per space, per user or group.
*
* @param spaceId The ID of the space of the assignment.
* @param body an object with the body content
* @throws CreateSpaceAssignmentHttpError
*/
declare const createSpaceAssignment: (spaceId: string, body: AssignmentCreate, options?: ApiCallOptions) => Promise<CreateSpaceAssignmentHttpResponse>;
type CreateSpaceAssignmentHttpResponse = {
data: Assignment;
headers: Headers;
status: number;
};
type CreateSpaceAssignmentHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Deletes an assignment.
*
* @param spaceId The ID of the space of the assignment.
* @param assignmentId The ID of the assignment to delete.
* @throws DeleteSpaceAssignmentHttpError
*/
declare const deleteSpaceAssignment: (spaceId: string, assignmentId: string, options?: ApiCallOptions) => Promise<DeleteSpaceAssignmentHttpResponse>;
type DeleteSpaceAssignmentHttpResponse = {
data: void;
headers: Headers;
status: number;
};
type DeleteSpaceAssignmentHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Retrieves a single assignment by assignment ID. Use `GET /spaces/{spaceId}/assignments` to list all users and groups assigned to the space and their assignment ID.
*
* @param spaceId The ID of the space of the assignment.
* @param assignmentId The ID of the assignment to retrieve.
* @throws GetSpaceAssignmentHttpError
*/
declare const getSpaceAssignment: (spaceId: string, assignmentId: string, options?: ApiCallOptions) => Promise<GetSpaceAssignmentHttpResponse>;
type GetSpaceAssignmentHttpResponse = {
data: Assignment;
headers: Headers;
status: number;
};
type GetSpaceAssignmentHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Updates a single assignment by assignment ID. Use `GET /spaces/{spaceId}/assignments` to list all users and groups assigned to the space and their assignment ID. The complete list of roles must be provided.
*
* @param spaceId The ID of the space of the assignment.
* @param assignmentId The ID of the assignment to update.
* @param body an object with the body content
* @throws UpdateSpaceAssignmentHttpError
*/
declare const updateSpaceAssignment: (spaceId: string, assignmentId: string, body: AssignmentUpdate, options?: ApiCallOptions) => Promise<UpdateSpaceAssignmentHttpResponse>;
type UpdateSpaceAssignmentHttpResponse = {
data: Assignment;
headers: Headers;
status: number;
};
type UpdateSpaceAssignmentHttpError = {
data: Errors;
headers: Headers;
status: number;
};
/**
* Clears the cache for spaces api requests.
*/
declare function clearCache(): void;
interface SpacesAPI {
/**
* Retrieves spaces that the current user has access to and match the query.
*
* @param query an object with query parameters
* @throws GetSpacesHttpError
*/
getSpaces: typeof getSpaces;
/**
* Creates a space. Spaces names must be unique. Spaces of type `data` should only be used for Qlik Talend Data Integration projects.
*
* @param body an object with the body content
* @throws CreateSpaceHttpError
*/
createSpace: typeof createSpace;
/**
* Gets a list of distinct space types available for use in the tenant.
*
* @throws GetSpaceTypesHttpError
*/
getSpaceTypes: typeof getSpaceTypes;
/**
* Deletes a space.
*
* @param spaceId The ID of the space to delete.
* @throws DeleteSpaceHttpError
*/
deleteSpace: typeof deleteSpace;
/**
* Retrieves a single space by ID.
*
* @param spaceId The ID of the space to retrieve.
* @throws GetSpaceHttpError
*/
getSpace: typeof getSpace;
/**
* Updates one or more properties of a space. To update all properties at once, use `PUT /spaces/{spaceId}`.
*
* @param spaceId The ID of the space to update.
* @param body an object with the body content
* @throws PatchSpaceHttpError
*/
patchSpace: typeof patchSpace;
/**
* Updates a space. To update specific properties, use `PATCH /spaces/{spaceId}`.
*
* @param spaceId The ID of the space to update.
* @param body an object with the body content
* @throws UpdateSpaceHttpError
*/
updateSpace: typeof updateSpace;
/**
* Retrieves the assignments of the space matching the query. Each assignment represents one user or group and their corresponding roles in the space. Assignments are not shown for the owner of a space, who receive all `assignableRoles` by default.
*
* @param spaceId The ID of the space of the assignment.
* @param query an object with query parameters
* @throws GetSpaceAssignmentsHttpError
*/
getSpaceAssignments: typeof getSpaceAssignments;
/**
* Creates an assignment for a user or group (assignee) to a space with the specified roles. Assignments are not required for space owners, who receive all `assignableRoles` by default. Only one assignment can exist per space, per user or group.
*
* @param spaceId The ID of the space of the assignment.
* @param body an object with the body content
* @throws CreateSpaceAssignmentHttpError
*/
createSpaceAssignment: typeof createSpaceAssignment;
/**
* Deletes an assignment.
*
* @param spaceId The ID of the space of the assignment.
* @param assignmentId The ID of the assignment to delete.
* @throws DeleteSpaceAssignmentHttpError
*/
deleteSpaceAssignment: typeof deleteSpaceAssignment;
/**
* Retrieves a single assignment by assignment ID. Use `GET /spaces/{spaceId}/assignments` to list all users and groups assigned to the space and their assignment ID.
*
* @param spaceId The ID of the space of the assignment.
* @param assignmentId The ID of the assignment to retrieve.
* @throws GetSpaceAssignmentHttpError
*/
getSpaceAssignment: typeof getSpaceAssignment;
/**
* Updates a single assignment by assignment ID. Use `GET /spaces/{spaceId}/assignments` to list all users and groups assigned to the space and their assignment ID. The complete list of roles must be provided.
*
* @param spaceId The ID of the space of the assignment.
* @param assignmentId The ID of the assignment to update.
* @param body an object with the body content
* @throws UpdateSpaceAssignmentHttpError
*/
updateSpaceAssignment: typeof updateSpaceAssignment;
/**
* Clears the cache for spaces api requests.
*/
clearCache: typeof clearCache;
}
/**
* Functions for the spaces api
*/
declare const spacesExport: SpacesAPI;
export { type ActionName, type Assignment, type AssignmentCreate, type AssignmentType, type AssignmentUpdate, type Assignments, type CreateSpaceAssignmentHttpError, type CreateSpaceAssignmentHttpResponse, type CreateSpaceHttpError, type CreateSpaceHttpResponse, type DeleteSpaceAssignmentHttpError, type DeleteSpaceAssignmentHttpResponse, type DeleteSpaceHttpError, type DeleteSpaceHttpResponse, type Error, type Errors, type GetSpaceAssignmentHttpError, type GetSpaceAssignmentHttpResponse, type GetSpaceAssignmentsHttpError, type GetSpaceAssignmentsHttpResponse, type GetSpaceHttpError, type GetSpaceHttpResponse, type GetSpaceTypesHttpError, type GetSpaceTypesHttpResponse, type GetSpacesHttpError, type GetSpacesHttpResponse, type Link, type PatchSpaceHttpError, type PatchSpaceHttpResponse, type RoleType, type SharedSpaceRoleType, type Space, type SpaceCreate, type SpacePatch, type SpaceType, type SpaceTypes, type SpaceUpdate, type Spaces, type SpacesAPI, type UpdateSpaceAssignmentHttpError, type UpdateSpaceAssignmentHttpResponse, type UpdateSpaceHttpError, type UpdateSpaceHttpResponse, clearCache, createSpace, createSpaceAssignment, spacesExport as default, deleteSpace, deleteSpaceAssignment, getSpace, getSpaceAssignment, getSpaceAssignments, getSpaceTypes, getSpaces, patchSpace, updateSpace, updateSpaceAssignment };