@zernio/node 0.2.749 → 0.2.750

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/dist/index.d.mts CHANGED
@@ -26548,6 +26548,11 @@ type PurchasePhoneNumberData = {
26548
26548
  *
26549
26549
  */
26550
26550
  areaCode?: string;
26551
+ /**
26552
+ * One exact number to buy, in E.164, taken from GET /v1/phone-numbers/available. Hard constraint: when it is no longer available (bought by someone else, or WhatsApp's buy-time check rejects it) the purchase fails with 409 code PHONE_NUMBER_UNAVAILABLE instead of assigning another number; search again and pick another. Only for countries and types that activate instantly: a regulated one (202 kyc_required) returns 400 when phoneNumber is set.
26553
+ *
26554
+ */
26555
+ phoneNumber?: string;
26551
26556
  /**
26552
26557
  * A phone number is the unit; WhatsApp is one optional feature. Pass false to buy a STANDALONE number (Calls/SMS only): provisioning skips the Meta pre-verify/OTP steps and the number activates immediately. Omitted defaults to the WhatsApp provisioning path. WhatsApp can be connected to a standalone number later from the connect flow.
26553
26558
  *
@@ -26614,7 +26619,7 @@ type PurchasePhoneNumberError = (unknown | {
26614
26619
  error?: string;
26615
26620
  } | {
26616
26621
  error?: string;
26617
- code?: 'PURCHASE_VELOCITY' | 'AREA_CODE_UNAVAILABLE';
26622
+ code?: 'PURCHASE_VELOCITY' | 'AREA_CODE_UNAVAILABLE' | 'PHONE_NUMBER_UNAVAILABLE';
26618
26623
  });
26619
26624
  type ListPhoneNumberCountriesResponse = ({
26620
26625
  countries?: Array<{
@@ -26722,11 +26727,22 @@ type SearchAvailablePhoneNumbersResponse = ({
26722
26727
  */
26723
26728
  requireSms?: boolean;
26724
26729
  numbers?: Array<{
26730
+ /**
26731
+ * E.164. Pass it as `phoneNumber` on POST /v1/phone-numbers/purchase to buy this exact number.
26732
+ */
26725
26733
  phoneNumber?: string;
26726
26734
  /**
26727
26735
  * Provider capability list for this number (e.g. voice, sms, mms).
26728
26736
  */
26729
26737
  features?: Array<(string)>;
26738
+ /**
26739
+ * Town or rate center the number belongs to, as the carrier names it (e.g. WACO).
26740
+ */
26741
+ locality?: string;
26742
+ /**
26743
+ * true when the carrier added this number because too few matched your filters, so it may be outside the requested prefix or locality.
26744
+ */
26745
+ bestEffort?: boolean;
26730
26746
  }>;
26731
26747
  });
