@amityco/ts-sdk 7.34.1-a5ab820f.0 → 7.34.1-aaca0bfd.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.
@@ -3,7 +3,8 @@ declare global {
3
3
  namespace Amity {
4
4
  /**
5
5
  * What every {@link WidgetRepository} call carries. `coreVersion` is the
6
- * caller's own; `etag` sends `If-None-Match`.
6
+ * caller's own; `cursor` is the paging token, sent as `options[token]`;
7
+ * `etag` sends `If-None-Match`.
7
8
  */
8
9
  type WidgetCall = {
9
10
  coreVersion: string;
@@ -1 +1 @@
1
- {"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AAEV,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd;;;WAGG;QACH,KAAK,UAAU,GAAG;YAChB,WAAW,EAAE,MAAM,CAAC;YACpB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,EAAE,CAAC,EAAE,MAAM,CAAC;YACZ,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YACvB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;SACtB,CAAC;QAEF,gEAAgE;QAChE,KAAK,UAAU,GAAG;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC;QAEtE,iDAAiD;QACjD,KAAK,iBAAiB,GAAG;YAAE,IAAI,EAAE,aAAa,CAAA;SAAE,CAAC;QAEjD,qDAAqD;QACrD,KAAK,eAAe,GAAG;YAAE,IAAI,EAAE,WAAW,CAAA;SAAE,CAAC;QAE7C,KAAK,YAAY,GAAG,UAAU,GAAG,iBAAiB,GAAG,eAAe,CAAC;KACtE;CACF"}
1
+ {"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AAEV,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd;;;;WAIG;QACH,KAAK,UAAU,GAAG;YAChB,WAAW,EAAE,MAAM,CAAC;YACpB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,EAAE,CAAC,EAAE,MAAM,CAAC;YACZ,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;YACvB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;SACtB,CAAC;QAEF,gEAAgE;QAChE,KAAK,UAAU,GAAG;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;SAAE,CAAC;QAEtE,iDAAiD;QACjD,KAAK,iBAAiB,GAAG;YAAE,IAAI,EAAE,aAAa,CAAA;SAAE,CAAC;QAEjD,qDAAqD;QACrD,KAAK,eAAe,GAAG;YAAE,IAAI,EAAE,WAAW,CAAA;SAAE,CAAC;QAE7C,KAAK,YAAY,GAAG,UAAU,GAAG,iBAAiB,GAAG,eAAe,CAAC;KACtE;CACF"}
package/dist/index.cjs.js CHANGED
@@ -38931,11 +38931,15 @@ const widgetTarget = (url, endpoint, allowed) => {
38931
38931
  * @hidden
38932
38932
  */
38933
38933
  const widgetHeaders = (apiKey, call, json = false) => (Object.assign(Object.assign(Object.assign(Object.assign({}, (apiKey ? { 'X-API-Key': apiKey } : {})), { 'X-Widget-Platform': WIDGET_PLATFORM, 'X-Widget-Core-Version': call.coreVersion }), (call.etag ? { 'If-None-Match': call.etag } : {})), (json ? { 'Content-Type': 'application/json' } : {})));
38934
- /** The query of a call: `locale`, `tz` and `cursor` where they are given, in that order. */
38934
+ /**
38935
+ * The query of a call: `locale`, `tz` and the paging token where they are given, in that order.
38936
+ * The token (`cursor`) goes as core's `options[token]`, unread.
38937
+ */
38935
38938
  const widgetQuery = (call, keys) => keys.reduce((query, key) => {
38936
38939
  const value = call[key];
38937
38940
  const given = key === 'cursor' ? !!value : value !== undefined && value !== null;
38938
- return given ? Object.assign(Object.assign({}, query), { [key]: value }) : query;
38941
+ return given
38942
+ ? Object.assign(Object.assign({}, query), { [key === 'cursor' ? 'options[token]' : key]: value }) : query;
38939
38943
  }, {});
38940
38944
  /**
38941
38945
  * Drops `traceparent` from a widget request. The widget service's CORS does not
@@ -39001,7 +39005,7 @@ const sendWidgetRequest = async ({ method, url, call, params, data, json, timeou
39001
39005
  * Fetches a slot's widget from the widget service. Nothing is cached or parsed.
39002
39006
  *
39003
39007
  * @param slotId The slot to fetch
39004
- * @param call What the call carries: `coreVersion`, and `locale`, `tz`, `cursor`, `etag`
39008
+ * @param call What the call carries: `coreVersion`, and `locale`, `tz`, `cursor` (sent as `options[token]`), `etag`
39005
39009
  * @returns The body, `notModified` (304) or `noContent` (204)
39006
39010
  * @throws {AmityWidgetError}
39007
39011
  *
package/dist/index.esm.js CHANGED
@@ -38931,11 +38931,15 @@ const widgetTarget = (url, endpoint, allowed) => {
38931
38931
  * @hidden
38932
38932
  */
38933
38933
  const widgetHeaders = (apiKey, call, json = false) => (Object.assign(Object.assign(Object.assign(Object.assign({}, (apiKey ? { 'X-API-Key': apiKey } : {})), { 'X-Widget-Platform': WIDGET_PLATFORM, 'X-Widget-Core-Version': call.coreVersion }), (call.etag ? { 'If-None-Match': call.etag } : {})), (json ? { 'Content-Type': 'application/json' } : {})));
38934
- /** The query of a call: `locale`, `tz` and `cursor` where they are given, in that order. */
38934
+ /**
38935
+ * The query of a call: `locale`, `tz` and the paging token where they are given, in that order.
38936
+ * The token (`cursor`) goes as core's `options[token]`, unread.
38937
+ */
38935
38938
  const widgetQuery = (call, keys) => keys.reduce((query, key) => {
38936
38939
  const value = call[key];
38937
38940
  const given = key === 'cursor' ? !!value : value !== undefined && value !== null;
38938
- return given ? Object.assign(Object.assign({}, query), { [key]: value }) : query;
38941
+ return given
38942
+ ? Object.assign(Object.assign({}, query), { [key === 'cursor' ? 'options[token]' : key]: value }) : query;
38939
38943
  }, {});
38940
38944
  /**
38941
38945
  * Drops `traceparent` from a widget request. The widget service's CORS does not
@@ -39001,7 +39005,7 @@ const sendWidgetRequest = async ({ method, url, call, params, data, json, timeou
39001
39005
  * Fetches a slot's widget from the widget service. Nothing is cached or parsed.
39002
39006
  *
39003
39007
  * @param slotId The slot to fetch
39004
- * @param call What the call carries: `coreVersion`, and `locale`, `tz`, `cursor`, `etag`
39008
+ * @param call What the call carries: `coreVersion`, and `locale`, `tz`, `cursor` (sent as `options[token]`), `etag`
39005
39009
  * @returns The body, `notModified` (304) or `noContent` (204)
39006
39010
  * @throws {AmityWidgetError}
39007
39011
  *