@dialgem/sdk 0.1.0-beta.2 → 1.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0
4
+
5
+ The first stable release. The API is the one in `0.1.0-beta.3`, unchanged: nothing was added, removed or renamed. From here on, breaking changes only come in a new major version, and `npm install @dialgem/sdk` installs this release.
6
+
7
+ ## 0.1.0-beta.3
8
+
9
+ ### Added
10
+ - `phoneNumbers.search({ country?, type?, area_code?, contains?, limit? })` lists numbers that can be bought, with the monthly price, and `phoneNumbers.buy({ phone_number, type?, nickname? })` buys one. **Buying spends the organization's credit**: the first month is debited when you buy and the rental renews monthly until the number is released; nothing is charged if the purchase fails. Both need the deployment to have number purchasing switched on (`search` throws `NotFoundError`, `number_purchase_disabled`, otherwise). Types: `PhoneNumberSearchParams`, `PhoneNumberBuyParams`, `AvailablePhoneNumbers`, `PurchasedPhoneNumber`.
11
+ - A number looked up with `phoneNumbers.retrieve` now carries `own_twilio` (whether it is on a Twilio account you connected yourself). Connecting your own Twilio account and importing its numbers is a dashboard feature; it is not in the SDK, because it handles your Twilio credentials.
12
+
3
13
  ## 0.1.0-beta.2
4
14
 
5
15
  ### Not in this SDK, on purpose
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  Build voice agents, put them on phone numbers, place calls, steer them live, and read transcripts, all from your backend.
8
8
 
9
- [![npm](https://img.shields.io/npm/v/@dialgem/sdk?include_prereleases&color=CB3837&logo=npm&logoColor=white)](https://www.npmjs.com/package/@dialgem/sdk)
9
+ [![npm](https://img.shields.io/npm/v/@dialgem/sdk?color=CB3837&logo=npm&logoColor=white)](https://www.npmjs.com/package/@dialgem/sdk)
10
10
  [![Node](https://img.shields.io/node/v/@dialgem/sdk?logo=node.js&logoColor=white)](https://www.npmjs.com/package/@dialgem/sdk)
11
11
  [![CI](https://img.shields.io/github/actions/workflow/status/DialgemAI/dialgem-sdk-typescript/ci.yml?branch=main&label=CI&logo=github)](https://github.com/DialgemAI/dialgem-sdk-typescript/actions/workflows/ci.yml)
12
12
  [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
package/dist/index.cjs CHANGED
@@ -106,7 +106,7 @@ function isErrorBody(body) {
106
106
  }
107
107
 
108
108
  // src/version.ts
109
- var VERSION = "0.1.0-beta.2";
109
+ var VERSION = "1.0.0";
110
110
 
111
111
  // src/core/http.ts
112
112
  var RETRYABLE_METHODS = /* @__PURE__ */ new Set(["GET", "PUT", "PATCH", "DELETE"]);
@@ -967,6 +967,21 @@ var PhoneNumbers = class extends APIResource {
967
967
  create(body, options) {
968
968
  return this._client.post("/v1/phone-numbers", body, options);
969
969
  }
970
+ /**
971
+ * Numbers that can be bought, with the monthly price. Throws `NotFoundError` (`number_purchase_disabled`) when the
972
+ * deployment has not switched buying on.
973
+ */
974
+ search(params, options) {
975
+ return this._client.get("/v1/phone-numbers/available", { ...params }, options);
976
+ }
977
+ /**
978
+ * Buy one of the numbers `search` returned. **Spends the organization's credit**: the first month is debited now and
979
+ * the rental renews monthly until the number is released. Throws on insufficient credit, or if the carrier no longer
980
+ * has the number; nothing is charged in either case.
981
+ */
982
+ buy(body, options) {
983
+ return this._client.post("/v1/phone-numbers/buy", body, options);
984
+ }
970
985
  /** Every active (not released) number in the organization, newest first. */
971
986
  list(options) {
972
987
  return this._client.get("/v1/phone-numbers", void 0, options);