@w6w/sdk 0.6.0 → 0.9.9

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 (120) hide show
  1. package/README.md +166 -16
  2. package/dist/mod.d.ts +7 -5
  3. package/dist/mod.d.ts.map +1 -1
  4. package/dist/mod.js +1 -0
  5. package/dist/mod.js.map +1 -1
  6. package/dist/src/client.d.ts +11 -2
  7. package/dist/src/client.d.ts.map +1 -1
  8. package/dist/src/client.js +12 -2
  9. package/dist/src/client.js.map +1 -1
  10. package/dist/src/config.d.ts +83 -6
  11. package/dist/src/config.d.ts.map +1 -1
  12. package/dist/src/config.js +40 -4
  13. package/dist/src/config.js.map +1 -1
  14. package/dist/src/connections.d.ts +3 -2
  15. package/dist/src/connections.d.ts.map +1 -1
  16. package/dist/src/connections.js +7 -2
  17. package/dist/src/connections.js.map +1 -1
  18. package/dist/src/console/api-calls.d.ts +4 -3
  19. package/dist/src/console/api-calls.d.ts.map +1 -1
  20. package/dist/src/console/api-calls.js +4 -3
  21. package/dist/src/console/api-calls.js.map +1 -1
  22. package/dist/src/console/apps.d.ts +181 -8
  23. package/dist/src/console/apps.d.ts.map +1 -1
  24. package/dist/src/console/apps.js +67 -12
  25. package/dist/src/console/apps.js.map +1 -1
  26. package/dist/src/console/auth.d.ts +43 -3
  27. package/dist/src/console/auth.d.ts.map +1 -1
  28. package/dist/src/console/auth.js +23 -4
  29. package/dist/src/console/auth.js.map +1 -1
  30. package/dist/src/console/commerce.d.ts +428 -0
  31. package/dist/src/console/commerce.d.ts.map +1 -0
  32. package/dist/src/console/commerce.js +220 -0
  33. package/dist/src/console/commerce.js.map +1 -0
  34. package/dist/src/console/dashboard.d.ts +8 -0
  35. package/dist/src/console/dashboard.d.ts.map +1 -1
  36. package/dist/src/console/dashboard.js.map +1 -1
  37. package/dist/src/console/endpoints.d.ts +57 -2
  38. package/dist/src/console/endpoints.d.ts.map +1 -1
  39. package/dist/src/console/endpoints.js.map +1 -1
  40. package/dist/src/console/functions.d.ts +35 -4
  41. package/dist/src/console/functions.d.ts.map +1 -1
  42. package/dist/src/console/functions.js +13 -0
  43. package/dist/src/console/functions.js.map +1 -1
  44. package/dist/src/console/mod.d.ts +22 -7
  45. package/dist/src/console/mod.d.ts.map +1 -1
  46. package/dist/src/console/mod.js +16 -1
  47. package/dist/src/console/mod.js.map +1 -1
  48. package/dist/src/console/otp.d.ts +127 -0
  49. package/dist/src/console/otp.d.ts.map +1 -0
  50. package/dist/src/console/otp.js +118 -0
  51. package/dist/src/console/otp.js.map +1 -0
  52. package/dist/src/console/reliability.d.ts +101 -6
  53. package/dist/src/console/reliability.d.ts.map +1 -1
  54. package/dist/src/console/reliability.js +16 -5
  55. package/dist/src/console/reliability.js.map +1 -1
  56. package/dist/src/console/step-tests.d.ts +7 -1
  57. package/dist/src/console/step-tests.d.ts.map +1 -1
  58. package/dist/src/console/step-tests.js +1 -1
  59. package/dist/src/console/step-tests.js.map +1 -1
  60. package/dist/src/console/subscriptions.d.ts +38 -16
  61. package/dist/src/console/subscriptions.d.ts.map +1 -1
  62. package/dist/src/console/subscriptions.js +7 -13
  63. package/dist/src/console/subscriptions.js.map +1 -1
  64. package/dist/src/console/tenant-login-flags.d.ts +106 -0
  65. package/dist/src/console/tenant-login-flags.d.ts.map +1 -0
  66. package/dist/src/console/tenant-login-flags.js +113 -0
  67. package/dist/src/console/tenant-login-flags.js.map +1 -0
  68. package/dist/src/console/tenant-oauth-apps.d.ts +75 -14
  69. package/dist/src/console/tenant-oauth-apps.d.ts.map +1 -1
  70. package/dist/src/console/tenant-oauth-apps.js +37 -11
  71. package/dist/src/console/tenant-oauth-apps.js.map +1 -1
  72. package/dist/src/console/tokens.d.ts +2 -0
  73. package/dist/src/console/tokens.d.ts.map +1 -1
  74. package/dist/src/console/tokens.js.map +1 -1
  75. package/dist/src/console/workflows.d.ts +14 -0
  76. package/dist/src/console/workflows.d.ts.map +1 -1
  77. package/dist/src/console/workflows.js +13 -0
  78. package/dist/src/console/workflows.js.map +1 -1
  79. package/dist/src/documents.d.ts +9 -5
  80. package/dist/src/documents.d.ts.map +1 -1
  81. package/dist/src/documents.js +6 -3
  82. package/dist/src/documents.js.map +1 -1
  83. package/dist/src/functions.d.ts +149 -1
  84. package/dist/src/functions.d.ts.map +1 -1
  85. package/dist/src/functions.js +145 -0
  86. package/dist/src/functions.js.map +1 -1
  87. package/dist/src/http.d.ts +58 -10
  88. package/dist/src/http.d.ts.map +1 -1
  89. package/dist/src/http.js +82 -11
  90. package/dist/src/http.js.map +1 -1
  91. package/dist/src/me.d.ts +3 -2
  92. package/dist/src/me.d.ts.map +1 -1
  93. package/dist/src/me.js +7 -2
  94. package/dist/src/me.js.map +1 -1
  95. package/dist/src/run.d.ts +11 -2
  96. package/dist/src/run.d.ts.map +1 -1
  97. package/dist/src/run.js +11 -2
  98. package/dist/src/run.js.map +1 -1
  99. package/dist/src/server/mod.d.ts +100 -0
  100. package/dist/src/server/mod.d.ts.map +1 -0
  101. package/dist/src/server/mod.js +121 -0
  102. package/dist/src/server/mod.js.map +1 -0
  103. package/dist/src/team.d.ts +204 -0
  104. package/dist/src/team.d.ts.map +1 -0
  105. package/dist/src/team.js +161 -0
  106. package/dist/src/team.js.map +1 -0
  107. package/dist/src/types.d.ts +143 -10
  108. package/dist/src/types.d.ts.map +1 -1
  109. package/dist/src/types.js +27 -0
  110. package/dist/src/types.js.map +1 -1
  111. package/dist/src/vars.d.ts +5 -3
  112. package/dist/src/vars.d.ts.map +1 -1
  113. package/dist/src/vars.js +14 -4
  114. package/dist/src/vars.js.map +1 -1
  115. package/dist/src/version.js +1 -1
  116. package/dist/src/workflows.d.ts +261 -9
  117. package/dist/src/workflows.d.ts.map +1 -1
  118. package/dist/src/workflows.js +246 -7
  119. package/dist/src/workflows.js.map +1 -1
  120. package/package.json +5 -1
