@magda/minion-sdk 2.0.0-alpha.0 → 2.0.0-alpha.3

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +19 -35
  2. package/dist/index.js +1904 -1992
  3. package/package.json +4 -4
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import express from 'express';
3
3
  import http = require('http');
4
- import { Response as Response_2 } from 'request';
5
4
  import { default as URI_2 } from 'urijs';
6
5
  import yargs from 'yargs';
7
6
 
@@ -103,24 +102,18 @@ export declare class AuthorizedRegistryClient extends RegistryClient {
103
102
  getHooks(): Promise<WebHook[] | Error>;
104
103
  resumeHook(webhookId: string, succeeded?: boolean, lastEventIdReceived?: string, active?: boolean): Promise<WebHookAcknowledgementResponse | Error>;
105
104
  putRecord(record: Record_2, tenantId?: number): Promise<Record_2 | Error>;
105
+ patchRecord(recordId: string, recordPatch: Operation[], tenantId?: number): Promise<Record_2 | Error>;
106
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>;
107
108
  patchRecordAspect(recordId: string, aspectId: string, aspectPatch: Operation[], tenantId?: number): Promise<Record_2 | Error>;
108
109
  deleteBySource(sourceTagToPreserve: string, sourceId: string, tenantId?: number): Promise<MultipleDeleteResult | "Processing" | Error>;
109
110
  getRecordHistory(id: string, pageToken?: string, start?: number, limit?: number): Promise<EventsPage | Error>;
110
111
  }
111
112
 
112
- declare interface AuthorizedRegistryJwtOptions extends RegistryOptions {
113
- jwt: string;
114
- userId?: never;
115
- jwtSecret?: never;
116
- }
117
-
118
- export declare type AuthorizedRegistryOptions = AuthorizedRegistryUserIdAndJwtSecretOptions | AuthorizedRegistryJwtOptions;
119
-
120
- declare interface AuthorizedRegistryUserIdAndJwtSecretOptions extends RegistryOptions {
121
- userId: string;
122
- jwtSecret: string;
123
- jwt?: never;
113
+ export declare interface AuthorizedRegistryOptions extends RegistryOptions {
114
+ jwt?: string;
115
+ userId?: string;
116
+ jwtSecret?: string;
124
117
  }
125
118
 
126
119
  /**
@@ -290,10 +283,6 @@ declare class Record_2 {
290
283
  */
291
284
  'aspects': any;
292
285
  /**
293
- * The read authorization policy id of a record
294
- */
295
- 'authnReadPolicyId': string;
296
- /**
297
286
  * A tag representing the action by the source of this record (e.g. an id for a individual crawl of a data portal).
298
287
  */
299
288
  'sourceTag': string;
@@ -512,6 +501,17 @@ declare class RecordsApi {
512
501
  response: http.IncomingMessage;
513
502
  body: Record_2;
514
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
+ }>;
515
515
  /**
516
516
  * Get a summary record by ID
517
517
  * Gets a summary record, including all the aspect ids for which this record has data.
@@ -558,7 +558,7 @@ declare class RecordsApi {
558
558
  */
559
559
  patchById(xMagdaTenantId: number, id: string, recordPatch: Array<Operation>, xMagdaSession: string): Promise<{
560
560
  response: http.IncomingMessage;
561
- body: AspectDefinition;
561
+ body: Record_2;
562
562
  }>;
563
563
  /**
564
564
  * Modify a record by ID
@@ -630,17 +630,11 @@ declare class RegistryClient {
630
630
  protected tenantId: number;
631
631
  protected jwt: string | undefined;
632
632
  constructor({ baseUrl, maxRetries, secondsBetweenRetries, tenantId }: RegistryOptions);
633
- toServerError(error: {
634
- body: any;
635
- response: Response_2;
636
- }): ServerError | {
637
- body: any;
638
- response: Response_2;
639
- };
640
633
  getRecordUrl(id: string): string;
641
634
  getAspectDefinitions(): Promise<AspectDefinition[] | Error>;
642
635
  getAspectDefinition(aspectId: string, jwtToken?: string): Promise<AspectDefinition>;
643
636
  getRecord(id: string, aspect?: Array<string>, optionalAspect?: Array<string>, dereference?: boolean): Promise<Record_2 | Error>;
637
+ getRecordInFull(id: string): Promise<Record_2>;
644
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>;
645
639
  getRecordsPageTokens(aspect?: Array<string>, limit?: number): Promise<string[] | Error>;
646
640
  }
@@ -661,16 +655,6 @@ declare interface RegistryOptions {
661
655
  tenantId: number;
662
656
  }
663
657
 
664
- declare class ServerError extends Error {
665
- statusCode: number;
666
- constructor(message?: string, statusCode?: number);
667
- toData(): {
668
- isError: boolean;
669
- errorCode: number;
670
- errorMessage: string;
671
- };
672
- }
673
-
674
658
  declare class WebHook {
675
659
  'id': string;
676
660
  'name': string;