@farthershore/client 0.2.0 → 0.4.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 +18 -0
  2. package/README.md +7 -1
  3. package/dist/index.js +113 -16
  4. package/dist/types/api.generated.d.ts +23 -5
  5. package/dist/types/envelope.d.ts +2 -0
  6. package/dist/types/errors.d.ts +13 -0
  7. package/dist/types/generated/schemas.d.ts +68 -17
  8. package/dist/types/index.d.ts +1 -1
  9. package/dist/types/operations/agents.d.ts +9 -9
  10. package/dist/types/operations/agreements.d.ts +7 -7
  11. package/dist/types/operations/analytics.d.ts +5 -5
  12. package/dist/types/operations/audit-notifications.d.ts +6 -6
  13. package/dist/types/operations/auth.d.ts +4 -4
  14. package/dist/types/operations/backends.d.ts +8 -11
  15. package/dist/types/operations/billing.d.ts +4 -4
  16. package/dist/types/operations/businesses.d.ts +38 -24
  17. package/dist/types/operations/change-sets.d.ts +6 -6
  18. package/dist/types/operations/consumers.d.ts +13 -13
  19. package/dist/types/operations/define.d.ts +6 -2
  20. package/dist/types/operations/environments.d.ts +5 -4
  21. package/dist/types/operations/frontend.d.ts +2 -2
  22. package/dist/types/operations/index.d.ts +308 -182
  23. package/dist/types/operations/maker-tokens.d.ts +9 -9
  24. package/dist/types/operations/organizations.d.ts +21 -21
  25. package/dist/types/operations/personas.d.ts +8 -8
  26. package/dist/types/operations/plans-usage.d.ts +3 -3
  27. package/dist/types/operations/platform.d.ts +12 -12
  28. package/dist/types/operations/portal.d.ts +11 -11
  29. package/dist/types/operations/promo-codes.d.ts +15 -5
  30. package/dist/types/operations/variables.d.ts +22 -8
  31. package/dist/types/operations/webhooks.d.ts +105 -12
  32. package/dist/types/surface-types.d.ts +16 -10
  33. package/dist/types/types.d.ts +3 -0
  34. package/dist/types/version.d.ts +2 -2
  35. package/package.json +1 -1
@@ -3,6 +3,11 @@ import { type ListQuery, type RequestBody } from "./define.js";
3
3
  type BusinessRef = {
4
4
  businessId: string;
5
5
  };
6
+ /** One docs file sent to `businesses.docs.validate`, by repo-relative path. */
7
+ export type DocsValidateFile = {
8
+ path: string;
9
+ content: string;
10
+ };
6
11
  /** `env` selects a preview environment by name; omit it for production. */
