@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
@@ -1,18 +1,27 @@
1
1
  type VariableRef = {
2
2
  businessId: string;
3
3
  name: string;
4
- /** Omit for the production scope. */
4
+ /** Omit for a business-wide binding. */
5
5
  environmentId?: string;
6
6
  };
7
7
  type WriteInput = VariableRef & {
8
8
  value: string;
9
9
  };
10
+ type CreateInput = WriteInput & {
11
+ /** Exclude this business-wide secret from previews. Fixed at creation. */
12
+ productionOnly?: boolean;
13
+ };
10
14
  export declare const variableOperations: {
11
15
  "variables.read": import("./define.js").OperationEntry<{
12
16
  businessId: string;
13
17
  environmentId?: string;
14
18
  }, {
15
19
  name: string;
20
+ scope: "business-wide" | "environment" | "production-only" | "inherited";
21
+ environmentId: string | null;
22
+ productionOnly: boolean;
23
+ inheritedFrom: "main" | null;
24
+ unavailableReason: string | null;
16
25
  visibility: "public" | "secret";
17
26
  value: string | null;
18
27
  hasValue: boolean;
@@ -20,13 +29,18 @@ export declare const variableOperations: {
20
29
  version: number | null;
21
30
  }[], {
22
31
  name: string;
32
+ scope: "business-wide" | "environment" | "production-only" | "inherited";
33
+ environmentId: string | null;
34
+ productionOnly: boolean;
35
+ inheritedFrom: "main" | null;
36
+ unavailableReason: string | null;
23
37
  visibility: "public" | "secret";
24
38
  value: string | null;
25
39
  hasValue: boolean;
26
40
  lifecycleStatus: "PENDING" | "ACTIVE" | "REVOKING" | "REVOKED" | "DELETE_PENDING" | "DELETED";
27
41
  version: number | null;
28
- }[]>;
29
- "variables.create": import("./define.js").OperationEntry<WriteInput, {
42
+ }[], false>;
43
+ "variables.create": import("./define.js").OperationEntry<CreateInput, {
30
44
  operationId: string;
31
45
  kind: "CREATE" | "ROTATE" | "REVOKE" | "DELETE";
32
46
  status: "PENDING" | "PROCESSING" | "WAITING_RETRY" | "SUCCEEDED" | "ABORTED";
@@ -56,7 +70,7 @@ export declare const variableOperations: {
56
70
  } | null;
57
71
  completedAt: string | null;
58
72
  impact: import("../generated/schemas.js").components["schemas"]["SecretMutationImpact"];
59
- }>;
73
+ }, false>;
60
74
  "variables.rotate": import("./define.js").OperationEntry<WriteInput, {
61
75
  operationId: string;
62
76
  kind: "CREATE" | "ROTATE" | "REVOKE" | "DELETE";
@@ -87,7 +101,7 @@ export declare const variableOperations: {
87
101
  } | null;
88
102
  completedAt: string | null;
89
103
  impact: import("../generated/schemas.js").components["schemas"]["SecretMutationImpact"];
90
- }>;
104
+ }, false>;
91
105
  "variables.revoke": import("./define.js").OperationEntry<VariableRef, {
92
106
  operationId: string;
93
107
  kind: "CREATE" | "ROTATE" | "REVOKE" | "DELETE";
@@ -118,7 +132,7 @@ export declare const variableOperations: {
118
132
  } | null;
119
133
  completedAt: string | null;
120
134
  impact: import("../generated/schemas.js").components["schemas"]["SecretMutationImpact"];
121
- }>;
135
+ }, false>;
122
136
  "variables.delete": import("./define.js").OperationEntry<VariableRef, {
123
137
  operationId: string;
124
138
  kind: "CREATE" | "ROTATE" | "REVOKE" | "DELETE";
@@ -149,7 +163,7 @@ export declare const variableOperations: {
149
163
  } | null;
150
164
  completedAt: string | null;
151
165
  impact: import("../generated/schemas.js").components["schemas"]["SecretMutationImpact"];
152
- }>;
166
+ }, false>;
153
167
  "variables.operation.read": import("./define.js").OperationEntry<{
154
168
  businessId: string;
155
169
  operationId: string;
@@ -183,6 +197,6 @@ export declare const variableOperations: {
183
197
  } | null;
184
198
  completedAt: string | null;
185
199
  impact: import("../generated/schemas.js").components["schemas"]["SecretMutationImpact"];
186
- }>;
200
+ }, false>;
187
201
  };
