@magda/registry-client 2.0.0-alpha.5 → 2.0.0-alpha.8

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
@@ -388,8 +388,9 @@ declare class RecordHistoryApi {
388
388
  * @param limit The maximum number of events to receive. The response will include a token that can be passed as the pageToken parameter to a future request to continue receiving results where this query leaves off.
389
389
  * @param aspect The aspects for which to included in event history, specified as multiple occurrences of this query parameter.
390
390
  * @param dereference true to automatically dereference links to other records; false to leave them as links. Dereferencing a link means including the record itself where the link would be. Dereferencing only happens one level deep, regardless of the value of this parameter.
391
+ * @param reversePageTokenOrder When pagination via pageToken, by default, records with smaller pageToken (i.e. older records) will be returned first. When this parameter is set to `true`, higher pageToken records (newer records) will be returned.
391
392
  */
392
- history(xMagdaTenantId: number, recordId: string, xMagdaSession: string, pageToken?: string, start?: number, limit?: number, aspect?: Array<string>, dereference?: boolean): Promise<{
393
+ history(xMagdaTenantId: number, recordId: string, xMagdaSession: string, pageToken?: string, start?: number, limit?: number, aspect?: Array<string>, dereference?: boolean, reversePageTokenOrder?: boolean): Promise<{
393
394
  response: http.IncomingMessage;
394
395
  body: EventsPage;
395
396
  }>;
@@ -466,9 +467,10 @@ declare class RecordsApi {
466
467
  * @param orderBy Specify the field to sort the result. Aspect field can be supported in a format like aspectId.path.to.field
467
468
  * @param orderByDir Specify the order by direction. Either &#x60;asc&#x60; or &#x60;desc&#x60;
468
469
  * @param orderNullFirst Specify whether nulls appear before (&#x60;true&#x60;) or after (&#x60;false&#x60;) non-null values in the sort ordering.
470
+ * @param reversePageTokenOrder When pagination via pageToken, by default, records with smaller pageToken (i.e. older records) will be returned first. When this parameter is set to &#x60;true&#x60;, higher pageToken records (newer records) will be returned.
469
471
  * @param xMagdaSession Magda internal session id
470
472
  */
471
- getAll(xMagdaTenantId: number, aspect?: Array<string>, optionalAspect?: Array<string>, pageToken?: string, start?: number, limit?: number, dereference?: boolean, aspectQuery?: Array<string>, aspectOrQuery?: Array<string>, orderBy?: string, orderByDir?: string, orderNullFirst?: boolean, xMagdaSession?: string): Promise<{
473
+ getAll(xMagdaTenantId: number, aspect?: Array<string>, optionalAspect?: Array<string>, pageToken?: string, start?: number, limit?: number, dereference?: boolean, aspectQuery?: Array<string>, aspectOrQuery?: Array<string>, orderBy?: string, orderByDir?: string, orderNullFirst?: boolean, reversePageTokenOrder?: boolean, xMagdaSession?: string): Promise<{
472
474
  response: http.IncomingMessage;
473
475
  body: Array<Record_2>;
474
476
  }>;
@@ -479,9 +481,10 @@ declare class RecordsApi {
479
481
  * @param pageToken A token that identifies the start of a page of results. This token should not be interpreted as having any meaning, but it can be obtained from a previous page of results.
480
482
  * @param start The index of the first record to retrieve. When possible, specify pageToken instead as it will result in better performance. If this parameter and pageToken are both specified, this parameter is interpreted as the index after the pageToken of the first record to retrieve.
481
483
  * @param limit The maximum number of records to receive. The response will include a token that can be passed as the pageToken parameter to a future request to continue receiving results where this query leaves off.
484
+ * @param reversePageTokenOrder When pagination via pageToken, by default, records with smaller pageToken (i.e. older records) will be returned first. When this parameter is set to &#x60;true&#x60;, higher pageToken records (newer records) will be returned.
482
485
  * @param xMagdaSession Magda internal session id
483
486
  */
484
- getAllSummary(xMagdaTenantId: number, pageToken?: string, start?: number, limit?: number, xMagdaSession?: string): Promise<{
487
+ getAllSummary(xMagdaTenantId: number, pageToken?: string, start?: number, limit?: number, reversePageTokenOrder?: boolean, xMagdaSession?: string): Promise<{
485
488
  response: http.IncomingMessage;
486
489
  body: Array<RecordSummary>;
487
490
  }>;
@@ -658,7 +661,7 @@ export declare class RegistryClient {
658
661
  getRecord(id: string, aspect?: Array<string>, optionalAspect?: Array<string>, dereference?: boolean): Promise<Record_2 | ServerError>;
659
662
  getRecordAspect(id: string, aspectId: string): Promise<any | ServerError>;
660
663
  getRecordInFull(id: string): Promise<Record_2>;
661
- 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> | ServerError>;
664
+ 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, reversePageTokenOrder?: boolean): Promise<RecordsPage<I> | ServerError>;
662
665
  getRecordsPageTokens(aspect?: Array<string>, limit?: number): Promise<string[] | ServerError>;
663
666
  }
664
667
 
package/dist/index.js CHANGED
@@ -11384,8 +11384,8 @@ class RegistryClient {
11384
11384
  }
11385
11385
  });
11386
11386
  }
11387
- getRecords(aspect, optionalAspect, pageToken, dereference, limit, aspectQueries, aspectOrQuery, orderBy, orderByDir, orderNullFirst) {
11388
- const operation = (pageToken) => () => this.recordsApi.getAll(this.tenantId, aspect, optionalAspect, pageToken, undefined, limit, dereference, aspectQueries, aspectOrQuery, orderBy, orderByDir, orderNullFirst, this.jwt);
11387
+ getRecords(aspect, optionalAspect, pageToken, dereference, limit, aspectQueries, aspectOrQuery, orderBy, orderByDir, orderNullFirst, reversePageTokenOrder) {
11388
+ const operation = (pageToken) => () => this.recordsApi.getAll(this.tenantId, aspect, optionalAspect, pageToken, undefined, limit, dereference, aspectQueries, aspectOrQuery, orderBy, orderByDir, orderNullFirst, reversePageTokenOrder, this.jwt);
11389
11389
  return retry_1.default(operation(pageToken), this.secondsBetweenRetries, this.maxRetries, (e, retriesLeft) => console.log(formatServiceError_1.default("Failed to GET records.", e, retriesLeft)))
11390
11390
  .then((result) => result.body)
11391
11391
  .catch(exports.toServerError("getRecords"));
@@ -12356,8 +12356,9 @@ class RecordHistoryApi {
12356
12356
  * @param limit The maximum number of events to receive. The response will include a token that can be passed as the pageToken parameter to a future request to continue receiving results where this query leaves off.
12357
12357
  * @param aspect The aspects for which to included in event history, specified as multiple occurrences of this query parameter.
12358
12358
  * @param dereference true to automatically dereference links to other records; false to leave them as links. Dereferencing a link means including the record itself where the link would be. Dereferencing only happens one level deep, regardless of the value of this parameter.
12359
+ * @param reversePageTokenOrder When pagination via pageToken, by default, records with smaller pageToken (i.e. older records) will be returned first. When this parameter is set to &#x60;true&#x60;, higher pageToken records (newer records) will be returned.
12359
12360
  */
12360
- history(xMagdaTenantId, recordId, xMagdaSession, pageToken, start, limit, aspect, dereference) {
12361
+ history(xMagdaTenantId, recordId, xMagdaSession, pageToken, start, limit, aspect, dereference, reversePageTokenOrder) {
12361
12362
  const localVarPath = this.basePath + '/records/{recordId}/history'
12362
12363
  .replace('{' + 'recordId' + '}', String(recordId));
12363
12364
  let queryParameters = {};
@@ -12390,6 +12391,9 @@ class RecordHistoryApi {
12390
12391
  if (dereference !== undefined) {
12391
12392
  queryParameters['dereference'] = dereference;
12392
12393
  }
12394
+ if (reversePageTokenOrder !== undefined) {
12395
+ queryParameters['reversePageTokenOrder'] = reversePageTokenOrder;
12396
+ }
12393
12397
  headerParams['X-Magda-Tenant-Id'] = xMagdaTenantId;
12394
12398
  headerParams['X-Magda-Session'] = xMagdaSession;
12395
12399
  let useFormData = false;
@@ -12721,9 +12725,10 @@ class RecordsApi {
12721
12725
  * @param orderBy Specify the field to sort the result. Aspect field can be supported in a format like aspectId.path.to.field
12722
12726
  * @param orderByDir Specify the order by direction. Either &#x60;asc&#x60; or &#x60;desc&#x60;
12723
12727
  * @param orderNullFirst Specify whether nulls appear before (&#x60;true&#x60;) or after (&#x60;false&#x60;) non-null values in the sort ordering.
12728
+ * @param reversePageTokenOrder When pagination via pageToken, by default, records with smaller pageToken (i.e. older records) will be returned first. When this parameter is set to &#x60;true&#x60;, higher pageToken records (newer records) will be returned.
12724
12729
  * @param xMagdaSession Magda internal session id
12725
12730
  */
12726
- getAll(xMagdaTenantId, aspect, optionalAspect, pageToken, start, limit, dereference, aspectQuery, aspectOrQuery, orderBy, orderByDir, orderNullFirst, xMagdaSession) {
12731
+ getAll(xMagdaTenantId, aspect, optionalAspect, pageToken, start, limit, dereference, aspectQuery, aspectOrQuery, orderBy, orderByDir, orderNullFirst, reversePageTokenOrder, xMagdaSession) {
12727
12732
  const localVarPath = this.basePath + '/records';
12728
12733
  let queryParameters = {};
12729
12734
  let headerParams = Object.assign({}, this.defaultHeaders);
@@ -12765,6 +12770,9 @@ class RecordsApi {
12765
12770
  if (orderNullFirst !== undefined) {
12766
12771
  queryParameters['orderNullFirst'] = orderNullFirst;
12767
12772
  }
12773
+ if (reversePageTokenOrder !== undefined) {
12774
+ queryParameters['reversePageTokenOrder'] = reversePageTokenOrder;
12775
+ }
12768
12776
  headerParams['X-Magda-Tenant-Id'] = xMagdaTenantId;
12769
12777
  headerParams['X-Magda-Session'] = xMagdaSession;
12770
12778
  let useFormData = false;
@@ -12808,9 +12816,10 @@ class RecordsApi {
12808
12816
  * @param pageToken A token that identifies the start of a page of results. This token should not be interpreted as having any meaning, but it can be obtained from a previous page of results.
12809
12817
  * @param start The index of the first record to retrieve. When possible, specify pageToken instead as it will result in better performance. If this parameter and pageToken are both specified, this parameter is interpreted as the index after the pageToken of the first record to retrieve.
12810
12818
  * @param limit The maximum number of records to receive. The response will include a token that can be passed as the pageToken parameter to a future request to continue receiving results where this query leaves off.
12819
+ * @param reversePageTokenOrder When pagination via pageToken, by default, records with smaller pageToken (i.e. older records) will be returned first. When this parameter is set to &#x60;true&#x60;, higher pageToken records (newer records) will be returned.
12811
12820
  * @param xMagdaSession Magda internal session id
12812
12821
  */
12813
- getAllSummary(xMagdaTenantId, pageToken, start, limit, xMagdaSession) {
12822
+ getAllSummary(xMagdaTenantId, pageToken, start, limit, reversePageTokenOrder, xMagdaSession) {
12814
12823
  const localVarPath = this.basePath + '/records/summary';
12815
12824
  let queryParameters = {};
12816
12825
  let headerParams = Object.assign({}, this.defaultHeaders);
@@ -12828,6 +12837,9 @@ class RecordsApi {
12828
12837
  if (limit !== undefined) {
12829
12838
  queryParameters['limit'] = limit;
12830
12839
  }
12840
+ if (reversePageTokenOrder !== undefined) {
12841
+ queryParameters['reversePageTokenOrder'] = reversePageTokenOrder;
12842
+ }
12831
12843
  headerParams['X-Magda-Tenant-Id'] = xMagdaTenantId;
12832
12844
  headerParams['X-Magda-Session'] = xMagdaSession;
12833
12845
  let useFormData = false;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@magda/registry-client",
3
3
  "description": "MAGDA Registry Client",
4
- "version": "2.0.0-alpha.5",
4
+ "version": "2.0.0-alpha.8",
5
5
  "scripts": {
6
6
  "prebuild": "rimraf dist tsconfig.tsbuildinfo",
7
7
  "build": "webpack && api-extractor run -l",
@@ -12,7 +12,7 @@
12
12
  "main": "dist/index.js",
13
13
  "types": "dist/index.d.ts",
14
14
  "devDependencies": {
15
- "@magda/typescript-common": "^2.0.0-alpha.5",
15
+ "@magda/typescript-common": "^2.0.0-alpha.8",
16
16
  "@microsoft/api-extractor": "^7.7.8",
17
17
  "ts-loader": "^6.2.1",
18
18
  "typescript": "^3.7.2",