@magda/registry-client 2.0.0-alpha.1 → 2.0.0-alpha.4

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 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
  /**
@@ -101,24 +100,18 @@ export declare class AuthorizedRegistryClient extends RegistryClient {
101
100
  getHooks(): Promise<WebHook[] | Error>;
102
101
  resumeHook(webhookId: string, succeeded?: boolean, lastEventIdReceived?: string, active?: boolean): Promise<WebHookAcknowledgementResponse | Error>;
103
102
  putRecord(record: Record_2, tenantId?: number): Promise<Record_2 | Error>;
103
+ patchRecord(recordId: string, recordPatch: Operation[], tenantId?: number): Promise<Record_2 | Error>;
104
104
  putRecordAspect(recordId: string, aspectId: string, aspect: any, tenantId?: number): Promise<Record_2 | Error>;
105
+ deleteRecordAspect(recordId: string, aspectId: string, tenantId?: number): Promise<DeleteResult | Error>;
105
106
  patchRecordAspect(recordId: string, aspectId: string, aspectPatch: Operation[], tenantId?: number): Promise<Record_2 | Error>;
106
107
  deleteBySource(sourceTagToPreserve: string, sourceId: string, tenantId?: number): Promise<MultipleDeleteResult | "Processing" | Error>;
107
108
  getRecordHistory(id: string, pageToken?: string, start?: number, limit?: number): Promise<EventsPage | Error>;
108
109
  }
109
110
 
110
- declare interface AuthorizedRegistryJwtOptions extends RegistryOptions {
111
- jwt: string;
112
- userId?: never;
113
- jwtSecret?: never;
114
- }
115
-
116
- export declare type AuthorizedRegistryOptions = AuthorizedRegistryUserIdAndJwtSecretOptions | AuthorizedRegistryJwtOptions;
117
-
118
- declare interface AuthorizedRegistryUserIdAndJwtSecretOptions extends RegistryOptions {
119
- userId: string;
120
- jwtSecret: string;
121
- jwt?: never;
111
+ export declare interface AuthorizedRegistryOptions extends RegistryOptions {
112
+ jwt?: string;
113
+ userId?: string;
114
+ jwtSecret?: string;
122
115
  }
123
116
 
124
117
  declare class CountResponse {
@@ -250,10 +243,6 @@ declare class Record_2 {
250
243
  */
251
244
  'aspects': any;
252
245
  /**
253
- * The read authorization policy id of a record
254
- */
255
- 'authnReadPolicyId': string;
256
- /**
257
246
  * A tag representing the action by the source of this record (e.g. an id for a individual crawl of a data portal).
258
247
  */
259
248
  'sourceTag': string;
@@ -529,7 +518,7 @@ declare class RecordsApi {
529
518
  */
530
519
  patchById(xMagdaTenantId: number, id: string, recordPatch: Array<Operation>, xMagdaSession: string): Promise<{
531
520
  response: http.IncomingMessage;
532
- body: AspectDefinition;
521
+ body: Record_2;
533
522
  }>;
534
523
  /**
535
524
  * Modify a record by ID
@@ -601,13 +590,6 @@ export declare class RegistryClient {
601
590
  protected tenantId: number;
602
591
  protected jwt: string | undefined;
603
592
  constructor({ baseUrl, maxRetries, secondsBetweenRetries, tenantId }: RegistryOptions);
604
- toServerError(error: {
605
- body: any;
606
- response: Response_2;
607
- }): ServerError | {
608
- body: any;
609
- response: Response_2;
610
- };
611
593
  getRecordUrl(id: string): string;
612
594
  getAspectDefinitions(): Promise<AspectDefinition[] | Error>;
613
595
  getAspectDefinition(aspectId: string, jwtToken?: string): Promise<AspectDefinition>;
@@ -633,16 +615,6 @@ export declare interface RegistryOptions {
633
615
  tenantId: number;
634
616
  }
635
617
 
636
- declare class ServerError extends Error {
637
- statusCode: number;
638
- constructor(message?: string, statusCode?: number);
639
- toData(): {
640
- isError: boolean;
641
- errorCode: number;
642
- errorMessage: string;
643
- };
644
- }
645
-
646
618
  export declare const TenantConsts: any;
647
619
 
648
620
  export declare class WebHook {