@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.
- package/CHANGELOG.md +196 -0
- package/README.md +252 -2
- package/dist/index.js +7009 -0
- package/dist/types/api.generated.d.ts +1362 -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/generated/schemas.d.ts +3670 -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 +51 -0
- package/dist/types/index.d.ts +24 -0
- package/dist/types/operations/agents.d.ts +240 -0
- package/dist/types/operations/agreements.d.ts +174 -0
- package/dist/types/operations/analytics.d.ts +47 -0
- package/dist/types/operations/audit-notifications.d.ts +90 -0
- package/dist/types/operations/auth.d.ts +24 -0
- package/dist/types/operations/backends.d.ts +255 -0
- package/dist/types/operations/billing.d.ts +71 -0
- package/dist/types/operations/businesses.d.ts +795 -0
- package/dist/types/operations/change-sets.d.ts +462 -0
- package/dist/types/operations/consumers.d.ts +168 -0
- package/dist/types/operations/define.d.ts +102 -0
- package/dist/types/operations/environments.d.ts +55 -0
- package/dist/types/operations/frontend.d.ts +31 -0
- package/dist/types/operations/index.d.ts +4773 -0
- package/dist/types/operations/maker-tokens.d.ts +194 -0
- package/dist/types/operations/organizations.d.ts +373 -0
- package/dist/types/operations/personas.d.ts +136 -0
- package/dist/types/operations/plans-usage.d.ts +84 -0
- package/dist/types/operations/platform.d.ts +455 -0
- package/dist/types/operations/portal.d.ts +442 -0
- package/dist/types/operations/promo-codes.d.ts +139 -0
- package/dist/types/operations/variables.d.ts +188 -0
- package/dist/types/operations/webhooks.d.ts +130 -0
- package/dist/types/surface-types.d.ts +76 -0
- package/dist/types/surface.d.ts +35 -0
- package/dist/types/transport.d.ts +114 -0
- package/dist/types/types.d.ts +440 -0
- package/dist/types/version.d.ts +8 -0
- package/package.json +53 -3
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
/**
|
|
22
|
+
* One implemented operation (or helper call) of the namespaced surface. `W` is
|
|
23
|
+
* what a preview (`{ dryRun: true }`) would have returned, inside the
|
|
24
|
+
* `{ dryRun, wouldHave }` envelope; it is the output itself unless the
|
|
25
|
+
* operation previews a different shape.
|
|
26
|
+
*/
|
|
27
|
+
export type OperationEntry<I, O, W = O> = {
|
|
28
|
+
/**
|
|
29
|
+
* The opKey this method serves, or `null` for the few calls that have none
|
|
30
|
+
* (credential introspection, the portal plane).
|
|
31
|
+
*/
|
|
32
|
+
readonly op: string | null;
|
|
33
|
+
/**
|
|
34
|
+
* One line, for a method that is not the opKey's primary method (it shares
|
|
35
|
+
* the opKey with it) or that has no opKey. Primary methods take their
|
|
36
|
+
* summary from the operation spec.
|
|
37
|
+
*/
|
|
38
|
+
readonly summary?: string;
|
|
39
|
+
/** Overrides the opKey's side effect (a read-only preview of a write op). */
|
|
40
|
+
readonly sideEffect?: "read" | "write";
|
|
41
|
+
/**
|
|
42
|
+
* Safety metadata for a method without an opKey (the portal plane), where
|
|
43
|
+
* no operation spec supplies it. A method with an opKey takes these from
|
|
44
|
+
* its spec.
|
|
45
|
+
*/
|
|
46
|
+
readonly destructive?: boolean;
|
|
47
|
+
readonly oneTimeSecret?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Paging style. For a method with an opKey it overrides the spec's (which
|
|
50
|
+
* describes the operation's list endpoint): `null` marks a primary method
|
|
51
|
+
* that is not that list.
|
|
52
|
+
*/
|
|
53
|
+
readonly pagination?: "offset" | "cursor" | null;
|
|
54
|
+
/** The largest page the server returns; larger `limit`s are clamped. */
|
|
55
|
+
readonly maxPageSize?: number;
|
|
56
|
+
readonly run: (ctx: OperationContext, input: I) => Promise<O>;
|
|
57
|
+
/** Type-only: carries `W`. Never set at runtime. */
|
|
58
|
+
readonly __wouldHave?: W;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Declare an operation; the type parameters are its input, its output, and
|
|
62
|
+
* (when a preview returns a different shape than the write) the preview's
|
|
63
|
+
* `wouldHave`.
|
|
64
|
+
*/
|
|
65
|
+
export declare function operation<I, O, W = O>(entry: OperationEntry<I, O, W>): OperationEntry<I, O, W>;
|
|
66
|
+
/** Input type of an entry. */
|
|
67
|
+
export type InputOf<E> = E extends OperationEntry<infer I, unknown> ? I : never;
|
|
68
|
+
/** Output type of an entry. */
|
|
69
|
+
export type OutputOf<E> = E extends OperationEntry<never, infer O, any> ? O : never;
|
|
70
|
+
/** Encode one caller-supplied value without letting it alter the path shape. */
|
|
71
|
+
export declare function seg(value: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Append a query string. Empty strings and `undefined` are omitted; an array
|
|
74
|
+
* value repeats the key (empty entries skipped).
|
|
75
|
+
*/
|
|
76
|
+
export declare function withQuery(path: string, params: Record<string, string | readonly string[] | undefined>): string;
|
|
77
|
+
/** A numeric query value as a string, or `undefined` when absent. */
|
|
78
|
+
export declare function num(value: number | string | undefined): string | undefined;
|
|
79
|
+
/** A server-side list query: filters, a sort, and a free-text search. */
|
|
80
|
+
export type ListQuery = {
|
|
81
|
+
readonly filters: ReadonlyArray<{
|
|
82
|
+
readonly field: string;
|
|
83
|
+
readonly value: string;
|
|
84
|
+
}>;
|
|
85
|
+
readonly sort?: {
|
|
86
|
+
readonly field: string;
|
|
87
|
+
readonly direction: "asc" | "desc";
|
|
88
|
+
};
|
|
89
|
+
readonly q?: string;
|
|
90
|
+
};
|
|
91
|
+
/** The `filter` / `sort` / `q` query parameters of a {@link ListQuery}. */
|
|
92
|
+
export declare function listQueryParams(query?: ListQuery): {
|
|
93
|
+
filter: string[] | undefined;
|
|
94
|
+
sort: string | undefined;
|
|
95
|
+
q: string | undefined;
|
|
96
|
+
};
|
|
97
|
+
/** The call's options, classified as a read-only request. */
|
|
98
|
+
export declare function readOnly(ctx: OperationContext): TransportRequestOptions;
|
|
99
|
+
/** An open JSON request body, sent as given. */
|
|
100
|
+
export type RequestBody = object;
|
|
101
|
+
/** JSON request on the context's transport. */
|
|
102
|
+
export declare function send<T>(ctx: OperationContext, method: string, path: string, body?: unknown, options?: TransportRequestOptions): Promise<T>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { type ListQuery } from "./define.js";
|
|
2
|
+
export declare const environmentOperations: {
|
|
3
|
+
"environments.read": import("./define.js").OperationEntry<{
|
|
4
|
+
businessId: string;
|
|
5
|
+
limit?: number;
|
|
6
|
+
offset?: number;
|
|
7
|
+
query?: ListQuery;
|
|
8
|
+
}, {
|
|
9
|
+
data: import("../generated/schemas.js").components["schemas"]["BusinessEnvironment"][];
|
|
10
|
+
pagination: {
|
|
11
|
+
total: number;
|
|
12
|
+
limit: number;
|
|
13
|
+
offset: number;
|
|
14
|
+
hasMore: boolean;
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
data: import("../generated/schemas.js").components["schemas"]["BusinessEnvironment"][];
|
|
18
|
+
pagination: {
|
|
19
|
+
total: number;
|
|
20
|
+
limit: number;
|
|
21
|
+
offset: number;
|
|
22
|
+
hasMore: boolean;
|
|
23
|
+
};
|
|
24
|
+
}>;
|
|
25
|
+
"environments.create": import("./define.js").OperationEntry<{
|
|
26
|
+
businessId: string;
|
|
27
|
+
name: string;
|
|
28
|
+
branch: string;
|
|
29
|
+
}, {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
branch: string;
|
|
33
|
+
subdomain: string;
|
|
34
|
+
runtimeHostname: string;
|
|
35
|
+
portalHostname: string | null;
|
|
36
|
+
status: string;
|
|
37
|
+
created: boolean;
|
|
38
|
+
branchCreated: boolean;
|
|
39
|
+
}, {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
branch: string;
|
|
43
|
+
subdomain: string;
|
|
44
|
+
runtimeHostname: string;
|
|
45
|
+
portalHostname: string | null;
|
|
46
|
+
status: string;
|
|
47
|
+
created: boolean;
|
|
48
|
+
branchCreated: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
/** Resolves with no body; an environment already gone also resolves. */
|
|
51
|
+
"environments.delete": import("./define.js").OperationEntry<{
|
|
52
|
+
businessId: string;
|
|
53
|
+
environment: string;
|
|
54
|
+
}, void, void>;
|
|
55
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
}, {
|
|
8
|
+
status: import("../generated/schemas.js").components["schemas"]["FrontendServeState"];
|
|
9
|
+
releases: import("../generated/schemas.js").components["schemas"]["FrontendRelease"][];
|
|
10
|
+
builds: import("../generated/schemas.js").components["schemas"]["FrontendBuild"][];
|
|
11
|
+
}, {
|
|
12
|
+
status: import("../generated/schemas.js").components["schemas"]["FrontendServeState"];
|
|
13
|
+
releases: import("../generated/schemas.js").components["schemas"]["FrontendRelease"][];
|
|
14
|
+
builds: import("../generated/schemas.js").components["schemas"]["FrontendBuild"][];
|
|
15
|
+
}>;
|
|
16
|
+
"frontend.rollback": import("./define.js").OperationEntry<{
|
|
17
|
+
businessId: string;
|
|
18
|
+
releaseId: string;
|
|
19
|
+
environmentId?: string;
|
|
20
|
+
}, {
|
|
21
|
+
releaseId: string;
|
|
22
|
+
buildId: string;
|
|
23
|
+
environmentId: string | null;
|
|
24
|
+
host: string;
|
|
25
|
+
uiMode: "template" | "custom-react";
|
|
26
|
+
}, {
|
|
27
|
+
releaseId: string;
|
|
28
|
+
buildId: string;
|
|
29
|
+
environmentId: string | null;
|
|
30
|
+
}>;
|
|
31
|
+
};
|