7
12
  type EnvScoped = BusinessRef & {
8
13
  env?: string;
@@ -72,7 +77,7 @@ export declare const businessOperations: {
72
77
  previewEnvTrigger: "BRANCH_PREFIX" | "PULL_REQUEST" | "DISABLED";
73
78
  createdAt: string;
74
79
  updatedAt: string;
75
- }[]>;
80
+ }[], false>;
76
81
  "businesses.read": import("./define.js").OperationEntry<EnvScoped, {
77
82
  id: string;
78
83
  organizationId: string | null;
@@ -135,7 +140,7 @@ export declare const businessOperations: {
135
140
  createdAt: string;
136
141
  updatedAt: string;
137
142
  environments: import("../generated/schemas.js").components["schemas"]["BusinessEnvironment"][];
138
- }>;
143
+ }, false>;
139
144
  "businesses.create": import("./define.js").OperationEntry<{
140
145
  name: string;
141
146
  description?: string;
@@ -163,13 +168,13 @@ export declare const businessOperations: {
163
168
  instructions: string;
164
169
  agentsMdUrl: string;
165
170
  };
166
- }>;
167
- "businesses.delete": import("./define.js").OperationEntry<BusinessRef, void, void>;
171
+ }, false>;
172
+ "businesses.delete": import("./define.js").OperationEntry<BusinessRef, void, void, false>;
168
173
  "businesses.routes.read": import("./define.js").OperationEntry<EnvScoped, {
169
174
  routes: import("../generated/schemas.js").components["schemas"]["BusinessRoute"][];
170
175
  }, {
171
176
  routes: import("../generated/schemas.js").components["schemas"]["BusinessRoute"][];
172
- }>;
177
+ }, false>;
173
178
  "businesses.contract.read": import("./define.js").OperationEntry<EnvScoped, {
174
179
  plans: import("../generated/schemas.js").components["schemas"]["ContractPlan"][];
175
180
  unreadablePlans?: {
@@ -196,7 +201,7 @@ export declare const businessOperations: {
196
201
  metered: import("../generated/schemas.js").components["schemas"]["ContractRoute"][];
197
202
  unmetered: import("../generated/schemas.js").components["schemas"]["ContractRoute"][];
198
203
  unmeteredWrites: import("../generated/schemas.js").components["schemas"]["ContractRoute"][];
199
- }>;
204
+ }, false>;
200
205
  "businesses.config.read": import("./define.js").OperationEntry<EnvScoped, {
201
206
  businessId: string;
202
207
  environment: {
@@ -223,7 +228,7 @@ export declare const businessOperations: {
223
228
  acceptedAt: string | null;
224
229
  repositorySyncStatus: ("PENDING" | "SYNCED" | "FAILED" | "SKIPPED") | null;
225
230
  commitSha: string | null;
226
- }>;
231
+ }, false>;
227
232
  "businesses.configAttempts.read": import("./define.js").OperationEntry<BusinessRef, {
228
233
  businessId: string;
229
234
  environment: {
@@ -238,7 +243,7 @@ export declare const businessOperations: {
238
243
  production: boolean;
239
244
  };
240
245
  attempts: import("../generated/schemas.js").components["schemas"]["BusinessConfigAttempt"][];
241
- }>;
246
+ }, false>;
242
247
  "businesses.subdomainAvailability.read": import("./define.js").OperationEntry<{
243
248
  subdomain: string;
244
249
  }, {
@@ -249,7 +254,7 @@ export declare const businessOperations: {
249
254
  subdomain: string;
250
255
  available: boolean;
251
256
  message?: string;
252
- }>;
257
+ }, false>;
253
258
  "businesses.status": import("./define.js").OperationEntry<EnvScoped, {
254
259
  data: import("../generated/schemas.js").components["schemas"]["DeploymentRun"][];
255
260
  applies: import("../generated/schemas.js").components["schemas"]["DeploymentApply"][];
@@ -274,7 +279,7 @@ export declare const businessOperations: {
274
279
  live: boolean;
275
280
  scopedLive: boolean;
276
281
  serving: import("../generated/schemas.js").components["schemas"]["ServingState"];
277
- }>;
282
+ }, false>;
278
283
  "businesses.publish": import("./define.js").OperationEntry<BusinessRef & PublishBusinessBody, {
279
284
  id: string;
280
285
  organizationId: string | null;
@@ -337,7 +342,7 @@ export declare const businessOperations: {
337
342
  createdAt: string;
338
343
  updatedAt: string;
339
344
  _release: import("../generated/schemas.js").components["schemas"]["PublishRelease"];
340
- }>;
345
+ }, true>;
341
346
  "businesses.rollback": import("./define.js").OperationEntry<BusinessRef & {
342
347
  workflowExecutionId: string;
343
348
  reason?: string;
@@ -349,7 +354,7 @@ export declare const businessOperations: {
349
354
  businessId: string;
350
355
  status: string;
351
356
  rollbackWorkflowExecutionId: string;
352
- }>;
357
+ }, false>;
353
358
  "businesses.compile": import("./define.js").OperationEntry<BusinessRef & {
354
359
  ir: unknown;
355
360
  env?: string;
@@ -387,7 +392,16 @@ export declare const businessOperations: {
387
392
  }[];
388
393
  } | null;
389
394
  economicChange: boolean;
390
- }>;
395
+ }, false>;
396
+ "businesses.docs.validate": import("./define.js").OperationEntry<BusinessRef & {
397
+ env?: string;
398
+ } & {
399
+ files: readonly DocsValidateFile[];
400
+ }, {
401
+ issues: import("../generated/schemas.js").components["schemas"]["DocsCheckIssue"][];
402
+ }, {
403
+ issues: import("../generated/schemas.js").components["schemas"]["DocsCheckIssue"][];
404
+ }, false>;
391
405
  "businesses.brand.update": import("./define.js").OperationEntry<BusinessRef & {
392
406
  env?: string;
393
407
  } & {
@@ -452,15 +466,15 @@ export declare const businessOperations: {
452
466
  previewEnvTrigger: "BRANCH_PREFIX" | "PULL_REQUEST" | "DISABLED";
453
467
  createdAt: string;
454
468
  updatedAt: string;
455
- }>;
469
+ }, false>;
456
470
  "businesses.brand.uploadAsset": import("./define.js").OperationEntry<BusinessRef & {
457
471
  kind: "icon" | "logo";
458
472
  body: Uint8Array;
459
473
  contentType: string;
460
- }, BrandAssetUploadResult, BrandAssetUploadResult>;
474
+ }, BrandAssetUploadResult, BrandAssetUploadResult, false>;
461
475
  "businesses.brand.deleteAsset": import("./define.js").OperationEntry<BusinessRef & {
462
476
  kind: "icon" | "logo";
463
- }, void, void>;
477
+ }, void, void, false>;
464
478
  "businesses.previewEnv.set": import("./define.js").OperationEntry<BusinessRef & {
465
479
  env?: string;
466
480
  } & {
@@ -525,7 +539,7 @@ export declare const businessOperations: {
525
539
  previewEnvTrigger: "BRANCH_PREFIX" | "PULL_REQUEST" | "DISABLED";
526
540
  createdAt: string;
527
541
  updatedAt: string;
528
- }>;
542
+ }, false>;
529
543
  "businesses.docs.enable": import("./define.js").OperationEntry<EnvScoped, {
530
544
  id: string;
531
545
  organizationId: string | null;
@@ -586,7 +600,7 @@ export declare const businessOperations: {
586
600
  previewEnvTrigger: "BRANCH_PREFIX" | "PULL_REQUEST" | "DISABLED";
587
601
  createdAt: string;
588
602
  updatedAt: string;
589
- }>;
603
+ }, false>;
590
604
  "businesses.docs.disable": import("./define.js").OperationEntry<EnvScoped, {
591
605
  id: string;
592
606
  organizationId: string | null;
@@ -647,7 +661,7 @@ export declare const businessOperations: {
647
661
  previewEnvTrigger: "BRANCH_PREFIX" | "PULL_REQUEST" | "DISABLED";
648
662
  createdAt: string;
649
663
  updatedAt: string;
650
- }>;
664
+ }, false>;
651
665
  "businesses.cors.update": import("./define.js").OperationEntry<BusinessRef & {
652
666
  env?: string;
653
667
  } & {
@@ -712,7 +726,7 @@ export declare const businessOperations: {
712
726
  previewEnvTrigger: "BRANCH_PREFIX" | "PULL_REQUEST" | "DISABLED";
713
727
  createdAt: string;
714
728
  updatedAt: string;
715
- }>;
729
+ }, false>;
716
730
  "businesses.rbac.read": import("./define.js").OperationEntry<BusinessRef, {
717
731
  id: string;
718
732
  organizationId: string | null;
@@ -775,21 +789,21 @@ export declare const businessOperations: {
775
789
  createdAt: string;
776
790
  updatedAt: string;
777
791
  environments: import("../generated/schemas.js").components["schemas"]["BusinessEnvironment"][];
778
- }>;
792
+ }, false>;
779
793
  "businesses.rbac.enable": import("./define.js").OperationEntry<BusinessRef, {
780
794
  rbacEnabled: boolean;
781
795
  }, {
782
796
  rbacEnabled: boolean;
783
- }>;
797
+ }, false>;
784
798
  "businesses.rbac.disable": import("./define.js").OperationEntry<BusinessRef, {
785
799
  rbacEnabled: boolean;
786
800
  }, {
787
801
  rbacEnabled: boolean;
788
- }>;
802
+ }, false>;
789
803
  "businesses.rbac.subjects.read": import("./define.js").OperationEntry<BusinessRef, {
790
804
  subjects: import("../generated/schemas.js").components["schemas"]["CustomPermissionSubject"][];
791
805
  }, {
792
806
  subjects: import("../generated/schemas.js").components["schemas"]["CustomPermissionSubject"][];
793
- }>;
807
+ }, false>;
794
808
  };
