@zernio/node 0.2.657 → 0.2.659

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.
@@ -4578,6 +4578,16 @@ export type ParameterIdempotencyKeyHeader = string;
4578
4578
  */
4579
4579
  export type ParameterPageParam = number;
4580
4580
 
4581
+ export type PhoneNumberStockWatch = {
4582
+ id: string;
4583
+ /**
4584
+ * ISO 3166-1 alpha-2.
4585
+ */
4586
+ country: string;
4587
+ countryName: string;
4588
+ createdAt: string;
4589
+ };
4590
+
4581
4591
  export type PinterestPlatformData = {
4582
4592
  /**
4583
4593
  * Pin title. Defaults to first line of content or "Pin". Must be ≤ 100 characters.
@@ -5933,6 +5943,31 @@ export type UploadTokenStatusResponse = {
5933
5943
  completedAt?: (string) | null;
5934
5944
  };
5935
5945
 
5946
+ export type UsageAttributionGroup = UsageAttributionSlice & {
5947
+ /**
5948
+ * Profile id or account id, per `groupBy`.
5949
+ */
5950
+ key: string;
5951
+ };
5952
+
5953
+ export type UsageAttributionSlice = {
5954
+ /**
5955
+ * USD per product family.
5956
+ */
5957
+ byProduct?: {
5958
+ accounts?: number;
5959
+ numbers?: number;
5960
+ calls?: number;
5961
+ sms?: number;
5962
+ verify?: number;
5963
+ dlc?: number;
5964
+ xApi?: number;
5965
+ credits?: number;
5966
+ other?: number;
5967
+ };
5968
+ totalUsd?: number;
5969
+ };
5970
+
5936
5971
  /**
5937
5972
  * Billed spend by product family over a window, from Metronome's invoice
5938
5973
  * breakdown (the CHARGE view). Returned by `GET /v1/usage`.
@@ -5988,14 +6023,14 @@ export type UsageMetering = {
5988
6023
  quantity?: number;
5989
6024
  }>;
5990
6025
  /**
5991
- * Peak counts over the window (Metronome COUNT metrics + live active-number count).
6026
+ * Peak counts over the window (Metronome COUNT metrics + live active-number count). Null when `profileId` / `accountId` is set.
5992
6027
  */
5993
6028
  peaks?: {
5994
6029
  accounts?: number;
5995
6030
  numbers?: number;
5996
- };
6031
+ } | null;
5997
6032
  /**
5998
- * Billable call volumes over the window.
6033
+ * Billable call volumes over the window. Null when `profileId` / `accountId` is set.
5999
6034
  */
6000
6035
  callUsage?: {
6001
6036
  whatsapp?: {
@@ -6006,7 +6041,7 @@ export type UsageMetering = {
6006
6041
  count?: number;
6007
6042
  minutes?: number;
6008
6043
  };
6009
- };
6044
+ } | null;
6010
6045
  period?: {
6011
6046
  start?: string;
6012
6047
  end?: string;
@@ -6041,6 +6076,33 @@ export type UsageMetering = {
6041
6076
  */
6042
6077
  reverseCharge?: boolean;
6043
6078
  } | null;
6079
+ /**
6080
+ * Present with `groupBy`. The window's spend split per profile or account; `sum(groups) + unattributed` equals `totals` per product.
6081
+ */
6082
+ attribution?: {
6083
+ groupBy?: 'profile' | 'account';
6084
+ groups?: Array<UsageAttributionGroup>;
6085
+ /**
6086
+ * Spend no profile/account can claim: credits, 10DLC fees, Verify, and usage whose record no longer resolves to an account. Zero for a restricted principal.
6087
+ */
6088
+ unattributed?: UsageAttributionSlice;
6089
+ /**
6090
+ * The window totals; for a restricted principal, the sum of the visible groups.
6091
+ */
6092
+ totals?: UsageAttributionSlice;
6093
+ /**
6094
+ * True when the caller (profile-scoped API key or member) cannot see every profile: `groups` are filtered, `totals` sum them, `unattributed` is zero, and the top-level `days` / `totals` / `lineItems` are projected onto the visible groups with `peaks`, `callUsage` and `tax` null.
6095
+ */
6096
+ restricted?: boolean;
6097
+ };
6098
+ /**
6099
+ * Present with `profileId` / `accountId`: echoes the group the payload was projected onto.
6100
+ */
6101
+ scope?: ({
6102
+ profileId: string;
6103
+ } | {
6104
+ accountId: string;
6105
+ });
6044
6106
  };
