@naturali/cli 0.173.3 → 0.174.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.
Files changed (2) hide show
  1. package/dist/index.mjs +40 -8
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ var __exportAll = (all, no_symbols) => {
17
17
  };
18
18
  //#endregion
19
19
  //#region package.json
20
- var version = "0.173.3";
20
+ var version = "0.174.0";
21
21
  //#endregion
22
22
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
23
23
  const serializeFormDataPair = (data, key, value) => {
@@ -935,7 +935,7 @@ var Channels = class {
935
935
  * Connect a channel
936
936
  *
937
937
  * Connect a channel. The required fields depend on `channel`; no credential is ever returned.
938
- * **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured.
938
+ * **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 invalid_bot_token` when Discord rejects it, `400 application_mismatch` when it belongs to another application. Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured.
939
939
  * **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret:
940
940
  * * **BYOT** (`credential_source: byot`, default) — supply
941
941
  * `phone_number_id` and `access_token` from your own Meta app.
@@ -5454,7 +5454,7 @@ var Users = class {
5454
5454
  *
5455
5455
  * With `saved_card: true` the saved card is charged at once and the answer is `status: paid`. When the card needs authentication or is declined, nothing is charged and the answer falls back to a checkout.
5456
5456
  *
5457
- * A checkout (`status: checkout`) is a hosted page: send the caller to `checkout_url`. Creating it charges nothing, and one left unpaid lapses at `expires_at`. After paying, the browser returns to the console's billing page.
5457
+ * A checkout (`status: checkout`) is a hosted page: send the caller to `checkout_url`. Creating it charges nothing, and one left unpaid lapses at `expires_at`. The card paid with there becomes the account's saved card, replacing any other. After paying, the browser returns to the console's billing page.
5458
5458
  *
5459
5459
  */
5460
5460
  static createCurrentUserTopUp(options) {
@@ -5545,9 +5545,11 @@ var Users = class {
5545
5545
  /**
5546
5546
  * Change the plan
5547
5547
  *
5548
- * Choose `free`, `pro` or `business`. A paid plan needs a saved card.
5548
+ * Choose `free`, `pro` or `business`.
5549
5549
  *
5550
- * An upgrade is charged at once on the saved card, in its currency, for the price difference over the rest of the month, then takes effect; the month's statement nets that payment out. A declined card leaves the plan unchanged. A downgrade takes effect when the month ends, and `next_plan` names it until then. A contract plan is changed by asking us.
5550
+ * An upgrade is charged for the price difference over the rest of the month, then takes effect; the month's statement nets that payment out. The saved card is charged at once, in its currency. With no saved card, or when the card needs authentication or is declined, nothing is charged and the answer carries a `checkout_url`: a hosted page that charges the upgrade and saves the card. The plan changes once it is paid; one left unpaid lapses at `expires_at`.
5551
+ *
5552
+ * A downgrade takes effect when the month ends, and `next_plan` names it until then. A contract plan is changed by asking us.
5551
5553
  *
5552
5554
  */
5553
5555
  static setCurrentUserPlan(options) {
@@ -5560,6 +5562,18 @@ var Users = class {
5560
5562
  }
5561
5563
  });
5562
5564
  }
5565
+ /**
5566
+ * Preview a plan change
5567
+ *
5568
+ * What choosing `plan` would charge now: an upgrade's share of the rest of the month, else 0. Changes nothing.
5569
+ *
5570
+ */
5571
+ static getCurrentUserPlanQuote(options) {
5572
+ return (options.client ?? client).get({
5573
+ url: "/v1/users/me/plan/quote",
5574
+ ...options
5575
+ });
5576
+ }
5563
5577
  };
5564
5578
  var Webhooks = class {
5565
5579
  /**
@@ -10162,7 +10176,7 @@ const routes = {
10162
10176
  "create-channel": {
10163
10177
  serviceClass: "Channels",
10164
10178
  operationId: "createChannel",
10165
- description: "Connect a channel. The required fields depend on `channel`; no credential is ever returned. **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured. **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret: * **BYOT** (`credential_source: byot`, default) — supply `phone_number_id` and `access_token` from your own Meta app. * **Embedded signup** (`credential_source: embedded_signup`) — supply `code` and `waba_id` (and optionally `pin`) from the Meta popup; naturali exchanges the `code` for the token and subscribes its app to the WABA, so the customer never hands over a token. Returns `501` on deployments where Meta App credentials are not configured. The project's plan limits how many channels it may hold. At the limit this responds `403` with `plan_limit_reached`, whose `details` carry the `plan` and the `limit`, before any credential is acquired. Only `active` channels count, so disabling one frees allowance without deleting it.",
10179
+ description: "Connect a channel. The required fields depend on `channel`; no credential is ever returned. **Discord** (`channel: discord`) — supply `application_id` and `bot_token`, plus the `modes` selecting which Gateway flows to serve (direct messages, and/or @mention-opens-a-thread). The token is checked with Discord first: `400 invalid_bot_token` when Discord rejects it, `400 application_mismatch` when it belongs to another application. Returns `501` when the deployment has no `CHANNEL_TOKEN_KEY` configured. **WhatsApp** (default) — one of two credential paths, both filling the same write-only secret: * **BYOT** (`credential_source: byot`, default) — supply `phone_number_id` and `access_token` from your own Meta app. * **Embedded signup** (`credential_source: embedded_signup`) — supply `code` and `waba_id` (and optionally `pin`) from the Meta popup; naturali exchanges the `code` for the token and subscribes its app to the WABA, so the customer never hands over a token. Returns `501` on deployments where Meta App credentials are not configured. The project's plan limits how many channels it may hold. At the limit this responds `403` with `plan_limit_reached`, whose `details` carry the `plan` and the `limit`, before any credential is acquired. Only `active` channels count, so disabling one frees allowance without deleting it.",
10166
10180
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channels",
10167
10181
  httpMethod: "post",
10168
10182
  pathParams: ["project_id"],
@@ -21114,7 +21128,7 @@ const routes = {
21114
21128
  "create-current-user-top-up": {
21115
21129
  serviceClass: "Users",
21116
21130
  operationId: "createCurrentUserTopUp",
21117
- description: "Buys model credit for the caller's account. Once the card is charged the full amount is added to `credit_balance_usd` as purchased credit, which never expires. The card fee is not deducted. `amount_usd` is what is credited; a card issued in Brazil is charged its equivalent in Brazilian reais at the Banco Central's latest closing PTAX selling rate, and a checkout shows reais to a payer in Brazil. With `saved_card: true` the saved card is charged at once and the answer is `status: paid`. When the card needs authentication or is declined, nothing is charged and the answer falls back to a checkout. A checkout (`status: checkout`) is a hosted page: send the caller to `checkout_url`. Creating it charges nothing, and one left unpaid lapses at `expires_at`. After paying, the browser returns to the console's billing page.",
21131
+ description: "Buys model credit for the caller's account. Once the card is charged the full amount is added to `credit_balance_usd` as purchased credit, which never expires. The card fee is not deducted. `amount_usd` is what is credited; a card issued in Brazil is charged its equivalent in Brazilian reais at the Banco Central's latest closing PTAX selling rate, and a checkout shows reais to a payer in Brazil. With `saved_card: true` the saved card is charged at once and the answer is `status: paid`. When the card needs authentication or is declined, nothing is charged and the answer falls back to a checkout. A checkout (`status: checkout`) is a hosted page: send the caller to `checkout_url`. Creating it charges nothing, and one left unpaid lapses at `expires_at`. The card paid with there becomes the account's saved card, replacing any other. After paying, the browser returns to the console's billing page.",
21118
21132
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/users",
21119
21133
  httpMethod: "post",
21120
21134
  pathParams: [],
@@ -21222,7 +21236,7 @@ const routes = {
21222
21236
  "set-current-user-plan": {
21223
21237
  serviceClass: "Users",
21224
21238
  operationId: "setCurrentUserPlan",
21225
- description: "Choose `free`, `pro` or `business`. A paid plan needs a saved card. An upgrade is charged at once on the saved card, in its currency, for the price difference over the rest of the month, then takes effect; the month's statement nets that payment out. A declined card leaves the plan unchanged. A downgrade takes effect when the month ends, and `next_plan` names it until then. A contract plan is changed by asking us.",
21239
+ description: "Choose `free`, `pro` or `business`. An upgrade is charged for the price difference over the rest of the month, then takes effect; the month's statement nets that payment out. The saved card is charged at once, in its currency. With no saved card, or when the card needs authentication or is declined, nothing is charged and the answer carries a `checkout_url`: a hosted page that charges the upgrade and saves the card. The plan changes once it is paid; one left unpaid lapses at `expires_at`. A downgrade takes effect when the month ends, and `next_plan` names it until then. A contract plan is changed by asking us.",
21226
21240
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/users",
21227
21241
  httpMethod: "put",
21228
21242
  pathParams: [],
@@ -21237,6 +21251,24 @@ const routes = {
21237
21251
  "in": "body"
21238
21252
  }]
21239
21253
  },
21254
+ "get-current-user-plan-quote": {
21255
+ serviceClass: "Users",
21256
+ operationId: "getCurrentUserPlanQuote",
21257
+ description: "What choosing `plan` would charge now: an upgrade's share of the rest of the month, else 0. Changes nothing.",
21258
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/users",
21259
+ httpMethod: "get",
21260
+ pathParams: [],
21261
+ queryParams: ["plan"],
21262
+ headerParams: [],
21263
+ cookieParams: [],
21264
+ flags: [{
21265
+ "name": "plan",
21266
+ "description": "",
21267
+ "required": true,
21268
+ "type": "string",
21269
+ "in": "query"
21270
+ }]
21271
+ },
21240
21272
  "list-webhooks": {
21241
21273
  serviceClass: "Webhooks",
21242
21274
  operationId: "listWebhooks",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.173.3",
3
+ "version": "0.174.0",
4
4
  "description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,7 +25,7 @@
25
25
  "yaml": "^2.9.1"
26
26
  },
27
27
  "devDependencies": {
28
- "@naturali/sdk": "0.173.3",
28
+ "@naturali/sdk": "0.174.0",
29
29
  "@ttoss/openapi-codegen": "^0.5.0",
30
30
  "@types/node": "^26.5.1",
31
31
  "tsdown": "^0.23.0",