188
202
  export {};
@@ -28,7 +28,7 @@ export declare const webhookOperations: {
28
28
  offset: number;
29
29
  hasMore: boolean;
30
30
  };
31
- }>;
31
+ }, false>;
32
32
  "webhooks.create": import("./define.js").OperationEntry<BusinessRef & {
33
33
  url: string;
34
34
  events: string[];
@@ -38,7 +38,7 @@ export declare const webhookOperations: {
38
38
  data: import("../generated/schemas.js").components["schemas"]["WebhookEndpointIssuance"];
39
39
  }, {
40
40
  data: import("../generated/schemas.js").components["schemas"]["WebhookEndpointIssuance"];
41
- }>;
41
+ }, false>;
42
42
  "webhooks.update": import("./define.js").OperationEntry<BusinessRef & {
43
43
  webhookId: string;
44
44
  } & {
@@ -50,7 +50,7 @@ export declare const webhookOperations: {
50
50
  data: import("../generated/schemas.js").components["schemas"]["WebhookEndpoint"];
51
51
  }, {
52
52
  data: import("../generated/schemas.js").components["schemas"]["WebhookEndpoint"];
53
- }>;
53
+ }, false>;
54
54
  "webhooks.delete": import("./define.js").OperationEntry<WebhookRef, {
55
55
  data: {
56
56
  deleted: true;
@@ -59,12 +59,12 @@ export declare const webhookOperations: {
59
59
  data: {
60
60
  deleted: true;
61
61
  };
62
- }>;
62
+ }, false>;
63
63
  "webhooks.test": import("./define.js").OperationEntry<TestInput, {
64
64
  data: import("../generated/schemas.js").components["schemas"]["WebhookTestResult"];
65
65
  }, {
66
66
  data: import("../generated/schemas.js").components["schemas"]["WebhookTestResult"];
67
- }>;
67
+ }, false>;
68
68
  "webhooks.trigger": import("./define.js").OperationEntry<BusinessRef & {
69
69
  webhookId: string;
70
70
  } & {
@@ -74,12 +74,12 @@ export declare const webhookOperations: {
74
74
  data: import("../generated/schemas.js").components["schemas"]["WebhookTestResult"];
75
75
  }, {
76
76
  data: import("../generated/schemas.js").components["schemas"]["WebhookTestResult"];
77
- }>;
77
+ }, false>;
78
78
  "webhooks.rotateSecret": import("./define.js").OperationEntry<WebhookRef, {
79
79
  data: import("../generated/schemas.js").components["schemas"]["WebhookEndpointRotation"];
80
80
  }, {
81
81
  data: import("../generated/schemas.js").components["schemas"]["WebhookEndpointRotation"];
82
- }>;
82
+ }, false>;
83
83
  "webhooks.eventType.read": import("./define.js").OperationEntry<BusinessRef, {
84
84
  data: {
85
85
  events: {
@@ -94,7 +94,7 @@ export declare const webhookOperations: {
94
94
  description: string;
95
95
  }[];
96
96
  };
97
- }>;
97
+ }, false>;
98
98
  "webhooks.delivery.read": import("./define.js").OperationEntry<BusinessRef & {
99
99
  webhookId: string;
100
100
  } & {
@@ -116,15 +116,108 @@ export declare const webhookOperations: {
116
116
  offset: number;
117
117
  hasMore: boolean;
118
118
  };
119
- }>;
119
+ }, false>;
120
120
  "webhooks.delivery.get": import("./define.js").OperationEntry<BusinessRef & {
121
121
  webhookId: string;
122
122
  } & {
123
123
  deliveryId: string;
124
124
  }, {
125
- data: import("../generated/schemas.js").components["schemas"]["WebhookDelivery"];
125
+ data: {
126
+ id: string;
127
+ eventType: string;
128
+ status: "pending" | "success" | "failed" | "dead";
129
+ attempts: number;
130
+ lastAttemptAt: string | null;
131
+ nextAttemptAt: string | null;
132
+ responseStatus: number | null;
133
+ environmentId: string | null;
134
+ createdAt: string;
135
+ payload?: {
136
+ id: string;
137
+ type: string;
138
+ createdAt: string;
139
+ businessId: string;
140
+ environmentId: string | null;
141
+ data: {
142
+ [key: string]: unknown;
143
+ };
144
+ };
145
+ responseBody?: string | null;
146
+ };
126
147
  }, {
127
- data: import("../generated/schemas.js").components["schemas"]["WebhookDelivery"];
128
- }>;
148
+ data: {
149
+ id: string;
150
+ eventType: string;
151
+ status: "pending" | "success" | "failed" | "dead";
152
+ attempts: number;
153
+ lastAttemptAt: string | null;
154
+ nextAttemptAt: string | null;
155
+ responseStatus: number | null;
156
+ environmentId: string | null;
157
+ createdAt: string;
158
+ payload?: {
159
+ id: string;
160
+ type: string;
161
+ createdAt: string;
162
+ businessId: string;
163
+ environmentId: string | null;
164
+ data: {
165
+ [key: string]: unknown;
166
+ };
167
+ };
168
+ responseBody?: string | null;
169
+ };
170
+ }, false>;
171
+ "webhooks.delivery.payload.read": import("./define.js").OperationEntry<BusinessRef & {
172
+ webhookId: string;
173
+ } & {
174
+ deliveryId: string;
175
+ }, {
176
+ data: {
177
+ id: string;
178
+ eventType: string;
179
+ status: "pending" | "success" | "failed" | "dead";
180
+ attempts: number;
181
+ lastAttemptAt: string | null;
182
+ nextAttemptAt: string | null;
183
+ responseStatus: number | null;
184
+ environmentId: string | null;
185
+ createdAt: string;
186
+ payload?: {
187
+ id: string;
188
+ type: string;
189
+ createdAt: string;
190
+ businessId: string;
191
+ environmentId: string | null;
192
+ data: {
193
+ [key: string]: unknown;
194
+ };
195
+ };
196
+ responseBody?: string | null;
197
+ };
198
+ }, {
199
+ data: {
200
+ id: string;
201
+ eventType: string;
202
+ status: "pending" | "success" | "failed" | "dead";
203
+ attempts: number;
204
+ lastAttemptAt: string | null;
205
+ nextAttemptAt: string | null;
206
+ responseStatus: number | null;
207
+ environmentId: string | null;
208
+ createdAt: string;
209
+ payload?: {
210
+ id: string;
211
+ type: string;
212
+ createdAt: string;
213
+ businessId: string;
214
+ environmentId: string | null;
215
+ data: {
216
+ [key: string]: unknown;
217
+ };
218
+ };
219
+ responseBody?: string | null;
220
+ };
221
+ }, false>;
129
222
  };