6045
6107
 
6046
6108
  export type granularity = 'day' | 'month' | 'total';
@@ -6050,6 +6112,8 @@ export type granularity = 'day' | 'month' | 'total';
6050
6112
  */
6051
6113
  export type source2 = 'cycle' | 'window';
6052
6114
 
6115
+ export type groupBy = 'profile' | 'account';
6116
+
6053
6117
  /**
6054
6118
  * Plan and usage stats. The response shape depends on `billingSystem`:
6055
6119
  * * Stripe users (default): per-period counters like `usage.uploads` and
@@ -6370,7 +6434,7 @@ export type Webhook = {
6370
6434
  /**
6371
6435
  * Events subscribed to
6372
6436
  */
6373
- events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'conversation.started' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'verification.approved' | 'verification.failed')>;
6437
+ events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'conversation.started' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed')>;
6374
6438
  /**
6375
6439
  * Whether webhook delivery is enabled
6376
6440
  */
@@ -7990,6 +8054,42 @@ export type platform11 = 'instagram' | 'facebook' | 'telegram' | 'whatsapp' | 't
7990
8054
  */
7991
8055
  export type source3 = 'whatsapp_business_app' | 'cloud_api';
7992
8056
 
8057
+ /**
8058
+ * Webhook payload for phone_number.stock_available events
8059
+ */
8060
+ export type WebhookPayloadPhoneNumberStockAvailable = {
8061
+ /**
8062
+ * Stable webhook event ID
8063
+ */
8064
+ id: string;
8065
+ event: 'phone_number.stock_available';
8066
+ stock: {
8067
+ /**
8068
+ * ISO 3166-1 alpha-2 country code of the watched country.
8069
+ */
8070
+ country: string;
8071
+ /**
8072
+ * Number types deliverable at sweep time. Only types with stock are listed.
8073
+ */
8074
+ types: Array<{
8075
+ /**
8076
+ * local, mobile, national or toll_free.
8077
+ */
8078
+ numberType: string;
8079
+ /**
8080
+ * Deliverable numbers at sweep time; first come, first served.
8081
+ */
8082
+ availableCount: number;
8083
+ }>;
8084
+ };
8085
+ /**
8086
+ * UTC time at which Zernio generated this event (set once when the event payload is built, before delivery is queued). Retries and redeliveries keep the original value, so it reflects the event, not the delivery attempt.
8087
+ */
8088
+ timestamp: string;
8089
+ };
8090
+
8091
+ export type event18 = 'phone_number.stock_available';
8092
+
7993
8093
  /**
7994
8094
  * Webhook payload for post events
7995
8095
  */
@@ -8029,7 +8129,7 @@ export type WebhookPayloadPost = {
8029
8129
  timestamp: string;
8030
8130
  };
8031
8131
 
8032
- export type event18 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled';
8132
+ export type event19 = 'post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled';
8033
8133
 
