@farthershore/client 0.3.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 (34) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +6 -0
  3. package/dist/index.js +74 -16
  4. package/dist/types/api.generated.d.ts +15 -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 +55 -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 +25 -25
  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 +298 -183
  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/version.d.ts +2 -2
  34. package/package.json +1 -1
@@ -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
  };