@farthershore/client 0.0.0-stage → 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 (43) hide show
  1. package/CHANGELOG.md +196 -0
  2. package/README.md +252 -2
  3. package/dist/index.js +7009 -0
  4. package/dist/types/api.generated.d.ts +1362 -0
  5. package/dist/types/credentials.d.ts +78 -0
  6. package/dist/types/envelope.d.ts +48 -0
  7. package/dist/types/errors.d.ts +86 -0
  8. package/dist/types/generated/schemas.d.ts +3670 -0
  9. package/dist/types/helpers/abort.d.ts +7 -0
  10. package/dist/types/helpers/paginate.d.ts +32 -0
  11. package/dist/types/helpers/poll.d.ts +26 -0
  12. package/dist/types/helpers/refs.d.ts +84 -0
  13. package/dist/types/helpers/wait-for-frontend-build.d.ts +51 -0
  14. package/dist/types/index.d.ts +24 -0
  15. package/dist/types/operations/agents.d.ts +240 -0
  16. package/dist/types/operations/agreements.d.ts +174 -0
  17. package/dist/types/operations/analytics.d.ts +47 -0
  18. package/dist/types/operations/audit-notifications.d.ts +90 -0
  19. package/dist/types/operations/auth.d.ts +24 -0
  20. package/dist/types/operations/backends.d.ts +255 -0
  21. package/dist/types/operations/billing.d.ts +71 -0
  22. package/dist/types/operations/businesses.d.ts +795 -0
  23. package/dist/types/operations/change-sets.d.ts +462 -0
  24. package/dist/types/operations/consumers.d.ts +168 -0
  25. package/dist/types/operations/define.d.ts +102 -0
  26. package/dist/types/operations/environments.d.ts +55 -0
  27. package/dist/types/operations/frontend.d.ts +31 -0
  28. package/dist/types/operations/index.d.ts +4773 -0
  29. package/dist/types/operations/maker-tokens.d.ts +194 -0
  30. package/dist/types/operations/organizations.d.ts +373 -0
  31. package/dist/types/operations/personas.d.ts +136 -0
  32. package/dist/types/operations/plans-usage.d.ts +84 -0
  33. package/dist/types/operations/platform.d.ts +455 -0
  34. package/dist/types/operations/portal.d.ts +442 -0
  35. package/dist/types/operations/promo-codes.d.ts +139 -0
  36. package/dist/types/operations/variables.d.ts +188 -0
  37. package/dist/types/operations/webhooks.d.ts +130 -0
  38. package/dist/types/surface-types.d.ts +76 -0
  39. package/dist/types/surface.d.ts +35 -0
  40. package/dist/types/transport.d.ts +114 -0
  41. package/dist/types/types.d.ts +440 -0
  42. package/dist/types/version.d.ts +8 -0
  43. package/package.json +53 -3
