@farthershore/client 0.0.0-stage → 0.1.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.
- package/CHANGELOG.md +34 -0
- package/README.md +251 -2
- package/dist/index.js +6997 -0
- package/dist/types/api.generated.d.ts +1356 -0
- package/dist/types/credentials.d.ts +78 -0
- package/dist/types/envelope.d.ts +48 -0
- package/dist/types/errors.d.ts +86 -0
- package/dist/types/helpers/abort.d.ts +7 -0
- package/dist/types/helpers/paginate.d.ts +32 -0
- package/dist/types/helpers/poll.d.ts +26 -0
- package/dist/types/helpers/refs.d.ts +84 -0
- package/dist/types/helpers/wait-for-frontend-build.d.ts +43 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/types/operations/agents.d.ts +48 -0
- package/dist/types/operations/agreements.d.ts +44 -0
- package/dist/types/operations/analytics.d.ts +25 -0
- package/dist/types/operations/audit-notifications.d.ts +33 -0
- package/dist/types/operations/auth.d.ts +16 -0
- package/dist/types/operations/backends.d.ts +53 -0
- package/dist/types/operations/billing.d.ts +15 -0
- package/dist/types/operations/businesses.d.ts +92 -0
- package/dist/types/operations/change-sets.d.ts +43 -0
- package/dist/types/operations/consumers.d.ts +49 -0
- package/dist/types/operations/define.d.ts +91 -0
- package/dist/types/operations/environments.d.ts +19 -0
- package/dist/types/operations/frontend.d.ts +13 -0
- package/dist/types/operations/index.d.ts +1036 -0
- package/dist/types/operations/maker-tokens.d.ts +30 -0
- package/dist/types/operations/organizations.d.ts +71 -0
- package/dist/types/operations/personas.d.ts +46 -0
- package/dist/types/operations/plans-usage.d.ts +18 -0
- package/dist/types/operations/platform.d.ts +47 -0
- package/dist/types/operations/portal.d.ts +49 -0
- package/dist/types/operations/promo-codes.d.ts +19 -0
- package/dist/types/operations/variables.d.ts +25 -0
- package/dist/types/operations/webhooks.d.ts +67 -0
- package/dist/types/surface-types.d.ts +54 -0
- package/dist/types/surface.d.ts +35 -0
- package/dist/types/transport.d.ts +119 -0
- package/dist/types/types.d.ts +469 -0
- package/dist/types/version.d.ts +8 -0
- package/package.json +53 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type RequestBody } from "./define.js";
|
|
2
|
+
type BusinessRef = {
|
|
3
|
+
businessId: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const billingOperations: {
|
|
6
|
+
"billing.stripe.read": import("./define.js").OperationEntry<BusinessRef, unknown>;
|
|
7
|
+
"billing.stripe.delete": import("./define.js").OperationEntry<BusinessRef & {
|
|
8
|
+
deleteAccount?: boolean;
|
|
9
|
+
}, unknown>;
|
|
10
|
+
"billing.taxSettings.read": import("./define.js").OperationEntry<BusinessRef, unknown>;
|
|
11
|
+
"billing.taxSettings.update": import("./define.js").OperationEntry<BusinessRef & {
|
|
12
|
+
body: RequestBody;
|
|
13
|
+
}, unknown>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { BusinessSummary, DeploymentRunSummary, ManagedSubdomainAvailability, ManifestCompileResult, PublishBusinessBody, PublishRelease } from "../types.js";
|
|
2
|
+
import { type ListQuery, type RequestBody } from "./define.js";
|
|
3
|
+
type BusinessRef = {
|
|
4
|
+
businessId: string;
|
|
5
|
+
};
|
|
6
|
+
/** `env` selects a preview environment by name; omit it for production. */
|
|
7
|
+
type EnvScoped = BusinessRef & {
|
|
8
|
+
env?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const businessOperations: {
|
|
11
|
+
"businesses.list": import("./define.js").OperationEntry<{
|
|
12
|
+
limit?: number;
|
|
13
|
+
offset?: number;
|
|
14
|
+
query?: ListQuery;
|
|
15
|
+
} | undefined, BusinessSummary[]>;
|
|
16
|
+
"businesses.read": import("./define.js").OperationEntry<EnvScoped, BusinessSummary>;
|
|
17
|
+
"businesses.create": import("./define.js").OperationEntry<{
|
|
18
|
+
name: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
displayName?: string;
|
|
21
|
+
docsEnabled?: boolean;
|
|
22
|
+
}, unknown>;
|
|
23
|
+
"businesses.delete": import("./define.js").OperationEntry<BusinessRef, void>;
|
|
24
|
+
"businesses.routes.read": import("./define.js").OperationEntry<EnvScoped, unknown>;
|
|
25
|
+
"businesses.contract.read": import("./define.js").OperationEntry<EnvScoped, unknown>;
|
|
26
|
+
"businesses.config.read": import("./define.js").OperationEntry<EnvScoped, unknown>;
|
|
27
|
+
"businesses.configAttempts.read": import("./define.js").OperationEntry<BusinessRef, {
|
|
28
|
+
attempts: unknown[];
|
|
29
|
+
}>;
|
|
30
|
+
"businesses.subdomainAvailability.read": import("./define.js").OperationEntry<{
|
|
31
|
+
subdomain: string;
|
|
32
|
+
}, ManagedSubdomainAvailability>;
|
|
33
|
+
"businesses.status": import("./define.js").OperationEntry<EnvScoped, {
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
data: DeploymentRunSummary[];
|
|
36
|
+
live: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
"businesses.publish": import("./define.js").OperationEntry<BusinessRef & PublishBusinessBody, BusinessSummary & {
|
|
39
|
+
_release?: PublishRelease;
|
|
40
|
+
}>;
|
|
41
|
+
"businesses.rollback": import("./define.js").OperationEntry<BusinessRef & {
|
|
42
|
+
workflowExecutionId: string;
|
|
43
|
+
reason?: string;
|
|
44
|
+
}, {
|
|
45
|
+
businessId: string;
|
|
46
|
+
status: string;
|
|
47
|
+
rollbackWorkflowExecutionId: string;
|
|
48
|
+
}>;
|
|
49
|
+
"businesses.compile": import("./define.js").OperationEntry<BusinessRef & {
|
|
50
|
+
ir: unknown;
|
|
51
|
+
env?: string;
|
|
52
|
+
}, ManifestCompileResult>;
|
|
53
|
+
"businesses.brand.update": import("./define.js").OperationEntry<BusinessRef & {
|
|
54
|
+
env?: string;
|
|
55
|
+
} & {
|
|
56
|
+
body: RequestBody;
|
|
57
|
+
}, BusinessSummary>;
|
|
58
|
+
"businesses.brand.uploadAsset": import("./define.js").OperationEntry<BusinessRef & {
|
|
59
|
+
kind: "icon" | "logo";
|
|
60
|
+
body: Uint8Array;
|
|
61
|
+
contentType: string;
|
|
62
|
+
}, {
|
|
63
|
+
iconUrl?: string;
|
|
64
|
+
logoUrl?: string;
|
|
65
|
+
}>;
|
|
66
|
+
"businesses.brand.deleteAsset": import("./define.js").OperationEntry<BusinessRef & {
|
|
67
|
+
kind: "icon" | "logo";
|
|
68
|
+
}, void>;
|
|
69
|
+
"businesses.previewEnv.set": import("./define.js").OperationEntry<BusinessRef & {
|
|
70
|
+
env?: string;
|
|
71
|
+
} & {
|
|
72
|
+
body: RequestBody;
|
|
73
|
+
}, BusinessSummary>;
|
|
74
|
+
"businesses.docs.enable": import("./define.js").OperationEntry<EnvScoped, BusinessSummary>;
|
|
75
|
+
"businesses.docs.disable": import("./define.js").OperationEntry<EnvScoped, BusinessSummary>;
|
|
76
|
+
"businesses.cors.update": import("./define.js").OperationEntry<BusinessRef & {
|
|
77
|
+
env?: string;
|
|
78
|
+
} & {
|
|
79
|
+
body: RequestBody;
|
|
80
|
+
}, BusinessSummary>;
|
|
81
|
+
"businesses.rbac.read": import("./define.js").OperationEntry<BusinessRef, BusinessSummary>;
|
|
82
|
+
"businesses.rbac.enable": import("./define.js").OperationEntry<BusinessRef, {
|
|
83
|
+
rbacEnabled: boolean;
|
|
84
|
+
}>;
|
|
85
|
+
"businesses.rbac.disable": import("./define.js").OperationEntry<BusinessRef, {
|
|
86
|
+
rbacEnabled: boolean;
|
|
87
|
+
}>;
|
|
88
|
+
"businesses.rbac.subjects.read": import("./define.js").OperationEntry<BusinessRef, {
|
|
89
|
+
subjects: unknown[];
|
|
90
|
+
}>;
|
|
91
|
+
};
|
|
92
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ApplyTimelineEntry, ApplyTimelineEntryList } from "../types.js";
|
|
2
|
+
type EnvScoped = {
|
|
3
|
+
businessId: string;
|
|
4
|
+
env?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* The entry a selector names. Core serves only the listing, so the read
|
|
8
|
+
* selects from it, precision-first: id, then release tag (re-releases share
|
|
9
|
+
* one commit, so the tag must win over a SHA match), PR number, branch, and
|
|
10
|
+
* finally a commit-SHA prefix.
|
|
11
|
+
*/
|
|
12
|
+
export declare function selectTimelineEntry(entries: readonly ApplyTimelineEntry[], selector: string): ApplyTimelineEntry | undefined;
|
|
13
|
+
export declare const changeSetOperations: {
|
|
14
|
+
"changeSets.timeline.list": import("./define.js").OperationEntry<EnvScoped, ApplyTimelineEntryList>;
|
|
15
|
+
"changeSets.timeline.read": import("./define.js").OperationEntry<EnvScoped & {
|
|
16
|
+
/** An entry id, release tag, PR number, branch, or commit-SHA prefix. */
|
|
17
|
+
selector: string;
|
|
18
|
+
}, ApplyTimelineEntry>;
|
|
19
|
+
"changeSets.propose": import("./define.js").OperationEntry<EnvScoped & {
|
|
20
|
+
subscriberId: string;
|
|
21
|
+
} & {
|
|
22
|
+
intent: string;
|
|
23
|
+
operations: unknown[];
|
|
24
|
+
}, unknown>;
|
|
25
|
+
"changeSets.preview": import("./define.js").OperationEntry<EnvScoped & {
|
|
26
|
+
subscriberId: string;
|
|
27
|
+
} & {
|
|
28
|
+
changeSetId: string;
|
|
29
|
+
}, unknown>;
|
|
30
|
+
"changeSets.proposalList": import("./define.js").OperationEntry<EnvScoped & {
|
|
31
|
+
subscriberId: string;
|
|
32
|
+
} & {
|
|
33
|
+
status?: string;
|
|
34
|
+
cursor?: string;
|
|
35
|
+
limit?: number;
|
|
36
|
+
}, unknown>;
|
|
37
|
+
"changeSets.proposalRead": import("./define.js").OperationEntry<EnvScoped & {
|
|
38
|
+
subscriberId: string;
|
|
39
|
+
} & {
|
|
40
|
+
changeSetId: string;
|
|
41
|
+
}, unknown>;
|
|
42
|
+
};
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { BlockConsumerResult, BusinessConsumer, ConsumerApiKey, ConsumerMemberRolesResult, ConsumerRbacRole, ConsumerRbacSettingsResult, RemoveConsumerResult } from "../types.js";
|
|
2
|
+
type SubscriberRef = {
|
|
3
|
+
businessId: string;
|
|
4
|
+
subscriberId: string;
|
|
5
|
+
};
|
|
6
|
+
type RoleRef = SubscriberRef & {
|
|
7
|
+
roleKey: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const consumerOperations: {
|
|
10
|
+
"consumers.read": import("./define.js").OperationEntry<{
|
|
11
|
+
businessId: string;
|
|
12
|
+
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>;
|
|
17
|
+
"consumers.roles.assign": import("./define.js").OperationEntry<SubscriberRef & {
|
|
18
|
+
userExternalId: string;
|
|
19
|
+
roles: string[];
|
|
20
|
+
}, ConsumerMemberRolesResult>;
|
|
21
|
+
"consumers.rbac.enable": import("./define.js").OperationEntry<SubscriberRef & {
|
|
22
|
+
defaultRoleKey?: string | null;
|
|
23
|
+
}, ConsumerRbacSettingsResult>;
|
|
24
|
+
"consumers.rbac.disable": import("./define.js").OperationEntry<SubscriberRef & {
|
|
25
|
+
defaultRoleKey?: string | null;
|
|
26
|
+
}, ConsumerRbacSettingsResult>;
|
|
27
|
+
"consumers.role.list": import("./define.js").OperationEntry<SubscriberRef, {
|
|
28
|
+
roles: ConsumerRbacRole[];
|
|
29
|
+
}>;
|
|
30
|
+
"consumers.role.create": import("./define.js").OperationEntry<SubscriberRef & {
|
|
31
|
+
roleKey: string;
|
|
32
|
+
name: string;
|
|
33
|
+
permissions: string[];
|
|
34
|
+
}, ConsumerRbacRole>;
|
|
35
|
+
"consumers.role.update": import("./define.js").OperationEntry<SubscriberRef & {
|
|
36
|
+
roleKey: string;
|
|
37
|
+
} & {
|
|
38
|
+
name?: string;
|
|
39
|
+
permissions?: string[];
|
|
40
|
+
}, ConsumerRbacRole>;
|
|
41
|
+
"consumers.role.delete": import("./define.js").OperationEntry<RoleRef, void>;
|
|
42
|
+
"consumers.apiKeys.list": import("./define.js").OperationEntry<SubscriberRef, {
|
|
43
|
+
apiKeys: ConsumerApiKey[];
|
|
44
|
+
}>;
|
|
45
|
+
"consumers.apiKeys.revoke": import("./define.js").OperationEntry<SubscriberRef & {
|
|
46
|
+
keyId: string;
|
|
47
|
+
}, void>;
|
|
48
|
+
};
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { Transport, TransportRequestOptions } from "../transport.js";
|
|
2
|
+
/** Options every namespaced method accepts as its second argument. */
|
|
3
|
+
export type CallOptions = {
|
|
4
|
+
/** Cancels the request (and any retry wait). */
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
/**
|
|
7
|
+
* Ask for a preview (`?dry_run=true`) instead of applying the change.
|
|
8
|
+
* Allowed only on operations whose `meta.preview` is true; any other
|
|
9
|
+
* operation refuses it locally with `DRY_RUN_NOT_SUPPORTED`.
|
|
10
|
+
*/
|
|
11
|
+
dryRun?: boolean;
|
|
12
|
+
/** `"none"`: a single attempt, even for a read. */
|
|
13
|
+
retry?: "none";
|
|
14
|
+
};
|
|
15
|
+
/** What an operation implementation receives besides its input. */
|
|
16
|
+
export type OperationContext = {
|
|
17
|
+
readonly transport: Transport;
|
|
18
|
+
/** The transport options for this call (`signal`, `dryRun`, `retry`). */
|
|
19
|
+
readonly options: TransportRequestOptions;
|
|
20
|
+
};
|
|
21
|
+
/** One implemented operation (or helper call) of the namespaced surface. */
|
|
22
|
+
export type OperationEntry<I, O> = {
|
|
23
|
+
/**
|
|
24
|
+
* The opKey this method serves, or `null` for the few calls that have none
|
|
25
|
+
* (credential introspection, the portal plane).
|
|
26
|
+
*/
|
|
27
|
+
readonly op: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* One line, for a method that is not the opKey's primary method (it shares
|
|
30
|
+
* the opKey with it) or that has no opKey. Primary methods take their
|
|
31
|
+
* summary from the operation spec.
|
|
32
|
+
*/
|
|
33
|
+
readonly summary?: string;
|
|
34
|
+
/** Overrides the opKey's side effect (a read-only preview of a write op). */
|
|
35
|
+
readonly sideEffect?: "read" | "write";
|
|
36
|
+
/**
|
|
37
|
+
* Safety metadata for a method without an opKey (the portal plane), where
|
|
38
|
+
* no operation spec supplies it. A method with an opKey takes these from
|
|
39
|
+
* its spec.
|
|
40
|
+
*/
|
|
41
|
+
readonly destructive?: boolean;
|
|
42
|
+
readonly oneTimeSecret?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Paging style. For a method with an opKey it overrides the spec's (which
|
|
45
|
+
* describes the operation's list endpoint): `null` marks a primary method
|
|
46
|
+
* that is not that list.
|
|
47
|
+
*/
|
|
48
|
+
readonly pagination?: "offset" | "cursor" | null;
|
|
49
|
+
/** The largest page the server returns; larger `limit`s are clamped. */
|
|
50
|
+
readonly maxPageSize?: number;
|
|
51
|
+
readonly run: (ctx: OperationContext, input: I) => Promise<O>;
|
|
52
|
+
};
|
|
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>;
|
|
55
|
+
/** Input type of an entry. */
|
|
56
|
+
export type InputOf<E> = E extends OperationEntry<infer I, unknown> ? I : never;
|
|
57
|
+
/** Output type of an entry. */
|
|
58
|
+
export type OutputOf<E> = E extends OperationEntry<never, infer O> ? O : never;
|
|
59
|
+
/** Encode one caller-supplied value without letting it alter the path shape. */
|
|
60
|
+
export declare function seg(value: string): string;
|
|
61
|
+
/**
|
|
62
|
+
* Append a query string. Empty strings and `undefined` are omitted; an array
|
|
63
|
+
* value repeats the key (empty entries skipped).
|
|
64
|
+
*/
|
|
65
|
+
export declare function withQuery(path: string, params: Record<string, string | readonly string[] | undefined>): string;
|
|
66
|
+
/** A numeric query value as a string, or `undefined` when absent. */
|
|
67
|
+
export declare function num(value: number | string | undefined): string | undefined;
|
|
68
|
+
/** A server-side list query: filters, a sort, and a free-text search. */
|
|
69
|
+
export type ListQuery = {
|
|
70
|
+
readonly filters: ReadonlyArray<{
|
|
71
|
+
readonly field: string;
|
|
72
|
+
readonly value: string;
|
|
73
|
+
}>;
|
|
74
|
+
readonly sort?: {
|
|
75
|
+
readonly field: string;
|
|
76
|
+
readonly direction: "asc" | "desc";
|
|
77
|
+
};
|
|
78
|
+
readonly q?: string;
|
|
79
|
+
};
|
|
80
|
+
/** The `filter` / `sort` / `q` query parameters of a {@link ListQuery}. */
|
|
81
|
+
export declare function listQueryParams(query?: ListQuery): {
|
|
82
|
+
filter: string[] | undefined;
|
|
83
|
+
sort: string | undefined;
|
|
84
|
+
q: string | undefined;
|
|
85
|
+
};
|
|
86
|
+
/** The call's options, classified as a read-only request. */
|
|
87
|
+
export declare function readOnly(ctx: OperationContext): TransportRequestOptions;
|
|
88
|
+
/** An open JSON request body, sent as given. */
|
|
89
|
+
export type RequestBody = object;
|
|
90
|
+
/** JSON request on the context's transport. */
|
|
91
|
+
export declare function send<T>(ctx: OperationContext, method: string, path: string, body?: unknown, options?: TransportRequestOptions): Promise<T>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { EnvironmentListResult } from "../types.js";
|
|
2
|
+
import { type ListQuery } from "./define.js";
|
|
3
|
+
export declare const environmentOperations: {
|
|
4
|
+
"environments.read": import("./define.js").OperationEntry<{
|
|
5
|
+
businessId: string;
|
|
6
|
+
limit?: number;
|
|
7
|
+
offset?: number;
|
|
8
|
+
query?: ListQuery;
|
|
9
|
+
}, EnvironmentListResult>;
|
|
10
|
+
"environments.create": import("./define.js").OperationEntry<{
|
|
11
|
+
businessId: string;
|
|
12
|
+
name: string;
|
|
13
|
+
branch: string;
|
|
14
|
+
}, unknown>;
|
|
15
|
+
"environments.delete": import("./define.js").OperationEntry<{
|
|
16
|
+
businessId: string;
|
|
17
|
+
environment: string;
|
|
18
|
+
}, void>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const frontendOperations: {
|
|
2
|
+
"frontend.status": import("./define.js").OperationEntry<{
|
|
3
|
+
businessId: string;
|
|
4
|
+
environmentId?: string;
|
|
5
|
+
/** An immutable Git commit SHA: only that commit's builds. */
|
|
6
|
+
ref?: string;
|
|
7
|
+
}, unknown>;
|
|
8
|
+
"frontend.rollback": import("./define.js").OperationEntry<{
|
|
9
|
+
businessId: string;
|
|
10
|
+
releaseId: string;
|
|
11
|
+
environmentId?: string;
|
|
12
|
+
}, unknown>;
|
|
13
|
+
};
|