@digisglobal/omnivox-sdk 0.8.0 → 0.9.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.
package/dist/index.cjs CHANGED
@@ -320,6 +320,9 @@ var getCannedResponsesControllerPatchUrl = (id) => {
320
320
  var getCannedResponsesControllerDeleteUrl = (id) => {
321
321
  return `/api/v1/canned-responses/${id}`;
322
322
  };
323
+ var getCannedResponsesControllerDuplicateUrl = (id) => {
324
+ return `/api/v1/canned-responses/${id}/duplicate`;
325
+ };
323
326
  var getAttachmentsControllerUploadUrl = () => {
324
327
  return `/api/v1/attachments`;
325
328
  };
@@ -1025,7 +1028,12 @@ function createCannedResponsesModule(options) {
1025
1028
  */
1026
1029
  async list(opts) {
1027
1030
  const { page, pageSize } = buildPageParams(opts);
1028
- const path = getCannedResponsesControllerListUrl({ page, pageSize });
1031
+ const path = getCannedResponsesControllerListUrl({
1032
+ page,
1033
+ pageSize,
1034
+ ...opts.category ? { category: opts.category } : {},
1035
+ ...opts.channel ? { channel: opts.channel } : {}
1036
+ });
1029
1037
  const url = `${baseUrl}${path}`;
1030
1038
  const res = await fetch(url, buildInit("GET"));
1031
1039
  return parseResponse(res);
@@ -1040,7 +1048,9 @@ function createCannedResponsesModule(options) {
1040
1048
  const path = getCannedResponsesControllerListUrl({
1041
1049
  page,
1042
1050
  pageSize,
1043
- q: opts.q
1051
+ q: opts.q,
1052
+ ...opts.category ? { category: opts.category } : {},
1053
+ ...opts.channel ? { channel: opts.channel } : {}
1044
1054
  });
1045
1055
  const url = `${baseUrl}${path}`;
1046
1056
  const res = await fetch(url, buildInit("GET"));
@@ -1057,7 +1067,7 @@ function createCannedResponsesModule(options) {
1057
1067
  return parseEnvelopedResponse(res);
1058
1068
  },
1059
1069
  /**
1060
- * Partially update a canned response — title, body, and/or keywords.
1070
+ * Partially update a canned response — title, shortcut, category, channel, and/or body.
1061
1071
  * Calls PATCH /api/v1/canned-responses/:id.
1062
1072
  */
1063
1073
  async update(id, input) {
@@ -1077,6 +1087,16 @@ function createCannedResponsesModule(options) {
1077
1087
  if (!res.ok) {
1078
1088
  return parseResponse(res);
1079
1089
  }
1090
+ },
1091
+ /**
1092
+ * Duplicate a canned response. The server generates a unique title and
1093
+ * shortcut. Calls POST /api/v1/canned-responses/:id/duplicate.
1094
+ */
1095
+ async duplicate(id) {
1096
+ const path = getCannedResponsesControllerDuplicateUrl(id);
1097
+ const url = `${baseUrl}${path}`;
1098
+ const res = await fetch(url, buildInit("POST"));
1099
+ return parseEnvelopedResponse(res);
1080
1100
  }
1081
1101
  };
1082
1102
  }
package/dist/index.d.cts CHANGED
@@ -42,6 +42,7 @@ declare function createSessionTokenProvider(): TokenProvider;
42
42
  * - create(input) → POST /api/v1/canned-responses
43
43
  * - update(id, input) → PATCH /api/v1/canned-responses/:id
44
44
  * - delete(id) → DELETE /api/v1/canned-responses/:id
45
+ * - duplicate(id) → POST /api/v1/canned-responses/:id/duplicate
45
46
  *
46
47
  * Never re-exports symbols from _generated/.
47
48
  * Contains no business logic — typed transport only.
@@ -55,23 +56,29 @@ interface CannedResponsesModuleOptions extends TokenProvider {
55
56
  /** Input for creating a canned response. */
56
57
  interface CreateCannedResponseInput {
57
58
  title: string;
59
+ shortcut: string;
58
60
  body: string;
59
- keywords: string[];
61
+ category?: string;
62
+ channel?: string;
60
63
  [key: string]: unknown;
61
64
  }
62
65
  /** Input for partially updating a canned response. */
63
66
  interface UpdateCannedResponseInput {
64
67
  title?: string;
68
+ shortcut?: string;
65
69
  body?: string;
66
- keywords?: string[];
70
+ category?: string;
71
+ channel?: string;
67
72
  [key: string]: unknown;
68
73
  }
69
74
  /** Canned response resource shape returned by the API. */
70
75
  interface CannedResponseItem {
71
76
  id: string;
72
77
  title: string;
78
+ shortcut: string;
79
+ category: string;
80
+ channel: string;
73
81
  body: string;
74
- keywords: string[];
75
82
  [key: string]: unknown;
76
83
  }
77
84
  /** Paginated list response. */
@@ -88,6 +95,8 @@ interface PagedList$5<T> {
88
95
  interface CannedResponseListOpts {
89
96
  page: number;
90
97
  pageSize: number;
98
+ category?: string;
99
+ channel?: string;
91
100
  [key: string]: unknown;
92
101
  }
93
102
  /** Pagination + search options for search(). */
@@ -95,6 +104,8 @@ interface CannedResponseSearchOpts {
95
104
  page: number;
96
105
  pageSize: number;
97
106
  q: string;
107
+ category?: string;
108
+ channel?: string;
98
109
  [key: string]: unknown;
99
110
  }
100
111
  /**
@@ -119,7 +130,7 @@ declare function createCannedResponsesModule(options: CannedResponsesModuleOptio
119
130
  */
120
131
  create(input: CreateCannedResponseInput): Promise<CannedResponseItem>;
121
132
  /**
122
- * Partially update a canned response — title, body, and/or keywords.
133
+ * Partially update a canned response — title, shortcut, category, channel, and/or body.
123
134
  * Calls PATCH /api/v1/canned-responses/:id.
124
135
  */
125
136
  update(id: string, input: UpdateCannedResponseInput): Promise<CannedResponseItem>;
@@ -128,6 +139,11 @@ declare function createCannedResponsesModule(options: CannedResponsesModuleOptio
128
139
  * Calls DELETE /api/v1/canned-responses/:id.
129
140
  */
130
141
  delete(id: string): Promise<void>;
142
+ /**
143
+ * Duplicate a canned response. The server generates a unique title and
144
+ * shortcut. Calls POST /api/v1/canned-responses/:id/duplicate.
145
+ */
146
+ duplicate(id: string): Promise<CannedResponseItem>;
131
147
  };
132
148
  /** Return type of createCannedResponsesModule. */
133
149
  type CannedResponsesModule = ReturnType<typeof createCannedResponsesModule>;
@@ -1314,6 +1330,7 @@ declare function createOmnivoxClient(options: OmnivoxClientOptions): {
1314
1330
  create(input: CreateCannedResponseInput): Promise<CannedResponseItem>;
1315
1331
  update(id: string, input: UpdateCannedResponseInput): Promise<CannedResponseItem>;
1316
1332
  delete(id: string): Promise<void>;
1333
+ duplicate(id: string): Promise<CannedResponseItem>;
1317
1334
  };
1318
1335
  attachments: {
1319
1336
  upload(file: Blob | Uint8Array, _opts?: Record<string, unknown>): Promise<AttachmentUploadResult>;
package/dist/index.d.ts CHANGED
@@ -42,6 +42,7 @@ declare function createSessionTokenProvider(): TokenProvider;
42
42
  * - create(input) → POST /api/v1/canned-responses
43
43
  * - update(id, input) → PATCH /api/v1/canned-responses/:id
44
44
  * - delete(id) → DELETE /api/v1/canned-responses/:id
45
+ * - duplicate(id) → POST /api/v1/canned-responses/:id/duplicate
45
46
  *
46
47
  * Never re-exports symbols from _generated/.
47
48
  * Contains no business logic — typed transport only.
@@ -55,23 +56,29 @@ interface CannedResponsesModuleOptions extends TokenProvider {
55
56
  /** Input for creating a canned response. */
56
57
  interface CreateCannedResponseInput {
57
58
  title: string;
59
+ shortcut: string;
58
60
  body: string;
59
- keywords: string[];
61
+ category?: string;
62
+ channel?: string;
60
63
  [key: string]: unknown;
61
64
  }
62
65
  /** Input for partially updating a canned response. */
63
66
  interface UpdateCannedResponseInput {
64
67
  title?: string;
68
+ shortcut?: string;
65
69
  body?: string;
66
- keywords?: string[];
70
+ category?: string;
71
+ channel?: string;
67
72
  [key: string]: unknown;
68
73
  }
69
74
  /** Canned response resource shape returned by the API. */
70
75
  interface CannedResponseItem {
71
76
  id: string;
72
77
  title: string;
78
+ shortcut: string;
79
+ category: string;
80
+ channel: string;
73
81
  body: string;
74
- keywords: string[];
75
82
  [key: string]: unknown;
76
83
  }
77
84
  /** Paginated list response. */
@@ -88,6 +95,8 @@ interface PagedList$5<T> {
88
95
  interface CannedResponseListOpts {
89
96
  page: number;
90
97
  pageSize: number;
98
+ category?: string;
99
+ channel?: string;
91
100
  [key: string]: unknown;
92
101
  }
93
102
  /** Pagination + search options for search(). */
@@ -95,6 +104,8 @@ interface CannedResponseSearchOpts {
95
104
  page: number;
96
105
  pageSize: number;
97
106
  q: string;
107
+ category?: string;
108
+ channel?: string;
98
109
  [key: string]: unknown;
99
110
  }
100
111
  /**
@@ -119,7 +130,7 @@ declare function createCannedResponsesModule(options: CannedResponsesModuleOptio
119
130
  */
120
131
  create(input: CreateCannedResponseInput): Promise<CannedResponseItem>;
121
132
  /**
122
- * Partially update a canned response — title, body, and/or keywords.
133
+ * Partially update a canned response — title, shortcut, category, channel, and/or body.
123
134
  * Calls PATCH /api/v1/canned-responses/:id.
124
135
  */
125
136
  update(id: string, input: UpdateCannedResponseInput): Promise<CannedResponseItem>;
@@ -128,6 +139,11 @@ declare function createCannedResponsesModule(options: CannedResponsesModuleOptio
128
139
  * Calls DELETE /api/v1/canned-responses/:id.
129
140
  */
130
141
  delete(id: string): Promise<void>;
142
+ /**
143
+ * Duplicate a canned response. The server generates a unique title and
144
+ * shortcut. Calls POST /api/v1/canned-responses/:id/duplicate.
145
+ */
146
+ duplicate(id: string): Promise<CannedResponseItem>;
131
147
  };
132
148
  /** Return type of createCannedResponsesModule. */
133
149
  type CannedResponsesModule = ReturnType<typeof createCannedResponsesModule>;
@@ -1314,6 +1330,7 @@ declare function createOmnivoxClient(options: OmnivoxClientOptions): {
1314
1330
  create(input: CreateCannedResponseInput): Promise<CannedResponseItem>;
1315
1331
  update(id: string, input: UpdateCannedResponseInput): Promise<CannedResponseItem>;
1316
1332
  delete(id: string): Promise<void>;
1333
+ duplicate(id: string): Promise<CannedResponseItem>;
1317
1334
  };
1318
1335
  attachments: {
1319
1336
  upload(file: Blob | Uint8Array, _opts?: Record<string, unknown>): Promise<AttachmentUploadResult>;
package/dist/index.js CHANGED
@@ -277,6 +277,9 @@ var getCannedResponsesControllerPatchUrl = (id) => {
277
277
  var getCannedResponsesControllerDeleteUrl = (id) => {
278
278
  return `/api/v1/canned-responses/${id}`;
279
279
  };
280
+ var getCannedResponsesControllerDuplicateUrl = (id) => {
281
+ return `/api/v1/canned-responses/${id}/duplicate`;
282
+ };
280
283
  var getAttachmentsControllerUploadUrl = () => {
281
284
  return `/api/v1/attachments`;
282
285
  };
@@ -982,7 +985,12 @@ function createCannedResponsesModule(options) {
982
985
  */
983
986
  async list(opts) {
984
987
  const { page, pageSize } = buildPageParams(opts);
985
- const path = getCannedResponsesControllerListUrl({ page, pageSize });
988
+ const path = getCannedResponsesControllerListUrl({
989
+ page,
990
+ pageSize,
991
+ ...opts.category ? { category: opts.category } : {},
992
+ ...opts.channel ? { channel: opts.channel } : {}
993
+ });
986
994
  const url = `${baseUrl}${path}`;
987
995
  const res = await fetch(url, buildInit("GET"));
988
996
  return parseResponse(res);
@@ -997,7 +1005,9 @@ function createCannedResponsesModule(options) {
997
1005
  const path = getCannedResponsesControllerListUrl({
998
1006
  page,
999
1007
  pageSize,
1000
- q: opts.q
1008
+ q: opts.q,
1009
+ ...opts.category ? { category: opts.category } : {},
1010
+ ...opts.channel ? { channel: opts.channel } : {}
1001
1011
  });
1002
1012
  const url = `${baseUrl}${path}`;
1003
1013
  const res = await fetch(url, buildInit("GET"));
@@ -1014,7 +1024,7 @@ function createCannedResponsesModule(options) {
1014
1024
  return parseEnvelopedResponse(res);
1015
1025
  },
1016
1026
  /**
1017
- * Partially update a canned response — title, body, and/or keywords.
1027
+ * Partially update a canned response — title, shortcut, category, channel, and/or body.
1018
1028
  * Calls PATCH /api/v1/canned-responses/:id.
1019
1029
  */
1020
1030
  async update(id, input) {
@@ -1034,6 +1044,16 @@ function createCannedResponsesModule(options) {
1034
1044
  if (!res.ok) {
1035
1045
  return parseResponse(res);
1036
1046
  }
1047
+ },
1048
+ /**
1049
+ * Duplicate a canned response. The server generates a unique title and
1050
+ * shortcut. Calls POST /api/v1/canned-responses/:id/duplicate.
1051
+ */
1052
+ async duplicate(id) {
1053
+ const path = getCannedResponsesControllerDuplicateUrl(id);
1054
+ const url = `${baseUrl}${path}`;
1055
+ const res = await fetch(url, buildInit("POST"));
1056
+ return parseEnvelopedResponse(res);
1037
1057
  }
1038
1058
  };
1039
1059
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digisglobal/omnivox-sdk",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {