@talqing/sdk 0.13.1 → 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
  /**
@@ -3598,6 +3602,16 @@ export type CreateTelephonyAccountRequest = {
3598
3602
  provider: 'plivo' | 'exotel' | 'vobiz' | 'twilio';
3599
3603
  };
3600
3604
 
3605
+ /**
3606
+ * CreateTokenRequest
3607
+ */
3608
+ export type CreateTokenRequest = {
3609
+ /**
3610
+ * Name
3611
+ */
3612
+ name: string;
3613
+ };
3614
+
3601
3615
  /**
3602
3616
  * CreateToolRequest
3603
3617
  */
@@ -3721,6 +3735,64 @@ export type CreateWhatsAppBatchRequest = {
3721
3735
  window?: TimeWindow | null;
3722
3736
  };
3723
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
+
3724
3796
  /**
3725
3797
  * CreditBalanceResponse
3726
3798
  *
@@ -8135,6 +8207,28 @@ export type PageTelephonyProviderSpec = {
8135
8207
  offset: number;
8136
8208
  };
8137
8209
 
8210
+ /**
8211
+ * Page[TokenResponse]
8212
+ */
8213
+ export type PageTokenResponse = {
8214
+ /**
8215
+ * Has More
8216
+ */
8217
+ has_more: boolean;
8218
+ /**
8219
+ * Items
8220
+ */
8221
+ items: Array<TokenResponse>;
8222
+ /**
8223
+ * Limit
8224
+ */
8225
+ limit: number;
8226
+ /**
8227
+ * Offset
8228
+ */
8229
+ offset: number;
8230
+ };
8231
+
8138
8232
  /**
8139
8233
  * Page[ToolResponse]
8140
8234
  */
@@ -12403,6 +12497,40 @@ export type TimeWindow = {
12403
12497
  start: string;
12404
12498
  };
12405
12499
 
12500
+ /**
12501
+ * TokenCreatedResponse
12502
+ */
12503
+ export type TokenCreatedResponse = {
12504
+ /**
12505
+ * Created At
12506
+ */
12507
+ created_at: string;
12508
+ /**
12509
+ * Id
12510
+ */
12511
+ id: string;
12512
+ /**
12513
+ * Kind
12514
+ */
12515
+ kind: 'manual' | 'mcp';
12516
+ /**
12517
+ * Name
12518
+ */
12519
+ name: string;
12520
+ /**
12521
+ * Token
12522
+ */
12523
+ token: string;
12524
+ /**
12525
+ * User Email
12526
+ */
12527
+ user_email: string;
12528
+ /**
12529
+ * User Id
12530
+ */
12531
+ user_id: string;
12532
+ };
12533
+
12406
12534
  /**
12407
12535
  * TokenRequest
12408
12536
  *
@@ -12468,6 +12596,36 @@ export type TokenRequest = {
12468
12596
  } | null;
12469
12597
  };
12470
12598
 
12599
+ /**
12600
+ * TokenResponse
12601
+ */
12602
+ export type TokenResponse = {
12603
+ /**
12604
+ * Created At
12605
+ */
12606
+ created_at: string;
12607
+ /**
12608
+ * Id
12609
+ */
12610
+ id: string;
12611
+ /**
12612
+ * Kind
12613
+ */
12614
+ kind: 'manual' | 'mcp';
12615
+ /**
12616
+ * Name
12617
+ */
12618
+ name: string;
12619
+ /**
12620
+ * User Email
12621
+ */
12622
+ user_email: string;
12623
+ /**
12624
+ * User Id
12625
+ */
12626
+ user_id: string;
12627
+ };
12628
+
12471
12629
  /**
12472
12630
  * ToolResponse
12473
12631
  */