@@ -84,6 +84,11 @@ export interface LoginResponse {
84
84
  user: User;
85
85
  expiresIn: number;
86
86
  }
87
+ /** `POST /auth/refresh` → 200 (`id/auth.ts`'s `refreshHandler`). */
88
+ export interface RefreshResponse {
89
+ token: string;
90
+ expiresIn: number;
91
+ }
87
92
  /** The signed-up user, as `POST /auth/signup` returns it (`data/signup.ts:147-152`). */
88
93
  export interface SignupUser {
89
94
  id: string;
@@ -128,6 +133,17 @@ export interface SlugAvailabilityResponse {
128
133
  available: boolean;
129
134
  suggestions: string[];
130
135
  }
136
+ /** The body `createAccount` sends. An options object, matching `signup`'s
137
+ * `SignupInput` shape two methods below — `name`/`slug` are **not** sent, the
138
+ * server mints the slug from `companyName`. */
139
+ export interface CreateAccountInput {
140
+ /** The company/workspace name. Optional — the server mints the account slug from it when present. */
141
+ companyName?: string;
142
+ /** The caller's role in the company, from the signup form's dropdown. Optional. */
143
+ role?: string;
144
+ /** What the caller intends to use w6w for, from the signup form's dropdown. Optional. */
145
+ usage?: string;
146
+ }
131
147
  /** `POST /accounts` → 201 (`id/signup.ts:69-73`). The token re-issues the session
132
148
  * with the new account's claim on it. */
133
149
  export interface CreateAccountResponse {
@@ -167,6 +183,17 @@ export interface ConsoleMe {
167
183
  * accidentally granted.
168
184
  */
169
185
  tenantAdmin: boolean;
186
+ /**
187
+ * Server-decided: may this caller manage its account's team (invite, change
188
+ * a role, remove a member)? Studio-internal; not on the published `Me`.
189
+ *
190
+ * **Required, not optional, on purpose.** A client forced to branch on
191
+ * `undefined` is a client that will branch wrong; an older server that omits
192
+ * the key yields `undefined` at runtime, which is falsy, so every
193
+ * `if (me.canManageMembers)` fails CLOSED — the capability is denied, never
194
+ * accidentally granted.
195
+ */
196
+ canManageMembers: boolean;
170
197
  /** Component versions, as the published `Me` documents them. Optional and open. */
171
198
  versions?: Record<string, string>;
172
199
  }
@@ -294,6 +321,20 @@ export declare class AuthApi {
294
321
  * @throws {ApiError} On any non-2xx, e.g. `401` for invalid credentials.
295
322
  */
296
323
  login(identifier: string, password: string): Promise<LoginResponse>;
324
+ /**
325
+ * Mint a fresh token for the CURRENT session — same identity (subject,
326
+ * tenant, role, account, any admin claim), just a renewed lifetime. The
327
+ * sliding-session mechanism: a client that keeps calling this while a
328
+ * user is active never sees the original token's `exp` arrive.
329
+ *
330
+ * AUTHENTICATED — the default `requireAuth` applies (a caller with no
331
+ * token has no session to extend).
332
+ *
333
+ * @returns The new token and its lifetime in seconds.
334
+ * @throws {ApiError} `401` if the CURRENT token is already invalid/expired
335
+ * — refreshing cannot resurrect a session that has already lapsed.
336
+ */
337
+ refresh(): Promise<RefreshResponse>;
297
338
  /**
298
339
  * Self-serve signup: creates the user and mints a `role: "user"` session.
299
340
  *
@@ -326,12 +367,11 @@ export declare class AuthApi {
326
367
  * adopting it downgrades an operator; this method never writes the session
327
368
  * itself, the caller decides.
328
369
  *
329
- * @param name - The account's display name.
330
- * @param slug - The account's slug.
370
+ * @param input - The optional company name, role and use-case from the signup form.
331
371
  * @returns The created account, a re-issued token carrying its claim, and the token's lifetime.
332
372
  * @throws {ApiError} On any non-2xx, e.g. `409` when the slug is taken.
333
373
  */
334
- createAccount(name: string, slug: string): Promise<CreateAccountResponse>;
374
+ createAccount(input: CreateAccountInput): Promise<CreateAccountResponse>;
335
375
  /**
336
376
  * Read the caller's identity **and its tenant-admin capability**.
337
377
  *
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/console/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAQ,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,QAAQ;IACvB,2BAA2B;IAC3B,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/D;AAED,qFAAqF;AACrF,MAAM,WAAW,IAAI;IACnB,QAAQ,EAAE,MAAM,C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AO,IAAI,OAAO,CAAC,eAAe,CAAC;IAQzC;;;;;;;;;OASG;IACG,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC;IAUzD;;;;;;;;;;;OAWG;IACG,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAUvE;;;;;;;;;;;OAWG;IACG,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAS9E;;;;;;;;;;;;;;;;OAgBG;IACG,KAAK,IAAI,OAAO,CAAC,SAAS,CAAC;IAQjC;;;;;;;;;OASG;IACG,UAAU,IAAI,OAAO,CAAC,WAAW,CAAC;IAKxC;;;;;;;;OAQG;IACG,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC;IASpE;;;;;;;;;;OAUG;IACG,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ3E;;;;;;;;;;OAUG;IACG,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,WAAW,CAAC;IASlF;;;;;;;;;;OAUG;IACG,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9C;;;;;;;;;;OAUG;IACG,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAStD;;;;;;;;;;;;;;OAcG;IACG,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAO1D"}
@@ -111,6 +111,26 @@ export class AuthApi {
111
111
  });
112
112
  return res.body;
113
113
  }
114
+ /**
115
+ * Mint a fresh token for the CURRENT session — same identity (subject,
116
+ * tenant, role, account, any admin claim), just a renewed lifetime. The
117
+ * sliding-session mechanism: a client that keeps calling this while a
118
+ * user is active never sees the original token's `exp` arrive.
119
+ *
120
+ * AUTHENTICATED — the default `requireAuth` applies (a caller with no
121
+ * token has no session to extend).
122
+ *
123
+ * @returns The new token and its lifetime in seconds.
124
+ * @throws {ApiError} `401` if the CURRENT token is already invalid/expired
125
+ * — refreshing cannot resurrect a session that has already lapsed.
126
+ */
127
+ async refresh() {
128
+ const res = await this.#host.request({
129
+ method: "POST",
130
+ path: "/auth/refresh",
131
+ });
132
+ return res.body;
133
+ }
114
134
  /**
115
135
  * Self-serve signup: creates the user and mints a `role: "user"` session.
116
136
  *
@@ -159,16 +179,15 @@ export class AuthApi {
159
179
  * adopting it downgrades an operator; this method never writes the session
160
180
  * itself, the caller decides.
161
181
  *
162
- * @param name - The account's display name.
163
- * @param slug - The account's slug.
182
+ * @param input - The optional company name, role and use-case from the signup form.
164
183
  * @returns The created account, a re-issued token carrying its claim, and the token's lifetime.
165
184
  * @throws {ApiError} On any non-2xx, e.g. `409` when the slug is taken.
166
185
  */
167
- async createAccount(name, slug) {
186
+ async createAccount(input) {
168
187
  const res = await this.#host.request({
169
188
  method: "POST",
170
189
  path: "/accounts",
171
- body: { name, slug },
190
+ body: input,
172
191
  });
173
192
  return res.body;
174
193
  }