130
223
  export {};
@@ -38,19 +38,23 @@ export type DryRunPreview<O> = {
38
38
  type PreviewCallOptions = CallOptions & {
39
39
  dryRun: true;
40
40
  };
41
- /** A method whose input may be omitted: a preview resolves to `DryRunPreview<O>`. */
42
- type OptionalInputFn<I, O, W = O> = {
43
- (input: I | undefined, options: PreviewCallOptions): Promise<DryRunPreview<W>>;
44
- (input?: I, options?: CallOptions): Promise<O>;
41
+ /** Options known to execute the operation rather than preview it. */
42
+ type WriteCallOptions = CallOptions & {
43
+ dryRun?: false;
45
44
  };
46
- /** A method that requires its input: a preview resolves to `DryRunPreview<O>`. */
47
- type RequiredInputFn<I, O, W = O> = {
45
+ type OptionalInputFn<I, O, W, P extends boolean> = P extends true ? {
46
+ (input: I | undefined, options: PreviewCallOptions): Promise<DryRunPreview<W>>;
47
+ (input?: I, options?: WriteCallOptions): Promise<O>;
48
+ (input: I | undefined, options?: CallOptions): Promise<O | DryRunPreview<W>>;
49
+ } : (input?: I, options?: CallOptions) => Promise<O>;
50
+ type RequiredInputFn<I, O, W, P extends boolean> = P extends true ? {
48
51
  (input: I, options: PreviewCallOptions): Promise<DryRunPreview<W>>;
49
- (input: I, options?: CallOptions): Promise<O>;
50
- };
51
- type MethodFn<I, O, W> = [I] extends [void] ? OptionalInputFn<undefined, O, W> : undefined extends I ? OptionalInputFn<I, O, W> : {} extends I ? OptionalInputFn<I, O, W> : RequiredInputFn<I, O, W>;
52
+ (input: I, options?: WriteCallOptions): Promise<O>;
53
+ (input: I, options?: CallOptions): Promise<O | DryRunPreview<W>>;
54
+ } : (input: I, options?: CallOptions) => Promise<O>;
55
+ type MethodFn<I, O, W, P extends boolean> = [I] extends [void] ? OptionalInputFn<undefined, O, W, P> : undefined extends I ? OptionalInputFn<I, O, W, P> : {} extends I ? OptionalInputFn<I, O, W, P> : RequiredInputFn<I, O, W, P>;
52
56
  /** A namespaced method: `(input, options?) => Promise<output>` plus `meta`. */
53
- export type MethodOf<E> = E extends OperationEntry<infer I, infer O, infer W> ? MethodFn<I, O, W> & {
57
+ export type MethodOf<E> = E extends OperationEntry<infer I, infer O, infer W, infer P> ? MethodFn<I, O, W, P> & {
54
58
  readonly meta: OperationMeta;
55
59
  } : never;
56
60
  /** The method at a dotted path. */
@@ -59,6 +63,8 @@ export type Method<P extends MethodPath> = MethodOf<OperationTable[P]>;
59
63
  export type MethodInput<P extends MethodPath> = OperationTable[P] extends OperationEntry<infer I, unknown> ? I : never;
60
64
  /** Output of the method at a dotted path. */
61
65
  export type MethodOutput<P extends MethodPath> = OperationTable[P] extends OperationEntry<never, infer O, any> ? O : never;
66
+ /** Payload inside a method's dry-run envelope. */
67
+ export type MethodPreviewOutput<P extends MethodPath> = OperationTable[P] extends OperationEntry<never, unknown, infer W, true> ? W : never;
62
68
  type Nest<Path extends string, V> = Path extends `${infer Head}.${infer Rest}` ? {
63
69
  readonly [K in Head]: Nest<Rest, V>;
64
70
  } : {
@@ -171,6 +171,9 @@ export type BulletinPostList = Schemas["BulletinPostList"];
171
171
  export type AutomationRule = Schemas["AutomationRule"];
172
172
  /** `automationRules.read`: one page, newest first. */
173
173
  export type AutomationRuleList = Schemas["AutomationRuleList"];
174
+ /** `business.docs.validate`: the issues a pull request's Docs comment
175
+ * would show for the files sent (errors first, then notes). */
176
+ export type DocsValidateResponse = Schemas["DocsValidateResponse"];
174
177
  /** `knowledge.*.read`: one page of the Knowledge Registry index. */
175
178
  export type KnowledgeIndex = Schemas["KnowledgeIndex"];
176
179
  /** `platform.resourceCounts.report`: the recorded count. */
@@ -3,6 +3,6 @@
3
3
  * `package.json` by `version.test.ts` and checked in the built bundle by
4
4
  * `scripts/check-pack.mjs`.
5
5
  */
6
- export declare const CLIENT_VERSION = "0.2.0";
6
+ export declare const CLIENT_VERSION = "0.4.0";
7
7
  /** The `x-fs-client` product token for this package. */
8
- export declare const CLIENT_PRODUCT = "@farthershore/client/0.2.0";
8
+ export declare const CLIENT_PRODUCT = "@farthershore/client/0.4.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farthershore/client",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Farther Shore API client: the authenticated HTTP transport, credential sources, and typed errors shared by the CLI and agent tooling",
5
5
  "type": "module",
6
6
  "sideEffects": false,