@terminal3/t3n-sdk 3.10.1 → 3.11.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.d.ts CHANGED
@@ -1708,6 +1708,28 @@ declare class T3nClient {
1708
1708
  * @throws {ContractResponseError} when the response is not valid JSON
1709
1709
  */
1710
1710
  executeAndDecode<T = unknown>(payload: unknown, schema?: ContractResponseSchema<T>): Promise<T>;
1711
+ /**
1712
+ * Create a new organisation owned by the authenticated caller.
1713
+ *
1714
+ * Dispatches `organisation-create-self` on `tee:organisation/contracts`
1715
+ * over the standard authenticated `action.execute` path. The node
1716
+ * injects the caller's DID into the contract call context, and the
1717
+ * contract forces the new organisation's sole initial admin to that
1718
+ * caller — the caller cannot nominate a different admin, and the
1719
+ * organisation is always created as a root. The caller must already be
1720
+ * a registered user, and the call is metered against the caller's own
1721
+ * credits.
1722
+ *
1723
+ * The returned DID is the org identifier the org-data and payroll
1724
+ * surfaces expect (e.g. `OrgDataClient.setGrants({ orgDid, … })`).
1725
+ *
1726
+ * @param name - human-readable organisation name (1..=128 bytes)
1727
+ * @returns the new organisation's DID (`did:t3n:<40-hex>`)
1728
+ * @throws if the session is not authenticated, or if the contract
1729
+ * refuses (e.g. the caller is not a registered user, or the name is
1730
+ * empty / too long)
1731
+ */
1732
+ createOrganisation(name: string): Promise<Did>;
1711
1733
  /**
1712
1734
  * Build the canonical `ExecuteActionRequest` shape the server
1713
1735
  * expects (`script_name`, `script_version`, `function_name`, `input`,