@naturali/cli 0.126.0 → 0.127.1

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 +159 -1
  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.126.0";
17
+ var version = "0.127.1";
18
18
  //#endregion
19
19
  //#region ../sdk/src/generated/core/bodySerializer.gen.ts
20
20
  const serializeFormDataPair = (data, key, value) => {
@@ -1138,6 +1138,20 @@ var Admin = class {
1138
1138
  }
1139
1139
  });
1140
1140
  }
1141
+ /**
1142
+ * Read the global price book
1143
+ *
1144
+ * The upstream runtime's global default prices — the rows carrying neither a provider nor a project, which is all the upstream listing returns, so no tenant's own rates appear here.
1145
+ *
1146
+ * These are a cost basis, not a tariff: what a customer pays is the plan they bought plus the multiplier in PRICING.md section 3, applied when spend is reconciled. This is the read behind the storage-rate assertion at boot and the pinned embedding rate.
1147
+ *
1148
+ */
1149
+ static getAdminPriceBook(options) {
1150
+ return (options?.client ?? client).get({
1151
+ url: "/v1/admin/usage/prices",
1152
+ ...options
1153
+ });
1154
+ }
1141
1155
  };
1142
1156
  var Agents = class {
1143
1157
  /**
@@ -3693,6 +3707,47 @@ var Projects = class {
3693
3707
  ...options
3694
3708
  });
3695
3709
  }
3710
+ /**
3711
+ * List usage thresholds
3712
+ *
3713
+ * The spend alerts this project has set. A threshold fires the usage.threshold_crossed event when the project's windowed usage crosses it, so one is only useful alongside a webhook subscribed to that event.
3714
+ *
3715
+ */
3716
+ static listProjectUsageThresholds(options) {
3717
+ return (options.client ?? client).get({
3718
+ url: "/v1/projects/{project_id}/usage/thresholds",
3719
+ ...options
3720
+ });
3721
+ }
3722
+ /**
3723
+ * Set a usage threshold
3724
+ *
3725
+ * Creates an alert on this project's windowed usage. Crossing it fires usage.threshold_crossed once per window — a calendar_month threshold fires at most once in a month, and a rolling_24h one re-arms when the windowed total falls back below 90% of the threshold, so a total hovering at the line does not alert repeatedly.
3726
+ *
3727
+ * Requires the admin role: an alerting rule belongs to the account that pays, not to one member.
3728
+ *
3729
+ */
3730
+ static createProjectUsageThreshold(options) {
3731
+ return (options.client ?? client).post({
3732
+ url: "/v1/projects/{project_id}/usage/thresholds",
3733
+ ...options,
3734
+ headers: {
3735
+ "Content-Type": "application/json",
3736
+ ...options.headers
3737
+ }
3738
+ });
3739
+ }
3740
+ /**
3741
+ * Delete a usage threshold
3742
+ *
3743
+ * Stops the alert. Requires the admin role.
3744
+ */
3745
+ static deleteProjectUsageThreshold(options) {
3746
+ return (options.client ?? client).delete({
3747
+ url: "/v1/projects/{project_id}/usage/thresholds/{threshold_id}",
3748
+ ...options
3749
+ });
3750
+ }
3696
3751
  };
