@naturali/cli 0.93.0 → 0.95.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 +80 -19
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -14,7 +14,7 @@ var __exportAll = (all, no_symbols) => {
14
14
  };
15
15
  //#endregion
16
16
  //#region package.json
17
- var version = "0.93.0";
17
+ var version = "0.95.0";
18
18
  //#endregion
19
19
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
20
20
  const serializeFormDataPair = (data, key, value) => {
@@ -920,6 +920,9 @@ var Channels = class {
920
920
  * the WABA, so the customer never hands over a token. Returns `501` on
921
921
  * deployments where Meta App credentials are not configured.
922
922
  *
923
+ *
924
+ * 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.
925
+ *
923
926
  */
924
927
  static createChannel(options) {
925
928
  return (options.client ?? client).post({
@@ -1051,11 +1054,24 @@ var Admin = class {
1051
1054
  });
1052
1055
  }
1053
1056
  /**
1057
+ * Read a user's plan history
1058
+ *
1059
+ * A cursor page of the account's plan history, newest first, and the rung it is on now. Needs the `admin` role.
1060
+ * The history is append-only, so this is the record of who put the account where and why — nothing edits or removes a line. `plan` at the top level is the same value every entitlement check resolves, so one response answers both "what plan is this?" and "how did it get there?".
1061
+ *
1062
+ */
1063
+ static listUserPlanHistory(options) {
1064
+ return (options.client ?? client).get({
1065
+ url: "/v1/admin/users/{user_id}/plan",
1066
+ ...options
1067
+ });
1068
+ }
1069
+ /**
1054
1070
  * Grant a user a plan
1055
1071
  *
1056
1072
  * Puts the account on a rung of the infra ladder. Needs the `admin` role.
1057
- * `PUT` because a user has exactly one plan: setting it twice leaves one subscription, never two (two rows for one payer is a state where "which plan is this?" has no answer).
1058
- * The rung is recorded and read back, and **nothing enforces it yet** — no route refuses a feature for the plan an account is on. Downgrading is the same call with a lower rung, and what becomes of resources a lower plan would not hold is a separate mechanism that is not built.
1073
+ * `PUT` because an account is on exactly one rung at a time, but the change is **recorded rather than overwritten**: the plan history is append-only and the newest line is the account's plan. Setting the rung it already holds still writes a line — a re-confirmation is an act worth a record, and the `reason` given with it would otherwise have nowhere to go. Read the history back with `GET` on this path.
1074
+ * The rung is what the feature gate and the resource caps resolve against. Downgrading is the same call with a lower rung; what becomes of resources a lower plan would not hold is a separate mechanism that is not built.
1059
1075
  *
1060
1076
  */
1061
1077
  static grantUserPlan(options) {
@@ -3442,6 +3458,9 @@ var Projects = class {
3442
3458
  * Create a project
3443
3459
  *
3444
3460
  * Creates a project (one per client or per environment).
3461
+ *
3462
+ * Your plan limits how many projects you may own. At the limit this responds `403` with `plan_limit_reached`, whose `details` carry the `plan` and the `limit`. An archived project still counts — archiving keeps every resource, so it frees nothing; deleting a project does.
3463
+ *
3445
3464
  */
3446
3465
  static createProject(options) {
3447
3466
  return (options.client ?? client).post({
@@ -5635,27 +5654,69 @@ const routes = {
5635
5654
  "in": "body"
5636
5655
  }]
5637
5656
  },
5657
+ "list-user-plan-history": {
5658
+ serviceClass: "Admin",
5659
+ operationId: "listUserPlanHistory",
5660
+ description: "A cursor page of the account's plan history, newest first, and the rung it is on now. Needs the `admin` role. The history is append-only, so this is the record of who put the account where and why — nothing edits or removes a line. `plan` at the top level is the same value every entitlement check resolves, so one response answers both \"what plan is this?\" and \"how did it get there?\".",
5661
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/admin",
5662
+ httpMethod: "get",
5663
+ pathParams: ["user_id"],
5664
+ queryParams: ["limit", "cursor"],
5665
+ flags: [
5666
+ {
5667
+ "name": "user_id",
5668
+ "description": "",
5669
+ "required": true,
5670
+ "type": "string",
5671
+ "in": "path"
5672
+ },
5673
+ {
5674
+ "name": "limit",
5675
+ "description": "Maximum items per page — an integer from 1 to 100 (default 20).",
5676
+ "required": false,
5677
+ "type": "integer",
5678
+ "in": "query"
5679
+ },
5680
+ {
5681
+ "name": "cursor",
5682
+ "description": "The `next_cursor` of the previous page.",
5683
+ "required": false,
5684
+ "type": "string",
5685
+ "in": "query"
5686
+ }
5687
+ ]
5688
+ },
5638
5689
  "grant-user-plan": {
5639
5690
  serviceClass: "Admin",
5640
5691
  operationId: "grantUserPlan",
5641
- description: "Puts the account on a rung of the infra ladder. Needs the `admin` role. `PUT` because a user has exactly one plan: setting it twice leaves one subscription, never two (two rows for one payer is a state where \"which plan is this?\" has no answer). The rung is recorded and read back, and **nothing enforces it yet** — no route refuses a feature for the plan an account is on. Downgrading is the same call with a lower rung, and what becomes of resources a lower plan would not hold is a separate mechanism that is not built.",
5692
+ description: "Puts the account on a rung of the infra ladder. Needs the `admin` role. `PUT` because an account is on exactly one rung at a time, but the change is **recorded rather than overwritten**: the plan history is append-only and the newest line is the account's plan. Setting the rung it already holds still writes a line — a re-confirmation is an act worth a record, and the `reason` given with it would otherwise have nowhere to go. Read the history back with `GET` on this path. The rung is what the feature gate and the resource caps resolve against. Downgrading is the same call with a lower rung; what becomes of resources a lower plan would not hold is a separate mechanism that is not built.",
5642
5693
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/admin",
5643
5694
  httpMethod: "put",
5644
5695
  pathParams: ["user_id"],
5645
5696
  queryParams: [],
5646
- flags: [{
5647
- "name": "user_id",
5648
- "description": "",
5649
- "required": true,
5650
- "type": "string",
5651
- "in": "path"
5652
- }, {
5653
- "name": "plan",
5654
- "description": "The rung to put the account on.",
5655
- "required": true,
5656
- "type": "string",
5657
- "in": "body"
5658
- }]
5697
+ flags: [
5698
+ {
5699
+ "name": "user_id",
5700
+ "description": "",
5701
+ "required": true,
5702
+ "type": "string",
5703
+ "in": "path"
5704
+ },
5705
+ {
5706
+ "name": "plan",
5707
+ "description": "The rung to put the account on.",
5708
+ "required": true,
5709
+ "type": "string",
5710
+ "in": "body"
5711
+ },
5712
+ {
5713
+ "name": "reason",
5714
+ "description": "Why the account was moved. Recorded on the line and never edited, so it is the only account of intent the history carries.",
5715
+ "required": false,
5716
+ "type": "string",
5717
+ "in": "body"
5718
+ }
5719
+ ]
5659
5720
  },
5660
5721
  "list-user-credits": {
5661
5722
  serviceClass: "Admin",
@@ -8073,7 +8134,7 @@ const routes = {
8073
8134
  "create-channel": {
8074
8135
  serviceClass: "Channels",
8075
8136
  operationId: "createChannel",
8076
- 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.",
8137
+ 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.",
8077
8138
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/channels",
8078
8139
  httpMethod: "post",
8079
8140
  pathParams: ["project_id"],
@@ -13051,7 +13112,7 @@ const routes = {
13051
13112
  "create-project": {
13052
13113
  serviceClass: "Projects",
13053
13114
  operationId: "createProject",
13054
- description: "Creates a project (one per client or per environment).",
13115
+ description: "Creates a project (one per client or per environment). Your plan limits how many projects you may own. At the limit this responds `403` with `plan_limit_reached`, whose `details` carry the `plan` and the `limit`. An archived project still counts — archiving keeps every resource, so it frees nothing; deleting a project does.",
13055
13116
  moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
13056
13117
  httpMethod: "post",
13057
13118
  pathParams: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.93.0",
3
+ "version": "0.95.0",
4
4
  "description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,7 +30,7 @@
30
30
  "tsx": "^4.23.1",
31
31
  "typescript": "~6.0.3",
32
32
  "vitest": "^4.1.10",
33
- "@naturali/sdk": "0.93.0"
33
+ "@naturali/sdk": "0.95.0"
34
34
  },
35
35
  "scripts": {
36
36
  "generate": "tsx scripts/generate.ts",