@aifeatures/backend 0.1.2
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/dist/index.cjs +1002 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +995 -0
- package/dist/index.d.ts +995 -0
- package/dist/index.js +959 -0
- package/dist/index.js.map +1 -0
- package/package.json +38 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,995 @@
|
|
|
1
|
+
type AuthToken = string | undefined;
|
|
2
|
+
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
|
+
* Header or query parameter name.
|
|
11
|
+
*
|
|
12
|
+
* @default 'Authorization'
|
|
13
|
+
*/
|
|
14
|
+
name?: string;
|
|
15
|
+
scheme?: "basic" | "bearer";
|
|
16
|
+
type: "apiKey" | "http";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface SerializerOptions<T> {
|
|
20
|
+
/**
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
explode: boolean;
|
|
24
|
+
style: T;
|
|
25
|
+
}
|
|
26
|
+
type ArrayStyle = "form" | "spaceDelimited" | "pipeDelimited";
|
|
27
|
+
type ObjectStyle = "form" | "deepObject";
|
|
28
|
+
|
|
29
|
+
type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
30
|
+
type BodySerializer = (body: any) => any;
|
|
31
|
+
type QuerySerializerOptionsObject = {
|
|
32
|
+
allowReserved?: boolean;
|
|
33
|
+
array?: Partial<SerializerOptions<ArrayStyle>>;
|
|
34
|
+
object?: Partial<SerializerOptions<ObjectStyle>>;
|
|
35
|
+
};
|
|
36
|
+
type QuerySerializerOptions = QuerySerializerOptionsObject & {
|
|
37
|
+
/**
|
|
38
|
+
* Per-parameter serialization overrides. When provided, these settings
|
|
39
|
+
* override the global array/object settings for specific parameter names.
|
|
40
|
+
*/
|
|
41
|
+
parameters?: Record<string, QuerySerializerOptionsObject>;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
type HttpMethod = "connect" | "delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace";
|
|
45
|
+
type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
|
|
46
|
+
/**
|
|
47
|
+
* Returns the final request URL.
|
|
48
|
+
*/
|
|
49
|
+
buildUrl: BuildUrlFn;
|
|
50
|
+
getConfig: () => Config;
|
|
51
|
+
request: RequestFn;
|
|
52
|
+
setConfig: (config: Config) => Config;
|
|
53
|
+
} & {
|
|
54
|
+
[K in HttpMethod]: MethodFn;
|
|
55
|
+
} & ([SseFn] extends [never] ? {
|
|
56
|
+
sse?: never;
|
|
57
|
+
} : {
|
|
58
|
+
sse: {
|
|
59
|
+
[K in HttpMethod]: SseFn;
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
interface Config$1 {
|
|
63
|
+
/**
|
|
64
|
+
* Auth token or a function returning auth token. The resolved value will be
|
|
65
|
+
* added to the request payload as defined by its `security` array.
|
|
66
|
+
*/
|
|
67
|
+
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
68
|
+
/**
|
|
69
|
+
* A function for serializing request body parameter. By default,
|
|
70
|
+
* {@link JSON.stringify()} will be used.
|
|
71
|
+
*/
|
|
72
|
+
bodySerializer?: BodySerializer | null;
|
|
73
|
+
/**
|
|
74
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
75
|
+
* `Headers` object with.
|
|
76
|
+
*
|
|
77
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
78
|
+
*/
|
|
79
|
+
headers?: RequestInit["headers"] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
80
|
+
/**
|
|
81
|
+
* The request method.
|
|
82
|
+
*
|
|
83
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
84
|
+
*/
|
|
85
|
+
method?: Uppercase<HttpMethod>;
|
|
86
|
+
/**
|
|
87
|
+
* A function for serializing request query parameters. By default, arrays
|
|
88
|
+
* will be exploded in form style, objects will be exploded in deepObject
|
|
89
|
+
* style, and reserved characters are percent-encoded.
|
|
90
|
+
*
|
|
91
|
+
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
92
|
+
* API function is used.
|
|
93
|
+
*
|
|
94
|
+
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
95
|
+
*/
|
|
96
|
+
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
97
|
+
/**
|
|
98
|
+
* A function validating request data. This is useful if you want to ensure
|
|
99
|
+
* the request conforms to the desired shape, so it can be safely sent to
|
|
100
|
+
* the server.
|
|
101
|
+
*/
|
|
102
|
+
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
103
|
+
/**
|
|
104
|
+
* A function transforming response data before it's returned. This is useful
|
|
105
|
+
* for post-processing data, e.g. converting ISO strings into Date objects.
|
|
106
|
+
*/
|
|
107
|
+
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
108
|
+
/**
|
|
109
|
+
* A function validating response data. This is useful if you want to ensure
|
|
110
|
+
* the response conforms to the desired shape, so it can be safely passed to
|
|
111
|
+
* the transformers and returned to the user.
|
|
112
|
+
*/
|
|
113
|
+
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, "method"> & Pick<Config$1, "method" | "responseTransformer" | "responseValidator"> & {
|
|
117
|
+
/**
|
|
118
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
119
|
+
* fetch instance.
|
|
120
|
+
*
|
|
121
|
+
* @default globalThis.fetch
|
|
122
|
+
*/
|
|
123
|
+
fetch?: typeof fetch;
|
|
124
|
+
/**
|
|
125
|
+
* Implementing clients can call request interceptors inside this hook.
|
|
126
|
+
*/
|
|
127
|
+
onRequest?: (url: string, init: RequestInit) => Promise<Request>;
|
|
128
|
+
/**
|
|
129
|
+
* Callback invoked when a network or parsing error occurs during streaming.
|
|
130
|
+
*
|
|
131
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
132
|
+
*
|
|
133
|
+
* @param error The error that occurred.
|
|
134
|
+
*/
|
|
135
|
+
onSseError?: (error: unknown) => void;
|
|
136
|
+
/**
|
|
137
|
+
* Callback invoked when an event is streamed from the server.
|
|
138
|
+
*
|
|
139
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
140
|
+
*
|
|
141
|
+
* @param event Event streamed from the server.
|
|
142
|
+
* @returns Nothing (void).
|
|
143
|
+
*/
|
|
144
|
+
onSseEvent?: (event: StreamEvent<TData>) => void;
|
|
145
|
+
serializedBody?: RequestInit["body"];
|
|
146
|
+
/**
|
|
147
|
+
* Default retry delay in milliseconds.
|
|
148
|
+
*
|
|
149
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
150
|
+
*
|
|
151
|
+
* @default 3000
|
|
152
|
+
*/
|
|
153
|
+
sseDefaultRetryDelay?: number;
|
|
154
|
+
/**
|
|
155
|
+
* Maximum number of retry attempts before giving up.
|
|
156
|
+
*/
|
|
157
|
+
sseMaxRetryAttempts?: number;
|
|
158
|
+
/**
|
|
159
|
+
* Maximum retry delay in milliseconds.
|
|
160
|
+
*
|
|
161
|
+
* Applies only when exponential backoff is used.
|
|
162
|
+
*
|
|
163
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
164
|
+
*
|
|
165
|
+
* @default 30000
|
|
166
|
+
*/
|
|
167
|
+
sseMaxRetryDelay?: number;
|
|
168
|
+
/**
|
|
169
|
+
* Optional sleep function for retry backoff.
|
|
170
|
+
*
|
|
171
|
+
* Defaults to using `setTimeout`.
|
|
172
|
+
*/
|
|
173
|
+
sseSleepFn?: (ms: number) => Promise<void>;
|
|
174
|
+
url: string;
|
|
175
|
+
};
|
|
176
|
+
interface StreamEvent<TData = unknown> {
|
|
177
|
+
data: TData;
|
|
178
|
+
event?: string;
|
|
179
|
+
id?: string;
|
|
180
|
+
retry?: number;
|
|
181
|
+
}
|
|
182
|
+
type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
183
|
+
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>;
|
|
187
|
+
type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
|
|
188
|
+
type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
|
|
189
|
+
declare class Interceptors<Interceptor> {
|
|
190
|
+
fns: Array<Interceptor | null>;
|
|
191
|
+
clear(): void;
|
|
192
|
+
eject(id: number | Interceptor): void;
|
|
193
|
+
exists(id: number | Interceptor): boolean;
|
|
194
|
+
getInterceptorIndex(id: number | Interceptor): number;
|
|
195
|
+
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
|
|
196
|
+
use(fn: Interceptor): number;
|
|
197
|
+
}
|
|
198
|
+
interface Middleware<Req, Res, Err, Options> {
|
|
199
|
+
error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
|
|
200
|
+
request: Interceptors<ReqInterceptor<Req, Options>>;
|
|
201
|
+
response: Interceptors<ResInterceptor<Res, Req, Options>>;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
type ResponseStyle = "data" | "fields";
|
|
205
|
+
interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<RequestInit, "body" | "headers" | "method">, Config$1 {
|
|
206
|
+
/**
|
|
207
|
+
* Base URL for all requests made by this client.
|
|
208
|
+
*/
|
|
209
|
+
baseUrl?: T["baseUrl"];
|
|
210
|
+
/**
|
|
211
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
212
|
+
* fetch instance.
|
|
213
|
+
*
|
|
214
|
+
* @default globalThis.fetch
|
|
215
|
+
*/
|
|
216
|
+
fetch?: typeof fetch;
|
|
217
|
+
/**
|
|
218
|
+
* Please don't use the Fetch client for Next.js applications. The `next`
|
|
219
|
+
* options won't have any effect.
|
|
220
|
+
*
|
|
221
|
+
* Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
|
|
222
|
+
*/
|
|
223
|
+
next?: never;
|
|
224
|
+
/**
|
|
225
|
+
* Return the response data parsed in a specified format. By default, `auto`
|
|
226
|
+
* will infer the appropriate method from the `Content-Type` response header.
|
|
227
|
+
* You can override this behavior with any of the {@link Body} methods.
|
|
228
|
+
* Select `stream` if you don't want to parse response data at all.
|
|
229
|
+
*
|
|
230
|
+
* @default 'auto'
|
|
231
|
+
*/
|
|
232
|
+
parseAs?: "arrayBuffer" | "auto" | "blob" | "formData" | "json" | "stream" | "text";
|
|
233
|
+
/**
|
|
234
|
+
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
235
|
+
*
|
|
236
|
+
* @default 'fields'
|
|
237
|
+
*/
|
|
238
|
+
responseStyle?: ResponseStyle;
|
|
239
|
+
/**
|
|
240
|
+
* Throw an error instead of returning it in the response?
|
|
241
|
+
*
|
|
242
|
+
* @default false
|
|
243
|
+
*/
|
|
244
|
+
throwOnError?: T["throwOnError"];
|
|
245
|
+
}
|
|
246
|
+
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
247
|
+
responseStyle: TResponseStyle;
|
|
248
|
+
throwOnError: ThrowOnError;
|
|
249
|
+
}>, Pick<ServerSentEventsOptions<TData>, "onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay"> {
|
|
250
|
+
/**
|
|
251
|
+
* Any body that you want to add to your request.
|
|
252
|
+
*
|
|
253
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
254
|
+
*/
|
|
255
|
+
body?: unknown;
|
|
256
|
+
path?: Record<string, unknown>;
|
|
257
|
+
query?: Record<string, unknown>;
|
|
258
|
+
/**
|
|
259
|
+
* Security mechanism(s) to use for the request.
|
|
260
|
+
*/
|
|
261
|
+
security?: ReadonlyArray<Auth>;
|
|
262
|
+
url: Url;
|
|
263
|
+
}
|
|
264
|
+
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
265
|
+
serializedBody?: string;
|
|
266
|
+
}
|
|
267
|
+
type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = "fields"> = ThrowOnError extends true ? Promise<TResponseStyle extends "data" ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
268
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
269
|
+
request: Request;
|
|
270
|
+
response: Response;
|
|
271
|
+
}> : Promise<TResponseStyle extends "data" ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
272
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
273
|
+
error: undefined;
|
|
274
|
+
} | {
|
|
275
|
+
data: undefined;
|
|
276
|
+
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
277
|
+
}) & {
|
|
278
|
+
request: Request;
|
|
279
|
+
response: Response;
|
|
280
|
+
}>;
|
|
281
|
+
interface ClientOptions$1 {
|
|
282
|
+
baseUrl?: string;
|
|
283
|
+
responseStyle?: ResponseStyle;
|
|
284
|
+
throwOnError?: boolean;
|
|
285
|
+
}
|
|
286
|
+
type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
287
|
+
type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
288
|
+
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method"> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
289
|
+
type BuildUrlFn = <TData extends {
|
|
290
|
+
body?: unknown;
|
|
291
|
+
path?: Record<string, unknown>;
|
|
292
|
+
query?: Record<string, unknown>;
|
|
293
|
+
url: string;
|
|
294
|
+
}>(options: TData & Options$1<TData>) => string;
|
|
295
|
+
type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
|
|
296
|
+
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
297
|
+
};
|
|
298
|
+
interface TDataShape {
|
|
299
|
+
body?: unknown;
|
|
300
|
+
headers?: unknown;
|
|
301
|
+
path?: unknown;
|
|
302
|
+
query?: unknown;
|
|
303
|
+
url: string;
|
|
304
|
+
}
|
|
305
|
+
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
306
|
+
type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = "fields"> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, "body" | "path" | "query" | "url"> & ([TData] extends [never] ? unknown : Omit<TData, "url">);
|
|
307
|
+
|
|
308
|
+
type ClientOptions = {
|
|
309
|
+
baseUrl: "https://aifeatures.dev/api/v1" | "http://localhost:8787/api/v1" | (string & {});
|
|
310
|
+
};
|
|
311
|
+
/**
|
|
312
|
+
* CAPTCHA configuration. CAPTCHA is always enabled when available (managed at site level).
|
|
313
|
+
*/
|
|
314
|
+
type Captcha = {
|
|
315
|
+
enabled: boolean;
|
|
316
|
+
provider?: "turnstile";
|
|
317
|
+
site_key?: string;
|
|
318
|
+
};
|
|
319
|
+
type Form = {
|
|
320
|
+
id: string;
|
|
321
|
+
name: string;
|
|
322
|
+
endpoint_url: string;
|
|
323
|
+
email_recipients: Array<string>;
|
|
324
|
+
redirect_url: string;
|
|
325
|
+
webhook_url: string;
|
|
326
|
+
captcha: Captcha;
|
|
327
|
+
created_at: string;
|
|
328
|
+
updated_at: string;
|
|
329
|
+
};
|
|
330
|
+
type FormsList = {
|
|
331
|
+
forms: Array<Form>;
|
|
332
|
+
};
|
|
333
|
+
type Error = {
|
|
334
|
+
error: string;
|
|
335
|
+
};
|
|
336
|
+
type CreateForm = {
|
|
337
|
+
name: string;
|
|
338
|
+
/**
|
|
339
|
+
* Email recipients for form submissions. If not provided, uses the site default.
|
|
340
|
+
*/
|
|
341
|
+
email_recipients?: Array<string>;
|
|
342
|
+
redirect_url?: string;
|
|
343
|
+
webhook_url?: string;
|
|
344
|
+
};
|
|
345
|
+
type Site = {
|
|
346
|
+
id: string;
|
|
347
|
+
name: string;
|
|
348
|
+
/**
|
|
349
|
+
* External ID from the consumer system
|
|
350
|
+
*/
|
|
351
|
+
external_id: string;
|
|
352
|
+
/**
|
|
353
|
+
* Default email recipients for forms that do not specify their own
|
|
354
|
+
*/
|
|
355
|
+
default_email_recipients: Array<string>;
|
|
356
|
+
created_at: string;
|
|
357
|
+
updated_at: string;
|
|
358
|
+
};
|
|
359
|
+
type SitesList = {
|
|
360
|
+
sites: Array<Site>;
|
|
361
|
+
};
|
|
362
|
+
type SiteWithToken = Site & {
|
|
363
|
+
/**
|
|
364
|
+
* Site-scoped API token. Only returned on creation - store it securely!
|
|
365
|
+
*/
|
|
366
|
+
api_token: string;
|
|
367
|
+
};
|
|
368
|
+
type CreateSite = {
|
|
369
|
+
name: string;
|
|
370
|
+
/**
|
|
371
|
+
* External ID from your system (e.g., your website ID)
|
|
372
|
+
*/
|
|
373
|
+
external_id?: string;
|
|
374
|
+
/**
|
|
375
|
+
* Default email recipients for forms in this site
|
|
376
|
+
*/
|
|
377
|
+
default_email_recipients?: Array<string>;
|
|
378
|
+
/**
|
|
379
|
+
* Allowed domains for Turnstile CAPTCHA verification
|
|
380
|
+
*/
|
|
381
|
+
domains?: Array<string>;
|
|
382
|
+
};
|
|
383
|
+
type UpdateSite = {
|
|
384
|
+
name?: string;
|
|
385
|
+
default_email_recipients?: Array<string>;
|
|
386
|
+
};
|
|
387
|
+
type SiteDomains = {
|
|
388
|
+
/**
|
|
389
|
+
* Current allowed domains for Turnstile CAPTCHA verification
|
|
390
|
+
*/
|
|
391
|
+
domains: Array<string>;
|
|
392
|
+
};
|
|
393
|
+
type UpdateSiteDomains = {
|
|
394
|
+
/**
|
|
395
|
+
* Allowed domains for Turnstile CAPTCHA verification
|
|
396
|
+
*/
|
|
397
|
+
domains: Array<string>;
|
|
398
|
+
};
|
|
399
|
+
type UpdateForm = {
|
|
400
|
+
name?: string;
|
|
401
|
+
email_recipients?: Array<string>;
|
|
402
|
+
redirect_url?: string;
|
|
403
|
+
webhook_url?: string;
|
|
404
|
+
};
|
|
405
|
+
type Attachment = {
|
|
406
|
+
name: string;
|
|
407
|
+
size: number;
|
|
408
|
+
r2_key: string;
|
|
409
|
+
content_type: string;
|
|
410
|
+
};
|
|
411
|
+
type SubmissionMetadata = {
|
|
412
|
+
ip_address: string;
|
|
413
|
+
user_agent: string;
|
|
414
|
+
submitted_at: string;
|
|
415
|
+
};
|
|
416
|
+
type Submission = {
|
|
417
|
+
id: string;
|
|
418
|
+
form_id: string;
|
|
419
|
+
data: {
|
|
420
|
+
[key: string]: unknown;
|
|
421
|
+
};
|
|
422
|
+
attachments: Array<Attachment>;
|
|
423
|
+
metadata: SubmissionMetadata;
|
|
424
|
+
/**
|
|
425
|
+
* Resend email ID for tracking notification delivery
|
|
426
|
+
*/
|
|
427
|
+
resend_id: string;
|
|
428
|
+
};
|
|
429
|
+
type SubmissionsList = {
|
|
430
|
+
submissions: Array<Submission>;
|
|
431
|
+
total: number;
|
|
432
|
+
limit: number;
|
|
433
|
+
offset: number;
|
|
434
|
+
};
|
|
435
|
+
type GetApiV1FormsData = {
|
|
436
|
+
body?: never;
|
|
437
|
+
path?: never;
|
|
438
|
+
query?: never;
|
|
439
|
+
url: "/api/v1/forms";
|
|
440
|
+
};
|
|
441
|
+
type GetApiV1FormsErrors = {
|
|
442
|
+
/**
|
|
443
|
+
* Unauthorized - requires site token
|
|
444
|
+
*/
|
|
445
|
+
401: Error;
|
|
446
|
+
/**
|
|
447
|
+
* Site not found
|
|
448
|
+
*/
|
|
449
|
+
404: Error;
|
|
450
|
+
};
|
|
451
|
+
type GetApiV1FormsError = GetApiV1FormsErrors[keyof GetApiV1FormsErrors];
|
|
452
|
+
type GetApiV1FormsResponses = {
|
|
453
|
+
/**
|
|
454
|
+
* List of forms
|
|
455
|
+
*/
|
|
456
|
+
200: FormsList;
|
|
457
|
+
};
|
|
458
|
+
type GetApiV1FormsResponse = GetApiV1FormsResponses[keyof GetApiV1FormsResponses];
|
|
459
|
+
type PostApiV1FormsData = {
|
|
460
|
+
body: CreateForm;
|
|
461
|
+
path?: never;
|
|
462
|
+
query?: never;
|
|
463
|
+
url: "/api/v1/forms";
|
|
464
|
+
};
|
|
465
|
+
type PostApiV1FormsErrors = {
|
|
466
|
+
/**
|
|
467
|
+
* Unauthorized - requires site token
|
|
468
|
+
*/
|
|
469
|
+
401: Error;
|
|
470
|
+
/**
|
|
471
|
+
* Site not found
|
|
472
|
+
*/
|
|
473
|
+
404: Error;
|
|
474
|
+
};
|
|
475
|
+
type PostApiV1FormsError = PostApiV1FormsErrors[keyof PostApiV1FormsErrors];
|
|
476
|
+
type PostApiV1FormsResponses = {
|
|
477
|
+
/**
|
|
478
|
+
* Form created successfully
|
|
479
|
+
*/
|
|
480
|
+
201: Form;
|
|
481
|
+
};
|
|
482
|
+
type PostApiV1FormsResponse = PostApiV1FormsResponses[keyof PostApiV1FormsResponses];
|
|
483
|
+
type GetApiV1SitesData = {
|
|
484
|
+
body?: never;
|
|
485
|
+
path?: never;
|
|
486
|
+
query?: never;
|
|
487
|
+
url: "/api/v1/sites";
|
|
488
|
+
};
|
|
489
|
+
type GetApiV1SitesErrors = {
|
|
490
|
+
/**
|
|
491
|
+
* Unauthorized
|
|
492
|
+
*/
|
|
493
|
+
401: Error;
|
|
494
|
+
};
|
|
495
|
+
type GetApiV1SitesError = GetApiV1SitesErrors[keyof GetApiV1SitesErrors];
|
|
496
|
+
type GetApiV1SitesResponses = {
|
|
497
|
+
/**
|
|
498
|
+
* List of sites
|
|
499
|
+
*/
|
|
500
|
+
200: SitesList;
|
|
501
|
+
};
|
|
502
|
+
type GetApiV1SitesResponse = GetApiV1SitesResponses[keyof GetApiV1SitesResponses];
|
|
503
|
+
type PostApiV1SitesData = {
|
|
504
|
+
body: CreateSite;
|
|
505
|
+
path?: never;
|
|
506
|
+
query?: never;
|
|
507
|
+
url: "/api/v1/sites";
|
|
508
|
+
};
|
|
509
|
+
type PostApiV1SitesErrors = {
|
|
510
|
+
/**
|
|
511
|
+
* Unauthorized
|
|
512
|
+
*/
|
|
513
|
+
401: Error;
|
|
514
|
+
/**
|
|
515
|
+
* Site with this external_id already exists
|
|
516
|
+
*/
|
|
517
|
+
409: Error;
|
|
518
|
+
};
|
|
519
|
+
type PostApiV1SitesError = PostApiV1SitesErrors[keyof PostApiV1SitesErrors];
|
|
520
|
+
type PostApiV1SitesResponses = {
|
|
521
|
+
/**
|
|
522
|
+
* Site created successfully. The api_token is only returned once!
|
|
523
|
+
*/
|
|
524
|
+
201: SiteWithToken;
|
|
525
|
+
};
|
|
526
|
+
type PostApiV1SitesResponse = PostApiV1SitesResponses[keyof PostApiV1SitesResponses];
|
|
527
|
+
type DeleteApiV1SitesBySiteIdData = {
|
|
528
|
+
body?: never;
|
|
529
|
+
path: {
|
|
530
|
+
siteId: string;
|
|
531
|
+
};
|
|
532
|
+
query?: never;
|
|
533
|
+
url: "/api/v1/sites/{siteId}";
|
|
534
|
+
};
|
|
535
|
+
type DeleteApiV1SitesBySiteIdErrors = {
|
|
536
|
+
/**
|
|
537
|
+
* Unauthorized
|
|
538
|
+
*/
|
|
539
|
+
401: Error;
|
|
540
|
+
/**
|
|
541
|
+
* Site not found
|
|
542
|
+
*/
|
|
543
|
+
404: Error;
|
|
544
|
+
};
|
|
545
|
+
type DeleteApiV1SitesBySiteIdError = DeleteApiV1SitesBySiteIdErrors[keyof DeleteApiV1SitesBySiteIdErrors];
|
|
546
|
+
type DeleteApiV1SitesBySiteIdResponses = {
|
|
547
|
+
/**
|
|
548
|
+
* Site deleted successfully
|
|
549
|
+
*/
|
|
550
|
+
204: void;
|
|
551
|
+
};
|
|
552
|
+
type DeleteApiV1SitesBySiteIdResponse = DeleteApiV1SitesBySiteIdResponses[keyof DeleteApiV1SitesBySiteIdResponses];
|
|
553
|
+
type GetApiV1SitesBySiteIdData = {
|
|
554
|
+
body?: never;
|
|
555
|
+
path: {
|
|
556
|
+
siteId: string;
|
|
557
|
+
};
|
|
558
|
+
query?: never;
|
|
559
|
+
url: "/api/v1/sites/{siteId}";
|
|
560
|
+
};
|
|
561
|
+
type GetApiV1SitesBySiteIdErrors = {
|
|
562
|
+
/**
|
|
563
|
+
* Unauthorized
|
|
564
|
+
*/
|
|
565
|
+
401: Error;
|
|
566
|
+
/**
|
|
567
|
+
* Site not found
|
|
568
|
+
*/
|
|
569
|
+
404: Error;
|
|
570
|
+
};
|
|
571
|
+
type GetApiV1SitesBySiteIdError = GetApiV1SitesBySiteIdErrors[keyof GetApiV1SitesBySiteIdErrors];
|
|
572
|
+
type GetApiV1SitesBySiteIdResponses = {
|
|
573
|
+
/**
|
|
574
|
+
* Site details
|
|
575
|
+
*/
|
|
576
|
+
200: Site;
|
|
577
|
+
};
|
|
578
|
+
type GetApiV1SitesBySiteIdResponse = GetApiV1SitesBySiteIdResponses[keyof GetApiV1SitesBySiteIdResponses];
|
|
579
|
+
type PatchApiV1SitesBySiteIdData = {
|
|
580
|
+
body: UpdateSite;
|
|
581
|
+
path: {
|
|
582
|
+
siteId: string;
|
|
583
|
+
};
|
|
584
|
+
query?: never;
|
|
585
|
+
url: "/api/v1/sites/{siteId}";
|
|
586
|
+
};
|
|
587
|
+
type PatchApiV1SitesBySiteIdErrors = {
|
|
588
|
+
/**
|
|
589
|
+
* Unauthorized
|
|
590
|
+
*/
|
|
591
|
+
401: Error;
|
|
592
|
+
/**
|
|
593
|
+
* Site not found
|
|
594
|
+
*/
|
|
595
|
+
404: Error;
|
|
596
|
+
};
|
|
597
|
+
type PatchApiV1SitesBySiteIdError = PatchApiV1SitesBySiteIdErrors[keyof PatchApiV1SitesBySiteIdErrors];
|
|
598
|
+
type PatchApiV1SitesBySiteIdResponses = {
|
|
599
|
+
/**
|
|
600
|
+
* Site updated successfully
|
|
601
|
+
*/
|
|
602
|
+
200: Site;
|
|
603
|
+
};
|
|
604
|
+
type PatchApiV1SitesBySiteIdResponse = PatchApiV1SitesBySiteIdResponses[keyof PatchApiV1SitesBySiteIdResponses];
|
|
605
|
+
type PatchApiV1SitesBySiteIdDomainsData = {
|
|
606
|
+
body: UpdateSiteDomains;
|
|
607
|
+
path: {
|
|
608
|
+
siteId: string;
|
|
609
|
+
};
|
|
610
|
+
query?: never;
|
|
611
|
+
url: "/api/v1/sites/{siteId}/domains";
|
|
612
|
+
};
|
|
613
|
+
type PatchApiV1SitesBySiteIdDomainsErrors = {
|
|
614
|
+
/**
|
|
615
|
+
* Unauthorized
|
|
616
|
+
*/
|
|
617
|
+
401: Error;
|
|
618
|
+
/**
|
|
619
|
+
* Site not found
|
|
620
|
+
*/
|
|
621
|
+
404: Error;
|
|
622
|
+
};
|
|
623
|
+
type PatchApiV1SitesBySiteIdDomainsError = PatchApiV1SitesBySiteIdDomainsErrors[keyof PatchApiV1SitesBySiteIdDomainsErrors];
|
|
624
|
+
type PatchApiV1SitesBySiteIdDomainsResponses = {
|
|
625
|
+
/**
|
|
626
|
+
* Site domains updated successfully
|
|
627
|
+
*/
|
|
628
|
+
200: SiteDomains;
|
|
629
|
+
};
|
|
630
|
+
type PatchApiV1SitesBySiteIdDomainsResponse = PatchApiV1SitesBySiteIdDomainsResponses[keyof PatchApiV1SitesBySiteIdDomainsResponses];
|
|
631
|
+
type GetApiV1SitesBySiteIdFormsData = {
|
|
632
|
+
body?: never;
|
|
633
|
+
path: {
|
|
634
|
+
siteId: string;
|
|
635
|
+
};
|
|
636
|
+
query?: never;
|
|
637
|
+
url: "/api/v1/sites/{siteId}/forms";
|
|
638
|
+
};
|
|
639
|
+
type GetApiV1SitesBySiteIdFormsErrors = {
|
|
640
|
+
/**
|
|
641
|
+
* Unauthorized
|
|
642
|
+
*/
|
|
643
|
+
401: Error;
|
|
644
|
+
/**
|
|
645
|
+
* Site not found
|
|
646
|
+
*/
|
|
647
|
+
404: Error;
|
|
648
|
+
};
|
|
649
|
+
type GetApiV1SitesBySiteIdFormsError = GetApiV1SitesBySiteIdFormsErrors[keyof GetApiV1SitesBySiteIdFormsErrors];
|
|
650
|
+
type GetApiV1SitesBySiteIdFormsResponses = {
|
|
651
|
+
/**
|
|
652
|
+
* List of forms
|
|
653
|
+
*/
|
|
654
|
+
200: FormsList;
|
|
655
|
+
};
|
|
656
|
+
type GetApiV1SitesBySiteIdFormsResponse = GetApiV1SitesBySiteIdFormsResponses[keyof GetApiV1SitesBySiteIdFormsResponses];
|
|
657
|
+
type PostApiV1SitesBySiteIdFormsData = {
|
|
658
|
+
body: CreateForm;
|
|
659
|
+
path: {
|
|
660
|
+
siteId: string;
|
|
661
|
+
};
|
|
662
|
+
query?: never;
|
|
663
|
+
url: "/api/v1/sites/{siteId}/forms";
|
|
664
|
+
};
|
|
665
|
+
type PostApiV1SitesBySiteIdFormsErrors = {
|
|
666
|
+
/**
|
|
667
|
+
* Unauthorized
|
|
668
|
+
*/
|
|
669
|
+
401: Error;
|
|
670
|
+
/**
|
|
671
|
+
* Site not found
|
|
672
|
+
*/
|
|
673
|
+
404: Error;
|
|
674
|
+
};
|
|
675
|
+
type PostApiV1SitesBySiteIdFormsError = PostApiV1SitesBySiteIdFormsErrors[keyof PostApiV1SitesBySiteIdFormsErrors];
|
|
676
|
+
type PostApiV1SitesBySiteIdFormsResponses = {
|
|
677
|
+
/**
|
|
678
|
+
* Form created successfully
|
|
679
|
+
*/
|
|
680
|
+
201: Form;
|
|
681
|
+
};
|
|
682
|
+
type PostApiV1SitesBySiteIdFormsResponse = PostApiV1SitesBySiteIdFormsResponses[keyof PostApiV1SitesBySiteIdFormsResponses];
|
|
683
|
+
type DeleteApiV1FormsByFormIdData = {
|
|
684
|
+
body?: never;
|
|
685
|
+
path: {
|
|
686
|
+
formId: string;
|
|
687
|
+
};
|
|
688
|
+
query?: never;
|
|
689
|
+
url: "/api/v1/forms/{formId}";
|
|
690
|
+
};
|
|
691
|
+
type DeleteApiV1FormsByFormIdErrors = {
|
|
692
|
+
/**
|
|
693
|
+
* Unauthorized
|
|
694
|
+
*/
|
|
695
|
+
401: Error;
|
|
696
|
+
/**
|
|
697
|
+
* Form not found
|
|
698
|
+
*/
|
|
699
|
+
404: Error;
|
|
700
|
+
};
|
|
701
|
+
type DeleteApiV1FormsByFormIdError = DeleteApiV1FormsByFormIdErrors[keyof DeleteApiV1FormsByFormIdErrors];
|
|
702
|
+
type DeleteApiV1FormsByFormIdResponses = {
|
|
703
|
+
/**
|
|
704
|
+
* Form deleted successfully
|
|
705
|
+
*/
|
|
706
|
+
204: void;
|
|
707
|
+
};
|
|
708
|
+
type DeleteApiV1FormsByFormIdResponse = DeleteApiV1FormsByFormIdResponses[keyof DeleteApiV1FormsByFormIdResponses];
|
|
709
|
+
type GetApiV1FormsByFormIdData = {
|
|
710
|
+
body?: never;
|
|
711
|
+
path: {
|
|
712
|
+
formId: string;
|
|
713
|
+
};
|
|
714
|
+
query?: never;
|
|
715
|
+
url: "/api/v1/forms/{formId}";
|
|
716
|
+
};
|
|
717
|
+
type GetApiV1FormsByFormIdErrors = {
|
|
718
|
+
/**
|
|
719
|
+
* Unauthorized
|
|
720
|
+
*/
|
|
721
|
+
401: Error;
|
|
722
|
+
/**
|
|
723
|
+
* Form not found
|
|
724
|
+
*/
|
|
725
|
+
404: Error;
|
|
726
|
+
};
|
|
727
|
+
type GetApiV1FormsByFormIdError = GetApiV1FormsByFormIdErrors[keyof GetApiV1FormsByFormIdErrors];
|
|
728
|
+
type GetApiV1FormsByFormIdResponses = {
|
|
729
|
+
/**
|
|
730
|
+
* Form details
|
|
731
|
+
*/
|
|
732
|
+
200: Form;
|
|
733
|
+
};
|
|
734
|
+
type GetApiV1FormsByFormIdResponse = GetApiV1FormsByFormIdResponses[keyof GetApiV1FormsByFormIdResponses];
|
|
735
|
+
type PatchApiV1FormsByFormIdData = {
|
|
736
|
+
body: UpdateForm;
|
|
737
|
+
path: {
|
|
738
|
+
formId: string;
|
|
739
|
+
};
|
|
740
|
+
query?: never;
|
|
741
|
+
url: "/api/v1/forms/{formId}";
|
|
742
|
+
};
|
|
743
|
+
type PatchApiV1FormsByFormIdErrors = {
|
|
744
|
+
/**
|
|
745
|
+
* Unauthorized
|
|
746
|
+
*/
|
|
747
|
+
401: Error;
|
|
748
|
+
/**
|
|
749
|
+
* Form not found
|
|
750
|
+
*/
|
|
751
|
+
404: Error;
|
|
752
|
+
};
|
|
753
|
+
type PatchApiV1FormsByFormIdError = PatchApiV1FormsByFormIdErrors[keyof PatchApiV1FormsByFormIdErrors];
|
|
754
|
+
type PatchApiV1FormsByFormIdResponses = {
|
|
755
|
+
/**
|
|
756
|
+
* Form updated successfully
|
|
757
|
+
*/
|
|
758
|
+
200: Form;
|
|
759
|
+
};
|
|
760
|
+
type PatchApiV1FormsByFormIdResponse = PatchApiV1FormsByFormIdResponses[keyof PatchApiV1FormsByFormIdResponses];
|
|
761
|
+
type GetApiV1FormsByFormIdSubmissionsData = {
|
|
762
|
+
body?: never;
|
|
763
|
+
path: {
|
|
764
|
+
formId: string;
|
|
765
|
+
};
|
|
766
|
+
query?: {
|
|
767
|
+
/**
|
|
768
|
+
* Maximum number of submissions to return (max 100)
|
|
769
|
+
*/
|
|
770
|
+
limit?: string;
|
|
771
|
+
/**
|
|
772
|
+
* Number of submissions to skip
|
|
773
|
+
*/
|
|
774
|
+
offset?: string;
|
|
775
|
+
/**
|
|
776
|
+
* Include spam submissions (default: false)
|
|
777
|
+
*/
|
|
778
|
+
include_spam?: string;
|
|
779
|
+
};
|
|
780
|
+
url: "/api/v1/forms/{formId}/submissions";
|
|
781
|
+
};
|
|
782
|
+
type GetApiV1FormsByFormIdSubmissionsErrors = {
|
|
783
|
+
/**
|
|
784
|
+
* Unauthorized
|
|
785
|
+
*/
|
|
786
|
+
401: Error;
|
|
787
|
+
/**
|
|
788
|
+
* Form not found
|
|
789
|
+
*/
|
|
790
|
+
404: Error;
|
|
791
|
+
};
|
|
792
|
+
type GetApiV1FormsByFormIdSubmissionsError = GetApiV1FormsByFormIdSubmissionsErrors[keyof GetApiV1FormsByFormIdSubmissionsErrors];
|
|
793
|
+
type GetApiV1FormsByFormIdSubmissionsResponses = {
|
|
794
|
+
/**
|
|
795
|
+
* List of submissions
|
|
796
|
+
*/
|
|
797
|
+
200: SubmissionsList;
|
|
798
|
+
};
|
|
799
|
+
type GetApiV1FormsByFormIdSubmissionsResponse = GetApiV1FormsByFormIdSubmissionsResponses[keyof GetApiV1FormsByFormIdSubmissionsResponses];
|
|
800
|
+
type DeleteApiV1SubmissionsBySubmissionIdData = {
|
|
801
|
+
body?: never;
|
|
802
|
+
path: {
|
|
803
|
+
submissionId: string;
|
|
804
|
+
};
|
|
805
|
+
query?: never;
|
|
806
|
+
url: "/api/v1/submissions/{submissionId}";
|
|
807
|
+
};
|
|
808
|
+
type DeleteApiV1SubmissionsBySubmissionIdErrors = {
|
|
809
|
+
/**
|
|
810
|
+
* Unauthorized
|
|
811
|
+
*/
|
|
812
|
+
401: Error;
|
|
813
|
+
/**
|
|
814
|
+
* Submission not found
|
|
815
|
+
*/
|
|
816
|
+
404: Error;
|
|
817
|
+
};
|
|
818
|
+
type DeleteApiV1SubmissionsBySubmissionIdError = DeleteApiV1SubmissionsBySubmissionIdErrors[keyof DeleteApiV1SubmissionsBySubmissionIdErrors];
|
|
819
|
+
type DeleteApiV1SubmissionsBySubmissionIdResponses = {
|
|
820
|
+
/**
|
|
821
|
+
* Submission deleted successfully
|
|
822
|
+
*/
|
|
823
|
+
204: void;
|
|
824
|
+
};
|
|
825
|
+
type DeleteApiV1SubmissionsBySubmissionIdResponse = DeleteApiV1SubmissionsBySubmissionIdResponses[keyof DeleteApiV1SubmissionsBySubmissionIdResponses];
|
|
826
|
+
type GetApiV1SubmissionsBySubmissionIdData = {
|
|
827
|
+
body?: never;
|
|
828
|
+
path: {
|
|
829
|
+
submissionId: string;
|
|
830
|
+
};
|
|
831
|
+
query?: never;
|
|
832
|
+
url: "/api/v1/submissions/{submissionId}";
|
|
833
|
+
};
|
|
834
|
+
type GetApiV1SubmissionsBySubmissionIdErrors = {
|
|
835
|
+
/**
|
|
836
|
+
* Unauthorized
|
|
837
|
+
*/
|
|
838
|
+
401: Error;
|
|
839
|
+
/**
|
|
840
|
+
* Submission not found
|
|
841
|
+
*/
|
|
842
|
+
404: Error;
|
|
843
|
+
};
|
|
844
|
+
type GetApiV1SubmissionsBySubmissionIdError = GetApiV1SubmissionsBySubmissionIdErrors[keyof GetApiV1SubmissionsBySubmissionIdErrors];
|
|
845
|
+
type GetApiV1SubmissionsBySubmissionIdResponses = {
|
|
846
|
+
/**
|
|
847
|
+
* Submission details
|
|
848
|
+
*/
|
|
849
|
+
200: Submission;
|
|
850
|
+
};
|
|
851
|
+
type GetApiV1SubmissionsBySubmissionIdResponse = GetApiV1SubmissionsBySubmissionIdResponses[keyof GetApiV1SubmissionsBySubmissionIdResponses];
|
|
852
|
+
type GetApiV1SubmissionsBySubmissionIdAttachmentsByFilenameData = {
|
|
853
|
+
body?: never;
|
|
854
|
+
path: {
|
|
855
|
+
submissionId: string;
|
|
856
|
+
filename: string;
|
|
857
|
+
};
|
|
858
|
+
query?: never;
|
|
859
|
+
url: "/api/v1/submissions/{submissionId}/attachments/{filename}";
|
|
860
|
+
};
|
|
861
|
+
type GetApiV1SubmissionsBySubmissionIdAttachmentsByFilenameErrors = {
|
|
862
|
+
/**
|
|
863
|
+
* Unauthorized
|
|
864
|
+
*/
|
|
865
|
+
401: Error;
|
|
866
|
+
/**
|
|
867
|
+
* Submission or attachment not found
|
|
868
|
+
*/
|
|
869
|
+
404: Error;
|
|
870
|
+
};
|
|
871
|
+
type GetApiV1SubmissionsBySubmissionIdAttachmentsByFilenameError = GetApiV1SubmissionsBySubmissionIdAttachmentsByFilenameErrors[keyof GetApiV1SubmissionsBySubmissionIdAttachmentsByFilenameErrors];
|
|
872
|
+
type GetApiV1SubmissionsBySubmissionIdAttachmentsByFilenameResponses = {
|
|
873
|
+
/**
|
|
874
|
+
* File content
|
|
875
|
+
*/
|
|
876
|
+
200: unknown;
|
|
877
|
+
};
|
|
878
|
+
|
|
879
|
+
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options$1<TData, ThrowOnError> & {
|
|
880
|
+
/**
|
|
881
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
882
|
+
* individual options. This might be also useful if you want to implement a
|
|
883
|
+
* custom client.
|
|
884
|
+
*/
|
|
885
|
+
client?: Client;
|
|
886
|
+
/**
|
|
887
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
888
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
889
|
+
*/
|
|
890
|
+
meta?: Record<string, unknown>;
|
|
891
|
+
};
|
|
892
|
+
/**
|
|
893
|
+
* List all forms (site token)
|
|
894
|
+
*
|
|
895
|
+
* Returns all forms for the site associated with your site token. Requires a site token (st_xxx), not an org API key.
|
|
896
|
+
*/
|
|
897
|
+
declare const getApiV1Forms: <ThrowOnError extends boolean = false>(options?: Options<GetApiV1FormsData, ThrowOnError>) => RequestResult<GetApiV1FormsResponses, GetApiV1FormsErrors, ThrowOnError, "fields">;
|
|
898
|
+
/**
|
|
899
|
+
* Create a form (site token)
|
|
900
|
+
*
|
|
901
|
+
* Creates a new form endpoint for the site associated with your site token. Requires a site token (st_xxx), not an org API key.
|
|
902
|
+
*/
|
|
903
|
+
declare const postApiV1Forms: <ThrowOnError extends boolean = false>(options: Options<PostApiV1FormsData, ThrowOnError>) => RequestResult<PostApiV1FormsResponses, PostApiV1FormsErrors, ThrowOnError, "fields">;
|
|
904
|
+
/**
|
|
905
|
+
* List all sites
|
|
906
|
+
*
|
|
907
|
+
* Returns all sites belonging to your organization.
|
|
908
|
+
*/
|
|
909
|
+
declare const getApiV1Sites: <ThrowOnError extends boolean = false>(options?: Options<GetApiV1SitesData, ThrowOnError>) => RequestResult<GetApiV1SitesResponses, GetApiV1SitesErrors, ThrowOnError, "fields">;
|
|
910
|
+
/**
|
|
911
|
+
* Create a site
|
|
912
|
+
*
|
|
913
|
+
* Creates a new site to group forms under. Returns a site-scoped API token that is only shown once - store it securely!
|
|
914
|
+
*/
|
|
915
|
+
declare const postApiV1Sites: <ThrowOnError extends boolean = false>(options: Options<PostApiV1SitesData, ThrowOnError>) => RequestResult<PostApiV1SitesResponses, PostApiV1SitesErrors, ThrowOnError, "fields">;
|
|
916
|
+
/**
|
|
917
|
+
* Delete a site
|
|
918
|
+
*
|
|
919
|
+
* Permanently deletes a site and all its forms and submissions.
|
|
920
|
+
*/
|
|
921
|
+
declare const deleteApiV1SitesBySiteId: <ThrowOnError extends boolean = false>(options: Options<DeleteApiV1SitesBySiteIdData, ThrowOnError>) => RequestResult<DeleteApiV1SitesBySiteIdResponses, DeleteApiV1SitesBySiteIdErrors, ThrowOnError, "fields">;
|
|
922
|
+
/**
|
|
923
|
+
* Get a site
|
|
924
|
+
*
|
|
925
|
+
* Returns details of a specific site.
|
|
926
|
+
*/
|
|
927
|
+
declare const getApiV1SitesBySiteId: <ThrowOnError extends boolean = false>(options: Options<GetApiV1SitesBySiteIdData, ThrowOnError>) => RequestResult<GetApiV1SitesBySiteIdResponses, GetApiV1SitesBySiteIdErrors, ThrowOnError, "fields">;
|
|
928
|
+
/**
|
|
929
|
+
* Update a site
|
|
930
|
+
*
|
|
931
|
+
* Updates an existing site.
|
|
932
|
+
*/
|
|
933
|
+
declare const patchApiV1SitesBySiteId: <ThrowOnError extends boolean = false>(options: Options<PatchApiV1SitesBySiteIdData, ThrowOnError>) => RequestResult<PatchApiV1SitesBySiteIdResponses, PatchApiV1SitesBySiteIdErrors, ThrowOnError, "fields">;
|
|
934
|
+
/**
|
|
935
|
+
* Update site domains
|
|
936
|
+
*
|
|
937
|
+
* Updates the allowed domains for Turnstile CAPTCHA verification. This should be called when a custom domain is connected or disconnected from a website.
|
|
938
|
+
*/
|
|
939
|
+
declare const patchApiV1SitesBySiteIdDomains: <ThrowOnError extends boolean = false>(options: Options<PatchApiV1SitesBySiteIdDomainsData, ThrowOnError>) => RequestResult<PatchApiV1SitesBySiteIdDomainsResponses, PatchApiV1SitesBySiteIdDomainsErrors, ThrowOnError, "fields">;
|
|
940
|
+
/**
|
|
941
|
+
* List all forms for a site
|
|
942
|
+
*
|
|
943
|
+
* Returns all forms belonging to a site.
|
|
944
|
+
*/
|
|
945
|
+
declare const getApiV1SitesBySiteIdForms: <ThrowOnError extends boolean = false>(options: Options<GetApiV1SitesBySiteIdFormsData, ThrowOnError>) => RequestResult<GetApiV1SitesBySiteIdFormsResponses, GetApiV1SitesBySiteIdFormsErrors, ThrowOnError, "fields">;
|
|
946
|
+
/**
|
|
947
|
+
* Create a form
|
|
948
|
+
*
|
|
949
|
+
* Creates a new form endpoint under a site. If captcha is enabled, a Cloudflare Turnstile widget will be automatically provisioned.
|
|
950
|
+
*/
|
|
951
|
+
declare const postApiV1SitesBySiteIdForms: <ThrowOnError extends boolean = false>(options: Options<PostApiV1SitesBySiteIdFormsData, ThrowOnError>) => RequestResult<PostApiV1SitesBySiteIdFormsResponses, PostApiV1SitesBySiteIdFormsErrors, ThrowOnError, "fields">;
|
|
952
|
+
/**
|
|
953
|
+
* Delete a form
|
|
954
|
+
*
|
|
955
|
+
* Permanently deletes a form and all its submissions.
|
|
956
|
+
*/
|
|
957
|
+
declare const deleteApiV1FormsByFormId: <ThrowOnError extends boolean = false>(options: Options<DeleteApiV1FormsByFormIdData, ThrowOnError>) => RequestResult<DeleteApiV1FormsByFormIdResponses, DeleteApiV1FormsByFormIdErrors, ThrowOnError, "fields">;
|
|
958
|
+
/**
|
|
959
|
+
* Get a form
|
|
960
|
+
*
|
|
961
|
+
* Returns details of a specific form.
|
|
962
|
+
*/
|
|
963
|
+
declare const getApiV1FormsByFormId: <ThrowOnError extends boolean = false>(options: Options<GetApiV1FormsByFormIdData, ThrowOnError>) => RequestResult<GetApiV1FormsByFormIdResponses, GetApiV1FormsByFormIdErrors, ThrowOnError, "fields">;
|
|
964
|
+
/**
|
|
965
|
+
* Update a form
|
|
966
|
+
*
|
|
967
|
+
* Updates an existing form. Only provided fields will be updated.
|
|
968
|
+
*/
|
|
969
|
+
declare const patchApiV1FormsByFormId: <ThrowOnError extends boolean = false>(options: Options<PatchApiV1FormsByFormIdData, ThrowOnError>) => RequestResult<PatchApiV1FormsByFormIdResponses, PatchApiV1FormsByFormIdErrors, ThrowOnError, "fields">;
|
|
970
|
+
/**
|
|
971
|
+
* List submissions
|
|
972
|
+
*
|
|
973
|
+
* Returns submissions for a form.
|
|
974
|
+
*/
|
|
975
|
+
declare const getApiV1FormsByFormIdSubmissions: <ThrowOnError extends boolean = false>(options: Options<GetApiV1FormsByFormIdSubmissionsData, ThrowOnError>) => RequestResult<GetApiV1FormsByFormIdSubmissionsResponses, GetApiV1FormsByFormIdSubmissionsErrors, ThrowOnError, "fields">;
|
|
976
|
+
/**
|
|
977
|
+
* Delete a submission
|
|
978
|
+
*
|
|
979
|
+
* Permanently deletes a submission and its attachments.
|
|
980
|
+
*/
|
|
981
|
+
declare const deleteApiV1SubmissionsBySubmissionId: <ThrowOnError extends boolean = false>(options: Options<DeleteApiV1SubmissionsBySubmissionIdData, ThrowOnError>) => RequestResult<DeleteApiV1SubmissionsBySubmissionIdResponses, DeleteApiV1SubmissionsBySubmissionIdErrors, ThrowOnError, "fields">;
|
|
982
|
+
/**
|
|
983
|
+
* Get a submission
|
|
984
|
+
*
|
|
985
|
+
* Returns details of a specific submission.
|
|
986
|
+
*/
|
|
987
|
+
declare const getApiV1SubmissionsBySubmissionId: <ThrowOnError extends boolean = false>(options: Options<GetApiV1SubmissionsBySubmissionIdData, ThrowOnError>) => RequestResult<GetApiV1SubmissionsBySubmissionIdResponses, GetApiV1SubmissionsBySubmissionIdErrors, ThrowOnError, "fields">;
|
|
988
|
+
/**
|
|
989
|
+
* Download an attachment
|
|
990
|
+
*
|
|
991
|
+
* Downloads a file attachment from a submission. Returns the file with appropriate Content-Type and Content-Disposition headers.
|
|
992
|
+
*/
|
|
993
|
+
declare const getApiV1SubmissionsBySubmissionIdAttachmentsByFilename: <ThrowOnError extends boolean = false>(options: Options<GetApiV1SubmissionsBySubmissionIdAttachmentsByFilenameData, ThrowOnError>) => RequestResult<GetApiV1SubmissionsBySubmissionIdAttachmentsByFilenameResponses, GetApiV1SubmissionsBySubmissionIdAttachmentsByFilenameErrors, ThrowOnError, "fields">;
|
|
994
|
+
|
|
995
|
+
export { type Attachment, type Captcha, type ClientOptions, type CreateForm, type CreateSite, type DeleteApiV1FormsByFormIdData, type DeleteApiV1FormsByFormIdError, type DeleteApiV1FormsByFormIdErrors, type DeleteApiV1FormsByFormIdResponse, type DeleteApiV1FormsByFormIdResponses, type DeleteApiV1SitesBySiteIdData, type DeleteApiV1SitesBySiteIdError, type DeleteApiV1SitesBySiteIdErrors, type DeleteApiV1SitesBySiteIdResponse, type DeleteApiV1SitesBySiteIdResponses, type DeleteApiV1SubmissionsBySubmissionIdData, type DeleteApiV1SubmissionsBySubmissionIdError, type DeleteApiV1SubmissionsBySubmissionIdErrors, type DeleteApiV1SubmissionsBySubmissionIdResponse, type DeleteApiV1SubmissionsBySubmissionIdResponses, type Error, type Form, type FormsList, type GetApiV1FormsByFormIdData, type GetApiV1FormsByFormIdError, type GetApiV1FormsByFormIdErrors, type GetApiV1FormsByFormIdResponse, type GetApiV1FormsByFormIdResponses, type GetApiV1FormsByFormIdSubmissionsData, type GetApiV1FormsByFormIdSubmissionsError, type GetApiV1FormsByFormIdSubmissionsErrors, type GetApiV1FormsByFormIdSubmissionsResponse, type GetApiV1FormsByFormIdSubmissionsResponses, type GetApiV1FormsData, type GetApiV1FormsError, type GetApiV1FormsErrors, type GetApiV1FormsResponse, type GetApiV1FormsResponses, type GetApiV1SitesBySiteIdData, type GetApiV1SitesBySiteIdError, type GetApiV1SitesBySiteIdErrors, type GetApiV1SitesBySiteIdFormsData, type GetApiV1SitesBySiteIdFormsError, type GetApiV1SitesBySiteIdFormsErrors, type GetApiV1SitesBySiteIdFormsResponse, type GetApiV1SitesBySiteIdFormsResponses, type GetApiV1SitesBySiteIdResponse, type GetApiV1SitesBySiteIdResponses, type GetApiV1SitesData, type GetApiV1SitesError, type GetApiV1SitesErrors, type GetApiV1SitesResponse, type GetApiV1SitesResponses, type GetApiV1SubmissionsBySubmissionIdAttachmentsByFilenameData, type GetApiV1SubmissionsBySubmissionIdAttachmentsByFilenameError, type GetApiV1SubmissionsBySubmissionIdAttachmentsByFilenameErrors, type GetApiV1SubmissionsBySubmissionIdAttachmentsByFilenameResponses, type GetApiV1SubmissionsBySubmissionIdData, type GetApiV1SubmissionsBySubmissionIdError, type GetApiV1SubmissionsBySubmissionIdErrors, type GetApiV1SubmissionsBySubmissionIdResponse, type GetApiV1SubmissionsBySubmissionIdResponses, type Options, type PatchApiV1FormsByFormIdData, type PatchApiV1FormsByFormIdError, type PatchApiV1FormsByFormIdErrors, type PatchApiV1FormsByFormIdResponse, type PatchApiV1FormsByFormIdResponses, type PatchApiV1SitesBySiteIdData, type PatchApiV1SitesBySiteIdDomainsData, type PatchApiV1SitesBySiteIdDomainsError, type PatchApiV1SitesBySiteIdDomainsErrors, type PatchApiV1SitesBySiteIdDomainsResponse, type PatchApiV1SitesBySiteIdDomainsResponses, type PatchApiV1SitesBySiteIdError, type PatchApiV1SitesBySiteIdErrors, type PatchApiV1SitesBySiteIdResponse, type PatchApiV1SitesBySiteIdResponses, type PostApiV1FormsData, type PostApiV1FormsError, type PostApiV1FormsErrors, type PostApiV1FormsResponse, type PostApiV1FormsResponses, type PostApiV1SitesBySiteIdFormsData, type PostApiV1SitesBySiteIdFormsError, type PostApiV1SitesBySiteIdFormsErrors, type PostApiV1SitesBySiteIdFormsResponse, type PostApiV1SitesBySiteIdFormsResponses, type PostApiV1SitesData, type PostApiV1SitesError, type PostApiV1SitesErrors, type PostApiV1SitesResponse, type PostApiV1SitesResponses, type Site, type SiteDomains, type SiteWithToken, type SitesList, type Submission, type SubmissionMetadata, type SubmissionsList, type UpdateForm, type UpdateSite, type UpdateSiteDomains, deleteApiV1FormsByFormId, deleteApiV1SitesBySiteId, deleteApiV1SubmissionsBySubmissionId, getApiV1Forms, getApiV1FormsByFormId, getApiV1FormsByFormIdSubmissions, getApiV1Sites, getApiV1SitesBySiteId, getApiV1SitesBySiteIdForms, getApiV1SubmissionsBySubmissionId, getApiV1SubmissionsBySubmissionIdAttachmentsByFilename, patchApiV1FormsByFormId, patchApiV1SitesBySiteId, patchApiV1SitesBySiteIdDomains, postApiV1Forms, postApiV1Sites, postApiV1SitesBySiteIdForms };
|