@amityco/ts-sdk 7.8.6-3e13cfa.0 → 7.8.6-4b6075d.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.
@@ -1 +1 @@
1
- {"version":3,"file":"ReactionPaginationController.d.ts","sourceRoot":"","sources":["../../../../src/reactionRepository/observers/getReactions/ReactionPaginationController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAKlF,qBAAa,4BAA6B,SAAQ,oBAAoB,CACpE,UAAU,EACV,KAAK,CAAC,sBAAsB,CAC7B;IACO,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,sBAAsB,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS;CA4BtF"}
1
+ {"version":3,"file":"ReactionPaginationController.d.ts","sourceRoot":"","sources":["../../../../src/reactionRepository/observers/getReactions/ReactionPaginationController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAKlF,qBAAa,4BAA6B,SAAQ,oBAAoB,CACpE,UAAU,EACV,KAAK,CAAC,sBAAsB,CAC7B;IACO,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,sBAAsB,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS;CA2BtF"}
@@ -6,15 +6,15 @@ import { REFERENCE_API_V5 } from '~/reactionRepository/api/constants';
6
6
  import { ASCApiError } from '~/core/errors';
7
7
  export class ReactionPaginationController extends PaginationController {
8
8
  async getRequest(queryParams, token) {
9
- const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT, referenceType } = queryParams, params = __rest(queryParams, ["limit", "referenceType"]);
9
+ const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT } = queryParams, params = __rest(queryParams, ["limit"]);
10
10
  const options = token ? { token } : { limit };
11
11
  const client = getActiveClient();
12
12
  client.log('reaction/queryReactions', queryParams);
13
13
  const path = '/api/v3/reactions';
14
- if (!['post', 'comment', 'story', 'message'].includes(referenceType))
14
+ if (!['post', 'comment', 'story', 'message'].includes(params.referenceType))
15
15
  throw new ASCApiError('The reference type is not valid. It should be one of post, comment, story, or message', 400000 /* Amity.ServerError.BAD_REQUEST */, "error" /* Amity.ErrorLevel.ERROR */);
16
16
  const { data: queryResponse } = await this.http.get(path, {
17
- params: Object.assign(Object.assign({}, params), { referenceType, referenceVersion: referenceType === 'message' ? REFERENCE_API_V5 : undefined, // Need to put this param to make it can query reaction for message in sub-channel
17
+ params: Object.assign(Object.assign({}, params), { referenceVersion: REFERENCE_API_V5, // Need to put this param to make it can query reaction for message in sub-channel
18
18
  options }),
19
19
  });
20
20
  return queryResponse;
@@ -1 +1 @@
1
- {"version":3,"file":"ReactionPaginationController.js","sourceRoot":"","sources":["../../../../src/reactionRepository/observers/getReactions/ReactionPaginationController.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,OAAO,4BAA6B,SAAQ,oBAGjD;IACC,KAAK,CAAC,UAAU,CAAC,WAAyC,EAAE,KAAyB;QACnF,MAAM,EAAE,KAAK,GAAG,mCAAmC,EAAE,aAAa,KAAgB,WAAW,EAAtB,MAAM,UAAK,WAAW,EAAvF,0BAAyE,CAAc,CAAC;QAC9F,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;QAC9C,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,yBAAyB,EAAE,WAAW,CAAC,CAAC;QAEnD,MAAM,IAAI,GAAG,mBAAmB,CAAC;QAEjC,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC;YAClE,MAAM,IAAI,WAAW,CACnB,uFAAuF,mFAGxF,CAAC;QAEJ,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CACjD,IAAI,EACJ;YACE,MAAM,kCACD,MAAM,KACT,aAAa,EACb,gBAAgB,EAAE,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,EAAE,kFAAkF;gBAChK,OAAO,GACR;SACF,CACF,CAAC;QACF,OAAO,aAAa,CAAC;IACvB,CAAC;CACF","sourcesContent":["import { getActiveClient } from '~/client';\nimport { PaginationController } from '~/core/liveCollection/PaginationController';\nimport { COLLECTION_DEFAULT_PAGINATION_LIMIT } from '~/utils/constants';\nimport { REFERENCE_API_V5 } from '~/reactionRepository/api/constants';\nimport { ASCApiError } from '~/core/errors';\n\nexport class ReactionPaginationController extends PaginationController<\n 'reaction',\n Amity.ReactionLiveCollection\n> {\n async getRequest(queryParams: Amity.ReactionLiveCollection, token: string | undefined) {\n const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT, referenceType, ...params } = queryParams;\n const options = token ? { token } : { limit };\n const client = getActiveClient();\n client.log('reaction/queryReactions', queryParams);\n\n const path = '/api/v3/reactions';\n\n if (!['post', 'comment', 'story', 'message'].includes(referenceType))\n throw new ASCApiError(\n 'The reference type is not valid. It should be one of post, comment, story, or message',\n Amity.ServerError.BAD_REQUEST,\n Amity.ErrorLevel.ERROR,\n );\n\n const { data: queryResponse } = await this.http.get<Amity.ReactionPayload & Amity.Pagination>(\n path,\n {\n params: {\n ...params,\n referenceType,\n referenceVersion: referenceType === 'message' ? REFERENCE_API_V5 : undefined, // Need to put this param to make it can query reaction for message in sub-channel\n options,\n },\n },\n );\n return queryResponse;\n }\n}\n"]}
1
+ {"version":3,"file":"ReactionPaginationController.js","sourceRoot":"","sources":["../../../../src/reactionRepository/observers/getReactions/ReactionPaginationController.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,OAAO,4BAA6B,SAAQ,oBAGjD;IACC,KAAK,CAAC,UAAU,CAAC,WAAyC,EAAE,KAAyB;QACnF,MAAM,EAAE,KAAK,GAAG,mCAAmC,KAAgB,WAAW,EAAtB,MAAM,UAAK,WAAW,EAAxE,SAA0D,CAAc,CAAC;QAC/E,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;QAC9C,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,yBAAyB,EAAE,WAAW,CAAC,CAAC;QAEnD,MAAM,IAAI,GAAG,mBAAmB,CAAC;QAEjC,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC;YACzE,MAAM,IAAI,WAAW,CACnB,uFAAuF,mFAGxF,CAAC;QAEJ,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CACjD,IAAI,EACJ;YACE,MAAM,kCACD,MAAM,KACT,gBAAgB,EAAE,gBAAgB,EAAE,kFAAkF;gBACtH,OAAO,GACR;SACF,CACF,CAAC;QACF,OAAO,aAAa,CAAC;IACvB,CAAC;CACF","sourcesContent":["import { getActiveClient } from '~/client';\nimport { PaginationController } from '~/core/liveCollection/PaginationController';\nimport { COLLECTION_DEFAULT_PAGINATION_LIMIT } from '~/utils/constants';\nimport { REFERENCE_API_V5 } from '~/reactionRepository/api/constants';\nimport { ASCApiError } from '~/core/errors';\n\nexport class ReactionPaginationController extends PaginationController<\n 'reaction',\n Amity.ReactionLiveCollection\n> {\n async getRequest(queryParams: Amity.ReactionLiveCollection, token: string | undefined) {\n const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT, ...params } = queryParams;\n const options = token ? { token } : { limit };\n const client = getActiveClient();\n client.log('reaction/queryReactions', queryParams);\n\n const path = '/api/v3/reactions';\n\n if (!['post', 'comment', 'story', 'message'].includes(params.referenceType))\n throw new ASCApiError(\n 'The reference type is not valid. It should be one of post, comment, story, or message',\n Amity.ServerError.BAD_REQUEST,\n Amity.ErrorLevel.ERROR,\n );\n\n const { data: queryResponse } = await this.http.get<Amity.ReactionPayload & Amity.Pagination>(\n path,\n {\n params: {\n ...params,\n referenceVersion: REFERENCE_API_V5, // Need to put this param to make it can query reaction for message in sub-channel\n options,\n },\n },\n );\n return queryResponse;\n }\n}\n"]}