@great-detail/support-sdk 0.7.2 → 0.7.4

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,5 +1,5 @@
1
1
  import * as ky from 'ky';
2
- import { KyInstance, Options as Options$W } from 'ky';
2
+ import { KyInstance, Options as Options$X } from 'ky';
3
3
  import { z } from 'zod';
4
4
 
5
5
  /**
@@ -29,28 +29,28 @@ interface RequestFilterable {
29
29
  * @see https://greatdetail.com
30
30
  */
31
31
 
32
- interface Options$V {
32
+ interface Options$W {
33
33
  requestFilterables: RequestFilterable[];
34
34
  }
35
35
  interface Transport {
36
36
  getURL(url: string): string;
37
37
  }
38
38
 
39
- interface InputOptions extends Options$V {
39
+ interface InputOptions extends Options$W {
40
40
  baseURL: string;
41
41
  }
42
- interface Options$U extends Options$V {
42
+ interface Options$V extends Options$W {
43
43
  baseURL: string;
44
44
  }
45
45
  declare class FetchTransport implements Transport {
46
46
  client: KyInstance;
47
- options: Options$U;
47
+ options: Options$V;
48
48
  constructor({ baseURL, ...options }: InputOptions);
49
49
  getURL(url: string): string;
50
- send<T = unknown>(url: string, request: Options$W): Promise<ky.KyResponse<T>>;
50
+ send<T = unknown>(url: string, request: Options$X): Promise<ky.KyResponse<T>>;
51
51
  }
52
52
 
53
- interface Options$T {
53
+ interface Options$U {
54
54
  request?: RequestInit;
55
55
  }
56
56
  type ListActionsResponse = {
@@ -72,7 +72,7 @@ type ListActionsResponse = {
72
72
  declare class ListActions {
73
73
  protected _transport: FetchTransport;
74
74
  constructor(_transport: FetchTransport);
75
- send({ request }?: Options$T): Promise<ky.KyResponse<ListActionsResponse>>;
75
+ send({ request }?: Options$U): Promise<ky.KyResponse<ListActionsResponse>>;
76
76
  }
77
77
 
78
78
  /**
@@ -86,7 +86,7 @@ declare class ListActions {
86
86
 
87
87
  type Authentication = RequestFilterable;
88
88
 
89
- interface Options$S {
89
+ interface Options$T {
90
90
  body: z.infer<typeof CreateBoilerplate.SCHEMA>;
91
91
  request?: RequestInit;
92
92
  }
@@ -121,10 +121,10 @@ declare class CreateBoilerplate {
121
121
  boilerplateCategory: string;
122
122
  }>;
123
123
  constructor(_transport: FetchTransport);
124
- send({ body, request }: Options$S): Promise<ky.KyResponse<CreateBoilerplateResponse>>;
124
+ send({ body, request }: Options$T): Promise<ky.KyResponse<CreateBoilerplateResponse>>;
125
125
  }
126
126
 
127
- interface Options$R {
127
+ interface Options$S {
128
128
  id: string;
129
129
  request?: RequestInit;
130
130
  }
@@ -144,10 +144,10 @@ type GetBoilerplateResponse = {
144
144
  declare class GetBoilerplate {
145
145
  protected _transport: FetchTransport;
146
146
  constructor(_transport: FetchTransport);
147
- send({ id, request }: Options$R): Promise<ky.KyResponse<GetBoilerplateResponse>>;
147
+ send({ id, request }: Options$S): Promise<ky.KyResponse<GetBoilerplateResponse>>;
148
148
  }
149
149
 
150
- interface Options$Q {
150
+ interface Options$R {
151
151
  id: string;
152
152
  request?: RequestInit;
153
153
  }
@@ -167,10 +167,10 @@ type ListBoilerplateCategoryBoilerplatesResponse = {
167
167
  declare class ListBoilerplateCategoryBoilerplates {
168
168
  protected _transport: FetchTransport;
169
169
  constructor(_transport: FetchTransport);
170
- send({ id, request }: Options$Q): Promise<ky.KyResponse<ListBoilerplateCategoryBoilerplatesResponse>>;
170
+ send({ id, request }: Options$R): Promise<ky.KyResponse<ListBoilerplateCategoryBoilerplatesResponse>>;
171
171
  }
172
172
 
173
- interface Options$P {
173
+ interface Options$Q {
174
174
  query?: string;
175
175
  request?: RequestInit;
176
176
  }
@@ -190,10 +190,10 @@ type ListBoilerplatesResponse = {
190
190
  declare class ListBoilerplates {
191
191
  protected _transport: FetchTransport;
192
192
  constructor(_transport: FetchTransport);
193
- send({ query, request }?: Options$P): Promise<ky.KyResponse<ListBoilerplatesResponse>>;
193
+ send({ query, request }?: Options$Q): Promise<ky.KyResponse<ListBoilerplatesResponse>>;
194
194
  }
195
195
 
196
- interface Options$O {
196
+ interface Options$P {
197
197
  id: string;
198
198
  body: z.infer<typeof UpdateBoilerplate.SCHEMA>;
199
199
  request?: RequestInit;
@@ -224,10 +224,10 @@ declare class UpdateBoilerplate {
224
224
  content?: string | undefined;
225
225
  }>;
226
226
  constructor(_transport: FetchTransport);
227
- send({ id, body, request }: Options$O): Promise<ky.KyResponse<UpdateBoilerplateResponse>>;
227
+ send({ id, body, request }: Options$P): Promise<ky.KyResponse<UpdateBoilerplateResponse>>;
228
228
  }
229
229
 
230
- interface Options$N {
230
+ interface Options$O {
231
231
  body: z.infer<typeof CreateBoilerplateCategory.SCHEMA>;
232
232
  request?: RequestInit;
233
233
  }
@@ -259,10 +259,10 @@ declare class CreateBoilerplateCategory {
259
259
  description?: string | undefined;
260
260
  }>;
261
261
  constructor(_transport: FetchTransport);
262
- send({ body, request }: Options$N): Promise<ky.KyResponse<CreateBoilerplateCategoryResponse>>;
262
+ send({ body, request }: Options$O): Promise<ky.KyResponse<CreateBoilerplateCategoryResponse>>;
263
263
  }
264
264
 
265
- interface Options$M {
265
+ interface Options$N {
266
266
  id: string;
267
267
  request?: RequestInit;
268
268
  }
@@ -281,17 +281,17 @@ type GetBoilerplateCategoryResponse = {
281
281
  declare class GetBoilerplateCategory {
282
282
  protected _transport: FetchTransport;
283
283
  constructor(_transport: FetchTransport);
284
- send({ id, request }: Options$M): Promise<ky.KyResponse<GetBoilerplateCategoryResponse>>;
284
+ send({ id, request }: Options$N): Promise<ky.KyResponse<GetBoilerplateCategoryResponse>>;
285
285
  }
286
286
 
287
- interface IncludeOptions$3 {
287
+ interface IncludeOptions$4 {
288
288
  boilerplateCount?: boolean;
289
289
  }
290
- interface Options$L<C extends IncludeOptions$3> {
290
+ interface Options$M<C extends IncludeOptions$4> {
291
291
  include?: C;
292
292
  request?: RequestInit;
293
293
  }
294
- type ListBoilerplateCategoriesResponse<C extends IncludeOptions$3> = {
294
+ type ListBoilerplateCategoriesResponse<C extends IncludeOptions$4> = {
295
295
  data: {
296
296
  boilerplateCategory: {
297
297
  id: string;
@@ -309,10 +309,10 @@ type ListBoilerplateCategoriesResponse<C extends IncludeOptions$3> = {
309
309
  declare class ListBoilerplateCategories {
310
310
  protected _transport: FetchTransport;
311
311
  constructor(_transport: FetchTransport);
312
- send<C extends IncludeOptions$3>({ include, request, }?: Options$L<C>): Promise<ky.KyResponse<ListBoilerplateCategoriesResponse<C>>>;
312
+ send<C extends IncludeOptions$4>({ include, request, }?: Options$M<C>): Promise<ky.KyResponse<ListBoilerplateCategoriesResponse<C>>>;
313
313
  }
314
314
 
315
- interface Options$K {
315
+ interface Options$L {
316
316
  id: string;
317
317
  body: z.infer<typeof UpdateBoilerplateCategory.SCHEMA>;
318
318
  request?: RequestInit;
@@ -342,10 +342,10 @@ declare class UpdateBoilerplateCategory {
342
342
  description?: string | undefined;
343
343
  }>;
344
344
  constructor(_transport: FetchTransport);
345
- send({ id, body, request }: Options$K): Promise<ky.KyResponse<UpdateBoilerplateCategoryResponse>>;
345
+ send({ id, body, request }: Options$L): Promise<ky.KyResponse<UpdateBoilerplateCategoryResponse>>;
346
346
  }
347
347
 
348
- interface Options$J {
348
+ interface Options$K {
349
349
  body: z.infer<typeof CreateChannel.SCHEMA>;
350
350
  request?: RequestInit;
351
351
  }
@@ -442,10 +442,10 @@ declare class CreateChannel {
442
442
  };
443
443
  }>]>>;
444
444
  constructor(_transport: FetchTransport);
445
- send({ body, request }: Options$J): Promise<ky.KyResponse<CreateChannelResponse>>;
445
+ send({ body, request }: Options$K): Promise<ky.KyResponse<CreateChannelResponse>>;
446
446
  }
447
447
 
448
- interface Options$I {
448
+ interface Options$J {
449
449
  id: string;
450
450
  request?: RequestInit;
451
451
  }
@@ -487,10 +487,10 @@ type GetChannelResponse = {
487
487
  declare class GetChannel {
488
488
  protected _transport: FetchTransport;
489
489
  constructor(_transport: FetchTransport);
490
- send({ id, request }: Options$I): Promise<ky.KyResponse<GetChannelResponse>>;
490
+ send({ id, request }: Options$J): Promise<ky.KyResponse<GetChannelResponse>>;
491
491
  }
492
492
 
493
- interface Options$H {
493
+ interface Options$I {
494
494
  request?: RequestInit;
495
495
  }
496
496
  type ListChannelsResponse = {
@@ -531,7 +531,51 @@ type ListChannelsResponse = {
531
531
  declare class ListChannels {
532
532
  protected _transport: FetchTransport;
533
533
  constructor(_transport: FetchTransport);
534
- send({ request }?: Options$H): Promise<ky.KyResponse<ListChannelsResponse>>;
534
+ send({ request }?: Options$I): Promise<ky.KyResponse<ListChannelsResponse>>;
535
+ }
536
+
537
+ interface Options$H {
538
+ id: string;
539
+ body: z.infer<typeof TwilioSendgridChannelSync.SCHEMA>;
540
+ request?: RequestInit;
541
+ }
542
+ type TwilioSendgridChannelSyncResponse = {
543
+ data: {
544
+ channel: {
545
+ id: string;
546
+ name?: string;
547
+ status: "ActiveChannelStatus" | "PotentialChannelStatus";
548
+ account: string;
549
+ createdAt: string;
550
+ updatedAt: string;
551
+ source: "twilio-sendgrid";
552
+ twilioSendgrid: {
553
+ id: string;
554
+ displayName: string;
555
+ outboundEmailAddress: string;
556
+ replyEmailAddress?: string;
557
+ inboundHostname: string;
558
+ apiKey: string;
559
+ secrets: {
560
+ id: string;
561
+ isActive: boolean;
562
+ secretExcerpt: string;
563
+ }[];
564
+ };
565
+ };
566
+ };
567
+ };
568
+ declare class TwilioSendgridChannelSync {
569
+ protected _transport: FetchTransport;
570
+ static SCHEMA: z.ZodObject<{
571
+ overwrite: z.ZodOptional<z.ZodBoolean>;
572
+ }, "strip", z.ZodTypeAny, {
573
+ overwrite?: boolean | undefined;
574
+ }, {
575
+ overwrite?: boolean | undefined;
576
+ }>;
577
+ constructor(_transport: FetchTransport);
578
+ send({ id, body, request }: Options$H): Promise<ky.KyResponse<TwilioSendgridChannelSyncResponse>>;
535
579
  }
536
580
 
537
581
  interface Options$G {
@@ -835,16 +879,16 @@ declare class CreateContact {
835
879
  send({ body, request }: Options$z): Promise<ky.KyResponse<CreateContactResponse>>;
836
880
  }
837
881
 
838
- interface IncludeOptions$2 {
882
+ interface IncludeOptions$3 {
839
883
  messageCount?: boolean;
840
884
  conversationCount?: boolean;
841
885
  }
842
- interface Options$y<C extends IncludeOptions$2> {
886
+ interface Options$y<C extends IncludeOptions$3> {
843
887
  id: string;
844
888
  include?: C;
845
889
  request?: RequestInit;
846
890
  }
847
- type GetContactResponse<C extends IncludeOptions$2> = {
891
+ type GetContactResponse<C extends IncludeOptions$3> = {
848
892
  data: {
849
893
  contact: {
850
894
  id: string;
@@ -866,7 +910,7 @@ type GetContactResponse<C extends IncludeOptions$2> = {
866
910
  declare class GetContact {
867
911
  protected _transport: FetchTransport;
868
912
  constructor(_transport: FetchTransport);
869
- send<C extends IncludeOptions$2>({ id, include, request, }: Options$y<C>): Promise<ky.KyResponse<GetContactResponse<C>>>;
913
+ send<C extends IncludeOptions$3>({ id, include, request, }: Options$y<C>): Promise<ky.KyResponse<GetContactResponse<C>>>;
870
914
  }
871
915
 
872
916
  interface Options$x {
@@ -951,11 +995,15 @@ declare class UpdateContact {
951
995
  send({ id, body, request }: Options$v): Promise<ky.KyResponse<UpdateContactResponse>>;
952
996
  }
953
997
 
954
- interface Options$u {
998
+ interface IncludeOptions$2 {
999
+ channel?: boolean;
1000
+ }
1001
+ interface Options$u<C extends IncludeOptions$2> {
955
1002
  id: string;
1003
+ include?: C;
956
1004
  request?: RequestInit;
957
1005
  }
958
- type GetConversationResponse = {
1006
+ type GetConversationResponse<C extends IncludeOptions$2> = {
959
1007
  data: {
960
1008
  conversation: {
961
1009
  id: string;
@@ -966,12 +1014,45 @@ type GetConversationResponse = {
966
1014
  createdAt: string;
967
1015
  updatedAt: string;
968
1016
  };
1017
+ channel: C extends {
1018
+ channel: true;
1019
+ } ? {
1020
+ id: string;
1021
+ name?: string;
1022
+ status: "ActiveChannelStatus" | "PotentialChannelStatus";
1023
+ account: string;
1024
+ createdAt: string;
1025
+ updatedAt: string;
1026
+ } & ({
1027
+ source: "meta-whatsapp";
1028
+ metaWhatsapp: {
1029
+ id: string;
1030
+ whatsappAccountID: string;
1031
+ whatsappPhoneNumberID: string;
1032
+ accessToken: string;
1033
+ };
1034
+ } | {
1035
+ source: "twilio-sendgrid";
1036
+ twilioSendgrid: {
1037
+ id: string;
1038
+ displayName: string;
1039
+ outboundEmailAddress: string;
1040
+ replyEmailAddress?: string;
1041
+ inboundHostname: string;
1042
+ apiKey: string;
1043
+ secrets: {
1044
+ id: string;
1045
+ isActive: boolean;
1046
+ secretExcerpt: string;
1047
+ }[];
1048
+ };
1049
+ }) : never;
969
1050
  };
970
1051
  };
971
1052
  declare class GetConversation {
972
1053
  protected _transport: FetchTransport;
973
1054
  constructor(_transport: FetchTransport);
974
- send({ id, request }: Options$u): Promise<ky.KyResponse<GetConversationResponse>>;
1055
+ send<C extends IncludeOptions$2>({ id, include, request, }: Options$u<C>): Promise<ky.KyResponse<GetConversationResponse<C>>>;
975
1056
  }
976
1057
 
977
1058
  interface Options$t {
@@ -1848,6 +1929,9 @@ declare class Client {
1848
1929
  message: {
1849
1930
  list: ListChannelMessages;
1850
1931
  };
1932
+ twilioSendgrid: {
1933
+ sync: TwilioSendgridChannelSync;
1934
+ };
1851
1935
  };
1852
1936
  get compositionSection(): {
1853
1937
  get: GetCompositionSection;
@@ -1929,4 +2013,4 @@ declare class Client {
1929
2013
  get webhook(): Webhook;
1930
2014
  }
1931
2015
 
1932
- export { type GetSourceResponse as $, type Authentication as A, type ListContactConversationsResponse as B, Client as C, type CreateLabelResponse as D, type DeleteLabelResponse as E, type GetLabelResponse as F, type GetBoilerplateResponse as G, type ListLabelsResponse as H, type UpdateLabelResponse as I, type ListConversationMessagesResponse as J, type ListMessagesResponse as K, type ListActionsResponse as L, type ListChannelMessagesResponse as M, type GetModelResponse as N, type Options as O, type ListModelsResponse as P, type CreateCorrectionResponse as Q, type RequestFilterable as R, type CreateResponseResponse as S, type CreateContactNoteResponse as T, type UpdateBoilerplateResponse as U, type CreateConversationNoteResponse as V, type WebhookResponse as W, type GetNoteResponse as X, type ListContactNotesResponse as Y, type ListConversationNotesResponse as Z, type UpdateNoteResponse as _, type Options$V as a, type ListSourcesResponse as a0, type CreateContactNotificationSubscriptionResponse as a1, type CreateUploadResponse as a2, type GetUploadResponse as a3, type DeleteUploadResponse as a4, type CreateBoilerplateResponse as b, type ListBoilerplateCategoryBoilerplatesResponse as c, type ListBoilerplatesResponse as d, type CreateBoilerplateCategoryResponse as e, type GetBoilerplateCategoryResponse as f, type ListBoilerplateCategoriesResponse as g, type UpdateBoilerplateCategoryResponse as h, type ListChannelsResponse as i, type GetChannelResponse as j, type UpdateChannelResponse as k, type CreateChannelResponse as l, type GetCompositionSectionResponse as m, type ListCompositionSectionsResponse as n, type CreateCompositionSectionResponse as o, type ListChannelCompositionSectionsResponse as p, type UpdateCompositionSectionResponse as q, type CreateContactResponse as r, type GetContactResponse as s, type ListContactsResponse as t, type ListLabelContactsResponse as u, type UpdateContactResponse as v, type GetConversationResponse as w, type ListConversationsResponse as x, type ListLabelConversationsResponse as y, type UpdateConversationResponse as z };
2016
+ export { type UpdateNoteResponse as $, type Authentication as A, type ListContactConversationsResponse as B, Client as C, type CreateLabelResponse as D, type DeleteLabelResponse as E, type GetLabelResponse as F, type GetBoilerplateResponse as G, type ListLabelsResponse as H, type UpdateLabelResponse as I, type ListConversationMessagesResponse as J, type ListMessagesResponse as K, type ListActionsResponse as L, type ListChannelMessagesResponse as M, type GetModelResponse as N, type Options as O, type ListModelsResponse as P, type CreateCorrectionResponse as Q, type RequestFilterable as R, type CreateResponseResponse as S, type TwilioSendgridChannelSyncResponse as T, type UpdateBoilerplateResponse as U, type CreateContactNoteResponse as V, type WebhookResponse as W, type CreateConversationNoteResponse as X, type GetNoteResponse as Y, type ListContactNotesResponse as Z, type ListConversationNotesResponse as _, type Options$W as a, type GetSourceResponse as a0, type ListSourcesResponse as a1, type CreateContactNotificationSubscriptionResponse as a2, type CreateUploadResponse as a3, type GetUploadResponse as a4, type DeleteUploadResponse as a5, type CreateBoilerplateResponse as b, type ListBoilerplateCategoryBoilerplatesResponse as c, type ListBoilerplatesResponse as d, type CreateBoilerplateCategoryResponse as e, type GetBoilerplateCategoryResponse as f, type ListBoilerplateCategoriesResponse as g, type UpdateBoilerplateCategoryResponse as h, type ListChannelsResponse as i, type GetChannelResponse as j, type UpdateChannelResponse as k, type CreateChannelResponse as l, type GetCompositionSectionResponse as m, type ListCompositionSectionsResponse as n, type CreateCompositionSectionResponse as o, type ListChannelCompositionSectionsResponse as p, type UpdateCompositionSectionResponse as q, type CreateContactResponse as r, type GetContactResponse as s, type ListContactsResponse as t, type ListLabelContactsResponse as u, type UpdateContactResponse as v, type GetConversationResponse as w, type ListConversationsResponse as x, type ListLabelConversationsResponse as y, type UpdateConversationResponse as z };
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var re=Object.create;var Ut=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var Kt=(r,t)=>{for(var e in t)Ut(r,e,{get:t[e],enumerable:!0})},Vt=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of se(t))!ie.call(r,s)&&s!==e&&Ut(r,s,{get:()=>t[s],enumerable:!(n=ne(t,s))||n.enumerable});return r};var Wt=(r,t,e)=>(e=r!=null?re(oe(r)):{},Vt(t||!r||!r.__esModule?Ut(e,"default",{value:r,enumerable:!0}):e,r)),ae=r=>Vt(Ut({},"__esModule",{value:!0}),r);var pe={};Kt(pe,{Client:()=>x,DEFAULT_SUPPORT_BASE_URL:()=>qt,Error:()=>Bt,KeyAuthentication:()=>Ft,PublicAuthentication:()=>wt,TokenAuthentication:()=>It,default:()=>x});module.exports=ae(pe);var qt="https://api.support.greatdetail.com",Yt={"X-Powered-By":"GDSupport/JavaScript"},$t="api-key";var y=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/actions",{...t,method:"GET"})}};var C=require("zod"),T=class r{constructor(t){this._transport=t}static SCHEMA=C.z.object({title:C.z.string(),content:C.z.string(),account:C.z.string(),boilerplateCategory:C.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/boilerplates",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var _=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...e,method:"GET"})}};var E=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...e,method:"GET"})}};var v=class{constructor(t){this._transport=t}async send({query:t,request:e={}}={}){return this._transport.send("v1/boilerplates"+(t?"?query="+encodeURIComponent(t):""),{...e,method:"GET"})}};var Ht=require("zod"),O=class r{constructor(t){this._transport=t}static SCHEMA=Ht.z.object({title:Ht.z.string().optional(),content:Ht.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var S=require("zod"),F=class r{constructor(t){this._transport=t}static SCHEMA=S.z.object({title:S.z.string(),description:S.z.string().optional(),account:S.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/boilerplate-categories",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var I=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...e,method:"GET"})}};var w=class{constructor(t){this._transport=t}async send({include:t,request:e={}}={}){let n=[];for(let s of Object.keys(t??{}))n.push(["include",s]);return this._transport.send("v1/boilerplate-categories",{...e,method:"GET",searchParams:n})}};var Lt=require("zod"),U=class r{constructor(t){this._transport=t}static SCHEMA=Lt.z.object({title:Lt.z.string().optional(),description:Lt.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var o=require("zod"),q=class r{constructor(t){this._transport=t}static SCHEMA=o.z.intersection(o.z.object({name:o.z.string().optional(),account:o.z.string()}),o.z.discriminatedUnion("source",[o.z.object({source:o.z.literal("meta-whatsapp")}),o.z.object({source:o.z.literal("twilio-sendgrid"),twilioSendgrid:o.z.object({displayName:o.z.string().optional(),outboundEmailAddress:o.z.string().email(),replyEmailAddress:o.z.string().optional(),inboundHostname:o.z.string(),apiKey:o.z.string()})})]));async send({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var H=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}};var L=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/channels",{...t,method:"GET"})}};var i=require("zod"),M=class r{constructor(t){this._transport=t}static SCHEMA=i.z.intersection(i.z.object({name:i.z.string().optional()}),i.z.discriminatedUnion("source",[i.z.object({source:i.z.literal("meta-whatsapp")}),i.z.object({source:i.z.literal("twilio-sendgrid"),twilioSendgrid:i.z.object({displayName:i.z.string().optional(),outboundEmailAddress:i.z.string().email().optional(),replyEmailAddress:i.z.string().optional(),inboundHostname:i.z.string().optional(),apiKey:i.z.string().optional()})})]));async send({id:t,body:e,request:n={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var b=require("zod"),j=class r{constructor(t){this._transport=t}static SCHEMA=b.z.object({account:b.z.string(),channel:b.z.string().optional(),location:b.z.enum(["header","footer"]),content:b.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var N=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}};var G=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...e,method:"GET"})}};var P=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/composition-sections",{...t,method:"GET"})}};var Gt=require("zod"),z=class r{constructor(t){this._transport=t}static SCHEMA=Gt.z.object({content:Gt.z.string()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var Jt="SUPPORT_ACCESS_TOKEN",Xt="SUPPORT_API_KEY",Qt="SUPPORT_KEY_NAME",Zt="SUPPORT_BASE_URL";var D=class{constructor(t){this._transport=t}getRelativeURL({id:t,vcf:e={}}){let n=e.variant??"vcard",s=e.format??(e.variant==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(n)+"&format="+encodeURIComponent(s)}getURL(t){return this._transport.getURL(this.getRelativeURL(t))}};var A=require("zod"),B=class r{constructor(t){this._transport=t}static SCHEMA=A.z.object({name:A.z.string(),account:A.z.string(),emailAddress:A.z.string().email().optional(),telephoneNumber:A.z.string().optional()});async send({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var k=class{constructor(t){this._transport=t}async send({id:t,include:e,request:n={}}){let s=[];for(let l of Object.keys(e??{}))s.push(["include",l]);return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...n,method:"GET",searchParams:s})}};var K=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/contacts",{...t,method:"GET"})}};var V=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...e,method:"GET"})}};var W=require("zod"),Y=class r{constructor(t){this._transport=t}static SCHEMA=W.z.object({name:W.z.string().optional(),emailAddress:W.z.string().email().optional(),telephoneNumber:W.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var $=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"GET"})}};var J=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...e,method:"GET"})}};var X=class{constructor(t){this._transport=t}async send({filter:t,include:e,request:n={}}={}){let s=[];return t&&s.push(["filter",t]),e?.latestMessage&&s.push(["include","latestMessage"]),this._transport.send("v1/conversations",{...n,method:"GET",searchParams:s})}};var Q=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...e,method:"GET"})}};var Mt=require("zod"),Z=class r{constructor(t){this._transport=t}static SCHEMA=Mt.z.object({status:Mt.z.enum(["AwaitingContactConversationStatus","AwaitingAgentConversationStatus","ResolvedConversationStatus","ClosedConversationStatus"]).optional(),hasEnded:Mt.z.boolean().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var tt=require("zod"),et=class r{constructor(t){this._transport=t}static SCHEMA=tt.z.object({title:tt.z.string(),description:tt.z.string().optional(),account:tt.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var rt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var nt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}};var st=class{constructor(t){this._transport=t}async send({include:t,request:e={}}={}){let n=[];for(let s of Object.keys(t??{}))n.push(["include",s]);return this._transport.send("v1/labels",{...e,method:"GET",searchParams:n})}};var jt=require("zod"),ot=class r{constructor(t){this._transport=t}static SCHEMA=jt.z.object({title:jt.z.string().optional(),description:jt.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var it=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...e,method:"GET"})}};var at=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...e,method:"GET"})}};var pt=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/messages",{...t,method:"GET"})}};var ct=require("zod"),dt=class r{constructor(t){this._transport=t}static SCHEMA=ct.z.object({input:ct.z.string().max(65536),original:ct.z.string().max(65536),correction:ct.z.string().max(65536)});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var ut=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}};var lt=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}};var gt=require("zod"),mt=class r{constructor(t){this._transport=t}static SCHEMA=gt.z.array(gt.z.object({role:gt.z.enum(["user","assistant"]),content:gt.z.string().max(65536).nullable()})).min(1);async send({id:t,body:e,request:n={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var Pt=require("zod"),ht=class r{constructor(t){this._transport=t}static SCHEMA=Pt.z.object({content:Pt.z.string()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var zt=require("zod"),R=class r{constructor(t){this._transport=t}static SCHEMA=zt.z.object({content:zt.z.string()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var ft=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}};var Ct=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}};var bt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}};var Dt=require("zod"),At=class r{constructor(t){this._transport=t}static SCHEMA=Dt.z.object({content:Dt.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var d=require("zod"),Rt=class r{constructor(t){this._transport=t}static SCHEMA=d.z.discriminatedUnion("type",[d.z.object({type:d.z.literal("vapid"),endpoint:d.z.string().url(),keys:d.z.object({p256dh:d.z.string(),auth:d.z.string()})})]);async send({id:t,body:e,request:n={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notification-subscriptions",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var xt=class r{constructor(t=r.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=Yt;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var yt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}};var Tt=class{constructor(t){this._transport=t}async send({category:t,request:e={}}={}){let n=[];if(t){let s=Array.isArray(t)?t:[t];for(let l of s)n.push(["category",l])}return this._transport.send("v1/sources",{...e,method:"GET",searchParams:n})}};var te=Wt(require("is-network-error"),1),Nt=Wt(require("ky"),1);var a=class extends Error{};var c=class extends a{};var g=class extends c{static unauthenticated(){return new this("An unauthenticated request occurred")}};var m=class extends c{static forbidden(){return new this("A forbidden request occurred")}};var u=class extends a{static notFound(t){return new this(`Record not found for request: ${t}`)}static forbiddenMethod(t,e){return new this(`Forbidden method for request: ${t} ${e}`)}};var h=class extends a{};var f=class extends a{static badRequest(){return new this("Bad request")}};var _t=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=Nt.default.create({prefixUrl:this.options.baseURL,hooks:{beforeRequest:[n=>{for(let s of this.options.requestFilterables){let l=s.getHeaders();for(let[kt,ee]of Object.entries(l))n.headers.has(kt)||n.headers.set(kt,ee)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}async send(t,e){return await this.client(t,e).catch(n=>{if((0,te.default)(n))throw new h("A network error occurred",{cause:n});if(n instanceof Nt.HTTPError){let s=n.response.status;switch(console.error(JSON.stringify(n.response)),s){case 400:throw f.badRequest();case 401:throw g.unauthenticated();case 403:throw m.forbidden();case 404:throw u.notFound(t);case 405:throw u.forbiddenMethod(t,e.method??"GET")}}throw n})}};var Et=class{constructor(t){this._transport=t}async send({account:t,files:e,request:n={}}){let s=new FormData;for(let l of e)s.append("file",l);return this._transport.send("v1/uploads",{...n,method:"POST",body:s,searchParams:{account:t}})}};var vt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var Ot=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}};var p=require("zod"),St=class r{constructor(t){this._client=t}static SCHEMA=p.z.object({event:p.z.intersection(p.z.object({id:p.z.string(),createdAt:p.z.string().datetime()}),p.z.discriminatedUnion("type",[p.z.object({type:p.z.literal("contact.created"),contact:p.z.string()}),p.z.object({type:p.z.literal("message.created"),message:p.z.string()})]))});async event({request:t}){let{event:e}=r.SCHEMA.parse(t.body);return{event:e}}};var x=class r{static DEFAULT_BASE_URL=qt;_transport;constructor(t,{baseURL:e,...n}={}){this._transport=new _t({requestFilterables:[new xt,t],...n,baseURL:e?.toString()??r.getBaseURL()})}static getBaseURL(){return process.env[Zt]??this.DEFAULT_BASE_URL}get action(){return{list:new y(this._transport)}}get boilerplate(){return{get:new _(this._transport),list:new v(this._transport),update:new O(this._transport),create:new T(this._transport)}}get boilerplateCategory(){return{get:new I(this._transport),list:new w(this._transport),create:new F(this._transport),update:new U(this._transport),boilerplate:{list:new E(this._transport)}}}get channel(){return{get:new H(this._transport),list:new L(this._transport),update:new M(this._transport),create:new q(this._transport),compositionSection:{list:new G(this._transport)},message:{list:new it(this._transport)}}}get compositionSection(){return{get:new N(this._transport),list:new P(this._transport),create:new j(this._transport),update:new z(this._transport)}}get contact(){return{get:new k(this._transport),list:new K(this._transport),update:new Y(this._transport),create:new B(this._transport),conversation:{list:new J(this._transport)},note:{list:new Ct(this._transport),create:new ht(this._transport)},notificationSubscription:{create:new Rt(this._transport)},vcf:{get:new D(this._transport)}}}get conversation(){return{get:new $(this._transport),list:new X(this._transport),update:new Z(this._transport),create:new R(this._transport),message:{list:new at(this._transport)},note:{list:new bt(this._transport),create:new R(this._transport)}}}get label(){return{create:new et(this._transport),get:new nt(this._transport),list:new st(this._transport),update:new ot(this._transport),delete:new rt(this._transport),contact:{list:new V(this._transport)},conversation:{list:new Q(this._transport)}}}get message(){return{list:new pt(this._transport)}}get model(){return{get:new ut(this._transport),list:new lt(this._transport),response:{create:new mt(this._transport)},correction:{create:new dt(this._transport)}}}get note(){return{get:new ft(this._transport),update:new At(this._transport)}}get source(){return{get:new yt(this._transport),list:new Tt(this._transport)}}get upload(){return{get:new Ot(this._transport),create:new Et(this._transport),delete:new vt(this._transport)}}get webhook(){return new St(this)}};var Bt={};Kt(Bt,{AuthError:()=>c,AuthenticationError:()=>g,AuthorizationError:()=>m,LogicError:()=>u,NetworkError:()=>h,SupportError:()=>a,ValidationError:()=>f});var Ft=class r{static DEFAULT_NAME=$t;name;#t;constructor({name:t=process.env[Qt]??r.DEFAULT_NAME,key:e=process.env[Xt]}={}){if(!e)throw new Error("API Key option must be specified when using Key Authentication");this.name=t,this.#t=e}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};var It=class{#t;constructor({token:t=process.env[Jt]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Bearer ${this.#t}`}}};var wt=class{async filter(){return{headers:this.getHeaders()}}getHeaders(){return{}}};0&&(module.exports={Client,DEFAULT_SUPPORT_BASE_URL,Error,KeyAuthentication,PublicAuthentication,TokenAuthentication});
1
+ "use strict";var se=Object.create;var qt=Object.defineProperty;var oe=Object.getOwnPropertyDescriptor;var ie=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty;var Wt=(r,t)=>{for(var e in t)qt(r,e,{get:t[e],enumerable:!0})},Yt=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ie(t))!pe.call(r,s)&&s!==e&&qt(r,s,{get:()=>t[s],enumerable:!(n=oe(t,s))||n.enumerable});return r};var $t=(r,t,e)=>(e=r!=null?se(ae(r)):{},Yt(t||!r||!r.__esModule?qt(e,"default",{value:r,enumerable:!0}):e,r)),ce=r=>Yt(qt({},"__esModule",{value:!0}),r);var de={};Wt(de,{Client:()=>R,DEFAULT_SUPPORT_BASE_URL:()=>Ht,Error:()=>Kt,KeyAuthentication:()=>It,PublicAuthentication:()=>Ut,TokenAuthentication:()=>Ft,default:()=>R});module.exports=ce(de);var Ht="https://api.support.greatdetail.com",Jt={"X-Powered-By":"GDSupport/JavaScript"},Xt="api-key";var y=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/actions",{...t,method:"GET"})}};var C=require("zod"),T=class r{constructor(t){this._transport=t}static SCHEMA=C.z.object({title:C.z.string(),content:C.z.string(),account:C.z.string(),boilerplateCategory:C.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/boilerplates",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var E=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...e,method:"GET"})}};var _=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...e,method:"GET"})}};var S=class{constructor(t){this._transport=t}async send({query:t,request:e={}}={}){return this._transport.send("v1/boilerplates"+(t?"?query="+encodeURIComponent(t):""),{...e,method:"GET"})}};var Lt=require("zod"),v=class r{constructor(t){this._transport=t}static SCHEMA=Lt.z.object({title:Lt.z.string().optional(),content:Lt.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var O=require("zod"),w=class r{constructor(t){this._transport=t}static SCHEMA=O.z.object({title:O.z.string(),description:O.z.string().optional(),account:O.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/boilerplate-categories",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var I=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...e,method:"GET"})}};var F=class{constructor(t){this._transport=t}async send({include:t,request:e={}}={}){let n=[];for(let s of Object.keys(t??{}))n.push(["include",s]);return this._transport.send("v1/boilerplate-categories",{...e,method:"GET",searchParams:n})}};var Mt=require("zod"),U=class r{constructor(t){this._transport=t}static SCHEMA=Mt.z.object({title:Mt.z.string().optional(),description:Mt.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var o=require("zod"),q=class r{constructor(t){this._transport=t}static SCHEMA=o.z.intersection(o.z.object({name:o.z.string().optional(),account:o.z.string()}),o.z.discriminatedUnion("source",[o.z.object({source:o.z.literal("meta-whatsapp")}),o.z.object({source:o.z.literal("twilio-sendgrid"),twilioSendgrid:o.z.object({displayName:o.z.string().optional(),outboundEmailAddress:o.z.string().email(),replyEmailAddress:o.z.string().optional(),inboundHostname:o.z.string(),apiKey:o.z.string()})})]));async send({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var H=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}};var L=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/channels",{...t,method:"GET"})}};var Gt=require("zod"),M=class r{constructor(t){this._transport=t}static SCHEMA=Gt.z.object({overwrite:Gt.z.boolean().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/sources/twilio-sendgrid/channels/"+encodeURIComponent(t)+"/sync",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var i=require("zod"),j=class r{constructor(t){this._transport=t}static SCHEMA=i.z.intersection(i.z.object({name:i.z.string().optional()}),i.z.discriminatedUnion("source",[i.z.object({source:i.z.literal("meta-whatsapp")}),i.z.object({source:i.z.literal("twilio-sendgrid"),twilioSendgrid:i.z.object({displayName:i.z.string().optional(),outboundEmailAddress:i.z.string().email().optional(),replyEmailAddress:i.z.string().optional(),inboundHostname:i.z.string().optional(),apiKey:i.z.string().optional()})})]));async send({id:t,body:e,request:n={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var b=require("zod"),N=class r{constructor(t){this._transport=t}static SCHEMA=b.z.object({account:b.z.string(),channel:b.z.string().optional(),location:b.z.enum(["header","footer"]),content:b.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var P=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}};var G=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...e,method:"GET"})}};var z=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/composition-sections",{...t,method:"GET"})}};var zt=require("zod"),D=class r{constructor(t){this._transport=t}static SCHEMA=zt.z.object({content:zt.z.string()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var Qt="SUPPORT_ACCESS_TOKEN",Zt="SUPPORT_API_KEY",te="SUPPORT_KEY_NAME",ee="SUPPORT_BASE_URL";var B=class{constructor(t){this._transport=t}getRelativeURL({id:t,vcf:e={}}){let n=e.variant??"vcard",s=e.format??(e.variant==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(n)+"&format="+encodeURIComponent(s)}getURL(t){return this._transport.getURL(this.getRelativeURL(t))}};var A=require("zod"),k=class r{constructor(t){this._transport=t}static SCHEMA=A.z.object({name:A.z.string(),account:A.z.string(),emailAddress:A.z.string().email().optional(),telephoneNumber:A.z.string().optional()});async send({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var K=class{constructor(t){this._transport=t}async send({id:t,include:e,request:n={}}){let s=[];for(let c of Object.keys(e??{}))s.push(["include",c]);return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...n,method:"GET",searchParams:s})}};var V=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/contacts",{...t,method:"GET"})}};var W=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...e,method:"GET"})}};var Y=require("zod"),$=class r{constructor(t){this._transport=t}static SCHEMA=Y.z.object({name:Y.z.string().optional(),emailAddress:Y.z.string().email().optional(),telephoneNumber:Y.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var J=class{constructor(t){this._transport=t}async send({id:t,include:e,request:n={}}){let s=[];for(let c of Object.keys(e??{}))s.push(["include",c]);return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...n,method:"GET",searchParams:s})}};var X=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...e,method:"GET"})}};var Q=class{constructor(t){this._transport=t}async send({filter:t,include:e,request:n={}}={}){let s=[];t&&s.push(["filter",t]);for(let c of Object.keys(e??{}))s.push(["include",c]);return this._transport.send("v1/conversations",{...n,method:"GET",searchParams:s})}};var Z=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...e,method:"GET"})}};var jt=require("zod"),tt=class r{constructor(t){this._transport=t}static SCHEMA=jt.z.object({status:jt.z.enum(["AwaitingContactConversationStatus","AwaitingAgentConversationStatus","ResolvedConversationStatus","ClosedConversationStatus"]).optional(),hasEnded:jt.z.boolean().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var et=require("zod"),rt=class r{constructor(t){this._transport=t}static SCHEMA=et.z.object({title:et.z.string(),description:et.z.string().optional(),account:et.z.string()});async send({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var nt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var st=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}};var ot=class{constructor(t){this._transport=t}async send({include:t,request:e={}}={}){let n=[];for(let s of Object.keys(t??{}))n.push(["include",s]);return this._transport.send("v1/labels",{...e,method:"GET",searchParams:n})}};var Nt=require("zod"),it=class r{constructor(t){this._transport=t}static SCHEMA=Nt.z.object({title:Nt.z.string().optional(),description:Nt.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var at=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...e,method:"GET"})}};var pt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...e,method:"GET"})}};var ct=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/messages",{...t,method:"GET"})}};var dt=require("zod"),ut=class r{constructor(t){this._transport=t}static SCHEMA=dt.z.object({input:dt.z.string().max(65536),original:dt.z.string().max(65536),correction:dt.z.string().max(65536)});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var lt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}};var gt=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}};var mt=require("zod"),ht=class r{constructor(t){this._transport=t}static SCHEMA=mt.z.array(mt.z.object({role:mt.z.enum(["user","assistant"]),content:mt.z.string().max(65536).nullable()})).min(1);async send({id:t,body:e,request:n={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var Dt=require("zod"),ft=class r{constructor(t){this._transport=t}static SCHEMA=Dt.z.object({content:Dt.z.string()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var Bt=require("zod"),x=class r{constructor(t){this._transport=t}static SCHEMA=Bt.z.object({content:Bt.z.string()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var Ct=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}};var bt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}};var At=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}};var kt=require("zod"),xt=class r{constructor(t){this._transport=t}static SCHEMA=kt.z.object({content:kt.z.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var u=require("zod"),Rt=class r{constructor(t){this._transport=t}static SCHEMA=u.z.discriminatedUnion("type",[u.z.object({type:u.z.literal("vapid"),endpoint:u.z.string().url(),keys:u.z.object({p256dh:u.z.string(),auth:u.z.string()})})]);async send({id:t,body:e,request:n={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notification-subscriptions",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var yt=class r{constructor(t=r.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=Jt;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var Tt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}};var Et=class{constructor(t){this._transport=t}async send({category:t,request:e={}}={}){let n=[];if(t){let s=Array.isArray(t)?t:[t];for(let c of s)n.push(["category",c])}return this._transport.send("v1/sources",{...e,method:"GET",searchParams:n})}};var re=$t(require("is-network-error"),1),Pt=$t(require("ky"),1);var a=class extends Error{};var d=class extends a{};var g=class extends d{static unauthenticated(){return new this("An unauthenticated request occurred")}};var m=class extends d{static forbidden(){return new this("A forbidden request occurred")}};var l=class extends a{static notFound(t){return new this(`Record not found for request: ${t}`)}static forbiddenMethod(t,e){return new this(`Forbidden method for request: ${t} ${e}`)}};var h=class extends a{};var f=class extends a{static badRequest(){return new this("Bad request")}};var _t=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=Pt.default.create({prefixUrl:this.options.baseURL,hooks:{beforeRequest:[n=>{for(let s of this.options.requestFilterables){let c=s.getHeaders();for(let[Vt,ne]of Object.entries(c))n.headers.has(Vt)||n.headers.set(Vt,ne)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}async send(t,e){return await this.client(t,e).catch(n=>{if((0,re.default)(n))throw new h("A network error occurred",{cause:n});if(n instanceof Pt.HTTPError){let s=n.response.status;switch(console.error(JSON.stringify(n.response)),s){case 400:throw f.badRequest();case 401:throw g.unauthenticated();case 403:throw m.forbidden();case 404:throw l.notFound(t);case 405:throw l.forbiddenMethod(t,e.method??"GET")}}throw n})}};var St=class{constructor(t){this._transport=t}async send({account:t,files:e,request:n={}}){let s=new FormData;for(let c of e)s.append("file",c);return this._transport.send("v1/uploads",{...n,method:"POST",body:s,searchParams:{account:t}})}};var vt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var Ot=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}};var p=require("zod"),wt=class r{constructor(t){this._client=t}static SCHEMA=p.z.object({event:p.z.intersection(p.z.object({id:p.z.string(),createdAt:p.z.string().datetime()}),p.z.discriminatedUnion("type",[p.z.object({type:p.z.literal("contact.created"),contact:p.z.string()}),p.z.object({type:p.z.literal("message.created"),message:p.z.string()})]))});async event({request:t}){let{event:e}=r.SCHEMA.parse(t.body);return{event:e}}};var R=class r{static DEFAULT_BASE_URL=Ht;_transport;constructor(t,{baseURL:e,...n}={}){this._transport=new _t({requestFilterables:[new yt,t],...n,baseURL:e?.toString()??r.getBaseURL()})}static getBaseURL(){return process.env[ee]??this.DEFAULT_BASE_URL}get action(){return{list:new y(this._transport)}}get boilerplate(){return{get:new E(this._transport),list:new S(this._transport),update:new v(this._transport),create:new T(this._transport)}}get boilerplateCategory(){return{get:new I(this._transport),list:new F(this._transport),create:new w(this._transport),update:new U(this._transport),boilerplate:{list:new _(this._transport)}}}get channel(){return{get:new H(this._transport),list:new L(this._transport),update:new j(this._transport),create:new q(this._transport),compositionSection:{list:new G(this._transport)},message:{list:new at(this._transport)},twilioSendgrid:{sync:new M(this._transport)}}}get compositionSection(){return{get:new P(this._transport),list:new z(this._transport),create:new N(this._transport),update:new D(this._transport)}}get contact(){return{get:new K(this._transport),list:new V(this._transport),update:new $(this._transport),create:new k(this._transport),conversation:{list:new X(this._transport)},note:{list:new bt(this._transport),create:new ft(this._transport)},notificationSubscription:{create:new Rt(this._transport)},vcf:{get:new B(this._transport)}}}get conversation(){return{get:new J(this._transport),list:new Q(this._transport),update:new tt(this._transport),create:new x(this._transport),message:{list:new pt(this._transport)},note:{list:new At(this._transport),create:new x(this._transport)}}}get label(){return{create:new rt(this._transport),get:new st(this._transport),list:new ot(this._transport),update:new it(this._transport),delete:new nt(this._transport),contact:{list:new W(this._transport)},conversation:{list:new Z(this._transport)}}}get message(){return{list:new ct(this._transport)}}get model(){return{get:new lt(this._transport),list:new gt(this._transport),response:{create:new ht(this._transport)},correction:{create:new ut(this._transport)}}}get note(){return{get:new Ct(this._transport),update:new xt(this._transport)}}get source(){return{get:new Tt(this._transport),list:new Et(this._transport)}}get upload(){return{get:new Ot(this._transport),create:new St(this._transport),delete:new vt(this._transport)}}get webhook(){return new wt(this)}};var Kt={};Wt(Kt,{AuthError:()=>d,AuthenticationError:()=>g,AuthorizationError:()=>m,LogicError:()=>l,NetworkError:()=>h,SupportError:()=>a,ValidationError:()=>f});var It=class r{static DEFAULT_NAME=Xt;name;#t;constructor({name:t=process.env[te]??r.DEFAULT_NAME,key:e=process.env[Zt]}={}){if(!e)throw new Error("API Key option must be specified when using Key Authentication");this.name=t,this.#t=e}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#t)}`}}};var Ft=class{#t;constructor({token:t=process.env[Qt]}={}){if(!t)throw new Error("Access Token option must be specified when using Token Authentication");this.#t=t}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Bearer ${this.#t}`}}};var Ut=class{async filter(){return{headers:this.getHeaders()}}getHeaders(){return{}}};0&&(module.exports={Client,DEFAULT_SUPPORT_BASE_URL,Error,KeyAuthentication,PublicAuthentication,TokenAuthentication});
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as Authentication } from './index-CzSzQtiU.cjs';
2
- export { C as Client, e as CreateBoilerplateCategoryResponse, b as CreateBoilerplateResponse, l as CreateChannelResponse, o as CreateCompositionSectionResponse, T as CreateContactNoteResponse, a1 as CreateContactNotificationSubscriptionResponse, r as CreateContactResponse, V as CreateConversationNoteResponse, Q as CreateCorrectionResponse, D as CreateLabelResponse, S as CreateResponseResponse, a2 as CreateUploadResponse, E as DeleteLabelResponse, a4 as DeleteUploadResponse, f as GetBoilerplateCategoryResponse, G as GetBoilerplateResponse, j as GetChannelResponse, m as GetCompositionSectionResponse, s as GetContactResponse, w as GetConversationResponse, F as GetLabelResponse, N as GetModelResponse, X as GetNoteResponse, $ as GetSourceResponse, a3 as GetUploadResponse, L as ListActionsResponse, g as ListBoilerplateCategoriesResponse, c as ListBoilerplateCategoryBoilerplatesResponse, d as ListBoilerplatesResponse, p as ListChannelCompositionSectionsResponse, M as ListChannelMessagesResponse, i as ListChannelsResponse, n as ListCompositionSectionsResponse, B as ListContactConversationsResponse, Y as ListContactNotesResponse, t as ListContactsResponse, J as ListConversationMessagesResponse, Z as ListConversationNotesResponse, x as ListConversationsResponse, u as ListLabelContactsResponse, y as ListLabelConversationsResponse, H as ListLabelsResponse, K as ListMessagesResponse, P as ListModelsResponse, a0 as ListSourcesResponse, O as Options, R as RequestFilterable, a as TransportOptions, h as UpdateBoilerplateCategoryResponse, U as UpdateBoilerplateResponse, k as UpdateChannelResponse, q as UpdateCompositionSectionResponse, v as UpdateContactResponse, z as UpdateConversationResponse, I as UpdateLabelResponse, _ as UpdateNoteResponse, W as WebhookResponse, C as default } from './index-CzSzQtiU.cjs';
1
+ import { A as Authentication } from './index-D-OqS58j.cjs';
2
+ export { C as Client, e as CreateBoilerplateCategoryResponse, b as CreateBoilerplateResponse, l as CreateChannelResponse, o as CreateCompositionSectionResponse, V as CreateContactNoteResponse, a2 as CreateContactNotificationSubscriptionResponse, r as CreateContactResponse, X as CreateConversationNoteResponse, Q as CreateCorrectionResponse, D as CreateLabelResponse, S as CreateResponseResponse, a3 as CreateUploadResponse, E as DeleteLabelResponse, a5 as DeleteUploadResponse, f as GetBoilerplateCategoryResponse, G as GetBoilerplateResponse, j as GetChannelResponse, m as GetCompositionSectionResponse, s as GetContactResponse, w as GetConversationResponse, F as GetLabelResponse, N as GetModelResponse, Y as GetNoteResponse, a0 as GetSourceResponse, a4 as GetUploadResponse, L as ListActionsResponse, g as ListBoilerplateCategoriesResponse, c as ListBoilerplateCategoryBoilerplatesResponse, d as ListBoilerplatesResponse, p as ListChannelCompositionSectionsResponse, M as ListChannelMessagesResponse, i as ListChannelsResponse, n as ListCompositionSectionsResponse, B as ListContactConversationsResponse, Z as ListContactNotesResponse, t as ListContactsResponse, J as ListConversationMessagesResponse, _ as ListConversationNotesResponse, x as ListConversationsResponse, u as ListLabelContactsResponse, y as ListLabelConversationsResponse, H as ListLabelsResponse, K as ListMessagesResponse, P as ListModelsResponse, a1 as ListSourcesResponse, O as Options, R as RequestFilterable, a as TransportOptions, T as TwilioSendgridChannelSyncResponse, h as UpdateBoilerplateCategoryResponse, U as UpdateBoilerplateResponse, k as UpdateChannelResponse, q as UpdateCompositionSectionResponse, v as UpdateContactResponse, z as UpdateConversationResponse, I as UpdateLabelResponse, $ as UpdateNoteResponse, W as WebhookResponse, C as default } from './index-D-OqS58j.cjs';
3
3
  import 'ky';
4
4
  import 'zod';
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as Authentication } from './index-CzSzQtiU.js';
2
- export { C as Client, e as CreateBoilerplateCategoryResponse, b as CreateBoilerplateResponse, l as CreateChannelResponse, o as CreateCompositionSectionResponse, T as CreateContactNoteResponse, a1 as CreateContactNotificationSubscriptionResponse, r as CreateContactResponse, V as CreateConversationNoteResponse, Q as CreateCorrectionResponse, D as CreateLabelResponse, S as CreateResponseResponse, a2 as CreateUploadResponse, E as DeleteLabelResponse, a4 as DeleteUploadResponse, f as GetBoilerplateCategoryResponse, G as GetBoilerplateResponse, j as GetChannelResponse, m as GetCompositionSectionResponse, s as GetContactResponse, w as GetConversationResponse, F as GetLabelResponse, N as GetModelResponse, X as GetNoteResponse, $ as GetSourceResponse, a3 as GetUploadResponse, L as ListActionsResponse, g as ListBoilerplateCategoriesResponse, c as ListBoilerplateCategoryBoilerplatesResponse, d as ListBoilerplatesResponse, p as ListChannelCompositionSectionsResponse, M as ListChannelMessagesResponse, i as ListChannelsResponse, n as ListCompositionSectionsResponse, B as ListContactConversationsResponse, Y as ListContactNotesResponse, t as ListContactsResponse, J as ListConversationMessagesResponse, Z as ListConversationNotesResponse, x as ListConversationsResponse, u as ListLabelContactsResponse, y as ListLabelConversationsResponse, H as ListLabelsResponse, K as ListMessagesResponse, P as ListModelsResponse, a0 as ListSourcesResponse, O as Options, R as RequestFilterable, a as TransportOptions, h as UpdateBoilerplateCategoryResponse, U as UpdateBoilerplateResponse, k as UpdateChannelResponse, q as UpdateCompositionSectionResponse, v as UpdateContactResponse, z as UpdateConversationResponse, I as UpdateLabelResponse, _ as UpdateNoteResponse, W as WebhookResponse, C as default } from './index-CzSzQtiU.js';
1
+ import { A as Authentication } from './index-D-OqS58j.js';
2
+ export { C as Client, e as CreateBoilerplateCategoryResponse, b as CreateBoilerplateResponse, l as CreateChannelResponse, o as CreateCompositionSectionResponse, V as CreateContactNoteResponse, a2 as CreateContactNotificationSubscriptionResponse, r as CreateContactResponse, X as CreateConversationNoteResponse, Q as CreateCorrectionResponse, D as CreateLabelResponse, S as CreateResponseResponse, a3 as CreateUploadResponse, E as DeleteLabelResponse, a5 as DeleteUploadResponse, f as GetBoilerplateCategoryResponse, G as GetBoilerplateResponse, j as GetChannelResponse, m as GetCompositionSectionResponse, s as GetContactResponse, w as GetConversationResponse, F as GetLabelResponse, N as GetModelResponse, Y as GetNoteResponse, a0 as GetSourceResponse, a4 as GetUploadResponse, L as ListActionsResponse, g as ListBoilerplateCategoriesResponse, c as ListBoilerplateCategoryBoilerplatesResponse, d as ListBoilerplatesResponse, p as ListChannelCompositionSectionsResponse, M as ListChannelMessagesResponse, i as ListChannelsResponse, n as ListCompositionSectionsResponse, B as ListContactConversationsResponse, Z as ListContactNotesResponse, t as ListContactsResponse, J as ListConversationMessagesResponse, _ as ListConversationNotesResponse, x as ListConversationsResponse, u as ListLabelContactsResponse, y as ListLabelConversationsResponse, H as ListLabelsResponse, K as ListMessagesResponse, P as ListModelsResponse, a1 as ListSourcesResponse, O as Options, R as RequestFilterable, a as TransportOptions, T as TwilioSendgridChannelSyncResponse, h as UpdateBoilerplateCategoryResponse, U as UpdateBoilerplateResponse, k as UpdateChannelResponse, q as UpdateCompositionSectionResponse, v as UpdateContactResponse, z as UpdateConversationResponse, I as UpdateLabelResponse, $ as UpdateNoteResponse, W as WebhookResponse, C as default } from './index-D-OqS58j.js';
3
3
  import 'ky';
4
4
  import 'zod';
5
5
 
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{a as d,b as g,c as s,d as p,e as n,f as _,g as a,h as f,i as m,j as u,k as c,l as x,m as l,n as h,o as A}from"./chunk-YT5DKYBN.js";var E={};d(E,{AuthError:()=>m,AuthenticationError:()=>u,AuthorizationError:()=>c,LogicError:()=>x,NetworkError:()=>l,SupportError:()=>f,ValidationError:()=>h});var t=class e{static DEFAULT_NAME=a;name;#r;constructor({name:r=process.env[n]??e.DEFAULT_NAME,key:i=process.env[p]}={}){if(!i)throw new Error("API Key option must be specified when using Key Authentication");this.name=r,this.#r=i}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#r)}`}}};var o=class{#r;constructor({token:r=process.env[s]}={}){if(!r)throw new Error("Access Token option must be specified when using Token Authentication");this.#r=r}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Bearer ${this.#r}`}}};export{A as Client,_ as DEFAULT_SUPPORT_BASE_URL,E as Error,t as KeyAuthentication,g as PublicAuthentication,o as TokenAuthentication,A as default};
1
+ import{a as d,b as g,c as s,d as p,e as n,f as _,g as a,h as f,i as m,j as u,k as c,l as x,m as l,n as h,o as A}from"./chunk-AIPFHQNB.js";var E={};d(E,{AuthError:()=>m,AuthenticationError:()=>u,AuthorizationError:()=>c,LogicError:()=>x,NetworkError:()=>l,SupportError:()=>f,ValidationError:()=>h});var t=class e{static DEFAULT_NAME=a;name;#r;constructor({name:r=process.env[n]??e.DEFAULT_NAME,key:i=process.env[p]}={}){if(!i)throw new Error("API Key option must be specified when using Key Authentication");this.name=r,this.#r=i}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Basic ${btoa(this.name+":"+this.#r)}`}}};var o=class{#r;constructor({token:r=process.env[s]}={}){if(!r)throw new Error("Access Token option must be specified when using Token Authentication");this.#r=r}async filter(){return{headers:this.getHeaders()}}getHeaders(){return{Authorization:`Bearer ${this.#r}`}}};export{A as Client,_ as DEFAULT_SUPPORT_BASE_URL,E as Error,t as KeyAuthentication,g as PublicAuthentication,o as TokenAuthentication,A as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@great-detail/support-sdk",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "type": "module",
5
5
  "description": "JavaScript SDK for the Great Detail Support System",
6
6
  "author": "Great Detail Ltd <info@greatdetail.com>",
@@ -1 +0,0 @@
1
- var Bt=Object.defineProperty;var Wt=(r,t)=>{for(var e in t)Bt(r,e,{get:t[e],enumerable:!0})};var Ot=class{async filter(){return{headers:this.getHeaders()}}getHeaders(){return{}}};var Lt="https://api.support.greatdetail.com",Mt={"X-Powered-By":"GDSupport/JavaScript"},Jt="api-key";import{z as a}from"zod";var m=class r{constructor(t){this._client=t}static SCHEMA=a.object({event:a.intersection(a.object({id:a.string(),createdAt:a.string().datetime()}),a.discriminatedUnion("type",[a.object({type:a.literal("contact.created"),contact:a.string()}),a.object({type:a.literal("message.created"),message:a.string()})]))});async event({request:t}){let{event:e}=r.SCHEMA.parse(t.body);return{event:e}}};var h=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/actions",{...t,method:"GET"})}};import{z as f}from"zod";var C=class r{constructor(t){this._transport=t}static SCHEMA=f.object({title:f.string(),content:f.string(),account:f.string(),boilerplateCategory:f.string()});async send({body:t,request:e={}}){return this._transport.send("v1/boilerplates",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var b=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...e,method:"GET"})}};var A=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t)+"/boilerplates",{...e,method:"GET"})}};var R=class{constructor(t){this._transport=t}async send({query:t,request:e={}}={}){return this._transport.send("v1/boilerplates"+(t?"?query="+encodeURIComponent(t):""),{...e,method:"GET"})}};import{z as It}from"zod";var y=class r{constructor(t){this._transport=t}static SCHEMA=It.object({title:It.string().optional(),content:It.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/boilerplates/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};import{z as Tt}from"zod";var x=class r{constructor(t){this._transport=t}static SCHEMA=Tt.object({title:Tt.string(),description:Tt.string().optional(),account:Tt.string()});async send({body:t,request:e={}}){return this._transport.send("v1/boilerplate-categories",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var T=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...e,method:"GET"})}};var _=class{constructor(t){this._transport=t}async send({include:t,request:e={}}={}){let n=[];for(let s of Object.keys(t??{}))n.push(["include",s]);return this._transport.send("v1/boilerplate-categories",{...e,method:"GET",searchParams:n})}};import{z as Ft}from"zod";var v=class r{constructor(t){this._transport=t}static SCHEMA=Ft.object({title:Ft.string().optional(),description:Ft.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/boilerplate-categories/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};import{z as o}from"zod";var S=class r{constructor(t){this._transport=t}static SCHEMA=o.intersection(o.object({name:o.string().optional(),account:o.string()}),o.discriminatedUnion("source",[o.object({source:o.literal("meta-whatsapp")}),o.object({source:o.literal("twilio-sendgrid"),twilioSendgrid:o.object({displayName:o.string().optional(),outboundEmailAddress:o.string().email(),replyEmailAddress:o.string().optional(),inboundHostname:o.string(),apiKey:o.string()})})]));async send({body:t,request:e={}}){return this._transport.send("v1/channels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var E=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...e,method:"GET"})}};var O=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/channels",{...t,method:"GET"})}};import{z as i}from"zod";var I=class r{constructor(t){this._transport=t}static SCHEMA=i.intersection(i.object({name:i.string().optional()}),i.discriminatedUnion("source",[i.object({source:i.literal("meta-whatsapp")}),i.object({source:i.literal("twilio-sendgrid"),twilioSendgrid:i.object({displayName:i.string().optional(),outboundEmailAddress:i.string().email().optional(),replyEmailAddress:i.string().optional(),inboundHostname:i.string().optional(),apiKey:i.string().optional()})})]));async send({id:t,body:e,request:n={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};import{z as F}from"zod";var w=class r{constructor(t){this._transport=t}static SCHEMA=F.object({account:F.string(),channel:F.string().optional(),location:F.enum(["header","footer"]),content:F.string()});async send({body:t,request:e={}}){return this._transport.send("v1/composition-sections",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var U=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...e,method:"GET"})}};var q=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/composition-sections",{...e,method:"GET"})}};var H=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/composition-sections",{...t,method:"GET"})}};import{z as jt}from"zod";var L=class r{constructor(t){this._transport=t}static SCHEMA=jt.object({content:jt.string()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/composition-sections/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var Ee="SUPPORT_ACCESS_TOKEN",Oe="SUPPORT_API_KEY",Ie="SUPPORT_KEY_NAME",Gt="SUPPORT_BASE_URL";var M=class{constructor(t){this._transport=t}getRelativeURL({id:t,vcf:e={}}){let n=e.variant??"vcard",s=e.format??(e.variant==="vcard"?"vcf":"json");return"v1/contacts/"+encodeURIComponent(t)+"/vcf?variant="+encodeURIComponent(n)+"&format="+encodeURIComponent(s)}getURL(t){return this._transport.getURL(this.getRelativeURL(t))}};import{z as j}from"zod";var G=class r{constructor(t){this._transport=t}static SCHEMA=j.object({name:j.string(),account:j.string(),emailAddress:j.string().email().optional(),telephoneNumber:j.string().optional()});async send({body:t,request:e={}}){return this._transport.send("v1/contacts",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var N=class{constructor(t){this._transport=t}async send({id:t,include:e,request:n={}}){let s=[];for(let c of Object.keys(e??{}))s.push(["include",c]);return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...n,method:"GET",searchParams:s})}};var P=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/contacts",{...t,method:"GET"})}};var z=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/contacts",{...e,method:"GET"})}};import{z as _t}from"zod";var D=class r{constructor(t){this._transport=t}static SCHEMA=_t.object({name:_t.string().optional(),emailAddress:_t.string().email().optional(),telephoneNumber:_t.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var B=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...e,method:"GET"})}};var k=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/conversations",{...e,method:"GET"})}};var K=class{constructor(t){this._transport=t}async send({filter:t,include:e,request:n={}}={}){let s=[];return t&&s.push(["filter",t]),e?.latestMessage&&s.push(["include","latestMessage"]),this._transport.send("v1/conversations",{...n,method:"GET",searchParams:s})}};var V=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t)+"/conversations",{...e,method:"GET"})}};import{z as wt}from"zod";var W=class r{constructor(t){this._transport=t}static SCHEMA=wt.object({status:wt.enum(["AwaitingContactConversationStatus","AwaitingAgentConversationStatus","ResolvedConversationStatus","ClosedConversationStatus"]).optional(),hasEnded:wt.boolean().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};import{z as vt}from"zod";var Y=class r{constructor(t){this._transport=t}static SCHEMA=vt.object({title:vt.string(),description:vt.string().optional(),account:vt.string()});async send({body:t,request:e={}}){return this._transport.send("v1/labels",{...e,method:"POST",headers:{...e.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(t)})}};var $=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var J=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...e,method:"GET"})}};var X=class{constructor(t){this._transport=t}async send({include:t,request:e={}}={}){let n=[];for(let s of Object.keys(t??{}))n.push(["include",s]);return this._transport.send("v1/labels",{...e,method:"GET",searchParams:n})}};import{z as Ut}from"zod";var Q=class r{constructor(t){this._transport=t}static SCHEMA=Ut.object({title:Ut.string().optional(),description:Ut.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/labels/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var Z=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/channels/"+encodeURIComponent(t)+"/messages",{...e,method:"GET"})}};var tt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/messages",{...e,method:"GET"})}};var et=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/messages",{...t,method:"GET"})}};import{z as St}from"zod";var rt=class r{constructor(t){this._transport=t}static SCHEMA=St.object({input:St.string().max(65536),original:St.string().max(65536),correction:St.string().max(65536)});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/correction",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var nt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/models/"+encodeURIComponent(t),{...e,method:"GET"})}};var st=class{constructor(t){this._transport=t}async send({request:t={}}={}){return this._transport.send("v1/models",{...t,method:"GET"})}};import{z as Et}from"zod";var ot=class r{constructor(t){this._transport=t}static SCHEMA=Et.array(Et.object({role:Et.enum(["user","assistant"]),content:Et.string().max(65536).nullable()})).min(1);async send({id:t,body:e,request:n={}}){return this._transport.send("v1/models/"+encodeURIComponent(t)+"/response",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};import{z as Nt}from"zod";var it=class r{constructor(t){this._transport=t}static SCHEMA=Nt.object({content:Nt.string()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};import{z as Pt}from"zod";var l=class r{constructor(t){this._transport=t}static SCHEMA=Pt.object({content:Pt.string()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var at=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...e,method:"GET"})}};var pt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}};var ct=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/conversations/"+encodeURIComponent(t)+"/notes",{...e,method:"GET"})}};import{z as zt}from"zod";var dt=class r{constructor(t){this._transport=t}static SCHEMA=zt.object({content:zt.string().optional()});async send({id:t,body:e,request:n={}}){return this._transport.send("v1/notes/"+encodeURIComponent(t),{...n,method:"PATCH",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};import{z as d}from"zod";var ut=class r{constructor(t){this._transport=t}static SCHEMA=d.discriminatedUnion("type",[d.object({type:d.literal("vapid"),endpoint:d.string().url(),keys:d.object({p256dh:d.string(),auth:d.string()})})]);async send({id:t,body:e,request:n={}}){return this._transport.send("v1/contacts/"+encodeURIComponent(t)+"/notification-subscriptions",{...n,method:"POST",headers:{...n.headers,"Content-Type":"application/json"},json:r.SCHEMA.parse(e)})}};var lt=class r{constructor(t=r.STANDARD_HEADERS){this._standardHeaders=t}static STANDARD_HEADERS=Mt;async filter(){return{headers:this.getHeaders()}}getHeaders(){return this._standardHeaders}};var gt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/sources/"+encodeURIComponent(t),{...e,method:"GET"})}};var mt=class{constructor(t){this._transport=t}async send({category:t,request:e={}}={}){let n=[];if(t){let s=Array.isArray(t)?t:[t];for(let c of s)n.push(["category",c])}return this._transport.send("v1/sources",{...e,method:"GET",searchParams:n})}};import kt from"is-network-error";import Kt,{HTTPError as Vt}from"ky";var p=class extends Error{};var u=class extends p{};var ht=class extends u{static unauthenticated(){return new this("An unauthenticated request occurred")}};var ft=class extends u{static forbidden(){return new this("A forbidden request occurred")}};var g=class extends p{static notFound(t){return new this(`Record not found for request: ${t}`)}static forbiddenMethod(t,e){return new this(`Forbidden method for request: ${t} ${e}`)}};var Ct=class extends p{};var bt=class extends p{static badRequest(){return new this("Bad request")}};var At=class{client;options;constructor({baseURL:t,...e}){this.options={...e,baseURL:t},this.client=Kt.create({prefixUrl:this.options.baseURL,hooks:{beforeRequest:[n=>{for(let s of this.options.requestFilterables){let c=s.getHeaders();for(let[Ht,Dt]of Object.entries(c))n.headers.has(Ht)||n.headers.set(Ht,Dt)}}]}})}getURL(t){return new URL(t,this.options.baseURL).toString()}async send(t,e){return await this.client(t,e).catch(n=>{if(kt(n))throw new Ct("A network error occurred",{cause:n});if(n instanceof Vt){let s=n.response.status;switch(console.error(JSON.stringify(n.response)),s){case 400:throw bt.badRequest();case 401:throw ht.unauthenticated();case 403:throw ft.forbidden();case 404:throw g.notFound(t);case 405:throw g.forbiddenMethod(t,e.method??"GET")}}throw n})}};var Rt=class{constructor(t){this._transport=t}async send({account:t,files:e,request:n={}}){let s=new FormData;for(let c of e)s.append("file",c);return this._transport.send("v1/uploads",{...n,method:"POST",body:s,searchParams:{account:t}})}};var yt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"DELETE"})}};var xt=class{constructor(t){this._transport=t}async send({id:t,request:e={}}){return this._transport.send("v1/uploads/"+encodeURIComponent(t),{...e,method:"GET"})}};var qt=class r{static DEFAULT_BASE_URL=Lt;_transport;constructor(t,{baseURL:e,...n}={}){this._transport=new At({requestFilterables:[new lt,t],...n,baseURL:e?.toString()??r.getBaseURL()})}static getBaseURL(){return process.env[Gt]??this.DEFAULT_BASE_URL}get action(){return{list:new h(this._transport)}}get boilerplate(){return{get:new b(this._transport),list:new R(this._transport),update:new y(this._transport),create:new C(this._transport)}}get boilerplateCategory(){return{get:new T(this._transport),list:new _(this._transport),create:new x(this._transport),update:new v(this._transport),boilerplate:{list:new A(this._transport)}}}get channel(){return{get:new E(this._transport),list:new O(this._transport),update:new I(this._transport),create:new S(this._transport),compositionSection:{list:new q(this._transport)},message:{list:new Z(this._transport)}}}get compositionSection(){return{get:new U(this._transport),list:new H(this._transport),create:new w(this._transport),update:new L(this._transport)}}get contact(){return{get:new N(this._transport),list:new P(this._transport),update:new D(this._transport),create:new G(this._transport),conversation:{list:new k(this._transport)},note:{list:new pt(this._transport),create:new it(this._transport)},notificationSubscription:{create:new ut(this._transport)},vcf:{get:new M(this._transport)}}}get conversation(){return{get:new B(this._transport),list:new K(this._transport),update:new W(this._transport),create:new l(this._transport),message:{list:new tt(this._transport)},note:{list:new ct(this._transport),create:new l(this._transport)}}}get label(){return{create:new Y(this._transport),get:new J(this._transport),list:new X(this._transport),update:new Q(this._transport),delete:new $(this._transport),contact:{list:new z(this._transport)},conversation:{list:new V(this._transport)}}}get message(){return{list:new et(this._transport)}}get model(){return{get:new nt(this._transport),list:new st(this._transport),response:{create:new ot(this._transport)},correction:{create:new rt(this._transport)}}}get note(){return{get:new at(this._transport),update:new dt(this._transport)}}get source(){return{get:new gt(this._transport),list:new mt(this._transport)}}get upload(){return{get:new xt(this._transport),create:new Rt(this._transport),delete:new yt(this._transport)}}get webhook(){return new m(this)}};export{Wt as a,Ot as b,Ee as c,Oe as d,Ie as e,Lt as f,Jt as g,p as h,u as i,ht as j,ft as k,g as l,Ct as m,bt as n,qt as o};