@@ -1 +1 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/console/auth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAEH,OAAO,EAAqB,IAAI,EAAuB,MAAM,YAAY,CAAC;AAqM1E,+FAA+F;AAC/F,SAAS,aAAa,CAAC,IAAiB;IACtC,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IACtC,OAAO,EAAE,GAAG,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;AAC/C,CAAC;AAyCD;;;;;;;;;;GAUG;AACH,MAAM,OAAO,OAAO;IACT,KAAK,CAAW;IAEzB;;OAEG;IACH,YAAY,IAAc;QACxB,IAAI,CAA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ACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,oBAAoB,CAAC,KAAgC;QACzD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAc;YAChD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,sBAAsB;YAC5B,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;QACH,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,aAAa,CAAC,EAAU;QAC5B,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAA,gBAAgB,EAAE,EAAE,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,cAAc,CAAC,EAAU;QAC7B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAc;YAChD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAA,gBAAgB,EAAE,UAAU;YACtC,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;QACH,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,WAAW,CAAC,KAAuB;QACvC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAU;YAChC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;IACL,CAAC;CACF"}
@@ -0,0 +1,428 @@
1
+ /**
2
+ * `client.console.commerce.*` — the checked-in plan catalog, and the caller's
3
+ * own resolved subscription.
4
+ *
5
+ * **Studio-internal, not the published partner contract.** This namespace
6
+ * lives under the `console` subpath export (`@w6w/sdk/console`), excluded from
7
+ * `endpoints.json` and from the root barrel (`mod.ts`) — see `docs/console.md`
8
+ * and this task's contract. `@w6w/sdk`'s instance-state mechanism pin still
9
+ * applies here exactly as it does to every other namespace
10
+ * (`docs/implementation.md` §MECHANISM PIN — instance state, never globals):
11
+ * this class holds no state of its own beyond the injected host, so two
12
+ * clients in one process never share a credential.
13
+ *
14
+ * **The public/guarded split is per METHOD, not per file, exactly like
15
+ * `console.auth`.** `plans()` is registered above the auth guard
16
+ * (`packages/server/packages/api/commerce/plans-route.ts`'s own doc comment:
17
+ * "PUBLIC: registered above the auth guard by `commerce/edge.ts`") and reads
18
+ * nothing from the request, so it passes `requireAuth: false` and the
19
+ * transport never even attempts to attach a bearer. `subscription()` derives
20
+ * the account from the JWT (`subscription-route.ts`'s own doc comment:
21
+ * "GUARDED") and uses the default, unconditional `requireAuth`.
22
+ *
23
+ * **Both responses carry an envelope key — unlike `console.dashboard`.** The
24
+ * server answers `c.json({ plans: … })` (`plans-route.ts`) and
25
+ * `c.json({ subscription: { plan, status, canUpgrade } })`
26
+ * (`subscription-route.ts`), so both methods here call this package's
27
+ * `unwrap()` helper rather than returning `res.body` verbatim.
28
+ *
29
+ * **`allowance()` (W-12) is the caller's own EFFECTIVE allowance, credits and
30
+ * current-month usage** — `GET /commerce/allowance`, AUTHENTICATED like
31
+ * `subscription()`, unwrapped from the `allowance` envelope. `credits.balance`
32
+ * is SIGNED and never clamped: negative means over by that many executions.
33
+ * Egress-pinned: never `reason`, `setBy`, `grantedBy`, `grants`, `override` or
34
+ * a `/stripe/i` key at any depth — those are operator/control-internal, not
35
+ * account-facing. Any non-200 (including a 424 `control_unavailable` or an old
36
+ * control's 404 `text/plain`) is treated as "unavailable" by callers.
37
+ *
38
+ * @module
39
+ */
40
+ import type { HttpResponse, RequestOptions } from "../http.ts";
41
+ /**
42
+ * The slice of `W6WClient` this namespace needs: the transport, and nothing
43
+ * else. Structural rather than a concrete client type, so the namespace stays
44
+ * independently constructible in a test and this module never imports the
45
+ * client back — mirrors `ReliabilityHost` in `./reliability.ts`.
46
+ */
47
+ export interface CommerceHost {
48
+ /** Perform one request. */
49
+ request<T>(options: RequestOptions): Promise<HttpResponse<T>>;
50
+ }
51
+ /** A quota on some countable resource, as `PlanQuotas`' fields each carry one. */
52
+ export type Quota = {
53
+ readonly kind: "unlimited";
54
+ } | {
55
+ readonly kind: "custom";
56
+ } | {
57
+ readonly kind: "capped";
58
+ readonly included: number;
59
+ } | {
60
+ readonly kind: "metered";
61
+ readonly included: number;
62
+ readonly per: number;
63
+ readonly unitAmount: number;
64
+ };
65
+ /** The monitor-cadence limit: how often a health check may run. */
66
+ export interface MonitorLimit {
67
+ readonly quota: Quota;
68
+ readonly minCadenceMinutes: number | "custom";
69
+ }
70
+ /** How long check-run bodies and metadata are retained. */
71
+ export interface RetentionLimit {
72
+ readonly bodiesDays: number | "custom";
73
+ readonly metadataDays: number | "custom";
74
+ }
75
+ /** Every countable resource a plan bounds. */
76
+ export interface PlanQuotas {
77
+ readonly runs: Quota;
78
+ /** Concurrent runs — the server's own `parallelExecutions` dimension. */
79
+ readonly parallelExecutions: Quota;
80
+ readonly monitors: MonitorLimit;
81
+ readonly retention: RetentionLimit;
82
+ readonly projects: Quota;
83
+ readonly seats: Quota;
84
+ }
85
+ /** Whether a plan may self-host, and the annual surcharge if so. */
86
+ export interface SelfHostLicence {
87
+ readonly available: boolean;
88
+ readonly annualSurcharge: number | null;
89
+ }
90
+ /** The feature toggles a plan grants. */
91
+ export interface PlanCapabilities {
92
+ readonly catalogImport: boolean;
93
+ readonly privateRegistry: boolean;
94
+ readonly implSwapAndConfig: boolean;
95
+ readonly versionPinsAndBlocks: boolean;
96
+ readonly egressCaptureExport: boolean;
97
+ readonly embeddedWhiteLabel: boolean;
98
+ readonly sso: boolean;
99
+ readonly auditLog: boolean;
100
+ readonly rbac: boolean;
101
+ readonly dataResidency: boolean;
102
+ readonly selfHostLicence: SelfHostLicence;
103
+ }
104
+ /** A plan's support tier. */
105
+ export type SupportLevel = "community" | "email" | "email-1-business-day" | "sla-named-contact-dpa";
106
+ /** Everything a plan bounds or grants: quotas, capabilities, and support level. */
107
+ export interface PlanLimits {
108
+ readonly quotas: PlanQuotas;
109
+ readonly capabilities: PlanCapabilities;
110
+ readonly support: SupportLevel;
111
+ }
112
+ /** Which cadence a {@link PlanPricePoint} recurs on. */
113
+ export type BillingInterval = "month" | "year";
114
+ /**
115
+ * One published price point. `unitAmount` is integer cents charged per ONE
116
+ * `interval` — an annual point's amount is what is charged once a year, NOT a
117
+ * monthly equivalent, so `$500/yr` arrives as `50000` beside a monthly `5000`.
118
+ *
119
+ * Both figures are authored server-side and neither is derived from the other.
120
+ * A client may compute a saving percentage from the pair for DISPLAY; nothing
121
+ * should reconstruct a price from one and a rate.
122
+ */
123
+ export interface PlanPricePoint {
124
+ readonly unitAmount: number;
125
+ readonly interval: BillingInterval;
126
+ }
127
+ /**
128
+ * The `price` arm of a plan — exactly what `plans-route.ts`'s `toWirePlan`
129
+ * allowlists. Never `productId`/`lookupKey`/`metered`: the rail (Stripe) is an
130
+ * implementation detail and the product id / lookup key are server
131
+ * configuration, not published pricing.
132
+ *
133
+ * Only the `billable` arm carries price data. `none` (Free) and
134
+ * `contact-sales` (Enterprise) carry no amount, no interval and no currency.
135
+ */
136
+ export type PlanPrice = {
137
+ readonly kind: "none";
138
+ } | {
139
+ readonly kind: "contact-sales";
140
+ } | {
141
+ readonly kind: "billable";
142
+ readonly currency: "usd";
143
+ readonly monthly: PlanPricePoint;
144
+ /** `null` when the plan is offered monthly only. */
145
+ readonly annual: PlanPricePoint | null;
146
+ };
147
+ /** One entry in the checked-in plan catalog, as `GET /commerce/plans` returns it. */
148
+ export interface Plan {
149
+ /** `"free" | "team" | "business" | "enterprise"` today, typed `string` on the wire. */
150
+ readonly key: string;
151
+ readonly name: string;
152
+ readonly description: string;
153
+ readonly rank: number;
154
+ readonly retired: boolean;
155
+ /** Whether an upgrade INTO this plan must go through sales rather than self-serve checkout — true only for `enterprise` today. Optional/forward-compatible on this SDK copy: absent means false. */
156
+ readonly topTier?: boolean;
157
+ readonly features: readonly string[];
158
+ readonly limits: PlanLimits;
159
+ readonly price: PlanPrice;
160
+ }
161
+ /**
162
+ * The caller's resolved subscription, as `GET /commerce/subscription`
163
+ * returns it. `status` is the SUBSCRIPTION's status, never a vendor/HTTP
164
+ * status; `plan` is a catalog key, not a display name. Named
165
+ * `CommerceSubscription` rather than the bare `Subscription` — that name is
166
+ * already taken by `console/subscriptions.ts` (webhook-trigger
167
+ * subscriptions, an unrelated domain despite the shared word).
168
+ */
169
+ export interface CommerceSubscription {
170
+ readonly plan: string;
171
+ readonly status: string;
172
+ readonly canUpgrade: boolean;
173
+ }
174
+ /**
175
+ * One entry in the caller's own invoice history, as `GET /commerce/invoices`
176
+ * returns it. `id` is OUR id (`commerce.invoice.id`), never a Stripe id;
177
+ * `status` is Stripe's own vocabulary, verbatim. Newest first, ordered
178
+ * server-side by `createdAt` — not `issuedAt`, which is nullable and
179
+ * therefore not a total order for a hand-entered SLA row.
180
+ */
181
+ export interface Invoice {
182
+ readonly id: string;
183
+ readonly number: string | null;
184
+ readonly status: string;
185
+ readonly amountDueCents: number;
186
+ readonly amountPaidCents: number;
187
+ readonly currency: string;
188
+ readonly hostedInvoiceUrl: string | null;
189
+ readonly issuedAt: string | null;
190
+ readonly dueAt: string | null;
191
+ readonly createdAt: string;
192
+ }
193
+ /** Which cadence a checkout is for — mirrors `PlanPrice`'s own `BillingInterval`. */
194
+ export type CheckoutInterval = "month" | "year";
195
+ /** `client.console.commerce.checkout()`'s input. */
196
+ export interface CheckoutInput {
197
+ readonly planKey: string;
198
+ readonly interval: CheckoutInterval;
199
+ }
200
+ /**
201
+ * `POST /commerce/checkout`'s response — a hosted Stripe payment page URL,
202
+ * and NOTHING else: never a raw Checkout Session id, price id or product id
203
+ * (the server's own D-3 rule — no Stripe id crosses the wire in either
204
+ * direction).
205
+ */
206
+ export interface CheckoutResult {
207
+ readonly url: string;
208
+ }
209
+ /** `client.console.commerce.confirmCheckout()`'s input — the `checkout_session_id` the browser was redirected back with. */
210
+ export interface ConfirmCheckoutInput {
211
+ readonly sessionId: string;
212
+ }
213
+ /**
214
+ * `POST /commerce/contact-sales`'s input. `account` is never sent by the
215
+ * caller — the server stamps it from the bearer's own principal.
216
+ */
217
+ export interface ContactSalesInput {
218
+ readonly name: string;
219
+ readonly email: string;
220
+ readonly company?: string;
221
+ readonly message: string;
222
+ }
223
+ /** `POST /commerce/contact-sales`'s response. */
224
+ export interface ContactSalesResult {
225
+ readonly id: string;
226
+ }
227
+ /** `client.console.commerce.previewSubscriptionChange()` / `.changeSubscription()`'s shared input. */
228
+ export interface ChangeSubscriptionInput {
229
+ readonly planKey: string;
230
+ readonly interval: CheckoutInterval;
231
+ }
232
+ /**
233
+ * `POST /commerce/subscription/preview`'s response — what Stripe would
234
+ * charge (positive) or credit (negative) TODAY for this change, in integer
235
+ * cents. Never a raw Stripe invoice object; never rounded/clamped — a large
236
+ * negative value here is a large credit, expected when moving off a
237
+ * part-used ANNUAL plan (Stripe carries the excess forward to future
238
+ * invoices automatically — see the server's `SubscriptionChangeService`).
239
+ */
240
+ export interface SubscriptionChangePreview {
241
+ readonly amountDueCents: number;
242
+ readonly currency: string;
243
+ }
244
+ /**
245
+ * `POST /commerce/subscription/change`'s response. `subscription` here is
246
+ * NARROWER than {@link CommerceSubscription} — no `canUpgrade` — the server
247
+ * has no reason to recompute it against the wire's own move; re-fetch
248
+ * `subscription()` if the caller needs it refreshed.
249
+ */
250
+ export interface SubscriptionChangeResult {
251
+ readonly subscription: {
252
+ readonly plan: string;
253
+ readonly status: string;
254
+ };
255
+ readonly charge: SubscriptionChangePreview;
256
+ }
257
+ /**
258
+ * A metered/countable dimension's value as `GET /commerce/allowance` states
259
+ * it — a real number, or one of the catalog's two non-numeric arms. Mirrors
260
+ * the vocabulary of `PlanQuotas`' own `Quota.kind` but is deliberately flat
261
+ * (W-12): this endpoint reports one EFFECTIVE number per dimension, never a
262
+ * `{kind, included}` shape.
263
+ */
264
+ export type AllowanceValue = number | "unlimited" | "custom";
265
+ /**
266
+ * The caller's own accrued extra-usage balance (HITL-1 (b) — "extra
267
+ * executions", not a Stripe balance credit and not a comped plan). `balance`
268
+ * is SIGNED and never clamped: `granted - consumed`, so a negative value means
269
+ * the account is over by that many executions.
270
+ */
271
+ export interface AccountAllowanceCredits {
272
+ readonly granted: number;
273
+ readonly consumed: number;
274
+ readonly balance: number;
275
+ }
276
+ /**
277
+ * The account's effective per-dimension limits for the current month — the
278
+ * override where the operator set one, the catalog value otherwise. Same 8
279
+ * dimensions `PlanQuotas`/`PlanLimits` bound, flattened to one
280
+ * {@link AllowanceValue} each; no `override`/`metered` field travels on this
281
+ * wire (that provenance is operator/control-internal, never account-facing —
282
+ * see this module's egress pin).
283
+ */
284
+ export interface AccountAllowanceLimits {
285
+ readonly runs: AllowanceValue;
286
+ readonly parallelExecutions: AllowanceValue;
287
+ readonly monitors: AllowanceValue;
288
+ readonly monitorMinCadenceMinutes: AllowanceValue;
289
+ readonly retentionBodiesDays: AllowanceValue;
290
+ readonly retentionMetadataDays: AllowanceValue;
291
+ readonly projects: AllowanceValue;
292
+ readonly seats: AllowanceValue;
293
+ }
294
+ /**
295
+ * `GET /commerce/allowance`'s response (W-12) — the caller's own effective
296
+ * allowance, credits and current-month usage. `month` is the reporting month
297
+ * (`"YYYY-MM"`); `executions` is actual usage so far; `included` is the
298
+ * effective monthly allowance; `overage` is executions beyond `included`,
299
+ * reported but not consumed by this SDK's own callers (no enforcement,
300
+ * HITL-3).
301
+ */
302
+ export interface AccountAllowance {
303
+ readonly month: string;
304
+ readonly executions: number;
305
+ readonly included: AllowanceValue;
306
+ readonly overage: number;
307
+ readonly credits: AccountAllowanceCredits;
308
+ readonly limits: AccountAllowanceLimits;
309
+ readonly customTerms: boolean;
310
+ }
311
+ /**
312
+ * The `console.commerce` namespace on a `W6WClient`.
313
+ *
314
+ * @example
315
+ * ```ts
316
+ * const plans = await client.console.commerce.plans();
317
+ * const { canUpgrade } = await client.console.commerce.subscription();
318
+ * ```
319
+ */
320
+ export declare class CommerceApi {
321
+ #private;
322
+ /**
323
+ * @param host - The client this namespace issues requests through.
324
+ */
325
+ constructor(host: CommerceHost);
326
+ /**
327
+ * Fetch the checked-in plan catalog.
328
+ *
329
+ * PUBLIC — sends no bearer, even on a client that already holds one
330
+ * (`requireAuth: false`): the route reads nothing from the request and its
331
+ * output is byte-identical for every caller.
332
+ *
333
+ * @returns The catalog, unwrapped from the `plans` envelope.
334
+ * @throws {ApiError} On any non-2xx.
335
+ */
336
+ plans(): Promise<Plan[]>;
337
+ /**
338
+ * Fetch the caller's own resolved subscription.
339
+ *
340
+ * AUTHENTICATED — the default `requireAuth` applies: the account is
341
+ * derived server-side from the principal.
342
+ *
343
+ * @returns The subscription, unwrapped from the `subscription` envelope.
344
+ * @throws {ApiError} On any non-2xx, e.g. `409` when the resolved plan key
345
+ * is not in the catalog or is ambiguous.
346
+ */
347
+ subscription(): Promise<CommerceSubscription>;
348
+ /**
349
+ * Fetch the caller's own invoice history, newest first.
350
+ *
351
+ * AUTHENTICATED — the default `requireAuth` applies: the account is
352
+ * derived server-side from the principal.
353
+ *
354
+ * @returns The invoices, unwrapped from the `invoices` envelope.
355
+ * @throws {ApiError} On any non-2xx.
356
+ */
357
+ invoices(): Promise<Invoice[]>;
358
+ /**
359
+ * Open a live Stripe Checkout Session for a billable plan/interval.
360
+ * AUTHENTICATED — the account is resolved server-side from the bearer.
361
+ *
362
+ * @returns The hosted payment page URL. Redirect the browser to it
363
+ * (`window.location.href = url`); do not fetch it.
364
+ * @throws {ApiError} `409 plan_not_billable` for a `contact-sales`/`none`
365
+ * plan or an interval the plan doesn't offer; `409 price_not_synced` if
366
+ * the catalog says billable but Stripe has no matching active price yet;
367
+ * `409 plan_not_self_serve` if the account's CURRENT plan is a top-tier
368
+ * plan — an upgrade off it goes through sales, not self-serve checkout.
369
+ */
370
+ checkout(input: CheckoutInput): Promise<CheckoutResult>;
371
+ /**
372
+ * Confirm a Checkout Session on return from Stripe (the
373
+ * `checkout_session_id` query param `checkout()`'s success URL carries
374
+ * back). Verified against Stripe itself, never trusted from the URL alone
375
+ * — see the server's `CheckoutService` for what this deliberately does not
376
+ * cover (no webhook yet: a session completed after the tab closed is
377
+ * invisible to it).
378
+ *
379
+ * @returns The confirmed subscription.
380
+ * @throws {ApiError} `404 checkout_session_not_found`; `403
381
+ * checkout_session_mismatch` if the session belongs to a different
382
+ * account; `409 checkout_not_paid` if payment hasn't completed yet.
383
+ */
384
+ confirmCheckout(input: ConfirmCheckoutInput): Promise<CommerceSubscription>;
385
+ /**
386
+ * Submit an Enterprise "contact sales" lead. AUTHENTICATED — captured
387
+ * durably server-side regardless of whether outbound mail is configured
388
+ * (see the server's `ContactSalesService`).
389
+ */
390
+ contactSales(input: ContactSalesInput): Promise<ContactSalesResult>;
391
+ /**
392
+ * Preview what moving the CALLER'S OWN existing subscription to a
393
+ * different plan/interval would charge or credit TODAY, without applying
394
+ * anything. AUTHENTICATED.
395
+ *
396
+ * @throws {ApiError} `409 no_active_subscription` if the account has no
397
+ * active Stripe subscription to change — use {@link checkout} instead;
398
+ * `409 plan_not_self_serve` if the account's CURRENT plan is a top-tier
399
+ * plan — an upgrade off it goes through sales, not self-serve checkout.
400
+ */
401
+ previewSubscriptionChange(input: ChangeSubscriptionInput): Promise<SubscriptionChangePreview>;
402
+ /**
403
+ * Apply the change {@link previewSubscriptionChange} previewed — moves the
404
+ * caller's existing Stripe subscription to the new plan/interval with
405
+ * proration, and charges/credits the net difference immediately.
406
+ * AUTHENTICATED.
407
+ *
408
+ * @throws {ApiError} `409 no_active_subscription` if the account has no
409
+ * active Stripe subscription to change — use {@link checkout} instead;
410
+ * `409 plan_not_self_serve` if the account's CURRENT plan is a top-tier
411
+ * plan — an upgrade off it goes through sales, not self-serve checkout.
412
+ */
413
+ changeSubscription(input: ChangeSubscriptionInput): Promise<SubscriptionChangeResult>;
414
+ /**
415
+ * Fetch the caller's own effective allowance, credits and current-month
416
+ * usage (W-12).
417
+ *
418
+ * AUTHENTICATED — the default `requireAuth` applies: the account is
419
+ * derived server-side from the principal.
420
+ *
421
+ * @returns The allowance, unwrapped from the `allowance` envelope.
422
+ * @throws {ApiError} On any non-2xx, including `424 control_unavailable`
423
+ * when the host cannot reach control — callers should treat ANY non-200
424
+ * here as "unavailable", not just this one code.
425
+ */
426
+ allowance(): Promise<AccountAllowance>;
427
+ }
428
+ //# sourceMappingURL=commerce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commerce.d.ts","sourceRoot":"","sources":["../../../src/console/commerce.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG/D;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,2BAA2B;IAC3B,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/D;AAED,kFAAkF;AAClF,MAAM,MAAM,KAAK,GACb;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACtD;IACA,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEJ,mEAAmE;AACnE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,iBAAiB,EAAE,MAAM,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