@farthershore/client 0.1.0 → 0.2.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.
Files changed (35) hide show
  1. package/CHANGELOG.md +162 -0
  2. package/README.md +9 -8
  3. package/dist/index.js +66 -54
  4. package/dist/types/api.generated.d.ts +13 -7
  5. package/dist/types/generated/schemas.d.ts +3670 -0
  6. package/dist/types/helpers/wait-for-frontend-build.d.ts +12 -4
  7. package/dist/types/index.d.ts +2 -2
  8. package/dist/types/operations/agents.d.ts +204 -12
  9. package/dist/types/operations/agreements.d.ts +139 -9
  10. package/dist/types/operations/analytics.d.ts +27 -5
  11. package/dist/types/operations/audit-notifications.d.ts +64 -7
  12. package/dist/types/operations/auth.d.ts +12 -4
  13. package/dist/types/operations/backends.d.ts +211 -9
  14. package/dist/types/operations/billing.d.ts +60 -4
  15. package/dist/types/operations/businesses.d.ts +730 -27
  16. package/dist/types/operations/change-sets.d.ts +426 -7
  17. package/dist/types/operations/consumers.d.ts +133 -14
  18. package/dist/types/operations/define.d.ts +16 -5
  19. package/dist/types/operations/environments.d.ts +40 -4
  20. package/dist/types/operations/frontend.d.ts +20 -2
  21. package/dist/types/operations/index.d.ts +3930 -193
  22. package/dist/types/operations/maker-tokens.d.ts +175 -11
  23. package/dist/types/operations/organizations.d.ts +321 -19
  24. package/dist/types/operations/personas.d.ts +98 -8
  25. package/dist/types/operations/plans-usage.d.ts +69 -3
  26. package/dist/types/operations/platform.d.ts +420 -12
  27. package/dist/types/operations/portal.d.ts +409 -16
  28. package/dist/types/operations/promo-codes.d.ts +126 -6
  29. package/dist/types/operations/variables.d.ts +170 -7
  30. package/dist/types/operations/webhooks.d.ts +77 -14
  31. package/dist/types/surface-types.d.ts +25 -3
  32. package/dist/types/transport.d.ts +5 -10
  33. package/dist/types/types.d.ts +382 -411
  34. package/dist/types/version.d.ts +2 -2
  35. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import type { ApplyTimelineEntry, ApplyTimelineEntryList } from "../types.js";
