@hubs101/js-api-skd-client 1.0.10565 → 1.0.10567

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.
@@ -120,7 +120,7 @@ const _deleteSpeakerRole = (basePath, token, attendeeId) => __awaiter(void 0, vo
120
120
  exports._deleteSpeakerRole = _deleteSpeakerRole;
121
121
  const _deleteGroup = (basePath, token, groupId) => __awaiter(void 0, void 0, void 0, function* () {
122
122
  const base = (0, base_1.getBasePath)(basePath);
123
- const response = yield (0, api_1.deleteRequest)(`${base.GROUPS}/${groupId}`, null, token);
123
+ const response = yield (0, api_1.deleteRequest)(`${base.GROUPS}/${groupId}`, {}, token);
124
124
  return response;
125
125
  });
126
126
  exports._deleteGroup = _deleteGroup;
@@ -6,6 +6,7 @@ export declare const _likePost: (basePath: string, token: string, postId: string
6
6
  export declare const _unlikePost: (basePath: string, token: string, postId: string) => Promise<Post>;
7
7
  export declare const _likeComment: (basePath: string, token: string, postId: string, commentId: string) => Promise<Post>;
8
8
  export declare const _unlikeComment: (basePath: string, token: string, postId: string, commentId: string) => Promise<Post>;
9
+ export declare const _unlikeCommentNative: (basePath: string, token: string, postId: string, commentId: string) => Promise<Post>;
9
10
  export declare const _addComment: (basePath: string, token: string, postId: string, body: CommentBody) => Promise<Comment>;
10
11
  export declare const _addPost: (basePath: string, token: string, body: PostBody) => Promise<Post>;
11
12
  export declare const _updatePost: (basePath: string, token: string, postId: string, body: UpdatePostBody) => Promise<Post>;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports._addPostNative = exports._deleteComment = exports._deletePost = exports._updatePost = exports._addPost = exports._addComment = exports._unlikeComment = exports._likeComment = exports._unlikePost = exports._likePost = exports._fetchPostDetails = exports._fetchPosts = void 0;
12
+ exports._addPostNative = exports._deleteComment = exports._deletePost = exports._updatePost = exports._addPost = exports._addComment = exports._unlikeCommentNative = exports._unlikeComment = exports._likeComment = exports._unlikePost = exports._likePost = exports._fetchPostDetails = exports._fetchPosts = void 0;
13
13
  const api_1 = require("../../utils/api");
14
14
  const base_1 = require("../../utils/base");
15
15
  const _fetchPosts = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
@@ -46,10 +46,16 @@ const _likeComment = (basePath, token, postId, commentId) => __awaiter(void 0, v
46
46
  exports._likeComment = _likeComment;
47
47
  const _unlikeComment = (basePath, token, postId, commentId) => __awaiter(void 0, void 0, void 0, function* () {
48
48
  const base = (0, base_1.getBasePath)(basePath);
49
- const response = yield (0, api_1.deleteRequest)(`${base.POSTS}/${postId}/comment/${commentId}/like`, null, token);
49
+ const response = yield (0, api_1.deleteRequest)(`${base.POSTS}/${postId}/comment/${commentId}/like`, {}, token);
50
50
  return response;
51
51
  });
52
52
  exports._unlikeComment = _unlikeComment;
53
+ const _unlikeCommentNative = (basePath, token, postId, commentId) => __awaiter(void 0, void 0, void 0, function* () {
54
+ const base = (0, base_1.getBasePath)(basePath);
55
+ const response = yield (0, api_1.deleteRequest)(`${base.POSTS}/${postId}/comment/${commentId}/like`, null, token);
56
+ return response;
57
+ });
58
+ exports._unlikeCommentNative = _unlikeCommentNative;
53
59
  const _addComment = (basePath, token, postId, body) => __awaiter(void 0, void 0, void 0, function* () {
54
60
  const base = (0, base_1.getBasePath)(basePath);
55
61
  const comment = yield (0, api_1.postRequest)(`${base.POSTS}/${postId}/comment`, body, token);
@@ -82,7 +88,7 @@ const _deleteComment = (basePath, token, postId, commentId) => __awaiter(void 0,
82
88
  exports._deleteComment = _deleteComment;
83
89
  const _addPostNative = (basePath, token, body) => __awaiter(void 0, void 0, void 0, function* () {
84
90
  const base = (0, base_1.getBasePath)(basePath);
85
- const post = yield (0, api_1.postWithImageNative)(`${base.POSTS}`, body, token);
91
+ const post = yield (0, api_1.postWithAttachments)(`${base.POSTS}`, body, token);
86
92
  return (post === null || post === void 0 ? void 0 : post.data) || post;
87
93
  });
88
94
  exports._addPostNative = _addPostNative;
@@ -10,6 +10,7 @@ export declare const _rateSession: (basePath: string, token: string, sessionId:
10
10
  }) => Promise<APIResponse>;
11
11
  export declare const _reserveSeat: (basePath: string, token: string, sessionId: string) => Promise<APIResponse>;
12
12
  export declare const _removeSeat: (basePath: string, token: string, sessionId: string) => Promise<APIResponse>;
13
+ export declare const _removeSeatNative: (basePath: string, token: string, sessionId: string) => Promise<APIResponse>;
13
14
  export declare const _watchSession: (basePath: string, token: string, sessionId: string) => Promise<APIResponse>;
14
15
  export declare const _postSessionComment: (basePath: string, token: string, sessionId: string, message: string) => Promise<Session>;
15
16
  export declare const _refetchSessionDiscussion: (basePath: string, token: string, sessionId: string) => Promise<Session>;
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports._fetchColocatedAgenda = exports._promoteSession = exports._deleteSession = exports._updateSession = exports._createSession = exports._fetchSelectedEventSessions = exports._reportSessionAction = exports._refetchSessionDiscussion = exports._postSessionComment = exports._watchSession = exports._removeSeat = exports._reserveSeat = exports._rateSession = exports._unpinSession = exports._pinSession = exports._fetchZoomSignature = exports._fetchAgenda = void 0;
12
+ exports._fetchColocatedAgenda = exports._promoteSession = exports._deleteSession = exports._updateSession = exports._createSession = exports._fetchSelectedEventSessions = exports._reportSessionAction = exports._refetchSessionDiscussion = exports._postSessionComment = exports._watchSession = exports._removeSeatNative = exports._removeSeat = exports._reserveSeat = exports._rateSession = exports._unpinSession = exports._pinSession = exports._fetchZoomSignature = exports._fetchAgenda = void 0;
13
13
  const api_1 = require("../../utils/api");
14
14
  const base_1 = require("../../utils/base");
15
15
  const _fetchAgenda = (basePath, token, eventId) => __awaiter(void 0, void 0, void 0, function* () {
@@ -50,9 +50,15 @@ const _reserveSeat = (basePath, token, sessionId) => __awaiter(void 0, void 0, v
50
50
  exports._reserveSeat = _reserveSeat;
51
51
  const _removeSeat = (basePath, token, sessionId) => __awaiter(void 0, void 0, void 0, function* () {
52
52
  const base = (0, base_1.getBasePath)(basePath);
53
- return yield (0, api_1.deleteRequest)(`${base.SESSIONS}/${sessionId}/reserve`, null, token);
53
+ return yield (0, api_1.deleteRequest)(`${base.SESSIONS}/${sessionId}/reserve`, {}, token);
54
54
  });
55
55
  exports._removeSeat = _removeSeat;
56
+ const _removeSeatNative = (basePath, token, sessionId) => __awaiter(void 0, void 0, void 0, function* () {
57
+ const base = (0, base_1.getBasePath)(basePath);
58
+ const response = yield (0, api_1.deleteRequest)(`${base.SESSIONS}/${sessionId}/reserve`, null, token);
59
+ return response;
60
+ });
61
+ exports._removeSeatNative = _removeSeatNative;
56
62
  const _watchSession = (basePath, token, sessionId) => __awaiter(void 0, void 0, void 0, function* () {
57
63
  const base = (0, base_1.getBasePath)(basePath);
58
64
  return yield (0, api_1.getRequest)(`${base.SESSIONS}/${sessionId}/watch`, token);
package/lib/index.js CHANGED
@@ -731,6 +731,10 @@ function EventAPIProvider(props) {
731
731
  (0, api_1.validateConfig)(config);
732
732
  return (0, sessions_1._removeSeat)(config.baseUrl, config.token, sessionId);
733
733
  }), [config, config.baseUrl, config.token]);
734
+ const removeSeatNative = react_1.default.useCallback((sessionId) => __awaiter(this, void 0, void 0, function* () {
735
+ (0, api_1.validateConfig)(config);
736
+ return (0, sessions_1._removeSeatNative)(config.baseUrl, config.token, sessionId);
737
+ }), [config, config.baseUrl, config.token]);
734
738
  const watchSession = react_1.default.useCallback((sessionId) => __awaiter(this, void 0, void 0, function* () {
735
739
  (0, api_1.validateConfig)(config);
736
740
  return (0, sessions_1._watchSession)(config.baseUrl, config.token, sessionId);
@@ -811,6 +815,10 @@ function EventAPIProvider(props) {
811
815
  (0, api_1.validateConfig)(config);
812
816
  return (0, posts_1._unlikeComment)(config.baseUrl, config.token, postId, commentId);
813
817
  }), [config, config.baseUrl, config.token]);
818
+ const unlikeCommentNative = react_1.default.useCallback((postId, commentId) => __awaiter(this, void 0, void 0, function* () {
819
+ (0, api_1.validateConfig)(config);
820
+ return (0, posts_1._unlikeCommentNative)(config.baseUrl, config.token, postId, commentId);
821
+ }), [config, config.baseUrl, config.token]);
814
822
  const addComment = react_1.default.useCallback((postId, body) => __awaiter(this, void 0, void 0, function* () {
815
823
  (0, api_1.validateConfig)(config);
816
824
  return (0, posts_1._addComment)(config.baseUrl, config.token, postId, body);
@@ -1257,6 +1265,7 @@ function EventAPIProvider(props) {
1257
1265
  rateSession,
1258
1266
  reserveSeat,
1259
1267
  removeSeat,
1268
+ removeSeatNative,
1260
1269
  watchSession,
1261
1270
  postSessionComment,
1262
1271
  refetchSessionDiscussion,
@@ -1277,6 +1286,7 @@ function EventAPIProvider(props) {
1277
1286
  unlikePost,
1278
1287
  likeComment,
1279
1288
  unlikeComment,
1289
+ unlikeCommentNative,
1280
1290
  addComment,
1281
1291
  addPost,
1282
1292
  updatePost,
@@ -1511,6 +1521,7 @@ exports.BaseAPI = {
1511
1521
  rateSession: sessions_1._rateSession,
1512
1522
  reserveSeat: sessions_1._reserveSeat,
1513
1523
  removeSeat: sessions_1._removeSeat,
1524
+ removeSeatNative: sessions_1._removeSeatNative,
1514
1525
  watchSession: sessions_1._watchSession,
1515
1526
  postSessionComment: sessions_1._postSessionComment,
1516
1527
  refetchSessionDiscussion: sessions_1._refetchSessionDiscussion,
@@ -1532,6 +1543,7 @@ exports.BaseAPI = {
1532
1543
  unlikePost: posts_1._unlikePost,
1533
1544
  likeComment: posts_1._likeComment,
1534
1545
  unlikeComment: posts_1._unlikeComment,
1546
+ unlikeCommentNative: posts_1._unlikeCommentNative,
1535
1547
  addComment: posts_1._addComment,
1536
1548
  addPost: posts_1._addPost,
1537
1549
  updatePost: posts_1._updatePost,
@@ -244,6 +244,7 @@ export type BaseAPIType = {
244
244
  }) => Promise<APIResponse>;
245
245
  reserveSeat: (basePath: string, token: string, sessionId: string) => Promise<APIResponse>;
246
246
  removeSeat: (basePath: string, token: string, sessionId: string) => Promise<APIResponse>;
247
+ removeSeatNative: (basePath: string, token: string, sessionId: string) => Promise<APIResponse>;
247
248
  watchSession: (basePath: string, token: string, sessionId: string) => Promise<APIResponse>;
248
249
  postSessionComment: (basePath: string, token: string, sessionId: string, message: string) => Promise<Session>;
249
250
  refetchSessionDiscussion: (basePath: string, token: string, sessionId: string) => Promise<Session>;
@@ -264,6 +265,7 @@ export type BaseAPIType = {
264
265
  unlikePost: (basePath: string, token: string, postId: string) => Promise<Post>;
265
266
  likeComment: (basePath: string, token: string, postId: string, commentId: string) => Promise<Post>;
266
267
  unlikeComment: (basePath: string, token: string, postId: string, commentId: string) => Promise<Post>;
268
+ unlikeCommentNative: (basePath: string, token: string, postId: string, commentId: string) => Promise<Post>;
267
269
  addComment: (basePath: string, token: string, postId: string, body: CommentBody) => Promise<Comment>;
268
270
  addPost: (basePath: string, token: string, body: PostBody) => Promise<Post>;
269
271
  updatePost: (basePath: string, token: string, postId: string, body: UpdatePostBody) => Promise<Post>;
@@ -527,6 +529,7 @@ export type EventAPIType = {
527
529
  }) => Promise<APIResponse>;
528
530
  reserveSeat: (sessionId: string) => Promise<APIResponse>;
529
531
  removeSeat: (sessionId: string) => Promise<APIResponse>;
532
+ removeSeatNative: (sessionId: string) => Promise<APIResponse>;
530
533
  watchSession: (sessionId: string) => Promise<APIResponse>;
531
534
  postSessionComment: (sessionId: string, message: string) => Promise<Session>;
532
535
  refetchSessionDiscussion: (sessionId: string) => Promise<Session>;
@@ -548,6 +551,7 @@ export type EventAPIType = {
548
551
  unlikePost: (postId: string) => Promise<Post>;
549
552
  likeComment: (postId: string, commentId: string) => Promise<Post>;
550
553
  unlikeComment: (postId: string, commentId: string) => Promise<Post>;
554
+ unlikeCommentNative: (postId: string, commentId: string) => Promise<Post>;
551
555
  addComment: (postId: string, body: CommentBody) => Promise<Comment>;
552
556
  addPost: (body: PostBody) => Promise<Post>;
553
557
  addPostNative: (body: FormData) => Promise<Post>;
@@ -23,5 +23,5 @@ export declare const deleteRequestWE: (url: string, token: string) => Promise<an
23
23
  export declare const postFileRequestWE: (url: string, file: File, param: string, token: string) => Promise<any>;
24
24
  export declare const postRequestJSON: (url: string, body?: any, token?: string, headers?: any) => Promise<any>;
25
25
  export declare const patchRequestWe: (url: string, body: Record<string, string>, token: string) => Promise<any>;
26
- export declare const postWithImageNative: (url: string, formData: any, token: string, headers?: any) => Promise<any>;
26
+ export declare const postWithAttachments: (url: string, formData: any, token: string, headers?: any) => Promise<any>;
27
27
  export declare const putRequestDirect: (url: string, token: string, body: any) => Promise<any>;
package/lib/utils/api.js CHANGED
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.putRequestDirect = exports.postWithImageNative = exports.patchRequestWe = exports.postRequestJSON = exports.postFileRequestWE = exports.deleteRequestWE = exports.postRequestWE = exports.postRequestWithRetry = exports.postFilesAndDataRequest = exports.validateBaseUrl = exports.validateConfig = exports.getFormRequest = exports.getRequest = exports.patchRequest = exports.putRequest = exports.postFileRequest = exports.deleteRequestSimple = exports.deleteRequest = exports.getRequestSimple = exports.postRequestSimple = exports.postRequest = exports.trimUndefined = exports.error400 = void 0;
12
+ exports.putRequestDirect = exports.postWithAttachments = exports.patchRequestWe = exports.postRequestJSON = exports.postFileRequestWE = exports.deleteRequestWE = exports.postRequestWE = exports.postRequestWithRetry = exports.postFilesAndDataRequest = exports.validateBaseUrl = exports.validateConfig = exports.getFormRequest = exports.getRequest = exports.patchRequest = exports.putRequest = exports.postFileRequest = exports.deleteRequestSimple = exports.deleteRequest = exports.getRequestSimple = exports.postRequestSimple = exports.postRequest = exports.trimUndefined = exports.error400 = void 0;
13
13
  exports.error400 = '"status":400';
14
14
  const trimUndefined = (obj) => Object.keys(obj).reduce((result, key) => obj[key] === undefined ? result : ((result[key] = obj[key]), result), {});
15
15
  exports.trimUndefined = trimUndefined;
@@ -495,7 +495,7 @@ const postRequestJSON = (url, body, token, headers) => __awaiter(void 0, void 0,
495
495
  exports.postRequestJSON = postRequestJSON;
496
496
  const patchRequestWe = (url, body, token) => __awaiter(void 0, void 0, void 0, function* () { return yield (0, exports.postFilesAndDataRequest)(url, body, [], token, "patch"); });
497
497
  exports.patchRequestWe = patchRequestWe;
498
- const postWithImageNative = (url, formData, token, headers) => __awaiter(void 0, void 0, void 0, function* () {
498
+ const postWithAttachments = (url, formData, token, headers) => __awaiter(void 0, void 0, void 0, function* () {
499
499
  try {
500
500
  // Validate required parameters
501
501
  if (!url) {
@@ -540,11 +540,11 @@ const postWithImageNative = (url, formData, token, headers) => __awaiter(void 0,
540
540
  }
541
541
  }
542
542
  catch (error) {
543
- console.error("postWithImageNative error:", error.message);
543
+ console.error("postWithAttachments error:", error.message);
544
544
  throw error;
545
545
  }
546
546
  });
547
- exports.postWithImageNative = postWithImageNative;
547
+ exports.postWithAttachments = postWithAttachments;
548
548
  const putRequestDirect = (url, token, body) => __awaiter(void 0, void 0, void 0, function* () {
549
549
  const response = yield fetch(url, {
550
550
  method: "PUT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubs101/js-api-skd-client",
3
- "version": "1.0.10565",
3
+ "version": "1.0.10567",
4
4
  "author": "Liveware",
5
5
  "scripts": {
6
6
  "test": "jest --config jestconfig.json",