795
809
  export {};
@@ -17,7 +17,7 @@ export declare const changeSetOperations: {
17
17
  }, {
18
18
  data: import("../generated/schemas.js").components["schemas"]["ApplyTimelineEntry"][];
19
19
  environmentId: string | null;
20
- }>;
20
+ }, false>;
21
21
  "changeSets.timeline.read": import("./define.js").OperationEntry<EnvScoped & {
22
22
  /** An entry id, release tag, PR number, branch, or commit-SHA prefix. */
23
23
  selector: string;
@@ -227,7 +227,7 @@ export declare const changeSetOperations: {
227
227
  cohorts: number;
228
228
  reasons: string[];
229
229
  }[];
230
- }>;
230
+ }, false>;
231
231
  "changeSets.propose": import("./define.js").OperationEntry<EnvScoped & {
232
232
  subscriberId: string;
233
233
  } & {
@@ -282,7 +282,7 @@ export declare const changeSetOperations: {
282
282
  actorId: string;
283
283
  intent: string;
284
284
  operationCount: number;
285
- }>;
285
+ }, true>;
286
286
  "changeSets.preview": import("./define.js").OperationEntry<EnvScoped & {
287
287
  subscriberId: string;
288
288
  } & {
@@ -363,7 +363,7 @@ export declare const changeSetOperations: {
363
363
  updatedAt: string;
364
364
  appliedAt: string | null;
365
365
  rolledBackAt: string | null;
366
- }>;
366
+ }, false>;
367
367
  "changeSets.proposalList": import("./define.js").OperationEntry<EnvScoped & {
368
368
  subscriberId: string;
369
369
  } & {
@@ -376,7 +376,7 @@ export declare const changeSetOperations: {
376
376
  }, {
377
377
  items: import("../generated/schemas.js").components["schemas"]["ChangeSet"][];
378
378
  nextCursor: string | null;
379
- }>;
379
+ }, false>;
380
380
  "changeSets.proposalRead": import("./define.js").OperationEntry<EnvScoped & {
381
381
  subscriberId: string;
382
382
  } & {
@@ -457,6 +457,6 @@ export declare const changeSetOperations: {
457
457
  updatedAt: string;
458
458
  appliedAt: string | null;
459
459
  rolledBackAt: string | null;
460
- }>;
460
+ }, false>;
461
461
  };
