@talqing/sdk 0.13.2 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1913,6 +1913,10 @@ export type CatalogResponse = {
1913
1913
  * Turn Detector Languages
1914
1914
  */
1915
1915
  turn_detector_languages: Array<LanguageOption>;
1916
+ /**
1917
+ * Whatsapp Template Languages
1918
+ */
1919
+ whatsapp_template_languages: Array<string>;
1916
1920
  };
1917
1921
 
1918
1922
  /**
@@ -3731,6 +3735,64 @@ export type CreateWhatsAppBatchRequest = {
3731
3735
  window?: TimeWindow | null;
3732
3736
  };
3733
3737
 
3738
+ /**
3739
+ * CreateWhatsAppTemplateRequest
3740
+ */
3741
+ export type CreateWhatsAppTemplateRequest = {
3742
+ /**
3743
+ * Body
3744
+ *
3745
+ * Variables are named: `{{first_name}}`.
3746
+ */
3747
+ body: string;
3748
+ /**
3749
+ * Buttons
3750
+ */
3751
+ buttons?: Array<WhatsAppTemplateQuickReplyButtonInput | WhatsAppTemplateUrlButtonInput | WhatsAppTemplatePhoneButtonInput | WhatsAppTemplateVoiceCallButtonInput | WhatsAppTemplateCopyCodeButtonInput>;
3752
+ /**
3753
+ * Category
3754
+ */
3755
+ category: 'marketing' | 'utility';
3756
+ /**
3757
+ * Examples
3758
+ *
3759
+ * A realistic sample for every variable; WhatsApp reviews them.
3760
+ */
3761
+ examples?: {
3762
+ [key: string]: string;
3763
+ };
3764
+ /**
3765
+ * Footer
3766
+ */
3767
+ footer?: string | null;
3768
+ /**
3769
+ * Header
3770
+ */
3771
+ header?: ({
3772
+ type: 'text';
3773
+ } & WhatsAppTemplateTextHeaderInput) | ({
3774
+ type: 'document' | 'image' | 'video';
3775
+ } & WhatsAppTemplateMediaHeaderInput) | null;
3776
+ /**
3777
+ * Integration Id
3778
+ *
3779
+ * A Twilio WhatsApp sender; the template is account-wide.
3780
+ */
3781
+ integration_id: string;
3782
+ /**
3783
+ * Language
3784
+ *
3785
+ * One of the catalog's `whatsapp_template_languages`.
3786
+ */
3787
+ language: string;
3788
+ /**
3789
+ * Name
3790
+ *
3791
+ * Lowercase letters, digits and `_`.
3792
+ */
3793
+ name: string;
3794
+ };
3795
+
3734
3796
  /**
3735
3797
  * CreditBalanceResponse
3736
3798
  *
@@ -13653,7 +13715,7 @@ export type WhatsAppBatchResponse = {
13653
13715
  * Status
13654
13716
  */
13655
13717
  status: 'draft' | 'scheduled' | 'sending' | 'paused' | 'completed' | 'canceled' | 'failed';
13656
- template: WhatsAppTemplate;
13718
+ template: WhatsAppTemplateSnapshot;
13657
13719
  /**
13658
13720
  * Timezone
13659
13721
  */