1
+ import type { ApplyTimelineEntry } from "../types.js";
2
2
  type EnvScoped = {
3
3
  businessId: string;
4
4
  env?: string;
@@ -11,33 +11,452 @@ type EnvScoped = {
11
11
  */
12
12
  export declare function selectTimelineEntry(entries: readonly ApplyTimelineEntry[], selector: string): ApplyTimelineEntry | undefined;
13
13
  export declare const changeSetOperations: {
14
- "changeSets.timeline.list": import("./define.js").OperationEntry<EnvScoped, ApplyTimelineEntryList>;
14
+ "changeSets.timeline.list": import("./define.js").OperationEntry<EnvScoped, {
15
+ data: import("../generated/schemas.js").components["schemas"]["ApplyTimelineEntry"][];
16
+ environmentId: string | null;
17
+ }, {
18
+ data: import("../generated/schemas.js").components["schemas"]["ApplyTimelineEntry"][];
19
+ environmentId: string | null;
20
+ }>;
15
21
  "changeSets.timeline.read": import("./define.js").OperationEntry<EnvScoped & {
16
22
  /** An entry id, release tag, PR number, branch, or commit-SHA prefix. */
17
23
  selector: string;
18
- }, ApplyTimelineEntry>;
24
+ }, {
25
+ id: string;
26
+ source: "github_pr" | "github_push" | "github_release";
27
+ status: "pending" | "running" | "passed" | "failed" | "applied" | "deferred" | "stale";
28
+ branch: string;
29
+ baseBranch: string | null;
30
+ defaultBranch: string | null;
31
+ commitSha: string;
32
+ repoFullName: string;
33
+ prNumber: number | null;
34
+ releaseTag: string | null;
35
+ environmentId: string | null;
36
+ createdAt: string;
37
+ updatedAt: string;
38
+ semanticDiff: {
39
+ diffSummary: {
40
+ hasChanges: boolean;
41
+ productFieldChanges: number;
42
+ gatewayFieldChanges: number;
43
+ billingFieldChanges: number;
44
+ plansAdded: number;
45
+ plansRemoved: number;
46
+ plansModified: number;
47
+ pricingPoliciesChanged: number;
48
+ economicChange: boolean;
49
+ } | null;
50
+ semanticChanges: {
51
+ domain: "economic_contract" | "entitlement_surface" | "operational_policy" | "compatibility_lifecycle";
52
+ kind: string;
53
+ path: string;
54
+ from: unknown;
55
+ to: unknown;
56
+ additive: boolean;
57
+ rationale?: string;
58
+ }[] | null;
59
+ riskSummary: {
60
+ level: "safe" | "non_blocking" | "economic_risk" | "blocking";
61
+ byDomain: {
62
+ economic_contract: "safe" | "non_blocking" | "economic_risk" | "blocking";
63
+ entitlement_surface: "safe" | "non_blocking" | "economic_risk" | "blocking";
64
+ operational_policy: "safe" | "non_blocking" | "economic_risk" | "blocking";
65
+ compatibility_lifecycle: "safe" | "non_blocking" | "economic_risk" | "blocking";
66
+ };
67
+ blockingReasons: string[];
68
+ } | null;
69
+ lifecyclePlan: {
70
+ requiresSubscriptionMigration: boolean;
71
+ actions: {
72
+ domain: "economic_contract" | "entitlement_surface" | "operational_policy" | "compatibility_lifecycle";
73
+ action: "no_op" | "migrate_at_renewal" | "migrate_immediately" | "replay" | "block";
74
+ rationale: string;
75
+ }[];
76
+ } | null;
77
+ };
78
+ checks: {
79
+ name: string;
80
+ status: "pending" | "running" | "passed" | "failed" | "skipped";
81
+ summary: string | null;
82
+ }[];
83
+ apply: {
84
+ id: string;
85
+ overallStatus: "pending" | "running" | "succeeded" | "failed" | "skipped";
86
+ phases: {
87
+ build: {
88
+ status: "pending" | "running" | "succeeded" | "failed" | "skipped";
89
+ startedAt: string | null;
90
+ finishedAt: string | null;
91
+ error: string | null;
92
+ };
93
+ compile: {
94
+ status: "pending" | "running" | "succeeded" | "failed" | "skipped";
95
+ startedAt: string | null;
96
+ finishedAt: string | null;
97
+ error: string | null;
98
+ };
99
+ accept: {
100
+ status: "pending" | "running" | "succeeded" | "failed" | "skipped";
101
+ startedAt: string | null;
102
+ finishedAt: string | null;
103
+ error: string | null;
104
+ };
105
+ publish: {
106
+ status: "pending" | "running" | "succeeded" | "failed" | "skipped";
107
+ startedAt: string | null;
108
+ finishedAt: string | null;
109
+ error: string | null;
110
+ };
111
+ billing: {
112
+ status: "pending" | "running" | "succeeded" | "failed" | "skipped";
113
+ startedAt: string | null;
114
+ finishedAt: string | null;
115
+ error: string | null;
116
+ } | null;
117
+ };
118
+ } | null;
119
+ existingSubscribers?: {
120
+ planKey: string;
121
+ fromCompiledPlanId: string;
122
+ toCompiledPlanId: string;
123
+ timing: "aliased" | "immediate" | "period_end";
124
+ cohorts: number;
125
+ reasons: string[];
126
+ }[];
127
+ }, {
128
+ id: string;
129
+ source: "github_pr" | "github_push" | "github_release";
130
+ status: "pending" | "running" | "passed" | "failed" | "applied" | "deferred" | "stale";
131
+ branch: string;
132
+ baseBranch: string | null;
133
+ defaultBranch: string | null;
134
+ commitSha: string;
135
+ repoFullName: string;
136
+ prNumber: number | null;
137
+ releaseTag: string | null;
138
+ environmentId: string | null;
139
+ createdAt: string;
140
+ updatedAt: string;
141
+ semanticDiff: {
142
+ diffSummary: {
143
+ hasChanges: boolean;
144
+ productFieldChanges: number;
145
+ gatewayFieldChanges: number;
146
+ billingFieldChanges: number;
147
+ plansAdded: number;
148
+ plansRemoved: number;
149
+ plansModified: number;
150
+ pricingPoliciesChanged: number;
151
+ economicChange: boolean;
152
+ } | null;
153
+ semanticChanges: {
154
+ domain: "economic_contract" | "entitlement_surface" | "operational_policy" | "compatibility_lifecycle";
155
+ kind: string;
156
+ path: string;
157
+ from: unknown;
158
+ to: unknown;
159
+ additive: boolean;
160
+ rationale?: string;
161
+ }[] | null;
162
+ riskSummary: {
163
+ level: "safe" | "non_blocking" | "economic_risk" | "blocking";
164
+ byDomain: {
165
+ economic_contract: "safe" | "non_blocking" | "economic_risk" | "blocking";
166
+ entitlement_surface: "safe" | "non_blocking" | "economic_risk" | "blocking";
167
+ operational_policy: "safe" | "non_blocking" | "economic_risk" | "blocking";
168
+ compatibility_lifecycle: "safe" | "non_blocking" | "economic_risk" | "blocking";
169
+ };
170
+ blockingReasons: string[];
171
+ } | null;
172
+ lifecyclePlan: {
173
+ requiresSubscriptionMigration: boolean;
174
+ actions: {
175
+ domain: "economic_contract" | "entitlement_surface" | "operational_policy" | "compatibility_lifecycle";
176
+ action: "no_op" | "migrate_at_renewal" | "migrate_immediately" | "replay" | "block";
177
+ rationale: string;
178
+ }[];
179
+ } | null;
180
+ };
181
+ checks: {
182
+ name: string;
183
+ status: "pending" | "running" | "passed" | "failed" | "skipped";
184
+ summary: string | null;
185
+ }[];
186
+ apply: {
187
+ id: string;
188
+ overallStatus: "pending" | "running" | "succeeded" | "failed" | "skipped";
189
+ phases: {
190
+ build: {
191
+ status: "pending" | "running" | "succeeded" | "failed" | "skipped";
192
+ startedAt: string | null;
193
+ finishedAt: string | null;
194
+ error: string | null;
195
+ };
196
+ compile: {
197
+ status: "pending" | "running" | "succeeded" | "failed" | "skipped";
198
+ startedAt: string | null;
199
+ finishedAt: string | null;
200
+ error: string | null;
201
+ };
202
+ accept: {
203
+ status: "pending" | "running" | "succeeded" | "failed" | "skipped";
204
+ startedAt: string | null;
205
+ finishedAt: string | null;
206
+ error: string | null;
207
+ };
208
+ publish: {
209
+ status: "pending" | "running" | "succeeded" | "failed" | "skipped";
210
+ startedAt: string | null;
211
+ finishedAt: string | null;
212
+ error: string | null;
213
+ };
214
+ billing: {
215
+ status: "pending" | "running" | "succeeded" | "failed" | "skipped";
216
+ startedAt: string | null;
217
+ finishedAt: string | null;
218
+ error: string | null;
219
+ } | null;
220
+ };
221
+ } | null;
222
+ existingSubscribers?: {
223
+ planKey: string;
224
+ fromCompiledPlanId: string;
225
+ toCompiledPlanId: string;
226
+ timing: "aliased" | "immediate" | "period_end";
227
+ cohorts: number;
228
+ reasons: string[];
229
+ }[];
230
+ }>;
19
231
  "changeSets.propose": import("./define.js").OperationEntry<EnvScoped & {
20
232
  subscriberId: string;
21
233
  } & {
22
234
  intent: string;
23
235
  operations: unknown[];
24
- }, unknown>;
236
+ }, {
237
+ id: string;
238
+ scope: {
239
+ businessId: string;
240
+ environmentId: string | null;
241
+ subscriberId: string | null;
242
+ scopeType: "business" | "environment" | "subscriber";
243
+ };
244
+ source: "operate" | "system" | "agent";
245
+ actorType: string;
246
+ actorId: string;
247
+ intent: string;
248
+ status: "draft" | "previewed" | "approval_required" | "approved" | "scheduled" | "applied" | "failed" | "rolled_back" | "cancelled";
249
+ riskLevel: "low" | "medium" | "high" | "critical";
250
+ operations: import("../generated/schemas.js").components["schemas"]["ChangeSetOperation"][];
251
+ simulation: import("../generated/schemas.js").components["schemas"]["ChangeSetSimulation"] | null;
252
+ approvalRequirement: {
253
+ required: boolean;
254
+ minApprovals: number;
255
+ distinctFromProposer: boolean;
256
+ humanApproverRequired: boolean;
257
+ requiredVerb: string;
258
+ };
259
+ approvals: {
260
+ id: string;
261
+ approverType: string;
262
+ approverId: string;
263
+ decision: "approved" | "rejected";
264
+ comment: string | null;
265
+ soleOwner: boolean;
266
+ createdAt: string;
267
+ }[];
268
+ resetReason: ("simulation_expired" | "simulation_fingerprint_mismatch" | "version_mismatch" | "catalog_drift" | "role_deleted" | "status_conflict") | null;
269
+ scheduledFor: string | null;
270
+ createdAt: string;
271
+ updatedAt: string;
272
+ appliedAt: string | null;
273
+ rolledBackAt: string | null;
274
+ }, {
275
+ scope: {
276
+ businessId: string;
277
+ environmentId: string | null;
278
+ subscriberId: string | null;
279
+ scopeType: "business" | "environment" | "subscriber";
280
+ };
281
+ actorType: string;
282
+ actorId: string;
283
+ intent: string;
284
+ operationCount: number;
285
+ }>;
25
286
  "changeSets.preview": import("./define.js").OperationEntry<EnvScoped & {
26
287
  subscriberId: string;
27
288
  } & {
28
289
  changeSetId: string;
29
- }, unknown>;
290
+ }, {
291
+ id: string;
292
+ scope: {
293
+ businessId: string;
294
+ environmentId: string | null;
295
+ subscriberId: string | null;
296
+ scopeType: "business" | "environment" | "subscriber";
297
+ };
298
+ source: "operate" | "system" | "agent";
299
+ actorType: string;
300
+ actorId: string;
301
+ intent: string;
302
+ status: "draft" | "previewed" | "approval_required" | "approved" | "scheduled" | "applied" | "failed" | "rolled_back" | "cancelled";
303
+ riskLevel: "low" | "medium" | "high" | "critical";
304
+ operations: import("../generated/schemas.js").components["schemas"]["ChangeSetOperation"][];
305
+ simulation: import("../generated/schemas.js").components["schemas"]["ChangeSetSimulation"] | null;
306
+ approvalRequirement: {
307
+ required: boolean;
308
+ minApprovals: number;
309
+ distinctFromProposer: boolean;
310
+ humanApproverRequired: boolean;
311
+ requiredVerb: string;
312
+ };
313
+ approvals: {
314
+ id: string;
315
+ approverType: string;
316
+ approverId: string;
317
+ decision: "approved" | "rejected";
318
+ comment: string | null;
319
+ soleOwner: boolean;
320
+ createdAt: string;
321
+ }[];
322
+ resetReason: ("simulation_expired" | "simulation_fingerprint_mismatch" | "version_mismatch" | "catalog_drift" | "role_deleted" | "status_conflict") | null;
323
+ scheduledFor: string | null;
324
+ createdAt: string;
325
+ updatedAt: string;
326
+ appliedAt: string | null;
327
+ rolledBackAt: string | null;
328
+ }, {
329
+ id: string;
330
+ scope: {
331
+ businessId: string;
332
+ environmentId: string | null;
333
+ subscriberId: string | null;
334
+ scopeType: "business" | "environment" | "subscriber";
335
+ };
336
+ source: "operate" | "system" | "agent";
337
+ actorType: string;
338
+ actorId: string;
339
+ intent: string;
340
+ status: "draft" | "previewed" | "approval_required" | "approved" | "scheduled" | "applied" | "failed" | "rolled_back" | "cancelled";
341
+ riskLevel: "low" | "medium" | "high" | "critical";
342
+ operations: import("../generated/schemas.js").components["schemas"]["ChangeSetOperation"][];
343
+ simulation: import("../generated/schemas.js").components["schemas"]["ChangeSetSimulation"] | null;
344
+ approvalRequirement: {
345
+ required: boolean;
346
+ minApprovals: number;
347
+ distinctFromProposer: boolean;
348
+ humanApproverRequired: boolean;
349
+ requiredVerb: string;
350
+ };
351
+ approvals: {
352
+ id: string;
353
+ approverType: string;
354
+ approverId: string;
355
+ decision: "approved" | "rejected";
356
+ comment: string | null;
357
+ soleOwner: boolean;
358
+ createdAt: string;
359
+ }[];
360
+ resetReason: ("simulation_expired" | "simulation_fingerprint_mismatch" | "version_mismatch" | "catalog_drift" | "role_deleted" | "status_conflict") | null;
361
+ scheduledFor: string | null;
362
+ createdAt: string;
363
+ updatedAt: string;
364
+ appliedAt: string | null;
365
+ rolledBackAt: string | null;
366
+ }>;
30
367
  "changeSets.proposalList": import("./define.js").OperationEntry<EnvScoped & {
31
368
  subscriberId: string;
32
369
  } & {
33
370
  status?: string;
34
371
  cursor?: string;
35
372
  limit?: number;
36
- }, unknown>;
373
+ }, {
374
+ items: import("../generated/schemas.js").components["schemas"]["ChangeSet"][];
375
+ nextCursor: string | null;
376
+ }, {
377
+ items: import("../generated/schemas.js").components["schemas"]["ChangeSet"][];
378
+ nextCursor: string | null;
379
+ }>;
37
380
  "changeSets.proposalRead": import("./define.js").OperationEntry<EnvScoped & {
38
381
  subscriberId: string;
39
382
  } & {
40
383
  changeSetId: string;
41
- }, unknown>;
384
+ }, {
385
+ id: string;
386
+ scope: {
387
+ businessId: string;
388
+ environmentId: string | null;
389
+ subscriberId: string | null;
390
+ scopeType: "business" | "environment" | "subscriber";
391
+ };
392
+ source: "operate" | "system" | "agent";
393
+ actorType: string;
394
+ actorId: string;
395
+ intent: string;
396
+ status: "draft" | "previewed" | "approval_required" | "approved" | "scheduled" | "applied" | "failed" | "rolled_back" | "cancelled";
397
+ riskLevel: "low" | "medium" | "high" | "critical";
398
+ operations: import("../generated/schemas.js").components["schemas"]["ChangeSetOperation"][];
399
+ simulation: import("../generated/schemas.js").components["schemas"]["ChangeSetSimulation"] | null;
400
+ approvalRequirement: {
401
+ required: boolean;
402
+ minApprovals: number;
403
+ distinctFromProposer: boolean;
404
+ humanApproverRequired: boolean;
405
+ requiredVerb: string;
406
+ };
407
+ approvals: {
408
+ id: string;
409
+ approverType: string;
410
+ approverId: string;
411
+ decision: "approved" | "rejected";
412
+ comment: string | null;
413
+ soleOwner: boolean;
414
+ createdAt: string;
415
+ }[];
416
+ resetReason: ("simulation_expired" | "simulation_fingerprint_mismatch" | "version_mismatch" | "catalog_drift" | "role_deleted" | "status_conflict") | null;
417
+ scheduledFor: string | null;
418
+ createdAt: string;
419
+ updatedAt: string;
420
+ appliedAt: string | null;
421
+ rolledBackAt: string | null;
422
+ }, {
423
+ id: string;
424
+ scope: {
425
+ businessId: string;
426
+ environmentId: string | null;
427
+ subscriberId: string | null;
428
+ scopeType: "business" | "environment" | "subscriber";
429
+ };
430
+ source: "operate" | "system" | "agent";
431
+ actorType: string;
432
+ actorId: string;
433
+ intent: string;
434
+ status: "draft" | "previewed" | "approval_required" | "approved" | "scheduled" | "applied" | "failed" | "rolled_back" | "cancelled";
435
+ riskLevel: "low" | "medium" | "high" | "critical";
436
+ operations: import("../generated/schemas.js").components["schemas"]["ChangeSetOperation"][];
437
+ simulation: import("../generated/schemas.js").components["schemas"]["ChangeSetSimulation"] | null;
438
+ approvalRequirement: {
439
+ required: boolean;
440
+ minApprovals: number;
441
+ distinctFromProposer: boolean;
442
+ humanApproverRequired: boolean;
443
+ requiredVerb: string;
444
+ };
445
+ approvals: {
446
+ id: string;
447
+ approverType: string;
448
+ approverId: string;
449
+ decision: "approved" | "rejected";
450
+ comment: string | null;
451
+ soleOwner: boolean;
452
+ createdAt: string;
453
+ }[];
454
+ resetReason: ("simulation_expired" | "simulation_fingerprint_mismatch" | "version_mismatch" | "catalog_drift" | "role_deleted" | "status_conflict") | null;
455
+ scheduledFor: string | null;
456
+ createdAt: string;
457
+ updatedAt: string;
458
+ appliedAt: string | null;
459
+ rolledBackAt: string | null;
460
+ }>;
42
461
  };
