@amityco/ts-sdk 0.0.1-beta.42.2 → 0.0.1-beta.42.3

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":"getChannels.d.ts","sourceRoot":"","sources":["../../../src/channel/api/getChannels.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW;iBACV,MAAM,OAAO,CAAC,WAAW,CAAC,EAAE,GACvC,QAAQ,MAAM,MAAM,CAAC,MAAM,OAAO,EAAE,CAAC,CAAC;IAsBzC;;;;;;;;;;;;OAYG;wBAEW,MAAM,OAAO,CAAC,WAAW,CAAC,EAAE,GACvC,MAAM,MAAM,CAAC,MAAM,OAAO,EAAE,CAAC,GAAG,SAAS;CAjB3C,CAAC"}
1
+ {"version":3,"file":"getChannels.d.ts","sourceRoot":"","sources":["../../../src/channel/api/getChannels.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW;iBACV,MAAM,OAAO,CAAC,WAAW,CAAC,EAAE,GACvC,QAAQ,MAAM,MAAM,CAAC,MAAM,OAAO,EAAE,CAAC,CAAC;IAoCzC;;;;;;;;;;;;OAYG;wBAEW,MAAM,OAAO,CAAC,WAAW,CAAC,EAAE,GACvC,MAAM,MAAM,CAAC,MAAM,OAAO,EAAE,CAAC,GAAG,SAAS;CAjB3C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getComments.d.ts","sourceRoot":"","sources":["../../../src/comment/api/getComments.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW;iBACV,aAAa,CAAC,WAAW,CAAC,EAAE,GACvC,QAAQ,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;IAqBzC;;;;;;;;;;;;OAYG;wBAEW,aAAa,CAAC,WAAW,CAAC,EAAE,GACvC,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC,GAAG,SAAS;CAlB3C,CAAC"}
1
+ {"version":3,"file":"getComments.d.ts","sourceRoot":"","sources":["../../../src/comment/api/getComments.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW;iBACV,aAAa,CAAC,WAAW,CAAC,EAAE,GACvC,QAAQ,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC;IAmCzC;;;;;;;;;;;;OAYG;wBAEW,aAAa,CAAC,WAAW,CAAC,EAAE,GACvC,MAAM,MAAM,CAAC,aAAa,EAAE,CAAC,GAAG,SAAS;CAlB3C,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -95,8 +95,8 @@ const PostContentType = Object.freeze({
95
95
 
96
96
  function getVersion() {
97
97
  try {
98
- // the string ''v0.0.1-beta.42.2-cjs'' should be replaced by actual value by @rollup/plugin-replace
99
- return 'v0.0.1-beta.42.2-cjs';
98
+ // the string ''v0.0.1-beta.42.3-cjs'' should be replaced by actual value by @rollup/plugin-replace
99
+ return 'v0.0.1-beta.42.3-cjs';
100
100
  }
101
101
  catch (error) {
102
102
  return '__dev__';
@@ -22836,10 +22836,22 @@ const getPosts = async (postIds) => {
22836
22836
  const client = getActiveClient();
22837
22837
  client.log('post/getPosts', postIds);
22838
22838
  const encodedPostIds = postIds.map(postId => encodeURIComponent(postId));
22839
- // API-FIX: endpoint should not be /list, parameters should be querystring.
22840
- const { data: payload } = await client.http.get(`/api/v3/posts/list`, {
22841
- params: { postIds: encodedPostIds },
22842
- });
22839
+ let payload;
22840
+ try {
22841
+ // API-FIX: endpoint should not be /list, parameters should be querystring.
22842
+ const response = await client.http.get(`/api/v3/posts/list`, {
22843
+ params: { postIds: encodedPostIds },
22844
+ });
22845
+ payload = response.data;
22846
+ }
22847
+ catch (error) {
22848
+ postIds.forEach(postId => {
22849
+ if (checkIfShouldGoesToTombstone(error === null || error === void 0 ? void 0 : error.code)) {
22850
+ pushToTombstone('post', postId);
22851
+ }
22852
+ });
22853
+ throw error;
22854
+ }
22843
22855
  const data = prepareMembershipPayload(payload, 'communityUsers');
22844
22856
  const cachedAt = client.cache && Date.now();
22845
22857
  if (client.cache)
@@ -24014,10 +24026,22 @@ const getComments = async (commentIds) => {
24014
24026
  const client = getActiveClient();
24015
24027
  client.log('comment/getComments', commentIds);
24016
24028
  const encodedCommentIds = commentIds.map(commentId => encodeURIComponent(commentId));
24017
- // API-FIX: endpoint should not be /list, parameters should be querystring.
24018
- const { data } = await client.http.get(`/api/v3/comments/list`, {
24019
- params: { commentIds: encodedCommentIds },
24020
- });
24029
+ let data;
24030
+ try {
24031
+ // API-FIX: endpoint should not be /list, parameters should be querystring.
24032
+ const response = await client.http.get(`/api/v3/comments/list`, {
24033
+ params: { commentIds: encodedCommentIds },
24034
+ });
24035
+ data = response.data;
24036
+ }
24037
+ catch (error) {
24038
+ commentIds.forEach(commentId => {
24039
+ if (checkIfShouldGoesToTombstone(error === null || error === void 0 ? void 0 : error.code)) {
24040
+ pushToTombstone('comment', commentId);
24041
+ }
24042
+ });
24043
+ throw error;
24044
+ }
24021
24045
  const cachedAt = client.cache && Date.now();
24022
24046
  if (client.cache)
24023
24047
  ingestInCache(data, { cachedAt });
@@ -25443,7 +25467,7 @@ const queryChannels = async (query) => {
25443
25467
  // safe decapsulation
25444
25468
  const _a = query !== null && query !== void 0 ? query : {}, { page = { limit: 10 }, displayName, membership } = _a, params = __rest(_a, ["page", "displayName", "membership"]);
25445
25469
  // API-FIX: parameters should be querystring.
25446
- // API-FIX: backend doesnt answer Amity.Response
25470
+ // API-FIX: backend doesn't answer Amity.Response
25447
25471
  // const { data } = await client.http.get<Amity.Response<Amity.Paged<ChannelPayload>>>(
25448
25472
  const { data: queryPayload } = await client.http.get(`/api/v3/channels`, {
25449
25473
  params: Object.assign(Object.assign({}, params), { keyword: displayName, filter: membership, options: {
@@ -25520,10 +25544,22 @@ const getChannels = async (channelIds) => {
25520
25544
  const client = getActiveClient();
25521
25545
  client.log('channel/getChannels', channelIds);
25522
25546
  const encodedChannelIds = channelIds.map(channelId => encodeURIComponent(channelId));
25523
- // API-FIX: endpoint should not be /list, parameters should be querystring.
25524
- const { data: payload } = await client.http.get(`/api/v3/channels/list`, {
25525
- params: { channelIds: encodedChannelIds },
25526
- });
25547
+ let payload;
25548
+ try {
25549
+ // API-FIX: endpoint should not be /list, parameters should be querystring.
25550
+ const response = await client.http.get(`/api/v3/channels/list`, {
25551
+ params: { channelIds: encodedChannelIds },
25552
+ });
25553
+ payload = response.data;
25554
+ }
25555
+ catch (error) {
25556
+ channelIds.forEach(channelId => {
25557
+ if (checkIfShouldGoesToTombstone(error === null || error === void 0 ? void 0 : error.code)) {
25558
+ pushToTombstone('channel', channelId);
25559
+ }
25560
+ });
25561
+ throw error;
25562
+ }
25527
25563
  const data = prepareChannelPayload(payload);
25528
25564
  const cachedAt = client.cache && Date.now();
25529
25565
  if (client.cache)
package/dist/index.esm.js CHANGED
@@ -81,8 +81,8 @@ const PostContentType = Object.freeze({
81
81
 
82
82
  function getVersion() {
83
83
  try {
84
- // the string ''v0.0.1-beta.42.2-esm'' should be replaced by actual value by @rollup/plugin-replace
85
- return 'v0.0.1-beta.42.2-esm';
84
+ // the string ''v0.0.1-beta.42.3-esm'' should be replaced by actual value by @rollup/plugin-replace
85
+ return 'v0.0.1-beta.42.3-esm';
86
86
  }
87
87
  catch (error) {
88
88
  return '__dev__';
@@ -22822,10 +22822,22 @@ const getPosts = async (postIds) => {
22822
22822
  const client = getActiveClient();
22823
22823
  client.log('post/getPosts', postIds);
22824
22824
  const encodedPostIds = postIds.map(postId => encodeURIComponent(postId));
22825
- // API-FIX: endpoint should not be /list, parameters should be querystring.
22826
- const { data: payload } = await client.http.get(`/api/v3/posts/list`, {
22827
- params: { postIds: encodedPostIds },
22828
- });
22825
+ let payload;
22826
+ try {
22827
+ // API-FIX: endpoint should not be /list, parameters should be querystring.
22828
+ const response = await client.http.get(`/api/v3/posts/list`, {
22829
+ params: { postIds: encodedPostIds },
22830
+ });
22831
+ payload = response.data;
22832
+ }
22833
+ catch (error) {
22834
+ postIds.forEach(postId => {
22835
+ if (checkIfShouldGoesToTombstone(error === null || error === void 0 ? void 0 : error.code)) {
22836
+ pushToTombstone('post', postId);
22837
+ }
22838
+ });
22839
+ throw error;
22840
+ }
22829
22841
  const data = prepareMembershipPayload(payload, 'communityUsers');
22830
22842
  const cachedAt = client.cache && Date.now();
22831
22843
  if (client.cache)
@@ -24000,10 +24012,22 @@ const getComments = async (commentIds) => {
24000
24012
  const client = getActiveClient();
24001
24013
  client.log('comment/getComments', commentIds);
24002
24014
  const encodedCommentIds = commentIds.map(commentId => encodeURIComponent(commentId));
24003
- // API-FIX: endpoint should not be /list, parameters should be querystring.
24004
- const { data } = await client.http.get(`/api/v3/comments/list`, {
24005
- params: { commentIds: encodedCommentIds },
24006
- });
24015
+ let data;
24016
+ try {
24017
+ // API-FIX: endpoint should not be /list, parameters should be querystring.
24018
+ const response = await client.http.get(`/api/v3/comments/list`, {
24019
+ params: { commentIds: encodedCommentIds },
24020
+ });
24021
+ data = response.data;
24022
+ }
24023
+ catch (error) {
24024
+ commentIds.forEach(commentId => {
24025
+ if (checkIfShouldGoesToTombstone(error === null || error === void 0 ? void 0 : error.code)) {
24026
+ pushToTombstone('comment', commentId);
24027
+ }
24028
+ });
24029
+ throw error;
24030
+ }
24007
24031
  const cachedAt = client.cache && Date.now();
24008
24032
  if (client.cache)
24009
24033
  ingestInCache(data, { cachedAt });
@@ -25429,7 +25453,7 @@ const queryChannels = async (query) => {
25429
25453
  // safe decapsulation
25430
25454
  const _a = query !== null && query !== void 0 ? query : {}, { page = { limit: 10 }, displayName, membership } = _a, params = __rest(_a, ["page", "displayName", "membership"]);
25431
25455
  // API-FIX: parameters should be querystring.
25432
- // API-FIX: backend doesnt answer Amity.Response
25456
+ // API-FIX: backend doesn't answer Amity.Response
25433
25457
  // const { data } = await client.http.get<Amity.Response<Amity.Paged<ChannelPayload>>>(
25434
25458
  const { data: queryPayload } = await client.http.get(`/api/v3/channels`, {
25435
25459
  params: Object.assign(Object.assign({}, params), { keyword: displayName, filter: membership, options: {
@@ -25506,10 +25530,22 @@ const getChannels = async (channelIds) => {
25506
25530
  const client = getActiveClient();
25507
25531
  client.log('channel/getChannels', channelIds);
25508
25532
  const encodedChannelIds = channelIds.map(channelId => encodeURIComponent(channelId));
25509
- // API-FIX: endpoint should not be /list, parameters should be querystring.
25510
- const { data: payload } = await client.http.get(`/api/v3/channels/list`, {
25511
- params: { channelIds: encodedChannelIds },
25512
- });
25533
+ let payload;
25534
+ try {
25535
+ // API-FIX: endpoint should not be /list, parameters should be querystring.
25536
+ const response = await client.http.get(`/api/v3/channels/list`, {
25537
+ params: { channelIds: encodedChannelIds },
25538
+ });
25539
+ payload = response.data;
25540
+ }
25541
+ catch (error) {
25542
+ channelIds.forEach(channelId => {
25543
+ if (checkIfShouldGoesToTombstone(error === null || error === void 0 ? void 0 : error.code)) {
25544
+ pushToTombstone('channel', channelId);
25545
+ }
25546
+ });
25547
+ throw error;
25548
+ }
25513
25549
  const data = prepareChannelPayload(payload);
25514
25550
  const cachedAt = client.cache && Date.now();
25515
25551
  if (client.cache)