@@ -13774,7 +13836,7 @@ export type WhatsAppRecipientResponse = {
13774
13836
  /**
13775
13837
  * WhatsAppTemplate
13776
13838
  *
13777
- * The whole message: header, body, footer and buttons.
13839
+ * A template and where WhatsApp's review of it stands. Only `approved` can be sent.
13778
13840
  */
13779
13841
  export type WhatsAppTemplate = {
13780
13842
  /**
@@ -13788,7 +13850,17 @@ export type WhatsAppTemplate = {
13788
13850
  /**
13789
13851
  * Category
13790
13852
  */
13791
- category: string;
13853
+ category: 'marketing' | 'utility' | 'authentication';
13854
+ /**
13855
+ * Created At
13856
+ */
13857
+ created_at: string;
13858
+ /**
13859
+ * Examples
13860
+ */
13861
+ examples: {
13862
+ [key: string]: string;
13863
+ };
13792
13864
  /**
13793
13865
  * Footer
13794
13866
  */
@@ -13806,6 +13878,14 @@ export type WhatsAppTemplate = {
13806
13878
  * Name
13807
13879
  */
13808
13880
  name: string;
13881
+ /**
13882
+ * Rejection Reason
13883
+ */
13884
+ rejection_reason: string | null;
13885
+ /**
13886
+ * Status
13887
+ */
13888
+ status: 'pending' | 'approved' | 'rejected' | 'paused' | 'disabled';
13809
13889
  /**
13810
13890
  * Unsupported Reason
13811
13891
  */
@@ -13832,6 +13912,10 @@ export type WhatsAppTemplateButton = {
13832
13912
  * Text
13833
13913
  */
13834
13914
  text: string;
13915
+ /**
13916
+ * Ttl Minutes
13917
+ */
13918
+ ttl_minutes: number | null;
13835
13919
  /**
13836
13920
  * Type
13837
13921
  */
@@ -13842,6 +13926,22 @@ export type WhatsAppTemplateButton = {
13842
13926
  url: string | null;
13843
13927
  };
13844
13928
 
13929
+ /**
13930
+ * WhatsAppTemplateCopyCodeButtonInput
13931
+ *
13932
+ * WhatsApp labels it "Copy Code".
13933
+ */
13934
+ export type WhatsAppTemplateCopyCodeButtonInput = {
13935
+ /**
13936
+ * Code
13937
+ */
13938
+ code: string;
13939
+ /**
13940
+ * Type
13941
+ */
13942
+ type: 'copy_code';
13943
+ };
13944
+
13845
13945
  /**
13846
13946
  * WhatsAppTemplateHeader
13847
13947
  */
@@ -13860,6 +13960,151 @@ export type WhatsAppTemplateHeader = {
13860
13960
  url: string | null;
13861
13961
  };
13862
13962
 
13963
+ /**
13964
+ * WhatsAppTemplateMediaHeaderInput
13965
+ */
13966
+ export type WhatsAppTemplateMediaHeaderInput = {
13967
+ /**
13968
+ * Type
13969
+ */
13970
+ type: 'image' | 'video' | 'document';
13971
+ /**
13972
+ * Url
13973
+ *
13974
+ * A public https file; WhatsApp downloads it.
13975
+ */
13976
+ url: string;
13977
+ };
13978
+
13979
+ /**
13980
+ * WhatsAppTemplatePhoneButtonInput
13981
+ */
13982
+ export type WhatsAppTemplatePhoneButtonInput = {
13983
+ /**
13984
+ * Phone Number
13985
+ */
13986
+ phone_number: string;
13987
+ /**
13988
+ * Text
13989
+ */
13990
+ text: string;
13991
+ /**
13992
+ * Type
13993
+ */
13994
+ type: 'phone_number';
13995
+ };
13996
+
13997
+ /**
13998
+ * WhatsAppTemplateQuickReplyButtonInput
13999
+ */
14000
+ export type WhatsAppTemplateQuickReplyButtonInput = {
14001
+ /**
14002
+ * Text
14003
+ */
14004
+ text: string;
14005
+ /**
14006
+ * Type
14007
+ */
14008
+ type: 'quick_reply';
14009
+ };
14010
+
14011
+ /**
14012
+ * WhatsAppTemplateSnapshot
14013
+ *
14014
+ * The whole message as a batch sends it: header, body, footer and buttons.
14015
+ */
14016
+ export type WhatsAppTemplateSnapshot = {
14017
+ /**
14018
+ * Body
14019
+ */
14020
+ body: string;
14021
+ /**
14022
+ * Buttons
14023
+ */
14024
+ buttons: Array<WhatsAppTemplateButton>;
14025
+ /**
14026
+ * Category
14027
+ */
14028
+ category: 'marketing' | 'utility' | 'authentication';
14029
+ /**
14030
+ * Footer
14031
+ */
14032
+ footer: string | null;
14033
+ header: WhatsAppTemplateHeader | null;
14034
+ /**
14035
+ * Id
14036
+ */
14037
+ id: string;
14038
+ /**
14039
+ * Language
14040
+ */
14041
+ language: string;
14042
+ /**
14043
+ * Name
14044
+ */
14045
+ name: string;
14046
+ /**
14047
+ * Variables
14048
+ */
14049
+ variables: Array<string>;
14050
+ };
14051
+
14052
+ /**
14053
+ * WhatsAppTemplateTextHeaderInput
14054
+ */
14055
+ export type WhatsAppTemplateTextHeaderInput = {
14056
+ /**
14057
+ * Text
14058
+ */
14059
+ text: string;
14060
+ /**
14061
+ * Type
14062
+ */
14063
+ type: 'text';
14064
+ };
14065
+
14066
+ /**
14067
+ * WhatsAppTemplateUrlButtonInput
14068
+ */
14069
+ export type WhatsAppTemplateUrlButtonInput = {
14070
+ /**
14071
+ * Text
14072
+ */
14073
+ text: string;
14074
+ /**
14075
+ * Type
14076
+ */
14077
+ type: 'url';
14078
+ /**
14079
+ * Url
14080
+ *
14081
+ * May end in one variable, after a `/`.
14082
+ */
14083
+ url: string;
14084
+ };
14085
+
14086
+ /**
14087
+ * WhatsAppTemplateVoiceCallButtonInput
14088
+ *
14089
+ * Starts a WhatsApp call to the sending number.
14090
+ */
14091
+ export type WhatsAppTemplateVoiceCallButtonInput = {
14092
+ /**
14093
+ * Text
14094
+ */
14095
+ text: string;
14096
+ /**
14097
+ * Ttl Minutes
14098
+ *
14099
+ * How long the button works after sending. Default 7 days.
14100
+ */
14101
+ ttl_minutes?: number | null;
14102
+ /**
14103
+ * Type
14104
+ */
14105
+ type: 'voice_call';
14106
+ };
14107
+
13863
14108
  /**
13864
14109
  * WhatsAppTemplatesResponse
13865
14110
  */
@@ -23568,6 +23813,10 @@ export type WhatsappTemplatesListData = {
23568
23813
  * A connected WhatsApp sender.
23569
23814
  */
23570
23815
  integration_id: string;
23816
+ /**
23817
+ * Status
23818
+ */
23819
+ status?: Array<'pending' | 'approved' | 'rejected' | 'paused' | 'disabled'> | null;
23571
23820
  };
23572
23821
  url: '/v1/whatsapp/templates';
23573
23822
  };
@@ -23598,6 +23847,112 @@ export type WhatsappTemplatesListResults = {
23598
23847
 
23599
23848
  export type WhatsappTemplatesListResult = WhatsappTemplatesListResults[keyof WhatsappTemplatesListResults];
23600
23849
 
23850
+ export type WhatsappTemplatesCreateData = {
23851
+ body: CreateWhatsAppTemplateRequest;
23852
+ path?: never;
23853
+ query?: never;
23854
+ url: '/v1/whatsapp/templates';
23855
+ };
23856
+
23857
+ export type WhatsappTemplatesCreateErrors = {
23858
+ /**
23859
+ * Well-formed, but rejected by a rule; `detail.errors` lists each problem.
23860
+ */
23861
+ 400: ErrorResponse;
23862
+ /**
23863
+ * Missing credential, or one that is revoked or no longer a member of this organization.
23864
+ */
23865
+ 401: ErrorResponse;
23866
+ /**
23867
+ * Authenticated, but this organization role may not perform the operation.
23868
+ */
23869
+ 403: ErrorResponse;
23870
+ /**
23871
+ * The resource's current state forbids this — a name already taken, a job already running.
23872
+ */
23873
+ 409: ErrorResponse;
23874
+ /**
23875
+ * The request did not match this operation's schema; `detail.errors` lists each field.
23876
+ */
23877
+ 422: ErrorResponse;
23878
+ /**
23879
+ * Unexpected error. Every error this API returns carries this body.
23880
+ */
23881
+ default: ErrorResponse;
23882
+ };
23883
+
23884
+ export type WhatsappTemplatesCreateError = WhatsappTemplatesCreateErrors[keyof WhatsappTemplatesCreateErrors];
23885
+
23886
+ export type WhatsappTemplatesCreateResults = {
23887
+ /**
23888
+ * Successful Response
23889
+ */
23890
+ 201: WhatsAppTemplate;
23891
+ };
23892
+
23893
+ export type WhatsappTemplatesCreateResult = WhatsappTemplatesCreateResults[keyof WhatsappTemplatesCreateResults];
23894
+
23895
+ export type WhatsappTemplatesDeleteData = {
23896
+ body?: never;
23897
+ path: {
23898
+ /**
23899
+ * Template Id
23900
+ */
23901
+ template_id: string;
23902
+ };
23903
+ query: {
23904
+ /**
23905
+ * Integration Id
23906
+ *
23907
+ * A WhatsApp sender on the template's account.
23908
+ */
23909
+ integration_id: string;
23910
+ };
23911
+ url: '/v1/whatsapp/templates/{template_id}';
23912
+ };
23913
+
23914
+ export type WhatsappTemplatesDeleteErrors = {
23915
+ /**
23916
+ * Well-formed, but rejected by a rule; `detail.errors` lists each problem.
23917
+ */
23918
+ 400: ErrorResponse;
23919
+ /**
23920
+ * Missing credential, or one that is revoked or no longer a member of this organization.
23921
+ */
23922
+ 401: ErrorResponse;
23923
+ /**
23924
+ * Authenticated, but this organization role may not perform the operation.
23925
+ */
23926
+ 403: ErrorResponse;
23927
+ /**
23928
+ * No such resource in this organization.
23929
+ */
23930
+ 404: ErrorResponse;
23931
+ /**
23932
+ * The resource's current state forbids this — a name already taken, a job already running.
23933
+ */
23934
+ 409: ErrorResponse;
23935
+ /**
23936
+ * The request did not match this operation's schema; `detail.errors` lists each field.
23937
+ */
23938
+ 422: ErrorResponse;
23939
+ /**
23940
+ * Unexpected error. Every error this API returns carries this body.
23941
+ */
23942
+ default: ErrorResponse;
23943
+ };
23944
+
23945
+ export type WhatsappTemplatesDeleteError = WhatsappTemplatesDeleteErrors[keyof WhatsappTemplatesDeleteErrors];
23946
+
23947
+ export type WhatsappTemplatesDeleteResults = {
23948
+ /**
23949
+ * Successful Response
23950
+ */
23951
+ 200: OkResponse;
23952
+ };
23953
+
23954
+ export type WhatsappTemplatesDeleteResult = WhatsappTemplatesDeleteResults[keyof WhatsappTemplatesDeleteResults];
23955
+
23601
23956
  export type WhatsappTwilioSendersListData = {
23602
23957
  body: TwilioSendersRequest;
23603
23958
  path?: never;