43
462
  export {};
@@ -1,4 +1,3 @@
1
- import type { BlockConsumerResult, BusinessConsumer, ConsumerApiKey, ConsumerMemberRolesResult, ConsumerRbacRole, ConsumerRbacSettingsResult, RemoveConsumerResult } from "../types.js";
2
1
  type SubscriberRef = {
3
2
  businessId: string;
4
3
  subscriberId: string;
@@ -10,40 +9,160 @@ export declare const consumerOperations: {
10
9
  "consumers.read": import("./define.js").OperationEntry<{
11
10
  businessId: string;
12
11
  env?: string;
13
- }, BusinessConsumer[]>;
14
- "consumers.block": import("./define.js").OperationEntry<SubscriberRef, BlockConsumerResult>;
15
- "consumers.remove": import("./define.js").OperationEntry<SubscriberRef, RemoveConsumerResult>;
16
- "consumers.migrateLatest": import("./define.js").OperationEntry<SubscriberRef, unknown>;
12
+ }, {
13
+ id: string;
14
+ businessId: string;
15
+ status: "ONBOARDING" | "ACTIVE" | "SUSPENDED";
16
+ ownerType: "personal_organization" | "team_organization";
17
+ ownerOrganizationId: string | null;
18
+ ownerName: string | null;
19
+ planId: string | null;
20
+ planName: string | null;
21
+ onLatestPlan: boolean;
22
+ createdAt: string;
23
+ rbac: {
24
+ enabled: boolean;
25
+ roles: {
26
+ roleKey: string;
27
+ name: string;
28
+ }[];
29
+ };
30
+ members: import("../generated/schemas.js").components["schemas"]["ConsumerMember"][];
31
+ }[], {
32
+ id: string;
33
+ businessId: string;
34
+ status: "ONBOARDING" | "ACTIVE" | "SUSPENDED";
35
+ ownerType: "personal_organization" | "team_organization";
36
+ ownerOrganizationId: string | null;
37
+ ownerName: string | null;
38
+ planId: string | null;
39
+ planName: string | null;
40
+ onLatestPlan: boolean;
41
+ createdAt: string;
42
+ rbac: {
43
+ enabled: boolean;
44
+ roles: {
45
+ roleKey: string;
46
+ name: string;
47
+ }[];
48
+ };
49
+ members: import("../generated/schemas.js").components["schemas"]["ConsumerMember"][];
50
+ }[]>;
51
+ "consumers.block": import("./define.js").OperationEntry<SubscriberRef, {
52
+ blocked: true;
53
+ subscriberId: string;
54
+ apiKeysRevoked: number;
55
+ alreadyBlocked: boolean;
56
+ }, {
57
+ blocked: true;
58
+ subscriberId: string;
59
+ apiKeysRevoked: number;
60
+ alreadyBlocked: boolean;
61
+ }>;
62
+ "consumers.remove": import("./define.js").OperationEntry<SubscriberRef, {
63
+ removed: true;
64
+ subscriberId: string;
65
+ subscriptionsRemoved: number;
66
+ apiKeysRevoked: number;
67
+ }, {
68
+ removed: true;
69
+ subscriberId: string;
70
+ subscriptionsRemoved: number;
71
+ apiKeysRevoked: number;
72
+ }>;
73
+ "consumers.migrateLatest": import("./define.js").OperationEntry<SubscriberRef, {
74
+ migrated: true;
75
+ subscriberId: string;
76
+ } | {
77
+ migrated: false;
78
+ subscriberId: string;
79
+ reason: "already_on_head" | "no_active_head";
80
+ }, {
81
+ migrated: true;
82
+ subscriberId: string;
83
+ } | {
84
+ migrated: false;
85
+ subscriberId: string;
86
+ reason: "already_on_head" | "no_active_head";
87
+ }>;
17
88
  "consumers.roles.assign": import("./define.js").OperationEntry<SubscriberRef & {
18
89
  userExternalId: string;
19
90
  roles: string[];
20
- }, ConsumerMemberRolesResult>;
91
+ }, {
92
+ userExternalId: string;
93
+ accountRole: "owner" | "admin" | "member";
94
+ businessRoleKeys: string[];
95
+ }, {
96
+ userExternalId: string;
97
+ accountRole: "owner" | "admin" | "member";
98
+ businessRoleKeys: string[];
99
+ }>;
21
100
  "consumers.rbac.enable": import("./define.js").OperationEntry<SubscriberRef & {
22
101
  defaultRoleKey?: string | null;
23
- }, ConsumerRbacSettingsResult>;
102
+ }, {
103
+ enabled: boolean;
104
+ defaultRoleKey: string | null;
105
+ }, {
106
+ enabled: boolean;
107
+ defaultRoleKey: string | null;
108
+ }>;
24
109
  "consumers.rbac.disable": import("./define.js").OperationEntry<SubscriberRef & {
25
110
  defaultRoleKey?: string | null;
26
- }, ConsumerRbacSettingsResult>;
111
+ }, {
112
+ enabled: boolean;
113
+ defaultRoleKey: string | null;
114
+ }, {
115
+ enabled: boolean;
116
+ defaultRoleKey: string | null;
117
+ }>;
27
118
  "consumers.role.list": import("./define.js").OperationEntry<SubscriberRef, {
28
- roles: ConsumerRbacRole[];
119
+ roles: import("../generated/schemas.js").components["schemas"]["ConsumerRbacRole"][];
120
+ }, {
121
+ roles: import("../generated/schemas.js").components["schemas"]["ConsumerRbacRole"][];
29
122
  }>;
