@lorikeetai/node-sdk 0.13.2 → 1.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.
Files changed (202) hide show
  1. package/CHANGELOG.md +247 -0
  2. package/README.md +17 -32
  3. package/core.d.ts +7 -4
  4. package/core.d.ts.map +1 -1
  5. package/core.js +16 -9
  6. package/core.js.map +1 -1
  7. package/core.mjs +16 -9
  8. package/core.mjs.map +1 -1
  9. package/index.d.mts +21 -3
  10. package/index.d.ts +21 -3
  11. package/index.d.ts.map +1 -1
  12. package/index.js +31 -7
  13. package/index.js.map +1 -1
  14. package/index.mjs +32 -8
  15. package/index.mjs.map +1 -1
  16. package/internal/qs/formats.d.ts +6 -0
  17. package/internal/qs/formats.d.ts.map +1 -0
  18. package/internal/qs/formats.js +11 -0
  19. package/internal/qs/formats.js.map +1 -0
  20. package/internal/qs/formats.mjs +8 -0
  21. package/internal/qs/formats.mjs.map +1 -0
  22. package/internal/qs/index.d.ts +10 -0
  23. package/internal/qs/index.d.ts.map +1 -0
  24. package/internal/qs/index.js +14 -0
  25. package/internal/qs/index.js.map +1 -0
  26. package/internal/qs/index.mjs +10 -0
  27. package/internal/qs/index.mjs.map +1 -0
  28. package/internal/qs/stringify.d.ts +3 -0
  29. package/internal/qs/stringify.d.ts.map +1 -0
  30. package/internal/qs/stringify.js +279 -0
  31. package/internal/qs/stringify.js.map +1 -0
  32. package/internal/qs/stringify.mjs +276 -0
  33. package/internal/qs/stringify.mjs.map +1 -0
  34. package/internal/qs/types.d.ts +57 -0
  35. package/internal/qs/types.d.ts.map +1 -0
  36. package/internal/qs/types.js +3 -0
  37. package/internal/qs/types.js.map +1 -0
  38. package/internal/qs/types.mjs +2 -0
  39. package/internal/qs/types.mjs.map +1 -0
  40. package/internal/qs/utils.d.ts +14 -0
  41. package/internal/qs/utils.d.ts.map +1 -0
  42. package/internal/qs/utils.js +229 -0
  43. package/internal/qs/utils.js.map +1 -0
  44. package/internal/qs/utils.mjs +217 -0
  45. package/internal/qs/utils.mjs.map +1 -0
  46. package/package.json +1 -5
  47. package/resource.d.ts +1 -1
  48. package/resource.d.ts.map +1 -1
  49. package/resource.js.map +1 -1
  50. package/resource.mjs.map +1 -1
  51. package/resources/conversation/chat.d.ts +19 -164
  52. package/resources/conversation/chat.d.ts.map +1 -1
  53. package/resources/conversation/chat.js.map +1 -1
  54. package/resources/conversation/chat.mjs.map +1 -1
  55. package/resources/conversation/conversation.d.ts +116 -0
  56. package/resources/conversation/conversation.d.ts.map +1 -1
  57. package/resources/conversation/conversation.js +36 -0
  58. package/resources/conversation/conversation.js.map +1 -1
  59. package/resources/conversation/conversation.mjs +36 -0
  60. package/resources/conversation/conversation.mjs.map +1 -1
  61. package/resources/conversation/email.d.ts +19 -164
  62. package/resources/conversation/email.d.ts.map +1 -1
  63. package/resources/conversation/email.js.map +1 -1
  64. package/resources/conversation/email.mjs.map +1 -1
  65. package/resources/conversation/index.d.ts +1 -1
  66. package/resources/conversation/index.d.ts.map +1 -1
  67. package/resources/conversation/index.js.map +1 -1
  68. package/resources/conversation/index.mjs +1 -1
  69. package/resources/conversation/index.mjs.map +1 -1
  70. package/resources/customer/customer.d.ts +296 -0
  71. package/resources/customer/customer.d.ts.map +1 -0
  72. package/resources/customer/customer.js +79 -0
  73. package/resources/customer/customer.js.map +1 -0
  74. package/resources/customer/customer.mjs +52 -0
  75. package/resources/customer/customer.mjs.map +1 -0
  76. package/resources/customer/index.d.ts +3 -0
  77. package/resources/customer/index.d.ts.map +1 -0
  78. package/resources/customer/index.js +9 -0
  79. package/resources/customer/index.js.map +1 -0
  80. package/resources/customer/index.mjs +4 -0
  81. package/resources/customer/index.mjs.map +1 -0
  82. package/resources/customer/profile.d.ts +71 -0
  83. package/resources/customer/profile.d.ts.map +1 -0
  84. package/resources/customer/profile.js +21 -0
  85. package/resources/customer/profile.js.map +1 -0
  86. package/resources/customer/profile.mjs +17 -0
  87. package/resources/customer/profile.mjs.map +1 -0
  88. package/resources/customer.d.ts +1 -291
  89. package/resources/customer.d.ts.map +1 -1
  90. package/resources/customer.js +15 -45
  91. package/resources/customer.js.map +1 -1
  92. package/resources/customer.mjs +1 -43
  93. package/resources/customer.mjs.map +1 -1
  94. package/resources/file.d.ts +7 -0
  95. package/resources/file.d.ts.map +1 -0
  96. package/resources/file.js +21 -0
  97. package/resources/file.js.map +1 -0
  98. package/resources/file.mjs +17 -0
  99. package/resources/file.mjs.map +1 -0
  100. package/resources/index.d.ts +6 -2
  101. package/resources/index.d.ts.map +1 -1
  102. package/resources/index.js +10 -2
  103. package/resources/index.js.map +1 -1
  104. package/resources/index.mjs +6 -2
  105. package/resources/index.mjs.map +1 -1
  106. package/resources/ingest.d.ts +2 -0
  107. package/resources/ingest.d.ts.map +1 -1
  108. package/resources/ingest.js +9 -0
  109. package/resources/ingest.js.map +1 -1
  110. package/resources/ingest.mjs +9 -0
  111. package/resources/ingest.mjs.map +1 -1
  112. package/resources/oauth/authorization.d.ts +6 -0
  113. package/resources/oauth/authorization.d.ts.map +1 -0
  114. package/resources/oauth/authorization.js +15 -0
  115. package/resources/oauth/authorization.js.map +1 -0
  116. package/resources/oauth/authorization.mjs +11 -0
  117. package/resources/oauth/authorization.mjs.map +1 -0
  118. package/resources/oauth/index.d.ts +3 -0
  119. package/resources/oauth/index.d.ts.map +1 -0
  120. package/resources/oauth/index.js +9 -0
  121. package/resources/oauth/index.js.map +1 -0
  122. package/resources/oauth/index.mjs +4 -0
  123. package/resources/oauth/index.mjs.map +1 -0
  124. package/resources/oauth/oauth.d.ts +24 -0
  125. package/resources/oauth/oauth.d.ts.map +1 -0
  126. package/resources/oauth/oauth.js +65 -0
  127. package/resources/oauth/oauth.js.map +1 -0
  128. package/resources/oauth/oauth.mjs +38 -0
  129. package/resources/oauth/oauth.mjs.map +1 -0
  130. package/resources/oauth.d.ts +2 -0
  131. package/resources/oauth.d.ts.map +1 -0
  132. package/resources/oauth.js +19 -0
  133. package/resources/oauth.js.map +1 -0
  134. package/resources/oauth.mjs +3 -0
  135. package/resources/oauth.mjs.map +1 -0
  136. package/resources/suggestion.d.ts +7 -0
  137. package/resources/suggestion.d.ts.map +1 -0
  138. package/resources/suggestion.js +21 -0
  139. package/resources/suggestion.js.map +1 -0
  140. package/resources/suggestion.mjs +17 -0
  141. package/resources/suggestion.mjs.map +1 -0
  142. package/resources/ticket.d.ts +14 -0
  143. package/resources/ticket.d.ts.map +1 -0
  144. package/resources/ticket.js +16 -0
  145. package/resources/ticket.js.map +1 -0
  146. package/resources/ticket.mjs +12 -0
  147. package/resources/ticket.mjs.map +1 -0
  148. package/resources/top-level.d.ts +2 -0
  149. package/resources/top-level.d.ts.map +1 -0
  150. package/resources/top-level.js +4 -0
  151. package/resources/top-level.js.map +1 -0
  152. package/resources/top-level.mjs +3 -0
  153. package/resources/top-level.mjs.map +1 -0
  154. package/resources/webhooks.d.ts +6 -0
  155. package/resources/webhooks.d.ts.map +1 -0
  156. package/resources/webhooks.js +15 -0
  157. package/resources/webhooks.js.map +1 -0
  158. package/resources/webhooks.mjs +11 -0
  159. package/resources/webhooks.mjs.map +1 -0
  160. package/resources/workflow.d.ts +1 -0
  161. package/resources/workflow.d.ts.map +1 -1
  162. package/resources/workflow.js +3 -0
  163. package/resources/workflow.js.map +1 -1
  164. package/resources/workflow.mjs +3 -0
  165. package/resources/workflow.mjs.map +1 -1
  166. package/src/core.ts +17 -8
  167. package/src/index.ts +73 -10
  168. package/src/internal/qs/LICENSE.md +13 -0
  169. package/src/internal/qs/README.md +3 -0
  170. package/src/internal/qs/formats.ts +9 -0
  171. package/src/internal/qs/index.ts +13 -0
  172. package/src/internal/qs/stringify.ts +388 -0
  173. package/src/internal/qs/types.ts +71 -0
  174. package/src/internal/qs/utils.ts +265 -0
  175. package/src/resource.ts +1 -1
  176. package/src/resources/conversation/chat.ts +21 -217
  177. package/src/resources/conversation/conversation.ts +175 -0
  178. package/src/resources/conversation/email.ts +21 -217
  179. package/src/resources/conversation/index.ts +10 -1
  180. package/src/resources/customer/customer.ts +386 -0
  181. package/src/resources/customer/index.ts +13 -0
  182. package/src/resources/customer/profile.ts +89 -0
  183. package/src/resources/customer.ts +1 -372
  184. package/src/resources/file.ts +20 -0
  185. package/src/resources/index.ts +15 -2
  186. package/src/resources/ingest.ts +17 -0
  187. package/src/resources/oauth/authorization.ts +13 -0
  188. package/src/resources/oauth/index.ts +4 -0
  189. package/src/resources/oauth/oauth.ts +63 -0
  190. package/src/resources/oauth.ts +3 -0
  191. package/src/resources/suggestion.ts +20 -0
  192. package/src/resources/ticket.ts +30 -0
  193. package/src/resources/top-level.ts +3 -0
  194. package/src/resources/webhooks.ts +13 -0
  195. package/src/resources/workflow.ts +4 -0
  196. package/src/version.ts +1 -1
  197. package/version.d.ts +1 -1
  198. package/version.d.ts.map +1 -1
  199. package/version.js +1 -1
  200. package/version.js.map +1 -1
  201. package/version.mjs +1 -1
  202. package/version.mjs.map +1 -1
