@naturali/sdk 0.167.0 → 0.169.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 CHANGED
@@ -1124,7 +1124,7 @@ var Admin = class {
1124
1124
  /**
1125
1125
  * Grant a user credit
1126
1126
  *
1127
- * Writes one `granted` line to the account's credit ledger and answers with the balance it produced. Needs the `admin` role.
1127
+ * Writes one line to the account's credit ledger and answers with the balance it produced. Needs the `admin` role.
1128
1128
  * The ledger is append-only and the balance is its sum — there is no balance to set and no line to edit or delete. A mistake is corrected by writing a **negative** `amount_usd`, which leaves the wrong line on the record beside the one that compensates for it.
1129
1129
  * `kind` is required. Money received and credit given away report differently — one is revenue, the other customer-acquisition cost — so the line says which it is rather than defaulting to one of them.
1130
1130
  * The balance this moves is not yet a ceiling anything enforces; turning it into one is a separate mechanism.
@@ -1733,6 +1733,34 @@ var Assistant = class {
1733
1733
  }
1734
1734
  });
1735
1735
  }
1736
+ /**
1737
+ * Read the conversation
1738
+ *
1739
+ * The newest 100 messages of your conversation with the Assistant in the app, oldest first. An account that has not messaged it yet has an empty conversation.
1740
+ *
1741
+ */
1742
+ static listAssistantMessages(options) {
1743
+ return (options?.client ?? client).get({
1744
+ url: "/v1/assistant/messages",
1745
+ ...options
1746
+ });
1747
+ }
1748
+ /**
1749
+ * Message the Assistant
1750
+ *
1751
+ * Runs one turn as your account and answers with the messages it added: yours, then the Assistant's reply. The turn is paid from your credit and refused before it runs when the balance is below zero.
1752
+ *
1753
+ */
1754
+ static sendAssistantMessage(options) {
1755
+ return (options.client ?? client).post({
1756
+ url: "/v1/assistant/messages",
1757
+ ...options,
1758
+ headers: {
1759
+ "Content-Type": "application/json",
1760
+ ...options.headers
1761
+ }
1762
+ });
1763
+ }
1736
1764
  };
1737
1765
  var AuditLog = class {
1738
1766
  /**
@@ -5337,7 +5365,7 @@ var Users = class {
5337
5365
  *
5338
5366
  * Schedule triggers, eval runs, orchestration runs and workflow tasks the platform stopped on this account's projects because the credit balance went below zero or a Free plan's runs ran out, and that have not been restored or dismissed yet. Newest first.
5339
5367
  *
5340
- * `blocked_by` names the ceiling still closed: while it is set, nothing can be restored. Top up for `debt`; upgrade or wait for the month to turn for `run_allowance`. A project-confined key sees its own project's stops only.
5368
+ * `blocked_by` names the ceiling still closed: while it is set, nothing can be restored. Top up for `debt`; upgrade or wait for the month to turn for `run_allowance`. A `marketplace_fee` stop, for work naming a priced installed listing, is restored only while the paid balance is positive. A project-confined key sees its own project's stops only.
5341
5369
  *
5342
5370
  */
5343
5371
  static listCurrentUserStops(options) {
@@ -5375,9 +5403,9 @@ var Users = class {
5375
5403
  /**
5376
5404
  * List the account's monthly statements
5377
5405
  *
5378
- * What the account owes for each closed billing month, newest first: the subscription fee, prorated by the share of the month each plan was held, and runs past the allowance at the plan's overage rate. Overage is measured against the highest plan held that month.
5406
+ * What the account owes for each closed billing month, newest first: the subscription fee, prorated by the share of the month each plan was held, and runs past the allowance at the plan's overage rate, less what was paid at an upgrade. Overage is measured against the highest plan held that month.
5379
5407
  *
5380
- * A statement is written within an hour of the month closing, once, and never changes. It is a record to bill from, not a charge and not a tax invoice. Months on the Free plan alone, contract plans and storage are not stated.
5408
+ * A statement is written within an hour of the month closing, once, and never changes; `payment_status` follows its charge on the saved card. It is not a tax invoice. Months on the Free plan alone, contract plans and storage are not stated.
5381
5409
  *
5382
5410
  */
5383
5411
  static listCurrentUserStatements(options) {
@@ -5491,6 +5519,24 @@ var Users = class {
5491
5519
  }
5492
5520
  });
5493
5521
  }
5522
+ /**
5523
+ * Change the plan
5524
+ *
5525
+ * Choose `free`, `pro` or `business`. A paid plan needs a saved card.
5526
+ *
5527
+ * An upgrade is charged at once on the saved card 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.
5528
+ *
5529
+ */
5530
+ static setCurrentUserPlan(options) {
5531
+ return (options.client ?? client).put({
5532
+ url: "/v1/users/me/plan",
5533
+ ...options,
5534
+ headers: {
5535
+ "Content-Type": "application/json",
5536
+ ...options.headers
5537
+ }
5538
+ });
5539
+ }
5494
5540
  };
5495
5541
  var Webhooks = class {
5496
5542
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturali/sdk",
3
- "version": "0.167.0",
3
+ "version": "0.169.0",
4
4
  "description": "TypeScript SDK for the naturali.ai API, generated from its OpenAPI specs",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "devDependencies": {
33
33
  "@hey-api/openapi-ts": "^0.99.0",
34
- "@naturali/api": "0.167.0",
34
+ "@naturali/api": "0.169.0",
35
35
  "@ttoss/openapi-codegen": "^0.5.0",
36
36
  "@types/node": "^26.5.1",
37
37
  "tsdown": "^0.23.0",