462
462
  export {};
@@ -47,7 +47,7 @@ export declare const consumerOperations: {
47
47
  }[];
48
48
  };
49
49
  members: import("../generated/schemas.js").components["schemas"]["ConsumerMember"][];
50
- }[]>;
50
+ }[], false>;
51
51
  "consumers.block": import("./define.js").OperationEntry<SubscriberRef, {
52
52
  blocked: true;
53
53
  subscriberId: string;
@@ -58,7 +58,7 @@ export declare const consumerOperations: {
58
58
  subscriberId: string;
59
59
  apiKeysRevoked: number;
60
60
  alreadyBlocked: boolean;
61
- }>;
61
+ }, false>;
62
62
  "consumers.remove": import("./define.js").OperationEntry<SubscriberRef, {
63
63
  removed: true;
64
64
  subscriberId: string;
@@ -69,7 +69,7 @@ export declare const consumerOperations: {
69
69
  subscriberId: string;
70
70
  subscriptionsRemoved: number;
71
71
  apiKeysRevoked: number;
72
- }>;
72
+ }, false>;
73
73
  "consumers.migrateLatest": import("./define.js").OperationEntry<SubscriberRef, {
74
74
  migrated: true;
75
75
  subscriberId: string;
@@ -84,7 +84,7 @@ export declare const consumerOperations: {
84
84
  migrated: false;
85
85
  subscriberId: string;
86
86
  reason: "already_on_head" | "no_active_head";
87
- }>;
87
+ }, false>;
88
88
  "consumers.roles.assign": import("./define.js").OperationEntry<SubscriberRef & {
89
89
  userExternalId: string;
90
90
  roles: string[];
@@ -96,7 +96,7 @@ export declare const consumerOperations: {
96
96
  userExternalId: string;
97
97
  accountRole: "owner" | "admin" | "member";
98
98
  businessRoleKeys: string[];
99
- }>;
99
+ }, false>;
100
100
  "consumers.rbac.enable": import("./define.js").OperationEntry<SubscriberRef & {
101
101
  defaultRoleKey?: string | null;
102
102
  }, {
@@ -105,7 +105,7 @@ export declare const consumerOperations: {
105
105
  }, {
106
106
  enabled: boolean;
107
107
  defaultRoleKey: string | null;
108
- }>;
108
+ }, false>;
109
109
  "consumers.rbac.disable": import("./define.js").OperationEntry<SubscriberRef & {
110
110
  defaultRoleKey?: string | null;
111
111
  }, {
@@ -114,12 +114,12 @@ export declare const consumerOperations: {
114
114
  }, {
115
115
  enabled: boolean;
116
116
  defaultRoleKey: string | null;
117
- }>;
117
+ }, false>;
118
118
  "consumers.role.list": import("./define.js").OperationEntry<SubscriberRef, {
119
119
  roles: import("../generated/schemas.js").components["schemas"]["ConsumerRbacRole"][];
120
120
  }, {
121
121
  roles: import("../generated/schemas.js").components["schemas"]["ConsumerRbacRole"][];
122
- }>;
122
+ }, false>;
123
123
  "consumers.role.create": import("./define.js").OperationEntry<SubscriberRef & {
124
124
  roleKey: string;
125
125
  name: string;
@@ -136,7 +136,7 @@ export declare const consumerOperations: {
136
136
  permissions: string[];
137
137
  kind: "ACCOUNT" | "CUSTOM";
138
138
  createdAt: string;
139
- }>;
139
+ }, false>;
140
140
  "consumers.role.update": import("./define.js").OperationEntry<SubscriberRef & {
141
141
  roleKey: string;
142
142
  } & {
@@ -154,15 +154,15 @@ export declare const consumerOperations: {
154
154
  permissions: string[];
155
155
  kind: "ACCOUNT" | "CUSTOM";
156
156
  createdAt: string;
157
- }>;
158
- "consumers.role.delete": import("./define.js").OperationEntry<RoleRef, void, void>;
157
+ }, false>;
158
+ "consumers.role.delete": import("./define.js").OperationEntry<RoleRef, void, void, false>;
159
159
  "consumers.apiKeys.list": import("./define.js").OperationEntry<SubscriberRef, {
160
160
  apiKeys: import("../generated/schemas.js").components["schemas"]["ConsumerApiKey"][];
161
161
  }, {
162
162
  apiKeys: import("../generated/schemas.js").components["schemas"]["ConsumerApiKey"][];
163
- }>;
163
+ }, false>;
164
164
  "consumers.apiKeys.revoke": import("./define.js").OperationEntry<SubscriberRef & {
165
165
  keyId: string;
166
- }, void, void>;
166
+ }, void, void, false>;
167
167
  };