8034
8134
  /**
8035
8135
  * Webhook payload for the per-platform terminal events
@@ -8128,7 +8228,7 @@ export type WebhookPayloadPostPlatform = {
8128
8228
  timestamp: string;
8129
8229
  };
8130
8230
 
8131
- export type event19 = 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved';
8231
+ export type event20 = 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved';
8132
8232
 
8133
8233
  /**
8134
8234
  * Terminal status this event fires on. Matches the event suffix.
@@ -8187,7 +8287,7 @@ export type WebhookPayloadReaction = {
8187
8287
  timestamp: string;
8188
8288
  };
8189
8289
 
8190
- export type event20 = 'reaction.received';
8290
+ export type event21 = 'reaction.received';
8191
8291
 
8192
8292
  export type action = 'added' | 'removed';
8193
8293
 
@@ -8261,7 +8361,7 @@ export type WebhookPayloadReferral = {
8261
8361
  timestamp: string;
8262
8362
  };
8263
8363
 
8264
- export type event21 = 'referral.received';
8364
+ export type event22 = 'referral.received';
8265
8365
 
8266
8366
  /**
8267
8367
  * Webhook payload for the review.new event (new review posted on a connected account).
@@ -8288,7 +8388,7 @@ export type WebhookPayloadReviewNew = {
8288
8388
  timestamp: string;
8289
8389
  };
8290
8390
 
8291
- export type event22 = 'review.new';
8391
+ export type event23 = 'review.new';
8292
8392
 
8293
8393
  /**
8294
8394
  * Webhook payload for the review.updated event. Fired when the reviewer edits
@@ -8319,7 +8419,7 @@ export type WebhookPayloadReviewUpdated = {
8319
8419
  timestamp: string;
8320
8420
  };
8321
8421
 
8322
- export type event23 = 'review.updated';
8422
+ export type event24 = 'review.updated';
8323
8423
 
8324
8424
  /**
8325
8425
  * Webhook payload for test deliveries
@@ -8340,7 +8440,7 @@ export type WebhookPayloadTest = {
8340
8440
  timestamp: string;
8341
8441
  };
8342
8442
 
8343
- export type event24 = 'webhook.test';
8443
+ export type event25 = 'webhook.test';
8344
8444
 
8345
8445
  /**
8346
8446
  * Webhook payload for the `whatsapp.account.name_status_updated` event.
@@ -8389,7 +8489,7 @@ export type WebhookPayloadWhatsAppAccountNameStatusUpdated = {
8389
8489
  timestamp: string;
8390
8490
  };
8391
8491
 
8392
- export type event25 = 'whatsapp.account.name_status_updated';
8492
+ export type event26 = 'whatsapp.account.name_status_updated';
8393
8493
 
8394
8494
  export type platform12 = 'whatsapp';
8395
8495
 
@@ -8460,7 +8560,7 @@ export type WebhookPayloadWhatsAppTemplateCategoryUpdated = {
8460
8560
  timestamp: string;
8461
8561
  };
8462
8562
 
8463
- export type event26 = 'whatsapp.template.category_updated';
8563
+ export type event27 = 'whatsapp.template.category_updated';
8464
8564
 
8465
8565
  /**
8466
8566
  * `scheduled` is Meta's 24h advance notice of an upcoming
@@ -8537,7 +8637,7 @@ export type WebhookPayloadWhatsAppTemplateStatusUpdated = {
8537
8637
  timestamp: string;
8538
8638
  };
8539
8639
 
8540
- export type event27 = 'whatsapp.template.status_updated';
8640
+ export type event28 = 'whatsapp.template.status_updated';
8541
8641
 
8542
8642
  /**
8543
8643
  * New status. Forwarded verbatim from Meta's `event` field.
@@ -11017,6 +11117,10 @@ export type GetXApiPricingError = ({
11017
11117
 
11018
11118
  export type GetUsageData = {
11019
11119
  query?: {
11120
+ /**
11121
+ * Metering mode (pair with `range`). Project the payload onto this account's attributed share. Mutually exclusive with `profileId`, and `groupBy` (if given) must be `account`; 404 when the account is not visible to the caller.
11122
+ */
11123
+ accountId?: string;
11020
11124
  /**
11021
11125
  * Inclusive start (UTC date). Required when `range=custom`.
11022
11126
  */