26732
26748
  type SearchAvailablePhoneNumbersError = (unknown | {
@@ -26905,6 +26921,11 @@ type PurchaseWhatsAppPhoneNumberData = {
26905
26921
  *
26906
26922
  */
26907
26923
  country?: string;
26924
+ /**
26925
+ * One exact number to buy, in E.164, taken from GET /v1/phone-numbers/available. Fails with 409 code PHONE_NUMBER_UNAVAILABLE when it is no longer available.
26926
+ *
26927
+ */
26928
+ phoneNumber?: string;
26908
26929
  /**
26909
26930
  * Optional idempotency key. Send the same value when retrying a purchase: if a number was already bought under this key, the API returns { status: "already_purchased", numberId, phoneNumber } instead of provisioning a second number. Generate a fresh key for each genuinely new purchase.
26910
26931
  *
@@ -26948,7 +26969,7 @@ type PurchaseWhatsAppPhoneNumberError = (unknown | {
26948
26969
  error?: string;
26949
26970
  } | {
26950
26971
  error?: string;
26951
- code?: 'PURCHASE_VELOCITY' | 'AREA_CODE_UNAVAILABLE';
26972
+ code?: 'PURCHASE_VELOCITY' | 'AREA_CODE_UNAVAILABLE' | 'PHONE_NUMBER_UNAVAILABLE';
26952
26973
  });
26953
26974
  type ListWhatsAppNumberCountriesResponse = ({
26954
26975
  countries?: Array<{
@@ -26995,6 +27016,8 @@ type SearchAvailableWhatsAppNumbersResponse = ({
26995
27016
  numberType?: string;
26996
27017
  numbers?: Array<{
26997
27018
  phoneNumber?: string;
27019
+ locality?: string;
27020
+ bestEffort?: boolean;
26998
27021
  }>;
26999
27022
  });
27000
27023
  type SearchAvailableWhatsAppNumbersError = (unknown | {
package/dist/index.d.ts CHANGED
@@ -26548,6 +26548,11 @@ type PurchasePhoneNumberData = {
26548
26548
  *
26549
26549
  */
26550
26550
  areaCode?: string;
26551
+ /**
26552
+ * One exact number to buy, in E.164, taken from GET /v1/phone-numbers/available. Hard constraint: when it is no longer available (bought by someone else, or WhatsApp's buy-time check rejects it) the purchase fails with 409 code PHONE_NUMBER_UNAVAILABLE instead of assigning another number; search again and pick another. Only for countries and types that activate instantly: a regulated one (202 kyc_required) returns 400 when phoneNumber is set.
26553
+ *
26554
+ */
26555
+ phoneNumber?: string;
26551
26556
  /**
26552
26557
  * A phone number is the unit; WhatsApp is one optional feature. Pass false to buy a STANDALONE number (Calls/SMS only): provisioning skips the Meta pre-verify/OTP steps and the number activates immediately. Omitted defaults to the WhatsApp provisioning path. WhatsApp can be connected to a standalone number later from the connect flow.
26553
26558
  *
@@ -26614,7 +26619,7 @@ type PurchasePhoneNumberError = (unknown | {
26614
26619
  error?: string;
26615
26620
  } | {
26616
26621
  error?: string;
26617
- code?: 'PURCHASE_VELOCITY' | 'AREA_CODE_UNAVAILABLE';
26622
+ code?: 'PURCHASE_VELOCITY' | 'AREA_CODE_UNAVAILABLE' | 'PHONE_NUMBER_UNAVAILABLE';
26618
26623
  });
26619
26624
  type ListPhoneNumberCountriesResponse = ({
26620
26625
  countries?: Array<{
@@ -26722,11 +26727,22 @@ type SearchAvailablePhoneNumbersResponse = ({
26722
26727
  */
26723
26728
  requireSms?: boolean;
26724
26729
  numbers?: Array<{
26730
+ /**
26731
+ * E.164. Pass it as `phoneNumber` on POST /v1/phone-numbers/purchase to buy this exact number.
26732
+ */
26725
26733
  phoneNumber?: string;
26726
26734
  /**
26727
26735
  * Provider capability list for this number (e.g. voice, sms, mms).
26728
26736
  */
26729
26737
  features?: Array<(string)>;
26738
+ /**
26739
+ * Town or rate center the number belongs to, as the carrier names it (e.g. WACO).
26740
+ */
26741
+ locality?: string;
26742
+ /**
26743
+ * true when the carrier added this number because too few matched your filters, so it may be outside the requested prefix or locality.
26744
+ */
26745
+ bestEffort?: boolean;
26730
26746
  }>;
26731
26747
  });
26732
26748
  type SearchAvailablePhoneNumbersError = (unknown | {
@@ -26905,6 +26921,11 @@ type PurchaseWhatsAppPhoneNumberData = {
26905
26921
  *
26906
26922
  */
26907
26923
  country?: string;
26924
+ /**
26925
+ * One exact number to buy, in E.164, taken from GET /v1/phone-numbers/available. Fails with 409 code PHONE_NUMBER_UNAVAILABLE when it is no longer available.
26926
+ *
26927
+ */
26928
+ phoneNumber?: string;
26908
26929
  /**
26909
26930
  * Optional idempotency key. Send the same value when retrying a purchase: if a number was already bought under this key, the API returns { status: "already_purchased", numberId, phoneNumber } instead of provisioning a second number. Generate a fresh key for each genuinely new purchase.
26910
26931
  *
@@ -26948,7 +26969,7 @@ type PurchaseWhatsAppPhoneNumberError = (unknown | {
26948
26969
  error?: string;
26949
26970
  } | {
26950
26971
  error?: string;
26951
- code?: 'PURCHASE_VELOCITY' | 'AREA_CODE_UNAVAILABLE';
26972
+ code?: 'PURCHASE_VELOCITY' | 'AREA_CODE_UNAVAILABLE' | 'PHONE_NUMBER_UNAVAILABLE';
26952
26973
  });
26953
26974
  type ListWhatsAppNumberCountriesResponse = ({
26954
26975
  countries?: Array<{
@@ -26995,6 +27016,8 @@ type SearchAvailableWhatsAppNumbersResponse = ({
26995
27016
  numberType?: string;
26996
27017
  numbers?: Array<{
26997
27018
  phoneNumber?: string;
27019
+ locality?: string;
27020
+ bestEffort?: boolean;
26998
27021
  }>;
26999
27022
  });
27000
27023
  type SearchAvailableWhatsAppNumbersError = (unknown | {
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(index_exports);
36
36
  // package.json
37
37
  var package_default = {
38
38
  name: "@zernio/node",
39
- version: "0.2.749",
39
+ version: "0.2.750",
40
40
  description: "The official Node.js library for the Zernio API",
41
41
  main: "dist/index.js",
42
42
  module: "dist/index.mjs",
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5
5
  // package.json
6
6
  var package_default = {
7
7
  name: "@zernio/node",
8
- version: "0.2.749",
8
+ version: "0.2.750",
9
9
  description: "The official Node.js library for the Zernio API",
10
10
  main: "dist/index.js",
11
11
  module: "dist/index.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zernio/node",
3
- "version": "0.2.749",
3
+ "version": "0.2.750",
4
4
  "description": "The official Node.js library for the Zernio API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -5797,8 +5797,9 @@ export const releasePhoneNumber = <ThrowOnError extends boolean = false>(options
5797
5797
 
5798
5798
  /**
5799
5799
  * Purchase phone number
5800
- * Payment-first: you do not pick a specific number, the system provisions one and
5801
- * auto-assigns it. With usage-based billing active and a payment method on file, the
5800
+ * Payment-first: the system provisions a number and auto-assigns it, unless you pass
5801
+ * `phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`. With
5802
+ * usage-based billing active and a payment method on file, the
5802
5803
  * number provisions inline and bills per month on your usage-based invoice (there is
5803
5804
  * no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`;
5804
5805
  * a regulated country returns `202` with `status: "kyc_required"` and a `kycUrl`.
@@ -5840,7 +5841,9 @@ export const listPhoneNumberCountries = <ThrowOnError extends boolean = false>(o
5840
5841
  * country (default US). Optional filters narrow the results. The country
5841
5842
  * must be offerable (see GET /v1/phone-numbers/countries). Voice
5842
5843
  * capability is always required; pass `sms=true` to only see numbers that
5843
- * can also text (SMS support is per-number, not per-country).
5844
+ * can also text (SMS support is per-number, not per-country). Numbers a
5845
+ * purchase would refuse are left out, and any result's `phoneNumber` can
5846
+ * be bought exactly by passing it to POST /v1/phone-numbers/purchase.
5844
5847
  *
5845
5848
  */
5846
5849
  export const searchAvailablePhoneNumbers = <ThrowOnError extends boolean = false>(options?: OptionsLegacyParser<SearchAvailablePhoneNumbersData, ThrowOnError>) => {
@@ -5895,8 +5898,9 @@ export const getWhatsAppPhoneNumbers = <ThrowOnError extends boolean = false>(op
5895
5898
  * Deprecated alias of `/v1/phone-numbers/purchase`; same contract. New
5896
5899
  * integrations should use that path.
5897
5900
  *
5898
- * Payment-first: you do not pick a specific number, the system provisions one and
5899
- * auto-assigns it. With usage-based billing active and a payment method on file, the
5901
+ * Payment-first: the system provisions a number and auto-assigns it, unless you pass
5902
+ * `phoneNumber` to buy one exact number from `GET /v1/phone-numbers/available`. With
5903
+ * usage-based billing active and a payment method on file, the
5900
5904
  * number provisions inline and bills per month on your usage-based invoice (there is
5901
5905
  * no checkout redirect). No payment method on file returns `402 PAYMENT_REQUIRED`;
5902
5906
  * a regulated country returns `202` with `status: "kyc_required"` and a `kycUrl`.
@@ -26404,6 +26404,11 @@ export type PurchasePhoneNumberData = {
26404
26404
  *
26405
26405
  */
26406
26406
  areaCode?: string;
26407
+ /**
26408
+ * One exact number to buy, in E.164, taken from GET /v1/phone-numbers/available. Hard constraint: when it is no longer available (bought by someone else, or WhatsApp's buy-time check rejects it) the purchase fails with 409 code PHONE_NUMBER_UNAVAILABLE instead of assigning another number; search again and pick another. Only for countries and types that activate instantly: a regulated one (202 kyc_required) returns 400 when phoneNumber is set.
26409
+ *
26410
+ */
26411
+ phoneNumber?: string;
26407
26412
  /**
26408
26413
  * A phone number is the unit; WhatsApp is one optional feature. Pass false to buy a STANDALONE number (Calls/SMS only): provisioning skips the Meta pre-verify/OTP steps and the number activates immediately. Omitted defaults to the WhatsApp provisioning path. WhatsApp can be connected to a standalone number later from the connect flow.
26409
26414
  *
@@ -26472,7 +26477,7 @@ export type PurchasePhoneNumberError = (unknown | {
26472
26477
  error?: string;
26473
26478
  } | {
26474
26479
  error?: string;
26475
- code?: 'PURCHASE_VELOCITY' | 'AREA_CODE_UNAVAILABLE';
26480
+ code?: 'PURCHASE_VELOCITY' | 'AREA_CODE_UNAVAILABLE' | 'PHONE_NUMBER_UNAVAILABLE';
26476
26481
  });
26477
26482
 
26478
26483
  export type ListPhoneNumberCountriesResponse = ({
@@ -26584,11 +26589,22 @@ export type SearchAvailablePhoneNumbersResponse = ({
26584
26589
  */
26585
26590
  requireSms?: boolean;
26586
26591
  numbers?: Array<{
26592
+ /**
26593
+ * E.164. Pass it as `phoneNumber` on POST /v1/phone-numbers/purchase to buy this exact number.
26594
+ */
26587
26595
  phoneNumber?: string;
26588
26596
  /**
26589
26597
  * Provider capability list for this number (e.g. voice, sms, mms).
26590
26598
  */
26591
26599
  features?: Array<(string)>;
26600
+ /**
26601
+ * Town or rate center the number belongs to, as the carrier names it (e.g. WACO).
26602
+ */
26603
+ locality?: string;
26604
+ /**
26605
+ * true when the carrier added this number because too few matched your filters, so it may be outside the requested prefix or locality.
26606
+ */
26607
+ bestEffort?: boolean;
26592
26608
  }>;
26593
26609
  });
26594
26610
 
@@ -26775,6 +26791,11 @@ export type PurchaseWhatsAppPhoneNumberData = {
26775
26791
  *
26776
26792
  */
26777
26793
  country?: string;
26794
+ /**
26795
+ * One exact number to buy, in E.164, taken from GET /v1/phone-numbers/available. Fails with 409 code PHONE_NUMBER_UNAVAILABLE when it is no longer available.
26796
+ *
26797
+ */
26798
+ phoneNumber?: string;
26778
26799
  /**
26779
26800
  * Optional idempotency key. Send the same value when retrying a purchase: if a number was already bought under this key, the API returns { status: "already_purchased", numberId, phoneNumber } instead of provisioning a second number. Generate a fresh key for each genuinely new purchase.
26780
26801
  *
@@ -26820,7 +26841,7 @@ export type PurchaseWhatsAppPhoneNumberError = (unknown | {
26820
26841
  error?: string;
26821
26842
  } | {
26822
26843
  error?: string;
26823
- code?: 'PURCHASE_VELOCITY' | 'AREA_CODE_UNAVAILABLE';
26844
+ code?: 'PURCHASE_VELOCITY' | 'AREA_CODE_UNAVAILABLE' | 'PHONE_NUMBER_UNAVAILABLE';
26824
26845
  });
26825
26846
 
26826
26847
  export type ListWhatsAppNumberCountriesResponse = ({
@@ -26871,6 +26892,8 @@ export type SearchAvailableWhatsAppNumbersResponse = ({
26871
26892
  numberType?: string;
26872
26893
  numbers?: Array<{
26873
26894
  phoneNumber?: string;
26895
+ locality?: string;
26896
+ bestEffort?: boolean;
26874
26897
  }>;
26875
26898
  });
26876
26899