168
168
  export {};
@@ -24,12 +24,14 @@ export type OperationContext = {
24
24
  * `{ dryRun, wouldHave }` envelope; it is the output itself unless the
25
25
  * operation previews a different shape.
26
26
  */
27
- export type OperationEntry<I, O, W = O> = {
27
+ export type OperationEntry<I, O, W = O, P extends boolean = boolean> = {
28
28
  /**
29
29
  * The opKey this method serves, or `null` for the few calls that have none
30
30
  * (credential introspection, the portal plane).
31
31
  */
32
32
  readonly op: string | null;
33
+ /** Literal capability carried into the public method overloads. */
34
+ readonly preview: P;
33
35
  /**
34
36
  * One line, for a method that is not the opKey's primary method (it shares
35
37
  * the opKey with it) or that has no opKey. Primary methods take their
@@ -62,7 +64,9 @@ export type OperationEntry<I, O, W = O> = {
62
64
  * (when a preview returns a different shape than the write) the preview's
63
65
  * `wouldHave`.
64
66
  */
65
- export declare function operation<I, O, W = O>(entry: OperationEntry<I, O, W>): OperationEntry<I, O, W>;
67
+ export declare function operation<I, O, W = O>(entry: Omit<OperationEntry<I, O, W, false>, "preview">): OperationEntry<I, O, W, false>;
68
+ /** Declare a primary method whose operation spec supports dry-run previews. */
69
+ export declare function previewOperation<I, O, W = O>(entry: Omit<OperationEntry<I, O, W, true>, "preview">): OperationEntry<I, O, W, true>;
66
70
  /** Input type of an entry. */
67
71
  export type InputOf<E> = E extends OperationEntry<infer I, unknown> ? I : never;
68
72
  /** Output type of an entry. */
@@ -21,10 +21,9 @@ export declare const environmentOperations: {
21
21
  offset: number;
22
22
  hasMore: boolean;
23
23
  };
24
- }>;
24
+ }, false>;
25
25
  "environments.create": import("./define.js").OperationEntry<{
26
26
  businessId: string;
27
- name: string;
28
27
  branch: string;
29
28
  }, {
30
29
  id: string;
@@ -34,6 +33,7 @@ export declare const environmentOperations: {
34
33
  runtimeHostname: string;
35
34
  portalHostname: string | null;
36
35
  status: string;
36
+ secretInheritanceUnavailableReason?: string | null;
37
37
  created: boolean;
38
38
  branchCreated: boolean;
39
39
  }, {
@@ -44,12 +44,13 @@ export declare const environmentOperations: {
44
44
  runtimeHostname: string;
45
45
  portalHostname: string | null;
46
46
  status: string;
47
+ secretInheritanceUnavailableReason?: string | null;
47
48
  created: boolean;
48
49
  branchCreated: boolean;
49
- }>;
50
+ }, false>;
50
51
  /** Resolves with no body; an environment already gone also resolves. */
51
52
  "environments.delete": import("./define.js").OperationEntry<{
52
53
  businessId: string;
53
54
  environment: string;
54
- }, void, void>;
55
+ }, void, void, false>;
55
56
  };
@@ -12,7 +12,7 @@ export declare const frontendOperations: {
12
12
  status: import("../generated/schemas.js").components["schemas"]["FrontendServeState"];
13
13
  releases: import("../generated/schemas.js").components["schemas"]["FrontendRelease"][];
14
14
  builds: import("../generated/schemas.js").components["schemas"]["FrontendBuild"][];
15
- }>;
15
+ }, false>;
16
16
  "frontend.rollback": import("./define.js").OperationEntry<{
17
17
  businessId: string;
18
18
  releaseId: string;
@@ -27,5 +27,5 @@ export declare const frontendOperations: {
27
27
  releaseId: string;
28
28
  buildId: string;
29
29
  environmentId: string | null;
30
- }>;
30
+ }, true>;
31
31
  };