3697
3752
  var Quotas = class {
3698
3753
  /**
@@ -6031,6 +6086,16 @@ const routes = {
6031
6086
  }
6032
6087
  ]
6033
6088
  },
6089
+ "get-admin-price-book": {
6090
+ serviceClass: "Admin",
6091
+ operationId: "getAdminPriceBook",
6092
+ description: "The upstream runtime's global default prices — the rows carrying neither a provider nor a project, which is all the upstream listing returns, so no tenant's own rates appear here. These are a cost basis, not a tariff: what a customer pays is the plan they bought plus the multiplier in PRICING.md section 3, applied when spend is reconciled. This is the read behind the storage-rate assertion at boot and the pinned embedding rate.",
6093
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/admin",
6094
+ httpMethod: "get",
6095
+ pathParams: [],
6096
+ queryParams: [],
6097
+ flags: []
6098
+ },
6034
6099
  "list-agents": {
6035
6100
  serviceClass: "Agents",
6036
6101
  operationId: "listAgents",
@@ -13962,6 +14027,99 @@ const routes = {
13962
14027
  }
13963
14028
  ]
13964
14029
  },
14030
+ "list-project-usage-thresholds": {
14031
+ serviceClass: "Projects",
14032
+ operationId: "listProjectUsageThresholds",
14033
+ description: "The spend alerts this project has set. A threshold fires the usage.threshold_crossed event when the project's windowed usage crosses it, so one is only useful alongside a webhook subscribed to that event.",
14034
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
14035
+ httpMethod: "get",
14036
+ pathParams: ["project_id"],
14037
+ queryParams: ["limit", "offset"],
14038
+ flags: [
14039
+ {
14040
+ "name": "project_id",
14041
+ "description": "Project public ID (proj_ prefix).",
14042
+ "required": true,
14043
+ "type": "string",
14044
+ "in": "path"
14045
+ },
14046
+ {
14047
+ "name": "limit",
14048
+ "description": "",
14049
+ "required": false,
14050
+ "type": "integer",
14051
+ "in": "query"
14052
+ },
14053
+ {
14054
+ "name": "offset",
14055
+ "description": "",
14056
+ "required": false,
14057
+ "type": "integer",
14058
+ "in": "query"
14059
+ }
14060
+ ]
14061
+ },
14062
+ "create-project-usage-threshold": {
14063
+ serviceClass: "Projects",
14064
+ operationId: "createProjectUsageThreshold",
14065
+ description: "Creates an alert on this project's windowed usage. Crossing it fires usage.threshold_crossed once per window — a calendar_month threshold fires at most once in a month, and a rolling_24h one re-arms when the windowed total falls back below 90% of the threshold, so a total hovering at the line does not alert repeatedly. Requires the admin role: an alerting rule belongs to the account that pays, not to one member.",
14066
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
14067
+ httpMethod: "post",
14068
+ pathParams: ["project_id"],
14069
+ queryParams: [],
14070
+ flags: [
14071
+ {
14072
+ "name": "project_id",
14073
+ "description": "Project public ID (proj_ prefix).",
14074
+ "required": true,
14075
+ "type": "string",
14076
+ "in": "path"
14077
+ },
14078
+ {
14079
+ "name": "metric",
14080
+ "description": "",
14081
+ "required": true,
14082
+ "type": "string",
14083
+ "in": "body"
14084
+ },
14085
+ {
14086
+ "name": "window",
14087
+ "description": "",
14088
+ "required": true,
14089
+ "type": "string",
14090
+ "in": "body"
14091
+ },
14092
+ {
14093
+ "name": "threshold",
14094
+ "description": "Must be greater than zero.",
14095
+ "required": true,
14096
+ "type": "number",
14097
+ "in": "body"
14098
+ }
14099
+ ]
14100
+ },
14101
+ "delete-project-usage-threshold": {
14102
+ serviceClass: "Projects",
14103
+ operationId: "deleteProjectUsageThreshold",
14104
+ description: "Stops the alert. Requires the admin role.",
14105
+ moduleDocsUrl: "https://docs.naturali.ai/docs/modules/projects",
14106
+ httpMethod: "delete",
14107
+ pathParams: ["project_id", "threshold_id"],
14108
+ queryParams: [],
14109
+ flags: [{
14110
+ "name": "project_id",
14111
+ "description": "Project public ID (proj_ prefix).",
14112
+ "required": true,
14113
+ "type": "string",
14114
+ "in": "path"
14115
+ }, {
14116
+ "name": "threshold_id",
14117
+ "description": "",
14118
+ "required": true,
14119
+ "type": "string",
14120
+ "in": "path"
14121
+ }]
14122
+ },
13965
14123
  "list-quotas": {
13966
14124
  serviceClass: "Quotas",
13967
14125
  operationId: "listQuotas",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/cli",
3
- "version": "0.126.0",
3
+ "version": "0.127.1",
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.126.0"
33
+ "@naturali/sdk": "0.127.1"
34
34
  },
35
35
  "scripts": {
36
36
  "generate": "tsx scripts/generate.ts",