@magda/connector-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.
@@ -164,10 +164,6 @@ declare class Record_2 {
164
164
  */
165
165
  'aspects': any;
166
166
  /**
167
- * The read authorization policy id of a record
168
- */
169
- 'authnReadPolicyId': string;
170
- /**
171
167
  * A tag representing the action by the source of this record (e.g. an id for a individual crawl of a data portal).
172
168
  */
173
169
  'sourceTag': string;
package/dist/index-web.js CHANGED
@@ -33086,8 +33086,7 @@ class JsonTransformer {
33086
33086
  name: name,
33087
33087
  aspects: generatedAspects,
33088
33088
  sourceTag: undefined,
33089
- tenantId: this.tenantId,
33090
- authnReadPolicyId: undefined
33089
+ tenantId: this.tenantId
33091
33090
  };
33092
33091
  }
33093
33092
  }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  /// <reference types="node" />
2
2
  import http = require('http');
3
- import { Response as Response_2 } from 'request';
4
3
  import { default as URI_2 } from 'urijs';
5
4
 
6
5
  export declare interface AspectBuilder {
@@ -127,24 +126,18 @@ export declare class AuthorizedRegistryClient extends RegistryClient {
127
126
  getHooks(): Promise<WebHook[] | Error>;
128
127
  resumeHook(webhookId: string, succeeded?: boolean, lastEventIdReceived?: string, active?: boolean): Promise<WebHookAcknowledgementResponse | Error>;
129
128
  putRecord(record: Record_2, tenantId?: number): Promise<Record_2 | Error>;
129
+ patchRecord(recordId: string, recordPatch: Operation[], tenantId?: number): Promise<Record_2 | Error>;
130
130
  putRecordAspect(recordId: string, aspectId: string, aspect: any, tenantId?: number): Promise<Record_2 | Error>;
131
+ deleteRecordAspect(recordId: string, aspectId: string, tenantId?: number): Promise<DeleteResult | Error>;
131
132
  patchRecordAspect(recordId: string, aspectId: string, aspectPatch: Operation[], tenantId?: number): Promise<Record_2 | Error>;
132
133
  deleteBySource(sourceTagToPreserve: string, sourceId: string, tenantId?: number): Promise<MultipleDeleteResult | "Processing" | Error>;
133
134
  getRecordHistory(id: string, pageToken?: string, start?: number, limit?: number): Promise<EventsPage | Error>;
134
135
  }
135
136
 
136
- declare interface AuthorizedRegistryJwtOptions extends RegistryOptions {
137
- jwt: string;
138
- userId?: never;
139
- jwtSecret?: never;
140
- }
141
-
142
- export declare type AuthorizedRegistryOptions = AuthorizedRegistryUserIdAndJwtSecretOptions | AuthorizedRegistryJwtOptions;
143
-
144
- declare interface AuthorizedRegistryUserIdAndJwtSecretOptions extends RegistryOptions {
145
- userId: string;
146
- jwtSecret: string;
147
- jwt?: never;
137
+ export declare interface AuthorizedRegistryOptions extends RegistryOptions {
138
+ jwt?: string;
139
+ userId?: string;
140
+ jwtSecret?: string;
148
141
  }
149
142
 
150
143
  export declare abstract class BuilderFunctionParameters {
@@ -614,10 +607,6 @@ declare class Record_2 {
614
607
  */
615
608
  'aspects': any;
616
609
  /**
617
- * The read authorization policy id of a record
618
- */
619
- 'authnReadPolicyId': string;
620
- /**
621
610
  * A tag representing the action by the source of this record (e.g. an id for a individual crawl of a data portal).
622
611
  */
623
612
  'sourceTag': string;
@@ -843,6 +832,17 @@ declare class RecordsApi {
843
832
  response: http.IncomingMessage;
844
833
  body: Record_2;
845
834
  }>;
835
+ /**
836
+ * Get a record in full by ID
837
+ * Get a record with all attached aspects data by the record ID.
838
+ * @param id ID of the record to be fetched.
839
+ * @param xMagdaTenantId 0
840
+ * @param xMagdaSession Magda internal session id
841
+ */
842
+ getByIdInFull(id: string, xMagdaTenantId: number, xMagdaSession?: string): Promise<{
843
+ response: http.IncomingMessage;
844
+ body: Record_2;
845
+ }>;
846
846
  /**
847
847
  * Get a summary record by ID
848
848
  * Gets a summary record, including all the aspect ids for which this record has data.
@@ -889,7 +889,7 @@ declare class RecordsApi {
889
889
  */
890
890
  patchById(xMagdaTenantId: number, id: string, recordPatch: Array<Operation>, xMagdaSession: string): Promise<{
891
891
  response: http.IncomingMessage;
892
- body: AspectDefinition;
892
+ body: Record_2;
893
893
  }>;
894
894
  /**
895
895
  * Modify a record by ID
@@ -963,17 +963,11 @@ declare class RegistryClient {
963
963
  protected tenantId: number;
964
964
  protected jwt: string | undefined;
965
965
  constructor({ baseUrl, maxRetries, secondsBetweenRetries, tenantId }: RegistryOptions);
966
- toServerError(error: {
967
- body: any;
968
- response: Response_2;
969
- }): ServerError | {
970
- body: any;
971
- response: Response_2;
972
- };
973
966
  getRecordUrl(id: string): string;
974
967
  getAspectDefinitions(): Promise<AspectDefinition[] | Error>;
975
968
  getAspectDefinition(aspectId: string, jwtToken?: string): Promise<AspectDefinition>;
976
969
  getRecord(id: string, aspect?: Array<string>, optionalAspect?: Array<string>, dereference?: boolean): Promise<Record_2 | Error>;
970
+ getRecordInFull(id: string): Promise<Record_2>;
977
971
  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>;
978
972
  getRecordsPageTokens(aspect?: Array<string>, limit?: number): Promise<string[] | Error>;
979
973
  }
@@ -998,16 +992,6 @@ declare interface ReportProblem {
998
992
  (title: string, message?: string, additionalInfo?: any): void;
999
993
  }
1000
994
 
1001
- declare class ServerError extends Error {
1002
- statusCode: number;
1003
- constructor(message?: string, statusCode?: number);
1004
- toData(): {
1005
- isError: boolean;
1006
- errorCode: number;
1007
- errorMessage: string;
1008
- };
1009
- }
1010
-
1011
995
  export declare const TenantConsts: any;
1012
996
 
1013
997
  declare class WebHook {