@naturali/cli 0.94.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.
- package/dist/index.mjs +72 -17
- 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.
|
|
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) => {
|
|
@@ -1054,11 +1054,24 @@ var Admin = class {
|
|
|
1054
1054
|
});
|
|
1055
1055
|
}
|
|
1056
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
|
+
/**
|
|
1057
1070
|
* Grant a user a plan
|
|
1058
1071
|
*
|
|
1059
1072
|
* Puts the account on a rung of the infra ladder. Needs the `admin` role.
|
|
1060
|
-
* `PUT` because
|
|
1061
|
-
* The rung is
|
|
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.
|
|
1062
1075
|
*
|
|
1063
1076
|
*/
|
|
1064
1077
|
static grantUserPlan(options) {
|
|
@@ -5641,27 +5654,69 @@ const routes = {
|
|
|
5641
5654
|
"in": "body"
|
|
5642
5655
|
}]
|
|
5643
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
|
+
},
|
|
5644
5689
|
"grant-user-plan": {
|
|
5645
5690
|
serviceClass: "Admin",
|
|
5646
5691
|
operationId: "grantUserPlan",
|
|
5647
|
-
description: "Puts the account on a rung of the infra ladder. Needs the `admin` role. `PUT` because
|
|
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.",
|
|
5648
5693
|
moduleDocsUrl: "https://docs.naturali.ai/docs/modules/admin",
|
|
5649
5694
|
httpMethod: "put",
|
|
5650
5695
|
pathParams: ["user_id"],
|
|
5651
5696
|
queryParams: [],
|
|
5652
|
-
flags: [
|
|
5653
|
-
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
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
|
+
]
|
|
5665
5720
|
},
|
|
5666
5721
|
"list-user-credits": {
|
|
5667
5722
|
serviceClass: "Admin",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/cli",
|
|
3
|
-
"version": "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.
|
|
33
|
+
"@naturali/sdk": "0.95.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"generate": "tsx scripts/generate.ts",
|