@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.cjs CHANGED
@@ -1125,7 +1125,7 @@ var Admin = class {
1125
1125
  /**
1126
1126
  * Grant a user credit
1127
1127
  *
1128
- * Writes one `granted` line to the account's credit ledger and answers with the balance it produced. Needs the `admin` role.
1128
+ * Writes one line to the account's credit ledger and answers with the balance it produced. Needs the `admin` role.
1129
1129
  * 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.
1130
1130
  * `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.
1131
1131
  * The balance this moves is not yet a ceiling anything enforces; turning it into one is a separate mechanism.
@@ -1734,6 +1734,34 @@ var Assistant = class {
1734
1734
  }
1735
1735
  });
1736
1736
  }
1737
+ /**
1738
+ * Read the conversation
1739
+ *
1740
+ * 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.
1741
+ *
1742
+ */
1743
+ static listAssistantMessages(options) {
1744
+ return (options?.client ?? client).get({
1745
+ url: "/v1/assistant/messages",
1746
+ ...options
1747
+ });
1748
+ }
1749
+ /**
1750
+ * Message the Assistant
1751
+ *
1752
+ * 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.
1753
+ *
1754
+ */
1755
+ static sendAssistantMessage(options) {
1756
+ return (options.client ?? client).post({
1757
+ url: "/v1/assistant/messages",
1758
+ ...options,
1759
+ headers: {
1760
+ "Content-Type": "application/json",
1761
+ ...options.headers
1762
+ }
1763
+ });
1764
+ }
1737
1765
  };
1738
1766
  var AuditLog = class {
1739
1767
  /**
@@ -5338,7 +5366,7 @@ var Users = class {
5338
5366
  *
5339
5367
  * 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.
5340
5368
  *
5341
- * `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.
5369
+ * `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.
5342
5370
  *
5343
5371
  */
5344
5372
  static listCurrentUserStops(options) {
@@ -5376,9 +5404,9 @@ var Users = class {
5376
5404
  /**
5377
5405
  * List the account's monthly statements
5378
5406
  *
5379
- * 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.
5407
+ * 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.
5380
5408
  *
5381
- * 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.
5409
+ * 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.
5382
5410
  *
5383
5411
  */
5384
5412
  static listCurrentUserStatements(options) {
@@ -5492,6 +5520,24 @@ var Users = class {
5492
5520
  }
5493
5521
  });
5494
5522
  }
5523
+ /**
5524
+ * Change the plan
5525
+ *
5526
+ * Choose `free`, `pro` or `business`. A paid plan needs a saved card.
5527
+ *
5528
+ * 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.
5529
+ *
5530
+ */
5531
+ static setCurrentUserPlan(options) {
5532
+ return (options.client ?? client).put({
5533
+ url: "/v1/users/me/plan",
5534
+ ...options,
5535
+ headers: {
5536
+ "Content-Type": "application/json",
5537
+ ...options.headers
5538
+ }
5539
+ });
5540
+ }
5495
5541
  };
5496
5542
  var Webhooks = class {
5497
5543
  /**