@doist/twist-sdk 2.0.0 → 2.0.1

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.
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.ChannelsClient = void 0;
19
+ var zod_1 = require("zod");
19
20
  var endpoints_1 = require("../consts/endpoints");
20
21
  var rest_client_1 = require("../rest-client");
21
22
  var entities_1 = require("../types/entities");
@@ -33,7 +34,7 @@ var ChannelsClient = /** @class */ (function (_super) {
33
34
  var url = "".concat(endpoints_1.ENDPOINT_CHANNELS, "/get");
34
35
  var params = args;
35
36
  if (options === null || options === void 0 ? void 0 : options.batch) {
36
- return { method: method, url: url, params: params };
37
+ return { method: method, url: url, params: params, schema: zod_1.z.array(entities_1.ChannelSchema) };
37
38
  }
38
39
  return (0, rest_client_1.request)({
39
40
  httpMethod: method,
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.CommentsClient = void 0;
19
+ var zod_1 = require("zod");
19
20
  var endpoints_1 = require("../consts/endpoints");
20
21
  var rest_client_1 = require("../rest-client");
21
22
  var entities_1 = require("../types/entities");
@@ -39,7 +40,7 @@ var CommentsClient = /** @class */ (function (_super) {
39
40
  var method = 'GET';
40
41
  var url = "".concat(endpoints_1.ENDPOINT_COMMENTS, "/get");
41
42
  if (options === null || options === void 0 ? void 0 : options.batch) {
42
- return { method: method, url: url, params: params };
43
+ return { method: method, url: url, params: params, schema: zod_1.z.array(entities_1.CommentSchema) };
43
44
  }
44
45
  return (0, rest_client_1.request)({
45
46
  httpMethod: method,
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.ConversationMessagesClient = void 0;
19
+ var zod_1 = require("zod");
19
20
  var endpoints_1 = require("../consts/endpoints");
20
21
  var rest_client_1 = require("../rest-client");
21
22
  var entities_1 = require("../types/entities");
@@ -43,7 +44,7 @@ var ConversationMessagesClient = /** @class */ (function (_super) {
43
44
  var method = 'GET';
44
45
  var url = "".concat(endpoints_1.ENDPOINT_CONVERSATION_MESSAGES, "/get");
45
46
  if (options === null || options === void 0 ? void 0 : options.batch) {
46
- return { method: method, url: url, params: params };
47
+ return { method: method, url: url, params: params, schema: zod_1.z.array(entities_1.ConversationMessageSchema) };
47
48
  }
48
49
  return (0, rest_client_1.request)({
49
50
  httpMethod: method,
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.ConversationsClient = void 0;
19
+ var zod_1 = require("zod");
19
20
  var endpoints_1 = require("../consts/endpoints");
20
21
  var rest_client_1 = require("../rest-client");
21
22
  var entities_1 = require("../types/entities");
@@ -33,7 +34,7 @@ var ConversationsClient = /** @class */ (function (_super) {
33
34
  var url = "".concat(endpoints_1.ENDPOINT_CONVERSATIONS, "/get");
34
35
  var params = args;
35
36
  if (options === null || options === void 0 ? void 0 : options.batch) {
36
- return { method: method, url: url, params: params };
37
+ return { method: method, url: url, params: params, schema: zod_1.z.array(entities_1.ConversationSchema) };
37
38
  }
38
39
  return (0, rest_client_1.request)({
39
40
  httpMethod: method,
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.InboxClient = void 0;
19
+ var zod_1 = require("zod");
19
20
  var endpoints_1 = require("../consts/endpoints");
20
21
  var rest_client_1 = require("../rest-client");
21
22
  var entities_1 = require("../types/entities");
@@ -43,7 +44,7 @@ var InboxClient = /** @class */ (function (_super) {
43
44
  var method = 'GET';
44
45
  var url = "".concat(endpoints_1.ENDPOINT_INBOX, "/get");
45
46
  if (options === null || options === void 0 ? void 0 : options.batch) {
46
- return { method: method, url: url, params: params };
47
+ return { method: method, url: url, params: params, schema: zod_1.z.array(entities_1.InboxThreadSchema) };
47
48
  }
48
49
  return (0, rest_client_1.request)({
49
50
  httpMethod: method,
@@ -16,6 +16,7 @@ var __extends = (this && this.__extends) || (function () {
16
16
  })();
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.ThreadsClient = void 0;
19
+ var zod_1 = require("zod");
19
20
  var endpoints_1 = require("../consts/endpoints");
20
21
  var rest_client_1 = require("../rest-client");
21
22
  var entities_1 = require("../types/entities");
@@ -33,7 +34,7 @@ var ThreadsClient = /** @class */ (function (_super) {
33
34
  var url = "".concat(endpoints_1.ENDPOINT_THREADS, "/get");
34
35
  var params = args;
35
36
  if (options === null || options === void 0 ? void 0 : options.batch) {
36
- return { method: method, url: url, params: params };
37
+ return { method: method, url: url, params: params, schema: zod_1.z.array(entities_1.ThreadSchema) };
37
38
  }
38
39
  return (0, rest_client_1.request)({
39
40
  httpMethod: method,
@@ -13,6 +13,7 @@ var __extends = (this && this.__extends) || (function () {
13
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
14
  };
15
15
  })();
16
+ import { z } from 'zod';
16
17
  import { ENDPOINT_CHANNELS } from '../consts/endpoints.js';
17
18
  import { request } from '../rest-client.js';
18
19
  import { ChannelSchema } from '../types/entities.js';
@@ -30,7 +31,7 @@ var ChannelsClient = /** @class */ (function (_super) {
30
31
  var url = "".concat(ENDPOINT_CHANNELS, "/get");
31
32
  var params = args;
32
33
  if (options === null || options === void 0 ? void 0 : options.batch) {
33
- return { method: method, url: url, params: params };
34
+ return { method: method, url: url, params: params, schema: z.array(ChannelSchema) };
34
35
  }
35
36
  return request({
36
37
  httpMethod: method,
@@ -13,6 +13,7 @@ var __extends = (this && this.__extends) || (function () {
13
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
14
  };
15
15
  })();
16
+ import { z } from 'zod';
16
17
  import { ENDPOINT_COMMENTS } from '../consts/endpoints.js';
17
18
  import { request } from '../rest-client.js';
18
19
  import { CommentSchema } from '../types/entities.js';
@@ -36,7 +37,7 @@ var CommentsClient = /** @class */ (function (_super) {
36
37
  var method = 'GET';
37
38
  var url = "".concat(ENDPOINT_COMMENTS, "/get");
38
39
  if (options === null || options === void 0 ? void 0 : options.batch) {
39
- return { method: method, url: url, params: params };
40
+ return { method: method, url: url, params: params, schema: z.array(CommentSchema) };
40
41
  }
41
42
  return request({
42
43
  httpMethod: method,
@@ -13,6 +13,7 @@ var __extends = (this && this.__extends) || (function () {
13
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
14
  };
15
15
  })();
16
+ import { z } from 'zod';
16
17
  import { ENDPOINT_CONVERSATION_MESSAGES } from '../consts/endpoints.js';
17
18
  import { request } from '../rest-client.js';
18
19
  import { ConversationMessageSchema } from '../types/entities.js';
@@ -40,7 +41,7 @@ var ConversationMessagesClient = /** @class */ (function (_super) {
40
41
  var method = 'GET';
41
42
  var url = "".concat(ENDPOINT_CONVERSATION_MESSAGES, "/get");
42
43
  if (options === null || options === void 0 ? void 0 : options.batch) {
43
- return { method: method, url: url, params: params };
44
+ return { method: method, url: url, params: params, schema: z.array(ConversationMessageSchema) };
44
45
  }
45
46
  return request({
46
47
  httpMethod: method,
@@ -13,6 +13,7 @@ var __extends = (this && this.__extends) || (function () {
13
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
14
  };
15
15
  })();
16
+ import { z } from 'zod';
16
17
  import { ENDPOINT_CONVERSATIONS } from '../consts/endpoints.js';
17
18
  import { request } from '../rest-client.js';
18
19
  import { ConversationSchema, UnreadConversationSchema, } from '../types/entities.js';
@@ -30,7 +31,7 @@ var ConversationsClient = /** @class */ (function (_super) {
30
31
  var url = "".concat(ENDPOINT_CONVERSATIONS, "/get");
31
32
  var params = args;
32
33
  if (options === null || options === void 0 ? void 0 : options.batch) {
33
- return { method: method, url: url, params: params };
34
+ return { method: method, url: url, params: params, schema: z.array(ConversationSchema) };
34
35
  }
35
36
  return request({
36
37
  httpMethod: method,
@@ -13,6 +13,7 @@ var __extends = (this && this.__extends) || (function () {
13
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
14
  };
15
15
  })();
16
+ import { z } from 'zod';
16
17
  import { ENDPOINT_INBOX } from '../consts/endpoints.js';
17
18
  import { request } from '../rest-client.js';
18
19
  import { InboxThreadSchema } from '../types/entities.js';
@@ -40,7 +41,7 @@ var InboxClient = /** @class */ (function (_super) {
40
41
  var method = 'GET';
41
42
  var url = "".concat(ENDPOINT_INBOX, "/get");
42
43
  if (options === null || options === void 0 ? void 0 : options.batch) {
43
- return { method: method, url: url, params: params };
44
+ return { method: method, url: url, params: params, schema: z.array(InboxThreadSchema) };
44
45
  }
45
46
  return request({
46
47
  httpMethod: method,
@@ -13,6 +13,7 @@ var __extends = (this && this.__extends) || (function () {
13
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
14
  };
15
15
  })();
16
+ import { z } from 'zod';
16
17
  import { ENDPOINT_THREADS } from '../consts/endpoints.js';
17
18
  import { request } from '../rest-client.js';
18
19
  import { ThreadSchema, UnreadThreadSchema } from '../types/entities.js';
@@ -30,7 +31,7 @@ var ThreadsClient = /** @class */ (function (_super) {
30
31
  var url = "".concat(ENDPOINT_THREADS, "/get");
31
32
  var params = args;
32
33
  if (options === null || options === void 0 ? void 0 : options.batch) {
33
- return { method: method, url: url, params: params };
34
+ return { method: method, url: url, params: params, schema: z.array(ThreadSchema) };
34
35
  }
35
36
  return request({
36
37
  httpMethod: method,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doist/twist-sdk",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "A TypeScript wrapper for the Twist REST API.",
5
5
  "author": "Doist developers",
6
6
  "homepage": "https://doist.github.io/twist-sdk-typescript/",