@talqing/sdk 0.6.0 → 0.8.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.
@@ -1,6 +1,39 @@
1
1
  export type ClientOptions = {
2
2
  baseUrl: `${string}://${string}` | (string & {});
3
3
  };
4
+ /**
5
+ * AddEmailRecipientsRequest
6
+ */
7
+ export type AddEmailRecipientsRequest = {
8
+ /**
9
+ * Recipients
10
+ */
11
+ recipients: Array<EmailRecipientInput>;
12
+ };
13
+ /**
14
+ * AddEmailRecipientsResponse
15
+ *
16
+ * `standing_send_id` is the send of every row that will mail the new rows
17
+ * without review, or null when they wait for review.
18
+ */
19
+ export type AddEmailRecipientsResponse = {
20
+ /**
21
+ * Added
22
+ */
23
+ added: number;
24
+ /**
25
+ * Skipped
26
+ */
27
+ skipped: Array<SkippedEmailRecipient>;
28
+ /**
29
+ * Standing Send Id
30
+ */
31
+ standing_send_id: string | null;
32
+ /**
33
+ * Total Recipients
34
+ */
35
+ total_recipients: number;
36
+ };
4
37
  /**
5
38
  * AddMessageConfig
6
39
  */
@@ -38,9 +71,10 @@ export type AddRecipientsRequest = {
38
71
  *
39
72
  * What appending to a batch did.
40
73
  *
41
- * Numbers already in the batch are skipped and reported rather than rejected:
42
- * re-uploading a list the operator re-exported is the normal case, and the
43
- * never-call-twice guarantee doing its job is not a user error.
74
+ * Numbers already in the batch, or repeated in the request, are skipped and
75
+ * reported rather than rejected: re-uploading a list the operator re-exported
76
+ * is the normal case, and the never-call-twice guarantee doing its job is not a
77
+ * user error.
44
78
  */
45
79
  export type AddRecipientsResponse = {
46
80
  /**
@@ -82,6 +116,32 @@ export type AddVoiceResponse = {
82
116
  */
83
117
  voice_id: string;
84
118
  };
119
+ /**
120
+ * AddWhatsAppRecipientsRequest
121
+ */
122
+ export type AddWhatsAppRecipientsRequest = {
123
+ /**
124
+ * Recipients
125
+ */
126
+ recipients: Array<WhatsAppRecipientInput>;
127
+ };
128
+ /**
129
+ * AddWhatsAppRecipientsResponse
130
+ */
131
+ export type AddWhatsAppRecipientsResponse = {
132
+ /**
133
+ * Added
134
+ */
135
+ added: number;
136
+ /**
137
+ * Skipped
138
+ */
139
+ skipped: Array<SkippedWhatsAppRecipient>;
140
+ /**
141
+ * Total Recipients
142
+ */
143
+ total_recipients: number;
144
+ };
85
145
  /**
86
146
  * AgentConfig
87
147
  *
@@ -1216,6 +1276,26 @@ export type CallBatchResponse = {
1216
1276
  * Created At
1217
1277
  */
1218
1278
  created_at: string;
1279
+ /**
1280
+ * Dial Daily Cap
1281
+ */
1282
+ dial_daily_cap: ({
1283
+ kind: 'fixed';
1284
+ } & FixedDailyCap) | ({
1285
+ kind: 'ramp';
1286
+ } & RampDailyCap) | null;
1287
+ /**
1288
+ * Dial Daily Cap Today
1289
+ */
1290
+ dial_daily_cap_today: number | null;
1291
+ /**
1292
+ * Dial Gap Seconds
1293
+ */
1294
+ dial_gap_seconds: number;
1295
+ /**
1296
+ * Dialed Today
1297
+ */
1298
+ dialed_today: number;
1219
1299
  /**
1220
1300
  * Ended At
1221
1301
  */
@@ -1252,6 +1332,10 @@ export type CallBatchResponse = {
1252
1332
  * Next Dial At
1253
1333
  */
1254
1334
  next_dial_at: string | null;
1335
+ /**
1336
+ * Next Dial Reason
1337
+ */
1338
+ next_dial_reason: 'start' | 'window' | 'daily_cap' | null;
1255
1339
  /**
1256
1340
  * Retry After Minutes
1257
1341
  */
@@ -2739,6 +2823,22 @@ export type CreateCallBatchRequest = {
2739
2823
  */
2740
2824
  agent_version?: number | 'draft' | null;
2741
2825
  calling_window?: TimeWindow | null;
2826
+ /**
2827
+ * Dial Daily Cap
2828
+ *
2829
+ * Calls placed per local day, retries included: a fixed limit, or a ramp that rises on days it dialled. Null is uncapped.
2830
+ */
2831
+ dial_daily_cap?: ({
2832
+ kind: 'fixed';
2833
+ } & FixedDailyCap) | ({
2834
+ kind: 'ramp';
2835
+ } & RampDailyCap) | null;
2836
+ /**
2837
+ * Dial Gap Seconds
2838
+ *
2839
+ * Minimum seconds between STARTING two calls; 0 dials as slots free. A call may start up to 30 seconds after its gap ends.
2840
+ */
2841
+ dial_gap_seconds?: number;
2742
2842
  /**
2743
2843
  * From Phone Number Id
2744
2844
  */
@@ -2893,9 +2993,13 @@ export type CreateEmailBatchRequest = {
2893
2993
  /**
2894
2994
  * Send Daily Cap
2895
2995
  *
2896
- * Emails this batch may send per local day, across all of its sends. Null is uncapped.
2996
+ * Emails this batch may send per local day, across all of its sends: a fixed limit, or a ramp that rises on days it sent. Null is uncapped.
2897
2997
  */
2898
- send_daily_cap?: number | null;
2998
+ send_daily_cap?: ({
2999
+ kind: 'fixed';
3000
+ } & FixedDailyCap) | ({
3001
+ kind: 'ramp';
3002
+ } & RampDailyCap) | null;
2899
3003
  /**
2900
3004
  * Send Gap Seconds
2901
3005
  *
@@ -2969,7 +3073,11 @@ export type CreateEmailSendRequest = {
2969
3073
  /**
2970
3074
  * Send Daily Cap
2971
3075
  */
2972
- send_daily_cap?: number | null;
3076
+ send_daily_cap?: ({
3077
+ kind: 'fixed';
3078
+ } & FixedDailyCap) | ({
3079
+ kind: 'ramp';
3080
+ } & RampDailyCap) | null;
2973
3081
  /**
2974
3082
  * Send Gap Seconds
2975
3083
  */
@@ -3256,9 +3364,13 @@ export type CreateWhatsAppBatchRequest = {
3256
3364
  /**
3257
3365
  * Send Daily Cap
3258
3366
  *
3259
- * Messages per local day. Null is uncapped.
3367
+ * Messages per local day: a fixed limit, or a ramp that rises on days it sent. Null is uncapped.
3260
3368
  */
3261
- send_daily_cap?: number | null;
3369
+ send_daily_cap?: ({
3370
+ kind: 'fixed';
3371
+ } & FixedDailyCap) | ({
3372
+ kind: 'ramp';
3373
+ } & RampDailyCap) | null;
3262
3374
  /**
3263
3375
  * Send Gap Seconds
3264
3376
  */
@@ -3675,7 +3787,15 @@ export type EmailBatchResponse = {
3675
3787
  /**
3676
3788
  * Send Daily Cap
3677
3789
  */
3678
- send_daily_cap: number | null;
3790
+ send_daily_cap: ({
3791
+ kind: 'fixed';
3792
+ } & FixedDailyCap) | ({
3793
+ kind: 'ramp';
3794
+ } & RampDailyCap) | null;
3795
+ /**
3796
+ * Send Daily Cap Today
3797
+ */
3798
+ send_daily_cap_today: number | null;
3679
3799
  /**
3680
3800
  * Send Gap Seconds
3681
3801
  */
@@ -3951,7 +4071,15 @@ export type EmailSendResponse = {
3951
4071
  /**
3952
4072
  * Send Daily Cap
3953
4073
  */
3954
- send_daily_cap: number | null;
4074
+ send_daily_cap: ({
4075
+ kind: 'fixed';
4076
+ } & FixedDailyCap) | ({
4077
+ kind: 'ramp';
4078
+ } & RampDailyCap) | null;
4079
+ /**
4080
+ * Send Daily Cap Today
4081
+ */
4082
+ send_daily_cap_today: number | null;
3955
4083
  /**
3956
4084
  * Send Gap Seconds
3957
4085
  */
@@ -4130,6 +4258,21 @@ export type FieldMap = {
4130
4258
  */
4131
4259
  to: string;
4132
4260
  };
4261
+ /**
4262
+ * FixedDailyCap
4263
+ *
4264
+ * The same limit every day.
4265
+ */
4266
+ export type FixedDailyCap = {
4267
+ /**
4268
+ * Kind
4269
+ */
4270
+ kind: 'fixed';
4271
+ /**
4272
+ * Limit
4273
+ */
4274
+ limit: number;
4275
+ };
4133
4276
  /**
4134
4277
  * FrontendRpcConfig
4135
4278
  */
@@ -7600,10 +7743,11 @@ export type PageWhatsAppRecipientResponse = {
7600
7743
  /**
7601
7744
  * PatchCallBatchRequest
7602
7745
  *
7603
- * Policy edits, allowed while a batch is `scheduled`, `running` or `paused`.
7746
+ * Policy edits, allowed while a batch is `scheduled`, `running`, `paused` or `completed`.
7604
7747
  *
7605
- * ``calling_window`` and ``start_at`` accept an explicit ``null`` to *clear*
7606
- * them — "dial at any hour", "start on the next pass" — which is why the
7748
+ * ``calling_window``, ``start_at`` and ``dial_daily_cap`` accept an explicit
7749
+ * ``null`` to *clear* them — "dial at any hour", "start on the next pass", "no
7750
+ * daily limit" — which is why the
7607
7751
  * service reads ``model_fields_set`` rather than treating absent and null the
7608
7752
  * same way. Every other field keeps the usual PATCH rule: absent means
7609
7753
  * unchanged.
@@ -7614,6 +7758,18 @@ export type PatchCallBatchRequest = {
7614
7758
  */
7615
7759
  agent_id?: string | null;
7616
7760
  calling_window?: TimeWindow | null;
7761
+ /**
7762
+ * Dial Daily Cap
7763
+ */
7764
+ dial_daily_cap?: ({
7765
+ kind: 'fixed';
7766
+ } & FixedDailyCap) | ({
7767
+ kind: 'ramp';
7768
+ } & RampDailyCap) | null;
7769
+ /**
7770
+ * Dial Gap Seconds
7771
+ */
7772
+ dial_gap_seconds?: number | null;
7617
7773
  /**
7618
7774
  * From Phone Number Id
7619
7775
  */
@@ -7724,7 +7880,11 @@ export type PatchEmailBatchRequest = {
7724
7880
  /**
7725
7881
  * Send Daily Cap
7726
7882
  */
7727
- send_daily_cap?: number | null;
7883
+ send_daily_cap?: ({
7884
+ kind: 'fixed';
7885
+ } & FixedDailyCap) | ({
7886
+ kind: 'ramp';
7887
+ } & RampDailyCap) | null;
7728
7888
  /**
7729
7889
  * Send Gap Seconds
7730
7890
  */
@@ -7779,7 +7939,11 @@ export type PatchEmailSendRequest = {
7779
7939
  /**
7780
7940
  * Send Daily Cap
7781
7941
  */
7782
- send_daily_cap?: number | null;
7942
+ send_daily_cap?: ({
7943
+ kind: 'fixed';
7944
+ } & FixedDailyCap) | ({
7945
+ kind: 'ramp';
7946
+ } & RampDailyCap) | null;
7783
7947
  /**
7784
7948
  * Send Gap Seconds
7785
7949
  */
@@ -8054,9 +8218,13 @@ export type PatchWhatsAppBatchRequest = {
8054
8218
  /**
8055
8219
  * Send Daily Cap
8056
8220
  *
8057
- * Messages per local day. Null is uncapped.
8221
+ * Messages per local day: a fixed limit, or a ramp that rises on days it sent. Null is uncapped.
8058
8222
  */
8059
- send_daily_cap?: number | null;
8223
+ send_daily_cap?: ({
8224
+ kind: 'fixed';
8225
+ } & FixedDailyCap) | ({
8226
+ kind: 'ramp';
8227
+ } & RampDailyCap) | null;
8060
8228
  /**
8061
8229
  * Send Gap Seconds
8062
8230
  */
@@ -8602,6 +8770,33 @@ export type PublishedValueResponse = {
8602
8770
  */
8603
8771
  value?: unknown;
8604
8772
  };
8773
+ /**
8774
+ * RampDailyCap
8775
+ *
8776
+ * `start` a day, raised by `step` every `interval_days` sending days, up to `end`.
8777
+ */
8778
+ export type RampDailyCap = {
8779
+ /**
8780
+ * End
8781
+ */
8782
+ end: number;
8783
+ /**
8784
+ * Interval Days
8785
+ */
8786
+ interval_days: number;
8787
+ /**
8788
+ * Kind
8789
+ */
8790
+ kind: 'ramp';
8791
+ /**
8792
+ * Start
8793
+ */
8794
+ start: number;
8795
+ /**
8796
+ * Step
8797
+ */
8798
+ step: number;
8799
+ };
8605
8800
  /**
8606
8801
  * RealtimeCatalogEntryResponse
8607
8802
  */
@@ -9670,9 +9865,13 @@ export type SendWhatsAppBatchRequest = {
9670
9865
  /**
9671
9866
  * Send Daily Cap
9672
9867
  *
9673
- * Messages per local day. Null is uncapped.
9868
+ * Messages per local day: a fixed limit, or a ramp that rises on days it sent. Null is uncapped.
9674
9869
  */
9675
- send_daily_cap?: number | null;
9870
+ send_daily_cap?: ({
9871
+ kind: 'fixed';
9872
+ } & FixedDailyCap) | ({
9873
+ kind: 'ramp';
9874
+ } & RampDailyCap) | null;
9676
9875
  /**
9677
9876
  * Send Gap Seconds
9678
9877
  */
@@ -9886,6 +10085,26 @@ export type SilenceSpecOverride = {
9886
10085
  */
9887
10086
  timeout?: number | null;
9888
10087
  };
10088
+ /**
10089
+ * SkippedEmailRecipient
10090
+ *
10091
+ * A row of the request that will not be drafted. `row_number` is its 1-based
10092
+ * position in the request; `recipient_id` is null when it was not stored.
10093
+ */
10094
+ export type SkippedEmailRecipient = {
10095
+ /**
10096
+ * Reason
10097
+ */
10098
+ reason: string;
10099
+ /**
10100
+ * Recipient Id
10101
+ */
10102
+ recipient_id: string | null;
10103
+ /**
10104
+ * Row Number
10105
+ */
10106
+ row_number: number;
10107
+ };
9889
10108
  /**
9890
10109
  * SkippedRecipient
9891
10110
  */
@@ -9903,6 +10122,26 @@ export type SkippedRecipient = {
9903
10122
  */
9904
10123
  to: string;
9905
10124
  };
10125
+ /**
10126
+ * SkippedWhatsAppRecipient
10127
+ *
10128
+ * A row of the request that will not be sent. `row_number` is its 1-based
10129
+ * position in the request; `recipient_id` is null when it was not stored.
10130
+ */
10131
+ export type SkippedWhatsAppRecipient = {
10132
+ /**
10133
+ * Reason
10134
+ */
10135
+ reason: string;
10136
+ /**
10137
+ * Recipient Id
10138
+ */
10139
+ recipient_id: string | null;
10140
+ /**
10141
+ * Row Number
10142
+ */
10143
+ row_number: number;
10144
+ };
9906
10145
  /**
9907
10146
  * StoredAgentPlan
9908
10147
  *
@@ -12155,7 +12394,15 @@ export type WhatsAppBatchResponse = {
12155
12394
  /**
12156
12395
  * Send Daily Cap
12157
12396
  */
12158
- send_daily_cap: number | null;
12397
+ send_daily_cap: ({
12398
+ kind: 'fixed';
12399
+ } & FixedDailyCap) | ({
12400
+ kind: 'ramp';
12401
+ } & RampDailyCap) | null;
12402
+ /**
12403
+ * Send Daily Cap Today
12404
+ */
12405
+ send_daily_cap_today: number | null;
12159
12406
  /**
12160
12407
  * Send Gap Seconds
12161
12408
  */
@@ -15965,6 +16212,55 @@ export type EmailBatchesRecipientsListResults = {
15965
16212
  200: PageEmailRecipientResponse;
15966
16213
  };
15967
16214
  export type EmailBatchesRecipientsListResult = EmailBatchesRecipientsListResults[keyof EmailBatchesRecipientsListResults];
16215
+ export type EmailBatchesRecipientsAddData = {
16216
+ body: AddEmailRecipientsRequest;
16217
+ path: {
16218
+ /**
16219
+ * Batch Id
16220
+ */
16221
+ batch_id: string;
16222
+ };
16223
+ query?: never;
16224
+ url: '/v1/email/batches/{batch_id}/recipients';
16225
+ };
16226
+ export type EmailBatchesRecipientsAddErrors = {
16227
+ /**
16228
+ * Well-formed, but rejected by a rule; `detail.errors` lists each problem.
16229
+ */
16230
+ 400: ErrorResponse;
16231
+ /**
16232
+ * Missing credential, or one that is revoked or no longer a member of this organization.
16233
+ */
16234
+ 401: ErrorResponse;
16235
+ /**
16236
+ * Authenticated, but this organization role may not perform the operation.
16237
+ */
16238
+ 403: ErrorResponse;
16239
+ /**
16240
+ * No such resource in this organization.
16241
+ */
16242
+ 404: ErrorResponse;
16243
+ /**
16244
+ * The resource's current state forbids this — a name already taken, a job already running.
16245
+ */
16246
+ 409: ErrorResponse;
16247
+ /**
16248
+ * The request did not match this operation's schema; `detail.errors` lists each field.
16249
+ */
16250
+ 422: ErrorResponse;
16251
+ /**
16252
+ * Unexpected error. Every error this API returns carries this body.
16253
+ */
16254
+ default: ErrorResponse;
16255
+ };
16256
+ export type EmailBatchesRecipientsAddError = EmailBatchesRecipientsAddErrors[keyof EmailBatchesRecipientsAddErrors];
16257
+ export type EmailBatchesRecipientsAddResults = {
16258
+ /**
16259
+ * Successful Response
16260
+ */
16261
+ 200: AddEmailRecipientsResponse;
16262
+ };
16263
+ export type EmailBatchesRecipientsAddResult = EmailBatchesRecipientsAddResults[keyof EmailBatchesRecipientsAddResults];
15968
16264
  export type EmailBatchesRecipientsUpdateData = {
15969
16265
  body: PatchEmailRecipientRequest;
15970
16266
  path: {
@@ -20431,6 +20727,55 @@ export type WhatsappBatchesRecipientsListResults = {
20431
20727
  200: PageWhatsAppRecipientResponse;
20432
20728
  };
20433
20729
  export type WhatsappBatchesRecipientsListResult = WhatsappBatchesRecipientsListResults[keyof WhatsappBatchesRecipientsListResults];
20730
+ export type WhatsappBatchesRecipientsAddData = {
20731
+ body: AddWhatsAppRecipientsRequest;
20732
+ path: {
20733
+ /**
20734
+ * Batch Id
20735
+ */
20736
+ batch_id: string;
20737
+ };
20738
+ query?: never;
20739
+ url: '/v1/whatsapp/batches/{batch_id}/recipients';
20740
+ };
20741
+ export type WhatsappBatchesRecipientsAddErrors = {
20742
+ /**
20743
+ * Well-formed, but rejected by a rule; `detail.errors` lists each problem.
20744
+ */
20745
+ 400: ErrorResponse;
20746
+ /**
20747
+ * Missing credential, or one that is revoked or no longer a member of this organization.
20748
+ */
20749
+ 401: ErrorResponse;
20750
+ /**
20751
+ * Authenticated, but this organization role may not perform the operation.
20752
+ */
20753
+ 403: ErrorResponse;
20754
+ /**
20755
+ * No such resource in this organization.
20756
+ */
20757
+ 404: ErrorResponse;
20758
+ /**
20759
+ * The resource's current state forbids this — a name already taken, a job already running.
20760
+ */
20761
+ 409: ErrorResponse;
20762
+ /**
20763
+ * The request did not match this operation's schema; `detail.errors` lists each field.
20764
+ */
20765
+ 422: ErrorResponse;
20766
+ /**
20767
+ * Unexpected error. Every error this API returns carries this body.
20768
+ */
20769
+ default: ErrorResponse;
20770
+ };
20771
+ export type WhatsappBatchesRecipientsAddError = WhatsappBatchesRecipientsAddErrors[keyof WhatsappBatchesRecipientsAddErrors];
20772
+ export type WhatsappBatchesRecipientsAddResults = {
20773
+ /**
20774
+ * Successful Response
20775
+ */
20776
+ 200: AddWhatsAppRecipientsResponse;
20777
+ };
20778
+ export type WhatsappBatchesRecipientsAddResult = WhatsappBatchesRecipientsAddResults[keyof WhatsappBatchesRecipientsAddResults];
20434
20779
  export type WhatsappBatchesRecipientsRestoreData = {
20435
20780
  body: SelectRecipientsRequest;
20436
20781
  path: {