-
Notifications
You must be signed in to change notification settings - Fork 3
/
items.d.ts
535 lines (533 loc) · 23.2 KB
/
items.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
import { A as ApiCallOptions } from './invoke-fetch-types-0Dw3a71T.js';
import './auth-types-PkN9CAF_.js';
type CollectionTypes = "private" | "public" | "publicgoverned";
type ErrorResponseBody = {
errors?: ServiceError[];
};
/**
* ListItemCollectionsResponseBody result type
*/
type ItemsListItemCollectionsResponseBody = {
data: CollectionResultResponseBody[];
links: CollectionsLinksResponseBody;
};
/**
* ListItemsResponseBody result type
*/
type ItemsListItemsResponseBody = {
data: ItemResultResponseBody[];
links: ItemsLinksResponseBody;
};
type ItemsSettingsPatch = {
/** The operation to be performed. Only "replace" is supported. */
op: "replace";
/** Field of Settings to be patched (updated). */
path: "/usageMetricsEnabled";
/** The value to be used within the operations. */
value: boolean;
}[];
type ItemsSettingsResponseBody = {
/** Decides if the usage metrics will be shown in the hub UI. */
usageMetricsEnabled: boolean;
};
type ItemsUpdateItemRequestBody = {
description?: string;
name?: string;
resourceAttributes?: unknown;
resourceCustomAttributes?: unknown;
/** The case-sensitive string used to search for an item by resourceId. If resourceId is provided, then resourceType must be provided. Provide either the resourceId or resourceLink, but not both. */
resourceId?: string;
/** The case-sensitive string used to search for an item by resourceLink. If resourceLink is provided, then resourceType must be provided. Provide either the resourceId or resourceLink, but not both. */
resourceLink?: string;
/** Optional field defining the item's subtype, if any. */
resourceSubType?: string;
/** The case-sensitive string defining the item's type. */
resourceType: ItemResourceTypeEnum;
/** The RFC3339 datetime when the resource that the item references was last updated. */
resourceUpdatedAt?: string;
/** The space's unique identifier. */
spaceId?: string;
/** The item thumbnail's unique identifier. This is optional for internal resources. */
thumbnailId?: string;
};
type Link = {
href?: string;
};
type ServiceError = {
/** Code is a unique identifier for this error class. */
code?: string;
/** Detail is a human-readable explanation specific to this occurrence of the problem. */
detail?: string;
meta?: Meta;
/** Title is the name of this class of errors. */
title?: string;
};
type CollectionLinksResponseBody = {
items?: Link;
self?: Link;
};
/**
* Collection metadata and computed fields.
*/
type CollectionMetaResponseBody = {
/** Multiple items. */
items?: ItemsResultResponseBody;
};
/**
* A collection.
*/
type CollectionResultResponseBody = {
/** The RFC3339 datetime when the collection was created. */
createdAt: string;
/** The ID of the user who created the collection. This property is only populated if the JWT contains a userId. */
creatorId?: string;
description?: string;
/** States if a collection has reached its items limit or not */
full?: boolean;
/** The collection's unique identifier. */
id: string;
/** The number of items that have been added to the collection that the user has access to. */
itemCount: number;
links: CollectionLinksResponseBody;
/** Collection metadata and computed fields. */
meta?: CollectionMetaResponseBody;
name: string;
/** The ID of the tenant that owns the collection. This property is populated by using JWT. */
tenantId: string;
type: "private" | "public" | "favorite" | "publicgoverned";
/** The RFC3339 datetime when the collection was last updated. */
updatedAt: string;
/** The ID of the user who last updated the collection. This property is only populated if the JWT contains a userId. */
updaterId?: string;
};
type CollectionsLinksResponseBody = {
item?: Link;
next?: Link;
prev?: Link;
self?: Link;
};
type ItemLinksResponseBody = {
collections?: Link;
open?: Link;
self?: Link;
thumbnail?: Link;
};
/**
* Item metadata and computed fields.
*/
type ItemMetaResponseBody = {
/** The actions that the user can perform on the item. */
actions: string[];
/** An array of collections that the item is part of. */
collections: ItemTagResponseBody[];
/** The flag that indicates if item is in the user's favorites collection. */
isFavorited: boolean;
/** An array of tags that the item is part of. */
tags: ItemTagResponseBody[];
};
/**
* The case-sensitive string defining the item's type.
*/
type ItemResourceTypeEnum = "app" | "collection" | "qlikview" | "insight" | "qvapp" | "genericlink" | "sharingservicetask" | "note" | "dataasset" | "dataset" | "automation" | "automl-experiment" | "automl-deployment";
/**
* An item.
*/
type ItemResultResponseBody = {
/** The actions that the user can perform on the item. */
actions: string[];
/** The ID of the collections that the item has been added to. */
collectionIds: string[];
/** The RFC3339 datetime when the item was created. */
createdAt: string;
/** The ID of the user who created the item. This is only populated if the JWT contains a userId. */
creatorId?: string;
description?: string;
/** The item's unique identifier. */
id: string;
/** The flag that indicates if item is in the user's favorites collection. */
isFavorited: boolean;
itemViews?: ItemViewsResponseBody;
links: ItemLinksResponseBody;
/** Item metadata and computed fields. */
meta: ItemMetaResponseBody;
name: string;
/** The ID of the user who owns the item. */
ownerId?: string;
resourceAttributes: unknown;
/** The RFC3339 datetime when the resource that the item references was created. */
resourceCreatedAt: string;
resourceCustomAttributes: unknown;
/** The case-sensitive string used to search for an item by resourceId. If resourceId is provided, then resourceType must be provided. Provide either the resourceId or resourceLink, but not both. */
resourceId?: string;
/** The case-sensitive string used to search for an item by resourceLink. If resourceLink is provided, then resourceType must be provided. Provide either the resourceId or resourceLink, but not both. */
resourceLink?: string;
/** The RFC3339 datetime when the resource last reload ended. */
resourceReloadEndTime?: string;
/** If the resource last reload was successful or not. */
resourceReloadStatus?: string;
resourceSize?: ItemsResourceSizeResponseBody;
/** Optional field defining the item's subtype, if any. */
resourceSubType?: string;
/** The case-sensitive string defining the item's type. */
resourceType: ItemResourceTypeEnum;
/** The RFC3339 datetime when the resource that the item references was last updated. */
resourceUpdatedAt: string;
/** The space's unique identifier. */
spaceId?: string;
/** The ID of the tenant that owns the item. This is populated using the JWT. */
tenantId: string;
/** The item thumbnail's unique identifier. This is optional for internal resources. */
thumbnailId?: string;
/** The RFC3339 datetime when the item was last updated. */
updatedAt: string;
/** ID of the user who last updated the item. This is only populated if the JWT contains a userId. */
updaterId?: string;
};
/**
* Holds basic information about a tag or collection.
*/
type ItemTagResponseBody = {
/** The ID of the tag/collection. */
id: string;
/** The name of the tag/collection. */
name: string;
};
type ItemViewsResponseBody = {
/** Total number of views the resource got during the last 28 days. */
total?: number;
/** Trend in views over the last 4 weeks. The trend value is a float number representing a linear regression slope (the x-coefficient) calculated from the weekly unique users views in the preceding 4 weeks. */
trend?: number;
/** Number of unique users who viewed the resource during the last 28 days. */
unique?: number;
/** Number of apps this dataset is used in (datasets only). */
usedBy?: number;
week?: ItemViewsWeeksResponseBody[];
};
type ItemViewsWeeksResponseBody = {
/** The RFC3339 datetime representing the start of the referenced week. */
start?: string;
/** Total number of views the resource got during the referenced week. */
total?: number;
/** Number of unique users who viewed the resource during the referenced week. */
unique?: number;
};
type ItemsLinksResponseBody = {
collection?: Link;
next?: Link;
prev?: Link;
self?: Link;
};
type ItemsResourceSizeResponseBody = {
/** Size of the app on disk in bytes. */
appFile?: number;
/** Size of the app in memory in bytes. */
appMemory?: number;
};
/**
* Multiple items.
*/
type ItemsResultResponseBody = {
data: ItemResultResponseBody[];
links: ItemsLinksResponseBody;
};
type Meta = {
/** Further explanation of the error */
explain?: unknown;
/** Is the error a server-side fault? */
fault?: boolean;
/** Is the error temporary? */
temporary?: boolean;
/** Is the error a timeout? */
timeout?: boolean;
};
/**
* The case-sensitive string defining the space type.
*/
type SpaceTypeEnum = "shared" | "managed" | "personal" | "data";
/**
* Lists items that the user has access to.
*
* @param query an object with query parameters
* @throws GetItemsHttpError
*/
declare const getItems: (query: {
/** The collection's unique identifier. Used to filter for items with a specific tag (collection type `public`), or collection. */
collectionId?: string;
/** User's unique identifier. */
createdByUserId?: string;
/** The item's unique identifier. */
id?: string;
/** The maximum number of resources to return for a request. The limit must be an integer between 1 and 100 (inclusive). */
limit?: number;
/** The case-insensitive string used to search for a resource by name. */
name?: string;
/** The cursor to the next page of resources. Provide either the next or prev cursor, but not both. */
next?: string;
/** If set to true, the user's available actions for each item will not be evaluated meaning the actions-array will be omitted from the response (reduces response time). */
noActions?: boolean;
/** User's unique identifier. */
notCreatedByUserId?: string;
/** Owner identifier. */
notOwnerId?: string;
/** Owner identifier. */
ownerId?: string;
/** The cursor to the previous page of resources. Provide either the next or prev cursor, but not both. */
prev?: string;
/** The case-insensitive string used to search for a resource by name or description. */
query?: string;
/** The case-sensitive string used to search for an item by resourceId. If resourceId is provided, then resourceType must be provided. Provide either the resourceId or resourceLink, but not both. */
resourceId?: string;
/** The case-sensitive strings used to search for an item by resourceIds. The maximum number of resourceIds it supports is 100. If resourceIds is provided, then resourceType must be provided. For example '?resourceIds=appId1,appId2' */
resourceIds?: string;
/** The case-sensitive string used to search for an item by resourceLink. If resourceLink is provided, then resourceType must be provided. Provide either the resourceId or resourceLink, but not both. */
resourceLink?: string;
/** the case-sensitive string used to filter items by resourceSubType(s). For example '?resourceSubType=chart-monitoring,qix-df,qvd'. Will return a 400 error if used in conjuction with the square bracket syntax for resourceSubType filtering in the 'resourceType' query parameter. */
resourceSubType?: string;
/** The case-sensitive string used to filter items by resourceType(s). For example '?resourceType=app,qvapp'. Additionally, a optional resourceSubType filter can be added to each resourceType. For example '?resourceType=app[qvd,chart-monitoring],qvapp'. An trailing comma can be used to include the empty resourceSubType, e.g. '?resourceType=app[qvd,chart-monitoring,]', or, to include only empty resourceSubTypes, '?resourceType=app[]' This syntax replaces the 'resourceSubType' query param, and using both in the same query will result in a 400 error. */
resourceType?: ItemResourceTypeEnum;
/** @deprecated
* Whether or not to return items in a shared space. */
shared?: boolean;
/** The property of a resource to sort on (default sort is +createdAt). The supported properties are createdAt, updatedAt, recentlyUsed and name. A property must be prefixed by + or - to indicate ascending or descending sort order respectively. */
sort?: "+createdAt" | "-createdAt" | "+name" | "-name" | "+updatedAt" | "-updatedAt" | "+recentlyUsed" | "-recentlyUsed";
/** The space's unique identifier (supports \'personal\' as spaceId). */
spaceId?: string;
/** The case-sensitive string used to filter items on space type(s). For example '?spaceType=shared,personal'. */
spaceType?: SpaceTypeEnum;
}, options?: ApiCallOptions) => Promise<GetItemsHttpResponse>;
type GetItemsHttpResponse = {
data: ItemsListItemsResponseBody;
headers: Headers;
status: number;
prev?: (options?: ApiCallOptions) => Promise<GetItemsHttpResponse>;
next?: (options?: ApiCallOptions) => Promise<GetItemsHttpResponse>;
};
type GetItemsHttpError = {
data: ErrorResponseBody;
headers: Headers;
status: number;
};
/**
* Finds and returns the items service settings for the current tenant. Currently used to enable or disable usage metrics in the tenant.
*
* @throws GetItemsSettingsHttpError
*/
declare const getItemsSettings: (options?: ApiCallOptions) => Promise<GetItemsSettingsHttpResponse>;
type GetItemsSettingsHttpResponse = {
data: ItemsSettingsResponseBody;
headers: Headers;
status: number;
};
type GetItemsSettingsHttpError = {
data: ErrorResponseBody;
headers: Headers;
status: number;
};
/**
* Updates the settings provided in the patch body. Currently used to enable or disable usage metrics in the tenant.
*
* @param body an object with the body content
* @throws PatchItemsSettingsHttpError
*/
declare const patchItemsSettings: (body: ItemsSettingsPatch, options?: ApiCallOptions) => Promise<PatchItemsSettingsHttpResponse>;
type PatchItemsSettingsHttpResponse = {
data: ItemsSettingsResponseBody;
headers: Headers;
status: number;
};
type PatchItemsSettingsHttpError = {
data: ErrorResponseBody;
headers: Headers;
status: number;
};
/**
* Deletes an item and removes the item from all collections.
*
* @param itemId The item's unique identifier.
* @throws DeleteItemHttpError
*/
declare const deleteItem: (itemId: string, options?: ApiCallOptions) => Promise<DeleteItemHttpResponse>;
type DeleteItemHttpResponse = {
data: void;
headers: Headers;
status: number;
};
type DeleteItemHttpError = {
data: ErrorResponseBody;
headers: Headers;
status: number;
};
/**
* Finds and returns an item.
*
* @param itemId The item's unique identifier
* @throws GetItemHttpError
*/
declare const getItem: (itemId: string, options?: ApiCallOptions) => Promise<GetItemHttpResponse>;
type GetItemHttpResponse = {
data: ItemResultResponseBody;
headers: Headers;
status: number;
};
type GetItemHttpError = {
data: ErrorResponseBody;
headers: Headers;
status: number;
};
/**
* Updates an item. Omitted and unsupported fields are ignored. To unset a field, provide the field's zero value.
*
* @param itemId The item's unique identifier.
* @param body an object with the body content
* @throws UpdateItemHttpError
*/
declare const updateItem: (itemId: string, body: ItemsUpdateItemRequestBody, options?: ApiCallOptions) => Promise<UpdateItemHttpResponse>;
type UpdateItemHttpResponse = {
data: ItemResultResponseBody;
headers: Headers;
status: number;
};
type UpdateItemHttpError = {
data: ErrorResponseBody;
headers: Headers;
status: number;
};
/**
* Finds and returns the collections (and tags) of an item. This endpoint does not return the user's favorites collection.
*
* @param itemId The item's unique identifier.
* @param query an object with query parameters
* @throws GetItemCollectionsHttpError
*/
declare const getItemCollections: (itemId: string, query: {
/** The maximum number of resources to return for a request. The limit must be an integer between 1 and 100 (inclusive). */
limit?: number;
/** The case-sensitive string used to search for a collection by name. */
name?: string;
/** The cursor to the next page of resources. Provide either the next or prev cursor, but not both. */
next?: string;
/** The cursor to the previous page of resources. Provide either the next or prev cursor, but not both. */
prev?: string;
/** The case-insensitive string used to search for a resource by name or description. */
query?: string;
/** The property of a resource to sort on (default sort is +createdAt). The supported properties are createdAt, updatedAt, and name. A property must be prefixed by + or - to indicate ascending or descending sort order respectively. */
sort?: "+createdAt" | "-createdAt" | "+name" | "-name" | "+updatedAt" | "-updatedAt";
/** The case-sensitive string used to search for a collection by type. */
type?: CollectionTypes;
}, options?: ApiCallOptions) => Promise<GetItemCollectionsHttpResponse>;
type GetItemCollectionsHttpResponse = {
data: ItemsListItemCollectionsResponseBody;
headers: Headers;
status: number;
prev?: (options?: ApiCallOptions) => Promise<GetItemCollectionsHttpResponse>;
next?: (options?: ApiCallOptions) => Promise<GetItemCollectionsHttpResponse>;
};
type GetItemCollectionsHttpError = {
data: ErrorResponseBody;
headers: Headers;
status: number;
};
/**
* Finds and returns the published items for a given item. This endpoint is particularly useful for finding the published copies of an app or a qvapp when you want to replace the content of a published copy with new information from the source item.
*
* @param itemId The item's unique identifier
* @param query an object with query parameters
* @throws GetPublishedItemsHttpError
*/
declare const getPublishedItems: (itemId: string, query: {
/** The maximum number of resources to return for a request. The limit must be an integer between 1 and 100 (inclusive). */
limit?: number;
/** The cursor to the next page of resources. Provide either the next or prev cursor, but not both. */
next?: string;
/** The cursor to the previous page of resources. Provide either the next or prev cursor, but not both. */
prev?: string;
/** The case-sensitive string used to search for an item by resourceType. */
resourceType?: ItemResourceTypeEnum;
/** The property of a resource to sort on (default sort is +createdAt). The supported properties are createdAt, updatedAt, and name. A property must be prefixed by + or - to indicate ascending or descending sort order respectively. */
sort?: "+createdAt" | "-createdAt" | "+name" | "-name" | "+updatedAt" | "-updatedAt";
}, options?: ApiCallOptions) => Promise<GetPublishedItemsHttpResponse>;
type GetPublishedItemsHttpResponse = {
data: ItemsListItemCollectionsResponseBody;
headers: Headers;
status: number;
prev?: (options?: ApiCallOptions) => Promise<GetPublishedItemsHttpResponse>;
next?: (options?: ApiCallOptions) => Promise<GetPublishedItemsHttpResponse>;
};
type GetPublishedItemsHttpError = {
data: ErrorResponseBody;
headers: Headers;
status: number;
};
/**
* Clears the cache for items api requests.
*/
declare function clearCache(): void;
interface ItemsAPI {
/**
* Lists items that the user has access to.
*
* @param query an object with query parameters
* @throws GetItemsHttpError
*/
getItems: typeof getItems;
/**
* Finds and returns the items service settings for the current tenant. Currently used to enable or disable usage metrics in the tenant.
*
* @throws GetItemsSettingsHttpError
*/
getItemsSettings: typeof getItemsSettings;
/**
* Updates the settings provided in the patch body. Currently used to enable or disable usage metrics in the tenant.
*
* @param body an object with the body content
* @throws PatchItemsSettingsHttpError
*/
patchItemsSettings: typeof patchItemsSettings;
/**
* Deletes an item and removes the item from all collections.
*
* @param itemId The item's unique identifier.
* @throws DeleteItemHttpError
*/
deleteItem: typeof deleteItem;
/**
* Finds and returns an item.
*
* @param itemId The item's unique identifier
* @throws GetItemHttpError
*/
getItem: typeof getItem;
/**
* Updates an item. Omitted and unsupported fields are ignored. To unset a field, provide the field's zero value.
*
* @param itemId The item's unique identifier.
* @param body an object with the body content
* @throws UpdateItemHttpError
*/
updateItem: typeof updateItem;
/**
* Finds and returns the collections (and tags) of an item. This endpoint does not return the user's favorites collection.
*
* @param itemId The item's unique identifier.
* @param query an object with query parameters
* @throws GetItemCollectionsHttpError
*/
getItemCollections: typeof getItemCollections;
/**
* Finds and returns the published items for a given item. This endpoint is particularly useful for finding the published copies of an app or a qvapp when you want to replace the content of a published copy with new information from the source item.
*
* @param itemId The item's unique identifier
* @param query an object with query parameters
* @throws GetPublishedItemsHttpError
*/
getPublishedItems: typeof getPublishedItems;
/**
* Clears the cache for items api requests.
*/
clearCache: typeof clearCache;
}
/**
* Functions for the items api
*/
declare const itemsExport: ItemsAPI;
export { type CollectionLinksResponseBody, type CollectionMetaResponseBody, type CollectionResultResponseBody, type CollectionTypes, type CollectionsLinksResponseBody, type DeleteItemHttpError, type DeleteItemHttpResponse, type ErrorResponseBody, type GetItemCollectionsHttpError, type GetItemCollectionsHttpResponse, type GetItemHttpError, type GetItemHttpResponse, type GetItemsHttpError, type GetItemsHttpResponse, type GetItemsSettingsHttpError, type GetItemsSettingsHttpResponse, type GetPublishedItemsHttpError, type GetPublishedItemsHttpResponse, type ItemLinksResponseBody, type ItemMetaResponseBody, type ItemResourceTypeEnum, type ItemResultResponseBody, type ItemTagResponseBody, type ItemViewsResponseBody, type ItemViewsWeeksResponseBody, type ItemsAPI, type ItemsLinksResponseBody, type ItemsListItemCollectionsResponseBody, type ItemsListItemsResponseBody, type ItemsResourceSizeResponseBody, type ItemsResultResponseBody, type ItemsSettingsPatch, type ItemsSettingsResponseBody, type ItemsUpdateItemRequestBody, type Link, type Meta, type PatchItemsSettingsHttpError, type PatchItemsSettingsHttpResponse, type ServiceError, type SpaceTypeEnum, type UpdateItemHttpError, type UpdateItemHttpResponse, clearCache, itemsExport as default, deleteItem, getItem, getItemCollections, getItems, getItemsSettings, getPublishedItems, patchItemsSettings, updateItem };