@@ -0,0 +1,386 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+ import * as ProfileAPI from './profile';
6
+ import { Profile, ProfileSyncParams, ProfileSyncResponse } from './profile';
7
+
8
+ export class Customer extends APIResource {
9
+ profile: ProfileAPI.Profile = new ProfileAPI.Profile(this._client);
10
+
11
+ /**
12
+ * @example
13
+ * ```ts
14
+ * const customer = await client.customer.create();
15
+ * ```
16
+ */
17
+ create(body: CustomerCreateParams, options?: Core.RequestOptions): Core.APIPromise<CustomerCreateResponse> {
18
+ return this._client.post('/v1/customer', { body, ...options });
19
+ }
20
+
21
+ /**
22
+ * @example
23
+ * ```ts
24
+ * const customer = await client.customer.update(
25
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
26
+ * );
27
+ * ```
28
+ */
29
+ update(
30
+ id: string,
31
+ body: CustomerUpdateParams,
32
+ options?: Core.RequestOptions,
33
+ ): Core.APIPromise<CustomerUpdateResponse> {
34
+ return this._client.put(`/v1/customer/${id}`, { body, ...options });
35
+ }
36
+
37
+ /**
38
+ * @example
39
+ * ```ts
40
+ * const customer = await client.customer.get(
41
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
42
+ * );
43
+ * ```
44
+ */
45
+ get(id: string, options?: Core.RequestOptions): Core.APIPromise<CustomerGetResponse> {
46
+ return this._client.get(`/v1/customer/${id}`, options);
47
+ }
48
+
49
+ /**
50
+ * @example
51
+ * ```ts
52
+ * const response = await client.customer.token();
53
+ * ```
54
+ */
55
+ token(body: CustomerTokenParams, options?: Core.RequestOptions): Core.APIPromise<string> {
56
+ return this._client.post('/v1/customer/token', { body, ...options });
57
+ }
58
+ }
59
+
60
+ export interface CustomerCreateResponse {
61
+ /**
62
+ * The id of the customer in the subscriber system
63
+ */
64
+ id: string;
65
+
66
+ /**
67
+ * The timestamp of the when the customer was created in our system
68
+ */
69
+ createdAt: string;
70
+
71
+ /**
72
+ * The URL of the customer avatar
73
+ */
74
+ avatarUrl?: string;
75
+
76
+ /**
77
+ * The display name of the customer
78
+ */
79
+ displayName?: string;
80
+
81
+ /**
82
+ * The email of the customer
83
+ */
84
+ email?: string;
85
+
86
+ /**
87
+ * The first name of the customer
88
+ */
89
+ firstName?: string;
90
+
91
+ /**
92
+ * The last name of the customer
93
+ */
94
+ lastName?: string;
95
+
96
+ /**
97
+ * The id of the customer in the ticketing system. For the SDK this needs to be
98
+ * stable and unique
99
+ */
100
+ remoteId?: string;
101
+
102
+ /**
103
+ * The id of the customer in your own primary database or a unique identifier, for
104
+ * example a cookie
105
+ */
106
+ subscriberCustomerId?: string;
107
+
108
+ /**
109
+ * A token that can be used to authenticate the customer in the your system, like a
110
+ * JWT
111
+ */
112
+ subscriberToken?: string;
113
+ }
114
+
115
+ export interface CustomerUpdateResponse {
116
+ /**
117
+ * The id of the customer in the subscriber system
118
+ */
119
+ id: string;
120
+
121
+ /**
122
+ * The timestamp of the when the customer was created in our system
123
+ */
124
+ createdAt: string;
125
+
126
+ /**
127
+ * The URL of the customer avatar
128
+ */
129
+ avatarUrl?: string;
130
+
131
+ /**
132
+ * The display name of the customer
133
+ */
134
+ displayName?: string;
135
+
136
+ /**
137
+ * The email of the customer
138
+ */
139
+ email?: string;
140
+
141
+ /**
142
+ * The first name of the customer
143
+ */
144
+ firstName?: string;
145
+
146
+ /**
147
+ * The last name of the customer
148
+ */
149
+ lastName?: string;
150
+
151
+ /**
152
+ * The id of the customer in the ticketing system. For the SDK this needs to be
153
+ * stable and unique
154
+ */
155
+ remoteId?: string;
156
+
157
+ /**
158
+ * The id of the customer in your own primary database or a unique identifier, for
159
+ * example a cookie
160
+ */
161
+ subscriberCustomerId?: string;
162
+
163
+ /**
164
+ * A token that can be used to authenticate the customer in the your system, like a
165
+ * JWT
166
+ */
167
+ subscriberToken?: string;
168
+ }
169
+
170
+ export interface CustomerGetResponse {
171
+ /**
172
+ * The id of the customer in the subscriber system
173
+ */
174
+ id: string;
175
+
176
+ /**
177
+ * The timestamp of the when the customer was created in our system
178
+ */
179
+ createdAt: string;
180
+
181
+ /**
182
+ * The URL of the customer avatar
183
+ */
184
+ avatarUrl?: string;
185
+
186
+ /**
187
+ * The display name of the customer
188
+ */
189
+ displayName?: string;
190
+
191
+ /**
192
+ * The email of the customer
193
+ */
194
+ email?: string;
195
+
196
+ /**
197
+ * The first name of the customer
198
+ */
199
+ firstName?: string;
200
+
201
+ /**
202
+ * The last name of the customer
203
+ */
204
+ lastName?: string;
205
+
206
+ /**
207
+ * The id of the customer in the ticketing system. For the SDK this needs to be
208
+ * stable and unique
209
+ */
210
+ remoteId?: string;
211
+
212
+ /**
213
+ * The id of the customer in your own primary database or a unique identifier, for
214
+ * example a cookie
215
+ */
216
+ subscriberCustomerId?: string;
217
+
218
+ /**
219
+ * A token that can be used to authenticate the customer in the your system, like a
220
+ * JWT
221
+ */
222
+ subscriberToken?: string;
223
+ }
224
+
225
+ export type CustomerTokenResponse = string;
226
+
227
+ export interface CustomerCreateParams {
228
+ /**
229
+ * The URL of the customer avatar
230
+ */
231
+ avatarUrl?: string;
232
+
233
+ /**
234
+ * The display name of the customer
235
+ */
236
+ displayName?: string;
237
+
238
+ /**
239
+ * The email of the customer
240
+ */
241
+ email?: string;
242
+
243
+ /**
244
+ * The first name of the customer
245
+ */
246
+ firstName?: string;
247
+
248
+ /**
249
+ * The last name of the customer
250
+ */
251
+ lastName?: string;
252
+
253
+ /**
254
+ * The id of the customer in the ticketing system. For the SDK this needs to be
255
+ * stable and unique
256
+ */
257
+ remoteId?: string;
258
+
259
+ /**
260
+ * The id of the customer in your own primary database or a unique identifier, for
261
+ * example a cookie
262
+ */
263
+ subscriberCustomerId?: string;
264
+
265
+ /**
266
+ * A token that can be used to authenticate the customer in the your system, like a
267
+ * JWT
268
+ */
269
+ subscriberToken?: string;
270
+ }
271
+
272
+ export interface CustomerUpdateParams {
273
+ /**
274
+ * The URL of the customer avatar
275
+ */
276
+ avatarUrl?: string;
277
+
278
+ /**
279
+ * The display name of the customer
280
+ */
281
+ displayName?: string;
282
+
283
+ /**
284
+ * The email of the customer
285
+ */
286
+ email?: string;
287
+
288
+ /**
289
+ * The first name of the customer
290
+ */
291
+ firstName?: string;
292
+
293
+ /**
294
+ * The last name of the customer
295
+ */
296
+ lastName?: string;
297
+
298
+ /**
299
+ * The id of the customer in the ticketing system. For the SDK this needs to be
300
+ * stable and unique
301
+ */
302
+ remoteId?: string;
303
+
304
+ /**
305
+ * The id of the customer in your own primary database or a unique identifier, for
306
+ * example a cookie
307
+ */
308
+ subscriberCustomerId?: string;
309
+
310
+ /**
311
+ * A token that can be used to authenticate the customer in the your system, like a
312
+ * JWT
313
+ */
314
+ subscriberToken?: string;
315
+ }
316
+
317
+ export interface CustomerTokenParams {
318
+ /**
319
+ * The URL of the customer avatar
320
+ */
321
+ avatarUrl?: string;
322
+
323
+ /**
324
+ * The display name of the customer
325
+ */
326
+ displayName?: string;
327
+
328
+ /**
329
+ * The email of the customer
330
+ */
331
+ email?: string;
332
+
333
+ /**
334
+ * The expiry of the conversation initialization token, if not provided it will be
335
+ * set to 1 hour
336
+ */
337
+ expiry?: string;
338
+
339
+ /**
340
+ * The first name of the customer
341
+ */
342
+ firstName?: string;
343
+
344
+ /**
345
+ * The last name of the customer
346
+ */
347
+ lastName?: string;
348
+
349
+ /**
350
+ * The id of the customer in the ticketing system. For the SDK this needs to be
351
+ * stable and unique
352
+ */
353
+ remoteId?: string;
354
+
355
+ /**
356
+ * The id of the customer in your own primary database or a unique identifier, for
357
+ * example a cookie
358
+ */
359
+ subscriberCustomerId?: string;
360
+
361
+ /**
362
+ * A token that can be used to authenticate the customer in the your system, like a
363
+ * JWT
364
+ */
365
+ subscriberToken?: string;
366
+ }
367
+
368
+ Customer.Profile = Profile;
369
+
370
+ export declare namespace Customer {
371
+ export {
372
+ type CustomerCreateResponse as CustomerCreateResponse,
373
+ type CustomerUpdateResponse as CustomerUpdateResponse,
374
+ type CustomerGetResponse as CustomerGetResponse,
375
+ type CustomerTokenResponse as CustomerTokenResponse,
376
+ type CustomerCreateParams as CustomerCreateParams,
377
+ type CustomerUpdateParams as CustomerUpdateParams,
378
+ type CustomerTokenParams as CustomerTokenParams,
379
+ };
380
+
381
+ export {
382
+ Profile as Profile,
383
+ type ProfileSyncResponse as ProfileSyncResponse,
384
+ type ProfileSyncParams as ProfileSyncParams,
385
+ };
386
+ }
@@ -0,0 +1,13 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ Customer,
5
+ type CustomerCreateResponse,
6
+ type CustomerUpdateResponse,
7
+ type CustomerGetResponse,
8
+ type CustomerTokenResponse,
9
+ type CustomerCreateParams,
10
+ type CustomerUpdateParams,
11
+ type CustomerTokenParams,
12
+ } from './customer';
13
+ export { Profile, type ProfileSyncResponse, type ProfileSyncParams } from './profile';
@@ -0,0 +1,89 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+
6
+ export class Profile extends APIResource {
7
+ /**
8
+ * @example
9
+ * ```ts
10
+ * const response = await client.customer.profile.sync(
11
+ * '123e4567-e89b-12d3-a456-426614174000',
12
+ * { data: { foo: 'string' } },
13
+ * );
14
+ * ```
15
+ */
16
+ sync(
17
+ id: string,
18
+ body: ProfileSyncParams,
19
+ options?: Core.RequestOptions,
20
+ ): Core.APIPromise<ProfileSyncResponse> {
21
+ return this._client.put(`/v1/customer/profile/${id}`, { body, ...options });
22
+ }
23
+ }
24
+
25
+ export interface ProfileSyncResponse {
26
+ /**
27
+ * The id of the customer in the subscriber system
28
+ */
29
+ id: string;
30
+
31
+ /**
32
+ * The timestamp of the when the customer was created in our system
33
+ */
34
+ createdAt: string;
35
+
36
+ /**
37
+ * The URL of the customer avatar
38
+ */
39
+ avatarUrl?: string;
40
+
41
+ /**
42
+ * The display name of the customer
43
+ */
44
+ displayName?: string;
45
+
46
+ /**
47
+ * The email of the customer
48
+ */
49
+ email?: string;
50
+
51
+ /**
52
+ * The first name of the customer
53
+ */
54
+ firstName?: string;
55
+
56
+ /**
57
+ * The last name of the customer
58
+ */
59
+ lastName?: string;
60
+
61
+ /**
62
+ * The id of the customer in the ticketing system. For the SDK this needs to be
63
+ * stable and unique
64
+ */
65
+ remoteId?: string;
66
+
67
+ /**
68
+ * The id of the customer in your own primary database or a unique identifier, for
69
+ * example a cookie
70
+ */
71
+ subscriberCustomerId?: string;
72
+
73
+ /**
74
+ * A token that can be used to authenticate the customer in the your system, like a
75
+ * JWT
76
+ */
77
+ subscriberToken?: string;
78
+ }
79
+
80
+ export interface ProfileSyncParams {
81
+ /**
82
+ * The profile data to update - should be provided as key value object
83
+ */
84
+ data: { [key: string]: string | boolean | number | unknown | Array<unknown> };
85
+ }
86
+
87
+ export declare namespace Profile {
88
+ export { type ProfileSyncResponse as ProfileSyncResponse, type ProfileSyncParams as ProfileSyncParams };
89
+ }