@forgerock/login-widget 1.0.2-beta.1 → 1.0.2-beta.3
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 +363 -0
- package/index.cjs +36261 -0
- package/index.cjs.map +1 -0
- package/index.d.ts +2391 -0
- package/index.js +36252 -0
- package/index.js.map +1 -0
- package/package.json +1 -4
- package/types.d.ts +2385 -0
- package/widget.css +1632 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,2391 @@
|
|
|
1
|
+
declare enum ActionTypes {
|
|
2
|
+
Authenticate = "AUTHENTICATE",
|
|
3
|
+
Authorize = "AUTHORIZE",
|
|
4
|
+
EndSession = "END_SESSION",
|
|
5
|
+
Logout = "LOGOUT",
|
|
6
|
+
ExchangeToken = "EXCHANGE_TOKEN",
|
|
7
|
+
RefreshToken = "REFRESH_TOKEN",
|
|
8
|
+
ResumeAuthenticate = "RESUME_AUTHENTICATE",
|
|
9
|
+
RevokeToken = "REVOKE_TOKEN",
|
|
10
|
+
StartAuthenticate = "START_AUTHENTICATE",
|
|
11
|
+
UserInfo = "USER_INFO"
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface StringDict<T> {
|
|
15
|
+
[name: string]: T;
|
|
16
|
+
}
|
|
17
|
+
interface Tokens {
|
|
18
|
+
accessToken: string;
|
|
19
|
+
idToken?: string;
|
|
20
|
+
refreshToken?: string;
|
|
21
|
+
tokenExpiry?: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Types of callbacks directly supported by the SDK.
|
|
26
|
+
*/
|
|
27
|
+
declare enum CallbackType {
|
|
28
|
+
BooleanAttributeInputCallback = "BooleanAttributeInputCallback",
|
|
29
|
+
ChoiceCallback = "ChoiceCallback",
|
|
30
|
+
ConfirmationCallback = "ConfirmationCallback",
|
|
31
|
+
DeviceProfileCallback = "DeviceProfileCallback",
|
|
32
|
+
HiddenValueCallback = "HiddenValueCallback",
|
|
33
|
+
KbaCreateCallback = "KbaCreateCallback",
|
|
34
|
+
MetadataCallback = "MetadataCallback",
|
|
35
|
+
NameCallback = "NameCallback",
|
|
36
|
+
NumberAttributeInputCallback = "NumberAttributeInputCallback",
|
|
37
|
+
PasswordCallback = "PasswordCallback",
|
|
38
|
+
PollingWaitCallback = "PollingWaitCallback",
|
|
39
|
+
ReCaptchaCallback = "ReCaptchaCallback",
|
|
40
|
+
RedirectCallback = "RedirectCallback",
|
|
41
|
+
SelectIdPCallback = "SelectIdPCallback",
|
|
42
|
+
StringAttributeInputCallback = "StringAttributeInputCallback",
|
|
43
|
+
SuspendedTextOutputCallback = "SuspendedTextOutputCallback",
|
|
44
|
+
TermsAndConditionsCallback = "TermsAndConditionsCallback",
|
|
45
|
+
TextInputCallback = "TextInputCallback",
|
|
46
|
+
TextOutputCallback = "TextOutputCallback",
|
|
47
|
+
ValidatedCreatePasswordCallback = "ValidatedCreatePasswordCallback",
|
|
48
|
+
ValidatedCreateUsernameCallback = "ValidatedCreateUsernameCallback"
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Represents the authentication tree API payload schema.
|
|
53
|
+
*/
|
|
54
|
+
interface Step {
|
|
55
|
+
authId?: string;
|
|
56
|
+
callbacks?: Callback[];
|
|
57
|
+
code?: number;
|
|
58
|
+
description?: string;
|
|
59
|
+
detail?: StepDetail;
|
|
60
|
+
header?: string;
|
|
61
|
+
message?: string;
|
|
62
|
+
ok?: string;
|
|
63
|
+
realm?: string;
|
|
64
|
+
reason?: string;
|
|
65
|
+
stage?: string;
|
|
66
|
+
status?: number;
|
|
67
|
+
successUrl?: string;
|
|
68
|
+
tokenId?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Represents details of a failure in an authentication step.
|
|
72
|
+
*/
|
|
73
|
+
interface StepDetail {
|
|
74
|
+
failedPolicyRequirements?: FailedPolicyRequirement[];
|
|
75
|
+
failureUrl?: string;
|
|
76
|
+
result?: boolean;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Represents configuration overrides used when requesting the next
|
|
80
|
+
* step in an authentication tree.
|
|
81
|
+
*/
|
|
82
|
+
interface StepOptions extends ConfigOptions {
|
|
83
|
+
query?: StringDict<string>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Represents failed policies for a matching property.
|
|
87
|
+
*/
|
|
88
|
+
interface FailedPolicyRequirement {
|
|
89
|
+
policyRequirements: PolicyRequirement[];
|
|
90
|
+
property: string;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Represents a failed policy policy and failed policy params.
|
|
94
|
+
*/
|
|
95
|
+
interface PolicyRequirement {
|
|
96
|
+
params?: Partial<PolicyParams>;
|
|
97
|
+
policyRequirement: string;
|
|
98
|
+
}
|
|
99
|
+
interface PolicyParams {
|
|
100
|
+
[key: string]: unknown;
|
|
101
|
+
disallowedFields: string;
|
|
102
|
+
duplicateValue: string;
|
|
103
|
+
forbiddenChars: string;
|
|
104
|
+
maxLength: number;
|
|
105
|
+
minLength: number;
|
|
106
|
+
numCaps: number;
|
|
107
|
+
numNums: number;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Represents the authentication tree API callback schema.
|
|
111
|
+
*/
|
|
112
|
+
interface Callback {
|
|
113
|
+
_id?: number;
|
|
114
|
+
input?: NameValue[];
|
|
115
|
+
output: NameValue[];
|
|
116
|
+
type: CallbackType;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Represents a name/value pair found in an authentication tree callback.
|
|
120
|
+
*/
|
|
121
|
+
interface NameValue {
|
|
122
|
+
name: string;
|
|
123
|
+
value: unknown;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Base class for authentication tree callback wrappers.
|
|
128
|
+
*/
|
|
129
|
+
declare class FRCallback {
|
|
130
|
+
payload: Callback;
|
|
131
|
+
/**
|
|
132
|
+
* @param payload The raw payload returned by OpenAM
|
|
133
|
+
*/
|
|
134
|
+
constructor(payload: Callback);
|
|
135
|
+
/**
|
|
136
|
+
* Gets the name of this callback type.
|
|
137
|
+
*/
|
|
138
|
+
getType(): string;
|
|
139
|
+
/**
|
|
140
|
+
* Gets the value of the specified input element, or the first element if `selector` is not
|
|
141
|
+
* provided.
|
|
142
|
+
*
|
|
143
|
+
* @param selector The index position or name of the desired element
|
|
144
|
+
*/
|
|
145
|
+
getInputValue(selector?: number | string): unknown;
|
|
146
|
+
/**
|
|
147
|
+
* Sets the value of the specified input element, or the first element if `selector` is not
|
|
148
|
+
* provided.
|
|
149
|
+
*
|
|
150
|
+
* @param selector The index position or name of the desired element
|
|
151
|
+
*/
|
|
152
|
+
setInputValue(value: unknown, selector?: number | string | RegExp): void;
|
|
153
|
+
/**
|
|
154
|
+
* Gets the value of the specified output element, or the first element if `selector`
|
|
155
|
+
* is not provided.
|
|
156
|
+
*
|
|
157
|
+
* @param selector The index position or name of the desired element
|
|
158
|
+
*/
|
|
159
|
+
getOutputValue(selector?: number | string): unknown;
|
|
160
|
+
/**
|
|
161
|
+
* Gets the value of the first output element with the specified name or the
|
|
162
|
+
* specified default value.
|
|
163
|
+
*
|
|
164
|
+
* @param name The name of the desired element
|
|
165
|
+
*/
|
|
166
|
+
getOutputByName<T>(name: string, defaultValue: T): T;
|
|
167
|
+
private getArrayElement;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
declare type FRCallbackFactory = (callback: Callback) => FRCallback;
|
|
171
|
+
|
|
172
|
+
interface Action {
|
|
173
|
+
type: ActionTypes;
|
|
174
|
+
payload: any;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Configuration options.
|
|
178
|
+
*/
|
|
179
|
+
interface ConfigOptions {
|
|
180
|
+
callbackFactory?: FRCallbackFactory;
|
|
181
|
+
clientId?: string;
|
|
182
|
+
middleware?: RequestMiddleware[];
|
|
183
|
+
realmPath?: string;
|
|
184
|
+
redirectUri?: string;
|
|
185
|
+
scope?: string;
|
|
186
|
+
serverConfig?: ServerConfig;
|
|
187
|
+
support?: 'modern' | 'legacy' | undefined;
|
|
188
|
+
tokenStore?: TokenStoreObject | 'indexedDB' | 'sessionStorage' | 'localStorage';
|
|
189
|
+
tree?: string;
|
|
190
|
+
type?: string;
|
|
191
|
+
oauthThreshold?: number;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Optional configuration for custom paths for actions
|
|
195
|
+
*/
|
|
196
|
+
interface CustomPathConfig {
|
|
197
|
+
authenticate?: string;
|
|
198
|
+
authorize?: string;
|
|
199
|
+
accessToken?: string;
|
|
200
|
+
endSession?: string;
|
|
201
|
+
userInfo?: string;
|
|
202
|
+
revoke?: string;
|
|
203
|
+
sessions?: string;
|
|
204
|
+
}
|
|
205
|
+
declare type RequestMiddleware = (req: RequestObj, action: Action, next: () => RequestObj) => void;
|
|
206
|
+
interface RequestObj {
|
|
207
|
+
url: URL;
|
|
208
|
+
init: RequestInit;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Configuration settings for connecting to a server.
|
|
212
|
+
*/
|
|
213
|
+
interface ServerConfig {
|
|
214
|
+
baseUrl: string;
|
|
215
|
+
paths?: CustomPathConfig;
|
|
216
|
+
timeout: number;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* API for implementing a custom token store
|
|
220
|
+
*/
|
|
221
|
+
interface TokenStoreObject {
|
|
222
|
+
get: (clientId: string) => Promise<Tokens>;
|
|
223
|
+
set: (clientId: string, token: Tokens) => Promise<void>;
|
|
224
|
+
remove: (clientId: string) => Promise<void>;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* An event-handling function.
|
|
229
|
+
*/
|
|
230
|
+
declare type Listener = (e: FREvent) => void;
|
|
231
|
+
interface FREvent {
|
|
232
|
+
type: string;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Event dispatcher for subscribing and publishing categorized events.
|
|
237
|
+
*/
|
|
238
|
+
declare class Dispatcher {
|
|
239
|
+
private callbacks;
|
|
240
|
+
/**
|
|
241
|
+
* Subscribes to an event type.
|
|
242
|
+
*
|
|
243
|
+
* @param type The event type
|
|
244
|
+
* @param listener The function to subscribe to events of this type
|
|
245
|
+
*/
|
|
246
|
+
addEventListener(type: string, listener: Listener): void;
|
|
247
|
+
/**
|
|
248
|
+
* Unsubscribes from an event type.
|
|
249
|
+
*
|
|
250
|
+
* @param type The event type
|
|
251
|
+
* @param listener The function to unsubscribe from events of this type
|
|
252
|
+
*/
|
|
253
|
+
removeEventListener(type: string, listener: Listener): void;
|
|
254
|
+
/**
|
|
255
|
+
* Unsubscribes all listener functions to a single event type or all event types.
|
|
256
|
+
*
|
|
257
|
+
* @param type The event type, or all event types if not specified
|
|
258
|
+
*/
|
|
259
|
+
clearEventListeners(type?: string): void;
|
|
260
|
+
/**
|
|
261
|
+
* Publishes an event.
|
|
262
|
+
*
|
|
263
|
+
* @param event The event object to publish
|
|
264
|
+
*/
|
|
265
|
+
dispatchEvent<T extends FREvent>(event: T): void;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Types of steps returned by the authentication tree.
|
|
270
|
+
*/
|
|
271
|
+
declare enum StepType {
|
|
272
|
+
LoginFailure = "LoginFailure",
|
|
273
|
+
LoginSuccess = "LoginSuccess",
|
|
274
|
+
Step = "Step"
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Base interface for all types of authentication step responses.
|
|
279
|
+
*/
|
|
280
|
+
interface AuthResponse {
|
|
281
|
+
type: StepType;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Represents details of a failure in an authentication step.
|
|
285
|
+
*/
|
|
286
|
+
interface FailureDetail {
|
|
287
|
+
failureUrl?: string;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Represents a single step of an authentication tree.
|
|
292
|
+
*/
|
|
293
|
+
declare class FRStep implements AuthResponse {
|
|
294
|
+
payload: Step;
|
|
295
|
+
/**
|
|
296
|
+
* The type of step.
|
|
297
|
+
*/
|
|
298
|
+
readonly type = StepType.Step;
|
|
299
|
+
/**
|
|
300
|
+
* The callbacks contained in this step.
|
|
301
|
+
*/
|
|
302
|
+
callbacks: FRCallback[];
|
|
303
|
+
/**
|
|
304
|
+
* @param payload The raw payload returned by OpenAM
|
|
305
|
+
* @param callbackFactory A function that returns am implementation of FRCallback
|
|
306
|
+
*/
|
|
307
|
+
constructor(payload: Step, callbackFactory?: FRCallbackFactory);
|
|
308
|
+
/**
|
|
309
|
+
* Gets the first callback of the specified type in this step.
|
|
310
|
+
*
|
|
311
|
+
* @param type The type of callback to find.
|
|
312
|
+
*/
|
|
313
|
+
getCallbackOfType<T extends FRCallback>(type: CallbackType): T;
|
|
314
|
+
/**
|
|
315
|
+
* Gets all callbacks of the specified type in this step.
|
|
316
|
+
*
|
|
317
|
+
* @param type The type of callback to find.
|
|
318
|
+
*/
|
|
319
|
+
getCallbacksOfType<T extends FRCallback>(type: CallbackType): T[];
|
|
320
|
+
/**
|
|
321
|
+
* Sets the value of the first callback of the specified type in this step.
|
|
322
|
+
*
|
|
323
|
+
* @param type The type of callback to find.
|
|
324
|
+
* @param value The value to set for the callback.
|
|
325
|
+
*/
|
|
326
|
+
setCallbackValue(type: CallbackType, value: unknown): void;
|
|
327
|
+
/**
|
|
328
|
+
* Gets the step's description.
|
|
329
|
+
*/
|
|
330
|
+
getDescription(): string | undefined;
|
|
331
|
+
/**
|
|
332
|
+
* Gets the step's header.
|
|
333
|
+
*/
|
|
334
|
+
getHeader(): string | undefined;
|
|
335
|
+
/**
|
|
336
|
+
* Gets the step's stage.
|
|
337
|
+
*/
|
|
338
|
+
getStage(): string | undefined;
|
|
339
|
+
private convertCallbacks;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
declare type HandleStep = (step: FRStep) => Promise<FRStep>;
|
|
343
|
+
/**
|
|
344
|
+
* Options to use when making an HTTP call.
|
|
345
|
+
*/
|
|
346
|
+
interface HttpClientRequestOptions {
|
|
347
|
+
bypassAuthentication?: boolean;
|
|
348
|
+
authorization?: {
|
|
349
|
+
config?: ConfigOptions;
|
|
350
|
+
handleStep: HandleStep;
|
|
351
|
+
idToken?: string;
|
|
352
|
+
txnID?: string;
|
|
353
|
+
};
|
|
354
|
+
init: RequestInit;
|
|
355
|
+
requiresNewToken?: RequiresNewTokenFn;
|
|
356
|
+
timeout: number;
|
|
357
|
+
url: string;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* A function that determines whether a new token is required based on a HTTP response.
|
|
361
|
+
*/
|
|
362
|
+
declare type RequiresNewTokenFn = (res: Response) => boolean;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* HTTP client that includes bearer token injection and refresh.
|
|
366
|
+
* This module also supports authorization for policy protected endpoints.
|
|
367
|
+
*
|
|
368
|
+
* Example:
|
|
369
|
+
*
|
|
370
|
+
* ```js
|
|
371
|
+
* return forgerock.HttpClient.request({
|
|
372
|
+
* url: `https://example.com/protected/resource`,
|
|
373
|
+
* init: {
|
|
374
|
+
* method: 'GET',
|
|
375
|
+
* credentials: 'include',
|
|
376
|
+
* },
|
|
377
|
+
* authorization: {
|
|
378
|
+
* handleStep: async (step) => {
|
|
379
|
+
* step.getCallbackOfType('PasswordCallback').setPassword(pw);
|
|
380
|
+
* return Promise.resolve(step);
|
|
381
|
+
* },
|
|
382
|
+
* },
|
|
383
|
+
* });
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
declare abstract class HttpClient extends Dispatcher {
|
|
387
|
+
/**
|
|
388
|
+
* Makes a request using the specified options.
|
|
389
|
+
*
|
|
390
|
+
* @param options The options to use when making the request
|
|
391
|
+
*/
|
|
392
|
+
static request(options: HttpClientRequestOptions): Promise<Response>;
|
|
393
|
+
private static setAuthHeaders;
|
|
394
|
+
private static stepIterator;
|
|
395
|
+
private static _request;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
declare function noop(): void;
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* INTERNAL, DO NOT USE. Code may change at any time.
|
|
402
|
+
*/
|
|
403
|
+
interface Fragment {
|
|
404
|
+
key: string | null;
|
|
405
|
+
first: null;
|
|
406
|
+
c: () => void;
|
|
407
|
+
l: (nodes: any) => void;
|
|
408
|
+
h: () => void;
|
|
409
|
+
m: (target: HTMLElement, anchor: any) => void;
|
|
410
|
+
p: (ctx: T$$['ctx'], dirty: T$$['dirty']) => void;
|
|
411
|
+
r: () => void;
|
|
412
|
+
f: () => void;
|
|
413
|
+
a: () => void;
|
|
414
|
+
i: (local: any) => void;
|
|
415
|
+
o: (local: any) => void;
|
|
416
|
+
d: (detaching: 0 | 1) => void;
|
|
417
|
+
}
|
|
418
|
+
interface T$$ {
|
|
419
|
+
dirty: number[];
|
|
420
|
+
ctx: any[];
|
|
421
|
+
bound: any;
|
|
422
|
+
update: () => void;
|
|
423
|
+
callbacks: any;
|
|
424
|
+
after_update: any[];
|
|
425
|
+
props: Record<string, 0 | string>;
|
|
426
|
+
fragment: null | false | Fragment;
|
|
427
|
+
not_equal: any;
|
|
428
|
+
before_update: any[];
|
|
429
|
+
context: Map<any, any>;
|
|
430
|
+
on_mount: any[];
|
|
431
|
+
on_destroy: any[];
|
|
432
|
+
skip_bound: boolean;
|
|
433
|
+
on_disconnect: any[];
|
|
434
|
+
root: Element | ShadowRoot;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* Base class for Svelte components. Used when dev=false.
|
|
439
|
+
*/
|
|
440
|
+
declare class SvelteComponent {
|
|
441
|
+
$$: T$$;
|
|
442
|
+
$$set?: ($$props: any) => void;
|
|
443
|
+
$destroy(): void;
|
|
444
|
+
$on(type: any, callback: any): typeof noop;
|
|
445
|
+
$set($$props: any): void;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
declare type Props = Record<string, any>;
|
|
449
|
+
interface ComponentConstructorOptions<Props extends Record<string, any> = Record<string, any>> {
|
|
450
|
+
target: Element | ShadowRoot;
|
|
451
|
+
anchor?: Element;
|
|
452
|
+
props?: Props;
|
|
453
|
+
context?: Map<any, any>;
|
|
454
|
+
hydrate?: boolean;
|
|
455
|
+
intro?: boolean;
|
|
456
|
+
$$inline?: boolean;
|
|
457
|
+
}
|
|
458
|
+
interface SvelteComponentDev$1 {
|
|
459
|
+
$set(props?: Props): void;
|
|
460
|
+
$on(event: string, callback: ((event: any) => void) | null | undefined): () => void;
|
|
461
|
+
$destroy(): void;
|
|
462
|
+
[accessor: string]: any;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
|
|
466
|
+
*/
|
|
467
|
+
declare class SvelteComponentDev$1 extends SvelteComponent {
|
|
468
|
+
/**
|
|
469
|
+
* @private
|
|
470
|
+
* For type checking capabilities only.
|
|
471
|
+
* Does not exist at runtime.
|
|
472
|
+
* ### DO NOT USE!
|
|
473
|
+
*/
|
|
474
|
+
$$prop_def: Props;
|
|
475
|
+
/**
|
|
476
|
+
* @private
|
|
477
|
+
* For type checking capabilities only.
|
|
478
|
+
* Does not exist at runtime.
|
|
479
|
+
* ### DO NOT USE!
|
|
480
|
+
*/
|
|
481
|
+
$$events_def: any;
|
|
482
|
+
/**
|
|
483
|
+
* @private
|
|
484
|
+
* For type checking capabilities only.
|
|
485
|
+
* Does not exist at runtime.
|
|
486
|
+
* ### DO NOT USE!
|
|
487
|
+
*/
|
|
488
|
+
$$slot_def: any;
|
|
489
|
+
constructor(options: ComponentConstructorOptions);
|
|
490
|
+
$capture_state(): void;
|
|
491
|
+
$inject_state(): void;
|
|
492
|
+
}
|
|
493
|
+
interface SvelteComponentTyped<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any> {
|
|
494
|
+
$set(props?: Partial<Props>): void;
|
|
495
|
+
$on<K extends Extract<keyof Events, string>>(type: K, callback: ((e: Events[K]) => void) | null | undefined): () => void;
|
|
496
|
+
$destroy(): void;
|
|
497
|
+
[accessor: string]: any;
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* Base class to create strongly typed Svelte components.
|
|
501
|
+
* This only exists for typing purposes and should be used in `.d.ts` files.
|
|
502
|
+
*
|
|
503
|
+
* ### Example:
|
|
504
|
+
*
|
|
505
|
+
* You have component library on npm called `component-library`, from which
|
|
506
|
+
* you export a component called `MyComponent`. For Svelte+TypeScript users,
|
|
507
|
+
* you want to provide typings. Therefore you create a `index.d.ts`:
|
|
508
|
+
* ```ts
|
|
509
|
+
* import { SvelteComponentTyped } from "svelte";
|
|
510
|
+
* export class MyComponent extends SvelteComponentTyped<{foo: string}> {}
|
|
511
|
+
* ```
|
|
512
|
+
* Typing this makes it possible for IDEs like VS Code with the Svelte extension
|
|
513
|
+
* to provide intellisense and to use the component like this in a Svelte file
|
|
514
|
+
* with TypeScript:
|
|
515
|
+
* ```svelte
|
|
516
|
+
* <script lang="ts">
|
|
517
|
+
* import { MyComponent } from "component-library";
|
|
518
|
+
* </script>
|
|
519
|
+
* <MyComponent foo={'bar'} />
|
|
520
|
+
* ```
|
|
521
|
+
*
|
|
522
|
+
* #### Why not make this part of `SvelteComponent(Dev)`?
|
|
523
|
+
* Because
|
|
524
|
+
* ```ts
|
|
525
|
+
* class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}
|
|
526
|
+
* const component: typeof SvelteComponent = ASubclassOfSvelteComponent;
|
|
527
|
+
* ```
|
|
528
|
+
* will throw a type error, so we need to separate the more strictly typed class.
|
|
529
|
+
*/
|
|
530
|
+
declare class SvelteComponentTyped<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any> extends SvelteComponentDev$1 {
|
|
531
|
+
/**
|
|
532
|
+
* @private
|
|
533
|
+
* For type checking capabilities only.
|
|
534
|
+
* Does not exist at runtime.
|
|
535
|
+
* ### DO NOT USE!
|
|
536
|
+
*/
|
|
537
|
+
$$prop_def: Props;
|
|
538
|
+
/**
|
|
539
|
+
* @private
|
|
540
|
+
* For type checking capabilities only.
|
|
541
|
+
* Does not exist at runtime.
|
|
542
|
+
* ### DO NOT USE!
|
|
543
|
+
*/
|
|
544
|
+
$$events_def: Events;
|
|
545
|
+
/**
|
|
546
|
+
* @private
|
|
547
|
+
* For type checking capabilities only.
|
|
548
|
+
* Does not exist at runtime.
|
|
549
|
+
* ### DO NOT USE!
|
|
550
|
+
*/
|
|
551
|
+
$$slot_def: Slots;
|
|
552
|
+
constructor(options: ComponentConstructorOptions<Props>);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/** Callback to inform of a value updates. */
|
|
556
|
+
declare type Subscriber<T> = (value: T) => void;
|
|
557
|
+
/** Unsubscribes from value updates. */
|
|
558
|
+
declare type Unsubscriber = () => void;
|
|
559
|
+
|
|
560
|
+
|
|
561
|
+
interface ComponentStoreValue {
|
|
562
|
+
lastAction: 'close' | 'open' | 'mount' | null;
|
|
563
|
+
error: {
|
|
564
|
+
code: string;
|
|
565
|
+
message: string;
|
|
566
|
+
} | null;
|
|
567
|
+
modal: {
|
|
568
|
+
component: SvelteComponentDev$1;
|
|
569
|
+
element: HTMLDialogElement;
|
|
570
|
+
} | null;
|
|
571
|
+
mounted: boolean;
|
|
572
|
+
open: boolean | null;
|
|
573
|
+
reason: 'auto' | 'external' | 'user' | null;
|
|
574
|
+
type: 'inline' | 'modal' | null;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
interface MessageCreator {
|
|
578
|
+
[key: string]: (propertyName: string, params?: {
|
|
579
|
+
[key: string]: unknown;
|
|
580
|
+
}) => string;
|
|
581
|
+
}
|
|
582
|
+
interface ProcessedPropertyError {
|
|
583
|
+
detail: FailedPolicyRequirement;
|
|
584
|
+
messages: string[];
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
declare class FRLoginFailure implements AuthResponse {
|
|
588
|
+
payload: Step;
|
|
589
|
+
/**
|
|
590
|
+
* The type of step.
|
|
591
|
+
*/
|
|
592
|
+
readonly type = StepType.LoginFailure;
|
|
593
|
+
/**
|
|
594
|
+
* @param payload The raw payload returned by OpenAM
|
|
595
|
+
*/
|
|
596
|
+
constructor(payload: Step);
|
|
597
|
+
/**
|
|
598
|
+
* Gets the error code.
|
|
599
|
+
*/
|
|
600
|
+
getCode(): number;
|
|
601
|
+
/**
|
|
602
|
+
* Gets the failure details.
|
|
603
|
+
*/
|
|
604
|
+
getDetail(): FailureDetail | undefined;
|
|
605
|
+
/**
|
|
606
|
+
* Gets the failure message.
|
|
607
|
+
*/
|
|
608
|
+
getMessage(): string | undefined;
|
|
609
|
+
/**
|
|
610
|
+
* Gets processed failure message.
|
|
611
|
+
*/
|
|
612
|
+
getProcessedMessage(messageCreator?: MessageCreator): ProcessedPropertyError[];
|
|
613
|
+
/**
|
|
614
|
+
* Gets the failure reason.
|
|
615
|
+
*/
|
|
616
|
+
getReason(): string | undefined;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
declare class FRLoginSuccess implements AuthResponse {
|
|
620
|
+
payload: Step;
|
|
621
|
+
/**
|
|
622
|
+
* The type of step.
|
|
623
|
+
*/
|
|
624
|
+
readonly type = StepType.LoginSuccess;
|
|
625
|
+
/**
|
|
626
|
+
* @param payload The raw payload returned by OpenAM
|
|
627
|
+
*/
|
|
628
|
+
constructor(payload: Step);
|
|
629
|
+
/**
|
|
630
|
+
* Gets the step's realm.
|
|
631
|
+
*/
|
|
632
|
+
getRealm(): string | undefined;
|
|
633
|
+
/**
|
|
634
|
+
* Gets the step's session token.
|
|
635
|
+
*/
|
|
636
|
+
getSessionToken(): string | undefined;
|
|
637
|
+
/**
|
|
638
|
+
* Gets the step's success URL.
|
|
639
|
+
*/
|
|
640
|
+
getSuccessUrl(): string | undefined;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* Tokens returned after successful authentication.
|
|
645
|
+
*/
|
|
646
|
+
interface OAuth2Tokens {
|
|
647
|
+
accessToken: string;
|
|
648
|
+
idToken?: string;
|
|
649
|
+
refreshToken?: string;
|
|
650
|
+
tokenExpiry?: number;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
type Maybe<T> = T | null | undefined;
|
|
654
|
+
|
|
655
|
+
interface UserStoreValue {
|
|
656
|
+
completed: boolean;
|
|
657
|
+
error: Maybe<{
|
|
658
|
+
code?: Maybe<number>;
|
|
659
|
+
message: Maybe<string>;
|
|
660
|
+
troubleshoot: Maybe<string>;
|
|
661
|
+
}>;
|
|
662
|
+
loading: boolean;
|
|
663
|
+
successful: boolean;
|
|
664
|
+
response: unknown;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
interface OAuthTokenStoreValue {
|
|
668
|
+
completed: boolean;
|
|
669
|
+
error: Maybe<{
|
|
670
|
+
code?: Maybe<number>;
|
|
671
|
+
message: Maybe<string>;
|
|
672
|
+
troubleshoot: Maybe<string>;
|
|
673
|
+
}>;
|
|
674
|
+
loading: boolean;
|
|
675
|
+
successful: boolean;
|
|
676
|
+
response: Maybe<OAuth2Tokens> | void;
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
interface CallbackMetadata {
|
|
680
|
+
derived: {
|
|
681
|
+
canForceUserInputOptionality: boolean;
|
|
682
|
+
isFirstInvalidInput: boolean;
|
|
683
|
+
isReadyForSubmission: boolean;
|
|
684
|
+
isSelfSubmitting: boolean;
|
|
685
|
+
isUserInputRequired: boolean;
|
|
686
|
+
};
|
|
687
|
+
idx: number;
|
|
688
|
+
platform?: Record<string, unknown>;
|
|
689
|
+
}
|
|
690
|
+
interface JourneyStoreValue {
|
|
691
|
+
completed: boolean;
|
|
692
|
+
error: Maybe<{
|
|
693
|
+
code: Maybe<number>;
|
|
694
|
+
message: Maybe<string>;
|
|
695
|
+
stage: Maybe<string>;
|
|
696
|
+
troubleshoot: Maybe<string>;
|
|
697
|
+
}>;
|
|
698
|
+
loading: boolean;
|
|
699
|
+
metadata: {
|
|
700
|
+
callbacks: CallbackMetadata[];
|
|
701
|
+
step: StepMetadata;
|
|
702
|
+
} | null;
|
|
703
|
+
step: StepTypes;
|
|
704
|
+
successful: boolean;
|
|
705
|
+
response: Maybe<Step>;
|
|
706
|
+
}
|
|
707
|
+
interface StepMetadata {
|
|
708
|
+
derived: {
|
|
709
|
+
isUserInputOptional: boolean;
|
|
710
|
+
isStepSelfSubmittable: boolean;
|
|
711
|
+
numOfCallbacks: number;
|
|
712
|
+
numOfSelfSubmittableCbs: number;
|
|
713
|
+
numOfUserInputCbs: number;
|
|
714
|
+
};
|
|
715
|
+
platform?: Record<string, unknown>;
|
|
716
|
+
}
|
|
717
|
+
type StepTypes = FRStep | FRLoginSuccess | FRLoginFailure | null;
|
|
718
|
+
|
|
719
|
+
declare type Primitive = string | number | symbol | bigint | boolean | null | undefined;
|
|
720
|
+
|
|
721
|
+
declare namespace util {
|
|
722
|
+
type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
|
|
723
|
+
export type isAny<T> = 0 extends 1 & T ? true : false;
|
|
724
|
+
export const assertEqual: <A, B>(val: AssertEqual<A, B>) => AssertEqual<A, B>;
|
|
725
|
+
export function assertIs<T>(_arg: T): void;
|
|
726
|
+
export function assertNever(_x: never): never;
|
|
727
|
+
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
728
|
+
export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
|
|
729
|
+
export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
730
|
+
export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
|
|
731
|
+
export const getValidEnumValues: (obj: any) => any[];
|
|
732
|
+
export const objectValues: (obj: any) => any[];
|
|
733
|
+
export const objectKeys: ObjectConstructor["keys"];
|
|
734
|
+
export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
|
|
735
|
+
export type identity<T> = objectUtil.identity<T>;
|
|
736
|
+
export type flatten<T> = objectUtil.flatten<T>;
|
|
737
|
+
export type noUndefined<T> = T extends undefined ? never : T;
|
|
738
|
+
export const isInteger: NumberConstructor["isInteger"];
|
|
739
|
+
export function joinValues<T extends any[]>(array: T, separator?: string): string;
|
|
740
|
+
export const jsonStringifyReplacer: (_: string, value: any) => any;
|
|
741
|
+
export {};
|
|
742
|
+
}
|
|
743
|
+
declare namespace objectUtil {
|
|
744
|
+
export type MergeShapes<U, V> = {
|
|
745
|
+
[k in Exclude<keyof U, keyof V>]: U[k];
|
|
746
|
+
} & V;
|
|
747
|
+
type requiredKeys<T extends object> = {
|
|
748
|
+
[k in keyof T]: undefined extends T[k] ? never : k;
|
|
749
|
+
}[keyof T];
|
|
750
|
+
export type addQuestionMarks<T extends object, R extends keyof T = requiredKeys<T>> = Pick<Required<T>, R> & Partial<T>;
|
|
751
|
+
export type identity<T> = T;
|
|
752
|
+
export type flatten<T> = identity<{
|
|
753
|
+
[k in keyof T]: T[k];
|
|
754
|
+
}>;
|
|
755
|
+
export type noNeverKeys<T> = {
|
|
756
|
+
[k in keyof T]: [T[k]] extends [never] ? never : k;
|
|
757
|
+
}[keyof T];
|
|
758
|
+
export type noNever<T> = identity<{
|
|
759
|
+
[k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
|
|
760
|
+
}>;
|
|
761
|
+
export const mergeShapes: <U, T>(first: U, second: T) => T & U;
|
|
762
|
+
export type extendShape<A, B> = flatten<Omit<A, keyof B> & B>;
|
|
763
|
+
export {};
|
|
764
|
+
}
|
|
765
|
+
declare const ZodParsedType: {
|
|
766
|
+
function: "function";
|
|
767
|
+
number: "number";
|
|
768
|
+
string: "string";
|
|
769
|
+
nan: "nan";
|
|
770
|
+
integer: "integer";
|
|
771
|
+
float: "float";
|
|
772
|
+
boolean: "boolean";
|
|
773
|
+
date: "date";
|
|
774
|
+
bigint: "bigint";
|
|
775
|
+
symbol: "symbol";
|
|
776
|
+
undefined: "undefined";
|
|
777
|
+
null: "null";
|
|
778
|
+
array: "array";
|
|
779
|
+
object: "object";
|
|
780
|
+
unknown: "unknown";
|
|
781
|
+
promise: "promise";
|
|
782
|
+
void: "void";
|
|
783
|
+
never: "never";
|
|
784
|
+
map: "map";
|
|
785
|
+
set: "set";
|
|
786
|
+
};
|
|
787
|
+
declare type ZodParsedType = keyof typeof ZodParsedType;
|
|
788
|
+
|
|
789
|
+
declare type allKeys<T> = T extends any ? keyof T : never;
|
|
790
|
+
declare type typeToFlattenedError<T, U = string> = {
|
|
791
|
+
formErrors: U[];
|
|
792
|
+
fieldErrors: {
|
|
793
|
+
[P in allKeys<T>]?: U[];
|
|
794
|
+
};
|
|
795
|
+
};
|
|
796
|
+
declare const ZodIssueCode: {
|
|
797
|
+
invalid_type: "invalid_type";
|
|
798
|
+
invalid_literal: "invalid_literal";
|
|
799
|
+
custom: "custom";
|
|
800
|
+
invalid_union: "invalid_union";
|
|
801
|
+
invalid_union_discriminator: "invalid_union_discriminator";
|
|
802
|
+
invalid_enum_value: "invalid_enum_value";
|
|
803
|
+
unrecognized_keys: "unrecognized_keys";
|
|
804
|
+
invalid_arguments: "invalid_arguments";
|
|
805
|
+
invalid_return_type: "invalid_return_type";
|
|
806
|
+
invalid_date: "invalid_date";
|
|
807
|
+
invalid_string: "invalid_string";
|
|
808
|
+
too_small: "too_small";
|
|
809
|
+
too_big: "too_big";
|
|
810
|
+
invalid_intersection_types: "invalid_intersection_types";
|
|
811
|
+
not_multiple_of: "not_multiple_of";
|
|
812
|
+
not_finite: "not_finite";
|
|
813
|
+
};
|
|
814
|
+
declare type ZodIssueCode = keyof typeof ZodIssueCode;
|
|
815
|
+
declare type ZodIssueBase = {
|
|
816
|
+
path: (string | number)[];
|
|
817
|
+
message?: string;
|
|
818
|
+
};
|
|
819
|
+
interface ZodInvalidTypeIssue extends ZodIssueBase {
|
|
820
|
+
code: typeof ZodIssueCode.invalid_type;
|
|
821
|
+
expected: ZodParsedType;
|
|
822
|
+
received: ZodParsedType;
|
|
823
|
+
}
|
|
824
|
+
interface ZodInvalidLiteralIssue extends ZodIssueBase {
|
|
825
|
+
code: typeof ZodIssueCode.invalid_literal;
|
|
826
|
+
expected: unknown;
|
|
827
|
+
received: unknown;
|
|
828
|
+
}
|
|
829
|
+
interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
|
|
830
|
+
code: typeof ZodIssueCode.unrecognized_keys;
|
|
831
|
+
keys: string[];
|
|
832
|
+
}
|
|
833
|
+
interface ZodInvalidUnionIssue extends ZodIssueBase {
|
|
834
|
+
code: typeof ZodIssueCode.invalid_union;
|
|
835
|
+
unionErrors: ZodError[];
|
|
836
|
+
}
|
|
837
|
+
interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
|
|
838
|
+
code: typeof ZodIssueCode.invalid_union_discriminator;
|
|
839
|
+
options: Primitive[];
|
|
840
|
+
}
|
|
841
|
+
interface ZodInvalidEnumValueIssue extends ZodIssueBase {
|
|
842
|
+
received: string | number;
|
|
843
|
+
code: typeof ZodIssueCode.invalid_enum_value;
|
|
844
|
+
options: (string | number)[];
|
|
845
|
+
}
|
|
846
|
+
interface ZodInvalidArgumentsIssue extends ZodIssueBase {
|
|
847
|
+
code: typeof ZodIssueCode.invalid_arguments;
|
|
848
|
+
argumentsError: ZodError;
|
|
849
|
+
}
|
|
850
|
+
interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
|
|
851
|
+
code: typeof ZodIssueCode.invalid_return_type;
|
|
852
|
+
returnTypeError: ZodError;
|
|
853
|
+
}
|
|
854
|
+
interface ZodInvalidDateIssue extends ZodIssueBase {
|
|
855
|
+
code: typeof ZodIssueCode.invalid_date;
|
|
856
|
+
}
|
|
857
|
+
declare type StringValidation = "email" | "url" | "emoji" | "uuid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "ip" | {
|
|
858
|
+
includes: string;
|
|
859
|
+
position?: number;
|
|
860
|
+
} | {
|
|
861
|
+
startsWith: string;
|
|
862
|
+
} | {
|
|
863
|
+
endsWith: string;
|
|
864
|
+
};
|
|
865
|
+
interface ZodInvalidStringIssue extends ZodIssueBase {
|
|
866
|
+
code: typeof ZodIssueCode.invalid_string;
|
|
867
|
+
validation: StringValidation;
|
|
868
|
+
}
|
|
869
|
+
interface ZodTooSmallIssue extends ZodIssueBase {
|
|
870
|
+
code: typeof ZodIssueCode.too_small;
|
|
871
|
+
minimum: number | bigint;
|
|
872
|
+
inclusive: boolean;
|
|
873
|
+
exact?: boolean;
|
|
874
|
+
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
|
875
|
+
}
|
|
876
|
+
interface ZodTooBigIssue extends ZodIssueBase {
|
|
877
|
+
code: typeof ZodIssueCode.too_big;
|
|
878
|
+
maximum: number | bigint;
|
|
879
|
+
inclusive: boolean;
|
|
880
|
+
exact?: boolean;
|
|
881
|
+
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
|
882
|
+
}
|
|
883
|
+
interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
|
|
884
|
+
code: typeof ZodIssueCode.invalid_intersection_types;
|
|
885
|
+
}
|
|
886
|
+
interface ZodNotMultipleOfIssue extends ZodIssueBase {
|
|
887
|
+
code: typeof ZodIssueCode.not_multiple_of;
|
|
888
|
+
multipleOf: number | bigint;
|
|
889
|
+
}
|
|
890
|
+
interface ZodNotFiniteIssue extends ZodIssueBase {
|
|
891
|
+
code: typeof ZodIssueCode.not_finite;
|
|
892
|
+
}
|
|
893
|
+
interface ZodCustomIssue extends ZodIssueBase {
|
|
894
|
+
code: typeof ZodIssueCode.custom;
|
|
895
|
+
params?: {
|
|
896
|
+
[k: string]: any;
|
|
897
|
+
};
|
|
898
|
+
}
|
|
899
|
+
declare type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
|
|
900
|
+
declare type ZodIssue = ZodIssueOptionalMessage & {
|
|
901
|
+
fatal?: boolean;
|
|
902
|
+
message: string;
|
|
903
|
+
};
|
|
904
|
+
declare type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
|
|
905
|
+
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
906
|
+
} : T extends any[] ? {
|
|
907
|
+
[k: number]: ZodFormattedError<T[number]>;
|
|
908
|
+
} : T extends object ? {
|
|
909
|
+
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
910
|
+
} : unknown;
|
|
911
|
+
declare type ZodFormattedError<T, U = string> = {
|
|
912
|
+
_errors: U[];
|
|
913
|
+
} & recursiveZodFormattedError<NonNullable<T>>;
|
|
914
|
+
declare class ZodError<T = any> extends Error {
|
|
915
|
+
issues: ZodIssue[];
|
|
916
|
+
get errors(): ZodIssue[];
|
|
917
|
+
constructor(issues: ZodIssue[]);
|
|
918
|
+
format(): ZodFormattedError<T>;
|
|
919
|
+
format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
|
|
920
|
+
static create: (issues: ZodIssue[]) => ZodError<any>;
|
|
921
|
+
toString(): string;
|
|
922
|
+
get message(): string;
|
|
923
|
+
get isEmpty(): boolean;
|
|
924
|
+
addIssue: (sub: ZodIssue) => void;
|
|
925
|
+
addIssues: (subs?: ZodIssue[]) => void;
|
|
926
|
+
flatten(): typeToFlattenedError<T>;
|
|
927
|
+
flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
|
|
928
|
+
get formErrors(): typeToFlattenedError<T, string>;
|
|
929
|
+
}
|
|
930
|
+
declare type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
|
|
931
|
+
declare type IssueData = stripPath<ZodIssueOptionalMessage> & {
|
|
932
|
+
path?: (string | number)[];
|
|
933
|
+
fatal?: boolean;
|
|
934
|
+
};
|
|
935
|
+
declare type ErrorMapCtx = {
|
|
936
|
+
defaultError: string;
|
|
937
|
+
data: any;
|
|
938
|
+
};
|
|
939
|
+
declare type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
|
|
940
|
+
message: string;
|
|
941
|
+
};
|
|
942
|
+
|
|
943
|
+
declare type ParseParams = {
|
|
944
|
+
path: (string | number)[];
|
|
945
|
+
errorMap: ZodErrorMap;
|
|
946
|
+
async: boolean;
|
|
947
|
+
};
|
|
948
|
+
declare type ParsePathComponent = string | number;
|
|
949
|
+
declare type ParsePath = ParsePathComponent[];
|
|
950
|
+
interface ParseContext {
|
|
951
|
+
readonly common: {
|
|
952
|
+
readonly issues: ZodIssue[];
|
|
953
|
+
readonly contextualErrorMap?: ZodErrorMap;
|
|
954
|
+
readonly async: boolean;
|
|
955
|
+
};
|
|
956
|
+
readonly path: ParsePath;
|
|
957
|
+
readonly schemaErrorMap?: ZodErrorMap;
|
|
958
|
+
readonly parent: ParseContext | null;
|
|
959
|
+
readonly data: any;
|
|
960
|
+
readonly parsedType: ZodParsedType;
|
|
961
|
+
}
|
|
962
|
+
declare type ParseInput = {
|
|
963
|
+
data: any;
|
|
964
|
+
path: (string | number)[];
|
|
965
|
+
parent: ParseContext;
|
|
966
|
+
};
|
|
967
|
+
declare class ParseStatus {
|
|
968
|
+
value: "aborted" | "dirty" | "valid";
|
|
969
|
+
dirty(): void;
|
|
970
|
+
abort(): void;
|
|
971
|
+
static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
|
|
972
|
+
static mergeObjectAsync(status: ParseStatus, pairs: {
|
|
973
|
+
key: ParseReturnType<any>;
|
|
974
|
+
value: ParseReturnType<any>;
|
|
975
|
+
}[]): Promise<SyncParseReturnType<any>>;
|
|
976
|
+
static mergeObjectSync(status: ParseStatus, pairs: {
|
|
977
|
+
key: SyncParseReturnType<any>;
|
|
978
|
+
value: SyncParseReturnType<any>;
|
|
979
|
+
alwaysSet?: boolean;
|
|
980
|
+
}[]): SyncParseReturnType;
|
|
981
|
+
}
|
|
982
|
+
declare type INVALID = {
|
|
983
|
+
status: "aborted";
|
|
984
|
+
};
|
|
985
|
+
declare const INVALID: INVALID;
|
|
986
|
+
declare type DIRTY<T> = {
|
|
987
|
+
status: "dirty";
|
|
988
|
+
value: T;
|
|
989
|
+
};
|
|
990
|
+
declare const DIRTY: <T>(value: T) => DIRTY<T>;
|
|
991
|
+
declare type OK<T> = {
|
|
992
|
+
status: "valid";
|
|
993
|
+
value: T;
|
|
994
|
+
};
|
|
995
|
+
declare const OK: <T>(value: T) => OK<T>;
|
|
996
|
+
declare type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
|
|
997
|
+
declare type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
|
|
998
|
+
declare type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
|
|
999
|
+
|
|
1000
|
+
declare namespace enumUtil {
|
|
1001
|
+
type UnionToIntersectionFn<T> = (T extends unknown ? (k: () => T) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
|
|
1002
|
+
type GetUnionLast<T> = UnionToIntersectionFn<T> extends () => infer Last ? Last : never;
|
|
1003
|
+
type UnionToTuple<T, Tuple extends unknown[] = []> = [T] extends [never] ? Tuple : UnionToTuple<Exclude<T, GetUnionLast<T>>, [GetUnionLast<T>, ...Tuple]>;
|
|
1004
|
+
type CastToStringTuple<T> = T extends [string, ...string[]] ? T : never;
|
|
1005
|
+
export type UnionToTupleString<T> = CastToStringTuple<UnionToTuple<T>>;
|
|
1006
|
+
export {};
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
declare namespace errorUtil {
|
|
1010
|
+
type ErrMessage = string | {
|
|
1011
|
+
message?: string;
|
|
1012
|
+
};
|
|
1013
|
+
const errToObj: (message?: ErrMessage | undefined) => {
|
|
1014
|
+
message?: string | undefined;
|
|
1015
|
+
};
|
|
1016
|
+
const toString: (message?: ErrMessage | undefined) => string | undefined;
|
|
1017
|
+
}
|
|
1018
|
+
|
|
1019
|
+
declare namespace partialUtil {
|
|
1020
|
+
type DeepPartial<T extends ZodTypeAny> = T extends ZodObject<ZodRawShape> ? ZodObject<{
|
|
1021
|
+
[k in keyof T["shape"]]: ZodOptional<DeepPartial<T["shape"][k]>>;
|
|
1022
|
+
}, T["_def"]["unknownKeys"], T["_def"]["catchall"]> : T extends ZodArray<infer Type, infer Card> ? ZodArray<DeepPartial<Type>, Card> : T extends ZodOptional<infer Type> ? ZodOptional<DeepPartial<Type>> : T extends ZodNullable<infer Type> ? ZodNullable<DeepPartial<Type>> : T extends ZodTuple<infer Items> ? {
|
|
1023
|
+
[k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial<Items[k]> : never;
|
|
1024
|
+
} extends infer PI ? PI extends ZodTupleItems ? ZodTuple<PI> : never : never : T;
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
declare type RefinementCtx = {
|
|
1028
|
+
addIssue: (arg: IssueData) => void;
|
|
1029
|
+
path: (string | number)[];
|
|
1030
|
+
};
|
|
1031
|
+
declare type ZodRawShape = {
|
|
1032
|
+
[k: string]: ZodTypeAny;
|
|
1033
|
+
};
|
|
1034
|
+
declare type ZodTypeAny = ZodType<any, any, any>;
|
|
1035
|
+
declare type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
|
|
1036
|
+
declare type input<T extends ZodType<any, any, any>> = T["_input"];
|
|
1037
|
+
declare type output<T extends ZodType<any, any, any>> = T["_output"];
|
|
1038
|
+
|
|
1039
|
+
declare type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
|
|
1040
|
+
interface ZodTypeDef {
|
|
1041
|
+
errorMap?: ZodErrorMap;
|
|
1042
|
+
description?: string;
|
|
1043
|
+
}
|
|
1044
|
+
declare type RawCreateParams = {
|
|
1045
|
+
errorMap?: ZodErrorMap;
|
|
1046
|
+
invalid_type_error?: string;
|
|
1047
|
+
required_error?: string;
|
|
1048
|
+
description?: string;
|
|
1049
|
+
} | undefined;
|
|
1050
|
+
declare type SafeParseSuccess<Output> = {
|
|
1051
|
+
success: true;
|
|
1052
|
+
data: Output;
|
|
1053
|
+
};
|
|
1054
|
+
declare type SafeParseError<Input> = {
|
|
1055
|
+
success: false;
|
|
1056
|
+
error: ZodError<Input>;
|
|
1057
|
+
};
|
|
1058
|
+
declare type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
|
|
1059
|
+
declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
|
|
1060
|
+
readonly _type: Output;
|
|
1061
|
+
readonly _output: Output;
|
|
1062
|
+
readonly _input: Input;
|
|
1063
|
+
readonly _def: Def;
|
|
1064
|
+
get description(): string | undefined;
|
|
1065
|
+
abstract _parse(input: ParseInput): ParseReturnType<Output>;
|
|
1066
|
+
_getType(input: ParseInput): string;
|
|
1067
|
+
_getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
|
|
1068
|
+
_processInputParams(input: ParseInput): {
|
|
1069
|
+
status: ParseStatus;
|
|
1070
|
+
ctx: ParseContext;
|
|
1071
|
+
};
|
|
1072
|
+
_parseSync(input: ParseInput): SyncParseReturnType<Output>;
|
|
1073
|
+
_parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
|
|
1074
|
+
parse(data: unknown, params?: Partial<ParseParams>): Output;
|
|
1075
|
+
safeParse(data: unknown, params?: Partial<ParseParams>): SafeParseReturnType<Input, Output>;
|
|
1076
|
+
parseAsync(data: unknown, params?: Partial<ParseParams>): Promise<Output>;
|
|
1077
|
+
safeParseAsync(data: unknown, params?: Partial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
|
|
1078
|
+
spa: (data: unknown, params?: Partial<ParseParams> | undefined) => Promise<SafeParseReturnType<Input, Output>>;
|
|
1079
|
+
refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
|
|
1080
|
+
refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
|
|
1081
|
+
refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
|
|
1082
|
+
refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
|
|
1083
|
+
_refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
|
|
1084
|
+
superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
|
|
1085
|
+
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
|
|
1086
|
+
constructor(def: Def);
|
|
1087
|
+
optional(): ZodOptional<this>;
|
|
1088
|
+
nullable(): ZodNullable<this>;
|
|
1089
|
+
nullish(): ZodOptional<ZodNullable<this>>;
|
|
1090
|
+
array(): ZodArray<this>;
|
|
1091
|
+
promise(): ZodPromise<this>;
|
|
1092
|
+
or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
|
|
1093
|
+
and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
|
|
1094
|
+
transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
|
|
1095
|
+
default(def: util.noUndefined<Input>): ZodDefault<this>;
|
|
1096
|
+
default(def: () => util.noUndefined<Input>): ZodDefault<this>;
|
|
1097
|
+
brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
|
|
1098
|
+
catch(def: Output): ZodCatch<this>;
|
|
1099
|
+
catch(def: (ctx: {
|
|
1100
|
+
error: ZodError;
|
|
1101
|
+
input: Input;
|
|
1102
|
+
}) => Output): ZodCatch<this>;
|
|
1103
|
+
describe(description: string): this;
|
|
1104
|
+
pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
|
|
1105
|
+
isOptional(): boolean;
|
|
1106
|
+
isNullable(): boolean;
|
|
1107
|
+
}
|
|
1108
|
+
declare type IpVersion = "v4" | "v6";
|
|
1109
|
+
declare type ZodStringCheck = {
|
|
1110
|
+
kind: "min";
|
|
1111
|
+
value: number;
|
|
1112
|
+
message?: string;
|
|
1113
|
+
} | {
|
|
1114
|
+
kind: "max";
|
|
1115
|
+
value: number;
|
|
1116
|
+
message?: string;
|
|
1117
|
+
} | {
|
|
1118
|
+
kind: "length";
|
|
1119
|
+
value: number;
|
|
1120
|
+
message?: string;
|
|
1121
|
+
} | {
|
|
1122
|
+
kind: "email";
|
|
1123
|
+
message?: string;
|
|
1124
|
+
} | {
|
|
1125
|
+
kind: "url";
|
|
1126
|
+
message?: string;
|
|
1127
|
+
} | {
|
|
1128
|
+
kind: "emoji";
|
|
1129
|
+
message?: string;
|
|
1130
|
+
} | {
|
|
1131
|
+
kind: "uuid";
|
|
1132
|
+
message?: string;
|
|
1133
|
+
} | {
|
|
1134
|
+
kind: "cuid";
|
|
1135
|
+
message?: string;
|
|
1136
|
+
} | {
|
|
1137
|
+
kind: "includes";
|
|
1138
|
+
value: string;
|
|
1139
|
+
position?: number;
|
|
1140
|
+
message?: string;
|
|
1141
|
+
} | {
|
|
1142
|
+
kind: "cuid2";
|
|
1143
|
+
message?: string;
|
|
1144
|
+
} | {
|
|
1145
|
+
kind: "ulid";
|
|
1146
|
+
message?: string;
|
|
1147
|
+
} | {
|
|
1148
|
+
kind: "startsWith";
|
|
1149
|
+
value: string;
|
|
1150
|
+
message?: string;
|
|
1151
|
+
} | {
|
|
1152
|
+
kind: "endsWith";
|
|
1153
|
+
value: string;
|
|
1154
|
+
message?: string;
|
|
1155
|
+
} | {
|
|
1156
|
+
kind: "regex";
|
|
1157
|
+
regex: RegExp;
|
|
1158
|
+
message?: string;
|
|
1159
|
+
} | {
|
|
1160
|
+
kind: "trim";
|
|
1161
|
+
message?: string;
|
|
1162
|
+
} | {
|
|
1163
|
+
kind: "toLowerCase";
|
|
1164
|
+
message?: string;
|
|
1165
|
+
} | {
|
|
1166
|
+
kind: "toUpperCase";
|
|
1167
|
+
message?: string;
|
|
1168
|
+
} | {
|
|
1169
|
+
kind: "datetime";
|
|
1170
|
+
offset: boolean;
|
|
1171
|
+
precision: number | null;
|
|
1172
|
+
message?: string;
|
|
1173
|
+
} | {
|
|
1174
|
+
kind: "ip";
|
|
1175
|
+
version?: IpVersion;
|
|
1176
|
+
message?: string;
|
|
1177
|
+
};
|
|
1178
|
+
interface ZodStringDef extends ZodTypeDef {
|
|
1179
|
+
checks: ZodStringCheck[];
|
|
1180
|
+
typeName: ZodFirstPartyTypeKind.ZodString;
|
|
1181
|
+
coerce: boolean;
|
|
1182
|
+
}
|
|
1183
|
+
declare class ZodString extends ZodType<string, ZodStringDef> {
|
|
1184
|
+
_parse(input: ParseInput): ParseReturnType<string>;
|
|
1185
|
+
protected _regex: (regex: RegExp, validation: StringValidation, message?: errorUtil.ErrMessage | undefined) => ZodEffects<this, string, string>;
|
|
1186
|
+
_addCheck(check: ZodStringCheck): ZodString;
|
|
1187
|
+
email(message?: errorUtil.ErrMessage): ZodString;
|
|
1188
|
+
url(message?: errorUtil.ErrMessage): ZodString;
|
|
1189
|
+
emoji(message?: errorUtil.ErrMessage): ZodString;
|
|
1190
|
+
uuid(message?: errorUtil.ErrMessage): ZodString;
|
|
1191
|
+
cuid(message?: errorUtil.ErrMessage): ZodString;
|
|
1192
|
+
cuid2(message?: errorUtil.ErrMessage): ZodString;
|
|
1193
|
+
ulid(message?: errorUtil.ErrMessage): ZodString;
|
|
1194
|
+
ip(options?: string | {
|
|
1195
|
+
version?: "v4" | "v6";
|
|
1196
|
+
message?: string;
|
|
1197
|
+
}): ZodString;
|
|
1198
|
+
datetime(options?: string | {
|
|
1199
|
+
message?: string | undefined;
|
|
1200
|
+
precision?: number | null;
|
|
1201
|
+
offset?: boolean;
|
|
1202
|
+
}): ZodString;
|
|
1203
|
+
regex(regex: RegExp, message?: errorUtil.ErrMessage): ZodString;
|
|
1204
|
+
includes(value: string, options?: {
|
|
1205
|
+
message?: string;
|
|
1206
|
+
position?: number;
|
|
1207
|
+
}): ZodString;
|
|
1208
|
+
startsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
|
1209
|
+
endsWith(value: string, message?: errorUtil.ErrMessage): ZodString;
|
|
1210
|
+
min(minLength: number, message?: errorUtil.ErrMessage): ZodString;
|
|
1211
|
+
max(maxLength: number, message?: errorUtil.ErrMessage): ZodString;
|
|
1212
|
+
length(len: number, message?: errorUtil.ErrMessage): ZodString;
|
|
1213
|
+
nonempty: (message?: errorUtil.ErrMessage | undefined) => ZodString;
|
|
1214
|
+
trim: () => ZodString;
|
|
1215
|
+
toLowerCase: () => ZodString;
|
|
1216
|
+
toUpperCase: () => ZodString;
|
|
1217
|
+
get isDatetime(): boolean;
|
|
1218
|
+
get isEmail(): boolean;
|
|
1219
|
+
get isURL(): boolean;
|
|
1220
|
+
get isEmoji(): boolean;
|
|
1221
|
+
get isUUID(): boolean;
|
|
1222
|
+
get isCUID(): boolean;
|
|
1223
|
+
get isCUID2(): boolean;
|
|
1224
|
+
get isULID(): boolean;
|
|
1225
|
+
get isIP(): boolean;
|
|
1226
|
+
get minLength(): number | null;
|
|
1227
|
+
get maxLength(): number | null;
|
|
1228
|
+
static create: (params?: ({
|
|
1229
|
+
errorMap?: ZodErrorMap | undefined;
|
|
1230
|
+
invalid_type_error?: string | undefined;
|
|
1231
|
+
required_error?: string | undefined;
|
|
1232
|
+
description?: string | undefined;
|
|
1233
|
+
} & {
|
|
1234
|
+
coerce?: true | undefined;
|
|
1235
|
+
}) | undefined) => ZodString;
|
|
1236
|
+
}
|
|
1237
|
+
declare type ZodNumberCheck = {
|
|
1238
|
+
kind: "min";
|
|
1239
|
+
value: number;
|
|
1240
|
+
inclusive: boolean;
|
|
1241
|
+
message?: string;
|
|
1242
|
+
} | {
|
|
1243
|
+
kind: "max";
|
|
1244
|
+
value: number;
|
|
1245
|
+
inclusive: boolean;
|
|
1246
|
+
message?: string;
|
|
1247
|
+
} | {
|
|
1248
|
+
kind: "int";
|
|
1249
|
+
message?: string;
|
|
1250
|
+
} | {
|
|
1251
|
+
kind: "multipleOf";
|
|
1252
|
+
value: number;
|
|
1253
|
+
message?: string;
|
|
1254
|
+
} | {
|
|
1255
|
+
kind: "finite";
|
|
1256
|
+
message?: string;
|
|
1257
|
+
};
|
|
1258
|
+
interface ZodNumberDef extends ZodTypeDef {
|
|
1259
|
+
checks: ZodNumberCheck[];
|
|
1260
|
+
typeName: ZodFirstPartyTypeKind.ZodNumber;
|
|
1261
|
+
coerce: boolean;
|
|
1262
|
+
}
|
|
1263
|
+
declare class ZodNumber extends ZodType<number, ZodNumberDef> {
|
|
1264
|
+
_parse(input: ParseInput): ParseReturnType<number>;
|
|
1265
|
+
static create: (params?: ({
|
|
1266
|
+
errorMap?: ZodErrorMap | undefined;
|
|
1267
|
+
invalid_type_error?: string | undefined;
|
|
1268
|
+
required_error?: string | undefined;
|
|
1269
|
+
description?: string | undefined;
|
|
1270
|
+
} & {
|
|
1271
|
+
coerce?: boolean | undefined;
|
|
1272
|
+
}) | undefined) => ZodNumber;
|
|
1273
|
+
gte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
1274
|
+
min: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
|
|
1275
|
+
gt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
1276
|
+
lte(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
1277
|
+
max: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
|
|
1278
|
+
lt(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
1279
|
+
protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber;
|
|
1280
|
+
_addCheck(check: ZodNumberCheck): ZodNumber;
|
|
1281
|
+
int(message?: errorUtil.ErrMessage): ZodNumber;
|
|
1282
|
+
positive(message?: errorUtil.ErrMessage): ZodNumber;
|
|
1283
|
+
negative(message?: errorUtil.ErrMessage): ZodNumber;
|
|
1284
|
+
nonpositive(message?: errorUtil.ErrMessage): ZodNumber;
|
|
1285
|
+
nonnegative(message?: errorUtil.ErrMessage): ZodNumber;
|
|
1286
|
+
multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber;
|
|
1287
|
+
step: (value: number, message?: errorUtil.ErrMessage | undefined) => ZodNumber;
|
|
1288
|
+
finite(message?: errorUtil.ErrMessage): ZodNumber;
|
|
1289
|
+
safe(message?: errorUtil.ErrMessage): ZodNumber;
|
|
1290
|
+
get minValue(): number | null;
|
|
1291
|
+
get maxValue(): number | null;
|
|
1292
|
+
get isInt(): boolean;
|
|
1293
|
+
get isFinite(): boolean;
|
|
1294
|
+
}
|
|
1295
|
+
interface ZodBooleanDef extends ZodTypeDef {
|
|
1296
|
+
typeName: ZodFirstPartyTypeKind.ZodBoolean;
|
|
1297
|
+
coerce: boolean;
|
|
1298
|
+
}
|
|
1299
|
+
declare class ZodBoolean extends ZodType<boolean, ZodBooleanDef> {
|
|
1300
|
+
_parse(input: ParseInput): ParseReturnType<boolean>;
|
|
1301
|
+
static create: (params?: ({
|
|
1302
|
+
errorMap?: ZodErrorMap | undefined;
|
|
1303
|
+
invalid_type_error?: string | undefined;
|
|
1304
|
+
required_error?: string | undefined;
|
|
1305
|
+
description?: string | undefined;
|
|
1306
|
+
} & {
|
|
1307
|
+
coerce?: boolean | undefined;
|
|
1308
|
+
}) | undefined) => ZodBoolean;
|
|
1309
|
+
}
|
|
1310
|
+
interface ZodUnknownDef extends ZodTypeDef {
|
|
1311
|
+
typeName: ZodFirstPartyTypeKind.ZodUnknown;
|
|
1312
|
+
}
|
|
1313
|
+
declare class ZodUnknown extends ZodType<unknown, ZodUnknownDef> {
|
|
1314
|
+
_unknown: true;
|
|
1315
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1316
|
+
static create: (params?: RawCreateParams) => ZodUnknown;
|
|
1317
|
+
}
|
|
1318
|
+
interface ZodVoidDef extends ZodTypeDef {
|
|
1319
|
+
typeName: ZodFirstPartyTypeKind.ZodVoid;
|
|
1320
|
+
}
|
|
1321
|
+
declare class ZodVoid extends ZodType<void, ZodVoidDef> {
|
|
1322
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1323
|
+
static create: (params?: RawCreateParams) => ZodVoid;
|
|
1324
|
+
}
|
|
1325
|
+
interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1326
|
+
type: T;
|
|
1327
|
+
typeName: ZodFirstPartyTypeKind.ZodArray;
|
|
1328
|
+
exactLength: {
|
|
1329
|
+
value: number;
|
|
1330
|
+
message?: string;
|
|
1331
|
+
} | null;
|
|
1332
|
+
minLength: {
|
|
1333
|
+
value: number;
|
|
1334
|
+
message?: string;
|
|
1335
|
+
} | null;
|
|
1336
|
+
maxLength: {
|
|
1337
|
+
value: number;
|
|
1338
|
+
message?: string;
|
|
1339
|
+
} | null;
|
|
1340
|
+
}
|
|
1341
|
+
declare type ArrayCardinality = "many" | "atleastone";
|
|
1342
|
+
declare type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
|
|
1343
|
+
declare class ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> extends ZodType<arrayOutputType<T, Cardinality>, ZodArrayDef<T>, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> {
|
|
1344
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1345
|
+
get element(): T;
|
|
1346
|
+
min(minLength: number, message?: errorUtil.ErrMessage): this;
|
|
1347
|
+
max(maxLength: number, message?: errorUtil.ErrMessage): this;
|
|
1348
|
+
length(len: number, message?: errorUtil.ErrMessage): this;
|
|
1349
|
+
nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
|
|
1350
|
+
static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodArray<T_1, "many">;
|
|
1351
|
+
}
|
|
1352
|
+
declare type UnknownKeysParam = "passthrough" | "strict" | "strip";
|
|
1353
|
+
interface ZodObjectDef<T extends ZodRawShape = ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1354
|
+
typeName: ZodFirstPartyTypeKind.ZodObject;
|
|
1355
|
+
shape: () => T;
|
|
1356
|
+
catchall: Catchall;
|
|
1357
|
+
unknownKeys: UnknownKeys;
|
|
1358
|
+
}
|
|
1359
|
+
declare type objectOutputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<objectUtil.addQuestionMarks<baseObjectOutputType<Shape>>> & CatchallOutput<Catchall> & PassthroughType<UnknownKeys>;
|
|
1360
|
+
declare type baseObjectOutputType<Shape extends ZodRawShape> = {
|
|
1361
|
+
[k in keyof Shape]: Shape[k]["_output"];
|
|
1362
|
+
};
|
|
1363
|
+
declare type objectInputType<Shape extends ZodRawShape, Catchall extends ZodTypeAny, UnknownKeys extends UnknownKeysParam = UnknownKeysParam> = objectUtil.flatten<baseObjectInputType<Shape>> & CatchallInput<Catchall> & PassthroughType<UnknownKeys>;
|
|
1364
|
+
declare type baseObjectInputType<Shape extends ZodRawShape> = objectUtil.addQuestionMarks<{
|
|
1365
|
+
[k in keyof Shape]: Shape[k]["_input"];
|
|
1366
|
+
}>;
|
|
1367
|
+
declare type CatchallOutput<T extends ZodTypeAny> = ZodTypeAny extends T ? unknown : {
|
|
1368
|
+
[k: string]: T["_output"];
|
|
1369
|
+
};
|
|
1370
|
+
declare type CatchallInput<T extends ZodTypeAny> = ZodTypeAny extends T ? unknown : {
|
|
1371
|
+
[k: string]: T["_input"];
|
|
1372
|
+
};
|
|
1373
|
+
declare type PassthroughType<T extends UnknownKeysParam> = T extends "passthrough" ? {
|
|
1374
|
+
[k: string]: unknown;
|
|
1375
|
+
} : unknown;
|
|
1376
|
+
declare type deoptional<T extends ZodTypeAny> = T extends ZodOptional<infer U> ? deoptional<U> : T extends ZodNullable<infer U> ? ZodNullable<deoptional<U>> : T;
|
|
1377
|
+
declare class ZodObject<T extends ZodRawShape, UnknownKeys extends UnknownKeysParam = UnknownKeysParam, Catchall extends ZodTypeAny = ZodTypeAny, Output = objectOutputType<T, Catchall, UnknownKeys>, Input = objectInputType<T, Catchall, UnknownKeys>> extends ZodType<Output, ZodObjectDef<T, UnknownKeys, Catchall>, Input> {
|
|
1378
|
+
private _cached;
|
|
1379
|
+
_getCached(): {
|
|
1380
|
+
shape: T;
|
|
1381
|
+
keys: string[];
|
|
1382
|
+
};
|
|
1383
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1384
|
+
get shape(): T;
|
|
1385
|
+
strict(message?: errorUtil.ErrMessage): ZodObject<T, "strict", Catchall>;
|
|
1386
|
+
strip(): ZodObject<T, "strip", Catchall>;
|
|
1387
|
+
passthrough(): ZodObject<T, "passthrough", Catchall>;
|
|
1388
|
+
nonstrict: () => ZodObject<T, "passthrough", Catchall>;
|
|
1389
|
+
extend<Augmentation extends ZodRawShape>(augmentation: Augmentation): ZodObject<objectUtil.extendShape<T, Augmentation>, UnknownKeys, Catchall>;
|
|
1390
|
+
augment: <Augmentation extends ZodRawShape>(augmentation: Augmentation) => ZodObject<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, UnknownKeys, Catchall, objectOutputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall, UnknownKeys>, objectInputType<{ [k in keyof (Omit<T, keyof Augmentation> & Augmentation)]: (Omit<T, keyof Augmentation> & Augmentation)[k]; }, Catchall, UnknownKeys>>;
|
|
1391
|
+
merge<Incoming extends AnyZodObject, Augmentation extends Incoming["shape"]>(merging: Incoming): ZodObject<objectUtil.extendShape<T, Augmentation>, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>;
|
|
1392
|
+
setKey<Key extends string, Schema extends ZodTypeAny>(key: Key, schema: Schema): ZodObject<T & {
|
|
1393
|
+
[k in Key]: Schema;
|
|
1394
|
+
}, UnknownKeys, Catchall>;
|
|
1395
|
+
catchall<Index extends ZodTypeAny>(index: Index): ZodObject<T, UnknownKeys, Index>;
|
|
1396
|
+
pick<Mask extends {
|
|
1397
|
+
[k in keyof T]?: true;
|
|
1398
|
+
}>(mask: Mask): ZodObject<Pick<T, Extract<keyof T, keyof Mask>>, UnknownKeys, Catchall>;
|
|
1399
|
+
omit<Mask extends {
|
|
1400
|
+
[k in keyof T]?: true;
|
|
1401
|
+
}>(mask: Mask): ZodObject<Omit<T, keyof Mask>, UnknownKeys, Catchall>;
|
|
1402
|
+
deepPartial(): partialUtil.DeepPartial<this>;
|
|
1403
|
+
partial(): ZodObject<{
|
|
1404
|
+
[k in keyof T]: ZodOptional<T[k]>;
|
|
1405
|
+
}, UnknownKeys, Catchall>;
|
|
1406
|
+
partial<Mask extends {
|
|
1407
|
+
[k in keyof T]?: true;
|
|
1408
|
+
}>(mask: Mask): ZodObject<objectUtil.noNever<{
|
|
1409
|
+
[k in keyof T]: k extends keyof Mask ? ZodOptional<T[k]> : T[k];
|
|
1410
|
+
}>, UnknownKeys, Catchall>;
|
|
1411
|
+
required(): ZodObject<{
|
|
1412
|
+
[k in keyof T]: deoptional<T[k]>;
|
|
1413
|
+
}, UnknownKeys, Catchall>;
|
|
1414
|
+
required<Mask extends {
|
|
1415
|
+
[k in keyof T]?: true;
|
|
1416
|
+
}>(mask: Mask): ZodObject<objectUtil.noNever<{
|
|
1417
|
+
[k in keyof T]: k extends keyof Mask ? deoptional<T[k]> : T[k];
|
|
1418
|
+
}>, UnknownKeys, Catchall>;
|
|
1419
|
+
keyof(): ZodEnum<enumUtil.UnionToTupleString<keyof T>>;
|
|
1420
|
+
static create: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>;
|
|
1421
|
+
static strictCreate: <T_1 extends ZodRawShape>(shape: T_1, params?: RawCreateParams) => ZodObject<T_1, "strict", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>;
|
|
1422
|
+
static lazycreate: <T_1 extends ZodRawShape>(shape: () => T_1, params?: RawCreateParams) => ZodObject<T_1, "strip", ZodTypeAny, { [k_1 in keyof objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>]: objectUtil.addQuestionMarks<baseObjectOutputType<T_1>, { [k in keyof baseObjectOutputType<T_1>]: undefined extends baseObjectOutputType<T_1>[k] ? never : k; }[keyof T_1]>[k_1]; }, { [k_2 in keyof baseObjectInputType<T_1>]: baseObjectInputType<T_1>[k_2]; }>;
|
|
1423
|
+
}
|
|
1424
|
+
declare type AnyZodObject = ZodObject<any, any, any>;
|
|
1425
|
+
declare type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
|
|
1426
|
+
interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[
|
|
1427
|
+
ZodTypeAny,
|
|
1428
|
+
ZodTypeAny,
|
|
1429
|
+
...ZodTypeAny[]
|
|
1430
|
+
]>> extends ZodTypeDef {
|
|
1431
|
+
options: T;
|
|
1432
|
+
typeName: ZodFirstPartyTypeKind.ZodUnion;
|
|
1433
|
+
}
|
|
1434
|
+
declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
|
|
1435
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1436
|
+
get options(): T;
|
|
1437
|
+
static create: <T_1 extends readonly [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>(types: T_1, params?: RawCreateParams) => ZodUnion<T_1>;
|
|
1438
|
+
}
|
|
1439
|
+
interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1440
|
+
left: T;
|
|
1441
|
+
right: U;
|
|
1442
|
+
typeName: ZodFirstPartyTypeKind.ZodIntersection;
|
|
1443
|
+
}
|
|
1444
|
+
declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
|
|
1445
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1446
|
+
static create: <T_1 extends ZodTypeAny, U_1 extends ZodTypeAny>(left: T_1, right: U_1, params?: RawCreateParams) => ZodIntersection<T_1, U_1>;
|
|
1447
|
+
}
|
|
1448
|
+
declare type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
|
|
1449
|
+
declare type AssertArray<T> = T extends any[] ? T : never;
|
|
1450
|
+
declare type OutputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
|
1451
|
+
[k in keyof T]: T[k] extends ZodType<any, any> ? T[k]["_output"] : never;
|
|
1452
|
+
}>;
|
|
1453
|
+
declare type OutputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...OutputTypeOfTuple<T>, ...Rest["_output"][]] : OutputTypeOfTuple<T>;
|
|
1454
|
+
declare type InputTypeOfTuple<T extends ZodTupleItems | []> = AssertArray<{
|
|
1455
|
+
[k in keyof T]: T[k] extends ZodType<any, any> ? T[k]["_input"] : never;
|
|
1456
|
+
}>;
|
|
1457
|
+
declare type InputTypeOfTupleWithRest<T extends ZodTupleItems | [], Rest extends ZodTypeAny | null = null> = Rest extends ZodTypeAny ? [...InputTypeOfTuple<T>, ...Rest["_input"][]] : InputTypeOfTuple<T>;
|
|
1458
|
+
interface ZodTupleDef<T extends ZodTupleItems | [] = ZodTupleItems, Rest extends ZodTypeAny | null = null> extends ZodTypeDef {
|
|
1459
|
+
items: T;
|
|
1460
|
+
rest: Rest;
|
|
1461
|
+
typeName: ZodFirstPartyTypeKind.ZodTuple;
|
|
1462
|
+
}
|
|
1463
|
+
declare type AnyZodTuple = ZodTuple<[
|
|
1464
|
+
ZodTypeAny,
|
|
1465
|
+
...ZodTypeAny[]
|
|
1466
|
+
] | [], ZodTypeAny | null>;
|
|
1467
|
+
declare class ZodTuple<T extends [ZodTypeAny, ...ZodTypeAny[]] | [] = [ZodTypeAny, ...ZodTypeAny[]], Rest extends ZodTypeAny | null = null> extends ZodType<OutputTypeOfTupleWithRest<T, Rest>, ZodTupleDef<T, Rest>, InputTypeOfTupleWithRest<T, Rest>> {
|
|
1468
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1469
|
+
get items(): T;
|
|
1470
|
+
rest<Rest extends ZodTypeAny>(rest: Rest): ZodTuple<T, Rest>;
|
|
1471
|
+
static create: <T_1 extends [] | [ZodTypeAny, ...ZodTypeAny[]]>(schemas: T_1, params?: RawCreateParams) => ZodTuple<T_1, null>;
|
|
1472
|
+
}
|
|
1473
|
+
interface ZodFunctionDef<Args extends ZodTuple<any, any> = ZodTuple<any, any>, Returns extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1474
|
+
args: Args;
|
|
1475
|
+
returns: Returns;
|
|
1476
|
+
typeName: ZodFirstPartyTypeKind.ZodFunction;
|
|
1477
|
+
}
|
|
1478
|
+
declare type OuterTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_input"] extends Array<any> ? (...args: Args["_input"]) => Returns["_output"] : never;
|
|
1479
|
+
declare type InnerTypeOfFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> = Args["_output"] extends Array<any> ? (...args: Args["_output"]) => Returns["_input"] : never;
|
|
1480
|
+
declare class ZodFunction<Args extends ZodTuple<any, any>, Returns extends ZodTypeAny> extends ZodType<OuterTypeOfFunction<Args, Returns>, ZodFunctionDef<Args, Returns>, InnerTypeOfFunction<Args, Returns>> {
|
|
1481
|
+
_parse(input: ParseInput): ParseReturnType<any>;
|
|
1482
|
+
parameters(): Args;
|
|
1483
|
+
returnType(): Returns;
|
|
1484
|
+
args<Items extends Parameters<(typeof ZodTuple)["create"]>[0]>(...items: Items): ZodFunction<ZodTuple<Items, ZodUnknown>, Returns>;
|
|
1485
|
+
returns<NewReturnType extends ZodType<any, any>>(returnType: NewReturnType): ZodFunction<Args, NewReturnType>;
|
|
1486
|
+
implement<F extends InnerTypeOfFunction<Args, Returns>>(func: F): ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
|
|
1487
|
+
strictImplement(func: InnerTypeOfFunction<Args, Returns>): InnerTypeOfFunction<Args, Returns>;
|
|
1488
|
+
validate: <F extends InnerTypeOfFunction<Args, Returns>>(func: F) => ReturnType<F> extends Returns["_output"] ? (...args: Args["_input"]) => ReturnType<F> : OuterTypeOfFunction<Args, Returns>;
|
|
1489
|
+
static create(): ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>;
|
|
1490
|
+
static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>>(args: T): ZodFunction<T, ZodUnknown>;
|
|
1491
|
+
static create<T extends AnyZodTuple, U extends ZodTypeAny>(args: T, returns: U): ZodFunction<T, U>;
|
|
1492
|
+
static create<T extends AnyZodTuple = ZodTuple<[], ZodUnknown>, U extends ZodTypeAny = ZodUnknown>(args: T, returns: U, params?: RawCreateParams): ZodFunction<T, U>;
|
|
1493
|
+
}
|
|
1494
|
+
interface ZodLiteralDef<T = any> extends ZodTypeDef {
|
|
1495
|
+
value: T;
|
|
1496
|
+
typeName: ZodFirstPartyTypeKind.ZodLiteral;
|
|
1497
|
+
}
|
|
1498
|
+
declare class ZodLiteral<T> extends ZodType<T, ZodLiteralDef<T>> {
|
|
1499
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1500
|
+
get value(): T;
|
|
1501
|
+
static create: <T_1 extends Primitive>(value: T_1, params?: RawCreateParams) => ZodLiteral<T_1>;
|
|
1502
|
+
}
|
|
1503
|
+
declare type EnumValues = [string, ...string[]];
|
|
1504
|
+
declare type Values<T extends EnumValues> = {
|
|
1505
|
+
[k in T[number]]: k;
|
|
1506
|
+
};
|
|
1507
|
+
interface ZodEnumDef<T extends EnumValues = EnumValues> extends ZodTypeDef {
|
|
1508
|
+
values: T;
|
|
1509
|
+
typeName: ZodFirstPartyTypeKind.ZodEnum;
|
|
1510
|
+
}
|
|
1511
|
+
declare type Writeable<T> = {
|
|
1512
|
+
-readonly [P in keyof T]: T[P];
|
|
1513
|
+
};
|
|
1514
|
+
declare type FilterEnum<Values, ToExclude> = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum<Rest, ToExclude> : [Head, ...FilterEnum<Rest, ToExclude>] : never;
|
|
1515
|
+
declare type typecast<A, T> = A extends T ? A : never;
|
|
1516
|
+
declare function createZodEnum<U extends string, T extends Readonly<[U, ...U[]]>>(values: T, params?: RawCreateParams): ZodEnum<Writeable<T>>;
|
|
1517
|
+
declare function createZodEnum<U extends string, T extends [U, ...U[]]>(values: T, params?: RawCreateParams): ZodEnum<T>;
|
|
1518
|
+
declare class ZodEnum<T extends [string, ...string[]]> extends ZodType<T[number], ZodEnumDef<T>> {
|
|
1519
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1520
|
+
get options(): T;
|
|
1521
|
+
get enum(): Values<T>;
|
|
1522
|
+
get Values(): Values<T>;
|
|
1523
|
+
get Enum(): Values<T>;
|
|
1524
|
+
extract<ToExtract extends readonly [T[number], ...T[number][]]>(values: ToExtract): ZodEnum<Writeable<ToExtract>>;
|
|
1525
|
+
exclude<ToExclude extends readonly [T[number], ...T[number][]]>(values: ToExclude): ZodEnum<typecast<Writeable<FilterEnum<T, ToExclude[number]>>, [string, ...string[]]>>;
|
|
1526
|
+
static create: typeof createZodEnum;
|
|
1527
|
+
}
|
|
1528
|
+
interface ZodNativeEnumDef<T extends EnumLike = EnumLike> extends ZodTypeDef {
|
|
1529
|
+
values: T;
|
|
1530
|
+
typeName: ZodFirstPartyTypeKind.ZodNativeEnum;
|
|
1531
|
+
}
|
|
1532
|
+
declare type EnumLike = {
|
|
1533
|
+
[k: string]: string | number;
|
|
1534
|
+
[nu: number]: string;
|
|
1535
|
+
};
|
|
1536
|
+
declare class ZodNativeEnum<T extends EnumLike> extends ZodType<T[keyof T], ZodNativeEnumDef<T>> {
|
|
1537
|
+
_parse(input: ParseInput): ParseReturnType<T[keyof T]>;
|
|
1538
|
+
get enum(): T;
|
|
1539
|
+
static create: <T_1 extends EnumLike>(values: T_1, params?: RawCreateParams) => ZodNativeEnum<T_1>;
|
|
1540
|
+
}
|
|
1541
|
+
interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1542
|
+
type: T;
|
|
1543
|
+
typeName: ZodFirstPartyTypeKind.ZodPromise;
|
|
1544
|
+
}
|
|
1545
|
+
declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
|
|
1546
|
+
unwrap(): T;
|
|
1547
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1548
|
+
static create: <T_1 extends ZodTypeAny>(schema: T_1, params?: RawCreateParams) => ZodPromise<T_1>;
|
|
1549
|
+
}
|
|
1550
|
+
declare type RefinementEffect<T> = {
|
|
1551
|
+
type: "refinement";
|
|
1552
|
+
refinement: (arg: T, ctx: RefinementCtx) => any;
|
|
1553
|
+
};
|
|
1554
|
+
declare type TransformEffect<T> = {
|
|
1555
|
+
type: "transform";
|
|
1556
|
+
transform: (arg: T, ctx: RefinementCtx) => any;
|
|
1557
|
+
};
|
|
1558
|
+
declare type PreprocessEffect<T> = {
|
|
1559
|
+
type: "preprocess";
|
|
1560
|
+
transform: (arg: T) => any;
|
|
1561
|
+
};
|
|
1562
|
+
declare type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
|
|
1563
|
+
interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1564
|
+
schema: T;
|
|
1565
|
+
typeName: ZodFirstPartyTypeKind.ZodEffects;
|
|
1566
|
+
effect: Effect<any>;
|
|
1567
|
+
}
|
|
1568
|
+
declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
|
|
1569
|
+
innerType(): T;
|
|
1570
|
+
sourceType(): T;
|
|
1571
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1572
|
+
static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"], input<I>>;
|
|
1573
|
+
static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1577
|
+
innerType: T;
|
|
1578
|
+
typeName: ZodFirstPartyTypeKind.ZodOptional;
|
|
1579
|
+
}
|
|
1580
|
+
declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
|
|
1581
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1582
|
+
unwrap(): T;
|
|
1583
|
+
static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodOptional<T_1>;
|
|
1584
|
+
}
|
|
1585
|
+
interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1586
|
+
innerType: T;
|
|
1587
|
+
typeName: ZodFirstPartyTypeKind.ZodNullable;
|
|
1588
|
+
}
|
|
1589
|
+
declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
|
|
1590
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1591
|
+
unwrap(): T;
|
|
1592
|
+
static create: <T_1 extends ZodTypeAny>(type: T_1, params?: RawCreateParams) => ZodNullable<T_1>;
|
|
1593
|
+
}
|
|
1594
|
+
interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1595
|
+
innerType: T;
|
|
1596
|
+
defaultValue: () => util.noUndefined<T["_input"]>;
|
|
1597
|
+
typeName: ZodFirstPartyTypeKind.ZodDefault;
|
|
1598
|
+
}
|
|
1599
|
+
declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
|
|
1600
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1601
|
+
removeDefault(): T;
|
|
1602
|
+
static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
|
|
1603
|
+
errorMap?: ZodErrorMap | undefined;
|
|
1604
|
+
invalid_type_error?: string | undefined;
|
|
1605
|
+
required_error?: string | undefined;
|
|
1606
|
+
description?: string | undefined;
|
|
1607
|
+
} & {
|
|
1608
|
+
default: T_1["_input"] | (() => util.noUndefined<T_1["_input"]>);
|
|
1609
|
+
}) => ZodDefault<T_1>;
|
|
1610
|
+
}
|
|
1611
|
+
interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
1612
|
+
innerType: T;
|
|
1613
|
+
catchValue: (ctx: {
|
|
1614
|
+
error: ZodError;
|
|
1615
|
+
input: unknown;
|
|
1616
|
+
}) => T["_input"];
|
|
1617
|
+
typeName: ZodFirstPartyTypeKind.ZodCatch;
|
|
1618
|
+
}
|
|
1619
|
+
declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
|
|
1620
|
+
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
1621
|
+
removeCatch(): T;
|
|
1622
|
+
static create: <T_1 extends ZodTypeAny>(type: T_1, params: {
|
|
1623
|
+
errorMap?: ZodErrorMap | undefined;
|
|
1624
|
+
invalid_type_error?: string | undefined;
|
|
1625
|
+
required_error?: string | undefined;
|
|
1626
|
+
description?: string | undefined;
|
|
1627
|
+
} & {
|
|
1628
|
+
catch: T_1["_output"] | (() => T_1["_output"]);
|
|
1629
|
+
}) => ZodCatch<T_1>;
|
|
1630
|
+
}
|
|
1631
|
+
interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
|
|
1632
|
+
type: T;
|
|
1633
|
+
typeName: ZodFirstPartyTypeKind.ZodBranded;
|
|
1634
|
+
}
|
|
1635
|
+
declare const BRAND: unique symbol;
|
|
1636
|
+
declare type BRAND<T extends string | number | symbol> = {
|
|
1637
|
+
[BRAND]: {
|
|
1638
|
+
[k in T]: true;
|
|
1639
|
+
};
|
|
1640
|
+
};
|
|
1641
|
+
declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
|
|
1642
|
+
_parse(input: ParseInput): ParseReturnType<any>;
|
|
1643
|
+
unwrap(): T;
|
|
1644
|
+
}
|
|
1645
|
+
interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
|
|
1646
|
+
in: A;
|
|
1647
|
+
out: B;
|
|
1648
|
+
typeName: ZodFirstPartyTypeKind.ZodPipeline;
|
|
1649
|
+
}
|
|
1650
|
+
declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
|
|
1651
|
+
_parse(input: ParseInput): ParseReturnType<any>;
|
|
1652
|
+
static create<A extends ZodTypeAny, B extends ZodTypeAny>(a: A, b: B): ZodPipeline<A, B>;
|
|
1653
|
+
}
|
|
1654
|
+
declare enum ZodFirstPartyTypeKind {
|
|
1655
|
+
ZodString = "ZodString",
|
|
1656
|
+
ZodNumber = "ZodNumber",
|
|
1657
|
+
ZodNaN = "ZodNaN",
|
|
1658
|
+
ZodBigInt = "ZodBigInt",
|
|
1659
|
+
ZodBoolean = "ZodBoolean",
|
|
1660
|
+
ZodDate = "ZodDate",
|
|
1661
|
+
ZodSymbol = "ZodSymbol",
|
|
1662
|
+
ZodUndefined = "ZodUndefined",
|
|
1663
|
+
ZodNull = "ZodNull",
|
|
1664
|
+
ZodAny = "ZodAny",
|
|
1665
|
+
ZodUnknown = "ZodUnknown",
|
|
1666
|
+
ZodNever = "ZodNever",
|
|
1667
|
+
ZodVoid = "ZodVoid",
|
|
1668
|
+
ZodArray = "ZodArray",
|
|
1669
|
+
ZodObject = "ZodObject",
|
|
1670
|
+
ZodUnion = "ZodUnion",
|
|
1671
|
+
ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
|
|
1672
|
+
ZodIntersection = "ZodIntersection",
|
|
1673
|
+
ZodTuple = "ZodTuple",
|
|
1674
|
+
ZodRecord = "ZodRecord",
|
|
1675
|
+
ZodMap = "ZodMap",
|
|
1676
|
+
ZodSet = "ZodSet",
|
|
1677
|
+
ZodFunction = "ZodFunction",
|
|
1678
|
+
ZodLazy = "ZodLazy",
|
|
1679
|
+
ZodLiteral = "ZodLiteral",
|
|
1680
|
+
ZodEnum = "ZodEnum",
|
|
1681
|
+
ZodEffects = "ZodEffects",
|
|
1682
|
+
ZodNativeEnum = "ZodNativeEnum",
|
|
1683
|
+
ZodOptional = "ZodOptional",
|
|
1684
|
+
ZodNullable = "ZodNullable",
|
|
1685
|
+
ZodDefault = "ZodDefault",
|
|
1686
|
+
ZodCatch = "ZodCatch",
|
|
1687
|
+
ZodPromise = "ZodPromise",
|
|
1688
|
+
ZodBranded = "ZodBranded",
|
|
1689
|
+
ZodPipeline = "ZodPipeline"
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
declare const partialConfigSchema: ZodObject<{
|
|
1693
|
+
callbackFactory: ZodOptional<ZodOptional<ZodFunction<ZodTuple<[ZodObject<{
|
|
1694
|
+
_id: ZodOptional<ZodNumber>;
|
|
1695
|
+
input: ZodOptional<ZodArray<ZodObject<{
|
|
1696
|
+
name: ZodString;
|
|
1697
|
+
value: ZodUnknown;
|
|
1698
|
+
}, "strip", ZodTypeAny, {
|
|
1699
|
+
name: string;
|
|
1700
|
+
value?: unknown;
|
|
1701
|
+
}, {
|
|
1702
|
+
name: string;
|
|
1703
|
+
value?: unknown;
|
|
1704
|
+
}>, "many">>;
|
|
1705
|
+
output: ZodArray<ZodObject<{
|
|
1706
|
+
name: ZodString;
|
|
1707
|
+
value: ZodUnknown;
|
|
1708
|
+
}, "strip", ZodTypeAny, {
|
|
1709
|
+
name: string;
|
|
1710
|
+
value?: unknown;
|
|
1711
|
+
}, {
|
|
1712
|
+
name: string;
|
|
1713
|
+
value?: unknown;
|
|
1714
|
+
}>, "many">;
|
|
1715
|
+
type: ZodNativeEnum<typeof CallbackType>;
|
|
1716
|
+
}, "strip", ZodTypeAny, {
|
|
1717
|
+
type: CallbackType;
|
|
1718
|
+
output: {
|
|
1719
|
+
name: string;
|
|
1720
|
+
value?: unknown;
|
|
1721
|
+
}[];
|
|
1722
|
+
_id?: number | undefined;
|
|
1723
|
+
input?: {
|
|
1724
|
+
name: string;
|
|
1725
|
+
value?: unknown;
|
|
1726
|
+
}[] | undefined;
|
|
1727
|
+
}, {
|
|
1728
|
+
type: CallbackType;
|
|
1729
|
+
output: {
|
|
1730
|
+
name: string;
|
|
1731
|
+
value?: unknown;
|
|
1732
|
+
}[];
|
|
1733
|
+
_id?: number | undefined;
|
|
1734
|
+
input?: {
|
|
1735
|
+
name: string;
|
|
1736
|
+
value?: unknown;
|
|
1737
|
+
}[] | undefined;
|
|
1738
|
+
}>], ZodUnknown>, ZodType<FRCallback, ZodTypeDef, FRCallback>>>>;
|
|
1739
|
+
clientId: ZodOptional<ZodOptional<ZodString>>;
|
|
1740
|
+
middleware: ZodOptional<ZodOptional<ZodArray<ZodFunction<ZodTuple<[], ZodUnknown>, ZodUnknown>, "many">>>;
|
|
1741
|
+
realmPath: ZodOptional<ZodString>;
|
|
1742
|
+
redirectUri: ZodOptional<ZodOptional<ZodString>>;
|
|
1743
|
+
scope: ZodOptional<ZodOptional<ZodString>>;
|
|
1744
|
+
serverConfig: ZodOptional<ZodObject<{
|
|
1745
|
+
baseUrl: ZodString;
|
|
1746
|
+
paths: ZodOptional<ZodObject<{
|
|
1747
|
+
authenticate: ZodString;
|
|
1748
|
+
authorize: ZodString;
|
|
1749
|
+
accessToken: ZodString;
|
|
1750
|
+
endSession: ZodString;
|
|
1751
|
+
userInfo: ZodString;
|
|
1752
|
+
revoke: ZodString;
|
|
1753
|
+
sessions: ZodString;
|
|
1754
|
+
}, "strip", ZodTypeAny, {
|
|
1755
|
+
authenticate: string;
|
|
1756
|
+
authorize: string;
|
|
1757
|
+
accessToken: string;
|
|
1758
|
+
endSession: string;
|
|
1759
|
+
userInfo: string;
|
|
1760
|
+
revoke: string;
|
|
1761
|
+
sessions: string;
|
|
1762
|
+
}, {
|
|
1763
|
+
authenticate: string;
|
|
1764
|
+
authorize: string;
|
|
1765
|
+
accessToken: string;
|
|
1766
|
+
endSession: string;
|
|
1767
|
+
userInfo: string;
|
|
1768
|
+
revoke: string;
|
|
1769
|
+
sessions: string;
|
|
1770
|
+
}>>;
|
|
1771
|
+
timeout: ZodNumber;
|
|
1772
|
+
}, "strip", ZodTypeAny, {
|
|
1773
|
+
timeout: number;
|
|
1774
|
+
baseUrl: string;
|
|
1775
|
+
paths?: {
|
|
1776
|
+
authenticate: string;
|
|
1777
|
+
authorize: string;
|
|
1778
|
+
accessToken: string;
|
|
1779
|
+
endSession: string;
|
|
1780
|
+
userInfo: string;
|
|
1781
|
+
revoke: string;
|
|
1782
|
+
sessions: string;
|
|
1783
|
+
} | undefined;
|
|
1784
|
+
}, {
|
|
1785
|
+
timeout: number;
|
|
1786
|
+
baseUrl: string;
|
|
1787
|
+
paths?: {
|
|
1788
|
+
authenticate: string;
|
|
1789
|
+
authorize: string;
|
|
1790
|
+
accessToken: string;
|
|
1791
|
+
endSession: string;
|
|
1792
|
+
userInfo: string;
|
|
1793
|
+
revoke: string;
|
|
1794
|
+
sessions: string;
|
|
1795
|
+
} | undefined;
|
|
1796
|
+
}>>;
|
|
1797
|
+
support: ZodOptional<ZodOptional<ZodUnion<[ZodLiteral<"legacy">, ZodLiteral<"modern">]>>>;
|
|
1798
|
+
tokenStore: ZodOptional<ZodOptional<ZodUnion<[ZodObject<{
|
|
1799
|
+
get: ZodFunction<ZodTuple<[ZodString], ZodUnknown>, ZodPromise<ZodObject<{
|
|
1800
|
+
accessToken: ZodString;
|
|
1801
|
+
idToken: ZodOptional<ZodString>;
|
|
1802
|
+
refreshToken: ZodOptional<ZodString>;
|
|
1803
|
+
tokenExpiry: ZodOptional<ZodNumber>;
|
|
1804
|
+
}, "strip", ZodTypeAny, {
|
|
1805
|
+
accessToken: string;
|
|
1806
|
+
idToken?: string | undefined;
|
|
1807
|
+
refreshToken?: string | undefined;
|
|
1808
|
+
tokenExpiry?: number | undefined;
|
|
1809
|
+
}, {
|
|
1810
|
+
accessToken: string;
|
|
1811
|
+
idToken?: string | undefined;
|
|
1812
|
+
refreshToken?: string | undefined;
|
|
1813
|
+
tokenExpiry?: number | undefined;
|
|
1814
|
+
}>>>;
|
|
1815
|
+
set: ZodFunction<ZodTuple<[ZodString], ZodUnknown>, ZodPromise<ZodVoid>>;
|
|
1816
|
+
remove: ZodFunction<ZodTuple<[ZodString], ZodUnknown>, ZodPromise<ZodVoid>>;
|
|
1817
|
+
}, "strip", ZodTypeAny, {
|
|
1818
|
+
set: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1819
|
+
remove: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1820
|
+
get: (args_0: string, ...args_1: unknown[]) => Promise<{
|
|
1821
|
+
accessToken: string;
|
|
1822
|
+
idToken?: string | undefined;
|
|
1823
|
+
refreshToken?: string | undefined;
|
|
1824
|
+
tokenExpiry?: number | undefined;
|
|
1825
|
+
}>;
|
|
1826
|
+
}, {
|
|
1827
|
+
set: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1828
|
+
remove: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1829
|
+
get: (args_0: string, ...args_1: unknown[]) => Promise<{
|
|
1830
|
+
accessToken: string;
|
|
1831
|
+
idToken?: string | undefined;
|
|
1832
|
+
refreshToken?: string | undefined;
|
|
1833
|
+
tokenExpiry?: number | undefined;
|
|
1834
|
+
}>;
|
|
1835
|
+
}>, ZodLiteral<"indexedDB">, ZodLiteral<"sessionStorage">, ZodLiteral<"localStorage">]>>>;
|
|
1836
|
+
tree: ZodOptional<ZodOptional<ZodString>>;
|
|
1837
|
+
type: ZodOptional<ZodOptional<ZodString>>;
|
|
1838
|
+
oauthThreshold: ZodOptional<ZodOptional<ZodNumber>>;
|
|
1839
|
+
}, "strict", ZodTypeAny, {
|
|
1840
|
+
callbackFactory?: ((args_0: {
|
|
1841
|
+
type: CallbackType;
|
|
1842
|
+
output: {
|
|
1843
|
+
name: string;
|
|
1844
|
+
value?: unknown;
|
|
1845
|
+
}[];
|
|
1846
|
+
_id?: number | undefined;
|
|
1847
|
+
input?: {
|
|
1848
|
+
name: string;
|
|
1849
|
+
value?: unknown;
|
|
1850
|
+
}[] | undefined;
|
|
1851
|
+
}, ...args_1: unknown[]) => FRCallback) | undefined;
|
|
1852
|
+
clientId?: string | undefined;
|
|
1853
|
+
middleware?: ((...args: unknown[]) => unknown)[] | undefined;
|
|
1854
|
+
realmPath?: string | undefined;
|
|
1855
|
+
redirectUri?: string | undefined;
|
|
1856
|
+
scope?: string | undefined;
|
|
1857
|
+
serverConfig?: {
|
|
1858
|
+
timeout: number;
|
|
1859
|
+
baseUrl: string;
|
|
1860
|
+
paths?: {
|
|
1861
|
+
authenticate: string;
|
|
1862
|
+
authorize: string;
|
|
1863
|
+
accessToken: string;
|
|
1864
|
+
endSession: string;
|
|
1865
|
+
userInfo: string;
|
|
1866
|
+
revoke: string;
|
|
1867
|
+
sessions: string;
|
|
1868
|
+
} | undefined;
|
|
1869
|
+
} | undefined;
|
|
1870
|
+
support?: "modern" | "legacy" | undefined;
|
|
1871
|
+
tokenStore?: "localStorage" | "indexedDB" | "sessionStorage" | {
|
|
1872
|
+
set: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1873
|
+
remove: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1874
|
+
get: (args_0: string, ...args_1: unknown[]) => Promise<{
|
|
1875
|
+
accessToken: string;
|
|
1876
|
+
idToken?: string | undefined;
|
|
1877
|
+
refreshToken?: string | undefined;
|
|
1878
|
+
tokenExpiry?: number | undefined;
|
|
1879
|
+
}>;
|
|
1880
|
+
} | undefined;
|
|
1881
|
+
tree?: string | undefined;
|
|
1882
|
+
type?: string | undefined;
|
|
1883
|
+
oauthThreshold?: number | undefined;
|
|
1884
|
+
}, {
|
|
1885
|
+
callbackFactory?: ((args_0: {
|
|
1886
|
+
type: CallbackType;
|
|
1887
|
+
output: {
|
|
1888
|
+
name: string;
|
|
1889
|
+
value?: unknown;
|
|
1890
|
+
}[];
|
|
1891
|
+
_id?: number | undefined;
|
|
1892
|
+
input?: {
|
|
1893
|
+
name: string;
|
|
1894
|
+
value?: unknown;
|
|
1895
|
+
}[] | undefined;
|
|
1896
|
+
}, ...args_1: unknown[]) => FRCallback) | undefined;
|
|
1897
|
+
clientId?: string | undefined;
|
|
1898
|
+
middleware?: ((...args: unknown[]) => unknown)[] | undefined;
|
|
1899
|
+
realmPath?: string | undefined;
|
|
1900
|
+
redirectUri?: string | undefined;
|
|
1901
|
+
scope?: string | undefined;
|
|
1902
|
+
serverConfig?: {
|
|
1903
|
+
timeout: number;
|
|
1904
|
+
baseUrl: string;
|
|
1905
|
+
paths?: {
|
|
1906
|
+
authenticate: string;
|
|
1907
|
+
authorize: string;
|
|
1908
|
+
accessToken: string;
|
|
1909
|
+
endSession: string;
|
|
1910
|
+
userInfo: string;
|
|
1911
|
+
revoke: string;
|
|
1912
|
+
sessions: string;
|
|
1913
|
+
} | undefined;
|
|
1914
|
+
} | undefined;
|
|
1915
|
+
support?: "modern" | "legacy" | undefined;
|
|
1916
|
+
tokenStore?: "localStorage" | "indexedDB" | "sessionStorage" | {
|
|
1917
|
+
set: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1918
|
+
remove: (args_0: string, ...args_1: unknown[]) => Promise<void>;
|
|
1919
|
+
get: (args_0: string, ...args_1: unknown[]) => Promise<{
|
|
1920
|
+
accessToken: string;
|
|
1921
|
+
idToken?: string | undefined;
|
|
1922
|
+
refreshToken?: string | undefined;
|
|
1923
|
+
tokenExpiry?: number | undefined;
|
|
1924
|
+
}>;
|
|
1925
|
+
} | undefined;
|
|
1926
|
+
tree?: string | undefined;
|
|
1927
|
+
type?: string | undefined;
|
|
1928
|
+
oauthThreshold?: number | undefined;
|
|
1929
|
+
}>;
|
|
1930
|
+
|
|
1931
|
+
declare const journeyConfigSchema: ZodObject<{
|
|
1932
|
+
forgotPassword: ZodOptional<ZodObject<{
|
|
1933
|
+
journey: ZodOptional<ZodString>;
|
|
1934
|
+
match: ZodArray<ZodString, "many">;
|
|
1935
|
+
}, "strip", ZodTypeAny, {
|
|
1936
|
+
match: string[];
|
|
1937
|
+
journey?: string | undefined;
|
|
1938
|
+
}, {
|
|
1939
|
+
match: string[];
|
|
1940
|
+
journey?: string | undefined;
|
|
1941
|
+
}>>;
|
|
1942
|
+
forgotUsername: ZodOptional<ZodObject<{
|
|
1943
|
+
journey: ZodOptional<ZodString>;
|
|
1944
|
+
match: ZodArray<ZodString, "many">;
|
|
1945
|
+
}, "strip", ZodTypeAny, {
|
|
1946
|
+
match: string[];
|
|
1947
|
+
journey?: string | undefined;
|
|
1948
|
+
}, {
|
|
1949
|
+
match: string[];
|
|
1950
|
+
journey?: string | undefined;
|
|
1951
|
+
}>>;
|
|
1952
|
+
login: ZodOptional<ZodObject<{
|
|
1953
|
+
journey: ZodOptional<ZodString>;
|
|
1954
|
+
match: ZodArray<ZodString, "many">;
|
|
1955
|
+
}, "strip", ZodTypeAny, {
|
|
1956
|
+
match: string[];
|
|
1957
|
+
journey?: string | undefined;
|
|
1958
|
+
}, {
|
|
1959
|
+
match: string[];
|
|
1960
|
+
journey?: string | undefined;
|
|
1961
|
+
}>>;
|
|
1962
|
+
register: ZodOptional<ZodObject<{
|
|
1963
|
+
journey: ZodOptional<ZodString>;
|
|
1964
|
+
match: ZodArray<ZodString, "many">;
|
|
1965
|
+
}, "strip", ZodTypeAny, {
|
|
1966
|
+
match: string[];
|
|
1967
|
+
journey?: string | undefined;
|
|
1968
|
+
}, {
|
|
1969
|
+
match: string[];
|
|
1970
|
+
journey?: string | undefined;
|
|
1971
|
+
}>>;
|
|
1972
|
+
}, "strip", ZodTypeAny, {
|
|
1973
|
+
forgotPassword?: {
|
|
1974
|
+
match: string[];
|
|
1975
|
+
journey?: string | undefined;
|
|
1976
|
+
} | undefined;
|
|
1977
|
+
forgotUsername?: {
|
|
1978
|
+
match: string[];
|
|
1979
|
+
journey?: string | undefined;
|
|
1980
|
+
} | undefined;
|
|
1981
|
+
login?: {
|
|
1982
|
+
match: string[];
|
|
1983
|
+
journey?: string | undefined;
|
|
1984
|
+
} | undefined;
|
|
1985
|
+
register?: {
|
|
1986
|
+
match: string[];
|
|
1987
|
+
journey?: string | undefined;
|
|
1988
|
+
} | undefined;
|
|
1989
|
+
}, {
|
|
1990
|
+
forgotPassword?: {
|
|
1991
|
+
match: string[];
|
|
1992
|
+
journey?: string | undefined;
|
|
1993
|
+
} | undefined;
|
|
1994
|
+
forgotUsername?: {
|
|
1995
|
+
match: string[];
|
|
1996
|
+
journey?: string | undefined;
|
|
1997
|
+
} | undefined;
|
|
1998
|
+
login?: {
|
|
1999
|
+
match: string[];
|
|
2000
|
+
journey?: string | undefined;
|
|
2001
|
+
} | undefined;
|
|
2002
|
+
register?: {
|
|
2003
|
+
match: string[];
|
|
2004
|
+
journey?: string | undefined;
|
|
2005
|
+
} | undefined;
|
|
2006
|
+
}>;
|
|
2007
|
+
|
|
2008
|
+
declare const partialLinksSchema: ZodObject<{
|
|
2009
|
+
termsAndConditions: ZodOptional<ZodString>;
|
|
2010
|
+
}, "strict", ZodTypeAny, {
|
|
2011
|
+
termsAndConditions?: string | undefined;
|
|
2012
|
+
}, {
|
|
2013
|
+
termsAndConditions?: string | undefined;
|
|
2014
|
+
}>;
|
|
2015
|
+
|
|
2016
|
+
declare const partialStringsSchema: ZodObject<{
|
|
2017
|
+
alreadyHaveAnAccount: ZodOptional<ZodString>;
|
|
2018
|
+
backToDefault: ZodOptional<ZodString>;
|
|
2019
|
+
backToLogin: ZodOptional<ZodString>;
|
|
2020
|
+
dontHaveAnAccount: ZodOptional<ZodString>;
|
|
2021
|
+
closeModal: ZodOptional<ZodString>;
|
|
2022
|
+
charactersCannotRepeatMoreThan: ZodOptional<ZodString>;
|
|
2023
|
+
charactersCannotRepeatMoreThanCaseInsensitive: ZodOptional<ZodString>;
|
|
2024
|
+
chooseDifferentUsername: ZodOptional<ZodString>;
|
|
2025
|
+
confirmPassword: ZodOptional<ZodString>;
|
|
2026
|
+
constraintViolationForPassword: ZodOptional<ZodString>;
|
|
2027
|
+
constraintViolationForValue: ZodOptional<ZodString>;
|
|
2028
|
+
continueWith: ZodOptional<ZodString>;
|
|
2029
|
+
customSecurityQuestion: ZodOptional<ZodString>;
|
|
2030
|
+
doesNotMeetMinimumCharacterLength: ZodOptional<ZodString>;
|
|
2031
|
+
ensurePasswordIsMoreThan: ZodOptional<ZodString>;
|
|
2032
|
+
ensurePasswordHasOne: ZodOptional<ZodString>;
|
|
2033
|
+
enterVerificationCode: ZodOptional<ZodString>;
|
|
2034
|
+
exceedsMaximumCharacterLength: ZodOptional<ZodString>;
|
|
2035
|
+
fieldCanNotContainFollowingCharacters: ZodOptional<ZodString>;
|
|
2036
|
+
fieldCanNotContainFollowingValues: ZodOptional<ZodString>;
|
|
2037
|
+
forgotPassword: ZodOptional<ZodString>;
|
|
2038
|
+
forgotUsername: ZodOptional<ZodString>;
|
|
2039
|
+
givenName: ZodOptional<ZodString>;
|
|
2040
|
+
inputRequiredError: ZodOptional<ZodString>;
|
|
2041
|
+
loading: ZodOptional<ZodString>;
|
|
2042
|
+
loginButton: ZodOptional<ZodString>;
|
|
2043
|
+
loginFailure: ZodOptional<ZodString>;
|
|
2044
|
+
loginHeader: ZodOptional<ZodString>;
|
|
2045
|
+
loginSuccess: ZodOptional<ZodString>;
|
|
2046
|
+
mail: ZodOptional<ZodString>;
|
|
2047
|
+
minimumNumberOfNumbers: ZodOptional<ZodString>;
|
|
2048
|
+
minimumNumberOfLowercase: ZodOptional<ZodString>;
|
|
2049
|
+
minimumNumberOfUppercase: ZodOptional<ZodString>;
|
|
2050
|
+
minimumNumberOfSymbols: ZodOptional<ZodString>;
|
|
2051
|
+
nameCallback: ZodOptional<ZodString>;
|
|
2052
|
+
nextButton: ZodOptional<ZodString>;
|
|
2053
|
+
notToExceedMaximumCharacterLength: ZodOptional<ZodString>;
|
|
2054
|
+
noLessThanMinimumCharacterLength: ZodOptional<ZodString>;
|
|
2055
|
+
passwordCallback: ZodOptional<ZodString>;
|
|
2056
|
+
passwordCannotContainCommonPasswords: ZodOptional<ZodString>;
|
|
2057
|
+
passwordCannotContainCommonPasswordsOrBeReversible: ZodOptional<ZodString>;
|
|
2058
|
+
passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan: ZodOptional<ZodString>;
|
|
2059
|
+
passwordRequirements: ZodOptional<ZodString>;
|
|
2060
|
+
pleaseCheckValue: ZodOptional<ZodString>;
|
|
2061
|
+
pleaseConfirm: ZodOptional<ZodString>;
|
|
2062
|
+
preferencesMarketing: ZodOptional<ZodString>;
|
|
2063
|
+
preferencesUpdates: ZodOptional<ZodString>;
|
|
2064
|
+
provideCustomQuestion: ZodOptional<ZodString>;
|
|
2065
|
+
redirectingTo: ZodOptional<ZodString>;
|
|
2066
|
+
registerButton: ZodOptional<ZodString>;
|
|
2067
|
+
registerHeader: ZodOptional<ZodString>;
|
|
2068
|
+
registerSuccess: ZodOptional<ZodString>;
|
|
2069
|
+
requiredField: ZodOptional<ZodString>;
|
|
2070
|
+
securityAnswer: ZodOptional<ZodString>;
|
|
2071
|
+
securityQuestions: ZodOptional<ZodString>;
|
|
2072
|
+
securityQuestionsPrompt: ZodOptional<ZodString>;
|
|
2073
|
+
shouldContainANumber: ZodOptional<ZodString>;
|
|
2074
|
+
shouldContainAnUppercase: ZodOptional<ZodString>;
|
|
2075
|
+
shouldContainALowercase: ZodOptional<ZodString>;
|
|
2076
|
+
shouldContainASymbol: ZodOptional<ZodString>;
|
|
2077
|
+
showPassword: ZodOptional<ZodString>;
|
|
2078
|
+
sn: ZodOptional<ZodString>;
|
|
2079
|
+
submitButton: ZodOptional<ZodString>;
|
|
2080
|
+
successMessage: ZodOptional<ZodString>;
|
|
2081
|
+
termsAndConditions: ZodOptional<ZodString>;
|
|
2082
|
+
termsAndConditionsLinkText: ZodOptional<ZodString>;
|
|
2083
|
+
tryAgain: ZodOptional<ZodString>;
|
|
2084
|
+
twoFactorAuthentication: ZodOptional<ZodString>;
|
|
2085
|
+
useValidEmail: ZodOptional<ZodString>;
|
|
2086
|
+
unrecoverableError: ZodOptional<ZodString>;
|
|
2087
|
+
unknownLoginError: ZodOptional<ZodString>;
|
|
2088
|
+
unknownNetworkError: ZodOptional<ZodString>;
|
|
2089
|
+
userName: ZodOptional<ZodString>;
|
|
2090
|
+
usernameRequirements: ZodOptional<ZodString>;
|
|
2091
|
+
useTheAuthenticatorAppOnYourPhone: ZodOptional<ZodString>;
|
|
2092
|
+
validatedCreatePasswordCallback: ZodOptional<ZodString>;
|
|
2093
|
+
validatedCreateUsernameCallback: ZodOptional<ZodString>;
|
|
2094
|
+
valueRequirements: ZodOptional<ZodString>;
|
|
2095
|
+
}, "strict", ZodTypeAny, {
|
|
2096
|
+
alreadyHaveAnAccount?: string | undefined;
|
|
2097
|
+
backToDefault?: string | undefined;
|
|
2098
|
+
backToLogin?: string | undefined;
|
|
2099
|
+
dontHaveAnAccount?: string | undefined;
|
|
2100
|
+
closeModal?: string | undefined;
|
|
2101
|
+
charactersCannotRepeatMoreThan?: string | undefined;
|
|
2102
|
+
charactersCannotRepeatMoreThanCaseInsensitive?: string | undefined;
|
|
2103
|
+
chooseDifferentUsername?: string | undefined;
|
|
2104
|
+
confirmPassword?: string | undefined;
|
|
2105
|
+
constraintViolationForPassword?: string | undefined;
|
|
2106
|
+
constraintViolationForValue?: string | undefined;
|
|
2107
|
+
continueWith?: string | undefined;
|
|
2108
|
+
customSecurityQuestion?: string | undefined;
|
|
2109
|
+
doesNotMeetMinimumCharacterLength?: string | undefined;
|
|
2110
|
+
ensurePasswordIsMoreThan?: string | undefined;
|
|
2111
|
+
ensurePasswordHasOne?: string | undefined;
|
|
2112
|
+
enterVerificationCode?: string | undefined;
|
|
2113
|
+
exceedsMaximumCharacterLength?: string | undefined;
|
|
2114
|
+
fieldCanNotContainFollowingCharacters?: string | undefined;
|
|
2115
|
+
fieldCanNotContainFollowingValues?: string | undefined;
|
|
2116
|
+
forgotPassword?: string | undefined;
|
|
2117
|
+
forgotUsername?: string | undefined;
|
|
2118
|
+
givenName?: string | undefined;
|
|
2119
|
+
inputRequiredError?: string | undefined;
|
|
2120
|
+
loading?: string | undefined;
|
|
2121
|
+
loginButton?: string | undefined;
|
|
2122
|
+
loginFailure?: string | undefined;
|
|
2123
|
+
loginHeader?: string | undefined;
|
|
2124
|
+
loginSuccess?: string | undefined;
|
|
2125
|
+
mail?: string | undefined;
|
|
2126
|
+
minimumNumberOfNumbers?: string | undefined;
|
|
2127
|
+
minimumNumberOfLowercase?: string | undefined;
|
|
2128
|
+
minimumNumberOfUppercase?: string | undefined;
|
|
2129
|
+
minimumNumberOfSymbols?: string | undefined;
|
|
2130
|
+
nameCallback?: string | undefined;
|
|
2131
|
+
nextButton?: string | undefined;
|
|
2132
|
+
notToExceedMaximumCharacterLength?: string | undefined;
|
|
2133
|
+
noLessThanMinimumCharacterLength?: string | undefined;
|
|
2134
|
+
passwordCallback?: string | undefined;
|
|
2135
|
+
passwordCannotContainCommonPasswords?: string | undefined;
|
|
2136
|
+
passwordCannotContainCommonPasswordsOrBeReversible?: string | undefined;
|
|
2137
|
+
passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan?: string | undefined;
|
|
2138
|
+
passwordRequirements?: string | undefined;
|
|
2139
|
+
pleaseCheckValue?: string | undefined;
|
|
2140
|
+
pleaseConfirm?: string | undefined;
|
|
2141
|
+
preferencesMarketing?: string | undefined;
|
|
2142
|
+
preferencesUpdates?: string | undefined;
|
|
2143
|
+
provideCustomQuestion?: string | undefined;
|
|
2144
|
+
redirectingTo?: string | undefined;
|
|
2145
|
+
registerButton?: string | undefined;
|
|
2146
|
+
registerHeader?: string | undefined;
|
|
2147
|
+
registerSuccess?: string | undefined;
|
|
2148
|
+
requiredField?: string | undefined;
|
|
2149
|
+
securityAnswer?: string | undefined;
|
|
2150
|
+
securityQuestions?: string | undefined;
|
|
2151
|
+
securityQuestionsPrompt?: string | undefined;
|
|
2152
|
+
shouldContainANumber?: string | undefined;
|
|
2153
|
+
shouldContainAnUppercase?: string | undefined;
|
|
2154
|
+
shouldContainALowercase?: string | undefined;
|
|
2155
|
+
shouldContainASymbol?: string | undefined;
|
|
2156
|
+
showPassword?: string | undefined;
|
|
2157
|
+
sn?: string | undefined;
|
|
2158
|
+
submitButton?: string | undefined;
|
|
2159
|
+
successMessage?: string | undefined;
|
|
2160
|
+
termsAndConditions?: string | undefined;
|
|
2161
|
+
termsAndConditionsLinkText?: string | undefined;
|
|
2162
|
+
tryAgain?: string | undefined;
|
|
2163
|
+
twoFactorAuthentication?: string | undefined;
|
|
2164
|
+
useValidEmail?: string | undefined;
|
|
2165
|
+
unrecoverableError?: string | undefined;
|
|
2166
|
+
unknownLoginError?: string | undefined;
|
|
2167
|
+
unknownNetworkError?: string | undefined;
|
|
2168
|
+
userName?: string | undefined;
|
|
2169
|
+
usernameRequirements?: string | undefined;
|
|
2170
|
+
useTheAuthenticatorAppOnYourPhone?: string | undefined;
|
|
2171
|
+
validatedCreatePasswordCallback?: string | undefined;
|
|
2172
|
+
validatedCreateUsernameCallback?: string | undefined;
|
|
2173
|
+
valueRequirements?: string | undefined;
|
|
2174
|
+
}, {
|
|
2175
|
+
alreadyHaveAnAccount?: string | undefined;
|
|
2176
|
+
backToDefault?: string | undefined;
|
|
2177
|
+
backToLogin?: string | undefined;
|
|
2178
|
+
dontHaveAnAccount?: string | undefined;
|
|
2179
|
+
closeModal?: string | undefined;
|
|
2180
|
+
charactersCannotRepeatMoreThan?: string | undefined;
|
|
2181
|
+
charactersCannotRepeatMoreThanCaseInsensitive?: string | undefined;
|
|
2182
|
+
chooseDifferentUsername?: string | undefined;
|
|
2183
|
+
confirmPassword?: string | undefined;
|
|
2184
|
+
constraintViolationForPassword?: string | undefined;
|
|
2185
|
+
constraintViolationForValue?: string | undefined;
|
|
2186
|
+
continueWith?: string | undefined;
|
|
2187
|
+
customSecurityQuestion?: string | undefined;
|
|
2188
|
+
doesNotMeetMinimumCharacterLength?: string | undefined;
|
|
2189
|
+
ensurePasswordIsMoreThan?: string | undefined;
|
|
2190
|
+
ensurePasswordHasOne?: string | undefined;
|
|
2191
|
+
enterVerificationCode?: string | undefined;
|
|
2192
|
+
exceedsMaximumCharacterLength?: string | undefined;
|
|
2193
|
+
fieldCanNotContainFollowingCharacters?: string | undefined;
|
|
2194
|
+
fieldCanNotContainFollowingValues?: string | undefined;
|
|
2195
|
+
forgotPassword?: string | undefined;
|
|
2196
|
+
forgotUsername?: string | undefined;
|
|
2197
|
+
givenName?: string | undefined;
|
|
2198
|
+
inputRequiredError?: string | undefined;
|
|
2199
|
+
loading?: string | undefined;
|
|
2200
|
+
loginButton?: string | undefined;
|
|
2201
|
+
loginFailure?: string | undefined;
|
|
2202
|
+
loginHeader?: string | undefined;
|
|
2203
|
+
loginSuccess?: string | undefined;
|
|
2204
|
+
mail?: string | undefined;
|
|
2205
|
+
minimumNumberOfNumbers?: string | undefined;
|
|
2206
|
+
minimumNumberOfLowercase?: string | undefined;
|
|
2207
|
+
minimumNumberOfUppercase?: string | undefined;
|
|
2208
|
+
minimumNumberOfSymbols?: string | undefined;
|
|
2209
|
+
nameCallback?: string | undefined;
|
|
2210
|
+
nextButton?: string | undefined;
|
|
2211
|
+
notToExceedMaximumCharacterLength?: string | undefined;
|
|
2212
|
+
noLessThanMinimumCharacterLength?: string | undefined;
|
|
2213
|
+
passwordCallback?: string | undefined;
|
|
2214
|
+
passwordCannotContainCommonPasswords?: string | undefined;
|
|
2215
|
+
passwordCannotContainCommonPasswordsOrBeReversible?: string | undefined;
|
|
2216
|
+
passwordCannotContainCommonPasswordsOrBeReversibleStringsLessThan?: string | undefined;
|
|
2217
|
+
passwordRequirements?: string | undefined;
|
|
2218
|
+
pleaseCheckValue?: string | undefined;
|
|
2219
|
+
pleaseConfirm?: string | undefined;
|
|
2220
|
+
preferencesMarketing?: string | undefined;
|
|
2221
|
+
preferencesUpdates?: string | undefined;
|
|
2222
|
+
provideCustomQuestion?: string | undefined;
|
|
2223
|
+
redirectingTo?: string | undefined;
|
|
2224
|
+
registerButton?: string | undefined;
|
|
2225
|
+
registerHeader?: string | undefined;
|
|
2226
|
+
registerSuccess?: string | undefined;
|
|
2227
|
+
requiredField?: string | undefined;
|
|
2228
|
+
securityAnswer?: string | undefined;
|
|
2229
|
+
securityQuestions?: string | undefined;
|
|
2230
|
+
securityQuestionsPrompt?: string | undefined;
|
|
2231
|
+
shouldContainANumber?: string | undefined;
|
|
2232
|
+
shouldContainAnUppercase?: string | undefined;
|
|
2233
|
+
shouldContainALowercase?: string | undefined;
|
|
2234
|
+
shouldContainASymbol?: string | undefined;
|
|
2235
|
+
showPassword?: string | undefined;
|
|
2236
|
+
sn?: string | undefined;
|
|
2237
|
+
submitButton?: string | undefined;
|
|
2238
|
+
successMessage?: string | undefined;
|
|
2239
|
+
termsAndConditions?: string | undefined;
|
|
2240
|
+
termsAndConditionsLinkText?: string | undefined;
|
|
2241
|
+
tryAgain?: string | undefined;
|
|
2242
|
+
twoFactorAuthentication?: string | undefined;
|
|
2243
|
+
useValidEmail?: string | undefined;
|
|
2244
|
+
unrecoverableError?: string | undefined;
|
|
2245
|
+
unknownLoginError?: string | undefined;
|
|
2246
|
+
unknownNetworkError?: string | undefined;
|
|
2247
|
+
userName?: string | undefined;
|
|
2248
|
+
usernameRequirements?: string | undefined;
|
|
2249
|
+
useTheAuthenticatorAppOnYourPhone?: string | undefined;
|
|
2250
|
+
validatedCreatePasswordCallback?: string | undefined;
|
|
2251
|
+
validatedCreateUsernameCallback?: string | undefined;
|
|
2252
|
+
valueRequirements?: string | undefined;
|
|
2253
|
+
}>;
|
|
2254
|
+
|
|
2255
|
+
declare const partialStyleSchema: ZodObject<{
|
|
2256
|
+
checksAndRadios: ZodOptional<ZodOptional<ZodUnion<[ZodLiteral<"animated">, ZodLiteral<"standard">]>>>;
|
|
2257
|
+
labels: ZodOptional<ZodOptional<ZodUnion<[ZodOptional<ZodLiteral<"floating">>, ZodLiteral<"stacked">]>>>;
|
|
2258
|
+
logo: ZodOptional<ZodOptional<ZodObject<{
|
|
2259
|
+
dark: ZodOptional<ZodString>;
|
|
2260
|
+
height: ZodOptional<ZodNumber>;
|
|
2261
|
+
light: ZodOptional<ZodString>;
|
|
2262
|
+
width: ZodOptional<ZodNumber>;
|
|
2263
|
+
}, "strict", ZodTypeAny, {
|
|
2264
|
+
dark?: string | undefined;
|
|
2265
|
+
height?: number | undefined;
|
|
2266
|
+
light?: string | undefined;
|
|
2267
|
+
width?: number | undefined;
|
|
2268
|
+
}, {
|
|
2269
|
+
dark?: string | undefined;
|
|
2270
|
+
height?: number | undefined;
|
|
2271
|
+
light?: string | undefined;
|
|
2272
|
+
width?: number | undefined;
|
|
2273
|
+
}>>>;
|
|
2274
|
+
sections: ZodOptional<ZodOptional<ZodObject<{
|
|
2275
|
+
header: ZodOptional<ZodBoolean>;
|
|
2276
|
+
}, "strip", ZodTypeAny, {
|
|
2277
|
+
header?: boolean | undefined;
|
|
2278
|
+
}, {
|
|
2279
|
+
header?: boolean | undefined;
|
|
2280
|
+
}>>>;
|
|
2281
|
+
stage: ZodOptional<ZodOptional<ZodObject<{
|
|
2282
|
+
icon: ZodOptional<ZodBoolean>;
|
|
2283
|
+
}, "strip", ZodTypeAny, {
|
|
2284
|
+
icon?: boolean | undefined;
|
|
2285
|
+
}, {
|
|
2286
|
+
icon?: boolean | undefined;
|
|
2287
|
+
}>>>;
|
|
2288
|
+
}, "strict", ZodTypeAny, {
|
|
2289
|
+
checksAndRadios?: "standard" | "animated" | undefined;
|
|
2290
|
+
labels?: "floating" | "stacked" | undefined;
|
|
2291
|
+
logo?: {
|
|
2292
|
+
dark?: string | undefined;
|
|
2293
|
+
height?: number | undefined;
|
|
2294
|
+
light?: string | undefined;
|
|
2295
|
+
width?: number | undefined;
|
|
2296
|
+
} | undefined;
|
|
2297
|
+
sections?: {
|
|
2298
|
+
header?: boolean | undefined;
|
|
2299
|
+
} | undefined;
|
|
2300
|
+
stage?: {
|
|
2301
|
+
icon?: boolean | undefined;
|
|
2302
|
+
} | undefined;
|
|
2303
|
+
}, {
|
|
2304
|
+
checksAndRadios?: "standard" | "animated" | undefined;
|
|
2305
|
+
labels?: "floating" | "stacked" | undefined;
|
|
2306
|
+
logo?: {
|
|
2307
|
+
dark?: string | undefined;
|
|
2308
|
+
height?: number | undefined;
|
|
2309
|
+
light?: string | undefined;
|
|
2310
|
+
width?: number | undefined;
|
|
2311
|
+
} | undefined;
|
|
2312
|
+
sections?: {
|
|
2313
|
+
header?: boolean | undefined;
|
|
2314
|
+
} | undefined;
|
|
2315
|
+
stage?: {
|
|
2316
|
+
icon?: boolean | undefined;
|
|
2317
|
+
} | undefined;
|
|
2318
|
+
}>;
|
|
2319
|
+
|
|
2320
|
+
interface JourneyOptions {
|
|
2321
|
+
oauth?: boolean;
|
|
2322
|
+
user?: boolean;
|
|
2323
|
+
}
|
|
2324
|
+
interface JourneyOptionsChange {
|
|
2325
|
+
forgerock?: StepOptions;
|
|
2326
|
+
journey: string;
|
|
2327
|
+
}
|
|
2328
|
+
interface JourneyOptionsStart {
|
|
2329
|
+
forgerock?: StepOptions;
|
|
2330
|
+
journey?: string;
|
|
2331
|
+
resumeUrl?: string;
|
|
2332
|
+
}
|
|
2333
|
+
interface WidgetConfigOptions {
|
|
2334
|
+
forgerock?: TypeOf<typeof partialConfigSchema>;
|
|
2335
|
+
content?: TypeOf<typeof partialStringsSchema>;
|
|
2336
|
+
journeys?: TypeOf<typeof journeyConfigSchema>;
|
|
2337
|
+
links?: TypeOf<typeof partialLinksSchema>;
|
|
2338
|
+
style?: TypeOf<typeof partialStyleSchema>;
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2341
|
+
declare const configuration: (options?: WidgetConfigOptions | undefined) => {
|
|
2342
|
+
set(setOptions?: WidgetConfigOptions | undefined): void;
|
|
2343
|
+
};
|
|
2344
|
+
declare const journey: (options?: JourneyOptions | undefined) => {
|
|
2345
|
+
change: (changeOptions: JourneyOptionsChange) => Promise<unknown>;
|
|
2346
|
+
start: (startOptions?: JourneyOptionsStart | undefined) => Promise<unknown>;
|
|
2347
|
+
subscribe: (this: void, run: Subscriber<{
|
|
2348
|
+
journey: JourneyStoreValue;
|
|
2349
|
+
oauth: OAuthTokenStoreValue;
|
|
2350
|
+
user: UserStoreValue;
|
|
2351
|
+
}>, invalidate?: ((value?: {
|
|
2352
|
+
journey: JourneyStoreValue;
|
|
2353
|
+
oauth: OAuthTokenStoreValue;
|
|
2354
|
+
user: UserStoreValue;
|
|
2355
|
+
} | undefined) => void) | undefined) => Unsubscriber;
|
|
2356
|
+
};
|
|
2357
|
+
declare const component: () => {
|
|
2358
|
+
close: (args?: {
|
|
2359
|
+
reason: "auto" | "external" | "user";
|
|
2360
|
+
} | undefined) => void;
|
|
2361
|
+
open: () => void;
|
|
2362
|
+
subscribe: (this: void, run: Subscriber<Pick<ComponentStoreValue, "reason" | "error" | "open" | "lastAction" | "mounted">>, invalidate?: ((value?: Pick<ComponentStoreValue, "reason" | "error" | "open" | "lastAction" | "mounted"> | undefined) => void) | undefined) => Unsubscriber;
|
|
2363
|
+
};
|
|
2364
|
+
declare const request: typeof HttpClient.request;
|
|
2365
|
+
declare const user: {
|
|
2366
|
+
info(): {
|
|
2367
|
+
get: (options?: ConfigOptions | undefined) => Promise<unknown>;
|
|
2368
|
+
subscribe: (this: void, run: Subscriber<UserStoreValue>, invalidate?: ((value?: UserStoreValue | undefined) => void) | undefined) => Unsubscriber;
|
|
2369
|
+
};
|
|
2370
|
+
logout(): Promise<void>;
|
|
2371
|
+
tokens(): {
|
|
2372
|
+
get: (options?: ConfigOptions | undefined) => Promise<unknown>;
|
|
2373
|
+
subscribe: (this: void, run: Subscriber<OAuthTokenStoreValue>, invalidate?: ((value?: OAuthTokenStoreValue | undefined) => void) | undefined) => Unsubscriber;
|
|
2374
|
+
};
|
|
2375
|
+
};
|
|
2376
|
+
declare const __propDef: {
|
|
2377
|
+
props: {
|
|
2378
|
+
type?: "inline" | "modal" | undefined;
|
|
2379
|
+
};
|
|
2380
|
+
events: {
|
|
2381
|
+
[evt: string]: CustomEvent<any>;
|
|
2382
|
+
};
|
|
2383
|
+
slots: {};
|
|
2384
|
+
};
|
|
2385
|
+
type IndexProps = typeof __propDef.props;
|
|
2386
|
+
type IndexEvents = typeof __propDef.events;
|
|
2387
|
+
type IndexSlots = typeof __propDef.slots;
|
|
2388
|
+
declare class Index extends SvelteComponentTyped<IndexProps, IndexEvents, IndexSlots> {
|
|
2389
|
+
}
|
|
2390
|
+
|
|
2391
|
+
export { IndexEvents, IndexProps, IndexSlots, component, configuration, Index as default, journey, request, user };
|