@magda/connector-sdk 2.3.1 → 2.3.2-alpha.0

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
@@ -839,9 +839,10 @@ declare class RecordsApi {
839
839
  * @param orderByDir Specify the order by direction. Either `asc` or `desc`
840
840
  * @param orderNullFirst Specify whether nulls appear before (`true`) or after (`false`) non-null values in the sort ordering.
841
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 `true`, higher pageToken records (newer records) will be returned.
842
+ * @param q full text search query
842
843
  * @param xMagdaSession Magda internal session id
843
844
  */
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<{
845
+ 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, q?: string, xMagdaSession?: string): Promise<{
845
846
  response: http.IncomingMessage;
846
847
  body: Array<Record_2>;
847
848
  }>;
@@ -853,9 +854,10 @@ declare class RecordsApi {
853
854
  * @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.
854
855
  * @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
856
  * @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.
857
+ * @param q full text search query
856
858
  * @param xMagdaSession Magda internal session id
857
859
  */
858
- getAllSummary(xMagdaTenantId: number, pageToken?: string, start?: number, limit?: number, reversePageTokenOrder?: boolean, xMagdaSession?: string): Promise<{
860
+ getAllSummary(xMagdaTenantId: number, pageToken?: string, start?: number, limit?: number, reversePageTokenOrder?: boolean, q?: string, xMagdaSession?: string): Promise<{
859
861
  response: http.IncomingMessage;
860
862
  body: Array<RecordSummary>;
861
863
  }>;
@@ -902,9 +904,10 @@ declare class RecordsApi {
902
904
  * @param aspect The aspects for which to retrieve data, specified as multiple occurrences of this query parameter. Only records that have all of these aspects will be included in the response.
903
905
  * @param aspectQuery Filter the records returned by a value within the aspect JSON. Expressed as &#39;aspectId.path.to.field:value&#39;, url encoded. NOTE: This is an early stage API and may change greatly in the future
904
906
  * @param aspectOrQuery Filter the records returned by a value within the aspect JSON. Expressed as &#39;aspectId.path.to.field:value&#39;, url encoded. Queries passing via this parameter will be grouped with OR logic.
907
+ * @param q full text search query
905
908
  * @param xMagdaSession Magda internal session id
906
909
  */
907
- getCount(xMagdaTenantId: number, aspect?: Array<string>, aspectQuery?: Array<string>, aspectOrQuery?: Array<string>, xMagdaSession?: string): Promise<{
910
+ getCount(xMagdaTenantId: number, aspect?: Array<string>, aspectQuery?: Array<string>, aspectOrQuery?: Array<string>, q?: string, xMagdaSession?: string): Promise<{
908
911
  response: http.IncomingMessage;
909
912
  body: CountResponse;
910
913
  }>;
@@ -1035,7 +1038,7 @@ declare class RegistryClient {
1035
1038
  getRecord(id: string, aspect?: Array<string>, optionalAspect?: Array<string>, dereference?: boolean): Promise<Record_2 | ServerError>;
1036
1039
  getRecordAspect(id: string, aspectId: string): Promise<any | ServerError>;
1037
1040
  getRecordInFull(id: string): Promise<Record_2>;
1038
- 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>;
1041
+ 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, q?: string): Promise<RecordsPage<I> | ServerError>;
1039
1042
  getRecordsPageTokens(aspect?: Array<string>, limit?: number): Promise<string[] | ServerError>;
1040
1043
  }
1041
1044
 
package/dist/index.js CHANGED
@@ -16906,9 +16906,10 @@ class RecordsApi {
16906
16906
  * @param orderByDir Specify the order by direction. Either &#x60;asc&#x60; or &#x60;desc&#x60;
16907
16907
  * @param orderNullFirst Specify whether nulls appear before (&#x60;true&#x60;) or after (&#x60;false&#x60;) non-null values in the sort ordering.
16908
16908
  * @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.
16909
+ * @param q full text search query
16909
16910
  * @param xMagdaSession Magda internal session id
16910
16911
  */
16911
- getAll(xMagdaTenantId, aspect, optionalAspect, pageToken, start, limit, dereference, aspectQuery, aspectOrQuery, orderBy, orderByDir, orderNullFirst, reversePageTokenOrder, xMagdaSession) {
16912
+ getAll(xMagdaTenantId, aspect, optionalAspect, pageToken, start, limit, dereference, aspectQuery, aspectOrQuery, orderBy, orderByDir, orderNullFirst, reversePageTokenOrder, q, xMagdaSession) {
16912
16913
  const localVarPath = this.basePath + '/records';
16913
16914
  let queryParameters = {};
16914
16915
  let headerParams = Object.assign({}, this.defaultHeaders);
@@ -16953,6 +16954,9 @@ class RecordsApi {
16953
16954
  if (reversePageTokenOrder !== undefined) {
16954
16955
  queryParameters['reversePageTokenOrder'] = reversePageTokenOrder;
16955
16956
  }
16957
+ if (q !== undefined) {
16958
+ queryParameters['q'] = q;
16959
+ }
16956
16960
  headerParams['X-Magda-Tenant-Id'] = xMagdaTenantId;
16957
16961
  headerParams['X-Magda-Session'] = xMagdaSession;
16958
16962
  let useFormData = false;
@@ -16997,9 +17001,10 @@ class RecordsApi {
16997
17001
  * @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.
16998
17002
  * @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.
16999
17003
  * @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.
17004
+ * @param q full text search query
17000
17005
  * @param xMagdaSession Magda internal session id
17001
17006
  */
17002
- getAllSummary(xMagdaTenantId, pageToken, start, limit, reversePageTokenOrder, xMagdaSession) {
17007
+ getAllSummary(xMagdaTenantId, pageToken, start, limit, reversePageTokenOrder, q, xMagdaSession) {
17003
17008
  const localVarPath = this.basePath + '/records/summary';
17004
17009
  let queryParameters = {};
17005
17010
  let headerParams = Object.assign({}, this.defaultHeaders);
@@ -17020,6 +17025,9 @@ class RecordsApi {
17020
17025
  if (reversePageTokenOrder !== undefined) {
17021
17026
  queryParameters['reversePageTokenOrder'] = reversePageTokenOrder;
17022
17027
  }
17028
+ if (q !== undefined) {
17029
+ queryParameters['q'] = q;
17030
+ }
17023
17031
  headerParams['X-Magda-Tenant-Id'] = xMagdaTenantId;
17024
17032
  headerParams['X-Magda-Session'] = xMagdaSession;
17025
17033
  let useFormData = false;
@@ -17246,9 +17254,10 @@ class RecordsApi {
17246
17254
  * @param aspect The aspects for which to retrieve data, specified as multiple occurrences of this query parameter. Only records that have all of these aspects will be included in the response.
17247
17255
  * @param aspectQuery Filter the records returned by a value within the aspect JSON. Expressed as &#39;aspectId.path.to.field:value&#39;, url encoded. NOTE: This is an early stage API and may change greatly in the future
17248
17256
  * @param aspectOrQuery Filter the records returned by a value within the aspect JSON. Expressed as &#39;aspectId.path.to.field:value&#39;, url encoded. Queries passing via this parameter will be grouped with OR logic.
17257
+ * @param q full text search query
17249
17258
  * @param xMagdaSession Magda internal session id
17250
17259
  */
17251
- getCount(xMagdaTenantId, aspect, aspectQuery, aspectOrQuery, xMagdaSession) {
17260
+ getCount(xMagdaTenantId, aspect, aspectQuery, aspectOrQuery, q, xMagdaSession) {
17252
17261
  const localVarPath = this.basePath + '/records/count';
17253
17262
  let queryParameters = {};
17254
17263
  let headerParams = Object.assign({}, this.defaultHeaders);
@@ -17266,6 +17275,9 @@ class RecordsApi {
17266
17275
  if (aspectOrQuery !== undefined) {
17267
17276
  queryParameters['aspectOrQuery'] = aspectOrQuery;
17268
17277
  }
17278
+ if (q !== undefined) {
17279
+ queryParameters['q'] = q;
17280
+ }
17269
17281
  headerParams['X-Magda-Tenant-Id'] = xMagdaTenantId;
17270
17282
  headerParams['X-Magda-Session'] = xMagdaSession;
17271
17283
  let useFormData = false;
@@ -29850,8 +29862,8 @@ class RegistryClient {
29850
29862
  }
29851
29863
  });
29852
29864
  }
29853
- getRecords(aspect, optionalAspect, pageToken, dereference, limit, aspectQueries, aspectOrQuery, orderBy, orderByDir, orderNullFirst, reversePageTokenOrder) {
29854
- const operation = (pageToken) => () => this.recordsApi.getAll(this.tenantId, aspect, optionalAspect, pageToken, undefined, limit, dereference, aspectQueries, aspectOrQuery, orderBy, orderByDir, orderNullFirst, reversePageTokenOrder, this.jwt);
29865
+ getRecords(aspect, optionalAspect, pageToken, dereference, limit, aspectQueries, aspectOrQuery, orderBy, orderByDir, orderNullFirst, reversePageTokenOrder, q) {
29866
+ const operation = (pageToken) => () => this.recordsApi.getAll(this.tenantId, aspect, optionalAspect, pageToken, undefined, limit, dereference, aspectQueries, aspectOrQuery, orderBy, orderByDir, orderNullFirst, reversePageTokenOrder, q, this.jwt);
29855
29867
  return retry_1.default(operation(pageToken), this.secondsBetweenRetries, this.maxRetries, (e, retriesLeft) => console.log(formatServiceError_1.default("Failed to GET records.", e, retriesLeft)))
29856
29868
  .then((result) => result.body)
29857
29869
  .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.3.1",
4
+ "version": "2.3.2-alpha.0",
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.3.1",
17
+ "@magda/typescript-common": "^2.3.2-alpha.0",
18
18
  "@microsoft/api-extractor": "7.15.2",
19
19
  "ts-loader": "^6.2.1",
20
20
  "typescript": "~4.2.4",