@@ -13557,7 +13715,7 @@ export type WhatsAppBatchResponse = {
13557
13715
  * Status
13558
13716
  */
13559
13717
  status: 'draft' | 'scheduled' | 'sending' | 'paused' | 'completed' | 'canceled' | 'failed';
13560
- template: WhatsAppTemplate;
13718
+ template: WhatsAppTemplateSnapshot;
13561
13719
  /**
13562
13720
  * Timezone
13563
13721
  */
@@ -13678,7 +13836,7 @@ export type WhatsAppRecipientResponse = {
13678
13836
  /**
13679
13837
  * WhatsAppTemplate
13680
13838
  *
13681
- * The whole message: header, body, footer and buttons.
13839
+ * A template and where WhatsApp's review of it stands. Only `approved` can be sent.
13682
13840
  */
13683
13841
  export type WhatsAppTemplate = {
13684
13842
  /**
@@ -13692,7 +13850,17 @@ export type WhatsAppTemplate = {
13692
13850
  /**
13693
13851
  * Category
13694
13852
  */
13695
- 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
+ };
13696
13864
  /**
13697
13865
  * Footer
13698
13866
  */
@@ -13710,6 +13878,14 @@ export type WhatsAppTemplate = {
13710
13878
  * Name
13711
13879
  */
13712
13880
  name: string;
13881
+ /**
13882
+ * Rejection Reason
13883
+ */
13884
+ rejection_reason: string | null;
13885
+ /**
13886
+ * Status
13887
+ */
13888
+ status: 'pending' | 'approved' | 'rejected' | 'paused' | 'disabled';
13713
13889
  /**
13714
13890
  * Unsupported Reason
13715
13891
  */
@@ -13736,6 +13912,10 @@ export type WhatsAppTemplateButton = {
13736
13912
  * Text
13737
13913
  */
13738
13914
  text: string;
13915
+ /**
13916
+ * Ttl Minutes
13917
+ */
13918
+ ttl_minutes: number | null;
13739
13919
  /**
13740
13920
  * Type
13741
13921
  */
@@ -13746,6 +13926,22 @@ export type WhatsAppTemplateButton = {
13746
13926
  url: string | null;
13747
13927
  };
13748
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
+
13749
13945
  /**
13750
13946
  * WhatsAppTemplateHeader
13751
13947
  */
@@ -13764,6 +13960,151 @@ export type WhatsAppTemplateHeader = {
13764
13960
  url: string | null;
13765
13961
  };
13766
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
+
13767
14108
  /**
13768
14109
  * WhatsAppTemplatesResponse
13769
14110
  */
@@ -21769,6 +22110,139 @@ export type TelephonyProvidersListResults = {
21769
22110
 
21770
22111
  export type TelephonyProvidersListResult = TelephonyProvidersListResults[keyof TelephonyProvidersListResults];
21771
22112
 
22113
+ export type TokensListData = {
22114
+ body?: never;
22115
+ path?: never;
22116
+ query?: {
22117
+ /**
22118
+ * Limit
22119
+ */
22120
+ limit?: number;
22121
+ /**
22122
+ * Offset
22123
+ */
22124
+ offset?: number;
22125
+ };
22126
+ url: '/v1/tokens';
22127
+ };
22128
+
22129
+ export type TokensListErrors = {
22130
+ /**
22131
+ * Missing credential, or one that is revoked or no longer a member of this organization.
22132
+ */
22133
+ 401: ErrorResponse;
22134
+ /**
22135
+ * The request did not match this operation's schema; `detail.errors` lists each field.
22136
+ */
22137
+ 422: ErrorResponse;
22138
+ /**
22139
+ * Unexpected error. Every error this API returns carries this body.
22140
+ */
22141
+ default: ErrorResponse;
22142
+ };
22143
+
22144
+ export type TokensListError = TokensListErrors[keyof TokensListErrors];
22145
+
22146
+ export type TokensListResults = {
22147
+ /**
22148
+ * Successful Response
22149
+ */
22150
+ 200: PageTokenResponse;
22151
+ };
22152
+
22153
+ export type TokensListResult = TokensListResults[keyof TokensListResults];
22154
+
22155
+ export type TokensCreateData = {
22156
+ body: CreateTokenRequest;
22157
+ path?: never;
22158
+ query?: never;
22159
+ url: '/v1/tokens';
22160
+ };
22161
+
22162
+ export type TokensCreateErrors = {
22163
+ /**
22164
+ * Well-formed, but rejected by a rule; `detail.errors` lists each problem.
22165
+ */
22166
+ 400: ErrorResponse;
22167
+ /**
22168
+ * Missing credential, or one that is revoked or no longer a member of this organization.
22169
+ */
22170
+ 401: ErrorResponse;
22171
+ /**
22172
+ * The resource's current state forbids this — a name already taken, a job already running.
22173
+ */
22174
+ 409: ErrorResponse;
22175
+ /**
22176
+ * The request did not match this operation's schema; `detail.errors` lists each field.
22177
+ */
22178
+ 422: ErrorResponse;
22179
+ /**
22180
+ * Unexpected error. Every error this API returns carries this body.
22181
+ */
22182
+ default: ErrorResponse;
22183
+ };
22184
+
22185
+ export type TokensCreateError = TokensCreateErrors[keyof TokensCreateErrors];
22186
+
22187
+ export type TokensCreateResults = {
22188
+ /**
22189
+ * Successful Response
22190
+ */
22191
+ 201: TokenCreatedResponse;
22192
+ };
22193
+
22194
+ export type TokensCreateResult = TokensCreateResults[keyof TokensCreateResults];
22195
+
22196
+ export type TokensDeleteData = {
22197
+ body?: never;
22198
+ path: {
22199
+ /**
22200
+ * Token Id
22201
+ */
22202
+ token_id: string;
22203
+ };
22204
+ query?: never;
22205
+ url: '/v1/tokens/{token_id}';
22206
+ };
22207
+
22208
+ export type TokensDeleteErrors = {
22209
+ /**
22210
+ * Well-formed, but rejected by a rule; `detail.errors` lists each problem.
22211
+ */
22212
+ 400: ErrorResponse;
22213
+ /**
22214
+ * Missing credential, or one that is revoked or no longer a member of this organization.
22215
+ */
22216
+ 401: ErrorResponse;
22217
+ /**
22218
+ * No such resource in this organization.
22219
+ */
22220
+ 404: ErrorResponse;
22221
+ /**
22222
+ * The resource's current state forbids this — a name already taken, a job already running.
22223
+ */
22224
+ 409: ErrorResponse;
22225
+ /**
22226
+ * The request did not match this operation's schema; `detail.errors` lists each field.
22227
+ */
22228
+ 422: ErrorResponse;
22229
+ /**
22230
+ * Unexpected error. Every error this API returns carries this body.
22231
+ */
22232
+ default: ErrorResponse;
22233
+ };
22234
+
22235
+ export type TokensDeleteError = TokensDeleteErrors[keyof TokensDeleteErrors];
22236
+
22237
+ export type TokensDeleteResults = {
22238
+ /**
22239
+ * Successful Response
22240
+ */
22241
+ 200: OkResponse;
22242
+ };
22243
+
22244
+ export type TokensDeleteResult = TokensDeleteResults[keyof TokensDeleteResults];
22245
+
21772
22246
  export type ToolsListData = {
21773
22247
  body?: never;
21774
22248
  path?: never;
@@ -23339,6 +23813,10 @@ export type WhatsappTemplatesListData = {
23339
23813
  * A connected WhatsApp sender.
23340
23814
  */
23341
23815
  integration_id: string;
23816
+ /**
23817
+ * Status
23818
+ */
23819
+ status?: Array<'pending' | 'approved' | 'rejected' | 'paused' | 'disabled'> | null;
23342
23820
  };
23343
23821
  url: '/v1/whatsapp/templates';
23344
23822
  };
@@ -23369,6 +23847,112 @@ export type WhatsappTemplatesListResults = {
23369
23847
 
23370
23848
  export type WhatsappTemplatesListResult = WhatsappTemplatesListResults[keyof WhatsappTemplatesListResults];
23371
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
+
23372
23956
  export type WhatsappTwilioSendersListData = {
23373
23957
  body: TwilioSendersRequest;
23374
23958
  path?: never;