@@ -0,0 +1,440 @@
1
+ import type { components } from "./generated/schemas.js";
2
+ type Schemas = components["schemas"];
3
+ /**
4
+ * A business as the business reads and writes return it (`GET /businesses`,
5
+ * `PATCH /businesses/:id`, the management reads). Closed: only these fields.
6
+ */
7
+ export type BusinessSummary = Schemas["Business"];
8
+ /** `GET /businesses/:id`: the business plus its active environments. */
9
+ export type BusinessDetail = Schemas["BusinessDetail"];
10
+ /** `POST /businesses`: the draft business, its repository, and next steps. */
11
+ export type BusinessCreateResult = Schemas["BusinessCreateResponse"];
12
+ /** `POST /businesses/:id/publish`: the business plus the computed release. */
13
+ export type PublishBusinessResult = Schemas["PublishBusinessResponse"];
14
+ /**
15
+ * `POST /businesses/:id/publish` with `{ dryRun: true }`: the server's
16
+ * `{ dryRun, wouldHave }` envelope. The surface types a preview call as
17
+ * `DryRunPreview<PublishBusinessResult>`; this is the same shape, generated.
18
+ */
19
+ export type PublishBusinessPreview = Schemas["PublishBusinessPreview"];
20
+ /**
21
+ * A preview environment, as `GET /businesses/:id/environments` lists it and
22
+ * `GET /businesses/:id` nests it. Closed: only these fields.
23
+ */
24
+ export type EnvironmentSummary = Schemas["BusinessEnvironment"];
25
+ /**
26
+ * `POST /businesses/:id/environments`: the environment, plus whether this call
27
+ * created it (`created`) and its git branch (`branchCreated`).
28
+ */
29
+ export type EnvironmentCreateResult = Schemas["BusinessEnvironmentCreateResponse"];
30
+ /** One Apply Timeline entry: a repository-triggered apply and its phases. */
31
+ export type ApplyTimelineEntry = Schemas["ApplyTimelineEntry"];
32
+ /** `GET /businesses/:id/apply-timeline`: newest first, plus the env filtered on. */
33
+ export type ApplyTimelineEntryList = Schemas["ApplyTimelineList"];
34
+ /** A governed ChangeSet (proposal) against one subscriber. Closed. */
35
+ export type ChangeSet = Schemas["ChangeSet"];
36
+ /** One page of ChangeSets, newest first; `nextCursor` is null on the last. */
37
+ export type ChangeSetList = Schemas["ChangeSetList"];
38
+ /**
39
+ * What a propose would record: the `wouldHave` of a
40
+ * `changeSets.propose(…, { dryRun: true })` preview. Nothing is written.
41
+ */
42
+ export type ChangeSetProposePreview = Schemas["ChangeSetProposePreview"];
43
+ /** `analytics.timeseries`: one bucket per interval. */
44
+ export type AnalyticsTimeseriesResult = Schemas["AnalyticsTimeseriesResponse"];
45
+ /** `analytics.top`: ranked keys with their counts. */
46
+ export type AnalyticsTopKResult = Schemas["AnalyticsTopKResponse"];
47
+ /** `analytics.latency`: one row per requested percentile. */
48
+ export type AnalyticsPercentilesResult = Schemas["AnalyticsPercentilesResponse"];
49
+ /** `analytics.log`: archived events newest first, with their request detail. */
50
+ export type AnalyticsEventFeedResult = Schemas["AnalyticsEventFeedResponse"];
51
+ /** `analytics.query`: any verb's answer; the verb sent decides which. */
52
+ export type AnalyticsQueryResult = Schemas["AnalyticsQueryResponse"];
53
+ /** `GET /management/businesses/:id/usage`: the trailing-30-day summary. */
54
+ export type UsageSummary = Schemas["UsageSummary"];
55
+ /** `GET /management/businesses/:id/usage-limits`: subscriber limits, paged. */
56
+ export type ManagementUsageLimitList = Schemas["ManagementUsageLimitListResponse"];
57
+ /** `GET /management/businesses/:id/plans`: plans in one scope, paged. */
58
+ export type PlanList = Schemas["PlanList"];
59
+ /** `GET /businesses/:id/stripe/status`. No account ids. */
60
+ export type StripeConnectionStatus = Schemas["StripeConnectionStatus"];
61
+ /** `POST /businesses/:id/stripe/disconnect`. */
62
+ export type StripeDisconnectResult = Schemas["StripeDisconnectResponse"];
63
+ /** `GET`/`POST /management/businesses/:id/tax-settings`. */
64
+ export type TaxSettings = Schemas["TaxSettings"];
65
+ /** Offset pagination block. */
66
+ export type OffsetPagination = {
67
+ total: number;
68
+ limit: number;
69
+ offset: number;
70
+ hasMore: boolean;
71
+ };
72
+ /** `GET /businesses/:id/environments` response. */
73
+ export type EnvironmentListResult = Schemas["BusinessEnvironmentList"];
74
+ /** WS-C semver bump kinds. */
75
+ export type SemverBump = "major" | "minor" | "patch";
76
+ /** Release overrides a publish MAY carry (all optional). */
77
+ export type PublishBusinessBody = {
78
+ bump?: SemverBump;
79
+ version?: string;
80
+ acceptBreaking?: boolean;
81
+ };
82
+ /** The `_release` block the publish route returns. */
83
+ export type PublishRelease = Schemas["PublishRelease"];
84
+ /** `GET /management/businesses/subdomain-availability` response. */
85
+ export type ManagedSubdomainAvailability = Schemas["ManagedSubdomainAvailability"];
86
+ /** `businesses.routes.read`: the routes the current contract serves. */
87
+ export type BusinessRouteList = Schemas["BusinessRouteList"];
88
+ /**
89
+ * `businesses.contract.read`: plans with their limits and meters, and the
90
+ * metered / unmetered route partitions.
91
+ */
92
+ export type BusinessContract = Schemas["BusinessContract"];
93
+ /**
94
+ * The accepted business contract (the authored `BusinessSpec`). An upstream
95
+ * credential's token is never returned.
96
+ */
97
+ export type AcceptedBusinessContract = Schemas["AcceptedBusinessContract"];
98
+ /** `businesses.config.read`: the accepted contract for one scope. */
99
+ export type BusinessConfig = Schemas["BusinessConfig"];
100
+ /** `businesses.configAttempts.read`: rejected configuration attempts. */
101
+ export type BusinessConfigAttemptList = Schemas["BusinessConfigAttemptList"];
102
+ /** One deployment run from `businesses.status`. */
103
+ export type DeploymentRunSummary = Schemas["DeploymentRun"];
104
+ /** One recent apply from `businesses.status`. */
105
+ export type DeploymentApply = Schemas["DeploymentApply"];
106
+ /**
107
+ * `businesses.status`: recent runs and applies, the business's lifecycle and
108
+ * release, whether the scope is live, and whether the gateway serves it.
109
+ */
110
+ export type BusinessStatusResult = Schemas["BusinessStatus"];
111
+ /** A diagnostic from a validate: what was wrong, and where. */
112
+ export type BusinessDiagnostic = Schemas["BusinessDiagnostic"];
113
+ /** `businesses.compile`: the dry-run validate verdict. Nothing is applied. */
114
+ export type BusinessValidateResult = Schemas["BusinessValidateResponse"];
115
+ /** `businesses.rbac.subjects.read`: builder-defined permission subjects. */
116
+ export type CustomPermissionSubjectList = Schemas["CustomPermissionSubjectListResponse"];
117
+ /** `businesses.rbac.enable` / `disable`: the resulting flag. */
118
+ export type BusinessRbacUpdateResult = Schemas["BusinessRbacUpdateResponse"];
119
+ /** `businesses.brand.uploadAsset`: the uploaded icon's or logo's URL. */
120
+ export type BrandAssetUploadResult = Schemas["BusinessIconUploadResponse"] | Schemas["BusinessLogoUploadResponse"];
121
+ /** A webhook endpoint as list and update return it: never the signing secret. */
122
+ export type WebhookEndpoint = Schemas["WebhookEndpoint"];
123
+ /** `GET /management/businesses/:id/webhooks`: one page of endpoints. */
124
+ export type WebhookEndpointList = Schemas["WebhookEndpointList"];
125
+ /**
126
+ * `POST /management/businesses/:id/webhooks`: the endpoint plus its signing
127
+ * `secret`, returned exactly once. Store it in the receiver's secret store.
128
+ */
129
+ export type WebhookEndpointCreateResult = Schemas["WebhookEndpointCreateResponse"];
130
+ /** `PATCH /management/businesses/:id/webhooks/:webhookId`. */
131
+ export type WebhookEndpointUpdateResult = Schemas["WebhookEndpointUpdateResponse"];
132
+ /**
133
+ * `POST /management/businesses/:id/webhooks/:webhookId/rotate-secret`: the
134
+ * endpoint plus its NEW signing `secret`, returned exactly once; the previous
135
+ * secret keeps signing until `previousSecretExpiresAt`.
136
+ */
137
+ export type WebhookEndpointRotateSecretResult = Schemas["WebhookEndpointRotateSecretResponse"];
138
+ /** `DELETE /management/businesses/:id/webhooks/:webhookId`. */
139
+ export type WebhookEndpointDeleteResult = Schemas["WebhookEndpointDeleteResponse"];
140
+ /** `POST /management/businesses/:id/webhooks/:webhookId/test` (`data.success` is the headline). */
141
+ export type WebhookTestResult = Schemas["WebhookTestResponse"];
142
+ /** One delivery of an event to an endpoint. */
143
+ export type WebhookDelivery = Schemas["WebhookDelivery"];
144
+ /** `GET /management/businesses/:id/webhooks/:webhookId/deliveries`: one page, newest first. */
145
+ export type WebhookDeliveryList = Schemas["WebhookDeliveryList"];
146
+ /**
147
+ * `GET /management/businesses/:id/webhooks/:webhookId/deliveries/:deliveryId`:
148
+ * one delivery's metadata. Not its payload nor the endpoint's response body
149
+ * (both can carry subscriber PII; no permission gates them yet).
150
+ */
151
+ export type WebhookDeliveryResult = Schemas["WebhookDeliveryResponse"];
152
+ /** `GET /management/businesses/:id/webhook-event-types`: the subscribable events. */
153
+ export type WebhookEventTypeList = Schemas["WebhookEventTypeList"];
154
+ /** An operating agent of a business. Closed: only these fields. */
155
+ export type AgentSummary = Schemas["Agent"];
156
+ /** The closed config surface of an agent. */
157
+ export type AgentConfig = Schemas["AgentConfig"];
158
+ /** `agents.list`: the roster plus the roles that can still be enabled. */
159
+ export type AgentList = Schemas["AgentList"];
160
+ /** One run as an agent's status lists it. Failures carry a fixed message. */
161
+ export type AgentRunSummary = Schemas["AgentRun"];
162
+ /** `agents.status`: the agent, its recent runs, usage totals and catalog. */
163
+ export type AgentStatus = Schemas["AgentStatus"];
164
+ /** `agents.runs.show`: one run's trace, launch ledger and action receipts. */
165
+ export type AgentRunDetail = Schemas["AgentRunDetail"];
166
+ /** A post on a business's agent bulletin. */
167
+ export type BulletinPost = Schemas["BulletinPost"];
168
+ /** `bulletin.list`: one page, newest first; `nextCursor` is null on the last. */
169
+ export type BulletinPostList = Schemas["BulletinPostList"];
170
+ /** An automation rule: trigger, conditions and actions, as data. */
171
+ export type AutomationRule = Schemas["AutomationRule"];
172
+ /** `automationRules.read`: one page, newest first. */
173
+ export type AutomationRuleList = Schemas["AutomationRuleList"];
174
+ /** `knowledge.*.read`: one page of the Knowledge Registry index. */
175
+ export type KnowledgeIndex = Schemas["KnowledgeIndex"];
176
+ /** `platform.resourceCounts.report`: the recorded count. */
177
+ export type ResourceCountReport = Schemas["ResourceCountReport"];
178
+ /** `platform.denials.read`: why a gateway request was denied. */
179
+ export type DenialExplanation = Schemas["DenialExplanation"];
180
+ /** `platform.dependents.read`: subscribers active on a route. */
181
+ export type BusinessDependents = Schemas["BusinessDependents"];
182
+ /**
183
+ * `platform.workflowControl.replay`: a period scope preview
184
+ * (`status: "preview_only"`) or an invoice recompute (`status: "computed"`).
185
+ */
186
+ export type ReplayResult = Schemas["ReplayResult"];
187
+ /** `platform.workflowControl.rollback`: what a config rollback would target. */
188
+ export type ConfigRollbackPreview = Schemas["ConfigRollbackPreview"];
189
+ export type PromoCodeKind = NonNullable<Schemas["PromoCode"]["kind"]>;
190
+ export type PromoCodeStatus = Schemas["PromoCode"]["status"];
191
+ /**
192
+ * A promo code as every promo-code route returns it. Closed: only these
193
+ * fields. `id` is an opaque handle for update, archive and reactivate.
194
+ */
195
+ export type PromoCode = Schemas["PromoCode"];
196
+ /** `GET /businesses/:id/promo-codes`: every promo code of the business. */
197
+ export type PromoCodeList = Schemas["PromoCodeList"];
198
+ export type CreatePromoCodeInput = {
199
+ code: string;
200
+ kind: PromoCodeKind;
201
+ amount?: number | null;
202
+ durationMonths: number;
203
+ applicablePlanIds?: string[];
204
+ maxRedemptions?: number | null;
205
+ activeFrom?: string | null;
206
+ activeUntil?: string | null;
207
+ };
208
+ export type UpdatePromoCodeInput = Partial<CreatePromoCodeInput> & {
209
+ status?: PromoCodeStatus;
210
+ };
211
+ /** The lowercase account-tier vocabulary every agent surface speaks. */
212
+ export declare const ACCOUNT_ROLES: readonly ["owner", "admin", "member"];
213
+ export type AccountRole = (typeof ACCOUNT_ROLES)[number];
214
+ /** One member of a consumer organization, as the consumers list returns it. */
215
+ export type BusinessConsumerMember = Schemas["ConsumerMember"];
216
+ /**
217
+ * A consumer (a subscribing organization) as `GET /businesses/:id/consumers`
218
+ * lists it. Closed: only these fields.
219
+ */
220
+ export type BusinessConsumer = Schemas["Consumer"];
221
+ /** `GET /businesses/:id/consumers` (newest first, at most 500). */
222
+ export type BusinessConsumerList = Schemas["ConsumerList"];
223
+ /** The per-subscriber Managed-RBAC enablement flag and default role. */
224
+ export type ConsumerRbacSettingsResult = Schemas["ConsumerRbacSettings"];
225
+ /** One subscriber-owned role row (ACCOUNT or CUSTOM). */
226
+ export type ConsumerRbacRole = Schemas["ConsumerRbacRole"];
227
+ /** `GET …/consumers/:subscriberId/rbac/roles`. */
228
+ export type ConsumerRbacRoleList = Schemas["ConsumerRbacRoleList"];
229
+ /**
230
+ * One consumer API key as the builder plane sees it: metadata only. No hash,
231
+ * no lookup prefix, no raw key; `displayPrefix` is already redacted.
232
+ */
233
+ export type ConsumerApiKey = Schemas["ConsumerApiKey"];
234
+ /** `GET …/consumers/:subscriberId/api-keys`. */
235
+ export type ConsumerApiKeyList = Schemas["ConsumerApiKeyList"];
236
+ /** `POST …/consumers/:subscriberId/block`. */
237
+ export type BlockConsumerResult = Schemas["ConsumerBlockResponse"];
238
+ /** `POST …/consumers/:subscriberId/remove`. */
239
+ export type RemoveConsumerResult = Schemas["ConsumerRemoveResponse"];
240
+ /**
241
+ * `POST …/consumers/:subscriberId/migrate-latest`: moved, or not and why
242
+ * (`reason`).
243
+ */
244
+ export type ConsumerMigrateLatestResult = Schemas["ConsumerMigrateLatestResponse"];
245
+ /** A member's business-role assignment after a builder override. */
246
+ export type ConsumerMemberRolesResult = Schemas["ConsumerMemberRoles"];
247
+ /**
248
+ * A variable as `GET /businesses/:id/variables` lists it. `value` is set ONLY
249
+ * for an active public (`FS_PUBLIC_*`) variable; a secret's value is never
250
+ * returned by any call. Closed: only these fields.
251
+ */
252
+ export type BusinessVariableRow = Schemas["BusinessVariable"];
253
+ /** `GET /businesses/:id/variables`. */
254
+ export type BusinessVariableList = Schemas["BusinessVariableList"];
255
+ /**
256
+ * A durable variable create / rotate / revoke / delete and its progress.
257
+ * `lastError.message` is fixed copy per code; `impact` names who the change
258
+ * affects. Never carries a value.
259
+ */
260
+ export type SecretMutationOperation = Schemas["SecretMutationOperation"];
261
+ /**
262
+ * `error.details` of the 409 a revoke / delete answers while plans with live
263
+ * subscribers still use the secret: re-send with `acknowledgeImpact`.
264
+ */
265
+ export type SecretReferencedByActiveCohortsDetails = Schemas["SecretReferencedByActiveCohortsDetails"];
266
+ /**
267
+ * `GET /businesses/:id/frontend/status`: what the scope serves, its recent
268
+ * releases (rollback targets) and its recent builds.
269
+ */
270
+ export type FrontendStatusResult = Schemas["FrontendStatus"];
271
+ /** A recent frontend build, any status. */
272
+ export type FrontendBuildRow = Schemas["FrontendBuild"];
273
+ /** A prior frontend release; `releaseId` is what a rollback takes. */
274
+ export type FrontendReleaseRow = Schemas["FrontendRelease"];
275
+ /** `POST /businesses/:id/frontend/rollback`: the release now serving, pinned. */
276
+ export type FrontendRollbackResult = Schemas["FrontendRollbackResponse"];
277
+ /** What a rollback would re-activate (a dry run's `wouldHave`). */
278
+ export type FrontendRollbackPreview = Schemas["FrontendRollbackPreview"];
279
+ /** One page of builder audit-log entries; payloads arrive redacted. */
280
+ export type AuditLogPage = Schemas["AuditLogList"];
281
+ /** One builder audit-log entry. */
282
+ export type AuditLogEntry = Schemas["AuditLogEntry"];
283
+ /** The caller's email opt-outs for a business (`true` = opted out). */
284
+ export type NotificationPreferences = Schemas["NotificationPreferences"];
285
+ /** An economic agreement (builder surface). Closed: only these fields. */
286
+ export type EconomicAgreement = Schemas["EconomicAgreement"];
287
+ /** `GET /businesses/:id/agreements`: one page of agreements. */
288
+ export type EconomicAgreementList = Schemas["EconomicAgreementList"];
289
+ /**
290
+ * What creating an agreement would do, plus the `confirmationToken` that
291
+ * commits exactly that effect. Nothing is written.
292
+ */
293
+ export type AgreementCreatePreview = Schemas["AgreementCreatePreview"];
294
+ /** What amending an agreement would do, plus its `confirmationToken`. */
295
+ export type AgreementAmendPreview = Schemas["AgreementAmendPreview"];
296
+ /** Either agreement preview. */
297
+ export type AgreementPreview = AgreementCreatePreview | AgreementAmendPreview;
298
+ /** What one subject's prices are pinned to (read-only). */
299
+ export type SubjectPins = Schemas["SubjectPins"];
300
+ /** A runtime token as list and revoke return it: never the secret. */
301
+ export type RuntimeTokenSummary = Schemas["RuntimeToken"];
302
+ /**
303
+ * A runtime token plus its plaintext `token`, returned by mint and rotate
304
+ * exactly once. Never log or persist it anywhere but the backend's secret store.
305
+ */
306
+ export type RuntimeTokenIssuance = Schemas["RuntimeTokenIssuance"];
307
+ /** `GET /businesses/:id/runtime-tokens`: one page, plus the scope it describes. */
308
+ export type RuntimeTokenList = Schemas["RuntimeTokenList"];
309
+ /** A backend as every backend route returns it. */
310
+ export type BackendSummary = Schemas["Backend"];
311
+ /**
312
+ * `POST /businesses/:id/backends`: the backend. Create is an upsert keyed by
313
+ * (environment, slug); `updated: true` marks an existing backend updated in place.
314
+ */
315
+ export type BackendCreateResult = Schemas["BackendCreateResponse"];
316
+ /**
317
+ * What a backend create would do: the `wouldHave` of a
318
+ * `backends.create(…, { dryRun: true })` preview. Nothing is written.
319
+ */
320
+ export type BackendCreatePreview = Schemas["BackendCreatePreview"];
321
+ /** `GET /businesses/:id/backends`: one page, plus the scope it describes. */
322
+ export type BackendList = Schemas["BackendList"];
323
+ /** `DELETE /businesses/:id/backends/:backendId`. */
324
+ export type BackendDeleteResult = Schemas["BackendDeleteResponse"];
325
+ /** The delegable-permission vocabulary, grouped by subject. */
326
+ export type MakerTokenPermissionCatalog = Schemas["MakerTokenPermissionCatalog"];
327
+ /**
328
+ * A maker token as a listing returns it: metadata only. No plaintext, no hash;
329
+ * `lastFour` is the only secret-derived field.
330
+ */
331
+ export type MakerTokenSummary = Schemas["MakerTokenSummary"];
332
+ /** `GET /maker-tokens/org` (one page). */
333
+ export type MakerTokenList = Schemas["MakerTokenListResponse"];
334
+ /** A minted maker token: the summary plus its plaintext, returned once. */
335
+ export type MakerTokenIssuance = Schemas["MakerTokenIssuanceResponse"];
336
+ /** A rotate: the replacement plaintext, returned once. */
337
+ export type MakerTokenRotation = Schemas["MakerTokenRotationResponse"];
338
+ /**
339
+ * `makerTokens.create`: ACTIVE (minted; `token` is the plaintext, once) or
340
+ * PENDING approval (no credential exists yet).
341
+ */
342
+ export type OrgMakerTokenCreateResult = Schemas["OrgMakerTokenCreateResponse"];
343
+ /** `makerTokens.update`: ACTIVE (grants live) or PENDING approval. */
344
+ export type OrgMakerTokenUpdateResult = Schemas["OrgMakerTokenUpdateResponse"];
345
+ /** `makerTokens.approvalList`: pending requests, oldest first. */
346
+ export type OrgMakerTokenApprovalList = Schemas["OrgMakerTokenPendingApprovalListResponse"];
347
+ /** `makerTokens.approve`: approving a CREATE returns the plaintext once. */
348
+ export type OrgMakerTokenApprovalResult = Schemas["OrgMakerTokenApprovalResponse"];
349
+ /** `makerTokens.deny`. */
350
+ export type OrgMakerTokenDenyResult = Schemas["OrgMakerTokenDenyResponse"];
351
+ /** `organizations.list`: the organizations the caller can act in. */
352
+ export type OrganizationList = Schemas["OrganizationList"];
353
+ /** `organizations.create`: the new organization; the creator is its owner. */
354
+ export type OrganizationCreateResult = Schemas["OrganizationCreateResponse"];
355
+ /** An organization role and its exact permission grants. */
356
+ export type OrganizationRole = Schemas["OrganizationRole"];
357
+ /** `organizations.role.list`: roles plus what the viewer may grant. */
358
+ export type OrganizationRoleList = Schemas["OrganizationRoleList"];
359
+ /** `organizations.member.list`: one page of members plus viewer capabilities. */
360
+ export type OrganizationMembers = Schemas["OrganizationMembers"];
361
+ /** `organizations.member.update`. */
362
+ export type OrganizationMemberUpdateResult = Schemas["OrganizationMemberUpdateResponse"];
363
+ /** `organizations.ownership.transfer`. */
364
+ export type OrganizationOwnershipTransferResult = Schemas["OrganizationOwnershipTransferResponse"];
365
+ /** `organizations.invitation.create`. The accept token goes by email only. */
366
+ export type OrganizationInvitationCreateResult = Schemas["OrganizationInvitationCreateResponse"];
367
+ /** `organizations.invitation.listSent`: the organization's pending invitations. */
368
+ export type OrganizationSentInvitationList = Schemas["OrganizationSentInvitationList"];
369
+ /** `organizations.invitation.list`: pending invitations addressed to the caller. */
370
+ export type OrganizationReceivedInvitationList = Schemas["OrganizationReceivedInvitationList"];
371
+ /** `organizations.invitation.accept`. */
372
+ export type OrganizationInvitationAcceptResult = Schemas["OrganizationInvitationAcceptResponse"];
373
+ /** `organizations.overview.read`. Null means unknown, never zero. */
374
+ export type OrganizationOverview = Schemas["OrganizationOverview"];
375
+ /** `organizations.bulletin.read`: one page of the consolidated bulletin. */
376
+ export type OrganizationBulletin = Schemas["OrganizationBulletin"];
377
+ /** A CLI login's view of itself (`fscli_` session). */
378
+ export type CliSessionContext = {
379
+ kind: "cli_user";
380
+ } & Schemas["ManagementWhoamiCliSession"];
381
+ /** A maker token's view of itself, including its granted permissions. */
382
+ export type MakerTokenContext = {
383
+ kind: "maker";
384
+ } & Schemas["ManagementWhoamiMakerToken"];
385
+ /** A builder (dashboard) session's view of itself. Closed: no provider ids. */
386
+ export type BuilderBootstrapContext = Schemas["BuilderContext"];
387
+ /** `auth.context.issue`: a short-lived member context token. Never log it. */
388
+ export type ContextTokenIssuance = Schemas["ContextTokenResponse"]["data"];
389
+ /** A subscriber-plane service account. Never key material. */
390
+ export type PortalServiceAccount = Schemas["PortalServiceAccountListResponse"]["data"][number];
391
+ /** `portal.serviceAccounts.list`: one offset page. */
392
+ export type PortalServiceAccountList = Schemas["PortalServiceAccountListResponse"];
393
+ /**
394
+ * `portal.serviceAccounts.create`: ACTIVE (minted; `plaintext` shown once) or
395
+ * PENDING approval (no credential exists yet).
396
+ */
397
+ export type PortalServiceAccountCreateResult = Schemas["PortalServiceAccountCreateResponse"];
398
+ /** `portal.serviceAccounts.update`: ACTIVE (applied) or PENDING approval. */
399
+ export type PortalServiceAccountUpdateResult = Schemas["PortalServiceAccountUpdateResponse"];
400
+ /** `portal.serviceAccounts.approve`: an approved CREATE returns `plaintext` once. */
401
+ export type PortalServiceAccountApprovalResult = Schemas["PortalServiceAccountApprovalResponse"];
402
+ /** `portal.serviceAccounts.rotate`: the new `plaintext`, shown once. */
403
+ export type PortalServiceAccountRotateResult = Schemas["PortalServiceAccountRotateResponse"];
404
+ /** `portal.serviceAccounts.deny`. */
405
+ export type PortalServiceAccountDenyResult = Schemas["PortalServiceAccountDenyResponse"];
406
+ /** `portal.serviceAccounts.approvals`: pending changes, oldest first. */
407
+ export type PortalServiceAccountApprovalList = Schemas["PortalServiceAccountPendingApprovalListResponse"];
408
+ /** A subscriber usage limit: one subject and one value lane. */
409
+ export type PortalUsageLimit = Schemas["PortalUsageLimitDto"];
410
+ /** `portal.usageLimits.list`: one offset page. */
411
+ export type PortalUsageLimitList = Schemas["PortalUsageLimitListResponse"];
412
+ /** `portal.usageLimits.remove`. */
413
+ export type PortalUsageLimitDeleteResult = Schemas["PortalUsageLimitDeleteResponse"];
414
+ /** Who the credential is (`fs.auth.context.read()`). */
415
+ export type CallerContext = CliSessionContext | MakerTokenContext | ({
416
+ kind: "builder";
417
+ } & BuilderBootstrapContext);
418
+ /** A persona browser handoff: a single-use, 60-second `handoffToken`. */
419
+ export type PersonaHandoff = Schemas["TestPersonaLoginResponse"];
420
+ /** A test persona as the persona list returns it: never key material. */
421
+ export type TestPersona = Schemas["TestPersona"];
422
+ /** `GET …/test/personas`. */
423
+ export type TestPersonaList = Schemas["TestPersonaList"];
424
+ /**
425
+ * `POST …/test/bootstrap-key`: a new persona with its plaintext `apiKey` and
426
+ * `sessionToken`, shown exactly once. Never log them.
427
+ */
428
+ export type TestPersonaBootstrapResult = Schemas["TestPersonaBootstrapResponse"];
429
+ /** `POST …/test/personas/:id/rotate`: the new plaintext `apiKey`, shown once. */
430
+ export type TestPersonaRotateResult = Schemas["TestPersonaRotateResponse"];
431
+ /** `DELETE …/test/personas/:id`: the deletion receipt. */
432
+ export type TestPersonaDeleteResult = Schemas["TestPersonaDeleteResponse"];
433
+ /** A persona handoff plus the CLI-process-only local-preview proxy lease. */
434
+ export type PersonaLocalPreviewLease = {
435
+ data: PersonaHandoff["data"] & {
436
+ localProxyLease: string;
437
+ localProxyLeaseExpiresAt: string;
438
+ };
439
+ };
440
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This package's version, sent in the `x-fs-client` header. Kept in step with
3
+ * `package.json` by `version.test.ts` and checked in the built bundle by
4
+ * `scripts/check-pack.mjs`.
5
+ */
6
+ export declare const CLIENT_VERSION = "0.2.0";
7
+ /** The `x-fs-client` product token for this package. */
8
+ export declare const CLIENT_PRODUCT = "@farthershore/client/0.2.0";
package/package.json CHANGED
@@ -1,6 +1,56 @@
1
1
  {
2
2
  "name": "@farthershore/client",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
4
+ "description": "Farther Shore API client: the authenticated HTTP transport, credential sources, and typed errors shared by the CLI and agent tooling",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "main": "./dist/index.js",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/types/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/types/index.d.ts",
13
+ "import": "./dist/index.js"
14
+ }
15
+ },
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "CHANGELOG.md"
20
+ ],
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "keywords": [
25
+ "farthershore",
26
+ "api",
27
+ "client",
28
+ "sdk"
29
+ ],
30
+ "author": "Farther Shore",
31
+ "devDependencies": {
32
+ "@types/node": "^22.20.1",
33
+ "esbuild": "^0.28.1",
34
+ "eslint": "^9.39.5",
35
+ "eslint-plugin-sonarjs": "^4.2.0",
36
+ "fast-check": "3.23.2",
37
+ "prettier": "^3.9.6",
38
+ "typescript": "^6.0.3",
39
+ "typescript-eslint": "^8.66.0",
40
+ "vitest": "^4.1.10",
41
+ "@farthershore/contracts": "0.62.0"
42
+ },
43
+ "engines": {
44
+ "node": ">=22"
45
+ },
46
+ "license": "MIT",
47
+ "scripts": {
48
+ "build": "tsc --noEmit && node scripts/build.mjs",
49
+ "typecheck": "tsc --noEmit",
50
+ "lint": "eslint .",
51
+ "lint:fix": "eslint . --fix",
52
+ "test": "vitest run",
53
+ "pack:check": "node scripts/check-pack.mjs",
54
+ "generate:api": "UPDATE_API_TYPES=1 vitest run src/api.generated.test.ts"
55
+ }
6
56
  }