@magda/connector-sdk 2.0.0-alpha.5 → 2.0.0-alpha.6

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
@@ -759,8 +759,9 @@ declare class RecordHistoryApi {
759
759
  * @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.
760
760
  * @param aspect The aspects for which to included in event history, specified as multiple occurrences of this query parameter.
761
761
  * @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.
762
+ * @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.
762
763
  */
763
- history(xMagdaTenantId: number, recordId: string, xMagdaSession: string, pageToken?: string, start?: number, limit?: number, aspect?: Array<string>, dereference?: boolean): Promise<{
764
+ history(xMagdaTenantId: number, recordId: string, xMagdaSession: string, pageToken?: string, start?: number, limit?: number, aspect?: Array<string>, dereference?: boolean, reversePageTokenOrder?: boolean): Promise<{
764
765
  response: http.IncomingMessage;
765
766
  body: EventsPage;
766
767
  }>;
@@ -837,9 +838,10 @@ declare class RecordsApi {
837
838
  * @param orderBy Specify the field to sort the result. Aspect field can be supported in a format like aspectId.path.to.field
838
839
  * @param orderByDir Specify the order by direction. Either &#x60;asc&#x60; or &#x60;desc&#x60;
839
840
  * @param orderNullFirst Specify whether nulls appear before (&#x60;true&#x60;) or after (&#x60;false&#x60;) non-null values in the sort ordering.
841
+ * @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.
840
842
  * @param xMagdaSession Magda internal session id
841
843
  */
842
- 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<{
844
+ 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<{
843
845
  response: http.IncomingMessage;
844
846
  body: Array<Record_2>;
845
847
  }>;
@@ -850,9 +852,10 @@ declare class RecordsApi {
850
852
  * @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.
851
853
  * @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.
852
854
  * @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.
855
+ * @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.
853
856
  * @param xMagdaSession Magda internal session id
854
857
  */
855
- getAllSummary(xMagdaTenantId: number, pageToken?: string, start?: number, limit?: number, xMagdaSession?: string): Promise<{
858
+ getAllSummary(xMagdaTenantId: number, pageToken?: string, start?: number, limit?: number, reversePageTokenOrder?: boolean, xMagdaSession?: string): Promise<{
856
859
  response: http.IncomingMessage;
857
860
  body: Array<RecordSummary>;
858
861
  }>;
@@ -1031,7 +1034,7 @@ declare class RegistryClient {
1031
1034
  getRecord(id: string, aspect?: Array<string>, optionalAspect?: Array<string>, dereference?: boolean): Promise<Record_2 | ServerError>;
1032
1035
  getRecordAspect(id: string, aspectId: string): Promise<any | ServerError>;
1033
1036
  getRecordInFull(id: string): Promise<Record_2>;
1034
- 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>;
1037
+ 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>;
1035
1038
  getRecordsPageTokens(aspect?: Array<string>, limit?: number): Promise<string[] | ServerError>;
1036
1039
  }
1037
1040
 
package/dist/index.js CHANGED
@@ -16514,8 +16514,9 @@ class RecordHistoryApi {
16514
16514
  * @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.
16515
16515
  * @param aspect The aspects for which to included in event history, specified as multiple occurrences of this query parameter.
16516
16516
  * @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.
16517
+ * @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.
16517
16518
  */
16518
- history(xMagdaTenantId, recordId, xMagdaSession, pageToken, start, limit, aspect, dereference) {
16519
+ history(xMagdaTenantId, recordId, xMagdaSession, pageToken, start, limit, aspect, dereference, reversePageTokenOrder) {
16519
16520
  const localVarPath = this.basePath + '/records/{recordId}/history'
16520
16521
  .replace('{' + 'recordId' + '}', String(recordId));
16521
16522
  let queryParameters = {};
@@ -16548,6 +16549,9 @@ class RecordHistoryApi {
16548
16549
  if (dereference !== undefined) {
16549
16550
  queryParameters['dereference'] = dereference;
16550
16551
  }
16552
+ if (reversePageTokenOrder !== undefined) {
16553
+ queryParameters['reversePageTokenOrder'] = reversePageTokenOrder;
16554
+ }
16551
16555
  headerParams['X-Magda-Tenant-Id'] = xMagdaTenantId;
16552
16556
  headerParams['X-Magda-Session'] = xMagdaSession;
16553
16557
  let useFormData = false;
@@ -16879,9 +16883,10 @@ class RecordsApi {
16879
16883
  * @param orderBy Specify the field to sort the result. Aspect field can be supported in a format like aspectId.path.to.field
16880
16884
  * @param orderByDir Specify the order by direction. Either &#x60;asc&#x60; or &#x60;desc&#x60;
16881
16885
  * @param orderNullFirst Specify whether nulls appear before (&#x60;true&#x60;) or after (&#x60;false&#x60;) non-null values in the sort ordering.
16886
+ * @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.
16882
16887
  * @param xMagdaSession Magda internal session id
16883
16888
  */
16884
- getAll(xMagdaTenantId, aspect, optionalAspect, pageToken, start, limit, dereference, aspectQuery, aspectOrQuery, orderBy, orderByDir, orderNullFirst, xMagdaSession) {
16889
+ getAll(xMagdaTenantId, aspect, optionalAspect, pageToken, start, limit, dereference, aspectQuery, aspectOrQuery, orderBy, orderByDir, orderNullFirst, reversePageTokenOrder, xMagdaSession) {
16885
16890
  const localVarPath = this.basePath + '/records';
16886
16891
  let queryParameters = {};
16887
16892
  let headerParams = Object.assign({}, this.defaultHeaders);
@@ -16923,6 +16928,9 @@ class RecordsApi {
16923
16928
  if (orderNullFirst !== undefined) {
16924
16929
  queryParameters['orderNullFirst'] = orderNullFirst;
16925
16930
  }
16931
+ if (reversePageTokenOrder !== undefined) {
16932
+ queryParameters['reversePageTokenOrder'] = reversePageTokenOrder;
16933
+ }
16926
16934
  headerParams['X-Magda-Tenant-Id'] = xMagdaTenantId;
16927
16935
  headerParams['X-Magda-Session'] = xMagdaSession;
16928
16936
  let useFormData = false;
@@ -16966,9 +16974,10 @@ class RecordsApi {
16966
16974
  * @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.
16967
16975
  * @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.
16968
16976
  * @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.
16977
+ * @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.
16969
16978
  * @param xMagdaSession Magda internal session id
16970
16979
  */
16971
- getAllSummary(xMagdaTenantId, pageToken, start, limit, xMagdaSession) {
16980
+ getAllSummary(xMagdaTenantId, pageToken, start, limit, reversePageTokenOrder, xMagdaSession) {
16972
16981
  const localVarPath = this.basePath + '/records/summary';
16973
16982
  let queryParameters = {};
16974
16983
  let headerParams = Object.assign({}, this.defaultHeaders);
@@ -16986,6 +16995,9 @@ class RecordsApi {
16986
16995
  if (limit !== undefined) {
16987
16996
  queryParameters['limit'] = limit;
16988
16997
  }
16998
+ if (reversePageTokenOrder !== undefined) {
16999
+ queryParameters['reversePageTokenOrder'] = reversePageTokenOrder;
17000
+ }
16989
17001
  headerParams['X-Magda-Tenant-Id'] = xMagdaTenantId;
16990
17002
  headerParams['X-Magda-Session'] = xMagdaSession;
16991
17003
  let useFormData = false;
@@ -30671,8 +30683,8 @@ class RegistryClient {
30671
30683
  }
30672
30684
  });
30673
30685
  }
30674
- getRecords(aspect, optionalAspect, pageToken, dereference, limit, aspectQueries, aspectOrQuery, orderBy, orderByDir, orderNullFirst) {
30675
- const operation = (pageToken) => () => this.recordsApi.getAll(this.tenantId, aspect, optionalAspect, pageToken, undefined, limit, dereference, aspectQueries, aspectOrQuery, orderBy, orderByDir, orderNullFirst, this.jwt);
30686
+ getRecords(aspect, optionalAspect, pageToken, dereference, limit, aspectQueries, aspectOrQuery, orderBy, orderByDir, orderNullFirst, reversePageTokenOrder) {
30687
+ const operation = (pageToken) => () => this.recordsApi.getAll(this.tenantId, aspect, optionalAspect, pageToken, undefined, limit, dereference, aspectQueries, aspectOrQuery, orderBy, orderByDir, orderNullFirst, reversePageTokenOrder, this.jwt);
30676
30688
  return retry_1.default(operation(pageToken), this.secondsBetweenRetries, this.maxRetries, (e, retriesLeft) => console.log(formatServiceError_1.default("Failed to GET records.", e, retriesLeft)))
30677
30689
  .then((result) => result.body)
30678
30690
  .catch(exports.toServerError("getRecords"));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@magda/connector-sdk",
3
3
  "description": "MAGDA Connector SDK",
4
- "version": "2.0.0-alpha.5",
4
+ "version": "2.0.0-alpha.6",
5
5
  "scripts": {
6
6
  "prebuild": "rimraf dist tsconfig.tsbuildinfo",
7
7
  "compile": "webpack && webpack --env.target=web",
@@ -14,7 +14,7 @@
14
14
  "main": "dist/index.js",
15
15
  "browser": "dist/index-web.js",
16
16
  "devDependencies": {
17
- "@magda/typescript-common": "^2.0.0-alpha.5",
17
+ "@magda/typescript-common": "^2.0.0-alpha.6",
18
18
  "@microsoft/api-extractor": "^7.7.8",
19
19
  "ts-loader": "^6.2.1",
20
20
  "typescript": "^3.7.2",