@magda/minion-sdk 1.3.0-rc.0 → 2.0.0-alpha.2
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/dist/index.d.ts +57 -19
- package/dist/index.js +2514 -4669
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -45,8 +45,9 @@ declare class AspectDefinitionsApi {
|
|
|
45
45
|
* Get a list of all aspects
|
|
46
46
|
*
|
|
47
47
|
* @param xMagdaTenantId 0
|
|
48
|
+
* @param xMagdaSession Magda internal session id
|
|
48
49
|
*/
|
|
49
|
-
getAll(xMagdaTenantId: number): Promise<{
|
|
50
|
+
getAll(xMagdaTenantId: number, xMagdaSession?: string): Promise<{
|
|
50
51
|
response: http.IncomingMessage;
|
|
51
52
|
body: Array<AspectDefinition>;
|
|
52
53
|
}>;
|
|
@@ -55,8 +56,9 @@ declare class AspectDefinitionsApi {
|
|
|
55
56
|
*
|
|
56
57
|
* @param xMagdaTenantId 0
|
|
57
58
|
* @param id ID of the aspect to be fetched.
|
|
59
|
+
* @param xMagdaSession Magda internal session id
|
|
58
60
|
*/
|
|
59
|
-
getById(xMagdaTenantId: number, id: string): Promise<{
|
|
61
|
+
getById(xMagdaTenantId: number, id: string, xMagdaSession?: string): Promise<{
|
|
60
62
|
response: http.IncomingMessage;
|
|
61
63
|
body: AspectDefinition;
|
|
62
64
|
}>;
|
|
@@ -92,6 +94,7 @@ declare enum AspectDefinitionsApiApiKeys {
|
|
|
92
94
|
export declare class AuthorizedRegistryClient extends RegistryClient {
|
|
93
95
|
protected jwt: string;
|
|
94
96
|
constructor(options: AuthorizedRegistryOptions);
|
|
97
|
+
getAspectDefinition(aspectId: string): Promise<AspectDefinition>;
|
|
95
98
|
putAspectDefinition(aspectDefinition: AspectDefinition, tenantId?: number): Promise<AspectDefinition | Error>;
|
|
96
99
|
postHook(hook: WebHook): Promise<WebHook | Error>;
|
|
97
100
|
putHook(hook: WebHook): Promise<WebHook | Error>;
|
|
@@ -99,24 +102,18 @@ export declare class AuthorizedRegistryClient extends RegistryClient {
|
|
|
99
102
|
getHooks(): Promise<WebHook[] | Error>;
|
|
100
103
|
resumeHook(webhookId: string, succeeded?: boolean, lastEventIdReceived?: string, active?: boolean): Promise<WebHookAcknowledgementResponse | Error>;
|
|
101
104
|
putRecord(record: Record_2, tenantId?: number): Promise<Record_2 | Error>;
|
|
105
|
+
patchRecord(recordId: string, recordPatch: Operation[], tenantId?: number): Promise<Record_2 | Error>;
|
|
102
106
|
putRecordAspect(recordId: string, aspectId: string, aspect: any, tenantId?: number): Promise<Record_2 | Error>;
|
|
107
|
+
deleteRecordAspect(recordId: string, aspectId: string, tenantId?: number): Promise<DeleteResult | Error>;
|
|
103
108
|
patchRecordAspect(recordId: string, aspectId: string, aspectPatch: Operation[], tenantId?: number): Promise<Record_2 | Error>;
|
|
104
109
|
deleteBySource(sourceTagToPreserve: string, sourceId: string, tenantId?: number): Promise<MultipleDeleteResult | "Processing" | Error>;
|
|
105
110
|
getRecordHistory(id: string, pageToken?: string, start?: number, limit?: number): Promise<EventsPage | Error>;
|
|
106
111
|
}
|
|
107
112
|
|
|
108
|
-
declare interface
|
|
109
|
-
jwt
|
|
110
|
-
userId?:
|
|
111
|
-
jwtSecret?:
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export declare type AuthorizedRegistryOptions = AuthorizedRegistryUserIdAndJwtSecretOptions | AuthorizedRegistryJwtOptions;
|
|
115
|
-
|
|
116
|
-
declare interface AuthorizedRegistryUserIdAndJwtSecretOptions extends RegistryOptions {
|
|
117
|
-
userId: string;
|
|
118
|
-
jwtSecret: string;
|
|
119
|
-
jwt?: never;
|
|
113
|
+
export declare interface AuthorizedRegistryOptions extends RegistryOptions {
|
|
114
|
+
jwt?: string;
|
|
115
|
+
userId?: string;
|
|
116
|
+
jwtSecret?: string;
|
|
120
117
|
}
|
|
121
118
|
|
|
122
119
|
/**
|
|
@@ -286,10 +283,6 @@ declare class Record_2 {
|
|
|
286
283
|
*/
|
|
287
284
|
'aspects': any;
|
|
288
285
|
/**
|
|
289
|
-
* The read authorization policy id of a record
|
|
290
|
-
*/
|
|
291
|
-
'authnReadPolicyId': string;
|
|
292
|
-
/**
|
|
293
286
|
* A tag representing the action by the source of this record (e.g. an id for a individual crawl of a data portal).
|
|
294
287
|
*/
|
|
295
288
|
'sourceTag': string;
|
|
@@ -320,6 +313,33 @@ declare class RecordAspectsApi {
|
|
|
320
313
|
response: http.IncomingMessage;
|
|
321
314
|
body: DeleteResult;
|
|
322
315
|
}>;
|
|
316
|
+
/**
|
|
317
|
+
* Get a list of a record's aspects
|
|
318
|
+
*
|
|
319
|
+
* @param xMagdaTenantId 0
|
|
320
|
+
* @param recordId ID of the record for which to fetch aspects.
|
|
321
|
+
* @param keyword Specify the keyword to search in the all aspects' aspectId & data fields.
|
|
322
|
+
* @param aspectIdOnly When set to true, will respond only an array contains aspect id only.
|
|
323
|
+
* @param start The index of the first record to retrieve.
|
|
324
|
+
* @param limit The maximum number of records to receive.
|
|
325
|
+
* @param xMagdaSession Magda internal session id
|
|
326
|
+
*/
|
|
327
|
+
getAspects(xMagdaTenantId: number, recordId: string, keyword?: string, aspectIdOnly?: boolean, start?: number, limit?: number, xMagdaSession?: string): Promise<{
|
|
328
|
+
response: http.IncomingMessage;
|
|
329
|
+
body: Array<any>;
|
|
330
|
+
}>;
|
|
331
|
+
/**
|
|
332
|
+
* Get the number of aspects that a record has
|
|
333
|
+
*
|
|
334
|
+
* @param xMagdaTenantId 0
|
|
335
|
+
* @param recordId ID of the record for which to fetch an aspect.
|
|
336
|
+
* @param keyword Specify the keyword to search in the all aspects' aspectId & data fields.
|
|
337
|
+
* @param xMagdaSession Magda internal session id
|
|
338
|
+
*/
|
|
339
|
+
getAspectsCount(xMagdaTenantId: number, recordId: string, keyword?: string, xMagdaSession?: string): Promise<{
|
|
340
|
+
response: http.IncomingMessage;
|
|
341
|
+
body: CountResponse;
|
|
342
|
+
}>;
|
|
323
343
|
/**
|
|
324
344
|
* Get a record aspect by ID
|
|
325
345
|
*
|
|
@@ -481,6 +501,17 @@ declare class RecordsApi {
|
|
|
481
501
|
response: http.IncomingMessage;
|
|
482
502
|
body: Record_2;
|
|
483
503
|
}>;
|
|
504
|
+
/**
|
|
505
|
+
* Get a record in full by ID
|
|
506
|
+
* Get a record with all attached aspects data by the record ID.
|
|
507
|
+
* @param id ID of the record to be fetched.
|
|
508
|
+
* @param xMagdaTenantId 0
|
|
509
|
+
* @param xMagdaSession Magda internal session id
|
|
510
|
+
*/
|
|
511
|
+
getByIdInFull(id: string, xMagdaTenantId: number, xMagdaSession?: string): Promise<{
|
|
512
|
+
response: http.IncomingMessage;
|
|
513
|
+
body: Record_2;
|
|
514
|
+
}>;
|
|
484
515
|
/**
|
|
485
516
|
* Get a summary record by ID
|
|
486
517
|
* Gets a summary record, including all the aspect ids for which this record has data.
|
|
@@ -527,7 +558,7 @@ declare class RecordsApi {
|
|
|
527
558
|
*/
|
|
528
559
|
patchById(xMagdaTenantId: number, id: string, recordPatch: Array<Operation>, xMagdaSession: string): Promise<{
|
|
529
560
|
response: http.IncomingMessage;
|
|
530
|
-
body:
|
|
561
|
+
body: Record_2;
|
|
531
562
|
}>;
|
|
532
563
|
/**
|
|
533
564
|
* Modify a record by ID
|
|
@@ -601,7 +632,9 @@ declare class RegistryClient {
|
|
|
601
632
|
constructor({ baseUrl, maxRetries, secondsBetweenRetries, tenantId }: RegistryOptions);
|
|
602
633
|
getRecordUrl(id: string): string;
|
|
603
634
|
getAspectDefinitions(): Promise<AspectDefinition[] | Error>;
|
|
635
|
+
getAspectDefinition(aspectId: string, jwtToken?: string): Promise<AspectDefinition>;
|
|
604
636
|
getRecord(id: string, aspect?: Array<string>, optionalAspect?: Array<string>, dereference?: boolean): Promise<Record_2 | Error>;
|
|
637
|
+
getRecordInFull(id: string): Promise<Record_2>;
|
|
605
638
|
getRecords<I extends Record_2>(aspect?: Array<string>, optionalAspect?: Array<string>, pageToken?: string, dereference?: boolean, limit?: number, aspectQueries?: string[], aspectOrQuery?: string[], orderBy?: string, orderByDir?: string, orderNullFirst?: boolean): Promise<RecordsPage<I> | Error>;
|
|
606
639
|
getRecordsPageTokens(aspect?: Array<string>, limit?: number): Promise<string[] | Error>;
|
|
607
640
|
}
|
|
@@ -636,6 +669,11 @@ declare class WebHook {
|
|
|
636
669
|
'retryCount': number;
|
|
637
670
|
'isRunning': any;
|
|
638
671
|
'isProcessing': any;
|
|
672
|
+
'ownerId': string;
|
|
673
|
+
'creatorId': string;
|
|
674
|
+
'editorId': string;
|
|
675
|
+
'createTime': Date;
|
|
676
|
+
'editTime': Date;
|
|
639
677
|
}
|
|
640
678
|
|
|
641
679
|
/**
|