30
123
  "consumers.role.create": import("./define.js").OperationEntry<SubscriberRef & {
31
124
  roleKey: string;
32
125
  name: string;
33
126
  permissions: string[];
34
- }, ConsumerRbacRole>;
127
+ }, {
128
+ roleKey: string;
129
+ name: string;
130
+ permissions: string[];
131
+ kind: "ACCOUNT" | "CUSTOM";
132
+ createdAt: string;
133
+ }, {
134
+ roleKey: string;
135
+ name: string;
136
+ permissions: string[];
137
+ kind: "ACCOUNT" | "CUSTOM";
138
+ createdAt: string;
139
+ }>;
35
140
  "consumers.role.update": import("./define.js").OperationEntry<SubscriberRef & {
36
141
  roleKey: string;
37
142
  } & {
38
143
  name?: string;
39
144
  permissions?: string[];
40
- }, ConsumerRbacRole>;
41
- "consumers.role.delete": import("./define.js").OperationEntry<RoleRef, void>;
145
+ }, {
146
+ roleKey: string;
147
+ name: string;
148
+ permissions: string[];
149
+ kind: "ACCOUNT" | "CUSTOM";
150
+ createdAt: string;
151
+ }, {
152
+ roleKey: string;
153
+ name: string;
154
+ permissions: string[];
155
+ kind: "ACCOUNT" | "CUSTOM";
156
+ createdAt: string;
157
+ }>;
158
+ "consumers.role.delete": import("./define.js").OperationEntry<RoleRef, void, void>;
42
159
  "consumers.apiKeys.list": import("./define.js").OperationEntry<SubscriberRef, {
43
- apiKeys: ConsumerApiKey[];
160
+ apiKeys: import("../generated/schemas.js").components["schemas"]["ConsumerApiKey"][];
161
+ }, {
162
+ apiKeys: import("../generated/schemas.js").components["schemas"]["ConsumerApiKey"][];
44
163
  }>;
