@droz-js/sdk 0.9.22 → 0.9.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sdks/drozcommons.d.ts +1 -1
- package/src/sdks/nucleus.d.ts +1 -1
- package/src/sdks/whatsapp.d.ts +154 -0
- package/src/sdks/whatsapp.js +108 -1
- package/src/whatsapp.d.ts +14 -0
package/package.json
CHANGED
|
@@ -269,7 +269,7 @@ export type Mutation = {
|
|
|
269
269
|
deploy: Deployment;
|
|
270
270
|
destroy: Deployment;
|
|
271
271
|
joinTenantAsSuperAdmin?: Maybe<Scalars['String']['output']>;
|
|
272
|
-
leaveTenantOrganization?: Maybe<Scalars['
|
|
272
|
+
leaveTenantOrganization?: Maybe<Scalars['Void']['output']>;
|
|
273
273
|
removeAccountParameter?: Maybe<Parameter>;
|
|
274
274
|
removeGlobalParameter?: Maybe<Parameter>;
|
|
275
275
|
removeTenant: Tenant;
|
package/src/sdks/nucleus.d.ts
CHANGED
|
@@ -454,7 +454,7 @@ export type Mutation = {
|
|
|
454
454
|
editStateMachineConfig?: Maybe<StateMachineConfig>;
|
|
455
455
|
getOrCreateCustomer: Customer;
|
|
456
456
|
joinAsSuperAdmin?: Maybe<Scalars['String']['output']>;
|
|
457
|
-
leaveOrganization?: Maybe<Scalars['
|
|
457
|
+
leaveOrganization?: Maybe<Scalars['Void']['output']>;
|
|
458
458
|
patchSessionAttributes?: Maybe<Scalars['JSON']['output']>;
|
|
459
459
|
publishStateMachineConfig?: Maybe<StateMachineConfig>;
|
|
460
460
|
registerAppInstance: AppInstance;
|
package/src/sdks/whatsapp.d.ts
CHANGED
|
@@ -143,6 +143,19 @@ export type CreateWhatsAppInstanceInput = {
|
|
|
143
143
|
name: Scalars['String']['input'];
|
|
144
144
|
phoneNumberId: Scalars['String']['input'];
|
|
145
145
|
};
|
|
146
|
+
export type CreateWhatsAppTemplateInput = {
|
|
147
|
+
category: TemplateCategory;
|
|
148
|
+
components: TemplateComponentsInput;
|
|
149
|
+
credentialId: Scalars['String']['input'];
|
|
150
|
+
language: Scalars['String']['input'];
|
|
151
|
+
name: Scalars['String']['input'];
|
|
152
|
+
};
|
|
153
|
+
export type EditWhatsAppTemplateInput = {
|
|
154
|
+
category?: InputMaybe<TemplateCategory>;
|
|
155
|
+
components?: InputMaybe<TemplateComponentsInput>;
|
|
156
|
+
credentialId: Scalars['String']['input'];
|
|
157
|
+
id: Scalars['ID']['input'];
|
|
158
|
+
};
|
|
146
159
|
export type I18nText = {
|
|
147
160
|
lang: Scalars['Locale']['output'];
|
|
148
161
|
value: Scalars['String']['output'];
|
|
@@ -153,6 +166,8 @@ export type I18nTextInput = {
|
|
|
153
166
|
};
|
|
154
167
|
export type Mutation = {
|
|
155
168
|
createWhatsAppInstance?: Maybe<WhatsAppInstance>;
|
|
169
|
+
createWhatsAppTemplate?: Maybe<WhatsAppTemplate>;
|
|
170
|
+
editWhatsAppTemplate?: Maybe<Scalars['Void']['output']>;
|
|
156
171
|
removeWhatsAppInstance?: Maybe<WhatsAppInstance>;
|
|
157
172
|
updateWhatsAppInstance?: Maybe<WhatsAppInstance>;
|
|
158
173
|
version?: Maybe<Scalars['String']['output']>;
|
|
@@ -160,6 +175,12 @@ export type Mutation = {
|
|
|
160
175
|
export type MutationCreateWhatsAppInstanceArgs = {
|
|
161
176
|
input: CreateWhatsAppInstanceInput;
|
|
162
177
|
};
|
|
178
|
+
export type MutationCreateWhatsAppTemplateArgs = {
|
|
179
|
+
input: CreateWhatsAppTemplateInput;
|
|
180
|
+
};
|
|
181
|
+
export type MutationEditWhatsAppTemplateArgs = {
|
|
182
|
+
input: EditWhatsAppTemplateInput;
|
|
183
|
+
};
|
|
163
184
|
export type MutationRemoveWhatsAppInstanceArgs = {
|
|
164
185
|
input: RemoveWhatsAppInstanceInput;
|
|
165
186
|
};
|
|
@@ -192,16 +213,26 @@ export type Query = {
|
|
|
192
213
|
app?: Maybe<Scalars['DRN']['output']>;
|
|
193
214
|
getHttpEndpoint?: Maybe<Scalars['String']['output']>;
|
|
194
215
|
getWhatsAppInstance?: Maybe<WhatsAppInstance>;
|
|
216
|
+
getWhatsAppTemplate?: Maybe<WhatsAppTemplate>;
|
|
195
217
|
listWhatsAppInstances?: Maybe<Array<Maybe<WhatsAppInstance>>>;
|
|
196
218
|
listWhatsAppPhoneNumbers?: Maybe<Array<Maybe<WhatsAppPhoneNumber>>>;
|
|
219
|
+
listWhatsAppTemplates?: Maybe<Array<Maybe<WhatsAppTemplate>>>;
|
|
197
220
|
version?: Maybe<Scalars['String']['output']>;
|
|
198
221
|
};
|
|
199
222
|
export type QueryGetWhatsAppInstanceArgs = {
|
|
200
223
|
id: Scalars['ID']['input'];
|
|
201
224
|
};
|
|
225
|
+
export type QueryGetWhatsAppTemplateArgs = {
|
|
226
|
+
credentialsId: Scalars['ID']['input'];
|
|
227
|
+
id: Scalars['ID']['input'];
|
|
228
|
+
};
|
|
202
229
|
export type QueryListWhatsAppPhoneNumbersArgs = {
|
|
203
230
|
credentialsId: Scalars['ID']['input'];
|
|
204
231
|
};
|
|
232
|
+
export type QueryListWhatsAppTemplatesArgs = {
|
|
233
|
+
credentialsId: Scalars['ID']['input'];
|
|
234
|
+
status?: InputMaybe<TemplateStatus>;
|
|
235
|
+
};
|
|
205
236
|
export type RemoveWhatsAppInstanceInput = {
|
|
206
237
|
id: Scalars['ID']['input'];
|
|
207
238
|
};
|
|
@@ -252,6 +283,75 @@ export type StringMatcherInput = {
|
|
|
252
283
|
lte?: InputMaybe<Scalars['String']['input']>;
|
|
253
284
|
ne?: InputMaybe<Scalars['String']['input']>;
|
|
254
285
|
};
|
|
286
|
+
export type TemplateBaseComponent = {
|
|
287
|
+
example?: Maybe<Array<Scalars['String']['output']>>;
|
|
288
|
+
text: Scalars['String']['output'];
|
|
289
|
+
};
|
|
290
|
+
export type TemplateBaseComponentInput = {
|
|
291
|
+
example?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
292
|
+
text: Scalars['String']['input'];
|
|
293
|
+
};
|
|
294
|
+
export type TemplateButtonsComponent = {
|
|
295
|
+
example?: Maybe<Array<Scalars['String']['output']>>;
|
|
296
|
+
text: Scalars['String']['output'];
|
|
297
|
+
type: TemplateButtonsType;
|
|
298
|
+
url?: Maybe<Scalars['String']['output']>;
|
|
299
|
+
};
|
|
300
|
+
export type TemplateButtonsComponentInput = {
|
|
301
|
+
example?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
302
|
+
text: Scalars['String']['input'];
|
|
303
|
+
type: TemplateButtonsType;
|
|
304
|
+
url?: InputMaybe<Scalars['String']['input']>;
|
|
305
|
+
};
|
|
306
|
+
export declare enum TemplateButtonsType {
|
|
307
|
+
CopyCode = "COPY_CODE",
|
|
308
|
+
QuickReply = "QUICK_REPLY",
|
|
309
|
+
Url = "URL"
|
|
310
|
+
}
|
|
311
|
+
export declare enum TemplateCategory {
|
|
312
|
+
Authentication = "AUTHENTICATION",
|
|
313
|
+
Marketing = "MARKETING",
|
|
314
|
+
Utility = "UTILITY"
|
|
315
|
+
}
|
|
316
|
+
export declare enum TemplateComponentType {
|
|
317
|
+
Body = "BODY",
|
|
318
|
+
Buttons = "BUTTONS",
|
|
319
|
+
Footer = "FOOTER",
|
|
320
|
+
Header = "HEADER"
|
|
321
|
+
}
|
|
322
|
+
export type TemplateComponents = {
|
|
323
|
+
body: TemplateBaseComponent;
|
|
324
|
+
buttons?: Maybe<Array<Maybe<TemplateButtonsComponent>>>;
|
|
325
|
+
footer?: Maybe<TemplateBaseComponent>;
|
|
326
|
+
header?: Maybe<TemplateHeaderComponent>;
|
|
327
|
+
};
|
|
328
|
+
export type TemplateComponentsInput = {
|
|
329
|
+
body: TemplateBaseComponentInput;
|
|
330
|
+
buttons?: InputMaybe<Array<InputMaybe<TemplateButtonsComponentInput>>>;
|
|
331
|
+
footer?: InputMaybe<TemplateBaseComponentInput>;
|
|
332
|
+
header?: InputMaybe<TemplateHeaderComponentInput>;
|
|
333
|
+
};
|
|
334
|
+
export type TemplateHeaderComponent = {
|
|
335
|
+
example?: Maybe<Array<Scalars['String']['output']>>;
|
|
336
|
+
format: TemplateHeaderFormat;
|
|
337
|
+
text: Scalars['String']['output'];
|
|
338
|
+
};
|
|
339
|
+
export declare enum TemplateHeaderFormat {
|
|
340
|
+
Document = "DOCUMENT",
|
|
341
|
+
Image = "IMAGE",
|
|
342
|
+
Text = "TEXT",
|
|
343
|
+
Video = "VIDEO"
|
|
344
|
+
}
|
|
345
|
+
export declare enum TemplateStatus {
|
|
346
|
+
Approved = "APPROVED",
|
|
347
|
+
Deleted = "DELETED",
|
|
348
|
+
InAppeal = "IN_APPEAL",
|
|
349
|
+
LimitExceeded = "LIMIT_EXCEEDED",
|
|
350
|
+
Paused = "PAUSED",
|
|
351
|
+
Pending = "PENDING",
|
|
352
|
+
PendingDeletion = "PENDING_DELETION",
|
|
353
|
+
Rejected = "REJECTED"
|
|
354
|
+
}
|
|
255
355
|
export declare enum Typenames {
|
|
256
356
|
Any = "Any",
|
|
257
357
|
GraphqlConnections = "GraphqlConnections",
|
|
@@ -278,7 +378,28 @@ export type WhatsAppPhoneNumber = {
|
|
|
278
378
|
displayPhoneNumber: Scalars['String']['output'];
|
|
279
379
|
id: Scalars['String']['output'];
|
|
280
380
|
};
|
|
381
|
+
export type WhatsAppTemplate = {
|
|
382
|
+
category: TemplateCategory;
|
|
383
|
+
components: TemplateComponents;
|
|
384
|
+
id: Scalars['ID']['output'];
|
|
385
|
+
language: Scalars['String']['output'];
|
|
386
|
+
name: Scalars['String']['output'];
|
|
387
|
+
status: TemplateStatus;
|
|
388
|
+
};
|
|
389
|
+
export type TemplateHeaderComponentInput = {
|
|
390
|
+
example?: InputMaybe<Array<Scalars['String']['input']>>;
|
|
391
|
+
format: TemplateHeaderFormat;
|
|
392
|
+
text: Scalars['String']['input'];
|
|
393
|
+
};
|
|
281
394
|
export type WhatsappInstanceFragment = Pick<WhatsAppInstance, 'id' | 'name' | 'drn' | 'phoneNumberId' | 'wabaId' | 'credentialsId' | 'createdAt' | 'updatedAt'>;
|
|
395
|
+
export type WhatsAppTemplateFragment = (Pick<WhatsAppTemplate, 'id' | 'name' | 'category' | 'status'> & {
|
|
396
|
+
components: {
|
|
397
|
+
body: Pick<TemplateBaseComponent, 'example' | 'text'>;
|
|
398
|
+
header?: Maybe<Pick<TemplateHeaderComponent, 'text' | 'example' | 'format'>>;
|
|
399
|
+
footer?: Maybe<Pick<TemplateBaseComponent, 'text' | 'example'>>;
|
|
400
|
+
buttons?: Maybe<Array<Maybe<Pick<TemplateButtonsComponent, 'example' | 'text' | 'type' | 'url'>>>>;
|
|
401
|
+
};
|
|
402
|
+
});
|
|
282
403
|
export type WhatsAppPhoneNumberFragment = Pick<WhatsAppPhoneNumber, 'id' | 'displayPhoneNumber'>;
|
|
283
404
|
export type GetWhatsAppInstanceQueryVariables = Exact<{
|
|
284
405
|
id: Scalars['ID']['input'];
|
|
@@ -298,6 +419,20 @@ export type ListWhatsAppPhoneNumbersQueryVariables = Exact<{
|
|
|
298
419
|
export type ListWhatsAppPhoneNumbersQuery = {
|
|
299
420
|
listWhatsAppPhoneNumbers?: Maybe<Array<Maybe<WhatsAppPhoneNumberFragment>>>;
|
|
300
421
|
};
|
|
422
|
+
export type ListWhatsAppTemplatesQueryVariables = Exact<{
|
|
423
|
+
credentialsId: Scalars['ID']['input'];
|
|
424
|
+
status?: InputMaybe<TemplateStatus>;
|
|
425
|
+
}>;
|
|
426
|
+
export type ListWhatsAppTemplatesQuery = {
|
|
427
|
+
listWhatsAppTemplates?: Maybe<Array<Maybe<WhatsAppTemplateFragment>>>;
|
|
428
|
+
};
|
|
429
|
+
export type GetWhatsAppTemplateQueryVariables = Exact<{
|
|
430
|
+
id: Scalars['ID']['input'];
|
|
431
|
+
credentialsId: Scalars['ID']['input'];
|
|
432
|
+
}>;
|
|
433
|
+
export type GetWhatsAppTemplateQuery = {
|
|
434
|
+
getWhatsAppTemplate?: Maybe<WhatsAppTemplateFragment>;
|
|
435
|
+
};
|
|
301
436
|
export type CreateWhatsAppInstanceMutationVariables = Exact<{
|
|
302
437
|
input: CreateWhatsAppInstanceInput;
|
|
303
438
|
}>;
|
|
@@ -316,22 +451,41 @@ export type RemoveWhatsAppInstanceMutationVariables = Exact<{
|
|
|
316
451
|
export type RemoveWhatsAppInstanceMutation = {
|
|
317
452
|
removeWhatsAppInstance?: Maybe<WhatsappInstanceFragment>;
|
|
318
453
|
};
|
|
454
|
+
export type CreateWhatsAppTemplateMutationVariables = Exact<{
|
|
455
|
+
input: CreateWhatsAppTemplateInput;
|
|
456
|
+
}>;
|
|
457
|
+
export type CreateWhatsAppTemplateMutation = {
|
|
458
|
+
createWhatsAppTemplate?: Maybe<Pick<WhatsAppTemplate, 'id' | 'name' | 'status' | 'category'>>;
|
|
459
|
+
};
|
|
460
|
+
export type EditWhatsAppTemplateMutationVariables = Exact<{
|
|
461
|
+
input: EditWhatsAppTemplateInput;
|
|
462
|
+
}>;
|
|
463
|
+
export type EditWhatsAppTemplateMutation = Pick<Mutation, 'editWhatsAppTemplate'>;
|
|
319
464
|
export declare const WhatsappInstanceFragmentDoc = "\n fragment whatsappInstance on WhatsAppInstance {\n id\n name\n drn\n phoneNumberId\n wabaId\n credentialsId\n createdAt\n updatedAt\n}\n ";
|
|
465
|
+
export declare const WhatsAppTemplateFragmentDoc = "\n fragment whatsAppTemplate on WhatsAppTemplate {\n id\n name\n category\n status\n components {\n body {\n example\n text\n }\n header {\n text\n example\n format\n }\n footer {\n text\n example\n }\n buttons {\n example\n text\n type\n url\n }\n }\n}\n ";
|
|
320
466
|
export declare const WhatsAppPhoneNumberFragmentDoc = "\n fragment whatsAppPhoneNumber on WhatsAppPhoneNumber {\n id\n displayPhoneNumber\n}\n ";
|
|
321
467
|
export declare const GetWhatsAppInstanceDocument = "\n query getWhatsAppInstance($id: ID!) {\n getWhatsAppInstance(id: $id) {\n ...whatsappInstance\n }\n}\n \n fragment whatsappInstance on WhatsAppInstance {\n id\n name\n drn\n phoneNumberId\n wabaId\n credentialsId\n createdAt\n updatedAt\n}\n ";
|
|
322
468
|
export declare const ListWhatsAppInstancesDocument = "\n query listWhatsAppInstances {\n listWhatsAppInstances {\n ...whatsappInstance\n }\n}\n \n fragment whatsappInstance on WhatsAppInstance {\n id\n name\n drn\n phoneNumberId\n wabaId\n credentialsId\n createdAt\n updatedAt\n}\n ";
|
|
323
469
|
export declare const ListWhatsAppPhoneNumbersDocument = "\n query listWhatsAppPhoneNumbers($credentialsId: ID!) {\n listWhatsAppPhoneNumbers(credentialsId: $credentialsId) {\n ...whatsAppPhoneNumber\n }\n}\n \n fragment whatsAppPhoneNumber on WhatsAppPhoneNumber {\n id\n displayPhoneNumber\n}\n ";
|
|
470
|
+
export declare const ListWhatsAppTemplatesDocument = "\n query listWhatsAppTemplates($credentialsId: ID!, $status: TemplateStatus) {\n listWhatsAppTemplates(credentialsId: $credentialsId, status: $status) {\n ...whatsAppTemplate\n }\n}\n \n fragment whatsAppTemplate on WhatsAppTemplate {\n id\n name\n category\n status\n components {\n body {\n example\n text\n }\n header {\n text\n example\n format\n }\n footer {\n text\n example\n }\n buttons {\n example\n text\n type\n url\n }\n }\n}\n ";
|
|
471
|
+
export declare const GetWhatsAppTemplateDocument = "\n query getWhatsAppTemplate($id: ID!, $credentialsId: ID!) {\n getWhatsAppTemplate(id: $id, credentialsId: $credentialsId) {\n ...whatsAppTemplate\n }\n}\n \n fragment whatsAppTemplate on WhatsAppTemplate {\n id\n name\n category\n status\n components {\n body {\n example\n text\n }\n header {\n text\n example\n format\n }\n footer {\n text\n example\n }\n buttons {\n example\n text\n type\n url\n }\n }\n}\n ";
|
|
324
472
|
export declare const CreateWhatsAppInstanceDocument = "\n mutation createWhatsAppInstance($input: CreateWhatsAppInstanceInput!) {\n createWhatsAppInstance(input: $input) {\n ...whatsappInstance\n }\n}\n \n fragment whatsappInstance on WhatsAppInstance {\n id\n name\n drn\n phoneNumberId\n wabaId\n credentialsId\n createdAt\n updatedAt\n}\n ";
|
|
325
473
|
export declare const UpdateWhatsAppInstanceDocument = "\n mutation updateWhatsAppInstance($input: UpdateWhatsAppInstanceInput!) {\n updateWhatsAppInstance(input: $input) {\n ...whatsappInstance\n }\n}\n \n fragment whatsappInstance on WhatsAppInstance {\n id\n name\n drn\n phoneNumberId\n wabaId\n credentialsId\n createdAt\n updatedAt\n}\n ";
|
|
326
474
|
export declare const RemoveWhatsAppInstanceDocument = "\n mutation removeWhatsAppInstance($input: RemoveWhatsAppInstanceInput!) {\n removeWhatsAppInstance(input: $input) {\n ...whatsappInstance\n }\n}\n \n fragment whatsappInstance on WhatsAppInstance {\n id\n name\n drn\n phoneNumberId\n wabaId\n credentialsId\n createdAt\n updatedAt\n}\n ";
|
|
475
|
+
export declare const CreateWhatsAppTemplateDocument = "\n mutation createWhatsAppTemplate($input: CreateWhatsAppTemplateInput!) {\n createWhatsAppTemplate(input: $input) {\n id\n name\n status\n category\n }\n}\n ";
|
|
476
|
+
export declare const EditWhatsAppTemplateDocument = "\n mutation editWhatsAppTemplate($input: EditWhatsAppTemplateInput!) {\n editWhatsAppTemplate(input: $input)\n}\n ";
|
|
327
477
|
export type Requester<C = {}> = <R, V>(doc: string, vars?: V, options?: C) => Promise<R> | AsyncIterableIterator<R>;
|
|
328
478
|
export declare function getSdk<C>(requester: Requester<C>): {
|
|
329
479
|
getWhatsAppInstance(variables: GetWhatsAppInstanceQueryVariables, options?: C): Promise<GetWhatsAppInstanceQuery>;
|
|
330
480
|
listWhatsAppInstances(variables?: ListWhatsAppInstancesQueryVariables, options?: C): Promise<ListWhatsAppInstancesQuery>;
|
|
331
481
|
listWhatsAppPhoneNumbers(variables: ListWhatsAppPhoneNumbersQueryVariables, options?: C): Promise<ListWhatsAppPhoneNumbersQuery>;
|
|
482
|
+
listWhatsAppTemplates(variables: ListWhatsAppTemplatesQueryVariables, options?: C): Promise<ListWhatsAppTemplatesQuery>;
|
|
483
|
+
getWhatsAppTemplate(variables: GetWhatsAppTemplateQueryVariables, options?: C): Promise<GetWhatsAppTemplateQuery>;
|
|
332
484
|
createWhatsAppInstance(variables: CreateWhatsAppInstanceMutationVariables, options?: C): Promise<CreateWhatsAppInstanceMutation>;
|
|
333
485
|
updateWhatsAppInstance(variables: UpdateWhatsAppInstanceMutationVariables, options?: C): Promise<UpdateWhatsAppInstanceMutation>;
|
|
334
486
|
removeWhatsAppInstance(variables: RemoveWhatsAppInstanceMutationVariables, options?: C): Promise<RemoveWhatsAppInstanceMutation>;
|
|
487
|
+
createWhatsAppTemplate(variables: CreateWhatsAppTemplateMutationVariables, options?: C): Promise<CreateWhatsAppTemplateMutation>;
|
|
488
|
+
editWhatsAppTemplate(variables: EditWhatsAppTemplateMutationVariables, options?: C): Promise<EditWhatsAppTemplateMutation>;
|
|
335
489
|
};
|
|
336
490
|
export type Sdk = ReturnType<typeof getSdk>;
|
|
337
491
|
export declare const serviceName = "@droz/whatsapp";
|
package/src/sdks/whatsapp.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* istanbul ignore file */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.serviceName = exports.RemoveWhatsAppInstanceDocument = exports.UpdateWhatsAppInstanceDocument = exports.CreateWhatsAppInstanceDocument = exports.ListWhatsAppPhoneNumbersDocument = exports.ListWhatsAppInstancesDocument = exports.GetWhatsAppInstanceDocument = exports.WhatsAppPhoneNumberFragmentDoc = exports.WhatsappInstanceFragmentDoc = exports.Typenames = exports.Can = exports.AppInstanceStatus = void 0;
|
|
4
|
+
exports.serviceName = exports.EditWhatsAppTemplateDocument = exports.CreateWhatsAppTemplateDocument = exports.RemoveWhatsAppInstanceDocument = exports.UpdateWhatsAppInstanceDocument = exports.CreateWhatsAppInstanceDocument = exports.GetWhatsAppTemplateDocument = exports.ListWhatsAppTemplatesDocument = exports.ListWhatsAppPhoneNumbersDocument = exports.ListWhatsAppInstancesDocument = exports.GetWhatsAppInstanceDocument = exports.WhatsAppPhoneNumberFragmentDoc = exports.WhatsAppTemplateFragmentDoc = exports.WhatsappInstanceFragmentDoc = exports.Typenames = exports.TemplateStatus = exports.TemplateHeaderFormat = exports.TemplateComponentType = exports.TemplateCategory = exports.TemplateButtonsType = exports.Can = exports.AppInstanceStatus = void 0;
|
|
5
5
|
exports.getSdk = getSdk;
|
|
6
6
|
var AppInstanceStatus;
|
|
7
7
|
(function (AppInstanceStatus) {
|
|
@@ -16,6 +16,43 @@ var Can;
|
|
|
16
16
|
Can["Remove"] = "remove";
|
|
17
17
|
Can["Write"] = "write";
|
|
18
18
|
})(Can || (exports.Can = Can = {}));
|
|
19
|
+
var TemplateButtonsType;
|
|
20
|
+
(function (TemplateButtonsType) {
|
|
21
|
+
TemplateButtonsType["CopyCode"] = "COPY_CODE";
|
|
22
|
+
TemplateButtonsType["QuickReply"] = "QUICK_REPLY";
|
|
23
|
+
TemplateButtonsType["Url"] = "URL";
|
|
24
|
+
})(TemplateButtonsType || (exports.TemplateButtonsType = TemplateButtonsType = {}));
|
|
25
|
+
var TemplateCategory;
|
|
26
|
+
(function (TemplateCategory) {
|
|
27
|
+
TemplateCategory["Authentication"] = "AUTHENTICATION";
|
|
28
|
+
TemplateCategory["Marketing"] = "MARKETING";
|
|
29
|
+
TemplateCategory["Utility"] = "UTILITY";
|
|
30
|
+
})(TemplateCategory || (exports.TemplateCategory = TemplateCategory = {}));
|
|
31
|
+
var TemplateComponentType;
|
|
32
|
+
(function (TemplateComponentType) {
|
|
33
|
+
TemplateComponentType["Body"] = "BODY";
|
|
34
|
+
TemplateComponentType["Buttons"] = "BUTTONS";
|
|
35
|
+
TemplateComponentType["Footer"] = "FOOTER";
|
|
36
|
+
TemplateComponentType["Header"] = "HEADER";
|
|
37
|
+
})(TemplateComponentType || (exports.TemplateComponentType = TemplateComponentType = {}));
|
|
38
|
+
var TemplateHeaderFormat;
|
|
39
|
+
(function (TemplateHeaderFormat) {
|
|
40
|
+
TemplateHeaderFormat["Document"] = "DOCUMENT";
|
|
41
|
+
TemplateHeaderFormat["Image"] = "IMAGE";
|
|
42
|
+
TemplateHeaderFormat["Text"] = "TEXT";
|
|
43
|
+
TemplateHeaderFormat["Video"] = "VIDEO";
|
|
44
|
+
})(TemplateHeaderFormat || (exports.TemplateHeaderFormat = TemplateHeaderFormat = {}));
|
|
45
|
+
var TemplateStatus;
|
|
46
|
+
(function (TemplateStatus) {
|
|
47
|
+
TemplateStatus["Approved"] = "APPROVED";
|
|
48
|
+
TemplateStatus["Deleted"] = "DELETED";
|
|
49
|
+
TemplateStatus["InAppeal"] = "IN_APPEAL";
|
|
50
|
+
TemplateStatus["LimitExceeded"] = "LIMIT_EXCEEDED";
|
|
51
|
+
TemplateStatus["Paused"] = "PAUSED";
|
|
52
|
+
TemplateStatus["Pending"] = "PENDING";
|
|
53
|
+
TemplateStatus["PendingDeletion"] = "PENDING_DELETION";
|
|
54
|
+
TemplateStatus["Rejected"] = "REJECTED";
|
|
55
|
+
})(TemplateStatus || (exports.TemplateStatus = TemplateStatus = {}));
|
|
19
56
|
var Typenames;
|
|
20
57
|
(function (Typenames) {
|
|
21
58
|
Typenames["Any"] = "Any";
|
|
@@ -35,6 +72,35 @@ exports.WhatsappInstanceFragmentDoc = `
|
|
|
35
72
|
updatedAt
|
|
36
73
|
}
|
|
37
74
|
`;
|
|
75
|
+
exports.WhatsAppTemplateFragmentDoc = `
|
|
76
|
+
fragment whatsAppTemplate on WhatsAppTemplate {
|
|
77
|
+
id
|
|
78
|
+
name
|
|
79
|
+
category
|
|
80
|
+
status
|
|
81
|
+
components {
|
|
82
|
+
body {
|
|
83
|
+
example
|
|
84
|
+
text
|
|
85
|
+
}
|
|
86
|
+
header {
|
|
87
|
+
text
|
|
88
|
+
example
|
|
89
|
+
format
|
|
90
|
+
}
|
|
91
|
+
footer {
|
|
92
|
+
text
|
|
93
|
+
example
|
|
94
|
+
}
|
|
95
|
+
buttons {
|
|
96
|
+
example
|
|
97
|
+
text
|
|
98
|
+
type
|
|
99
|
+
url
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
`;
|
|
38
104
|
exports.WhatsAppPhoneNumberFragmentDoc = `
|
|
39
105
|
fragment whatsAppPhoneNumber on WhatsAppPhoneNumber {
|
|
40
106
|
id
|
|
@@ -62,6 +128,20 @@ exports.ListWhatsAppPhoneNumbersDocument = `
|
|
|
62
128
|
}
|
|
63
129
|
}
|
|
64
130
|
${exports.WhatsAppPhoneNumberFragmentDoc}`;
|
|
131
|
+
exports.ListWhatsAppTemplatesDocument = `
|
|
132
|
+
query listWhatsAppTemplates($credentialsId: ID!, $status: TemplateStatus) {
|
|
133
|
+
listWhatsAppTemplates(credentialsId: $credentialsId, status: $status) {
|
|
134
|
+
...whatsAppTemplate
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
${exports.WhatsAppTemplateFragmentDoc}`;
|
|
138
|
+
exports.GetWhatsAppTemplateDocument = `
|
|
139
|
+
query getWhatsAppTemplate($id: ID!, $credentialsId: ID!) {
|
|
140
|
+
getWhatsAppTemplate(id: $id, credentialsId: $credentialsId) {
|
|
141
|
+
...whatsAppTemplate
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
${exports.WhatsAppTemplateFragmentDoc}`;
|
|
65
145
|
exports.CreateWhatsAppInstanceDocument = `
|
|
66
146
|
mutation createWhatsAppInstance($input: CreateWhatsAppInstanceInput!) {
|
|
67
147
|
createWhatsAppInstance(input: $input) {
|
|
@@ -83,6 +163,21 @@ exports.RemoveWhatsAppInstanceDocument = `
|
|
|
83
163
|
}
|
|
84
164
|
}
|
|
85
165
|
${exports.WhatsappInstanceFragmentDoc}`;
|
|
166
|
+
exports.CreateWhatsAppTemplateDocument = `
|
|
167
|
+
mutation createWhatsAppTemplate($input: CreateWhatsAppTemplateInput!) {
|
|
168
|
+
createWhatsAppTemplate(input: $input) {
|
|
169
|
+
id
|
|
170
|
+
name
|
|
171
|
+
status
|
|
172
|
+
category
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
`;
|
|
176
|
+
exports.EditWhatsAppTemplateDocument = `
|
|
177
|
+
mutation editWhatsAppTemplate($input: EditWhatsAppTemplateInput!) {
|
|
178
|
+
editWhatsAppTemplate(input: $input)
|
|
179
|
+
}
|
|
180
|
+
`;
|
|
86
181
|
function getSdk(requester) {
|
|
87
182
|
return {
|
|
88
183
|
getWhatsAppInstance(variables, options) {
|
|
@@ -94,6 +189,12 @@ function getSdk(requester) {
|
|
|
94
189
|
listWhatsAppPhoneNumbers(variables, options) {
|
|
95
190
|
return requester(exports.ListWhatsAppPhoneNumbersDocument, variables, options);
|
|
96
191
|
},
|
|
192
|
+
listWhatsAppTemplates(variables, options) {
|
|
193
|
+
return requester(exports.ListWhatsAppTemplatesDocument, variables, options);
|
|
194
|
+
},
|
|
195
|
+
getWhatsAppTemplate(variables, options) {
|
|
196
|
+
return requester(exports.GetWhatsAppTemplateDocument, variables, options);
|
|
197
|
+
},
|
|
97
198
|
createWhatsAppInstance(variables, options) {
|
|
98
199
|
return requester(exports.CreateWhatsAppInstanceDocument, variables, options);
|
|
99
200
|
},
|
|
@@ -102,6 +203,12 @@ function getSdk(requester) {
|
|
|
102
203
|
},
|
|
103
204
|
removeWhatsAppInstance(variables, options) {
|
|
104
205
|
return requester(exports.RemoveWhatsAppInstanceDocument, variables, options);
|
|
206
|
+
},
|
|
207
|
+
createWhatsAppTemplate(variables, options) {
|
|
208
|
+
return requester(exports.CreateWhatsAppTemplateDocument, variables, options);
|
|
209
|
+
},
|
|
210
|
+
editWhatsAppTemplate(variables, options) {
|
|
211
|
+
return requester(exports.EditWhatsAppTemplateDocument, variables, options);
|
|
105
212
|
}
|
|
106
213
|
};
|
|
107
214
|
}
|
package/src/whatsapp.d.ts
CHANGED
|
@@ -15,6 +15,14 @@ declare const WhatsApp_base: new (options?: import("./client/http").HttpClientOp
|
|
|
15
15
|
listWhatsAppPhoneNumbers(variables: import("./sdks/whatsapp").Exact<{
|
|
16
16
|
credentialsId: import("./sdks/whatsapp").Scalars["ID"]["input"];
|
|
17
17
|
}>, options?: unknown): Promise<import("./sdks/whatsapp").ListWhatsAppPhoneNumbersQuery>;
|
|
18
|
+
listWhatsAppTemplates(variables: import("./sdks/whatsapp").Exact<{
|
|
19
|
+
credentialsId: import("./sdks/whatsapp").Scalars["ID"]["input"];
|
|
20
|
+
status?: import("./sdks/whatsapp").InputMaybe<import("./sdks/whatsapp").TemplateStatus>;
|
|
21
|
+
}>, options?: unknown): Promise<import("./sdks/whatsapp").ListWhatsAppTemplatesQuery>;
|
|
22
|
+
getWhatsAppTemplate(variables: import("./sdks/whatsapp").Exact<{
|
|
23
|
+
id: import("./sdks/whatsapp").Scalars["ID"]["input"];
|
|
24
|
+
credentialsId: import("./sdks/whatsapp").Scalars["ID"]["input"];
|
|
25
|
+
}>, options?: unknown): Promise<import("./sdks/whatsapp").GetWhatsAppTemplateQuery>;
|
|
18
26
|
createWhatsAppInstance(variables: import("./sdks/whatsapp").Exact<{
|
|
19
27
|
input: import("./sdks/whatsapp").CreateWhatsAppInstanceInput;
|
|
20
28
|
}>, options?: unknown): Promise<import("./sdks/whatsapp").CreateWhatsAppInstanceMutation>;
|
|
@@ -24,6 +32,12 @@ declare const WhatsApp_base: new (options?: import("./client/http").HttpClientOp
|
|
|
24
32
|
removeWhatsAppInstance(variables: import("./sdks/whatsapp").Exact<{
|
|
25
33
|
input: import("./sdks/whatsapp").RemoveWhatsAppInstanceInput;
|
|
26
34
|
}>, options?: unknown): Promise<import("./sdks/whatsapp").RemoveWhatsAppInstanceMutation>;
|
|
35
|
+
createWhatsAppTemplate(variables: import("./sdks/whatsapp").Exact<{
|
|
36
|
+
input: import("./sdks/whatsapp").CreateWhatsAppTemplateInput;
|
|
37
|
+
}>, options?: unknown): Promise<import("./sdks/whatsapp").CreateWhatsAppTemplateMutation>;
|
|
38
|
+
editWhatsAppTemplate(variables: import("./sdks/whatsapp").Exact<{
|
|
39
|
+
input: import("./sdks/whatsapp").EditWhatsAppTemplateInput;
|
|
40
|
+
}>, options?: unknown): Promise<import("./sdks/whatsapp").EditWhatsAppTemplateMutation>;
|
|
27
41
|
};
|
|
28
42
|
export declare class WhatsApp extends WhatsApp_base {
|
|
29
43
|
}
|