@naturali/sdk 0.110.1 → 0.111.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.cjs CHANGED
@@ -1055,6 +1055,7 @@ var Admin = class {
1055
1055
  * Puts the account on a rung of the infra ladder. Needs the `admin` role.
1056
1056
  * `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.
1057
1057
  * 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.
1058
+ * A rung whose content-retention window a contract sets — `enterprise` — **requires `retention_days`**, since nothing else can answer what that window is and an unanswered one bounds nothing. Every other rung sets its own and refuses the field.
1058
1059
  *
1059
1060
  */
1060
1061
  static grantUserPlan(options) {
@@ -4236,9 +4237,9 @@ var Users = class {
4236
4237
  /**
4237
4238
  * Get the current account's billing standing
4238
4239
  *
4239
- * The plan the account is on and the credit it has left — the two figures the platform already enforces against, readable by the account they are enforced against.
4240
+ * The plan the account is on, how long its projects may keep content, and the credit it has left — the figures the platform already enforces against, readable by the account they are enforced against.
4240
4241
  *
4241
- * A managed-model generation is refused with `402 insufficient_credit` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`. Both refusals name what is missing; this is where the numbers behind them are read.
4242
+ * A managed-model generation is refused with `402 insufficient_credit` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`, as is a retention window wider than `retention_days`. Every refusal names what is missing; this is where the numbers behind them are read.
4242
4243
  *
4243
4244
  * Answers for the caller's own account only, and always the account the credential resolves to — an API key answers for the user that minted it. The plan gating a *project* is that project's billing owner's, so a member of someone else's project reads their own rung here, not that project's.
4244
4245
  *
package/dist/index.d.cts CHANGED
@@ -487,6 +487,10 @@ type AdminUser = User & {
487
487
  * The rung of the infra ladder the account is on. `free` for an account with no subscription. It gates the feature lines and the resource counts of the pricing table.
488
488
  */
489
489
  plan: 'free' | 'pro' | 'business' | 'enterprise';
490
+ /**
491
+ * The longest content-retention window this account's projects may keep content for, in days. On a plan whose window a contract sets, this is the figure recorded with the grant; `null` means nothing bounds it. Resolved the same way the refusal is — the widest window held during the current billing cycle.
492
+ */
493
+ retention_days: number | null;
490
494
  /**
491
495
  * Model credit left, in US dollars — the ledger's sum, less the part of a past cycle's allowance that lapsed. `0` for an account that has never been credited, and negative for one that has overspent, which refuses its managed generations.
492
496
  */
@@ -508,6 +512,10 @@ type UserPlanGrant = {
508
512
  * The rung to put the account on.
509
513
  */
510
514
  plan: 'free' | 'pro' | 'business' | 'enterprise';
515
+ /**
516
+ * The content-retention window the contract negotiated, in days. **Required on `enterprise`**, whose window the pricing table leaves to a contract: without one nothing bounds what the account's projects store, so it is refused rather than defaulted. Send `null` for a contract that keeps content indefinitely — that is a decision the field records, not the absence of one. **Refused on every other rung**, whose window the plan itself sets.
517
+ */
518
+ retention_days?: number | null;
511
519
  /**
512
520
  * Why the account was moved. Recorded on the line and never edited, so it is the only account of intent the history carries.
513
521
  */
@@ -522,6 +530,10 @@ type PlanEvent = {
522
530
  * The rung the account was put on by this line.
523
531
  */
524
532
  plan: 'free' | 'pro' | 'business' | 'enterprise';
533
+ /**
534
+ * The contract window recorded with this line, in days. `null` on every rung whose window the plan itself sets, and on a contract that keeps content indefinitely — `plan` is what tells the two apart.
535
+ */
536
+ retention_days: number | null;
525
537
  reason: string | null;
526
538
  /**
527
539
  * The operator who recorded it. Null for a line no person wrote.
@@ -6305,6 +6317,10 @@ type UserBilling = {
6305
6317
  * The rung of the infra subscription this account is on. `free` for an account with no subscription, which is also the least-privileged rung. It gates the feature lines and the resource counts of the pricing table.
6306
6318
  */
6307
6319
  plan: 'free' | 'pro' | 'business' | 'enterprise';
6320
+ /**
6321
+ * The longest window a project of this account may keep trace and generation content for, in days. A `PATCH` asking for a wider one — `null` included, which keeps content indefinitely — is refused with `403 plan_limit_reached`; anything shorter is always allowed. On a plan whose window a contract sets, this is that contract's figure, and `null` means nothing bounds it. A plan change that shortens the window applies at the end of the billing cycle, so this reads as the widest window held during the current one.
6322
+ */
6323
+ retention_days: number | null;
6308
6324
  /**
6309
6325
  * Model credit left, in US dollars — granted and purchased credit plus the plan's monthly allowance, less managed-model spend. A managed generation is refused while this is negative; a zero balance still generates, and the generation that crosses zero is absorbed. Only as current as `spend_reconciled_at`, so read the two together.
6310
6326
  */
@@ -19059,6 +19075,7 @@ declare class Admin {
19059
19075
  * Puts the account on a rung of the infra ladder. Needs the `admin` role.
19060
19076
  * `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.
19061
19077
  * 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.
19078
+ * A rung whose content-retention window a contract sets — `enterprise` — **requires `retention_days`**, since nothing else can answer what that window is and an unanswered one bounds nothing. Every other rung sets its own and refuses the field.
19062
19079
  *
19063
19080
  */
19064
19081
  static grantUserPlan<ThrowOnError extends boolean = false>(options: Options<GrantUserPlanData, ThrowOnError>): RequestResult<GrantUserPlanResponses, GrantUserPlanErrors, ThrowOnError>;
@@ -20702,9 +20719,9 @@ declare class Users {
20702
20719
  /**
20703
20720
  * Get the current account's billing standing
20704
20721
  *
20705
- * The plan the account is on and the credit it has left — the two figures the platform already enforces against, readable by the account they are enforced against.
20722
+ * The plan the account is on, how long its projects may keep content, and the credit it has left — the figures the platform already enforces against, readable by the account they are enforced against.
20706
20723
  *
20707
- * A managed-model generation is refused with `402 insufficient_credit` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`. Both refusals name what is missing; this is where the numbers behind them are read.
20724
+ * A managed-model generation is refused with `402 insufficient_credit` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`, as is a retention window wider than `retention_days`. Every refusal names what is missing; this is where the numbers behind them are read.
20708
20725
  *
20709
20726
  * Answers for the caller's own account only, and always the account the credential resolves to — an API key answers for the user that minted it. The plan gating a *project* is that project's billing owner's, so a member of someone else's project reads their own rung here, not that project's.
20710
20727
  *
package/dist/index.d.mts CHANGED
@@ -487,6 +487,10 @@ type AdminUser = User & {
487
487
  * The rung of the infra ladder the account is on. `free` for an account with no subscription. It gates the feature lines and the resource counts of the pricing table.
488
488
  */
489
489
  plan: 'free' | 'pro' | 'business' | 'enterprise';
490
+ /**
491
+ * The longest content-retention window this account's projects may keep content for, in days. On a plan whose window a contract sets, this is the figure recorded with the grant; `null` means nothing bounds it. Resolved the same way the refusal is — the widest window held during the current billing cycle.
492
+ */
493
+ retention_days: number | null;
490
494
  /**
491
495
  * Model credit left, in US dollars — the ledger's sum, less the part of a past cycle's allowance that lapsed. `0` for an account that has never been credited, and negative for one that has overspent, which refuses its managed generations.
492
496
  */
@@ -508,6 +512,10 @@ type UserPlanGrant = {
508
512
  * The rung to put the account on.
509
513
  */
510
514
  plan: 'free' | 'pro' | 'business' | 'enterprise';
515
+ /**
516
+ * The content-retention window the contract negotiated, in days. **Required on `enterprise`**, whose window the pricing table leaves to a contract: without one nothing bounds what the account's projects store, so it is refused rather than defaulted. Send `null` for a contract that keeps content indefinitely — that is a decision the field records, not the absence of one. **Refused on every other rung**, whose window the plan itself sets.
517
+ */
518
+ retention_days?: number | null;
511
519
  /**
512
520
  * Why the account was moved. Recorded on the line and never edited, so it is the only account of intent the history carries.
513
521
  */
@@ -522,6 +530,10 @@ type PlanEvent = {
522
530
  * The rung the account was put on by this line.
523
531
  */
524
532
  plan: 'free' | 'pro' | 'business' | 'enterprise';
533
+ /**
534
+ * The contract window recorded with this line, in days. `null` on every rung whose window the plan itself sets, and on a contract that keeps content indefinitely — `plan` is what tells the two apart.
535
+ */
536
+ retention_days: number | null;
525
537
  reason: string | null;
526
538
  /**
527
539
  * The operator who recorded it. Null for a line no person wrote.
@@ -6305,6 +6317,10 @@ type UserBilling = {
6305
6317
  * The rung of the infra subscription this account is on. `free` for an account with no subscription, which is also the least-privileged rung. It gates the feature lines and the resource counts of the pricing table.
6306
6318
  */
6307
6319
  plan: 'free' | 'pro' | 'business' | 'enterprise';
6320
+ /**
6321
+ * The longest window a project of this account may keep trace and generation content for, in days. A `PATCH` asking for a wider one — `null` included, which keeps content indefinitely — is refused with `403 plan_limit_reached`; anything shorter is always allowed. On a plan whose window a contract sets, this is that contract's figure, and `null` means nothing bounds it. A plan change that shortens the window applies at the end of the billing cycle, so this reads as the widest window held during the current one.
6322
+ */
6323
+ retention_days: number | null;
6308
6324
  /**
6309
6325
  * Model credit left, in US dollars — granted and purchased credit plus the plan's monthly allowance, less managed-model spend. A managed generation is refused while this is negative; a zero balance still generates, and the generation that crosses zero is absorbed. Only as current as `spend_reconciled_at`, so read the two together.
6310
6326
  */
@@ -19059,6 +19075,7 @@ declare class Admin {
19059
19075
  * Puts the account on a rung of the infra ladder. Needs the `admin` role.
19060
19076
  * `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.
19061
19077
  * 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.
19078
+ * A rung whose content-retention window a contract sets — `enterprise` — **requires `retention_days`**, since nothing else can answer what that window is and an unanswered one bounds nothing. Every other rung sets its own and refuses the field.
19062
19079
  *
19063
19080
  */
19064
19081
  static grantUserPlan<ThrowOnError extends boolean = false>(options: Options<GrantUserPlanData, ThrowOnError>): RequestResult<GrantUserPlanResponses, GrantUserPlanErrors, ThrowOnError>;
@@ -20702,9 +20719,9 @@ declare class Users {
20702
20719
  /**
20703
20720
  * Get the current account's billing standing
20704
20721
  *
20705
- * The plan the account is on and the credit it has left — the two figures the platform already enforces against, readable by the account they are enforced against.
20722
+ * The plan the account is on, how long its projects may keep content, and the credit it has left — the figures the platform already enforces against, readable by the account they are enforced against.
20706
20723
  *
20707
- * A managed-model generation is refused with `402 insufficient_credit` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`. Both refusals name what is missing; this is where the numbers behind them are read.
20724
+ * A managed-model generation is refused with `402 insufficient_credit` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`, as is a retention window wider than `retention_days`. Every refusal names what is missing; this is where the numbers behind them are read.
20708
20725
  *
20709
20726
  * Answers for the caller's own account only, and always the account the credential resolves to — an API key answers for the user that minted it. The plan gating a *project* is that project's billing owner's, so a member of someone else's project reads their own rung here, not that project's.
20710
20727
  *
package/dist/index.mjs CHANGED
@@ -1054,6 +1054,7 @@ var Admin = class {
1054
1054
  * Puts the account on a rung of the infra ladder. Needs the `admin` role.
1055
1055
  * `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.
1056
1056
  * 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.
1057
+ * A rung whose content-retention window a contract sets — `enterprise` — **requires `retention_days`**, since nothing else can answer what that window is and an unanswered one bounds nothing. Every other rung sets its own and refuses the field.
1057
1058
  *
1058
1059
  */
1059
1060
  static grantUserPlan(options) {
@@ -4235,9 +4236,9 @@ var Users = class {
4235
4236
  /**
4236
4237
  * Get the current account's billing standing
4237
4238
  *
4238
- * The plan the account is on and the credit it has left — the two figures the platform already enforces against, readable by the account they are enforced against.
4239
+ * The plan the account is on, how long its projects may keep content, and the credit it has left — the figures the platform already enforces against, readable by the account they are enforced against.
4239
4240
  *
4240
- * A managed-model generation is refused with `402 insufficient_credit` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`. Both refusals name what is missing; this is where the numbers behind them are read.
4241
+ * A managed-model generation is refused with `402 insufficient_credit` while `credit_balance_usd` is negative, and a feature or a resource count outside the plan is refused with `403`, as is a retention window wider than `retention_days`. Every refusal names what is missing; this is where the numbers behind them are read.
4241
4242
  *
4242
4243
  * Answers for the caller's own account only, and always the account the credential resolves to — an API key answers for the user that minted it. The plan gating a *project* is that project's billing owner's, so a member of someone else's project reads their own rung here, not that project's.
4243
4244
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/sdk",
3
- "version": "0.110.1",
3
+ "version": "0.111.0",
4
4
  "description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -37,7 +37,7 @@
37
37
  "tsx": "^4.23.1",
38
38
  "typescript": "~6.0.3",
39
39
  "vitest": "^4.1.10",
40
- "@naturali/api": "0.110.1"
40
+ "@naturali/api": "0.111.0"
41
41
  },
42
42
  "scripts": {
43
43
  "generate": "tsx scripts/generate.ts",