@@ -11028,6 +11132,14 @@ export type GetUsageData = {
11028
11132
  *
11029
11133
  */
11030
11134
  granularity?: 'day' | 'month' | 'total';
11135
+ /**
11136
+ * Metering mode. Adds `attribution`: the window's spend split per profile or per account (keys are ids; resolve names via `GET /v1/profiles` / `GET /v1/accounts`).
11137
+ */
11138
+ groupBy?: 'profile' | 'account';
11139
+ /**
11140
+ * Metering mode (pair with `range`). Project the payload onto this profile's attributed share. Mutually exclusive with `accountId`, and `groupBy` (if given) must be `profile`; 404 when the profile is not in your workspace (or outside a scoped key's profiles).
11141
+ */
11142
+ profileId?: string;
11031
11143
  /**
11032
11144
  * Window to report. `cycle` / `prev-cycle` resolve to the customer's
11033
11145
  * real billing-period bounds (falling back to a trailing 30 days when
@@ -17649,7 +17761,7 @@ export type CreateWebhookSettingsData = {
17649
17761
  /**
17650
17762
  * Events to subscribe to (at least one required)
17651
17763
  */
17652
- events: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'conversation.started' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'verification.approved' | 'verification.failed')>;
17764
+ events: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'conversation.started' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed')>;
17653
17765
  /**
17654
17766
  * Enable or disable webhook delivery. Defaults to `true` when omitted.
17655
17767
  */
@@ -17704,7 +17816,7 @@ export type UpdateWebhookSettingsData = {
17704
17816
  /**
17705
17817
  * Events to subscribe to. Must contain at least one event if provided.
17706
17818
  */
17707
- events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'conversation.started' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'verification.approved' | 'verification.failed')>;
17819
+ events?: Array<('post.scheduled' | 'post.published' | 'post.failed' | 'post.partial' | 'post.cancelled' | 'post.recycled' | 'post.platform.published' | 'post.platform.failed' | 'post.platform.deleted' | 'post.tiktok.url_resolved' | 'post.external.created' | 'post.external.updated' | 'post.external.deleted' | 'account.connected' | 'account.disconnected' | 'account.ads.initial_sync_completed' | 'message.received' | 'conversation.started' | 'call.received' | 'call.ended' | 'call.failed' | 'call.permission_request' | 'message.sent' | 'message.edited' | 'message.deleted' | 'message.delivered' | 'message.read' | 'message.failed' | 'reaction.received' | 'referral.received' | 'comment.received' | 'review.new' | 'review.updated' | 'lead.received' | 'ad.status_changed' | 'whatsapp.template.status_updated' | 'whatsapp.template.category_updated' | 'whatsapp.account.name_status_updated' | 'whatsapp.automatic_event' | 'whatsapp.number.activated' | 'whatsapp.number.declined' | 'whatsapp.number.action_required' | 'whatsapp.number.verification_required' | 'whatsapp.number.suspended' | 'whatsapp.number.reactivated' | 'whatsapp.number.released' | 'whatsapp.number.kyc_submitted' | 'phone_number.stock_available' | 'verification.approved' | 'verification.failed')>;
17708
17820
  /**
17709
17821
  * Enable or disable webhook delivery
17710
17822
  */
@@ -25285,6 +25397,43 @@ export type DisableVoiceOnNumberError = ({
25285
25397
  error?: string;
25286
25398
  } | unknown);
25287
25399
 
25400
+ export type CreatePhoneNumberStockWatchData = {
25401
+ body: {
25402
+ /**
25403
+ * ISO 3166-1 alpha-2 code of a country listed by GET /v1/phone-numbers/countries.
25404
+ */
25405
+ country: string;
25406
+ };
25407
+ };
25408
+
25409
+ export type CreatePhoneNumberStockWatchResponse = (PhoneNumberStockWatch);
25410
+
25411
+ export type CreatePhoneNumberStockWatchError = (ErrorResponse | {
25412
+ error?: string;
25413
+ } | unknown);
25414
+
25415
+ export type ListPhoneNumberStockWatchesResponse = ({
25416
+ watches?: Array<PhoneNumberStockWatch>;
25417
+ });
25418
+
25419
+ export type ListPhoneNumberStockWatchesError = ({
25420
+ error?: string;
25421
+ });
25422
+
25423
+ export type DeletePhoneNumberStockWatchData = {
25424
+ path: {
25425
+ id: string;
25426
+ };
25427
+ };
25428
+
25429
+ export type DeletePhoneNumberStockWatchResponse = ({
25430
+ deleted?: boolean;
25431
+ });
25432
+
25433
+ export type DeletePhoneNumberStockWatchError = (ErrorResponse | {
25434
+ error?: string;
25435
+ } | unknown);
25436
+
25288
25437
  export type CreateSipTrunkData = {
25289
25438
  body: {
25290
25439
  /**