@zernio/node 0.2.663 → 0.2.665
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/README.md +3 -0
- package/dist/index.d.mts +189 -8
- package/dist/index.d.ts +189 -8
- package/dist/index.js +22 -1
- package/dist/index.mjs +22 -1
- package/package.json +1 -1
- package/src/client.ts +6 -0
- package/src/generated/sdk.gen.ts +77 -11
- package/src/generated/types.gen.ts +194 -7
|
@@ -7891,7 +7891,7 @@ export type event15 = 'message.delivered' | 'message.read' | 'message.failed';
|
|
|
7891
7891
|
/**
|
|
7892
7892
|
* Webhook payload for message.edited events. Fires when the sender
|
|
7893
7893
|
* edits a previously-sent message. Supported platforms: Instagram,
|
|
7894
|
-
* Facebook Messenger, Telegram. The message object reflects the
|
|
7894
|
+
* Facebook Messenger, Telegram, WhatsApp. The message object reflects the
|
|
7895
7895
|
* LATEST state; editHistory contains every prior version in order
|
|
7896
7896
|
* (oldest first), so the last entry is the version immediately before
|
|
7897
7897
|
* the current content.
|
|
@@ -21369,6 +21369,15 @@ export type GetWhatsAppTemplatesData = {
|
|
|
21369
21369
|
* WhatsApp social account ID
|
|
21370
21370
|
*/
|
|
21371
21371
|
accountId: string;
|
|
21372
|
+
/**
|
|
21373
|
+
* Exact language code (e.g. en_US).
|
|
21374
|
+
*/
|
|
21375
|
+
language?: string;
|
|
21376
|
+
/**
|
|
21377
|
+
* Exact template name; returns every language variant of that family.
|
|
21378
|
+
*/
|
|
21379
|
+
name?: string;
|
|
21380
|
+
status?: 'APPROVED' | 'REJECTED' | 'PENDING' | 'PAUSED' | 'DISABLED' | 'IN_APPEAL' | 'PENDING_DELETION';
|
|
21372
21381
|
};
|
|
21373
21382
|
};
|
|
21374
21383
|
|
|
@@ -21471,7 +21480,7 @@ export type CreateWhatsAppTemplateError = (unknown | {
|
|
|
21471
21480
|
export type GetWhatsAppTemplateData = {
|
|
21472
21481
|
path: {
|
|
21473
21482
|
/**
|
|
21474
|
-
* Template name
|
|
21483
|
+
* Template name (the family).
|
|
21475
21484
|
*/
|
|
21476
21485
|
templateName: string;
|
|
21477
21486
|
};
|
|
@@ -21480,25 +21489,53 @@ export type GetWhatsAppTemplateData = {
|
|
|
21480
21489
|
* WhatsApp social account ID
|
|
21481
21490
|
*/
|
|
21482
21491
|
accountId: string;
|
|
21492
|
+
/**
|
|
21493
|
+
* Language code of the variant (e.g. en_US, es, pt_BR). Required when the family has several languages.
|
|
21494
|
+
*/
|
|
21495
|
+
language?: string;
|
|
21483
21496
|
};
|
|
21484
21497
|
};
|
|
21485
21498
|
|
|
21486
21499
|
export type GetWhatsAppTemplateResponse = ({
|
|
21487
21500
|
success?: boolean;
|
|
21488
21501
|
template?: {
|
|
21502
|
+
/**
|
|
21503
|
+
* Meta template id. Unique per language variant; usable on /v1/whatsapp/templates/id/{templateId}.
|
|
21504
|
+
*/
|
|
21489
21505
|
id?: string;
|
|
21490
21506
|
name?: string;
|
|
21491
21507
|
status?: string;
|
|
21492
21508
|
category?: string;
|
|
21509
|
+
/**
|
|
21510
|
+
* The variant actually returned.
|
|
21511
|
+
*/
|
|
21493
21512
|
language?: string;
|
|
21494
21513
|
components?: Array<{
|
|
21495
21514
|
[key: string]: unknown;
|
|
21496
21515
|
}>;
|
|
21516
|
+
/**
|
|
21517
|
+
* Only when status is REJECTED.
|
|
21518
|
+
*/
|
|
21519
|
+
rejected_reason?: string;
|
|
21520
|
+
/**
|
|
21521
|
+
* Post-approval quality (GREEN/YELLOW/RED), when Meta reports one.
|
|
21522
|
+
*/
|
|
21523
|
+
quality_score?: {
|
|
21524
|
+
[key: string]: unknown;
|
|
21525
|
+
};
|
|
21497
21526
|
};
|
|
21498
21527
|
});
|
|
21499
21528
|
|
|
21500
|
-
export type GetWhatsAppTemplateError = (
|
|
21529
|
+
export type GetWhatsAppTemplateError = (ErrorResponse | {
|
|
21530
|
+
error?: string;
|
|
21531
|
+
} | unknown | {
|
|
21501
21532
|
error?: string;
|
|
21533
|
+
type?: 'invalid_request_error';
|
|
21534
|
+
code?: 'ambiguous_template';
|
|
21535
|
+
param?: 'language';
|
|
21536
|
+
details?: {
|
|
21537
|
+
languages?: Array<(string)>;
|
|
21538
|
+
};
|
|
21502
21539
|
});
|
|
21503
21540
|
|
|
21504
21541
|
export type UpdateWhatsAppTemplateData = {
|
|
@@ -21507,6 +21544,10 @@ export type UpdateWhatsAppTemplateData = {
|
|
|
21507
21544
|
* WhatsApp social account ID
|
|
21508
21545
|
*/
|
|
21509
21546
|
accountId: string;
|
|
21547
|
+
/**
|
|
21548
|
+
* Language code of the variant to edit (e.g. en_US, es, pt_BR). Required when the family has several languages. Body only: a language query parameter on PATCH is a 400.
|
|
21549
|
+
*/
|
|
21550
|
+
language?: string;
|
|
21510
21551
|
/**
|
|
21511
21552
|
* Updated template components
|
|
21512
21553
|
*/
|
|
@@ -21514,7 +21555,7 @@ export type UpdateWhatsAppTemplateData = {
|
|
|
21514
21555
|
};
|
|
21515
21556
|
path: {
|
|
21516
21557
|
/**
|
|
21517
|
-
* Template name
|
|
21558
|
+
* Template name (the family).
|
|
21518
21559
|
*/
|
|
21519
21560
|
templateName: string;
|
|
21520
21561
|
};
|
|
@@ -21523,8 +21564,15 @@ export type UpdateWhatsAppTemplateData = {
|
|
|
21523
21564
|
export type UpdateWhatsAppTemplateResponse = ({
|
|
21524
21565
|
success?: boolean;
|
|
21525
21566
|
template?: {
|
|
21567
|
+
/**
|
|
21568
|
+
* Meta id of the edited variant.
|
|
21569
|
+
*/
|
|
21526
21570
|
id?: string;
|
|
21527
21571
|
name?: string;
|
|
21572
|
+
/**
|
|
21573
|
+
* The variant that was edited.
|
|
21574
|
+
*/
|
|
21575
|
+
language?: string;
|
|
21528
21576
|
/**
|
|
21529
21577
|
* Approval state read back from Meta after the update, normally PENDING. If the state cannot be read back, the last known status is returned instead.
|
|
21530
21578
|
*/
|
|
@@ -21532,14 +21580,22 @@ export type UpdateWhatsAppTemplateResponse = ({
|
|
|
21532
21580
|
};
|
|
21533
21581
|
});
|
|
21534
21582
|
|
|
21535
|
-
export type UpdateWhatsAppTemplateError = (
|
|
21583
|
+
export type UpdateWhatsAppTemplateError = (ErrorResponse | {
|
|
21536
21584
|
error?: string;
|
|
21585
|
+
} | unknown | {
|
|
21586
|
+
error?: string;
|
|
21587
|
+
type?: 'invalid_request_error';
|
|
21588
|
+
code?: 'ambiguous_template';
|
|
21589
|
+
param?: 'language';
|
|
21590
|
+
details?: {
|
|
21591
|
+
languages?: Array<(string)>;
|
|
21592
|
+
};
|
|
21537
21593
|
});
|
|
21538
21594
|
|
|
21539
21595
|
export type DeleteWhatsAppTemplateData = {
|
|
21540
21596
|
path: {
|
|
21541
21597
|
/**
|
|
21542
|
-
* Template name
|
|
21598
|
+
* Template name (the family).
|
|
21543
21599
|
*/
|
|
21544
21600
|
templateName: string;
|
|
21545
21601
|
};
|
|
@@ -21548,18 +21604,149 @@ export type DeleteWhatsAppTemplateData = {
|
|
|
21548
21604
|
* WhatsApp social account ID
|
|
21549
21605
|
*/
|
|
21550
21606
|
accountId: string;
|
|
21607
|
+
/**
|
|
21608
|
+
* Delete only this language variant (e.g. es). Omit to delete the whole family.
|
|
21609
|
+
*/
|
|
21610
|
+
language?: string;
|
|
21551
21611
|
};
|
|
21552
21612
|
};
|
|
21553
21613
|
|
|
21554
21614
|
export type DeleteWhatsAppTemplateResponse = ({
|
|
21555
21615
|
success?: boolean;
|
|
21616
|
+
/**
|
|
21617
|
+
* Whether the whole family or one variant was deleted.
|
|
21618
|
+
*/
|
|
21619
|
+
scope?: 'all_languages' | 'language';
|
|
21620
|
+
/**
|
|
21621
|
+
* The deleted variant; only when scope is language.
|
|
21622
|
+
*/
|
|
21623
|
+
language?: string;
|
|
21556
21624
|
message?: string;
|
|
21557
21625
|
});
|
|
21558
21626
|
|
|
21559
|
-
export type DeleteWhatsAppTemplateError = (
|
|
21627
|
+
export type DeleteWhatsAppTemplateError = (ErrorResponse | {
|
|
21628
|
+
error?: string;
|
|
21629
|
+
} | unknown | {
|
|
21630
|
+
error?: string;
|
|
21631
|
+
type?: 'invalid_request_error';
|
|
21632
|
+
code?: 'ambiguous_template';
|
|
21633
|
+
param?: 'language';
|
|
21634
|
+
details?: {
|
|
21635
|
+
languages?: Array<(string)>;
|
|
21636
|
+
};
|
|
21637
|
+
});
|
|
21638
|
+
|
|
21639
|
+
export type GetWhatsAppTemplateByIdData = {
|
|
21640
|
+
path: {
|
|
21641
|
+
/**
|
|
21642
|
+
* Meta template id (numeric).
|
|
21643
|
+
*/
|
|
21644
|
+
templateId: string;
|
|
21645
|
+
};
|
|
21646
|
+
query: {
|
|
21647
|
+
/**
|
|
21648
|
+
* WhatsApp social account ID
|
|
21649
|
+
*/
|
|
21650
|
+
accountId: string;
|
|
21651
|
+
};
|
|
21652
|
+
};
|
|
21653
|
+
|
|
21654
|
+
export type GetWhatsAppTemplateByIdResponse = ({
|
|
21655
|
+
success?: boolean;
|
|
21656
|
+
template?: {
|
|
21657
|
+
/**
|
|
21658
|
+
* Meta template id. Unique per language variant; usable on /v1/whatsapp/templates/id/{templateId}.
|
|
21659
|
+
*/
|
|
21660
|
+
id?: string;
|
|
21661
|
+
name?: string;
|
|
21662
|
+
status?: string;
|
|
21663
|
+
category?: string;
|
|
21664
|
+
/**
|
|
21665
|
+
* The variant actually returned.
|
|
21666
|
+
*/
|
|
21667
|
+
language?: string;
|
|
21668
|
+
components?: Array<{
|
|
21669
|
+
[key: string]: unknown;
|
|
21670
|
+
}>;
|
|
21671
|
+
/**
|
|
21672
|
+
* Only when status is REJECTED.
|
|
21673
|
+
*/
|
|
21674
|
+
rejected_reason?: string;
|
|
21675
|
+
/**
|
|
21676
|
+
* Post-approval quality (GREEN/YELLOW/RED), when Meta reports one.
|
|
21677
|
+
*/
|
|
21678
|
+
quality_score?: {
|
|
21679
|
+
[key: string]: unknown;
|
|
21680
|
+
};
|
|
21681
|
+
};
|
|
21682
|
+
});
|
|
21683
|
+
|
|
21684
|
+
export type GetWhatsAppTemplateByIdError = (ErrorResponse | {
|
|
21560
21685
|
error?: string;
|
|
21686
|
+
} | unknown);
|
|
21687
|
+
|
|
21688
|
+
export type UpdateWhatsAppTemplateByIdData = {
|
|
21689
|
+
body: {
|
|
21690
|
+
/**
|
|
21691
|
+
* WhatsApp social account ID
|
|
21692
|
+
*/
|
|
21693
|
+
accountId: string;
|
|
21694
|
+
/**
|
|
21695
|
+
* Updated template components
|
|
21696
|
+
*/
|
|
21697
|
+
components: Array<WhatsAppTemplateComponent>;
|
|
21698
|
+
};
|
|
21699
|
+
path: {
|
|
21700
|
+
/**
|
|
21701
|
+
* Meta template id (numeric).
|
|
21702
|
+
*/
|
|
21703
|
+
templateId: string;
|
|
21704
|
+
};
|
|
21705
|
+
};
|
|
21706
|
+
|
|
21707
|
+
export type UpdateWhatsAppTemplateByIdResponse = ({
|
|
21708
|
+
success?: boolean;
|
|
21709
|
+
template?: {
|
|
21710
|
+
id?: string;
|
|
21711
|
+
name?: string;
|
|
21712
|
+
language?: string;
|
|
21713
|
+
/**
|
|
21714
|
+
* Approval state read back from Meta after the update, normally PENDING. If the state cannot be read back, the last known status is returned instead.
|
|
21715
|
+
*/
|
|
21716
|
+
status?: string;
|
|
21717
|
+
};
|
|
21561
21718
|
});
|
|
21562
21719
|
|
|
21720
|
+
export type UpdateWhatsAppTemplateByIdError = (ErrorResponse | {
|
|
21721
|
+
error?: string;
|
|
21722
|
+
} | unknown);
|
|
21723
|
+
|
|
21724
|
+
export type DeleteWhatsAppTemplateByIdData = {
|
|
21725
|
+
path: {
|
|
21726
|
+
/**
|
|
21727
|
+
* Meta template id (numeric).
|
|
21728
|
+
*/
|
|
21729
|
+
templateId: string;
|
|
21730
|
+
};
|
|
21731
|
+
query: {
|
|
21732
|
+
/**
|
|
21733
|
+
* WhatsApp social account ID
|
|
21734
|
+
*/
|
|
21735
|
+
accountId: string;
|
|
21736
|
+
};
|
|
21737
|
+
};
|
|
21738
|
+
|
|
21739
|
+
export type DeleteWhatsAppTemplateByIdResponse = ({
|
|
21740
|
+
success?: boolean;
|
|
21741
|
+
scope?: 'language';
|
|
21742
|
+
language?: string;
|
|
21743
|
+
message?: string;
|
|
21744
|
+
});
|
|
21745
|
+
|
|
21746
|
+
export type DeleteWhatsAppTemplateByIdError = (ErrorResponse | {
|
|
21747
|
+
error?: string;
|
|
21748
|
+
} | unknown);
|
|
21749
|
+
|
|
21563
21750
|
export type GetWhatsAppCallingConfigData = {
|
|
21564
21751
|
query: {
|
|
21565
21752
|
/**
|