45
164
  "consumers.apiKeys.revoke": import("./define.js").OperationEntry<SubscriberRef & {
46
165
  keyId: string;
47
- }, void>;
166
+ }, void, void>;
48
167
  };
49
168
  export {};
@@ -18,8 +18,13 @@ export type OperationContext = {
18
18
  /** The transport options for this call (`signal`, `dryRun`, `retry`). */
19
19
  readonly options: TransportRequestOptions;
20
20
  };
21
- /** One implemented operation (or helper call) of the namespaced surface. */
22
- export type OperationEntry<I, O> = {
21
+ /**
22
+ * One implemented operation (or helper call) of the namespaced surface. `W` is
23
+ * what a preview (`{ dryRun: true }`) would have returned, inside the
24
+ * `{ dryRun, wouldHave }` envelope; it is the output itself unless the
25
+ * operation previews a different shape.
26
+ */
27
+ export type OperationEntry<I, O, W = O> = {
23
28
  /**
24
29
  * The opKey this method serves, or `null` for the few calls that have none
25
30
  * (credential introspection, the portal plane).
@@ -49,13 +54,19 @@ export type OperationEntry<I, O> = {
49
54
  /** The largest page the server returns; larger `limit`s are clamped. */
50
55
  readonly maxPageSize?: number;
51
56
  readonly run: (ctx: OperationContext, input: I) => Promise<O>;
57
+ /** Type-only: carries `W`. Never set at runtime. */
58
+ readonly __wouldHave?: W;
52
59
  };
53
- /** Declare an operation; the type parameters are its input and output. */
54
- export declare function operation<I, O>(entry: OperationEntry<I, O>): OperationEntry<I, O>;
60
+ /**
61
+ * Declare an operation; the type parameters are its input, its output, and
62
+ * (when a preview returns a different shape than the write) the preview's
63
+ * `wouldHave`.
64
+ */
65
+ export declare function operation<I, O, W = O>(entry: OperationEntry<I, O, W>): OperationEntry<I, O, W>;
55
66
  /** Input type of an entry. */
56
67
  export type InputOf<E> = E extends OperationEntry<infer I, unknown> ? I : never;
57
68
  /** Output type of an entry. */
58
- export type OutputOf<E> = E extends OperationEntry<never, infer O> ? O : never;
69
+ export type OutputOf<E> = E extends OperationEntry<never, infer O, any> ? O : never;
59
70
  /** Encode one caller-supplied value without letting it alter the path shape. */
60
71
  export declare function seg(value: string): string;
61
72
  /**