@meshscale/sdk 0.1.7

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/README.md ADDED
@@ -0,0 +1,70 @@
1
+ # MeshScale TypeScript SDK
2
+
3
+ The SDK is generated from `../api/openapi.json` with Hey API. After changing the API specification, run `pnpm generate` and commit the generated output with the API change.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ pnpm add @meshscale/sdk
9
+ ```
10
+
11
+ ## Use in Next.js
12
+
13
+ Create a client where the request's access token is available, such as in a Server Component, Route Handler, or Server Action. Each client has isolated configuration, so credentials are not shared between requests.
14
+
15
+ ```ts
16
+ import { createMeshScaleClient } from '@meshscale/sdk';
17
+
18
+ const client = createMeshScaleClient({
19
+ auth: () => accessToken,
20
+ });
21
+
22
+ const result = await client.organizations.list();
23
+
24
+ if (result.error) {
25
+ throw new Error(result.error.error);
26
+ }
27
+
28
+ const organizations = result.data.organizations;
29
+ ```
30
+
31
+ The base URL defaults to `https://api.meshscale.cloud`. Override it for a local or self-hosted API, and use the generated Next.js `next` request options when configuring caching or revalidation:
32
+
33
+ ```ts
34
+ const client = createMeshScaleClient({
35
+ baseUrl: process.env.MESHSCALE_API_URL,
36
+ auth: () => accessToken,
37
+ next: { revalidate: 60 },
38
+ });
39
+ ```
40
+
41
+ The same client exposes `client.organizations.create({ body: { name, slug } })`, `client.organizations.setActive({ body: { organizationId } })`, and `client.user.get()`. Generated calls return typed `{ data, error, response }` results by default; use `throwOnError: true` per request when exceptions are preferred.
42
+
43
+ List deployments visible to the signed-in user, optionally filtering by project ID or region slug. Provide a deployment ID to return its project and region, versions, domains, and recent metrics:
44
+
45
+ ```ts
46
+ const result = await client.deployments.list({
47
+ query: { projectId, region: "syd", limit: 50 },
48
+ throwOnError: true,
49
+ });
50
+
51
+ const response = result.data;
52
+ if ("deployments" in response) {
53
+ const nextCursor = response.nextCursor;
54
+ } else {
55
+ const deployment = response.deployment;
56
+ }
57
+ ```
58
+
59
+ The list endpoint uses `nextCursor` for pagination. Detail collections are capped at 100 entries and include `versionsHasMore`, `domainsHasMore`, and `metricsHasMore` indicators. Environment values, arbitrary configuration objects, logs, and container identifiers are not returned.
60
+
61
+ Do not pass secret API tokens to Client Components. Call the SDK from server-side code or through an authenticated application route.
62
+
63
+ ## Development
64
+
65
+ ```sh
66
+ pnpm install
67
+ pnpm generate
68
+ pnpm typecheck
69
+ pnpm build
70
+ ```
@@ -0,0 +1,2 @@
1
+ import type { Client, Config } from './types.gen';
2
+ export declare const createClient: (config?: Config) => Client;
@@ -0,0 +1,10 @@
1
+ export type { Auth } from '../core/auth.gen';
2
+ export type { QuerySerializerOptions } from '../core/bodySerializer.gen';
3
+ export { formDataBodySerializer, jsonBodySerializer, urlSearchParamsBodySerializer, } from '../core/bodySerializer.gen';
4
+ export { buildClientParams } from '../core/params.gen';
5
+ export { serializeQueryKeyValue } from '../core/queryKeySerializer.gen';
6
+ export type { ServerSentEventsResult } from '../core/serverSentEvents.gen';
7
+ export type { ClientMeta } from '../core/types.gen';
8
+ export { createClient } from './client.gen';
9
+ export type { Client, ClientOptions, Config, CreateClientConfig, Options, RequestOptions, RequestResult, TDataShape, } from './types.gen';
10
+ export { createConfig } from './utils.gen';
@@ -0,0 +1,101 @@
1
+ import type { Auth } from '../core/auth.gen';
2
+ import type { ServerSentEventsOptions, ServerSentEventsResult } from '../core/serverSentEvents.gen';
3
+ import type { Client as CoreClient, Config as CoreConfig } from '../core/types.gen';
4
+ import type { Middleware } from './utils.gen';
5
+ export interface Config<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, CoreConfig {
6
+ /**
7
+ * Base URL for all requests made by this client.
8
+ */
9
+ baseUrl?: T['baseUrl'];
10
+ /**
11
+ * Fetch API implementation. You can use this option to provide a custom
12
+ * fetch instance.
13
+ *
14
+ * @default globalThis.fetch
15
+ */
16
+ fetch?: typeof fetch;
17
+ /**
18
+ * Return the response data parsed in a specified format. By default, `auto`
19
+ * will infer the appropriate method from the `Content-Type` response header.
20
+ * You can override this behavior with any of the {@link Body} methods.
21
+ * Select `stream` if you don't want to parse response data at all.
22
+ *
23
+ * @default 'auto'
24
+ */
25
+ parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
26
+ /**
27
+ * Throw an error instead of returning it in the response?
28
+ *
29
+ * @default false
30
+ */
31
+ throwOnError?: T['throwOnError'];
32
+ }
33
+ export interface RequestOptions<TData = unknown, ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
34
+ throwOnError: ThrowOnError;
35
+ }>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
36
+ /**
37
+ * Any body that you want to add to your request.
38
+ *
39
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
40
+ */
41
+ body?: unknown;
42
+ path?: Record<string, unknown>;
43
+ query?: Record<string, unknown>;
44
+ /**
45
+ * Security mechanism(s) to use for the request.
46
+ */
47
+ security?: ReadonlyArray<Auth>;
48
+ url: Url;
49
+ }
50
+ export interface ResolvedRequestOptions<ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, ThrowOnError, Url> {
51
+ headers: Headers;
52
+ serializedBody?: string;
53
+ }
54
+ export type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean> = ThrowOnError extends true ? Promise<{
55
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
56
+ response: Response;
57
+ }> : Promise<({
58
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
59
+ error: undefined;
60
+ } | {
61
+ data: undefined;
62
+ error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
63
+ }) & {
64
+ /** response may be undefined due to a network error where no response object is produced */
65
+ response?: Response;
66
+ }>;
67
+ export interface ClientOptions {
68
+ baseUrl?: string;
69
+ throwOnError?: boolean;
70
+ }
71
+ type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions<TData, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError>;
72
+ type SseFn = <TData = unknown, _TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions<never, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData>>;
73
+ type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false>(options: Omit<RequestOptions<TData, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError>;
74
+ type BuildUrlFn = <TData extends {
75
+ body?: unknown;
76
+ path?: Record<string, unknown>;
77
+ query?: Record<string, unknown>;
78
+ url: string;
79
+ }>(options: TData & Options<TData>) => string;
80
+ export type Client = CoreClient<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
81
+ interceptors: Middleware<Response, unknown, ResolvedRequestOptions>;
82
+ };
83
+ /**
84
+ * The `createClientConfig()` function will be called on client initialization
85
+ * and the returned object will become the client's initial configuration.
86
+ *
87
+ * You may want to initialize your client this way instead of calling
88
+ * `setConfig()`. This is useful for example if you're using Next.js
89
+ * to ensure your client always has the correct values.
90
+ */
91
+ export type CreateClientConfig<T extends ClientOptions = ClientOptions> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
92
+ export interface TDataShape {
93
+ body?: unknown;
94
+ headers?: unknown;
95
+ path?: unknown;
96
+ query?: unknown;
97
+ url: string;
98
+ }
99
+ type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
100
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = OmitKeys<RequestOptions<TResponse, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
101
+ export {};
@@ -0,0 +1,42 @@
1
+ import type { QuerySerializer, QuerySerializerOptions } from '../core/bodySerializer.gen';
2
+ import type { Client, ClientOptions, Config, RequestOptions } from './types.gen';
3
+ export declare const createQuerySerializer: <T = unknown>({ parameters, ...args }?: QuerySerializerOptions) => ((queryParams: T) => string);
4
+ /**
5
+ * Infers parseAs value from provided Content-Type header.
6
+ */
7
+ export declare const getParseAs: (contentType: string | null) => Exclude<Config["parseAs"], "auto">;
8
+ export declare function setAuthParams(options: Pick<RequestOptions, 'auth' | 'query' | 'security'> & {
9
+ headers: Headers;
10
+ }): Promise<void>;
11
+ export declare const buildUrl: Client['buildUrl'];
12
+ export declare const getUrl: ({ baseUrl, path, query, querySerializer, url: _url, }: {
13
+ baseUrl?: string;
14
+ path?: Record<string, unknown>;
15
+ query?: Record<string, unknown>;
16
+ querySerializer: QuerySerializer;
17
+ url: string;
18
+ }) => string;
19
+ export declare const mergeConfigs: (a: Config, b: Config) => Config;
20
+ export declare const mergeHeaders: (...headers: Array<Required<Config>["headers"] | undefined>) => Headers;
21
+ type ErrInterceptor<Err, Res, Options> = (error: Err,
22
+ /** response may be undefined due to a network error where no response object is produced */
23
+ response: Res | undefined, options: Options) => Err | Promise<Err>;
24
+ type ReqInterceptor<Options> = (options: Options) => void | Promise<void>;
25
+ type ResInterceptor<Res, Options> = (response: Res, options: Options) => Res | Promise<Res>;
26
+ declare class Interceptors<Interceptor> {
27
+ fns: Array<Interceptor | null>;
28
+ clear(): void;
29
+ eject(id: number | Interceptor): void;
30
+ exists(id: number | Interceptor): boolean;
31
+ getInterceptorIndex(id: number | Interceptor): number;
32
+ update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
33
+ use(fn: Interceptor): number;
34
+ }
35
+ export interface Middleware<Res, Err, Options> {
36
+ error: Interceptors<ErrInterceptor<Err, Res, Options>>;
37
+ request: Interceptors<ReqInterceptor<Options>>;
38
+ response: Interceptors<ResInterceptor<Res, Options>>;
39
+ }
40
+ export declare const createInterceptors: <Res, Err, Options>() => Middleware<Res, Err, Options>;
41
+ export declare const createConfig: <T extends ClientOptions = ClientOptions>(override?: Config<Omit<ClientOptions, keyof T> & T>) => Config<Omit<ClientOptions, keyof T> & T>;
42
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type Client, type ClientOptions, type Config } from './client';
2
+ import type { ClientOptions as ClientOptions2 } from './types.gen';
3
+ /**
4
+ * The `createClientConfig()` function will be called on client initialization
5
+ * and the returned object will become the client's initial configuration.
6
+ *
7
+ * You may want to initialize your client this way instead of calling
8
+ * `setConfig()`. This is useful for example if you're using Next.js
9
+ * to ensure your client always has the correct values.
10
+ */
11
+ export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (override?: Config<ClientOptions & T>) => Config<Required<ClientOptions> & T>;
12
+ export declare const client: Client;
@@ -0,0 +1,25 @@
1
+ export type AuthToken = string | undefined;
2
+ export interface Auth {
3
+ /**
4
+ * Which part of the request do we use to send the auth?
5
+ *
6
+ * @default 'header'
7
+ */
8
+ in?: 'header' | 'query' | 'cookie';
9
+ /**
10
+ * A unique identifier for the security scheme.
11
+ *
12
+ * Defined only when there are multiple security schemes whose `Auth`
13
+ * shape would otherwise be identical.
14
+ */
15
+ key?: string;
16
+ /**
17
+ * Header or query parameter name.
18
+ *
19
+ * @default 'Authorization'
20
+ */
21
+ name?: string;
22
+ scheme?: 'basic' | 'bearer';
23
+ type: 'apiKey' | 'http';
24
+ }
25
+ export declare const getAuthToken: (auth: Auth, callback: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken) => Promise<string | undefined>;
@@ -0,0 +1,25 @@
1
+ import type { ArrayStyle, ObjectStyle, SerializerOptions } from './pathSerializer.gen';
2
+ export type QuerySerializer = (query: Record<string, unknown>) => string;
3
+ export type BodySerializer = (body: unknown) => unknown;
4
+ type QuerySerializerOptionsObject = {
5
+ allowReserved?: boolean;
6
+ array?: Partial<SerializerOptions<ArrayStyle>>;
7
+ object?: Partial<SerializerOptions<ObjectStyle>>;
8
+ };
9
+ export type QuerySerializerOptions = QuerySerializerOptionsObject & {
10
+ /**
11
+ * Per-parameter serialization overrides. When provided, these settings
12
+ * override the global array/object settings for specific parameter names.
13
+ */
14
+ parameters?: Record<string, QuerySerializerOptionsObject>;
15
+ };
16
+ export declare const formDataBodySerializer: {
17
+ bodySerializer: (body: unknown) => FormData;
18
+ };
19
+ export declare const jsonBodySerializer: {
20
+ bodySerializer: (body: unknown) => string;
21
+ };
22
+ export declare const urlSearchParamsBodySerializer: {
23
+ bodySerializer: (body: unknown) => string;
24
+ };
25
+ export {};
@@ -0,0 +1,43 @@
1
+ type Slot = 'body' | 'headers' | 'path' | 'query';
2
+ export type Field = {
3
+ in: Exclude<Slot, 'body'>;
4
+ /**
5
+ * Field name. This is the name we want the user to see and use.
6
+ */
7
+ key: string;
8
+ /**
9
+ * Field mapped name. This is the name we want to use in the request.
10
+ * If omitted, we use the same value as `key`.
11
+ */
12
+ map?: string;
13
+ } | {
14
+ in: Extract<Slot, 'body'>;
15
+ /**
16
+ * Key isn't required for bodies.
17
+ */
18
+ key?: string;
19
+ map?: string;
20
+ } | {
21
+ /**
22
+ * Field name. This is the name we want the user to see and use.
23
+ */
24
+ key: string;
25
+ /**
26
+ * Field mapped name. This is the name we want to use in the request.
27
+ * If `in` is omitted, `map` aliases `key` to the transport layer.
28
+ */
29
+ map: Slot;
30
+ };
31
+ export interface Fields {
32
+ allowExtra?: Partial<Record<Slot, boolean>>;
33
+ args?: ReadonlyArray<Field>;
34
+ }
35
+ export type FieldsConfig = ReadonlyArray<Field | Fields>;
36
+ interface Params {
37
+ body?: unknown;
38
+ headers: Record<string, unknown>;
39
+ path: Record<string, unknown>;
40
+ query: Record<string, unknown>;
41
+ }
42
+ export declare function buildClientParams(args: ReadonlyArray<unknown>, fields: FieldsConfig): Params;
43
+ export {};
@@ -0,0 +1,33 @@
1
+ interface SerializeOptions<T> extends SerializePrimitiveOptions, SerializerOptions<T> {
2
+ }
3
+ interface SerializePrimitiveOptions {
4
+ allowReserved?: boolean;
5
+ name: string;
6
+ }
7
+ export interface SerializerOptions<T> {
8
+ /**
9
+ * @default true
10
+ */
11
+ explode: boolean;
12
+ style: T;
13
+ }
14
+ export type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
15
+ export type ArraySeparatorStyle = ArrayStyle | MatrixStyle;
16
+ type MatrixStyle = 'label' | 'matrix' | 'simple';
17
+ export type ObjectStyle = 'form' | 'deepObject';
18
+ type ObjectSeparatorStyle = ObjectStyle | MatrixStyle;
19
+ interface SerializePrimitiveParam extends SerializePrimitiveOptions {
20
+ value: string;
21
+ }
22
+ export declare const separatorArrayExplode: (style: ArraySeparatorStyle) => "." | ";" | "," | "&";
23
+ export declare const separatorArrayNoExplode: (style: ArraySeparatorStyle) => "," | "|" | "%20";
24
+ export declare const separatorObjectExplode: (style: ObjectSeparatorStyle) => "." | ";" | "," | "&";
25
+ export declare const serializeArrayParam: ({ allowReserved, explode, name, style, value, }: SerializeOptions<ArraySeparatorStyle> & {
26
+ value: unknown[];
27
+ }) => string;
28
+ export declare const serializePrimitiveParam: ({ allowReserved, name, value, }: SerializePrimitiveParam) => string;
29
+ export declare const serializeObjectParam: ({ allowReserved, explode, name, style, value, valueOnly, }: SerializeOptions<ObjectSeparatorStyle> & {
30
+ value: Record<string, unknown> | Date;
31
+ valueOnly?: boolean;
32
+ }) => string;
33
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * JSON-friendly union that mirrors what Pinia Colada can hash.
3
+ */
4
+ export type JsonValue = null | string | number | boolean | JsonValue[] | {
5
+ [key: string]: JsonValue;
6
+ };
7
+ /**
8
+ * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes.
9
+ */
10
+ export declare const queryKeyJsonReplacer: (_key: string, value: unknown) => unknown | undefined;
11
+ /**
12
+ * Safely stringifies a value and parses it back into a JsonValue.
13
+ */
14
+ export declare const stringifyToJsonValue: (input: unknown) => JsonValue | undefined;
15
+ /**
16
+ * Normalizes any accepted value into a JSON-friendly shape for query keys.
17
+ */
18
+ export declare const serializeQueryKeyValue: (value: unknown) => JsonValue | undefined;
@@ -0,0 +1,71 @@
1
+ import type { Config } from './types.gen';
2
+ export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config, 'method' | 'responseTransformer' | 'responseValidator'> & {
3
+ /**
4
+ * Fetch API implementation. You can use this option to provide a custom
5
+ * fetch instance.
6
+ *
7
+ * @default globalThis.fetch
8
+ */
9
+ fetch?: typeof fetch;
10
+ /**
11
+ * Implementing clients can call request interceptors inside this hook.
12
+ */
13
+ onRequest?: (url: string, init: RequestInit) => Promise<Request>;
14
+ /**
15
+ * Callback invoked when a network or parsing error occurs during streaming.
16
+ *
17
+ * This option applies only if the endpoint returns a stream of events.
18
+ *
19
+ * @param error The error that occurred.
20
+ */
21
+ onSseError?: (error: unknown) => void;
22
+ /**
23
+ * Callback invoked when an event is streamed from the server.
24
+ *
25
+ * This option applies only if the endpoint returns a stream of events.
26
+ *
27
+ * @param event Event streamed from the server.
28
+ * @returns Nothing (void).
29
+ */
30
+ onSseEvent?: (event: StreamEvent<TData>) => void;
31
+ serializedBody?: RequestInit['body'];
32
+ /**
33
+ * Default retry delay in milliseconds.
34
+ *
35
+ * This option applies only if the endpoint returns a stream of events.
36
+ *
37
+ * @default 3000
38
+ */
39
+ sseDefaultRetryDelay?: number;
40
+ /**
41
+ * Maximum number of retry attempts before giving up.
42
+ */
43
+ sseMaxRetryAttempts?: number;
44
+ /**
45
+ * Maximum retry delay in milliseconds.
46
+ *
47
+ * Applies only when exponential backoff is used.
48
+ *
49
+ * This option applies only if the endpoint returns a stream of events.
50
+ *
51
+ * @default 30000
52
+ */
53
+ sseMaxRetryDelay?: number;
54
+ /**
55
+ * Optional sleep function for retry backoff.
56
+ *
57
+ * Defaults to using `setTimeout`.
58
+ */
59
+ sseSleepFn?: (ms: number) => Promise<void>;
60
+ url: string;
61
+ };
62
+ export interface StreamEvent<TData = unknown> {
63
+ data: TData;
64
+ event?: string;
65
+ id?: string;
66
+ retry?: number;
67
+ }
68
+ export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
69
+ stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
70
+ };
71
+ export declare function createSseClient<TData = unknown>({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url, ...options }: ServerSentEventsOptions): ServerSentEventsResult<TData>;
@@ -0,0 +1,83 @@
1
+ import type { Auth, AuthToken } from './auth.gen';
2
+ import type { BodySerializer, QuerySerializer, QuerySerializerOptions } from './bodySerializer.gen';
3
+ export type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
4
+ export type Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
5
+ /**
6
+ * Returns the final request URL.
7
+ */
8
+ buildUrl: BuildUrlFn;
9
+ getConfig: () => Config;
10
+ request: RequestFn;
11
+ setConfig: (config: Config) => Config;
12
+ } & {
13
+ [K in HttpMethod]: MethodFn;
14
+ } & ([SseFn] extends [never] ? {
15
+ sse?: never;
16
+ } : {
17
+ sse: {
18
+ [K in HttpMethod]: SseFn;
19
+ };
20
+ });
21
+ export interface Config {
22
+ /**
23
+ * Auth token or a function returning auth token. The resolved value will be
24
+ * added to the request payload as defined by its `security` array.
25
+ */
26
+ auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
27
+ /**
28
+ * A function for serializing request body parameter. By default,
29
+ * {@link JSON.stringify()} will be used.
30
+ */
31
+ bodySerializer?: BodySerializer | null;
32
+ /**
33
+ * An object containing any HTTP headers that you want to pre-populate your
34
+ * `Headers` object with.
35
+ *
36
+ * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
37
+ */
38
+ headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
39
+ /**
40
+ * The request method.
41
+ *
42
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
43
+ */
44
+ method?: Uppercase<HttpMethod>;
45
+ /**
46
+ * A function for serializing request query parameters. By default, arrays
47
+ * will be exploded in form style, objects will be exploded in deepObject
48
+ * style, and reserved characters are percent-encoded.
49
+ *
50
+ * This method will have no effect if the native `paramsSerializer()` Axios
51
+ * API function is used.
52
+ *
53
+ * {@link https://swagger.io/docs/specification/serialization/#query View examples}
54
+ */
55
+ querySerializer?: QuerySerializer | QuerySerializerOptions;
56
+ /**
57
+ * A function validating request data. This is useful if you want to ensure
58
+ * the request conforms to the desired shape, so it can be safely sent to
59
+ * the server.
60
+ */
61
+ requestValidator?: (data: unknown) => Promise<unknown>;
62
+ /**
63
+ * A function transforming response data before it's returned. This is useful
64
+ * for post-processing data, e.g., converting ISO strings into Date objects.
65
+ */
66
+ responseTransformer?: (data: unknown) => Promise<unknown>;
67
+ /**
68
+ * A function validating response data. This is useful if you want to ensure
69
+ * the response conforms to the desired shape, so it can be safely passed to
70
+ * the transformers and returned to the user.
71
+ */
72
+ responseValidator?: (data: unknown) => Promise<unknown>;
73
+ }
74
+ /**
75
+ * Arbitrary metadata passed through the `meta` request option.
76
+ */
77
+ export interface ClientMeta {
78
+ }
79
+ type IsExactlyNeverOrNeverUndefined<T> = [T] extends [never] ? true : [T] extends [never | undefined] ? [undefined] extends [T] ? false : true : false;
80
+ export type OmitNever<T extends Record<string, unknown>> = {
81
+ [K in keyof T as IsExactlyNeverOrNeverUndefined<T[K]> extends true ? never : K]: T[K];
82
+ };
83
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { BodySerializer, QuerySerializer } from './bodySerializer.gen';
2
+ export interface PathSerializer {
3
+ path: Record<string, unknown>;
4
+ url: string;
5
+ }
6
+ export declare const PATH_PARAM_RE: RegExp;
7
+ export declare const defaultPathSerializer: ({ path, url: _url }: PathSerializer) => string;
8
+ export declare const getUrl: ({ baseUrl, path, query, querySerializer, url: _url, }: {
9
+ baseUrl?: string;
10
+ path?: Record<string, unknown>;
11
+ query?: Record<string, unknown>;
12
+ querySerializer: QuerySerializer;
13
+ url: string;
14
+ }) => string;
15
+ export declare function getValidRequestBody(options: {
16
+ body?: unknown;
17
+ bodySerializer?: BodySerializer | null;
18
+ serializedBody?: unknown;
19
+ }): unknown;
@@ -0,0 +1,2 @@
1
+ export { createBuild, createDeployment, createOrganization, createProject, deleteDeployment, deleteProject, getDeployment, getHealth, getProject, getProjectSettings, getTeamSettings, getUser, getUserPreferences, listBuilds, listDeployments, listOrganizations, listProjects, listRegions, type Options, setActiveOrganization, updateDeployment, updateProject, updateProjectSettings, updateTeamSettings, updateUserPreferences } from './sdk.gen';
2
+ export type { Build, BuildResponse, BuildsResponse, ClientOptions, CreateBuild, CreateBuildData, CreateBuildError, CreateBuildErrors, CreateBuildResponse, CreateBuildResponses, CreateDeployment, CreateDeploymentData, CreateDeploymentError, CreateDeploymentErrors, CreateDeploymentResponse, CreateDeploymentResponses, CreateOrganization, CreateOrganizationData, CreateOrganizationError, CreateOrganizationErrors, CreateOrganizationResponse, CreateOrganizationResponses, CreateProject, CreateProjectData, CreateProjectError, CreateProjectErrors, CreateProjectResponse, CreateProjectResponses, DeleteDeploymentData, DeleteDeploymentError, DeleteDeploymentErrors, DeleteDeploymentResponse, DeleteDeploymentResponses, DeleteProjectData, DeleteProjectError, DeleteProjectErrors, DeleteProjectResponse, DeleteProjectResponses, Deployment, DeploymentCreateResponse, DeploymentDetailResponse, DeploymentId, DeploymentPatch, DeploymentResponse, DeploymentsResponse, Error, ErrorResponse, GetDeploymentData, GetDeploymentError, GetDeploymentErrors, GetDeploymentResponse, GetDeploymentResponses, GetHealthData, GetHealthError, GetHealthErrors, GetHealthResponse, GetHealthResponses, GetProjectData, GetProjectError, GetProjectErrors, GetProjectResponse, GetProjectResponses, GetProjectSettingsData, GetProjectSettingsError, GetProjectSettingsErrors, GetProjectSettingsResponse, GetProjectSettingsResponses, GetTeamSettingsData, GetTeamSettingsError, GetTeamSettingsErrors, GetTeamSettingsResponse, GetTeamSettingsResponses, GetUserData, GetUserError, GetUserErrors, GetUserPreferencesData, GetUserPreferencesError, GetUserPreferencesErrors, GetUserPreferencesResponse, GetUserPreferencesResponses, GetUserResponse, GetUserResponses, HealthResponse, ListBuildsData, ListBuildsError, ListBuildsErrors, ListBuildsResponse, ListBuildsResponses, ListDeploymentsData, ListDeploymentsError, ListDeploymentsErrors, ListDeploymentsResponse, ListDeploymentsResponses, ListOrganizationsData, ListOrganizationsError, ListOrganizationsErrors, ListOrganizationsResponse, ListOrganizationsResponses, ListProjectsData, ListProjectsError, ListProjectsErrors, ListProjectsResponse, ListProjectsResponses, ListRegionsData, ListRegionsError, ListRegionsErrors, ListRegionsResponse, ListRegionsResponses, Organization, OrganizationListResponse, OrganizationResponse, Project, ProjectDetailResponse, ProjectId, ProjectIdQuery, ProjectPatch, ProjectResponse, ProjectSettings, ProjectSettingsPatch, ProjectSettingsPatchResponse, ProjectSettingsResponse, ProjectsResponse, Region, RegionIdQuery, RegionsResponse, SetActiveOrganization, SetActiveOrganizationData, SetActiveOrganizationError, SetActiveOrganizationErrors, SetActiveOrganizationResponse, SetActiveOrganizationResponses, TeamSettings, TeamSettingsPatch, TeamSettingsPatchResponse, TeamSettingsResponse, UpdateDeploymentData, UpdateDeploymentError, UpdateDeploymentErrors, UpdateDeploymentResponse, UpdateDeploymentResponses, UpdateProjectData, UpdateProjectError, UpdateProjectErrors, UpdateProjectResponse, UpdateProjectResponses, UpdateProjectSettingsData, UpdateProjectSettingsError, UpdateProjectSettingsErrors, UpdateProjectSettingsResponse, UpdateProjectSettingsResponses, UpdateTeamSettingsData, UpdateTeamSettingsError, UpdateTeamSettingsErrors, UpdateTeamSettingsResponse, UpdateTeamSettingsResponses, UpdateUserPreferencesData, UpdateUserPreferencesError, UpdateUserPreferencesErrors, UpdateUserPreferencesResponse, UpdateUserPreferencesResponses, UserPreferencesPatch, UserPreferencesResponse, UserResponse } from './types.gen';