@donotdev/core 0.1.0 → 0.1.1
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/functions/index.d.ts +0 -155
- package/i18n/locales/eager/dndev_ar.json +158 -0
- package/i18n/locales/eager/dndev_da.json +153 -0
- package/i18n/locales/eager/dndev_de.json +158 -0
- package/i18n/locales/eager/dndev_en.json +3 -0
- package/i18n/locales/eager/dndev_es.json +159 -1
- package/i18n/locales/eager/dndev_fr.json +158 -0
- package/i18n/locales/eager/dndev_it.json +158 -0
- package/i18n/locales/eager/dndev_ja.json +158 -0
- package/i18n/locales/eager/dndev_ko.json +158 -0
- package/i18n/locales/eager/dndev_nl.json +153 -0
- package/i18n/locales/eager/dndev_pt.json +581 -0
- package/i18n/locales/eager/dndev_zh.json +581 -0
- package/i18n/locales/lazy/ai_en.json +25 -0
- package/i18n/locales/lazy/ai_pt.json +25 -0
- package/i18n/locales/lazy/ai_zh.json +25 -0
- package/i18n/locales/lazy/auth_ar.json +44 -0
- package/i18n/locales/lazy/auth_da.json +45 -1
- package/i18n/locales/lazy/auth_de.json +44 -0
- package/i18n/locales/lazy/auth_en.json +44 -0
- package/i18n/locales/lazy/auth_es.json +44 -0
- package/i18n/locales/lazy/auth_fr.json +44 -0
- package/i18n/locales/lazy/auth_it.json +44 -0
- package/i18n/locales/lazy/auth_ja.json +44 -0
- package/i18n/locales/lazy/auth_ko.json +44 -0
- package/i18n/locales/lazy/auth_nl.json +45 -1
- package/i18n/locales/lazy/auth_pt.json +192 -0
- package/i18n/locales/lazy/auth_zh.json +192 -0
- package/i18n/locales/lazy/billing_en.json +11 -0
- package/i18n/locales/lazy/billing_pt.json +93 -0
- package/i18n/locales/lazy/billing_zh.json +93 -0
- package/i18n/locales/lazy/blog_pt.json +9 -0
- package/i18n/locales/lazy/blog_zh.json +9 -0
- package/i18n/locales/lazy/cookies_pt.json +32 -0
- package/i18n/locales/lazy/cookies_zh.json +32 -0
- package/i18n/locales/lazy/crud_ar.json +3 -0
- package/i18n/locales/lazy/crud_da.json +3 -0
- package/i18n/locales/lazy/crud_de.json +3 -0
- package/i18n/locales/lazy/crud_en.json +3 -0
- package/i18n/locales/lazy/crud_es.json +3 -0
- package/i18n/locales/lazy/crud_fr.json +3 -0
- package/i18n/locales/lazy/crud_it.json +3 -0
- package/i18n/locales/lazy/crud_ja.json +3 -0
- package/i18n/locales/lazy/crud_ko.json +3 -0
- package/i18n/locales/lazy/crud_nl.json +3 -0
- package/i18n/locales/lazy/crud_pt.json +534 -0
- package/i18n/locales/lazy/crud_zh.json +534 -0
- package/i18n/locales/lazy/homeTemplate_pt.json +52 -0
- package/i18n/locales/lazy/homeTemplate_zh.json +52 -0
- package/i18n/locales/lazy/legalNotice_pt.json +55 -0
- package/i18n/locales/lazy/legalNotice_zh.json +55 -0
- package/i18n/locales/lazy/oauth_pt.json +11 -0
- package/i18n/locales/lazy/oauth_zh.json +11 -0
- package/i18n/locales/lazy/privacy_pt.json +178 -0
- package/i18n/locales/lazy/privacy_zh.json +178 -0
- package/i18n/locales/lazy/terms_pt.json +200 -0
- package/i18n/locales/lazy/terms_zh.json +200 -0
- package/index.d.ts +1604 -3832
- package/index.js +44 -516
- package/next/index.d.ts +299 -159
- package/next/index.js +72 -59
- package/package.json +10 -6
- package/server.d.ts +1328 -2309
- package/server.js +1 -372
- package/vite/index.d.ts +242 -158
- package/vite/index.js +72 -72
package/server.d.ts
CHANGED
|
@@ -1,6 +1,398 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { ReactNode, ComponentType } from 'react';
|
|
3
2
|
import * as v from 'valibot';
|
|
3
|
+
import { InitOptions, TFunction } from 'i18next';
|
|
4
|
+
import { FieldValues } from 'react-hook-form';
|
|
5
|
+
import { useTranslation } from 'react-i18next';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @fileoverview AI Constants
|
|
9
|
+
* @description Provider IDs, model lists, roles, defaults for AI feature.
|
|
10
|
+
*
|
|
11
|
+
* @version 0.1.0
|
|
12
|
+
* @since 0.1.0
|
|
13
|
+
* @author AMBROISE PARK Consulting
|
|
14
|
+
*/
|
|
15
|
+
/** Supported AI providers */
|
|
16
|
+
declare const AI_PROVIDERS: {
|
|
17
|
+
readonly ANTHROPIC: "anthropic";
|
|
18
|
+
readonly OPENAI: "openai";
|
|
19
|
+
readonly GOOGLE: "google";
|
|
20
|
+
};
|
|
21
|
+
/** Message roles */
|
|
22
|
+
declare const AI_ROLES: {
|
|
23
|
+
readonly USER: "user";
|
|
24
|
+
readonly ASSISTANT: "assistant";
|
|
25
|
+
readonly SYSTEM: "system";
|
|
26
|
+
};
|
|
27
|
+
/** Default models per provider */
|
|
28
|
+
declare const AI_MODELS: {
|
|
29
|
+
readonly anthropic: {
|
|
30
|
+
readonly default: "claude-sonnet-4-6";
|
|
31
|
+
readonly models: readonly ["claude-sonnet-4-6", "claude-sonnet-4-20250514", "claude-haiku-4-5-20251001", "claude-opus-4-6", "claude-opus-4-20250514"];
|
|
32
|
+
};
|
|
33
|
+
readonly openai: {
|
|
34
|
+
readonly default: "gpt-4o";
|
|
35
|
+
readonly models: readonly ["gpt-4o", "gpt-4o-mini", "gpt-4.1", "gpt-4.1-mini", "o3-mini"];
|
|
36
|
+
};
|
|
37
|
+
readonly google: {
|
|
38
|
+
readonly default: "gemini-2.0-flash";
|
|
39
|
+
readonly models: readonly ["gemini-2.0-flash", "gemini-2.5-pro", "gemini-2.5-flash"];
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/** Default AI configuration */
|
|
43
|
+
declare const DEFAULT_AI_CONFIG: {
|
|
44
|
+
readonly maxTokens: 4096;
|
|
45
|
+
readonly temperature: 0.7;
|
|
46
|
+
readonly stream: true;
|
|
47
|
+
};
|
|
48
|
+
/** AI error codes */
|
|
49
|
+
declare const AI_ERROR_CODES: {
|
|
50
|
+
readonly UNKNOWN: "unknown";
|
|
51
|
+
readonly UNAUTHENTICATED: "unauthenticated";
|
|
52
|
+
readonly INVALID_API_KEY: "invalid_api_key";
|
|
53
|
+
readonly RATE_LIMIT_EXCEEDED: "rate_limit_exceeded";
|
|
54
|
+
readonly PROVIDER_ERROR: "provider_error";
|
|
55
|
+
readonly TOKEN_LIMIT_EXCEEDED: "token_limit_exceeded";
|
|
56
|
+
readonly STREAM_INTERRUPTED: "stream_interrupted";
|
|
57
|
+
};
|
|
58
|
+
/** AI model tiers - SSOT for tier-based model resolution */
|
|
59
|
+
declare const AI_TIERS: {
|
|
60
|
+
readonly FAST: {
|
|
61
|
+
readonly id: "fast";
|
|
62
|
+
readonly defaultModel: "claude-haiku-4-5-20251001";
|
|
63
|
+
};
|
|
64
|
+
readonly STANDARD: {
|
|
65
|
+
readonly id: "standard";
|
|
66
|
+
readonly defaultModel: "claude-sonnet-4-6";
|
|
67
|
+
};
|
|
68
|
+
readonly PREMIUM: {
|
|
69
|
+
readonly id: "premium";
|
|
70
|
+
readonly defaultModel: "claude-opus-4-6";
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
/** AI tier identifier derived from AI_TIERS constant. */
|
|
74
|
+
type AITierId = (typeof AI_TIERS)[keyof typeof AI_TIERS]['id'];
|
|
75
|
+
/** Default markup multiplier (provider cost x 4 = billed cost) */
|
|
76
|
+
declare const DEFAULT_AI_MARKUP = 4;
|
|
77
|
+
/**
|
|
78
|
+
* Token pricing per model (USD per 1M tokens).
|
|
79
|
+
* SSOT - imported by both client (cost display) and server (cost recording).
|
|
80
|
+
*/
|
|
81
|
+
declare const AI_TOKEN_PRICING: Record<string, {
|
|
82
|
+
promptPer1M: number;
|
|
83
|
+
completionPer1M: number;
|
|
84
|
+
currency: 'usd';
|
|
85
|
+
}>;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @fileoverview AI Schemas
|
|
89
|
+
* @description Valibot schemas for AI request/response validation.
|
|
90
|
+
*
|
|
91
|
+
* @version 0.1.0
|
|
92
|
+
* @since 0.1.0
|
|
93
|
+
* @author AMBROISE PARK Consulting
|
|
94
|
+
*/
|
|
95
|
+
|
|
96
|
+
/** Schema for a single AI message */
|
|
97
|
+
declare const AIMessageSchema: v.ObjectSchema<{
|
|
98
|
+
readonly role: v.PicklistSchema<["user", "assistant", "system"], undefined>;
|
|
99
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
100
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
101
|
+
readonly createdAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
102
|
+
}, undefined>;
|
|
103
|
+
/** Schema for an AI tool definition */
|
|
104
|
+
declare const AIToolDefinitionSchema: v.ObjectSchema<{
|
|
105
|
+
readonly description: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
106
|
+
readonly parameters: v.ObjectSchema<{
|
|
107
|
+
readonly type: v.LiteralSchema<"object", undefined>;
|
|
108
|
+
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.GenericSchema<any>, undefined>;
|
|
109
|
+
readonly required: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
110
|
+
}, undefined>;
|
|
111
|
+
}, undefined>;
|
|
112
|
+
/** Schema for a tool call result */
|
|
113
|
+
declare const AIToolCallSchema: v.ObjectSchema<{
|
|
114
|
+
readonly id: v.StringSchema<undefined>;
|
|
115
|
+
readonly name: v.StringSchema<undefined>;
|
|
116
|
+
readonly args: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
|
|
117
|
+
}, undefined>;
|
|
118
|
+
/** Schema for AI chat request (client → server) */
|
|
119
|
+
declare const AIChatRequestSchema: v.ObjectSchema<{
|
|
120
|
+
readonly messages: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
121
|
+
readonly role: v.PicklistSchema<["user", "assistant", "system"], undefined>;
|
|
122
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
123
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
124
|
+
readonly createdAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
125
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
126
|
+
role: "user" | "assistant" | "system";
|
|
127
|
+
content: string;
|
|
128
|
+
id?: string | undefined;
|
|
129
|
+
createdAt?: string | undefined;
|
|
130
|
+
}[], 1, undefined>]>;
|
|
131
|
+
readonly provider: v.OptionalSchema<v.PicklistSchema<["anthropic", "openai", "google"], undefined>, undefined>;
|
|
132
|
+
readonly model: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
133
|
+
readonly maxTokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
134
|
+
readonly temperature: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 2, undefined>]>, undefined>;
|
|
135
|
+
readonly systemPrompt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
136
|
+
readonly stream: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
137
|
+
readonly tools: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
138
|
+
readonly description: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
139
|
+
readonly parameters: v.ObjectSchema<{
|
|
140
|
+
readonly type: v.LiteralSchema<"object", undefined>;
|
|
141
|
+
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.GenericSchema<any>, undefined>;
|
|
142
|
+
readonly required: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
143
|
+
}, undefined>;
|
|
144
|
+
}, undefined>, undefined>, undefined>;
|
|
145
|
+
}, undefined>;
|
|
146
|
+
/** Schema for AI token usage */
|
|
147
|
+
declare const AIUsageSchema: v.ObjectSchema<{
|
|
148
|
+
readonly promptTokens: v.NumberSchema<undefined>;
|
|
149
|
+
readonly completionTokens: v.NumberSchema<undefined>;
|
|
150
|
+
readonly totalTokens: v.NumberSchema<undefined>;
|
|
151
|
+
}, undefined>;
|
|
152
|
+
/** Schema for AI chat response (server → client, non-streaming) */
|
|
153
|
+
declare const AIChatResponseSchema: v.ObjectSchema<{
|
|
154
|
+
readonly message: v.ObjectSchema<{
|
|
155
|
+
readonly role: v.PicklistSchema<["user", "assistant", "system"], undefined>;
|
|
156
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
157
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
158
|
+
readonly createdAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
159
|
+
}, undefined>;
|
|
160
|
+
readonly usage: v.OptionalSchema<v.ObjectSchema<{
|
|
161
|
+
readonly promptTokens: v.NumberSchema<undefined>;
|
|
162
|
+
readonly completionTokens: v.NumberSchema<undefined>;
|
|
163
|
+
readonly totalTokens: v.NumberSchema<undefined>;
|
|
164
|
+
}, undefined>, undefined>;
|
|
165
|
+
readonly finishReason: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
166
|
+
readonly toolCalls: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
167
|
+
readonly id: v.StringSchema<undefined>;
|
|
168
|
+
readonly name: v.StringSchema<undefined>;
|
|
169
|
+
readonly args: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
|
|
170
|
+
}, undefined>, undefined>, undefined>;
|
|
171
|
+
}, undefined>;
|
|
172
|
+
/** Schema for AI provider configuration (consumer's _shared/aiConfig.ts) */
|
|
173
|
+
declare const AIProviderConfigSchema: v.ObjectSchema<{
|
|
174
|
+
readonly provider: v.PicklistSchema<["anthropic", "openai", "google"], undefined>;
|
|
175
|
+
readonly model: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
176
|
+
readonly maxTokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
177
|
+
readonly temperature: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 2, undefined>]>, undefined>;
|
|
178
|
+
readonly systemPrompt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
179
|
+
}, undefined>;
|
|
180
|
+
/** A single message in an AI chat conversation. */
|
|
181
|
+
type AIMessage = v.InferOutput<typeof AIMessageSchema>;
|
|
182
|
+
/** Request payload for an AI chat completion. */
|
|
183
|
+
type AIChatRequest = v.InferOutput<typeof AIChatRequestSchema>;
|
|
184
|
+
/** Token usage statistics for an AI completion. */
|
|
185
|
+
type AIUsage = v.InferOutput<typeof AIUsageSchema>;
|
|
186
|
+
/** Response payload from an AI chat completion. */
|
|
187
|
+
type AIChatResponse = v.InferOutput<typeof AIChatResponseSchema>;
|
|
188
|
+
/** Configuration for an AI provider backend. */
|
|
189
|
+
type AIProviderConfig = v.InferOutput<typeof AIProviderConfigSchema>;
|
|
190
|
+
declare function validateAIChatRequest(data: unknown): v.SafeParseResult<v.ObjectSchema<{
|
|
191
|
+
readonly messages: v.SchemaWithPipe<readonly [v.ArraySchema<v.ObjectSchema<{
|
|
192
|
+
readonly role: v.PicklistSchema<["user", "assistant", "system"], undefined>;
|
|
193
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
194
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
195
|
+
readonly createdAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
196
|
+
}, undefined>, undefined>, v.MinLengthAction<{
|
|
197
|
+
role: "user" | "assistant" | "system";
|
|
198
|
+
content: string;
|
|
199
|
+
id?: string | undefined;
|
|
200
|
+
createdAt?: string | undefined;
|
|
201
|
+
}[], 1, undefined>]>;
|
|
202
|
+
readonly provider: v.OptionalSchema<v.PicklistSchema<["anthropic", "openai", "google"], undefined>, undefined>;
|
|
203
|
+
readonly model: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
204
|
+
readonly maxTokens: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
205
|
+
readonly temperature: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 2, undefined>]>, undefined>;
|
|
206
|
+
readonly systemPrompt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
207
|
+
readonly stream: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
208
|
+
readonly tools: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
209
|
+
readonly description: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
210
|
+
readonly parameters: v.ObjectSchema<{
|
|
211
|
+
readonly type: v.LiteralSchema<"object", undefined>;
|
|
212
|
+
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.GenericSchema<any>, undefined>;
|
|
213
|
+
readonly required: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
214
|
+
}, undefined>;
|
|
215
|
+
}, undefined>, undefined>, undefined>;
|
|
216
|
+
}, undefined>>;
|
|
217
|
+
declare function validateAIChatResponse(data: unknown): v.SafeParseResult<v.ObjectSchema<{
|
|
218
|
+
readonly message: v.ObjectSchema<{
|
|
219
|
+
readonly role: v.PicklistSchema<["user", "assistant", "system"], undefined>;
|
|
220
|
+
readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
221
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
222
|
+
readonly createdAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
223
|
+
}, undefined>;
|
|
224
|
+
readonly usage: v.OptionalSchema<v.ObjectSchema<{
|
|
225
|
+
readonly promptTokens: v.NumberSchema<undefined>;
|
|
226
|
+
readonly completionTokens: v.NumberSchema<undefined>;
|
|
227
|
+
readonly totalTokens: v.NumberSchema<undefined>;
|
|
228
|
+
}, undefined>, undefined>;
|
|
229
|
+
readonly finishReason: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
230
|
+
readonly toolCalls: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
231
|
+
readonly id: v.StringSchema<undefined>;
|
|
232
|
+
readonly name: v.StringSchema<undefined>;
|
|
233
|
+
readonly args: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
|
|
234
|
+
}, undefined>, undefined>, undefined>;
|
|
235
|
+
}, undefined>>;
|
|
236
|
+
|
|
237
|
+
/** AI provider type */
|
|
238
|
+
type AIProvider = (typeof AI_PROVIDERS)[keyof typeof AI_PROVIDERS];
|
|
239
|
+
/** AI error code type (derived from AI_ERROR_CODES constant) */
|
|
240
|
+
type AIErrorCode = (typeof AI_ERROR_CODES)[keyof typeof AI_ERROR_CODES];
|
|
241
|
+
/** Configuration for AI feature (consumer-facing) */
|
|
242
|
+
interface AIConfig {
|
|
243
|
+
provider: AIProvider;
|
|
244
|
+
model?: string;
|
|
245
|
+
maxTokens?: number;
|
|
246
|
+
temperature?: number;
|
|
247
|
+
systemPrompt?: string;
|
|
248
|
+
}
|
|
249
|
+
/** Per-model token pricing */
|
|
250
|
+
interface AIModelPricing {
|
|
251
|
+
/** Cost per 1M input tokens in USD */
|
|
252
|
+
promptPer1M: number;
|
|
253
|
+
/** Cost per 1M output tokens in USD */
|
|
254
|
+
completionPer1M: number;
|
|
255
|
+
/** Currency code */
|
|
256
|
+
currency: 'usd';
|
|
257
|
+
}
|
|
258
|
+
/** Cost calculation result */
|
|
259
|
+
interface AICostResult {
|
|
260
|
+
/** Raw provider cost in USD (server-side only, never expose to end users) */
|
|
261
|
+
providerCost: number;
|
|
262
|
+
/** Marked-up cost for consumer billing (what users owe) */
|
|
263
|
+
billedCost: number;
|
|
264
|
+
/** Markup multiplier applied */
|
|
265
|
+
markup: number;
|
|
266
|
+
/** Breakdown */
|
|
267
|
+
breakdown: {
|
|
268
|
+
promptTokens: number;
|
|
269
|
+
completionTokens: number;
|
|
270
|
+
promptCost: number;
|
|
271
|
+
completionCost: number;
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
/** Consumer-facing cost configuration */
|
|
275
|
+
interface AICostConfig {
|
|
276
|
+
/** Markup multiplier for rebilling (provider cost x markup = billed cost) */
|
|
277
|
+
markup: number;
|
|
278
|
+
/** Monthly token budget per user (0 = unlimited) */
|
|
279
|
+
monthlyBudgetTokens: number;
|
|
280
|
+
/** Whether to show cost to end users (false = admin only) */
|
|
281
|
+
showCostToUsers: boolean;
|
|
282
|
+
/** Currency for display */
|
|
283
|
+
displayCurrency: string;
|
|
284
|
+
}
|
|
285
|
+
/** Server-side cost record (written per AI request) */
|
|
286
|
+
interface AICostRecord {
|
|
287
|
+
userId: string;
|
|
288
|
+
model: string;
|
|
289
|
+
provider: string;
|
|
290
|
+
usage: AIUsage;
|
|
291
|
+
providerCost: number;
|
|
292
|
+
billedCost: number;
|
|
293
|
+
markup: number;
|
|
294
|
+
timestamp: string;
|
|
295
|
+
requestId: string;
|
|
296
|
+
}
|
|
297
|
+
/** Real-time cost event for billing integration */
|
|
298
|
+
interface AICostEvent {
|
|
299
|
+
type: 'cost_update';
|
|
300
|
+
requestId: string;
|
|
301
|
+
cost: AICostResult;
|
|
302
|
+
cumulative: AICostResult;
|
|
303
|
+
}
|
|
304
|
+
/** JSON Schema property definition for AI tool parameters */
|
|
305
|
+
interface AIToolParameter {
|
|
306
|
+
/** JSON Schema type */
|
|
307
|
+
type: 'string' | 'number' | 'boolean' | 'array' | 'object';
|
|
308
|
+
/** Parameter description (sent to the model) */
|
|
309
|
+
description?: string;
|
|
310
|
+
/** Enum constraint */
|
|
311
|
+
enum?: string[];
|
|
312
|
+
/** Array items schema */
|
|
313
|
+
items?: AIToolParameter;
|
|
314
|
+
/** Object properties */
|
|
315
|
+
properties?: Record<string, AIToolParameter>;
|
|
316
|
+
/** Required property names (for object type) */
|
|
317
|
+
required?: string[];
|
|
318
|
+
}
|
|
319
|
+
/** AI tool definition - JSON Schema based, provider-agnostic */
|
|
320
|
+
interface AIToolDefinition {
|
|
321
|
+
/** Tool description (sent to the model) */
|
|
322
|
+
description: string;
|
|
323
|
+
/** Tool parameters as JSON Schema object */
|
|
324
|
+
parameters: {
|
|
325
|
+
type: 'object';
|
|
326
|
+
properties: Record<string, AIToolParameter>;
|
|
327
|
+
required?: string[];
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
/** Result of a tool call made by the model */
|
|
331
|
+
interface AIToolCall {
|
|
332
|
+
/** Tool call ID (from provider) */
|
|
333
|
+
id: string;
|
|
334
|
+
/** Tool name */
|
|
335
|
+
name: string;
|
|
336
|
+
/** Parsed arguments */
|
|
337
|
+
args: Record<string, unknown>;
|
|
338
|
+
}
|
|
339
|
+
/** AI API surface - returned by useAIChat, degraded when @donotdev/ai not installed */
|
|
340
|
+
interface AIAPI {
|
|
341
|
+
/** Conversation messages */
|
|
342
|
+
messages: AIMessage[];
|
|
343
|
+
/** Send a message */
|
|
344
|
+
append: (content: string) => void;
|
|
345
|
+
/** Stop current stream */
|
|
346
|
+
stop: () => void;
|
|
347
|
+
/** Whether a response is streaming */
|
|
348
|
+
isLoading: boolean;
|
|
349
|
+
/** Current error */
|
|
350
|
+
error: Error | undefined;
|
|
351
|
+
/** Clear conversation */
|
|
352
|
+
clearMessages: () => void;
|
|
353
|
+
/** Whether AI is available (auth + consent) */
|
|
354
|
+
isAvailable: boolean;
|
|
355
|
+
/** Current input value (controlled) */
|
|
356
|
+
input: string;
|
|
357
|
+
/** Set input value */
|
|
358
|
+
setInput: (value: string) => void;
|
|
359
|
+
/** Submit the current input */
|
|
360
|
+
handleSubmit: (e?: any) => void;
|
|
361
|
+
/** Cost tracking (billed cost only - provider cost is server-side only) */
|
|
362
|
+
cost: {
|
|
363
|
+
lastCost: AICostResult | null;
|
|
364
|
+
sessionCost: AICostResult;
|
|
365
|
+
formattedBilledCost: string;
|
|
366
|
+
};
|
|
367
|
+
/** Tool calls from the latest assistant response */
|
|
368
|
+
toolCalls: AIToolCall[];
|
|
369
|
+
}
|
|
370
|
+
/** Rate limit configuration for AI handler */
|
|
371
|
+
interface AIRateLimitConfig {
|
|
372
|
+
/** Maximum requests per window */
|
|
373
|
+
maxRequests: number;
|
|
374
|
+
/** Window duration in milliseconds */
|
|
375
|
+
windowMs: number;
|
|
376
|
+
}
|
|
377
|
+
/** AI route configuration (server-side) */
|
|
378
|
+
interface AIRouteConfig {
|
|
379
|
+
/** AI provider */
|
|
380
|
+
provider: AIProvider;
|
|
381
|
+
/** Model ID */
|
|
382
|
+
model?: string;
|
|
383
|
+
/** Max output tokens */
|
|
384
|
+
maxTokens?: number;
|
|
385
|
+
/** Temperature */
|
|
386
|
+
temperature?: number;
|
|
387
|
+
/** System prompt */
|
|
388
|
+
systemPrompt?: string;
|
|
389
|
+
/** Cost configuration */
|
|
390
|
+
cost?: AICostConfig;
|
|
391
|
+
/** Rate limit configuration */
|
|
392
|
+
rateLimitConfig?: AIRateLimitConfig;
|
|
393
|
+
/** Tool definitions available to the model */
|
|
394
|
+
tools?: Record<string, AIToolDefinition>;
|
|
395
|
+
}
|
|
4
396
|
|
|
5
397
|
/**
|
|
6
398
|
* @fileoverview Partners Constants
|
|
@@ -747,10 +1139,10 @@ declare const OAUTH_PARTNERS: {
|
|
|
747
1139
|
readonly codeChallengeMethod: "S256";
|
|
748
1140
|
};
|
|
749
1141
|
readonly button: {
|
|
750
|
-
readonly backgroundColor: "#
|
|
751
|
-
readonly textColor: "#
|
|
752
|
-
readonly borderColor: "#
|
|
753
|
-
readonly hoverBackgroundColor: "#
|
|
1142
|
+
readonly backgroundColor: "#F1F3F5";
|
|
1143
|
+
readonly textColor: "#11181C";
|
|
1144
|
+
readonly borderColor: "#E6E8EB";
|
|
1145
|
+
readonly hoverBackgroundColor: "#E6E8EB";
|
|
754
1146
|
readonly focusOutlineColor: "#3ECF8E";
|
|
755
1147
|
readonly fontWeight: "500";
|
|
756
1148
|
};
|
|
@@ -775,11 +1167,11 @@ declare const OAUTH_PARTNERS: {
|
|
|
775
1167
|
readonly codeChallengeMethod: "S256";
|
|
776
1168
|
};
|
|
777
1169
|
readonly button: {
|
|
778
|
-
readonly backgroundColor: "#
|
|
779
|
-
readonly textColor: "#
|
|
780
|
-
readonly borderColor: "#
|
|
781
|
-
readonly hoverBackgroundColor: "#
|
|
782
|
-
readonly focusOutlineColor: "#
|
|
1170
|
+
readonly backgroundColor: "#ffffff";
|
|
1171
|
+
readonly textColor: "#000000";
|
|
1172
|
+
readonly borderColor: "#d1d5db";
|
|
1173
|
+
readonly hoverBackgroundColor: "#f9fafb";
|
|
1174
|
+
readonly focusOutlineColor: "#3b82f6";
|
|
783
1175
|
readonly fontWeight: "500";
|
|
784
1176
|
};
|
|
785
1177
|
};
|
|
@@ -911,7 +1303,6 @@ declare function isOAuthPartnerId(id: PartnerId): id is OAuthPartnerId;
|
|
|
911
1303
|
* @since 0.0.1
|
|
912
1304
|
* @author AMBROISE PARK Consulting
|
|
913
1305
|
*/
|
|
914
|
-
|
|
915
1306
|
/**
|
|
916
1307
|
* Shared primitives for auth and oauth partner flows
|
|
917
1308
|
*
|
|
@@ -942,22 +1333,6 @@ interface PartnerConnectionState {
|
|
|
942
1333
|
isConnected: boolean;
|
|
943
1334
|
error: Error | null;
|
|
944
1335
|
}
|
|
945
|
-
/**
|
|
946
|
-
* Result of an authentication operation with a specific partner
|
|
947
|
-
*
|
|
948
|
-
* @version 0.1.0
|
|
949
|
-
* @since 0.0.1
|
|
950
|
-
* @author AMBROISE PARK Consulting
|
|
951
|
-
*/
|
|
952
|
-
interface PartnerButton {
|
|
953
|
-
className?: string;
|
|
954
|
-
children?: ReactNode;
|
|
955
|
-
variant?: 'default' | 'outline' | 'ghost' | 'link' | 'icon';
|
|
956
|
-
size?: 'sm' | 'md' | 'lg';
|
|
957
|
-
disabled?: boolean;
|
|
958
|
-
loading?: boolean;
|
|
959
|
-
onError?: (error: Error) => void;
|
|
960
|
-
}
|
|
961
1336
|
|
|
962
1337
|
/**
|
|
963
1338
|
* @fileoverview Authentication Constants
|
|
@@ -1475,14 +1850,14 @@ interface IServerAuthAdapter {
|
|
|
1475
1850
|
}
|
|
1476
1851
|
|
|
1477
1852
|
/**
|
|
1478
|
-
* @fileoverview Layout
|
|
1479
|
-
* @description
|
|
1853
|
+
* @fileoverview Layout Constants
|
|
1854
|
+
* @description Shared constants and derived types used by both layoutTypes and presetConfig.
|
|
1855
|
+
* Extracted to break circular dependency.
|
|
1480
1856
|
*
|
|
1481
1857
|
* @version 0.1.0
|
|
1482
1858
|
* @since 0.0.1
|
|
1483
1859
|
* @author AMBROISE PARK Consulting
|
|
1484
1860
|
*/
|
|
1485
|
-
|
|
1486
1861
|
/**
|
|
1487
1862
|
* Default layout preset - single source of truth
|
|
1488
1863
|
*
|
|
@@ -1491,6 +1866,21 @@ interface IServerAuthAdapter {
|
|
|
1491
1866
|
* @author AMBROISE PARK Consulting
|
|
1492
1867
|
*/
|
|
1493
1868
|
declare const DEFAULT_LAYOUT_PRESET: "landing";
|
|
1869
|
+
/**
|
|
1870
|
+
* Footer mode constants - DRY single source of truth
|
|
1871
|
+
*
|
|
1872
|
+
* @version 0.1.0
|
|
1873
|
+
* @since 0.0.1
|
|
1874
|
+
* @author AMBROISE PARK Consulting
|
|
1875
|
+
*/
|
|
1876
|
+
declare const FOOTER_MODE: {
|
|
1877
|
+
readonly FIXED: "fixed";
|
|
1878
|
+
readonly SCROLL: "scroll";
|
|
1879
|
+
};
|
|
1880
|
+
/**
|
|
1881
|
+
* Footer mode type - auto-derived from constants
|
|
1882
|
+
*/
|
|
1883
|
+
type FooterMode = (typeof FOOTER_MODE)[keyof typeof FOOTER_MODE];
|
|
1494
1884
|
/**
|
|
1495
1885
|
* Layout preset constants - DRY single source of truth
|
|
1496
1886
|
* Use these instead of hardcoded strings throughout the codebase
|
|
@@ -1517,6 +1907,187 @@ declare const LAYOUT_PRESET: {
|
|
|
1517
1907
|
* @author AMBROISE PARK Consulting
|
|
1518
1908
|
*/
|
|
1519
1909
|
type LayoutPreset = (typeof LAYOUT_PRESET)[keyof typeof LAYOUT_PRESET] | string;
|
|
1910
|
+
|
|
1911
|
+
/**
|
|
1912
|
+
* @fileoverview Preset Configuration Types
|
|
1913
|
+
* @description Config-based preset system types. Presets are configuration objects
|
|
1914
|
+
* that declare what components go in which slots, replacing the component-based approach.
|
|
1915
|
+
*
|
|
1916
|
+
* @version 0.1.0
|
|
1917
|
+
* @since 0.0.1
|
|
1918
|
+
* @author AMBROISE PARK Consulting
|
|
1919
|
+
*/
|
|
1920
|
+
|
|
1921
|
+
/**
|
|
1922
|
+
* Slot content function - returns ReactNode or null
|
|
1923
|
+
*
|
|
1924
|
+
* Presets use functions that return ReactNode, same API as consumers.
|
|
1925
|
+
* Return null to explicitly hide the slot.
|
|
1926
|
+
*/
|
|
1927
|
+
type SlotContent = () => ReactNode | null;
|
|
1928
|
+
/**
|
|
1929
|
+
* Header zone configuration
|
|
1930
|
+
*
|
|
1931
|
+
* Grid-based layout with start/center/end areas.
|
|
1932
|
+
* - start: start-aligned (typically branding: AppIcon, AppTitle)
|
|
1933
|
+
* - center: absolutely centered (overlay, regardless of start/end content)
|
|
1934
|
+
* - end: end-aligned (typically actions: GoTo, Auth, Language, Theme)
|
|
1935
|
+
*/
|
|
1936
|
+
interface HeaderZoneConfig {
|
|
1937
|
+
/** Start slot - start-aligned, typically branding (AppIcon, AppTitle) */
|
|
1938
|
+
start?: SlotContent;
|
|
1939
|
+
/** Center slot - absolutely centered overlay, optional (navigation, search) */
|
|
1940
|
+
center?: SlotContent;
|
|
1941
|
+
/** End slot - end-aligned, typically actions (GoTo, Auth, Language, Theme) */
|
|
1942
|
+
end?: SlotContent;
|
|
1943
|
+
}
|
|
1944
|
+
/**
|
|
1945
|
+
* Sidebar zone configuration
|
|
1946
|
+
*
|
|
1947
|
+
* Vertical layout with top/content/bottom areas.
|
|
1948
|
+
* All sidebars use ResizableSidebar wrapper.
|
|
1949
|
+
*/
|
|
1950
|
+
interface SidebarZoneConfig {
|
|
1951
|
+
/** Top slot - branding, search */
|
|
1952
|
+
top?: SlotContent;
|
|
1953
|
+
/** Content slot - main scrollable area (defaults to NavigationMenu) */
|
|
1954
|
+
content?: SlotContent;
|
|
1955
|
+
/** Bottom slot - user profile, settings */
|
|
1956
|
+
bottom?: SlotContent;
|
|
1957
|
+
/** Default sidebar width in pixels */
|
|
1958
|
+
defaultWidth?: number;
|
|
1959
|
+
/** Minimum width when resizing */
|
|
1960
|
+
minWidth?: number;
|
|
1961
|
+
/** Maximum width when resizing */
|
|
1962
|
+
maxWidth?: number;
|
|
1963
|
+
}
|
|
1964
|
+
/**
|
|
1965
|
+
* Footer zone configuration
|
|
1966
|
+
*
|
|
1967
|
+
* Simple footer: Copyright (left) | LegalLinks + DoNotDev (right)
|
|
1968
|
+
* - `null`: Hide footer
|
|
1969
|
+
* - `undefined`: Use defaults (copyright + legal links + DoNotDev)
|
|
1970
|
+
* - `{ copyright?: ..., legalLinks?: ... }`: Custom configuration
|
|
1971
|
+
*/
|
|
1972
|
+
interface FooterConfig {
|
|
1973
|
+
/** Copyright configuration
|
|
1974
|
+
* - `null`: Hide copyright
|
|
1975
|
+
* - `undefined`: Use default (© YEAR appName. All rights reserved)
|
|
1976
|
+
* - `string`: Custom copyright text
|
|
1977
|
+
*/
|
|
1978
|
+
copyright?: null | string;
|
|
1979
|
+
/** Legal links configuration
|
|
1980
|
+
* - `null`: Hide legal links
|
|
1981
|
+
* - `Array<{ path, label }>`: Custom legal links
|
|
1982
|
+
* - `undefined`: Use framework defaults
|
|
1983
|
+
*/
|
|
1984
|
+
legalLinks?: null | Array<{
|
|
1985
|
+
path: string;
|
|
1986
|
+
label: string;
|
|
1987
|
+
}>;
|
|
1988
|
+
}
|
|
1989
|
+
/**
|
|
1990
|
+
* Footer zone configuration
|
|
1991
|
+
*
|
|
1992
|
+
* - `FooterConfig` object: configure DnDevFooter (copyright, legal links)
|
|
1993
|
+
* - `SlotContent` function: replace DnDevFooter with custom component
|
|
1994
|
+
* - `null`: hide footer
|
|
1995
|
+
* - `undefined`: use defaults
|
|
1996
|
+
*/
|
|
1997
|
+
type FooterZoneConfig = FooterConfig | SlotContent | null;
|
|
1998
|
+
/**
|
|
1999
|
+
* MergedBar configuration for mobile
|
|
2000
|
+
*
|
|
2001
|
+
* Fixed trigger bar that opens a Sheet with navigation content.
|
|
2002
|
+
* Each slot is customizable per-preset, with smart defaults.
|
|
2003
|
+
*/
|
|
2004
|
+
interface MergedBarConfig {
|
|
2005
|
+
/** Position of the trigger bar */
|
|
2006
|
+
position: 'top' | 'bottom';
|
|
2007
|
+
/** Height of the trigger bar (default: 64px for top, 48px for bottom) */
|
|
2008
|
+
height?: string;
|
|
2009
|
+
/** Trigger bar content (default: header.start for top, footer-like for bottom) */
|
|
2010
|
+
trigger?: SlotContent;
|
|
2011
|
+
/** Sheet top slot */
|
|
2012
|
+
top?: SlotContent;
|
|
2013
|
+
/** Sheet content slot - scrollable (default: sidebar.content) */
|
|
2014
|
+
content?: SlotContent;
|
|
2015
|
+
/** Sheet bottom slot (default: sidebar.bottom) */
|
|
2016
|
+
bottom?: SlotContent;
|
|
2017
|
+
}
|
|
2018
|
+
/**
|
|
2019
|
+
* Mobile behavior configuration
|
|
2020
|
+
*
|
|
2021
|
+
* Defines how the layout adapts on mobile/tablet breakpoints.
|
|
2022
|
+
*/
|
|
2023
|
+
interface MobileBehaviorConfig {
|
|
2024
|
+
/** Breakpoint at which mobile behavior activates (default: 1024px) */
|
|
2025
|
+
breakpoint?: number;
|
|
2026
|
+
/** Header slot overrides for mobile (overrides desktop header slots) */
|
|
2027
|
+
header?: HeaderZoneConfig;
|
|
2028
|
+
/** Sidebar slot overrides for mobile (overrides desktop sidebar slots) */
|
|
2029
|
+
sidebar?: SidebarZoneConfig;
|
|
2030
|
+
/** MergedBar configuration - replaces header/footer with sheet trigger */
|
|
2031
|
+
mergedBar?: MergedBarConfig;
|
|
2032
|
+
}
|
|
2033
|
+
/**
|
|
2034
|
+
* Complete preset configuration
|
|
2035
|
+
*
|
|
2036
|
+
* Declarative configuration for a layout preset.
|
|
2037
|
+
* Uses function-based slots, same API as consumers.
|
|
2038
|
+
*
|
|
2039
|
+
* @example
|
|
2040
|
+
* ```typescript
|
|
2041
|
+
* const landingPreset: PresetConfig = {
|
|
2042
|
+
* name: 'landing',
|
|
2043
|
+
* header: {
|
|
2044
|
+
* start: () => <AppBranding />,
|
|
2045
|
+
* center: () => null,
|
|
2046
|
+
* end: () => (
|
|
2047
|
+
* <>
|
|
2048
|
+
* <GoTo />
|
|
2049
|
+
* <AuthHeader />
|
|
2050
|
+
* </>
|
|
2051
|
+
* ),
|
|
2052
|
+
* },
|
|
2053
|
+
* mobile: {
|
|
2054
|
+
* header: {
|
|
2055
|
+
* end: () => <HeaderMenu>{desktop end content}</HeaderMenu>,
|
|
2056
|
+
* },
|
|
2057
|
+
* },
|
|
2058
|
+
* };
|
|
2059
|
+
* ```
|
|
2060
|
+
*/
|
|
2061
|
+
interface PresetConfig {
|
|
2062
|
+
/** Preset identifier (must match LayoutPreset type) */
|
|
2063
|
+
name: LayoutPreset;
|
|
2064
|
+
/** Header zone configuration (undefined = use defaults, object = override slots, function = custom mode) */
|
|
2065
|
+
header?: HeaderZoneConfig | SlotContent;
|
|
2066
|
+
/** Sidebar zone configuration (undefined = use defaults, object = override slots, function = custom mode) */
|
|
2067
|
+
sidebar?: SidebarZoneConfig | SlotContent;
|
|
2068
|
+
/** Footer zone configuration (undefined = use defaults, object = override) */
|
|
2069
|
+
footer?: FooterZoneConfig;
|
|
2070
|
+
/** Footer scroll behavior override for this preset */
|
|
2071
|
+
footerMode?: FooterMode;
|
|
2072
|
+
/** Mobile behavior configuration */
|
|
2073
|
+
mobile?: MobileBehaviorConfig;
|
|
2074
|
+
}
|
|
2075
|
+
/**
|
|
2076
|
+
* Preset registry type
|
|
2077
|
+
*
|
|
2078
|
+
* Maps preset names to their configurations.
|
|
2079
|
+
*/
|
|
2080
|
+
type PresetRegistry = Record<LayoutPreset, PresetConfig>;
|
|
2081
|
+
|
|
2082
|
+
/**
|
|
2083
|
+
* @fileoverview Layout Types
|
|
2084
|
+
* @description Type definitions for layout system. Defines layout presets, layout configuration, zone configuration, and layout-related interfaces.
|
|
2085
|
+
*
|
|
2086
|
+
* @version 0.1.0
|
|
2087
|
+
* @since 0.0.1
|
|
2088
|
+
* @author AMBROISE PARK Consulting
|
|
2089
|
+
*/
|
|
2090
|
+
|
|
1520
2091
|
/**
|
|
1521
2092
|
* Layout preset string literals
|
|
1522
2093
|
*
|
|
@@ -1620,7 +2191,7 @@ interface LayoutConfig {
|
|
|
1620
2191
|
* - 'fixed': Footer stays at viewport bottom (default on desktop)
|
|
1621
2192
|
* - 'scroll': Footer scrolls with content (default on mobile, optional on desktop)
|
|
1622
2193
|
*/
|
|
1623
|
-
footerMode?:
|
|
2194
|
+
footerMode?: FooterMode;
|
|
1624
2195
|
/** Header override - full component or slot overrides */
|
|
1625
2196
|
header?: DnDevOverride | {
|
|
1626
2197
|
start?: DnDevOverride;
|
|
@@ -1755,14 +2326,16 @@ interface AppMetadata {
|
|
|
1755
2326
|
* @author AMBROISE PARK Consulting
|
|
1756
2327
|
*/
|
|
1757
2328
|
interface AuthConfig {
|
|
1758
|
-
/** Route to redirect when authentication required (default: '/
|
|
1759
|
-
authRoute
|
|
2329
|
+
/** Route to redirect when authentication required (default: '/') */
|
|
2330
|
+
authRoute?: string;
|
|
1760
2331
|
/** Route to redirect when role insufficient (default: '/404') */
|
|
1761
2332
|
roleRoute: string;
|
|
1762
2333
|
/** Route to redirect when tier insufficient (default: '/404') */
|
|
1763
2334
|
tierRoute: string;
|
|
1764
2335
|
/** Optional: Path to login page. If provided, AuthHeader links to login page. If undefined (default), shows providers in header */
|
|
1765
2336
|
loginPath?: string;
|
|
2337
|
+
/** Optional: Path to password reset callback page (default: '/auth/reset-password'). Framework auto-handles the route. */
|
|
2338
|
+
resetPasswordPath?: string;
|
|
1766
2339
|
/** Optional: Path to profile page (default: '/profile') */
|
|
1767
2340
|
profilePath?: string;
|
|
1768
2341
|
/**
|
|
@@ -1858,7 +2431,7 @@ interface SEOConfig {
|
|
|
1858
2431
|
}>;
|
|
1859
2432
|
/**
|
|
1860
2433
|
* AI crawler management in robots.txt (default: 'recommended')
|
|
1861
|
-
* - 'recommended': Block training bots (GPTBot, Google-Extended, CCBot,
|
|
2434
|
+
* - 'recommended': Block training bots (GPTBot, Google-Extended, CCBot, ClaudeBot),
|
|
1862
2435
|
* allow search/retrieval bots (OAI-SearchBot, ChatGPT-User, Claude-SearchBot, etc.)
|
|
1863
2436
|
* - 'block-all': Block all AI bots
|
|
1864
2437
|
* - 'allow-all': Allow all AI bots
|
|
@@ -2053,6 +2626,7 @@ interface QueryConfig {
|
|
|
2053
2626
|
/** Mutation retry delay function (default: exponential backoff) */
|
|
2054
2627
|
mutationRetryDelay?: (attemptIndex: number) => number;
|
|
2055
2628
|
}
|
|
2629
|
+
/** Top-level application configuration passed to DoNotDevProvider. */
|
|
2056
2630
|
interface AppConfig {
|
|
2057
2631
|
/** App metadata and branding */
|
|
2058
2632
|
app?: AppMetadata;
|
|
@@ -2064,6 +2638,8 @@ interface AppConfig {
|
|
|
2064
2638
|
favicon?: FaviconConfig | false;
|
|
2065
2639
|
/** Layout preset for store initialization (defaults to 'landing' if invalid/empty) */
|
|
2066
2640
|
preset?: string;
|
|
2641
|
+
/** Custom presets — same shape as built-in presets, keyed by name */
|
|
2642
|
+
customPresets?: Record<string, PresetConfig>;
|
|
2067
2643
|
/** Feature flags */
|
|
2068
2644
|
features?: FeaturesConfig;
|
|
2069
2645
|
/** Query cache configuration (defaults: 5min staleTime, refetch on focus/reconnect) */
|
|
@@ -2509,6 +3085,70 @@ type PageAuth = boolean | {
|
|
|
2509
3085
|
* };
|
|
2510
3086
|
* ```
|
|
2511
3087
|
*/
|
|
3088
|
+
/**
|
|
3089
|
+
* SEO metadata for a page
|
|
3090
|
+
* @description Controls `<title>`, meta description, Open Graph, and Twitter Cards.
|
|
3091
|
+
* All fields default to i18n lookup when undefined.
|
|
3092
|
+
*
|
|
3093
|
+
* @example i18n-first (default)
|
|
3094
|
+
* ```tsx
|
|
3095
|
+
* export const meta: PageMeta = {
|
|
3096
|
+
* namespace: 'pricing', // Uses pricing:title, pricing:description
|
|
3097
|
+
* };
|
|
3098
|
+
* ```
|
|
3099
|
+
*
|
|
3100
|
+
* @example Full title control (escape "Page | App" format)
|
|
3101
|
+
* ```tsx
|
|
3102
|
+
* export const meta: PageMeta = {
|
|
3103
|
+
* namespace: 'home',
|
|
3104
|
+
* seo: { fullTitle: 'DoNotDev - Build Apps in Minutes' },
|
|
3105
|
+
* };
|
|
3106
|
+
* ```
|
|
3107
|
+
*
|
|
3108
|
+
* @example siteName only
|
|
3109
|
+
* ```tsx
|
|
3110
|
+
* export const meta: PageMeta = {
|
|
3111
|
+
* seo: { title: null }, // → "AppName"
|
|
3112
|
+
* };
|
|
3113
|
+
* ```
|
|
3114
|
+
*
|
|
3115
|
+
* @version 0.2.0
|
|
3116
|
+
* @since 0.2.0
|
|
3117
|
+
* @author AMBROISE PARK Consulting
|
|
3118
|
+
*/
|
|
3119
|
+
interface SeoMeta {
|
|
3120
|
+
/**
|
|
3121
|
+
* Page title segment (appears as "title | siteName")
|
|
3122
|
+
* @description
|
|
3123
|
+
* - `undefined` → i18n lookup (`ns:title`)
|
|
3124
|
+
* - `string` → literal value + siteName suffix
|
|
3125
|
+
* - `null` → siteName only (no page title)
|
|
3126
|
+
*/
|
|
3127
|
+
title?: string | null;
|
|
3128
|
+
/**
|
|
3129
|
+
* Full title override (no suffix appended)
|
|
3130
|
+
* @description Escapes the "Page | App" format entirely.
|
|
3131
|
+
* Takes priority over `title` when set.
|
|
3132
|
+
*/
|
|
3133
|
+
fullTitle?: string;
|
|
3134
|
+
/**
|
|
3135
|
+
* Meta description
|
|
3136
|
+
* @description
|
|
3137
|
+
* - `undefined` → i18n lookup (`ns:description`)
|
|
3138
|
+
* - `string` → literal value
|
|
3139
|
+
* - `null` → omit meta description
|
|
3140
|
+
*/
|
|
3141
|
+
description?: string | null;
|
|
3142
|
+
/** Open Graph image URL (relative or absolute) */
|
|
3143
|
+
image?: string;
|
|
3144
|
+
/** Keywords for meta tag */
|
|
3145
|
+
keywords?: string[];
|
|
3146
|
+
/** Page type for Open Graph */
|
|
3147
|
+
type?: 'website' | 'article' | 'product';
|
|
3148
|
+
/** Exclude from search engine indexing */
|
|
3149
|
+
noindex?: boolean;
|
|
3150
|
+
}
|
|
3151
|
+
/** Page-level metadata for route discovery, auth, SEO, and navigation. */
|
|
2512
3152
|
interface PageMeta {
|
|
2513
3153
|
/** Authentication requirements for this route */
|
|
2514
3154
|
auth?: PageAuth;
|
|
@@ -2564,6 +3204,12 @@ interface PageMeta {
|
|
|
2564
3204
|
* ```
|
|
2565
3205
|
*/
|
|
2566
3206
|
hideFromMenu?: boolean;
|
|
3207
|
+
/**
|
|
3208
|
+
* Hide breadcrumbs on this page (default: false)
|
|
3209
|
+
* @description Set to true to hide framework breadcrumbs on this route
|
|
3210
|
+
* @default false
|
|
3211
|
+
*/
|
|
3212
|
+
hideBreadcrumbs?: boolean;
|
|
2567
3213
|
/**
|
|
2568
3214
|
* Layout preset override for this route
|
|
2569
3215
|
* @description When set, overrides the app's default layout preset for this route only.
|
|
@@ -2579,6 +3225,27 @@ interface PageMeta {
|
|
|
2579
3225
|
* ```
|
|
2580
3226
|
*/
|
|
2581
3227
|
preset?: LayoutPreset;
|
|
3228
|
+
/**
|
|
3229
|
+
* SEO metadata override
|
|
3230
|
+
* @description Fine-grained control over `<title>`, meta description, and Open Graph tags.
|
|
3231
|
+
* When omitted, SEO uses i18n lookup based on `namespace` (i18n-first by default).
|
|
3232
|
+
*
|
|
3233
|
+
* @example Escape "Page | App" format
|
|
3234
|
+
* ```tsx
|
|
3235
|
+
* export const meta: PageMeta = {
|
|
3236
|
+
* namespace: 'home',
|
|
3237
|
+
* seo: { fullTitle: 'DoNotDev - Build Apps in Minutes' },
|
|
3238
|
+
* };
|
|
3239
|
+
* ```
|
|
3240
|
+
*
|
|
3241
|
+
* @example siteName only (no page title)
|
|
3242
|
+
* ```tsx
|
|
3243
|
+
* export const meta: PageMeta = {
|
|
3244
|
+
* seo: { title: null },
|
|
3245
|
+
* };
|
|
3246
|
+
* ```
|
|
3247
|
+
*/
|
|
3248
|
+
seo?: SeoMeta;
|
|
2582
3249
|
}
|
|
2583
3250
|
/**
|
|
2584
3251
|
* Route metadata (discovery-generated)
|
|
@@ -3246,10 +3913,17 @@ declare const DEFAULT_SUBSCRIPTION: SubscriptionClaims;
|
|
|
3246
3913
|
* @since 0.0.1
|
|
3247
3914
|
* @author AMBROISE PARK Consulting
|
|
3248
3915
|
*/
|
|
3249
|
-
declare const CreateCheckoutSessionRequestSchema: v.ObjectSchema<{
|
|
3916
|
+
declare const CreateCheckoutSessionRequestSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
3250
3917
|
readonly userId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3251
3918
|
readonly productId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3252
|
-
|
|
3919
|
+
/** Stripe price ID (fixed pricing mode) */
|
|
3920
|
+
readonly priceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3921
|
+
/** Amount in cents (dynamic pricing mode) */
|
|
3922
|
+
readonly unitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
3923
|
+
/** Product name shown on Stripe checkout (dynamic pricing mode) */
|
|
3924
|
+
readonly productName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
3925
|
+
/** Currency code, defaults to 'eur' (dynamic pricing mode) */
|
|
3926
|
+
readonly currency: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, "Currency must be 3-letter ISO code">]>, undefined>;
|
|
3253
3927
|
readonly successUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
3254
3928
|
readonly cancelUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
3255
3929
|
readonly customerEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
|
|
@@ -3257,7 +3931,23 @@ declare const CreateCheckoutSessionRequestSchema: v.ObjectSchema<{
|
|
|
3257
3931
|
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
3258
3932
|
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
3259
3933
|
readonly mode: v.OptionalSchema<v.PicklistSchema<["payment", "subscription"], undefined>, undefined>;
|
|
3260
|
-
}, undefined
|
|
3934
|
+
}, undefined>, v.CheckAction<{
|
|
3935
|
+
userId?: string | undefined;
|
|
3936
|
+
productId?: string | undefined;
|
|
3937
|
+
priceId?: string | undefined;
|
|
3938
|
+
unitAmount?: number | undefined;
|
|
3939
|
+
productName?: string | undefined;
|
|
3940
|
+
currency?: string | undefined;
|
|
3941
|
+
successUrl: string;
|
|
3942
|
+
cancelUrl: string;
|
|
3943
|
+
customerEmail?: string | undefined;
|
|
3944
|
+
userEmail?: string | undefined;
|
|
3945
|
+
metadata?: {
|
|
3946
|
+
[x: string]: string;
|
|
3947
|
+
} | undefined;
|
|
3948
|
+
allowPromotionCodes?: boolean | undefined;
|
|
3949
|
+
mode?: "payment" | "subscription" | undefined;
|
|
3950
|
+
}, "Either priceId or (unitAmount + productName) is required">]>;
|
|
3261
3951
|
/**
|
|
3262
3952
|
* Schema for creating a checkout session response
|
|
3263
3953
|
*
|
|
@@ -3424,10 +4114,17 @@ type ProductDeclaration = v.InferOutput<typeof ProductDeclarationSchema> & {
|
|
|
3424
4114
|
* @since 0.0.1
|
|
3425
4115
|
* @author AMBROISE PARK Consulting
|
|
3426
4116
|
*/
|
|
3427
|
-
declare function validateCreateCheckoutSessionRequest(data: unknown): v.SafeParseResult<v.ObjectSchema<{
|
|
4117
|
+
declare function validateCreateCheckoutSessionRequest(data: unknown): v.SafeParseResult<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
3428
4118
|
readonly userId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3429
4119
|
readonly productId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3430
|
-
|
|
4120
|
+
/** Stripe price ID (fixed pricing mode) */
|
|
4121
|
+
readonly priceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4122
|
+
/** Amount in cents (dynamic pricing mode) */
|
|
4123
|
+
readonly unitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
4124
|
+
/** Product name shown on Stripe checkout (dynamic pricing mode) */
|
|
4125
|
+
readonly productName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4126
|
+
/** Currency code, defaults to 'eur' (dynamic pricing mode) */
|
|
4127
|
+
readonly currency: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, "Currency must be 3-letter ISO code">]>, undefined>;
|
|
3431
4128
|
readonly successUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
3432
4129
|
readonly cancelUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
3433
4130
|
readonly customerEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
|
|
@@ -3435,7 +4132,23 @@ declare function validateCreateCheckoutSessionRequest(data: unknown): v.SafePars
|
|
|
3435
4132
|
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
3436
4133
|
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
3437
4134
|
readonly mode: v.OptionalSchema<v.PicklistSchema<["payment", "subscription"], undefined>, undefined>;
|
|
3438
|
-
}, undefined
|
|
4135
|
+
}, undefined>, v.CheckAction<{
|
|
4136
|
+
userId?: string | undefined;
|
|
4137
|
+
productId?: string | undefined;
|
|
4138
|
+
priceId?: string | undefined;
|
|
4139
|
+
unitAmount?: number | undefined;
|
|
4140
|
+
productName?: string | undefined;
|
|
4141
|
+
currency?: string | undefined;
|
|
4142
|
+
successUrl: string;
|
|
4143
|
+
cancelUrl: string;
|
|
4144
|
+
customerEmail?: string | undefined;
|
|
4145
|
+
userEmail?: string | undefined;
|
|
4146
|
+
metadata?: {
|
|
4147
|
+
[x: string]: string;
|
|
4148
|
+
} | undefined;
|
|
4149
|
+
allowPromotionCodes?: boolean | undefined;
|
|
4150
|
+
mode?: "payment" | "subscription" | undefined;
|
|
4151
|
+
}, "Either priceId or (unitAmount + productName) is required">]>>;
|
|
3439
4152
|
/**
|
|
3440
4153
|
* Validate create checkout session response
|
|
3441
4154
|
*
|
|
@@ -3522,7 +4235,14 @@ declare const StripePaymentSchema: v.ObjectSchema<{
|
|
|
3522
4235
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3523
4236
|
readonly price: v.StringSchema<undefined>;
|
|
3524
4237
|
readonly currency: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, "Currency must be 3-letter ISO code">]>, "EUR">;
|
|
3525
|
-
|
|
4238
|
+
/** Stripe price ID (fixed pricing). Optional when using dynamic pricing. */
|
|
4239
|
+
readonly priceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Stripe price ID is required">]>, undefined>;
|
|
4240
|
+
/** Default amount in cents (dynamic pricing). Used when no priceId. */
|
|
4241
|
+
readonly unitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
4242
|
+
/** Product name for Stripe checkout (dynamic pricing). */
|
|
4243
|
+
readonly productName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4244
|
+
/** Maximum allowed unit amount in cents. Security cap for client-provided amounts. */
|
|
4245
|
+
readonly maxUnitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
3526
4246
|
readonly tier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Tier is required">]>;
|
|
3527
4247
|
readonly duration: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Duration is required">]>;
|
|
3528
4248
|
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
@@ -3542,6 +4262,7 @@ declare const StripeSubscriptionSchema: v.ObjectSchema<{
|
|
|
3542
4262
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3543
4263
|
readonly price: v.StringSchema<undefined>;
|
|
3544
4264
|
readonly currency: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, "Currency must be 3-letter ISO code">]>, "EUR">;
|
|
4265
|
+
/** Stripe price ID. Required for subscriptions (price_data not supported for recurring). */
|
|
3545
4266
|
readonly priceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Stripe price ID is required">]>;
|
|
3546
4267
|
readonly tier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Tier is required">]>;
|
|
3547
4268
|
readonly duration: v.PicklistSchema<["1month", "3months", "6months", "1year", "2years", "lifetime"], undefined>;
|
|
@@ -3561,7 +4282,14 @@ declare const ProductDeclarationSchema: v.VariantSchema<"type", [v.ObjectSchema<
|
|
|
3561
4282
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3562
4283
|
readonly price: v.StringSchema<undefined>;
|
|
3563
4284
|
readonly currency: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, "Currency must be 3-letter ISO code">]>, "EUR">;
|
|
3564
|
-
|
|
4285
|
+
/** Stripe price ID (fixed pricing). Optional when using dynamic pricing. */
|
|
4286
|
+
readonly priceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Stripe price ID is required">]>, undefined>;
|
|
4287
|
+
/** Default amount in cents (dynamic pricing). Used when no priceId. */
|
|
4288
|
+
readonly unitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
4289
|
+
/** Product name for Stripe checkout (dynamic pricing). */
|
|
4290
|
+
readonly productName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4291
|
+
/** Maximum allowed unit amount in cents. Security cap for client-provided amounts. */
|
|
4292
|
+
readonly maxUnitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
3565
4293
|
readonly tier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Tier is required">]>;
|
|
3566
4294
|
readonly duration: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Duration is required">]>;
|
|
3567
4295
|
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
@@ -3572,6 +4300,7 @@ declare const ProductDeclarationSchema: v.VariantSchema<"type", [v.ObjectSchema<
|
|
|
3572
4300
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3573
4301
|
readonly price: v.StringSchema<undefined>;
|
|
3574
4302
|
readonly currency: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, "Currency must be 3-letter ISO code">]>, "EUR">;
|
|
4303
|
+
/** Stripe price ID. Required for subscriptions (price_data not supported for recurring). */
|
|
3575
4304
|
readonly priceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Stripe price ID is required">]>;
|
|
3576
4305
|
readonly tier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Tier is required">]>;
|
|
3577
4306
|
readonly duration: v.PicklistSchema<["1month", "3months", "6months", "1year", "2years", "lifetime"], undefined>;
|
|
@@ -3591,7 +4320,14 @@ declare const ProductDeclarationsSchema: v.RecordSchema<v.StringSchema<undefined
|
|
|
3591
4320
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3592
4321
|
readonly price: v.StringSchema<undefined>;
|
|
3593
4322
|
readonly currency: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, "Currency must be 3-letter ISO code">]>, "EUR">;
|
|
3594
|
-
|
|
4323
|
+
/** Stripe price ID (fixed pricing). Optional when using dynamic pricing. */
|
|
4324
|
+
readonly priceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Stripe price ID is required">]>, undefined>;
|
|
4325
|
+
/** Default amount in cents (dynamic pricing). Used when no priceId. */
|
|
4326
|
+
readonly unitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
4327
|
+
/** Product name for Stripe checkout (dynamic pricing). */
|
|
4328
|
+
readonly productName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4329
|
+
/** Maximum allowed unit amount in cents. Security cap for client-provided amounts. */
|
|
4330
|
+
readonly maxUnitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
3595
4331
|
readonly tier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Tier is required">]>;
|
|
3596
4332
|
readonly duration: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Duration is required">]>;
|
|
3597
4333
|
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
@@ -3602,6 +4338,7 @@ declare const ProductDeclarationsSchema: v.RecordSchema<v.StringSchema<undefined
|
|
|
3602
4338
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3603
4339
|
readonly price: v.StringSchema<undefined>;
|
|
3604
4340
|
readonly currency: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, "Currency must be 3-letter ISO code">]>, "EUR">;
|
|
4341
|
+
/** Stripe price ID. Required for subscriptions (price_data not supported for recurring). */
|
|
3605
4342
|
readonly priceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Stripe price ID is required">]>;
|
|
3606
4343
|
readonly tier: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, "Tier is required">]>;
|
|
3607
4344
|
readonly duration: v.PicklistSchema<["1month", "3months", "6months", "1year", "2years", "lifetime"], undefined>;
|
|
@@ -3621,7 +4358,12 @@ declare const StripeFrontConfigSchema: v.RecordSchema<v.StringSchema<undefined>,
|
|
|
3621
4358
|
readonly currency: v.StringSchema<undefined>;
|
|
3622
4359
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3623
4360
|
readonly features: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
3624
|
-
|
|
4361
|
+
/** Stripe price ID (fixed pricing). Optional for dynamic pricing products. */
|
|
4362
|
+
readonly priceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4363
|
+
/** Amount in cents (dynamic pricing). For display purposes. */
|
|
4364
|
+
readonly unitAmount: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
|
|
4365
|
+
/** Product name (dynamic pricing). For display purposes. */
|
|
4366
|
+
readonly productName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3625
4367
|
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
3626
4368
|
}, undefined>, undefined>;
|
|
3627
4369
|
/**
|
|
@@ -3636,7 +4378,14 @@ declare const StripeBackConfigSchema: v.RecordSchema<v.StringSchema<undefined>,
|
|
|
3636
4378
|
readonly name: v.StringSchema<undefined>;
|
|
3637
4379
|
readonly price: v.NumberSchema<undefined>;
|
|
3638
4380
|
readonly currency: v.StringSchema<undefined>;
|
|
3639
|
-
|
|
4381
|
+
/** Stripe price ID (fixed pricing). Optional for dynamic pricing products. */
|
|
4382
|
+
readonly priceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4383
|
+
/** Default amount in cents (dynamic pricing). */
|
|
4384
|
+
readonly unitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
4385
|
+
/** Product name for Stripe checkout (dynamic pricing). */
|
|
4386
|
+
readonly productName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4387
|
+
/** Maximum allowed unit amount in cents. Security cap. */
|
|
4388
|
+
readonly maxUnitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
3640
4389
|
readonly tier: v.StringSchema<undefined>;
|
|
3641
4390
|
readonly duration: v.StringSchema<undefined>;
|
|
3642
4391
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -3657,7 +4406,9 @@ declare function validateStripeFrontConfig(config: unknown): {
|
|
|
3657
4406
|
currency: string;
|
|
3658
4407
|
description?: string | undefined;
|
|
3659
4408
|
features?: string[] | undefined;
|
|
3660
|
-
priceId
|
|
4409
|
+
priceId?: string | undefined;
|
|
4410
|
+
unitAmount?: number | undefined;
|
|
4411
|
+
productName?: string | undefined;
|
|
3661
4412
|
allowPromotionCodes?: boolean | undefined;
|
|
3662
4413
|
};
|
|
3663
4414
|
};
|
|
@@ -3674,7 +4425,10 @@ declare function validateStripeBackConfig(config: unknown): {
|
|
|
3674
4425
|
name: string;
|
|
3675
4426
|
price: number;
|
|
3676
4427
|
currency: string;
|
|
3677
|
-
priceId
|
|
4428
|
+
priceId?: string | undefined;
|
|
4429
|
+
unitAmount?: number | undefined;
|
|
4430
|
+
productName?: string | undefined;
|
|
4431
|
+
maxUnitAmount?: number | undefined;
|
|
3678
4432
|
tier: string;
|
|
3679
4433
|
duration: string;
|
|
3680
4434
|
description?: string | undefined;
|
|
@@ -3694,10 +4448,17 @@ declare function validateStripeBackConfig(config: unknown): {
|
|
|
3694
4448
|
declare function validateBillingSchemas(): {
|
|
3695
4449
|
success: boolean;
|
|
3696
4450
|
results: {
|
|
3697
|
-
createCheckoutSessionRequest: v.SafeParseResult<v.ObjectSchema<{
|
|
4451
|
+
createCheckoutSessionRequest: v.SafeParseResult<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
3698
4452
|
readonly userId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3699
4453
|
readonly productId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3700
|
-
|
|
4454
|
+
/** Stripe price ID (fixed pricing mode) */
|
|
4455
|
+
readonly priceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4456
|
+
/** Amount in cents (dynamic pricing mode) */
|
|
4457
|
+
readonly unitAmount: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>;
|
|
4458
|
+
/** Product name shown on Stripe checkout (dynamic pricing mode) */
|
|
4459
|
+
readonly productName: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
4460
|
+
/** Currency code, defaults to 'eur' (dynamic pricing mode) */
|
|
4461
|
+
readonly currency: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.LengthAction<string, 3, "Currency must be 3-letter ISO code">]>, undefined>;
|
|
3701
4462
|
readonly successUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
3702
4463
|
readonly cancelUrl: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>;
|
|
3703
4464
|
readonly customerEmail: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>, undefined>;
|
|
@@ -3705,7 +4466,23 @@ declare function validateBillingSchemas(): {
|
|
|
3705
4466
|
readonly metadata: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.StringSchema<undefined>, undefined>, undefined>;
|
|
3706
4467
|
readonly allowPromotionCodes: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
3707
4468
|
readonly mode: v.OptionalSchema<v.PicklistSchema<["payment", "subscription"], undefined>, undefined>;
|
|
3708
|
-
}, undefined
|
|
4469
|
+
}, undefined>, v.CheckAction<{
|
|
4470
|
+
userId?: string | undefined;
|
|
4471
|
+
productId?: string | undefined;
|
|
4472
|
+
priceId?: string | undefined;
|
|
4473
|
+
unitAmount?: number | undefined;
|
|
4474
|
+
productName?: string | undefined;
|
|
4475
|
+
currency?: string | undefined;
|
|
4476
|
+
successUrl: string;
|
|
4477
|
+
cancelUrl: string;
|
|
4478
|
+
customerEmail?: string | undefined;
|
|
4479
|
+
userEmail?: string | undefined;
|
|
4480
|
+
metadata?: {
|
|
4481
|
+
[x: string]: string;
|
|
4482
|
+
} | undefined;
|
|
4483
|
+
allowPromotionCodes?: boolean | undefined;
|
|
4484
|
+
mode?: "payment" | "subscription" | undefined;
|
|
4485
|
+
}, "Either priceId or (unitAmount + productName) is required">]>>;
|
|
3709
4486
|
createCheckoutSessionResponse: v.SafeParseResult<v.ObjectSchema<{
|
|
3710
4487
|
readonly sessionId: v.StringSchema<undefined>;
|
|
3711
4488
|
readonly sessionUrl: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.UrlAction<string, undefined>]>, undefined>;
|
|
@@ -3940,7 +4717,13 @@ interface RefreshSubscriptionRequest {
|
|
|
3940
4717
|
*/
|
|
3941
4718
|
interface StripeProvider {
|
|
3942
4719
|
createCheckoutSession(params: {
|
|
3943
|
-
priceId
|
|
4720
|
+
priceId?: string;
|
|
4721
|
+
/** Amount in cents (dynamic pricing mode, used with price_data) */
|
|
4722
|
+
unitAmount?: number;
|
|
4723
|
+
/** Product name for Stripe checkout (dynamic pricing mode) */
|
|
4724
|
+
productName?: string;
|
|
4725
|
+
/** Currency code, defaults to 'eur' */
|
|
4726
|
+
currency?: string;
|
|
3944
4727
|
userId: string;
|
|
3945
4728
|
successUrl: string;
|
|
3946
4729
|
cancelUrl: string;
|
|
@@ -3991,7 +4774,7 @@ interface ProcessPaymentSuccessResponse {
|
|
|
3991
4774
|
* @since 0.0.1
|
|
3992
4775
|
* @author AMBROISE PARK Consulting
|
|
3993
4776
|
*/
|
|
3994
|
-
type BillingErrorCode = 'unknown' | 'unauthenticated' | 'invalid_request' | 'stripe_error' | 'subscription_not_found' | 'checkout_session_not_found' | 'webhook_verification_failed' | 'rate_limit_exceeded' | 'insufficient_permissions' | 'invalid_webhook_signature';
|
|
4777
|
+
type BillingErrorCode = 'unknown' | 'unauthenticated' | 'invalid_request' | 'stripe_error' | 'subscription_not_found' | 'checkout_session_not_found' | 'webhook_verification_failed' | 'rate_limit_exceeded' | 'insufficient_permissions' | 'invalid_webhook_signature' | 'checkout_blocked';
|
|
3995
4778
|
/**
|
|
3996
4779
|
* Stripe checkout session creation request
|
|
3997
4780
|
*
|
|
@@ -4000,8 +4783,14 @@ type BillingErrorCode = 'unknown' | 'unauthenticated' | 'invalid_request' | 'str
|
|
|
4000
4783
|
* @author AMBROISE PARK Consulting
|
|
4001
4784
|
*/
|
|
4002
4785
|
interface StripeCheckoutRequest {
|
|
4003
|
-
/** Stripe price ID
|
|
4004
|
-
priceId
|
|
4786
|
+
/** Stripe price ID (fixed pricing mode) */
|
|
4787
|
+
priceId?: string;
|
|
4788
|
+
/** Amount in cents (dynamic pricing mode, used with price_data) */
|
|
4789
|
+
unitAmount?: number;
|
|
4790
|
+
/** Product name for Stripe checkout (dynamic pricing mode) */
|
|
4791
|
+
productName?: string;
|
|
4792
|
+
/** Currency code, defaults to 'eur' (dynamic pricing mode) */
|
|
4793
|
+
currency?: string;
|
|
4005
4794
|
/** User email for the subscription */
|
|
4006
4795
|
userEmail: string;
|
|
4007
4796
|
/** URL to redirect to on successful payment */
|
|
@@ -4365,6 +5154,28 @@ interface StripePrice {
|
|
|
4365
5154
|
/** Price lookup key */
|
|
4366
5155
|
lookup_key?: string;
|
|
4367
5156
|
}
|
|
5157
|
+
/**
|
|
5158
|
+
* Result of a beforeCheckout hook invocation.
|
|
5159
|
+
* Allows blocking checkout or overriding pricing before Stripe session creation.
|
|
5160
|
+
*/
|
|
5161
|
+
interface BeforeCheckoutResult {
|
|
5162
|
+
/** Whether checkout is allowed to proceed */
|
|
5163
|
+
allowed: boolean;
|
|
5164
|
+
/** Reason for blocking (shown in error response) */
|
|
5165
|
+
reason?: string;
|
|
5166
|
+
/** Optional overrides applied to checkout options before Stripe session creation */
|
|
5167
|
+
overrides?: Partial<Pick<CheckoutOptions, 'unitAmount' | 'productName'>>;
|
|
5168
|
+
}
|
|
5169
|
+
/**
|
|
5170
|
+
* Hook called before Stripe checkout session creation.
|
|
5171
|
+
* Use for ownership checks, status validation, server-resolved pricing.
|
|
5172
|
+
*
|
|
5173
|
+
* @param userId - Authenticated user ID
|
|
5174
|
+
* @param options - Checkout options from the client request
|
|
5175
|
+
* @param metadata - Request metadata (sanitized)
|
|
5176
|
+
* @returns Whether to allow checkout, optional reason, optional overrides
|
|
5177
|
+
*/
|
|
5178
|
+
type BeforeCheckoutHook = (userId: string, options: CheckoutOptions, metadata: Record<string, string>) => Promise<BeforeCheckoutResult>;
|
|
4368
5179
|
/**
|
|
4369
5180
|
* Checkout options for Stripe checkout session
|
|
4370
5181
|
*
|
|
@@ -4373,7 +5184,14 @@ interface StripePrice {
|
|
|
4373
5184
|
* @author AMBROISE PARK Consulting
|
|
4374
5185
|
*/
|
|
4375
5186
|
interface CheckoutOptions {
|
|
4376
|
-
|
|
5187
|
+
/** Stripe price ID (fixed pricing mode) */
|
|
5188
|
+
priceId?: string;
|
|
5189
|
+
/** Amount in cents (dynamic pricing mode) */
|
|
5190
|
+
unitAmount?: number;
|
|
5191
|
+
/** Product name for Stripe checkout (dynamic pricing mode) */
|
|
5192
|
+
productName?: string;
|
|
5193
|
+
/** Currency code, defaults to 'eur' (dynamic pricing mode) */
|
|
5194
|
+
currency?: string;
|
|
4377
5195
|
mode: 'payment' | 'subscription';
|
|
4378
5196
|
successUrl?: string;
|
|
4379
5197
|
cancelUrl?: string;
|
|
@@ -4438,7 +5256,14 @@ type StripeBackConfig = {
|
|
|
4438
5256
|
name: string;
|
|
4439
5257
|
price: number;
|
|
4440
5258
|
currency: string;
|
|
4441
|
-
|
|
5259
|
+
/** Stripe price ID (fixed pricing). Optional for dynamic pricing products. */
|
|
5260
|
+
priceId?: string;
|
|
5261
|
+
/** Default amount in cents (dynamic pricing). */
|
|
5262
|
+
unitAmount?: number;
|
|
5263
|
+
/** Product name for Stripe checkout (dynamic pricing). */
|
|
5264
|
+
productName?: string;
|
|
5265
|
+
/** Maximum allowed unit amount in cents. Security cap for client-provided amounts. */
|
|
5266
|
+
maxUnitAmount?: number;
|
|
4442
5267
|
tier: string;
|
|
4443
5268
|
duration: string;
|
|
4444
5269
|
description?: string;
|
|
@@ -4450,6 +5275,8 @@ type StripeBackConfig = {
|
|
|
4450
5275
|
onSubscriptionRenewed?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
4451
5276
|
onSubscriptionCancelled?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
4452
5277
|
onPaymentFailed?: (userId: string, metadata: Record<string, string>) => Promise<void>;
|
|
5278
|
+
/** Hook called before Stripe checkout session creation. Can block or override pricing. */
|
|
5279
|
+
beforeCheckout?: BeforeCheckoutHook;
|
|
4453
5280
|
};
|
|
4454
5281
|
};
|
|
4455
5282
|
/**
|
|
@@ -4538,18 +5365,6 @@ interface AuthPartnerResult extends PartnerResult {
|
|
|
4538
5365
|
partnerId: AuthPartnerId;
|
|
4539
5366
|
metadata?: Record<string, any>;
|
|
4540
5367
|
}
|
|
4541
|
-
/**
|
|
4542
|
-
* Auth partner button interface
|
|
4543
|
-
*
|
|
4544
|
-
* @version 0.1.0
|
|
4545
|
-
* @since 0.0.1
|
|
4546
|
-
* @author AMBROISE PARK Consulting
|
|
4547
|
-
*/
|
|
4548
|
-
interface AuthPartnerButton extends PartnerButton {
|
|
4549
|
-
partnerId: AuthPartnerId;
|
|
4550
|
-
useRedirect?: boolean;
|
|
4551
|
-
onSuccess?: (result: AuthPartnerResult) => void;
|
|
4552
|
-
}
|
|
4553
5368
|
/**
|
|
4554
5369
|
* Partner state constants - Single source of truth for partner states
|
|
4555
5370
|
*
|
|
@@ -4928,6 +5743,13 @@ interface AuthState {
|
|
|
4928
5743
|
status: EmailVerificationStatus;
|
|
4929
5744
|
error?: string;
|
|
4930
5745
|
};
|
|
5746
|
+
/**
|
|
5747
|
+
* Password reset recovery mode.
|
|
5748
|
+
* Set by provider when PASSWORD_RECOVERY event fires (Supabase)
|
|
5749
|
+
* or when oobCode is detected in URL (Firebase).
|
|
5750
|
+
* Components use this to show the "set new password" UI.
|
|
5751
|
+
*/
|
|
5752
|
+
passwordResetPending: boolean;
|
|
4931
5753
|
authService: unknown;
|
|
4932
5754
|
/**
|
|
4933
5755
|
* Unified feature status - single source of truth for auth state.
|
|
@@ -4973,6 +5795,7 @@ interface AuthActions {
|
|
|
4973
5795
|
status: EmailVerificationStatus;
|
|
4974
5796
|
error?: string;
|
|
4975
5797
|
};
|
|
5798
|
+
setPasswordResetPending: (pending: boolean) => void;
|
|
4976
5799
|
setLoading: (loading: boolean) => void;
|
|
4977
5800
|
setError: (error: AuthError) => void;
|
|
4978
5801
|
clearError: () => void;
|
|
@@ -5183,6 +6006,22 @@ interface AuthProvider {
|
|
|
5183
6006
|
linkWithPartner(partnerId: AuthPartnerId, method?: AuthMethod): Promise<AuthResult | null>;
|
|
5184
6007
|
signInWithGoogleCredential(credential: string): Promise<AuthResult | null>;
|
|
5185
6008
|
updatePassword(newPassword: string): Promise<void>;
|
|
6009
|
+
/**
|
|
6010
|
+
* Verify a password reset code from the email callback link.
|
|
6011
|
+
* Returns the email address associated with the code.
|
|
6012
|
+
* @returns email address, or null if code is invalid/expired
|
|
6013
|
+
*/
|
|
6014
|
+
verifyPasswordResetCode?(code: string): Promise<string | null>;
|
|
6015
|
+
/**
|
|
6016
|
+
* Confirm a password reset with the code from the email and the new password.
|
|
6017
|
+
* After success, user can sign in with the new password.
|
|
6018
|
+
*/
|
|
6019
|
+
confirmPasswordReset?(code: string, newPassword: string): Promise<void>;
|
|
6020
|
+
/**
|
|
6021
|
+
* Get the password reset redirect path for this provider.
|
|
6022
|
+
* Used to build the redirect URL in password reset emails.
|
|
6023
|
+
*/
|
|
6024
|
+
getPasswordResetRedirectUrl?(): string;
|
|
5186
6025
|
sendEmailVerification(): Promise<void>;
|
|
5187
6026
|
sendSignInLinkToEmail(email: string, actionCodeSettings?: {
|
|
5188
6027
|
url: string;
|
|
@@ -5249,6 +6088,7 @@ interface AuthAPI {
|
|
|
5249
6088
|
status: string;
|
|
5250
6089
|
error?: string;
|
|
5251
6090
|
};
|
|
6091
|
+
passwordResetPending: boolean;
|
|
5252
6092
|
partnerError: {
|
|
5253
6093
|
partnerId: AuthPartnerId;
|
|
5254
6094
|
error: string;
|
|
@@ -5273,6 +6113,8 @@ interface AuthAPI {
|
|
|
5273
6113
|
signOut: () => Promise<void>;
|
|
5274
6114
|
sendPasswordResetEmail: (email: string) => Promise<void>;
|
|
5275
6115
|
updatePassword: (newPassword: string) => Promise<void>;
|
|
6116
|
+
verifyPasswordResetCode: (code: string) => Promise<string | null>;
|
|
6117
|
+
confirmPasswordReset: (code: string, newPassword: string) => Promise<void>;
|
|
5276
6118
|
sendEmailVerification: () => Promise<void>;
|
|
5277
6119
|
getEmailVerificationStatus: () => Promise<{
|
|
5278
6120
|
status: string;
|
|
@@ -5367,14 +6209,30 @@ declare const VISIBILITY: {
|
|
|
5367
6209
|
* Controls who can MODIFY this field
|
|
5368
6210
|
* - true: Anyone who can see the field
|
|
5369
6211
|
* - false: Nobody (read-only)
|
|
5370
|
-
* - '
|
|
6212
|
+
* - 'user': Authenticated users+ (role hierarchy)
|
|
6213
|
+
* - 'admin': Admins+ (role hierarchy)
|
|
6214
|
+
* - 'super': Super admins only
|
|
5371
6215
|
* - 'create-only': Editable on create, read-only after
|
|
6216
|
+
* - 'generated': DB-generated (excluded from forms and write schemas)
|
|
6217
|
+
* - 'computed': UI-computed (excluded from forms, included in writes)
|
|
5372
6218
|
*/
|
|
5373
6219
|
declare const EDITABLE: {
|
|
6220
|
+
/** Anyone who can see the field (follows visibility) */
|
|
5374
6221
|
readonly TRUE: true;
|
|
6222
|
+
/** Read-only display in forms */
|
|
5375
6223
|
readonly FALSE: false;
|
|
6224
|
+
/** Authenticated users+ */
|
|
6225
|
+
readonly USER: "user";
|
|
6226
|
+
/** Admin+ */
|
|
5376
6227
|
readonly ADMIN: "admin";
|
|
6228
|
+
/** Super only */
|
|
6229
|
+
readonly SUPER: "super";
|
|
6230
|
+
/** Editable on create, read-only after */
|
|
5377
6231
|
readonly CREATE_ONLY: "create-only";
|
|
6232
|
+
/** DB-generated column (PostgreSQL GENERATED ALWAYS) — excluded from forms and write schemas */
|
|
6233
|
+
readonly GENERATED: "generated";
|
|
6234
|
+
/** UI-computed field (derived from other fields) — excluded from forms, included in writes */
|
|
6235
|
+
readonly COMPUTED: "computed";
|
|
5378
6236
|
};
|
|
5379
6237
|
/**
|
|
5380
6238
|
* Default access levels for entity operations
|
|
@@ -5420,12 +6278,14 @@ declare const ORDER_DIRECTION: {
|
|
|
5420
6278
|
readonly ASC: "asc";
|
|
5421
6279
|
readonly DESC: "desc";
|
|
5422
6280
|
};
|
|
6281
|
+
/** Sort direction for query orderBy clauses. */
|
|
5423
6282
|
type OrderDirection = (typeof ORDER_DIRECTION)[keyof typeof ORDER_DIRECTION];
|
|
5424
6283
|
/** Schema type for list queries (list vs listCard) */
|
|
5425
6284
|
declare const LIST_SCHEMA_TYPE: {
|
|
5426
6285
|
readonly LIST: "list";
|
|
5427
6286
|
readonly LIST_CARD: "listCard";
|
|
5428
6287
|
};
|
|
6288
|
+
/** Schema variant for list queries (table vs card grid). */
|
|
5429
6289
|
type ListSchemaType = (typeof LIST_SCHEMA_TYPE)[keyof typeof LIST_SCHEMA_TYPE];
|
|
5430
6290
|
declare const FIELD_TYPES: readonly ["address", "array", "avatar", "badge", "boolean", "checkbox", "color", "combobox", "date", "datetime-local", "document", "documents", "duration", "email", "field-array", "file", "files", "gdprConsent", "geopoint", "hidden", "iban", "image", "images", "map", "month", "multiselect", "number", "currency", "price", "password", "radio", "reference", "range", "rating", "reset", "richtext", "select", "submit", "switch", "tel", "text", "textarea", "time", "timestamp", "url", "week", "year"];
|
|
5431
6291
|
|
|
@@ -5520,15 +6380,20 @@ type Visibility = (typeof VISIBILITY)[keyof typeof VISIBILITY];
|
|
|
5520
6380
|
* Editable level for entity fields
|
|
5521
6381
|
* Controls who can MODIFY a field
|
|
5522
6382
|
* - true: Anyone who can see the field
|
|
5523
|
-
* - false: Nobody (read-only)
|
|
5524
|
-
* - 'admin':
|
|
6383
|
+
* - false: Nobody (read-only, still shown in form)
|
|
6384
|
+
* - 'admin': Admin+ can edit (role hierarchy)
|
|
6385
|
+
* - 'super': Super only
|
|
5525
6386
|
* - 'create-only': Editable on create, read-only after
|
|
6387
|
+
* - 'generated': DB-generated — hidden from forms, stripped from writes
|
|
6388
|
+
* - 'computed': UI-computed (derived from other fields) — hidden from forms, included in writes
|
|
6389
|
+
*
|
|
6390
|
+
* Any role string ('user', 'admin', 'super') is also accepted and checked via role hierarchy.
|
|
5526
6391
|
*
|
|
5527
6392
|
* @version 0.1.0
|
|
5528
6393
|
* @since 0.0.1
|
|
5529
6394
|
* @author AMBROISE PARK Consulting
|
|
5530
6395
|
*/
|
|
5531
|
-
type Editable = (typeof EDITABLE)[keyof typeof EDITABLE];
|
|
6396
|
+
type Editable = (typeof EDITABLE)[keyof typeof EDITABLE] | string;
|
|
5532
6397
|
/**
|
|
5533
6398
|
* Entity-level access configuration
|
|
5534
6399
|
* Controls who can perform CRUD operations on the entity
|
|
@@ -5664,6 +6529,22 @@ interface UIFieldOptions<T extends string = FieldType> {
|
|
|
5664
6529
|
* → tries `floor_4`, falls back to `fields.floor_display`: `"{{value}}th floor"` → "4th floor"
|
|
5665
6530
|
*/
|
|
5666
6531
|
displayKey?: string | string[];
|
|
6532
|
+
/**
|
|
6533
|
+
* Custom display value resolver. Overrides type formatter and displayKey for display views.
|
|
6534
|
+
* Receives the field value, the full item, and the translation function —
|
|
6535
|
+
* useful for cross-field conditional display with i18n.
|
|
6536
|
+
* Return `null` to hide the field for that item. Return a string to display it.
|
|
6537
|
+
*
|
|
6538
|
+
* @example
|
|
6539
|
+
* ```typescript
|
|
6540
|
+
* // Hide date for reserved/signed, show "Available" for past dates
|
|
6541
|
+
* displayValue: (value, item, t) => {
|
|
6542
|
+
* if (item.status === 'reserved' || item.status === 'signed') return null;
|
|
6543
|
+
* return value <= today ? t('status.available_now') : String(value);
|
|
6544
|
+
* }
|
|
6545
|
+
* ```
|
|
6546
|
+
*/
|
|
6547
|
+
displayValue?: (value: unknown, item: Record<string, unknown>, t: (key: string, options?: Record<string, unknown>) => string) => string | null;
|
|
5667
6548
|
/** Whether to show value label for range inputs */
|
|
5668
6549
|
showValue?: T extends 'range' ? boolean : never;
|
|
5669
6550
|
/** Field specific options based on field type. Custom types: augment CustomFieldOptionsMap. */
|
|
@@ -6834,6 +7715,11 @@ interface PaginatedQueryResult<T> {
|
|
|
6834
7715
|
type DocumentSubscriptionCallback<T> = (data: T | null, error?: Error) => void;
|
|
6835
7716
|
/** Callback for collection subscriptions */
|
|
6836
7717
|
type CollectionSubscriptionCallback<T> = (data: T[], error?: Error) => void;
|
|
7718
|
+
/** Options for CRUD operations */
|
|
7719
|
+
interface CrudOperationOptions {
|
|
7720
|
+
/** AbortSignal to cancel the operation */
|
|
7721
|
+
signal?: AbortSignal;
|
|
7722
|
+
}
|
|
6837
7723
|
/**
|
|
6838
7724
|
* Provider-agnostic CRUD adapter interface.
|
|
6839
7725
|
*
|
|
@@ -6865,20 +7751,20 @@ interface ICrudAdapter {
|
|
|
6865
7751
|
*/
|
|
6866
7752
|
readonly dbLevelSecurity?: boolean;
|
|
6867
7753
|
/** Fetch a single document by ID. Returns null if not found. */
|
|
6868
|
-
get<T>(collection: string, id: string, schema?: dndevSchema<unknown
|
|
7754
|
+
get<T>(collection: string, id: string, schema?: dndevSchema<unknown>, options?: CrudOperationOptions): Promise<T | null>;
|
|
6869
7755
|
/** Create a new document with auto-generated ID. Returns the ID + parsed data. */
|
|
6870
|
-
add<T>(collection: string, data: T, schema?: dndevSchema<T
|
|
7756
|
+
add<T>(collection: string, data: T, schema?: dndevSchema<T>, options?: CrudOperationOptions): Promise<{
|
|
6871
7757
|
id: string;
|
|
6872
7758
|
data: Record<string, unknown>;
|
|
6873
7759
|
}>;
|
|
6874
7760
|
/** Set/replace a document by ID (upsert semantics). */
|
|
6875
|
-
set<T>(collection: string, id: string, data: T, schema?: dndevSchema<T
|
|
7761
|
+
set<T>(collection: string, id: string, data: T, schema?: dndevSchema<T>, options?: CrudOperationOptions): Promise<void>;
|
|
6876
7762
|
/** Partial update a document by ID. */
|
|
6877
|
-
update<T>(collection: string, id: string, data: Partial<T
|
|
7763
|
+
update<T>(collection: string, id: string, data: Partial<T>, options?: CrudOperationOptions): Promise<void>;
|
|
6878
7764
|
/** Delete a document by ID. */
|
|
6879
|
-
delete(collection: string, id: string): Promise<void>;
|
|
7765
|
+
delete(collection: string, id: string, options?: CrudOperationOptions): Promise<void>;
|
|
6880
7766
|
/** Query a collection with filters, ordering, and pagination. schemaType accepts 'list' | 'listCard' or string. */
|
|
6881
|
-
query<T>(collection: string, options: QueryOptions, schema?: dndevSchema<unknown>, schemaType?: ListSchemaType | string): Promise<PaginatedQueryResult<T>>;
|
|
7767
|
+
query<T>(collection: string, options: QueryOptions, schema?: dndevSchema<unknown>, schemaType?: ListSchemaType | string, operationOptions?: CrudOperationOptions): Promise<PaginatedQueryResult<T>>;
|
|
6882
7768
|
/**
|
|
6883
7769
|
* Subscribe to real-time changes on a single document.
|
|
6884
7770
|
* Optional — adapters that don't support real-time can throw or return a no-op unsubscribe.
|
|
@@ -6899,6 +7785,7 @@ declare const AGGREGATE_OPERATIONS: {
|
|
|
6899
7785
|
readonly MIN: "min";
|
|
6900
7786
|
readonly MAX: "max";
|
|
6901
7787
|
};
|
|
7788
|
+
/** Aggregation operation type derived from AGGREGATE_OPERATIONS constant. */
|
|
6902
7789
|
type AggregateOperation = (typeof AGGREGATE_OPERATIONS)[keyof typeof AGGREGATE_OPERATIONS];
|
|
6903
7790
|
/** Filter operators for aggregation (subset of CRUD_OPERATORS) */
|
|
6904
7791
|
declare const AGGREGATE_FILTER_OPERATORS: {
|
|
@@ -6909,6 +7796,7 @@ declare const AGGREGATE_FILTER_OPERATORS: {
|
|
|
6909
7796
|
readonly GT: ">";
|
|
6910
7797
|
readonly GTE: ">=";
|
|
6911
7798
|
};
|
|
7799
|
+
/** Filter operator type for aggregation queries. */
|
|
6912
7800
|
type AggregateFilterOperator = (typeof AGGREGATE_FILTER_OPERATORS)[keyof typeof AGGREGATE_FILTER_OPERATORS];
|
|
6913
7801
|
/**
|
|
6914
7802
|
* Single metric definition for aggregation
|
|
@@ -7057,7 +7945,35 @@ interface EntityBrowseBaseProps {
|
|
|
7057
7945
|
queryOptions?: QueryOptions;
|
|
7058
7946
|
/** Cache stale time in ms */
|
|
7059
7947
|
staleTime?: number;
|
|
7948
|
+
/**
|
|
7949
|
+
* Tone for the filter and results Section wrappers.
|
|
7950
|
+
* Use 'base' or 'muted' when the app has an image background so sections are readable.
|
|
7951
|
+
* @default 'ghost' (transparent — inherits parent background)
|
|
7952
|
+
*/
|
|
7953
|
+
tone?: 'ghost' | 'base' | 'muted' | 'contrast' | 'accent';
|
|
7954
|
+
/**
|
|
7955
|
+
* Static data for design-time preview.
|
|
7956
|
+
* When provided, the component renders this data directly instead of
|
|
7957
|
+
* fetching from the CRUD backend. All interactive elements (edit, delete,
|
|
7958
|
+
* create, filters, favorites, navigation) are rendered but disabled.
|
|
7959
|
+
*
|
|
7960
|
+
* No CrudProvider or backend connection required.
|
|
7961
|
+
* Hooks are never called - rendering delegates to a standalone preview component.
|
|
7962
|
+
*
|
|
7963
|
+
* @example
|
|
7964
|
+
* ```tsx
|
|
7965
|
+
* // Design preview with mock data
|
|
7966
|
+
* <EntityCardList entity={productEntity} preview={mockProducts} />
|
|
7967
|
+
*
|
|
7968
|
+
* // Spec chat: entity generated from user description
|
|
7969
|
+
* <EntityList entity={specEntity} preview={generateMockData(specEntity, 6)} />
|
|
7970
|
+
* ```
|
|
7971
|
+
*/
|
|
7972
|
+
preview?: (Record<string, unknown> & {
|
|
7973
|
+
id: string;
|
|
7974
|
+
})[];
|
|
7060
7975
|
}
|
|
7976
|
+
/** Props for the entity data table component with server/client pagination. */
|
|
7061
7977
|
interface EntityListProps extends EntityBrowseBaseProps {
|
|
7062
7978
|
/**
|
|
7063
7979
|
* Pagination mode:
|
|
@@ -7074,6 +7990,7 @@ interface EntityListProps extends EntityBrowseBaseProps {
|
|
|
7074
7990
|
*/
|
|
7075
7991
|
exportable?: boolean;
|
|
7076
7992
|
}
|
|
7993
|
+
/** Props for the entity card grid component with filtering and sorting. */
|
|
7077
7994
|
interface EntityCardListProps extends EntityBrowseBaseProps {
|
|
7078
7995
|
/** Grid columns (responsive) - defaults to [1, 2, 3, 4] */
|
|
7079
7996
|
cols?: number | [number, number, number, number];
|
|
@@ -7105,12 +8022,15 @@ interface EntityCardListProps extends EntityBrowseBaseProps {
|
|
|
7105
8022
|
* ```
|
|
7106
8023
|
*/
|
|
7107
8024
|
resultLabel?: (count: number) => string;
|
|
7108
|
-
/**
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
8025
|
+
/** Render a custom overlay on each card (e.g. status stamp). Receives the item. */
|
|
8026
|
+
renderCardOverlay?: (item: EntityRecord & {
|
|
8027
|
+
id: string;
|
|
8028
|
+
}) => ReactNode;
|
|
8029
|
+
/** Client-side sort: field config, comparator function, or null to disable. Defaults to entity.defaultSort. */
|
|
8030
|
+
clientSort?: {
|
|
8031
|
+
field: string;
|
|
8032
|
+
direction?: 'asc' | 'desc';
|
|
8033
|
+
} | ((a: any, b: any) => number) | null;
|
|
7114
8034
|
/** Make filter/results sections collapsible. @default false */
|
|
7115
8035
|
collapsible?: boolean;
|
|
7116
8036
|
/** Initial open state when collapsible. Only relevant when `collapsible` is true. */
|
|
@@ -7145,9 +8065,12 @@ interface CrudCardProps {
|
|
|
7145
8065
|
showDelete?: boolean;
|
|
7146
8066
|
/** Optional actions slot (e.g. favorites heart) rendered in card corner */
|
|
7147
8067
|
renderActions?: ReactNode;
|
|
8068
|
+
/** Optional overlay rendered over the full image area (position absolute, centered, pointer-events none) */
|
|
8069
|
+
renderOverlay?: ReactNode;
|
|
7148
8070
|
/** Optional className for the card wrapper */
|
|
7149
8071
|
className?: string;
|
|
7150
8072
|
}
|
|
8073
|
+
/** Props for the entity form renderer with create/edit modes, validation, and navigation. */
|
|
7151
8074
|
interface EntityFormRendererProps<T extends EntityRecord = EntityRecord> {
|
|
7152
8075
|
/** Entity definition - pass the full entity from defineEntity() */
|
|
7153
8076
|
entity: Entity;
|
|
@@ -7198,7 +8121,7 @@ interface EntityFormRendererProps<T extends EntityRecord = EntityRecord> {
|
|
|
7198
8121
|
cancelText?: string | null;
|
|
7199
8122
|
/**
|
|
7200
8123
|
* Success path - full path to navigate after successful submit (e.g., `/products`).
|
|
7201
|
-
* If not provided,
|
|
8124
|
+
* If not provided, stays on page (edit) or relies on onSubmit to navigate (create).
|
|
7202
8125
|
*/
|
|
7203
8126
|
successPath?: string;
|
|
7204
8127
|
/**
|
|
@@ -7228,6 +8151,7 @@ interface EntityFormRendererProps<T extends EntityRecord = EntityRecord> {
|
|
|
7228
8151
|
*/
|
|
7229
8152
|
hideVisibilityInfo?: boolean;
|
|
7230
8153
|
}
|
|
8154
|
+
/** Props for the entity recommendations section (e.g. "Similar items"). */
|
|
7231
8155
|
interface EntityRecommendationsProps {
|
|
7232
8156
|
/** The entity definition */
|
|
7233
8157
|
entity: Entity;
|
|
@@ -7239,14 +8163,21 @@ interface EntityRecommendationsProps {
|
|
|
7239
8163
|
basePath?: string;
|
|
7240
8164
|
/** Grid columns — default `[1,1,3,3]` */
|
|
7241
8165
|
cols?: number | [number, number, number, number];
|
|
8166
|
+
/**
|
|
8167
|
+
* Tone for the Section wrapper.
|
|
8168
|
+
* Use 'base' or 'muted' when the app has an image background so the section is readable.
|
|
8169
|
+
* @default 'ghost' (transparent — inherits parent background)
|
|
8170
|
+
*/
|
|
8171
|
+
tone?: 'ghost' | 'base' | 'muted' | 'contrast' | 'accent';
|
|
7242
8172
|
/** Additional className on wrapper Section */
|
|
7243
8173
|
className?: string;
|
|
7244
8174
|
}
|
|
8175
|
+
/** Props for the read-only entity detail renderer with role-based visibility. */
|
|
7245
8176
|
interface EntityDisplayRendererProps<T extends EntityRecord = EntityRecord> {
|
|
7246
8177
|
/** Entity definition - pass the full entity from defineEntity() */
|
|
7247
8178
|
entity: Entity;
|
|
7248
|
-
/** Entity ID to fetch */
|
|
7249
|
-
id
|
|
8179
|
+
/** Entity ID to fetch. Not required when `preview` is provided. */
|
|
8180
|
+
id?: string;
|
|
7250
8181
|
/** Translation function (optional - auto-generated if not provided) */
|
|
7251
8182
|
t?: (key: string, options?: Record<string, unknown>) => string;
|
|
7252
8183
|
/** Additional CSS classes */
|
|
@@ -7266,10 +8197,19 @@ interface EntityDisplayRendererProps<T extends EntityRecord = EntityRecord> {
|
|
|
7266
8197
|
* Use when the page already displays certain fields in a custom hero/header section.
|
|
7267
8198
|
*/
|
|
7268
8199
|
excludeFields?: string[];
|
|
8200
|
+
/**
|
|
8201
|
+
* Static data for design-time preview.
|
|
8202
|
+
* When provided, renders this record directly instead of fetching by id.
|
|
8203
|
+
* The `id` prop becomes unnecessary (ignored when preview is set).
|
|
8204
|
+
*
|
|
8205
|
+
* @example
|
|
8206
|
+
* ```tsx
|
|
8207
|
+
* <EntityDisplayRenderer entity={productEntity} preview={mockProduct} />
|
|
8208
|
+
* ```
|
|
8209
|
+
*/
|
|
8210
|
+
preview?: Partial<T>;
|
|
7269
8211
|
}
|
|
7270
8212
|
|
|
7271
|
-
type FieldValues = Record<string, any>;
|
|
7272
|
-
|
|
7273
8213
|
/**
|
|
7274
8214
|
* @fileoverview CRUD Types
|
|
7275
8215
|
* @description Type definitions for CRUD domain. Defines entity types, field types, and CRUD-related interfaces.
|
|
@@ -7362,6 +8302,140 @@ interface ColumnDef<T extends FieldValues> {
|
|
|
7362
8302
|
render?: (value: T[keyof T], row: T) => ReactNode;
|
|
7363
8303
|
}
|
|
7364
8304
|
|
|
8305
|
+
/**
|
|
8306
|
+
* @fileoverview Email Constants
|
|
8307
|
+
* @description Provider IDs, error codes, and defaults for email feature.
|
|
8308
|
+
*
|
|
8309
|
+
* @version 0.1.0
|
|
8310
|
+
* @since 0.1.0
|
|
8311
|
+
* @author AMBROISE PARK Consulting
|
|
8312
|
+
*/
|
|
8313
|
+
/** Supported email providers */
|
|
8314
|
+
declare const EMAIL_PROVIDERS: {
|
|
8315
|
+
readonly RESEND: "resend";
|
|
8316
|
+
};
|
|
8317
|
+
/** Email error codes */
|
|
8318
|
+
declare const EMAIL_ERROR_CODES: {
|
|
8319
|
+
readonly UNKNOWN: "unknown";
|
|
8320
|
+
readonly UNAUTHENTICATED: "unauthenticated";
|
|
8321
|
+
readonly INVALID_REQUEST: "invalid_request";
|
|
8322
|
+
readonly PROVIDER_ERROR: "provider_error";
|
|
8323
|
+
readonly TEMPLATE_NOT_FOUND: "template_not_found";
|
|
8324
|
+
readonly RATE_LIMIT_EXCEEDED: "rate_limit_exceeded";
|
|
8325
|
+
readonly MISSING_API_KEY: "missing_api_key";
|
|
8326
|
+
};
|
|
8327
|
+
|
|
8328
|
+
/**
|
|
8329
|
+
* @fileoverview Email Schemas
|
|
8330
|
+
* @description Valibot schemas for email request/response validation.
|
|
8331
|
+
*
|
|
8332
|
+
* @version 0.1.0
|
|
8333
|
+
* @since 0.1.0
|
|
8334
|
+
* @author AMBROISE PARK Consulting
|
|
8335
|
+
*/
|
|
8336
|
+
|
|
8337
|
+
/** Schema for send email request (caller → handler) */
|
|
8338
|
+
declare const SendEmailRequestSchema: v.ObjectSchema<{
|
|
8339
|
+
/** Template ID from the registry */
|
|
8340
|
+
readonly templateId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
8341
|
+
/** Recipient email address */
|
|
8342
|
+
readonly to: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
8343
|
+
/** Template data (shape depends on template) */
|
|
8344
|
+
readonly data: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
|
|
8345
|
+
/** Locale for i18n rendering (default: 'fr') */
|
|
8346
|
+
readonly locale: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, undefined>, v.MaxLengthAction<string, 5, undefined>]>, "fr">;
|
|
8347
|
+
/** Override "from" address */
|
|
8348
|
+
readonly from: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
8349
|
+
/** Override reply-to address */
|
|
8350
|
+
readonly replyTo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
8351
|
+
}, undefined>;
|
|
8352
|
+
/** Schema for send email response */
|
|
8353
|
+
declare const SendEmailResponseSchema: v.ObjectSchema<{
|
|
8354
|
+
/** Whether the email was sent successfully */
|
|
8355
|
+
readonly success: v.BooleanSchema<undefined>;
|
|
8356
|
+
/** Provider message ID (for tracking) */
|
|
8357
|
+
readonly messageId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
8358
|
+
/** Error message if sending failed */
|
|
8359
|
+
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
8360
|
+
}, undefined>;
|
|
8361
|
+
/** Request payload for sending an email. */
|
|
8362
|
+
type SendEmailRequest = v.InferOutput<typeof SendEmailRequestSchema>;
|
|
8363
|
+
/** Response payload after sending an email. */
|
|
8364
|
+
type SendEmailResponse = v.InferOutput<typeof SendEmailResponseSchema>;
|
|
8365
|
+
declare function validateSendEmailRequest(data: unknown): v.SafeParseResult<v.ObjectSchema<{
|
|
8366
|
+
/** Template ID from the registry */
|
|
8367
|
+
readonly templateId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
|
|
8368
|
+
/** Recipient email address */
|
|
8369
|
+
readonly to: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>]>;
|
|
8370
|
+
/** Template data (shape depends on template) */
|
|
8371
|
+
readonly data: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
|
|
8372
|
+
/** Locale for i18n rendering (default: 'fr') */
|
|
8373
|
+
readonly locale: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 2, undefined>, v.MaxLengthAction<string, 5, undefined>]>, "fr">;
|
|
8374
|
+
/** Override "from" address */
|
|
8375
|
+
readonly from: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
8376
|
+
/** Override reply-to address */
|
|
8377
|
+
readonly replyTo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
8378
|
+
}, undefined>>;
|
|
8379
|
+
declare function validateSendEmailResponse(data: unknown): v.SafeParseResult<v.ObjectSchema<{
|
|
8380
|
+
/** Whether the email was sent successfully */
|
|
8381
|
+
readonly success: v.BooleanSchema<undefined>;
|
|
8382
|
+
/** Provider message ID (for tracking) */
|
|
8383
|
+
readonly messageId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
8384
|
+
/** Error message if sending failed */
|
|
8385
|
+
readonly error: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
8386
|
+
}, undefined>>;
|
|
8387
|
+
|
|
8388
|
+
/**
|
|
8389
|
+
* @fileoverview Email Types
|
|
8390
|
+
* @description Type definitions for email feature. Provider abstraction, template registry, route config.
|
|
8391
|
+
*
|
|
8392
|
+
* @version 0.1.0
|
|
8393
|
+
* @since 0.1.0
|
|
8394
|
+
* @author AMBROISE PARK Consulting
|
|
8395
|
+
*/
|
|
8396
|
+
|
|
8397
|
+
/** Email provider type */
|
|
8398
|
+
type EmailProvider = (typeof EMAIL_PROVIDERS)[keyof typeof EMAIL_PROVIDERS];
|
|
8399
|
+
/** Email error code type */
|
|
8400
|
+
type EmailErrorCode = (typeof EMAIL_ERROR_CODES)[keyof typeof EMAIL_ERROR_CODES];
|
|
8401
|
+
/**
|
|
8402
|
+
* Email template with i18n support.
|
|
8403
|
+
* Templates render subject + HTML body from typed data and locale.
|
|
8404
|
+
*
|
|
8405
|
+
* @template TData - Shape of the template data
|
|
8406
|
+
*/
|
|
8407
|
+
interface EmailTemplate<TData extends Record<string, unknown> = Record<string, unknown>> {
|
|
8408
|
+
/** Render email subject for a given locale */
|
|
8409
|
+
subject: (data: TData, locale: string) => string;
|
|
8410
|
+
/** Render email HTML body for a given locale */
|
|
8411
|
+
html: (data: TData, locale: string) => string;
|
|
8412
|
+
}
|
|
8413
|
+
/**
|
|
8414
|
+
* Registry of named email templates.
|
|
8415
|
+
* Each key is a template ID used in send requests.
|
|
8416
|
+
*/
|
|
8417
|
+
type EmailTemplateRegistry = Record<string, EmailTemplate<any>>;
|
|
8418
|
+
/** Configuration for email feature (consumer-facing) */
|
|
8419
|
+
interface EmailConfig {
|
|
8420
|
+
/** Email provider */
|
|
8421
|
+
provider: EmailProvider;
|
|
8422
|
+
/** Default "from" address */
|
|
8423
|
+
defaultFrom: string;
|
|
8424
|
+
/** Default reply-to address */
|
|
8425
|
+
replyTo?: string;
|
|
8426
|
+
}
|
|
8427
|
+
/** Email route configuration (server-side) */
|
|
8428
|
+
interface EmailRouteConfig {
|
|
8429
|
+
/** Email provider */
|
|
8430
|
+
provider: EmailProvider;
|
|
8431
|
+
/** Default "from" address (e.g., "Frabled <noreply@frabled.com>") */
|
|
8432
|
+
defaultFrom: string;
|
|
8433
|
+
/** Default reply-to address */
|
|
8434
|
+
replyTo?: string;
|
|
8435
|
+
/** Registered templates */
|
|
8436
|
+
templates: EmailTemplateRegistry;
|
|
8437
|
+
}
|
|
8438
|
+
|
|
7365
8439
|
/**
|
|
7366
8440
|
* @fileoverview Error Types Used Throughout the DoNotDev Platform
|
|
7367
8441
|
* @description Centralized definition of error types to ensure consistency across packages. Defines standard error codes, error classes, and error handling types.
|
|
@@ -7395,6 +8469,7 @@ declare const ERROR_CODES: {
|
|
|
7395
8469
|
readonly UNKNOWN: "unknown";
|
|
7396
8470
|
readonly VALIDATION_FAILED: "validation-failed";
|
|
7397
8471
|
};
|
|
8472
|
+
/** Standardized error code derived from ERROR_CODES constant. */
|
|
7398
8473
|
type ErrorCode = (typeof ERROR_CODES)[keyof typeof ERROR_CODES];
|
|
7399
8474
|
/**
|
|
7400
8475
|
* Severity levels for error notifications and logging
|
|
@@ -7405,6 +8480,7 @@ declare const ERROR_SEVERITY: {
|
|
|
7405
8480
|
readonly INFO: "info";
|
|
7406
8481
|
readonly SUCCESS: "success";
|
|
7407
8482
|
};
|
|
8483
|
+
/** Error severity level for notifications and logging. */
|
|
7408
8484
|
type ErrorSeverity = (typeof ERROR_SEVERITY)[keyof typeof ERROR_SEVERITY];
|
|
7409
8485
|
/**
|
|
7410
8486
|
* Error types used in entity hooks
|
|
@@ -7417,6 +8493,7 @@ declare const ENTITY_HOOK_ERRORS: {
|
|
|
7417
8493
|
readonly ALREADY_EXISTS: "ALREADY_EXISTS";
|
|
7418
8494
|
readonly NETWORK_ERROR: "NETWORK_ERROR";
|
|
7419
8495
|
};
|
|
8496
|
+
/** Error type for entity hook operations (CRUD mutations). */
|
|
7420
8497
|
type EntityHookErrors = (typeof ENTITY_HOOK_ERRORS)[keyof typeof ENTITY_HOOK_ERRORS];
|
|
7421
8498
|
/**
|
|
7422
8499
|
* Maps Firebase error codes to entity hook error types
|
|
@@ -7455,6 +8532,7 @@ declare const ERROR_SOURCE: {
|
|
|
7455
8532
|
readonly UI: "ui";
|
|
7456
8533
|
readonly UNKNOWN: "unknown";
|
|
7457
8534
|
};
|
|
8535
|
+
/** Origin of an error for tracking and reporting. */
|
|
7458
8536
|
type ErrorSource = (typeof ERROR_SOURCE)[keyof typeof ERROR_SOURCE];
|
|
7459
8537
|
/**
|
|
7460
8538
|
* Standardized error class for the DoNotDev platform
|
|
@@ -8946,2023 +10024,45 @@ interface FunctionsConfig {
|
|
|
8946
10024
|
defaults?: FunctionDefaults;
|
|
8947
10025
|
/** Static functions configuration (non-CRUD) */
|
|
8948
10026
|
functions?: Record<string, FunctionMeta>;
|
|
8949
|
-
/** CRUD auto-generation configuration */
|
|
8950
|
-
crud?: CrudConfig;
|
|
8951
|
-
}
|
|
8952
|
-
/**
|
|
8953
|
-
* Generated function endpoint entry (for YAML output)
|
|
8954
|
-
*
|
|
8955
|
-
* @version 0.1.0
|
|
8956
|
-
* @since 0.0.1
|
|
8957
|
-
* @author AMBROISE PARK Consulting
|
|
8958
|
-
*/
|
|
8959
|
-
interface FunctionEndpoint {
|
|
8960
|
-
/** Function name (key in endpoints object) */
|
|
8961
|
-
name: string;
|
|
8962
|
-
/** Deployment regions */
|
|
8963
|
-
region: string[];
|
|
8964
|
-
/** Platform version */
|
|
8965
|
-
platform: 'gcfv1' | 'gcfv2';
|
|
8966
|
-
/** Trigger configuration */
|
|
8967
|
-
callableTrigger?: Record<string, never>;
|
|
8968
|
-
httpsTrigger?: Record<string, never>;
|
|
8969
|
-
scheduleTrigger?: {
|
|
8970
|
-
schedule: string;
|
|
8971
|
-
};
|
|
8972
|
-
/** Entry point in bundled code */
|
|
8973
|
-
entryPoint: string;
|
|
8974
|
-
/** Labels for organization */
|
|
8975
|
-
labels: Record<string, string>;
|
|
8976
|
-
/** Memory allocation */
|
|
8977
|
-
memory?: string;
|
|
8978
|
-
/** Timeout */
|
|
8979
|
-
timeoutSeconds?: number;
|
|
8980
|
-
/** Min instances */
|
|
8981
|
-
minInstances?: number;
|
|
8982
|
-
/** Max instances */
|
|
8983
|
-
maxInstances?: number;
|
|
8984
|
-
/** Secret environment variables */
|
|
8985
|
-
secretEnvironmentVariables?: Array<{
|
|
8986
|
-
key: string;
|
|
8987
|
-
}>;
|
|
8988
|
-
}
|
|
8989
|
-
|
|
8990
|
-
// Types
|
|
8991
|
-
|
|
8992
|
-
type $Dictionary<T = unknown> = { [key: string]: T };
|
|
8993
|
-
|
|
8994
|
-
type $SpecialObject = object | Array<string | object>;
|
|
8995
|
-
|
|
8996
|
-
// Types Operators
|
|
8997
|
-
|
|
8998
|
-
type $Prune<T> =
|
|
8999
|
-
| never
|
|
9000
|
-
| { [K in keyof T as [keyof T[K]] extends [never] ? never : K]: T[K] };
|
|
9001
|
-
|
|
9002
|
-
/** All the way down. */
|
|
9003
|
-
interface $Turtles {
|
|
9004
|
-
[x: string]: $Turtles;
|
|
9005
|
-
}
|
|
9006
|
-
|
|
9007
|
-
type $MergeBy<T, K> = Omit<T, keyof K> & K;
|
|
9008
|
-
|
|
9009
|
-
type $OmitArrayKeys<Arr> = Arr extends readonly any[] ? Omit<Arr, keyof any[]> : Arr;
|
|
9010
|
-
|
|
9011
|
-
type $PreservedValue<Value, Fallback> = [Value] extends [never] ? Fallback : Value;
|
|
9012
|
-
|
|
9013
|
-
type $NormalizeIntoArray<T extends unknown | readonly unknown[]> =
|
|
9014
|
-
T extends readonly unknown[] ? T : [T];
|
|
9015
|
-
|
|
9016
|
-
/**
|
|
9017
|
-
* @typeParam T
|
|
9018
|
-
* @example
|
|
9019
|
-
* ```
|
|
9020
|
-
* $UnionToIntersection<{foo: {bar: string} | {asd: boolean}}> = {foo: {bar: string} & {asd: boolean}}
|
|
9021
|
-
* ```
|
|
9022
|
-
*
|
|
9023
|
-
* @see https://stackoverflow.com/questions/50374908/transform-union-type-to-intersection-type
|
|
9024
|
-
*/
|
|
9025
|
-
type $UnionToIntersection<T> = (T extends unknown ? (k: T) => void : never) extends (
|
|
9026
|
-
k: infer I,
|
|
9027
|
-
) => void
|
|
9028
|
-
? I
|
|
9029
|
-
: never;
|
|
9030
|
-
|
|
9031
|
-
/**
|
|
9032
|
-
* @typeParam TPath union of strings
|
|
9033
|
-
* @typeParam TValue value of the record
|
|
9034
|
-
* @example
|
|
9035
|
-
* ```
|
|
9036
|
-
* $StringKeyPathToRecord<'foo.bar' | 'asd'> = {foo: {bar: string} | {asd: boolean}}
|
|
9037
|
-
* ```
|
|
9038
|
-
*/
|
|
9039
|
-
type $StringKeyPathToRecordUnion<
|
|
9040
|
-
TPath extends string,
|
|
9041
|
-
TValue,
|
|
9042
|
-
> = TPath extends `${infer TKey}.${infer Rest}`
|
|
9043
|
-
? { [Key in TKey]: $StringKeyPathToRecord<Rest, TValue> }
|
|
9044
|
-
: { [Key in TPath]: TValue };
|
|
9045
|
-
|
|
9046
|
-
/**
|
|
9047
|
-
* Used to intersect output of {@link $StringKeyPathToRecordUnion}
|
|
9048
|
-
*
|
|
9049
|
-
* @typeParam TPath union of strings
|
|
9050
|
-
* @typeParam TValue value of the record
|
|
9051
|
-
* @example
|
|
9052
|
-
* ```
|
|
9053
|
-
* $StringKeyPathToRecord<'foo.bar' | 'asd'> = {foo: {bar: string} & {asd: boolean}}
|
|
9054
|
-
* ```
|
|
9055
|
-
*/
|
|
9056
|
-
type $StringKeyPathToRecord<TPath extends string, TValue> = $UnionToIntersection<
|
|
9057
|
-
$StringKeyPathToRecordUnion<TPath, TValue>
|
|
9058
|
-
>;
|
|
9059
|
-
|
|
9060
|
-
/**
|
|
9061
|
-
* We could use NoInfer typescript build-in utility,
|
|
9062
|
-
* however this project still supports ts < 5.4.
|
|
9063
|
-
*
|
|
9064
|
-
* @see https://github.com/millsp/ts-toolbelt/blob/master/sources/Function/NoInfer.ts
|
|
9065
|
-
*/
|
|
9066
|
-
type $NoInfer<A> = [A][A extends any ? 0 : never];
|
|
9067
|
-
|
|
9068
|
-
/**
|
|
9069
|
-
* This interface can be augmented by users to add types to `i18next` default TypeOptions.
|
|
9070
|
-
*
|
|
9071
|
-
* Usage:
|
|
9072
|
-
* ```ts
|
|
9073
|
-
* // i18next.d.ts
|
|
9074
|
-
* import 'i18next';
|
|
9075
|
-
* declare module 'i18next' {
|
|
9076
|
-
* interface CustomTypeOptions {
|
|
9077
|
-
* defaultNS: 'custom';
|
|
9078
|
-
* returnNull: false;
|
|
9079
|
-
* returnObjects: false;
|
|
9080
|
-
* nsSeparator: ':';
|
|
9081
|
-
* keySeparator: '.';
|
|
9082
|
-
* compatibilityJSON: 'v4';
|
|
9083
|
-
* allowObjectInHTMLChildren: false;
|
|
9084
|
-
* resources: {
|
|
9085
|
-
* custom: {
|
|
9086
|
-
* foo: 'foo';
|
|
9087
|
-
* };
|
|
9088
|
-
* };
|
|
9089
|
-
* }
|
|
9090
|
-
* }
|
|
9091
|
-
* ```
|
|
9092
|
-
*/
|
|
9093
|
-
interface CustomTypeOptions {}
|
|
9094
|
-
|
|
9095
|
-
/**
|
|
9096
|
-
* This interface can be augmented by users to add types to `i18next` default PluginOptions.
|
|
9097
|
-
*/
|
|
9098
|
-
interface CustomPluginOptions {}
|
|
9099
|
-
|
|
9100
|
-
type TypeOptions = $MergeBy<
|
|
9101
|
-
{
|
|
9102
|
-
/** @see {InitOptions.returnNull} */
|
|
9103
|
-
returnNull: false;
|
|
9104
|
-
|
|
9105
|
-
/** @see {InitOptions.returnEmptyString} */
|
|
9106
|
-
returnEmptyString: true;
|
|
9107
|
-
|
|
9108
|
-
/** @see {InitOptions.returnObjects} */
|
|
9109
|
-
returnObjects: false;
|
|
9110
|
-
|
|
9111
|
-
/** @see {InitOptions.keySeparator} */
|
|
9112
|
-
keySeparator: '.';
|
|
9113
|
-
|
|
9114
|
-
/** @see {InitOptions.nsSeparator} */
|
|
9115
|
-
nsSeparator: ':';
|
|
9116
|
-
|
|
9117
|
-
/** @see {InitOptions.pluralSeparator} */
|
|
9118
|
-
pluralSeparator: '_';
|
|
9119
|
-
|
|
9120
|
-
/** @see {InitOptions.contextSeparator} */
|
|
9121
|
-
contextSeparator: '_';
|
|
9122
|
-
|
|
9123
|
-
/** @see {InitOptions.defaultNS} */
|
|
9124
|
-
defaultNS: 'translation';
|
|
9125
|
-
|
|
9126
|
-
/** @see {InitOptions.fallbackNS} */
|
|
9127
|
-
fallbackNS: false;
|
|
9128
|
-
|
|
9129
|
-
/** @see {InitOptions.compatibilityJSON} */
|
|
9130
|
-
compatibilityJSON: 'v4';
|
|
9131
|
-
|
|
9132
|
-
/** @see {InitOptions.resources} */
|
|
9133
|
-
resources: object;
|
|
9134
|
-
|
|
9135
|
-
/**
|
|
9136
|
-
* Flag that allows HTML elements to receive objects. This is only useful for React applications
|
|
9137
|
-
* where you pass objects to HTML elements so they can be replaced to their respective interpolation
|
|
9138
|
-
* values (mostly with Trans component)
|
|
9139
|
-
*/
|
|
9140
|
-
allowObjectInHTMLChildren: false;
|
|
9141
|
-
|
|
9142
|
-
/**
|
|
9143
|
-
* Flag that enables strict key checking even if a `defaultValue` has been provided.
|
|
9144
|
-
* This ensures all calls of `t` function don't accidentally use implicitly missing keys.
|
|
9145
|
-
*/
|
|
9146
|
-
strictKeyChecks: false;
|
|
9147
|
-
|
|
9148
|
-
/**
|
|
9149
|
-
* Prefix for interpolation
|
|
9150
|
-
*/
|
|
9151
|
-
interpolationPrefix: '{{';
|
|
9152
|
-
|
|
9153
|
-
/**
|
|
9154
|
-
* Suffix for interpolation
|
|
9155
|
-
*/
|
|
9156
|
-
interpolationSuffix: '}}';
|
|
9157
|
-
|
|
9158
|
-
/** @see {InterpolationOptions.unescapePrefix} */
|
|
9159
|
-
unescapePrefix: '-';
|
|
9160
|
-
|
|
9161
|
-
/** @see {InterpolationOptions.unescapeSuffix} */
|
|
9162
|
-
unescapeSuffix: '';
|
|
9163
|
-
|
|
9164
|
-
/**
|
|
9165
|
-
* Use a proxy-based selector to select a translation.
|
|
9166
|
-
*
|
|
9167
|
-
* Enables features like go-to definition, and better DX/faster autocompletion
|
|
9168
|
-
* for TypeScript developers.
|
|
9169
|
-
*
|
|
9170
|
-
* If you're working with an especially large set of translations and aren't
|
|
9171
|
-
* using context, you set `enableSelector` to `"optimize"` and i18next won't do
|
|
9172
|
-
* any type-level processing of your translations at all.
|
|
9173
|
-
*
|
|
9174
|
-
* With `enableSelector` set to `"optimize"`, i18next is capable of supporting
|
|
9175
|
-
* arbitrarily large/deep translation sets without causing any IDE slowdown
|
|
9176
|
-
* whatsoever.
|
|
9177
|
-
*
|
|
9178
|
-
* @default false
|
|
9179
|
-
*/
|
|
9180
|
-
enableSelector: false;
|
|
9181
|
-
},
|
|
9182
|
-
CustomTypeOptions
|
|
9183
|
-
>;
|
|
9184
|
-
|
|
9185
|
-
type PluginOptions<T> = $MergeBy<
|
|
9186
|
-
{
|
|
9187
|
-
/**
|
|
9188
|
-
* Options for language detection - check documentation of plugin
|
|
9189
|
-
* @default undefined
|
|
9190
|
-
*/
|
|
9191
|
-
detection?: object;
|
|
9192
|
-
|
|
9193
|
-
/**
|
|
9194
|
-
* Options for backend - check documentation of plugin
|
|
9195
|
-
* @default undefined
|
|
9196
|
-
*/
|
|
9197
|
-
backend?: T;
|
|
9198
|
-
|
|
9199
|
-
/**
|
|
9200
|
-
* Options for cache layer - check documentation of plugin
|
|
9201
|
-
* @default undefined
|
|
9202
|
-
*/
|
|
9203
|
-
cache?: object;
|
|
9204
|
-
|
|
9205
|
-
/**
|
|
9206
|
-
* Options for i18n message format - check documentation of plugin
|
|
9207
|
-
* @default undefined
|
|
9208
|
-
*/
|
|
9209
|
-
i18nFormat?: object;
|
|
9210
|
-
},
|
|
9211
|
-
CustomPluginOptions
|
|
9212
|
-
>;
|
|
9213
|
-
|
|
9214
|
-
type FormatFunction = (
|
|
9215
|
-
value: any,
|
|
9216
|
-
format?: string,
|
|
9217
|
-
lng?: string,
|
|
9218
|
-
options?: InterpolationOptions & $Dictionary<any>,
|
|
9219
|
-
) => string;
|
|
9220
|
-
|
|
9221
|
-
interface InterpolationOptions {
|
|
9222
|
-
/**
|
|
9223
|
-
* Format function see formatting for details
|
|
9224
|
-
* @default noop
|
|
9225
|
-
*/
|
|
9226
|
-
format?: FormatFunction;
|
|
9227
|
-
/**
|
|
9228
|
-
* Used to separate format from interpolation value
|
|
9229
|
-
* @default ','
|
|
9230
|
-
*/
|
|
9231
|
-
formatSeparator?: string;
|
|
9232
|
-
/**
|
|
9233
|
-
* Escape function
|
|
9234
|
-
* @default str => str
|
|
9235
|
-
*/
|
|
9236
|
-
escape?(str: string): string;
|
|
9237
|
-
|
|
9238
|
-
/**
|
|
9239
|
-
* Always format interpolated values.
|
|
9240
|
-
* @default false
|
|
9241
|
-
*/
|
|
9242
|
-
alwaysFormat?: boolean;
|
|
9243
|
-
/**
|
|
9244
|
-
* Escape passed in values to avoid xss injection
|
|
9245
|
-
* @default true
|
|
9246
|
-
*/
|
|
9247
|
-
escapeValue?: boolean;
|
|
9248
|
-
/**
|
|
9249
|
-
* If true, then value passed into escape function is not casted to string, use with custom escape function that does its own type check
|
|
9250
|
-
* @default false
|
|
9251
|
-
*/
|
|
9252
|
-
useRawValueToEscape?: boolean;
|
|
9253
|
-
/**
|
|
9254
|
-
* Prefix for interpolation
|
|
9255
|
-
* @default '{{'
|
|
9256
|
-
*/
|
|
9257
|
-
prefix?: string;
|
|
9258
|
-
/**
|
|
9259
|
-
* Suffix for interpolation
|
|
9260
|
-
* @default '}}'
|
|
9261
|
-
*/
|
|
9262
|
-
suffix?: string;
|
|
9263
|
-
/**
|
|
9264
|
-
* Escaped prefix for interpolation (regexSafe)
|
|
9265
|
-
* @default undefined
|
|
9266
|
-
*/
|
|
9267
|
-
prefixEscaped?: string;
|
|
9268
|
-
/**
|
|
9269
|
-
* Escaped suffix for interpolation (regexSafe)
|
|
9270
|
-
* @default undefined
|
|
9271
|
-
*/
|
|
9272
|
-
suffixEscaped?: string;
|
|
9273
|
-
/**
|
|
9274
|
-
* Suffix to unescaped mode
|
|
9275
|
-
* @default undefined
|
|
9276
|
-
*/
|
|
9277
|
-
unescapeSuffix?: string;
|
|
9278
|
-
/**
|
|
9279
|
-
* Prefix to unescaped mode
|
|
9280
|
-
* @default '-'
|
|
9281
|
-
*/
|
|
9282
|
-
unescapePrefix?: string;
|
|
9283
|
-
/**
|
|
9284
|
-
* Prefix for nesting
|
|
9285
|
-
* @default '$t('
|
|
9286
|
-
*/
|
|
9287
|
-
nestingPrefix?: string;
|
|
9288
|
-
/**
|
|
9289
|
-
* Suffix for nesting
|
|
9290
|
-
* @default ')'
|
|
9291
|
-
*/
|
|
9292
|
-
nestingSuffix?: string;
|
|
9293
|
-
/**
|
|
9294
|
-
* Escaped prefix for nesting (regexSafe)
|
|
9295
|
-
* @default undefined
|
|
9296
|
-
*/
|
|
9297
|
-
nestingPrefixEscaped?: string;
|
|
9298
|
-
/**
|
|
9299
|
-
* Escaped suffix for nesting (regexSafe)
|
|
9300
|
-
* @default undefined
|
|
9301
|
-
*/
|
|
9302
|
-
nestingSuffixEscaped?: string;
|
|
9303
|
-
/**
|
|
9304
|
-
* Separates options from key
|
|
9305
|
-
* @default ','
|
|
9306
|
-
*/
|
|
9307
|
-
nestingOptionsSeparator?: string;
|
|
9308
|
-
/**
|
|
9309
|
-
* Global variables to use in interpolation replacements
|
|
9310
|
-
* @default undefined
|
|
9311
|
-
*/
|
|
9312
|
-
|
|
9313
|
-
defaultVariables?: { [index: string]: any };
|
|
9314
|
-
/**
|
|
9315
|
-
* After how many interpolation runs to break out before throwing a stack overflow
|
|
9316
|
-
* @default 1000
|
|
9317
|
-
*/
|
|
9318
|
-
maxReplaces?: number;
|
|
9319
|
-
|
|
9320
|
-
/**
|
|
9321
|
-
* If true, it will skip to interpolate the variables
|
|
9322
|
-
* @default true
|
|
9323
|
-
*/
|
|
9324
|
-
skipOnVariables?: boolean;
|
|
9325
|
-
}
|
|
9326
|
-
|
|
9327
|
-
interface FallbackLngObjList {
|
|
9328
|
-
[language: string]: readonly string[];
|
|
9329
|
-
}
|
|
9330
|
-
|
|
9331
|
-
type FallbackLng =
|
|
9332
|
-
| string
|
|
9333
|
-
| readonly string[]
|
|
9334
|
-
| FallbackLngObjList
|
|
9335
|
-
| ((code: string) => string | readonly string[] | FallbackLngObjList);
|
|
9336
|
-
|
|
9337
|
-
interface ReactOptions {
|
|
9338
|
-
/**
|
|
9339
|
-
* Set it to fallback to let passed namespaces to translated hoc act as fallbacks
|
|
9340
|
-
* @default 'default'
|
|
9341
|
-
*/
|
|
9342
|
-
nsMode?: 'default' | 'fallback';
|
|
9343
|
-
/**
|
|
9344
|
-
* Set it to the default parent element created by the Trans component.
|
|
9345
|
-
* @default 'div'
|
|
9346
|
-
*/
|
|
9347
|
-
defaultTransParent?: string;
|
|
9348
|
-
/**
|
|
9349
|
-
* Set which events trigger a re-render, can be set to false or string of events
|
|
9350
|
-
* @default 'languageChanged'
|
|
9351
|
-
*/
|
|
9352
|
-
bindI18n?: string | false;
|
|
9353
|
-
/**
|
|
9354
|
-
* Set which events on store trigger a re-render, can be set to false or string of events
|
|
9355
|
-
* @default ''
|
|
9356
|
-
*/
|
|
9357
|
-
bindI18nStore?: string | false;
|
|
9358
|
-
/**
|
|
9359
|
-
* Set fallback value for Trans components without children
|
|
9360
|
-
* @default undefined
|
|
9361
|
-
*/
|
|
9362
|
-
transEmptyNodeValue?: string;
|
|
9363
|
-
/**
|
|
9364
|
-
* Set it to false if you do not want to use Suspense
|
|
9365
|
-
* @default true
|
|
9366
|
-
*/
|
|
9367
|
-
useSuspense?: boolean;
|
|
9368
|
-
/**
|
|
9369
|
-
* Function to generate an i18nKey from the defaultValue (or Trans children)
|
|
9370
|
-
* when no key is provided.
|
|
9371
|
-
* By default, the defaultValue (Trans text) itself is used as the key.
|
|
9372
|
-
* If you want to require keys for all translations, supply a function
|
|
9373
|
-
* that always throws an error.
|
|
9374
|
-
* @default undefined
|
|
9375
|
-
*/
|
|
9376
|
-
hashTransKey?(defaultValue: TOptionsBase['defaultValue']): TOptionsBase['defaultValue'];
|
|
9377
|
-
/**
|
|
9378
|
-
* Convert eg. <br/> found in translations to a react component of type br
|
|
9379
|
-
* @default true
|
|
9380
|
-
*/
|
|
9381
|
-
transSupportBasicHtmlNodes?: boolean;
|
|
9382
|
-
/**
|
|
9383
|
-
* Which nodes not to convert in defaultValue generation in the Trans component.
|
|
9384
|
-
* @default ['br', 'strong', 'i', 'p']
|
|
9385
|
-
*/
|
|
9386
|
-
transKeepBasicHtmlNodesFor?: readonly string[];
|
|
9387
|
-
/**
|
|
9388
|
-
* Wrap text nodes in a user-specified element.
|
|
9389
|
-
* @default ''
|
|
9390
|
-
*/
|
|
9391
|
-
transWrapTextNodes?: string;
|
|
9392
|
-
/**
|
|
9393
|
-
* Default props to apply to all Trans components.
|
|
9394
|
-
* Component-level props will override these defaults.
|
|
9395
|
-
*/
|
|
9396
|
-
transDefaultProps?: {
|
|
9397
|
-
tOptions?: TOptions;
|
|
9398
|
-
values?: object;
|
|
9399
|
-
shouldUnescape?: boolean;
|
|
9400
|
-
components?: readonly unknown[] | { readonly [tagName: string]: unknown }; // Use `unknown` (or `any`) to be permissive without importing React.
|
|
9401
|
-
};
|
|
9402
|
-
/**
|
|
9403
|
-
* Optional keyPrefix that will be automatically applied to returned t function in useTranslation for example.
|
|
9404
|
-
* @default undefined
|
|
9405
|
-
*/
|
|
9406
|
-
keyPrefix?: string;
|
|
9407
|
-
/**
|
|
9408
|
-
* Unescape function
|
|
9409
|
-
* by default it unescapes some basic html entities
|
|
9410
|
-
*/
|
|
9411
|
-
unescape?(str: string): string;
|
|
9412
|
-
}
|
|
9413
|
-
|
|
9414
|
-
type ResourceKey =
|
|
9415
|
-
| string
|
|
9416
|
-
| {
|
|
9417
|
-
[key: string]: any;
|
|
9418
|
-
};
|
|
9419
|
-
|
|
9420
|
-
interface ResourceLanguage {
|
|
9421
|
-
[namespace: string]: ResourceKey;
|
|
9422
|
-
}
|
|
9423
|
-
|
|
9424
|
-
interface Resource {
|
|
9425
|
-
[language: string]: ResourceLanguage;
|
|
9426
|
-
}
|
|
9427
|
-
|
|
9428
|
-
interface InitOptions<T = object> extends PluginOptions<T> {
|
|
9429
|
-
/**
|
|
9430
|
-
* Logs info level to console output. Helps finding issues with loading not working.
|
|
9431
|
-
* @default false
|
|
9432
|
-
*/
|
|
9433
|
-
debug?: boolean;
|
|
9434
|
-
|
|
9435
|
-
/**
|
|
9436
|
-
* Show support notice in console during initialization.
|
|
9437
|
-
* @default true
|
|
9438
|
-
*/
|
|
9439
|
-
showSupportNotice?: boolean;
|
|
9440
|
-
|
|
9441
|
-
/**
|
|
9442
|
-
* Resources to initialize with (if not using loading or not appending using addResourceBundle)
|
|
9443
|
-
* @default undefined
|
|
9444
|
-
*/
|
|
9445
|
-
resources?: Resource;
|
|
9446
|
-
|
|
9447
|
-
/**
|
|
9448
|
-
* Allow initializing with bundled resources while using a backend to load non bundled ones.
|
|
9449
|
-
* @default false
|
|
9450
|
-
*/
|
|
9451
|
-
partialBundledLanguages?: boolean;
|
|
9452
|
-
|
|
9453
|
-
/**
|
|
9454
|
-
* Language to use (overrides language detection)
|
|
9455
|
-
* @default undefined
|
|
9456
|
-
*/
|
|
9457
|
-
lng?: string;
|
|
9458
|
-
|
|
9459
|
-
/**
|
|
9460
|
-
* Language to use if translations in user language are not available.
|
|
9461
|
-
* @default 'dev'
|
|
9462
|
-
*/
|
|
9463
|
-
fallbackLng?: false | FallbackLng;
|
|
9464
|
-
|
|
9465
|
-
/**
|
|
9466
|
-
* Array of allowed languages
|
|
9467
|
-
* @default false
|
|
9468
|
-
*/
|
|
9469
|
-
supportedLngs?: false | readonly string[];
|
|
9470
|
-
|
|
9471
|
-
/**
|
|
9472
|
-
* If true will pass eg. en-US if finding en in supportedLngs
|
|
9473
|
-
* @default false
|
|
9474
|
-
*/
|
|
9475
|
-
nonExplicitSupportedLngs?: boolean;
|
|
9476
|
-
|
|
9477
|
-
/**
|
|
9478
|
-
* Language codes to lookup, given set language is 'en-US':
|
|
9479
|
-
* 'all' --> ['en-US', 'en', 'dev'],
|
|
9480
|
-
* 'currentOnly' --> 'en-US',
|
|
9481
|
-
* 'languageOnly' --> 'en'
|
|
9482
|
-
* @default 'all'
|
|
9483
|
-
*/
|
|
9484
|
-
load?: 'all' | 'currentOnly' | 'languageOnly';
|
|
9485
|
-
|
|
9486
|
-
/**
|
|
9487
|
-
* Array of languages to preload. Important on server-side to assert translations are loaded before rendering views.
|
|
9488
|
-
* @default false
|
|
9489
|
-
*/
|
|
9490
|
-
preload?: false | readonly string[];
|
|
9491
|
-
|
|
9492
|
-
/**
|
|
9493
|
-
* Language will be lowercased eg. en-US --> en-us
|
|
9494
|
-
* @default false
|
|
9495
|
-
*/
|
|
9496
|
-
lowerCaseLng?: boolean;
|
|
9497
|
-
|
|
9498
|
-
/**
|
|
9499
|
-
* Language will be lowercased EN --> en while leaving full locales like en-US
|
|
9500
|
-
* @default false
|
|
9501
|
-
*/
|
|
9502
|
-
cleanCode?: boolean;
|
|
9503
|
-
|
|
9504
|
-
/**
|
|
9505
|
-
* String or array of namespaces to load
|
|
9506
|
-
* @default 'translation'
|
|
9507
|
-
*/
|
|
9508
|
-
ns?: string | readonly string[];
|
|
9509
|
-
|
|
9510
|
-
/**
|
|
9511
|
-
* Default namespace used if not passed to translation function
|
|
9512
|
-
* @default 'translation'
|
|
9513
|
-
*/
|
|
9514
|
-
defaultNS?: string | false | readonly string[];
|
|
9515
|
-
|
|
9516
|
-
/**
|
|
9517
|
-
* String or array of namespaces to lookup key if not found in given namespace.
|
|
9518
|
-
* @default false
|
|
9519
|
-
*/
|
|
9520
|
-
fallbackNS?: false | string | readonly string[];
|
|
9521
|
-
|
|
9522
|
-
/**
|
|
9523
|
-
* Calls save missing key function on backend if key not found.
|
|
9524
|
-
* @default false
|
|
9525
|
-
*/
|
|
9526
|
-
saveMissing?: boolean;
|
|
9527
|
-
|
|
9528
|
-
/**
|
|
9529
|
-
* Calls save missing key function on backend if key not found also for plural forms.
|
|
9530
|
-
* @default false
|
|
9531
|
-
*/
|
|
9532
|
-
saveMissingPlurals?: boolean;
|
|
9533
|
-
|
|
9534
|
-
/**
|
|
9535
|
-
* Experimental: enable to update default values using the saveMissing
|
|
9536
|
-
* (Works only if defaultValue different from translated value.
|
|
9537
|
-
* Only useful on initial development or when keeping code as source of truth not changing values outside of code.
|
|
9538
|
-
* Only supported if backend supports it already)
|
|
9539
|
-
* @default false
|
|
9540
|
-
*/
|
|
9541
|
-
updateMissing?: boolean;
|
|
9542
|
-
|
|
9543
|
-
/**
|
|
9544
|
-
* @default 'fallback'
|
|
9545
|
-
*/
|
|
9546
|
-
saveMissingTo?: 'current' | 'all' | 'fallback';
|
|
9547
|
-
|
|
9548
|
-
/**
|
|
9549
|
-
* Used to not fallback to the key as default value, when using saveMissing functionality.
|
|
9550
|
-
* i.e. when using with i18next-http-backend this will result in having a key with an empty string value.
|
|
9551
|
-
* @default false
|
|
9552
|
-
*/
|
|
9553
|
-
missingKeyNoValueFallbackToKey?: boolean;
|
|
9554
|
-
|
|
9555
|
-
/**
|
|
9556
|
-
* Used for custom missing key handling (needs saveMissing set to true!)
|
|
9557
|
-
* @default false
|
|
9558
|
-
*/
|
|
9559
|
-
missingKeyHandler?:
|
|
9560
|
-
| false
|
|
9561
|
-
| ((
|
|
9562
|
-
lngs: readonly string[],
|
|
9563
|
-
ns: string,
|
|
9564
|
-
key: string,
|
|
9565
|
-
fallbackValue: string,
|
|
9566
|
-
updateMissing: boolean,
|
|
9567
|
-
options: any,
|
|
9568
|
-
) => void);
|
|
9569
|
-
|
|
9570
|
-
/**
|
|
9571
|
-
* Receives a key that was not found in `t()` and returns a value, that will be returned by `t()`
|
|
9572
|
-
* @default noop
|
|
9573
|
-
*/
|
|
9574
|
-
parseMissingKeyHandler?(key: string, defaultValue?: string, options?: any): any;
|
|
9575
|
-
|
|
9576
|
-
/**
|
|
9577
|
-
* Appends namespace to missing key
|
|
9578
|
-
* @default false
|
|
9579
|
-
*/
|
|
9580
|
-
appendNamespaceToMissingKey?: boolean;
|
|
9581
|
-
|
|
9582
|
-
/**
|
|
9583
|
-
* Gets called in case a interpolation value is undefined. This method will not be called if the value is empty string or null
|
|
9584
|
-
* @default noop
|
|
9585
|
-
*/
|
|
9586
|
-
missingInterpolationHandler?: (text: string, value: any, options: InitOptions) => any;
|
|
9587
|
-
|
|
9588
|
-
/**
|
|
9589
|
-
* Will use 'plural' as suffix for languages only having 1 plural form, setting it to false will suffix all with numbers
|
|
9590
|
-
* @default true
|
|
9591
|
-
*/
|
|
9592
|
-
simplifyPluralSuffix?: boolean;
|
|
9593
|
-
|
|
9594
|
-
/**
|
|
9595
|
-
* String or array of postProcessors to apply per default
|
|
9596
|
-
* @default false
|
|
9597
|
-
*/
|
|
9598
|
-
postProcess?: false | string | readonly string[];
|
|
9599
|
-
|
|
9600
|
-
/**
|
|
9601
|
-
* passthrough the resolved object including 'usedNS', 'usedLang' etc into options object of postprocessors as 'i18nResolved' property
|
|
9602
|
-
* @default false
|
|
9603
|
-
*/
|
|
9604
|
-
postProcessPassResolved?: boolean;
|
|
9605
|
-
|
|
9606
|
-
/**
|
|
9607
|
-
* Allows null values as valid translation
|
|
9608
|
-
* @default false
|
|
9609
|
-
*/
|
|
9610
|
-
returnNull?: boolean;
|
|
9611
|
-
|
|
9612
|
-
/**
|
|
9613
|
-
* Allows empty string as valid translation
|
|
9614
|
-
* @default true
|
|
9615
|
-
*/
|
|
9616
|
-
returnEmptyString?: boolean;
|
|
9617
|
-
|
|
9618
|
-
/**
|
|
9619
|
-
* Allows objects as valid translation result
|
|
9620
|
-
* @default false
|
|
9621
|
-
*/
|
|
9622
|
-
returnObjects?: boolean;
|
|
9623
|
-
|
|
9624
|
-
/**
|
|
9625
|
-
* Returns an object that includes information about the used language, namespace, key and value
|
|
9626
|
-
* @default false
|
|
9627
|
-
*/
|
|
9628
|
-
returnDetails?: boolean;
|
|
9629
|
-
|
|
9630
|
-
/**
|
|
9631
|
-
* Gets called if object was passed in as key but returnObjects was set to false
|
|
9632
|
-
* @default noop
|
|
9633
|
-
*/
|
|
9634
|
-
returnedObjectHandler?(key: string, value: string, options: any): void;
|
|
9635
|
-
|
|
9636
|
-
/**
|
|
9637
|
-
* Char, eg. '\n' that arrays will be joined by
|
|
9638
|
-
* @default false
|
|
9639
|
-
*/
|
|
9640
|
-
joinArrays?: false | string;
|
|
9641
|
-
|
|
9642
|
-
/**
|
|
9643
|
-
* Sets defaultValue
|
|
9644
|
-
* @default args => ({ defaultValue: args[1] })
|
|
9645
|
-
*/
|
|
9646
|
-
overloadTranslationOptionHandler?(args: string[]): TOptions;
|
|
9647
|
-
|
|
9648
|
-
/**
|
|
9649
|
-
* @see https://www.i18next.com/translation-function/interpolation
|
|
9650
|
-
*/
|
|
9651
|
-
interpolation?: InterpolationOptions;
|
|
9652
|
-
|
|
9653
|
-
/**
|
|
9654
|
-
* Options for react - check documentation of plugin
|
|
9655
|
-
* @default undefined
|
|
9656
|
-
*/
|
|
9657
|
-
react?: ReactOptions;
|
|
9658
|
-
|
|
9659
|
-
/**
|
|
9660
|
-
* Triggers resource loading in init function inside a setTimeout (default async behaviour).
|
|
9661
|
-
* Set it to false if your backend loads resources sync - that way calling i18next.t after
|
|
9662
|
-
* init is possible without relaying on the init callback.
|
|
9663
|
-
* @default true
|
|
9664
|
-
*/
|
|
9665
|
-
initAsync?: boolean;
|
|
9666
|
-
|
|
9667
|
-
/**
|
|
9668
|
-
* @deprecated Use initAsync instead.
|
|
9669
|
-
*/
|
|
9670
|
-
initImmediate?: boolean;
|
|
9671
|
-
|
|
9672
|
-
/**
|
|
9673
|
-
* Char to separate keys
|
|
9674
|
-
* @default '.'
|
|
9675
|
-
*/
|
|
9676
|
-
keySeparator?: false | string;
|
|
9677
|
-
|
|
9678
|
-
/**
|
|
9679
|
-
* Char to split namespace from key
|
|
9680
|
-
* @default ':'
|
|
9681
|
-
*/
|
|
9682
|
-
nsSeparator?: false | string;
|
|
9683
|
-
|
|
9684
|
-
/**
|
|
9685
|
-
* Char to split plural from key
|
|
9686
|
-
* @default '_'
|
|
9687
|
-
*/
|
|
9688
|
-
pluralSeparator?: string;
|
|
9689
|
-
|
|
9690
|
-
/**
|
|
9691
|
-
* Char to split context from key
|
|
9692
|
-
* @default '_'
|
|
9693
|
-
*/
|
|
9694
|
-
contextSeparator?: string;
|
|
9695
|
-
|
|
9696
|
-
/**
|
|
9697
|
-
* Prefixes the namespace to the returned key when using `cimode`
|
|
9698
|
-
* @default false
|
|
9699
|
-
*/
|
|
9700
|
-
appendNamespaceToCIMode?: boolean;
|
|
9701
|
-
|
|
9702
|
-
/**
|
|
9703
|
-
* Compatibility JSON version
|
|
9704
|
-
* @warning only `v4` is available and supported by typescript
|
|
9705
|
-
* @default 'v4'
|
|
9706
|
-
*/
|
|
9707
|
-
compatibilityJSON?: 'v4';
|
|
9708
|
-
|
|
9709
|
-
/**
|
|
9710
|
-
* Options for https://github.com/locize/locize-lastused
|
|
9711
|
-
* @default undefined
|
|
9712
|
-
*/
|
|
9713
|
-
locizeLastUsed?: {
|
|
9714
|
-
/**
|
|
9715
|
-
* The id of your locize project
|
|
9716
|
-
*/
|
|
9717
|
-
projectId: string;
|
|
9718
|
-
|
|
9719
|
-
/**
|
|
9720
|
-
* An api key if you want to send missing keys
|
|
9721
|
-
*/
|
|
9722
|
-
apiKey?: string;
|
|
9723
|
-
|
|
9724
|
-
/**
|
|
9725
|
-
* The reference language of your project
|
|
9726
|
-
* @default 'en'
|
|
9727
|
-
*/
|
|
9728
|
-
referenceLng?: string;
|
|
9729
|
-
|
|
9730
|
-
/**
|
|
9731
|
-
* Version
|
|
9732
|
-
* @default 'latest'
|
|
9733
|
-
*/
|
|
9734
|
-
version?: string;
|
|
9735
|
-
|
|
9736
|
-
/**
|
|
9737
|
-
* Debounce interval to send data in milliseconds
|
|
9738
|
-
* @default 90000
|
|
9739
|
-
*/
|
|
9740
|
-
debounceSubmit?: number;
|
|
9741
|
-
|
|
9742
|
-
/**
|
|
9743
|
-
* Hostnames that are allowed to send last used data.
|
|
9744
|
-
* Please keep those to your local system, staging, test servers (not production)
|
|
9745
|
-
* @default ['localhost']
|
|
9746
|
-
*/
|
|
9747
|
-
allowedHosts?: readonly string[];
|
|
9748
|
-
};
|
|
9749
|
-
|
|
9750
|
-
/**
|
|
9751
|
-
* Automatically lookup for a flat key if a nested key is not found an vice-versa
|
|
9752
|
-
* @default true
|
|
9753
|
-
*/
|
|
9754
|
-
ignoreJSONStructure?: boolean;
|
|
9755
|
-
|
|
9756
|
-
/**
|
|
9757
|
-
* Limit parallelism of calls to backend
|
|
9758
|
-
* This is needed to prevent trying to open thousands of
|
|
9759
|
-
* sockets or file descriptors, which can cause failures
|
|
9760
|
-
* and actually make the entire process take longer.
|
|
9761
|
-
* @default 10
|
|
9762
|
-
*/
|
|
9763
|
-
maxParallelReads?: number;
|
|
9764
|
-
|
|
9765
|
-
/**
|
|
9766
|
-
* The maximum number of retries to perform.
|
|
9767
|
-
* Note that retries are only performed when a request has no response
|
|
9768
|
-
* and throws an error.
|
|
9769
|
-
* The default value is used if value is set below 0.
|
|
9770
|
-
* @default 5
|
|
9771
|
-
*/
|
|
9772
|
-
maxRetries?: number;
|
|
9773
|
-
|
|
9774
|
-
/**
|
|
9775
|
-
* Set how long to wait, in milliseconds, between retries of failed requests.
|
|
9776
|
-
* This number is compounded by a factor of 2 for subsequent retry.
|
|
9777
|
-
* The default value is used if value is set below 1ms.
|
|
9778
|
-
* @default 350
|
|
9779
|
-
*/
|
|
9780
|
-
retryTimeout?: number;
|
|
9781
|
-
|
|
9782
|
-
/**
|
|
9783
|
-
* Initializes the internal formatter for the in-built formats as cached version.
|
|
9784
|
-
* Can be set to false for this type of issues: https://github.com/i18next/i18next/issues/2227
|
|
9785
|
-
* @default true
|
|
9786
|
-
*/
|
|
9787
|
-
cacheInBuiltFormats?: boolean;
|
|
9788
|
-
}
|
|
9789
|
-
|
|
9790
|
-
interface TOptionsBase {
|
|
9791
|
-
/**
|
|
9792
|
-
* Default value to return if a translation was not found
|
|
9793
|
-
*/
|
|
9794
|
-
defaultValue?: unknown;
|
|
9795
|
-
/**
|
|
9796
|
-
* Count value used for plurals
|
|
9797
|
-
*/
|
|
9798
|
-
count?: number;
|
|
9799
|
-
/**
|
|
9800
|
-
* Ordinal flag for ordinal plurals
|
|
9801
|
-
*/
|
|
9802
|
-
ordinal?: boolean;
|
|
9803
|
-
/**
|
|
9804
|
-
* Used for contexts (eg. male\female)
|
|
9805
|
-
*/
|
|
9806
|
-
context?: unknown;
|
|
9807
|
-
/**
|
|
9808
|
-
* Object with vars for interpolation - or put them directly in options
|
|
9809
|
-
*/
|
|
9810
|
-
replace?: any;
|
|
9811
|
-
/**
|
|
9812
|
-
* Override language to use
|
|
9813
|
-
*/
|
|
9814
|
-
lng?: string;
|
|
9815
|
-
/**
|
|
9816
|
-
* Override languages to use
|
|
9817
|
-
*/
|
|
9818
|
-
lngs?: readonly string[];
|
|
9819
|
-
/**
|
|
9820
|
-
* Override language to lookup key if not found see fallbacks for details
|
|
9821
|
-
*/
|
|
9822
|
-
fallbackLng?: false | FallbackLng;
|
|
9823
|
-
/**
|
|
9824
|
-
* Override namespaces (string or array)
|
|
9825
|
-
*/
|
|
9826
|
-
ns?: Namespace;
|
|
9827
|
-
/**
|
|
9828
|
-
* Override char to separate keys
|
|
9829
|
-
*/
|
|
9830
|
-
keySeparator?: false | string;
|
|
9831
|
-
/**
|
|
9832
|
-
* Override char to split namespace from key
|
|
9833
|
-
*/
|
|
9834
|
-
nsSeparator?: false | string;
|
|
9835
|
-
/**
|
|
9836
|
-
* Accessing an object not a translation string (can be set globally too)
|
|
9837
|
-
*/
|
|
9838
|
-
returnObjects?: boolean;
|
|
9839
|
-
/**
|
|
9840
|
-
* Returns an object that includes information about the used language, namespace, key and value
|
|
9841
|
-
*/
|
|
9842
|
-
returnDetails?: boolean;
|
|
9843
|
-
/**
|
|
9844
|
-
* Char, eg. '\n' that arrays will be joined by (can be set globally too)
|
|
9845
|
-
*/
|
|
9846
|
-
joinArrays?: string;
|
|
9847
|
-
/**
|
|
9848
|
-
* String or array of postProcessors to apply see interval plurals as a sample
|
|
9849
|
-
*/
|
|
9850
|
-
postProcess?: string | readonly string[];
|
|
9851
|
-
/**
|
|
9852
|
-
* Override interpolation options
|
|
9853
|
-
*/
|
|
9854
|
-
interpolation?: InterpolationOptions;
|
|
9855
|
-
/**
|
|
9856
|
-
* Optional keyPrefix that will be applied to the key before resolving.
|
|
9857
|
-
* Only supported on the TFunction returned by getFixedT().
|
|
9858
|
-
*/
|
|
9859
|
-
keyPrefix?: string;
|
|
9860
|
-
}
|
|
9861
|
-
|
|
9862
|
-
type TOptions<TInterpolationMap extends object = $Dictionary> = TOptionsBase &
|
|
9863
|
-
TInterpolationMap;
|
|
9864
|
-
|
|
9865
|
-
type FlatNamespace = $PreservedValue<keyof TypeOptions['resources'], string>;
|
|
9866
|
-
type Namespace<T = FlatNamespace> = T | readonly T[];
|
|
9867
|
-
type DefaultNamespace = TypeOptions['defaultNS'];
|
|
9868
|
-
|
|
9869
|
-
/** @todo consider to replace {} with Record<string, never> */
|
|
9870
|
-
|
|
9871
|
-
// Type Options
|
|
9872
|
-
type _ReturnObjects = TypeOptions['returnObjects'];
|
|
9873
|
-
type _ReturnEmptyString = TypeOptions['returnEmptyString'];
|
|
9874
|
-
type _ReturnNull = TypeOptions['returnNull'];
|
|
9875
|
-
type _KeySeparator = TypeOptions['keySeparator'];
|
|
9876
|
-
type _NsSeparator = TypeOptions['nsSeparator'];
|
|
9877
|
-
type _PluralSeparator = TypeOptions['pluralSeparator'];
|
|
9878
|
-
type _ContextSeparator = TypeOptions['contextSeparator'];
|
|
9879
|
-
type _FallbackNamespace = TypeOptions['fallbackNS'];
|
|
9880
|
-
type _Resources = TypeOptions['resources'];
|
|
9881
|
-
type _CompatibilityJSON = TypeOptions['compatibilityJSON'];
|
|
9882
|
-
type _InterpolationPrefix = TypeOptions['interpolationPrefix'];
|
|
9883
|
-
type _InterpolationSuffix = TypeOptions['interpolationSuffix'];
|
|
9884
|
-
type _UnescapePrefix = TypeOptions['unescapePrefix'];
|
|
9885
|
-
type _UnescapeSuffix = TypeOptions['unescapeSuffix'];
|
|
9886
|
-
type _StrictKeyChecks = TypeOptions['strictKeyChecks'];
|
|
9887
|
-
type _EnableSelector$1 = TypeOptions['enableSelector'];
|
|
9888
|
-
|
|
9889
|
-
type $IsResourcesDefined = [keyof _Resources] extends [never] ? false : true;
|
|
9890
|
-
type $ValueIfResourcesDefined<Value, Fallback> = $IsResourcesDefined extends true
|
|
9891
|
-
? Value
|
|
9892
|
-
: Fallback;
|
|
9893
|
-
type $FirstNamespace<Ns extends Namespace> = Ns extends readonly any[] ? Ns[0] : Ns;
|
|
9894
|
-
|
|
9895
|
-
type Resources = $ValueIfResourcesDefined<_Resources, $Dictionary<string>>;
|
|
9896
|
-
|
|
9897
|
-
type PluralSuffix = 'zero' | 'one' | 'two' | 'few' | 'many' | 'other';
|
|
9898
|
-
|
|
9899
|
-
type WithOrWithoutPlural<Key> = _CompatibilityJSON extends 'v4'
|
|
9900
|
-
? Key extends `${infer KeyWithoutOrdinalPlural}${_PluralSeparator}ordinal${_PluralSeparator}${PluralSuffix}`
|
|
9901
|
-
? KeyWithoutOrdinalPlural | Key
|
|
9902
|
-
: Key extends `${infer KeyWithoutPlural}${_PluralSeparator}${PluralSuffix}`
|
|
9903
|
-
? KeyWithoutPlural | Key
|
|
9904
|
-
: Key
|
|
9905
|
-
: Key;
|
|
9906
|
-
|
|
9907
|
-
type JoinKeys<K1, K2> = `${K1 & string}${_KeySeparator}${K2 & string}`;
|
|
9908
|
-
type AppendNamespace<Ns, Keys> = `${Ns & string}${_NsSeparator}${Keys & string}`;
|
|
9909
|
-
|
|
9910
|
-
type TrimSpaces<T extends string, Acc extends string = ''> = T extends `${infer Char}${infer Rest}`
|
|
9911
|
-
? Char extends ' '
|
|
9912
|
-
? TrimSpaces<Rest, Acc>
|
|
9913
|
-
: TrimSpaces<Rest, `${Acc}${Char}`>
|
|
9914
|
-
: T extends ''
|
|
9915
|
-
? Acc
|
|
9916
|
-
: never;
|
|
9917
|
-
|
|
9918
|
-
interface Branded<Ns extends Namespace> {
|
|
9919
|
-
$TFunctionBrand: $IsResourcesDefined extends true
|
|
9920
|
-
? `${Ns extends readonly any[] ? Ns[0] : Ns}`
|
|
9921
|
-
: never;
|
|
9922
|
-
}
|
|
9923
|
-
|
|
9924
|
-
/** ****************************************************
|
|
9925
|
-
* Build all keys and key prefixes based on Resources *
|
|
9926
|
-
***************************************************** */
|
|
9927
|
-
type KeysBuilderWithReturnObjects<Res, Key = keyof Res> = Key extends keyof Res
|
|
9928
|
-
? Res[Key] extends $Dictionary | readonly unknown[]
|
|
9929
|
-
?
|
|
9930
|
-
| JoinKeys<Key, WithOrWithoutPlural<keyof $OmitArrayKeys<Res[Key]>>>
|
|
9931
|
-
| JoinKeys<Key, KeysBuilderWithReturnObjects<Res[Key]>>
|
|
9932
|
-
: never
|
|
9933
|
-
: never;
|
|
9934
|
-
|
|
9935
|
-
type KeysBuilderWithoutReturnObjects<Res, Key = keyof $OmitArrayKeys<Res>> = Key extends keyof Res
|
|
9936
|
-
? Res[Key] extends $Dictionary | readonly unknown[]
|
|
9937
|
-
? JoinKeys<Key, KeysBuilderWithoutReturnObjects<Res[Key]>>
|
|
9938
|
-
: Key
|
|
9939
|
-
: never;
|
|
9940
|
-
|
|
9941
|
-
type KeysBuilder<Res, WithReturnObjects> = $IsResourcesDefined extends true
|
|
9942
|
-
? WithReturnObjects extends true
|
|
9943
|
-
? keyof Res | KeysBuilderWithReturnObjects<Res>
|
|
9944
|
-
: KeysBuilderWithoutReturnObjects<Res>
|
|
9945
|
-
: string;
|
|
9946
|
-
|
|
9947
|
-
type KeysWithReturnObjects = {
|
|
9948
|
-
[Ns in FlatNamespace]: WithOrWithoutPlural<KeysBuilder<Resources[Ns], true>>;
|
|
9949
|
-
};
|
|
9950
|
-
type KeysWithoutReturnObjects = {
|
|
9951
|
-
[Ns in FlatNamespace]: WithOrWithoutPlural<KeysBuilder<Resources[Ns], false>>;
|
|
9952
|
-
};
|
|
9953
|
-
|
|
9954
|
-
type ResourceKeys<WithReturnObjects = _ReturnObjects> = WithReturnObjects extends true
|
|
9955
|
-
? KeysWithReturnObjects
|
|
9956
|
-
: KeysWithoutReturnObjects;
|
|
9957
|
-
|
|
9958
|
-
/** **********************************************************************
|
|
9959
|
-
* Parse t function keys based on the namespace, options and key prefix *
|
|
9960
|
-
*********************************************************************** */
|
|
9961
|
-
type KeysByTOptions<TOpt extends TOptions> = TOpt['returnObjects'] extends true
|
|
9962
|
-
? ResourceKeys<true>
|
|
9963
|
-
: ResourceKeys;
|
|
9964
|
-
|
|
9965
|
-
type NsByTOptions<Ns extends Namespace, TOpt extends TOptions> = TOpt['ns'] extends Namespace
|
|
9966
|
-
? TOpt['ns']
|
|
9967
|
-
: Ns;
|
|
9968
|
-
|
|
9969
|
-
type ParseKeysByKeyPrefix<Keys, KPrefix> = KPrefix extends string
|
|
9970
|
-
? Keys extends `${KPrefix}${_KeySeparator}${infer Key}`
|
|
9971
|
-
? Key
|
|
9972
|
-
: never
|
|
9973
|
-
: Keys;
|
|
9974
|
-
|
|
9975
|
-
type ParseKeysByNamespaces<Ns extends Namespace, Keys> = Ns extends readonly (infer UnionNsps)[]
|
|
9976
|
-
? UnionNsps extends keyof Keys
|
|
9977
|
-
? AppendNamespace<UnionNsps, Keys[UnionNsps]>
|
|
9978
|
-
: never
|
|
9979
|
-
: never;
|
|
9980
|
-
|
|
9981
|
-
type ParseKeysByFallbackNs<Keys extends $Dictionary> = _FallbackNamespace extends false
|
|
9982
|
-
? never
|
|
9983
|
-
: _FallbackNamespace extends (infer UnionFallbackNs extends string)[]
|
|
9984
|
-
? Keys[UnionFallbackNs]
|
|
9985
|
-
: Keys[_FallbackNamespace & string];
|
|
9986
|
-
|
|
9987
|
-
type FilterKeysByContext<Keys, Context> = Context extends string
|
|
9988
|
-
? Keys extends
|
|
9989
|
-
| `${infer Prefix}${_ContextSeparator}${Context}${_PluralSeparator}${PluralSuffix}`
|
|
9990
|
-
| `${infer Prefix}${_ContextSeparator}${Context}`
|
|
9991
|
-
? Prefix
|
|
9992
|
-
: never
|
|
9993
|
-
: Keys;
|
|
9994
|
-
|
|
9995
|
-
type ParseKeys<
|
|
9996
|
-
Ns extends Namespace = DefaultNamespace,
|
|
9997
|
-
TOpt extends TOptions = {},
|
|
9998
|
-
KPrefix = undefined,
|
|
9999
|
-
Keys extends $Dictionary = KeysByTOptions<TOpt>,
|
|
10000
|
-
ActualNS extends Namespace = NsByTOptions<Ns, TOpt>,
|
|
10001
|
-
Context extends TOpt['context'] = TOpt['context'],
|
|
10002
|
-
> = $IsResourcesDefined extends true
|
|
10003
|
-
? FilterKeysByContext<
|
|
10004
|
-
| ParseKeysByKeyPrefix<Keys[$FirstNamespace<ActualNS>], KPrefix>
|
|
10005
|
-
| ParseKeysByNamespaces<ActualNS, Keys>
|
|
10006
|
-
| ParseKeysByFallbackNs<Keys>,
|
|
10007
|
-
Context
|
|
10008
|
-
>
|
|
10009
|
-
: string;
|
|
10010
|
-
|
|
10011
|
-
/** *******************************************************
|
|
10012
|
-
* Parse t function return type and interpolation values *
|
|
10013
|
-
******************************************************** */
|
|
10014
|
-
type ParseActualValue<Ret> = Ret extends `${_UnescapePrefix}${infer ActualValue}${_UnescapeSuffix}`
|
|
10015
|
-
? TrimSpaces<ActualValue>
|
|
10016
|
-
: Ret;
|
|
10017
|
-
|
|
10018
|
-
type ParseInterpolationValues<Ret> =
|
|
10019
|
-
Ret extends `${string}${_InterpolationPrefix}${infer Value}${_InterpolationSuffix}${infer Rest}`
|
|
10020
|
-
?
|
|
10021
|
-
| (Value extends `${infer ActualValue},${string}`
|
|
10022
|
-
? ParseActualValue<ActualValue>
|
|
10023
|
-
: ParseActualValue<Value>)
|
|
10024
|
-
| ParseInterpolationValues<Rest>
|
|
10025
|
-
: never;
|
|
10026
|
-
|
|
10027
|
-
type InterpolationMap<Ret> = $PreservedValue<
|
|
10028
|
-
$StringKeyPathToRecord<ParseInterpolationValues<Ret>, unknown>,
|
|
10029
|
-
Record<string, unknown>
|
|
10030
|
-
>;
|
|
10031
|
-
|
|
10032
|
-
type ParseTReturnPlural<
|
|
10033
|
-
Res,
|
|
10034
|
-
Key,
|
|
10035
|
-
KeyWithPlural = `${Key & string}${_PluralSeparator}${PluralSuffix}`,
|
|
10036
|
-
> = Res[(KeyWithPlural | Key) & keyof Res];
|
|
10037
|
-
|
|
10038
|
-
type ParseTReturnPluralOrdinal<
|
|
10039
|
-
Res,
|
|
10040
|
-
Key,
|
|
10041
|
-
KeyWithOrdinalPlural = `${Key &
|
|
10042
|
-
string}${_PluralSeparator}ordinal${_PluralSeparator}${PluralSuffix}`,
|
|
10043
|
-
> = Res[(KeyWithOrdinalPlural | Key) & keyof Res];
|
|
10044
|
-
|
|
10045
|
-
type ParseTReturnWithFallback<Key, Val> = Val extends ''
|
|
10046
|
-
? _ReturnEmptyString extends true
|
|
10047
|
-
? ''
|
|
10048
|
-
: Key
|
|
10049
|
-
: Val extends null
|
|
10050
|
-
? _ReturnNull extends true
|
|
10051
|
-
? null
|
|
10052
|
-
: Key
|
|
10053
|
-
: Val;
|
|
10054
|
-
|
|
10055
|
-
type ParseTReturn<Key, Res, TOpt extends TOptions = {}> = ParseTReturnWithFallback<
|
|
10056
|
-
Key,
|
|
10057
|
-
Key extends `${infer K1}${_KeySeparator}${infer RestKey}`
|
|
10058
|
-
? ParseTReturn<RestKey, Res[K1 & keyof Res], TOpt>
|
|
10059
|
-
: // Process plurals only if count is provided inside options
|
|
10060
|
-
TOpt['count'] extends number
|
|
10061
|
-
? TOpt['ordinal'] extends boolean
|
|
10062
|
-
? ParseTReturnPluralOrdinal<Res, Key>
|
|
10063
|
-
: ParseTReturnPlural<Res, Key>
|
|
10064
|
-
: // otherwise access plain key without adding plural and ordinal suffixes
|
|
10065
|
-
Res extends readonly unknown[]
|
|
10066
|
-
? Key extends `${infer NKey extends number}`
|
|
10067
|
-
? Res[NKey]
|
|
10068
|
-
: never
|
|
10069
|
-
: Res[Key & keyof Res]
|
|
10070
|
-
>;
|
|
10071
|
-
|
|
10072
|
-
type TReturnOptionalNull = _ReturnNull extends true ? null : never;
|
|
10073
|
-
type TReturnOptionalObjects<TOpt extends { returnObjects?: unknown }> = _ReturnObjects extends true
|
|
10074
|
-
? $SpecialObject | string
|
|
10075
|
-
: TOpt['returnObjects'] extends true
|
|
10076
|
-
? $SpecialObject
|
|
10077
|
-
: string;
|
|
10078
|
-
type DefaultTReturn<TOpt extends { returnObjects?: unknown }> =
|
|
10079
|
-
| TReturnOptionalObjects<TOpt>
|
|
10080
|
-
| TReturnOptionalNull;
|
|
10081
|
-
|
|
10082
|
-
type KeyWithContext<Key, TOpt extends TOptions> = TOpt['context'] extends string
|
|
10083
|
-
? `${Key & string}${_ContextSeparator}${TOpt['context']}`
|
|
10084
|
-
: Key;
|
|
10085
|
-
|
|
10086
|
-
// helper that maps the configured fallbackNS value to the matching resources slice
|
|
10087
|
-
type FallbackResourcesOf<FallbackNS, R> = FallbackNS extends readonly (infer FN)[]
|
|
10088
|
-
? R[FN & keyof R]
|
|
10089
|
-
: [FallbackNS] extends [false]
|
|
10090
|
-
? never
|
|
10091
|
-
: R[Extract<FallbackNS, keyof R> & keyof R];
|
|
10092
|
-
|
|
10093
|
-
/* reuse the parse helpers as top-level aliases (no nested type declarations) */
|
|
10094
|
-
type _PrimaryParse<
|
|
10095
|
-
ActualKey,
|
|
10096
|
-
PrimaryNS extends keyof Resources,
|
|
10097
|
-
TOpt extends TOptions,
|
|
10098
|
-
> = ParseTReturn<ActualKey, Resources[PrimaryNS], TOpt>;
|
|
10099
|
-
|
|
10100
|
-
type _FallbackParse<ActualKey, FallbackNS, TOpt extends TOptions> = [
|
|
10101
|
-
FallbackResourcesOf<FallbackNS, Resources>,
|
|
10102
|
-
] extends [never]
|
|
10103
|
-
? never
|
|
10104
|
-
: ParseTReturn<ActualKey, FallbackResourcesOf<FallbackNS, Resources>, TOpt>;
|
|
10105
|
-
|
|
10106
|
-
type TFunctionReturn<
|
|
10107
|
-
Ns extends Namespace,
|
|
10108
|
-
Key,
|
|
10109
|
-
TOpt extends TOptions,
|
|
10110
|
-
ActualNS extends Namespace = NsByTOptions<Ns, TOpt>,
|
|
10111
|
-
ActualKey = KeyWithContext<Key, TOpt>,
|
|
10112
|
-
> = $IsResourcesDefined extends true
|
|
10113
|
-
? ActualKey extends `${infer Nsp}${_NsSeparator}${infer RestKey}`
|
|
10114
|
-
? ParseTReturn<RestKey, Resources[Nsp & keyof Resources], TOpt>
|
|
10115
|
-
: $FirstNamespace<ActualNS> extends infer PrimaryNS
|
|
10116
|
-
? [PrimaryNS] extends [keyof Resources]
|
|
10117
|
-
? [_PrimaryParse<ActualKey, PrimaryNS & keyof Resources, TOpt>] extends [never]
|
|
10118
|
-
? [_FallbackParse<ActualKey, _FallbackNamespace, TOpt>] extends [never]
|
|
10119
|
-
? DefaultTReturn<TOpt>
|
|
10120
|
-
: _FallbackParse<ActualKey, _FallbackNamespace, TOpt>
|
|
10121
|
-
: _PrimaryParse<ActualKey, PrimaryNS & keyof Resources, TOpt>
|
|
10122
|
-
: never
|
|
10123
|
-
: never
|
|
10124
|
-
: DefaultTReturn<TOpt>;
|
|
10125
|
-
|
|
10126
|
-
type TFunctionDetailedResult<T = string, TOpt extends TOptions = {}> = {
|
|
10127
|
-
/**
|
|
10128
|
-
* The plain used key
|
|
10129
|
-
*/
|
|
10130
|
-
usedKey: string;
|
|
10131
|
-
/**
|
|
10132
|
-
* The translation result.
|
|
10133
|
-
*/
|
|
10134
|
-
res: T;
|
|
10135
|
-
/**
|
|
10136
|
-
* The key with context / plural
|
|
10137
|
-
*/
|
|
10138
|
-
exactUsedKey: string;
|
|
10139
|
-
/**
|
|
10140
|
-
* The used language for this translation.
|
|
10141
|
-
*/
|
|
10142
|
-
usedLng: string;
|
|
10143
|
-
/**
|
|
10144
|
-
* The used namespace for this translation.
|
|
10145
|
-
*/
|
|
10146
|
-
usedNS: string;
|
|
10147
|
-
/**
|
|
10148
|
-
* The parameters used for interpolation.
|
|
10149
|
-
*/
|
|
10150
|
-
usedParams: InterpolationMap<T> & { count?: TOpt['count'] };
|
|
10151
|
-
};
|
|
10152
|
-
|
|
10153
|
-
type TFunctionProcessReturnValue<Ret, DefaultValue> = Ret extends string | $SpecialObject | null
|
|
10154
|
-
? Ret
|
|
10155
|
-
: [DefaultValue] extends [never]
|
|
10156
|
-
? Ret
|
|
10157
|
-
: DefaultValue;
|
|
10158
|
-
|
|
10159
|
-
type TFunctionReturnOptionalDetails<Ret, TOpt extends TOptions> = TOpt['returnDetails'] extends true
|
|
10160
|
-
? TFunctionDetailedResult<Ret, TOpt>
|
|
10161
|
-
: Ret;
|
|
10162
|
-
|
|
10163
|
-
type AppendKeyPrefix<Key, KPrefix> = KPrefix extends string
|
|
10164
|
-
? `${KPrefix}${_KeySeparator}${Key & string}`
|
|
10165
|
-
: Key;
|
|
10166
|
-
|
|
10167
|
-
/**
|
|
10168
|
-
* Resolves the effective key prefix by preferring a per-call `keyPrefix` from
|
|
10169
|
-
* options over the interface-level `KPrefix` (set via getFixedT's 3rd argument).
|
|
10170
|
-
*/
|
|
10171
|
-
type EffectiveKPrefix<KPrefix, TOpt> = TOpt extends { keyPrefix: infer OptKP extends string }
|
|
10172
|
-
? OptKP
|
|
10173
|
-
: KPrefix;
|
|
10174
|
-
|
|
10175
|
-
/** ************************
|
|
10176
|
-
* T function declaration *
|
|
10177
|
-
************************* */
|
|
10178
|
-
|
|
10179
|
-
interface TFunctionStrict<
|
|
10180
|
-
Ns extends Namespace = DefaultNamespace,
|
|
10181
|
-
KPrefix = undefined,
|
|
10182
|
-
> extends Branded<Ns> {
|
|
10183
|
-
<
|
|
10184
|
-
const Key extends ParseKeys<Ns, TOpt, EffectiveKPrefix<KPrefix, TOpt>> | TemplateStringsArray,
|
|
10185
|
-
const TOpt extends TOptions,
|
|
10186
|
-
Ret extends TFunctionReturn<Ns, AppendKeyPrefix<Key, EffectiveKPrefix<KPrefix, TOpt>>, TOpt>,
|
|
10187
|
-
>(
|
|
10188
|
-
key: Key | Key[],
|
|
10189
|
-
options?: TOpt & InterpolationMap<Ret>,
|
|
10190
|
-
): TFunctionReturnOptionalDetails<TFunctionProcessReturnValue<$NoInfer<Ret>, never>, TOpt>;
|
|
10191
|
-
<
|
|
10192
|
-
const Key extends ParseKeys<Ns, TOpt, EffectiveKPrefix<KPrefix, TOpt>> | TemplateStringsArray,
|
|
10193
|
-
const TOpt extends TOptions,
|
|
10194
|
-
Ret extends TFunctionReturn<Ns, AppendKeyPrefix<Key, EffectiveKPrefix<KPrefix, TOpt>>, TOpt>,
|
|
10195
|
-
>(
|
|
10196
|
-
key: Key | Key[],
|
|
10197
|
-
defaultValue: string,
|
|
10198
|
-
options?: TOpt & InterpolationMap<Ret>,
|
|
10199
|
-
): TFunctionReturnOptionalDetails<TFunctionProcessReturnValue<$NoInfer<Ret>, never>, TOpt>;
|
|
10200
|
-
}
|
|
10201
|
-
|
|
10202
|
-
interface TFunctionNonStrict<
|
|
10203
|
-
Ns extends Namespace = DefaultNamespace,
|
|
10204
|
-
KPrefix = undefined,
|
|
10205
|
-
> extends Branded<Ns> {
|
|
10206
|
-
<
|
|
10207
|
-
const Key extends ParseKeys<Ns, TOpt, EffectiveKPrefix<KPrefix, TOpt>> | TemplateStringsArray,
|
|
10208
|
-
const TOpt extends TOptions,
|
|
10209
|
-
Ret extends TFunctionReturn<Ns, AppendKeyPrefix<Key, EffectiveKPrefix<KPrefix, TOpt>>, TOpt>,
|
|
10210
|
-
const ActualOptions extends TOpt & InterpolationMap<Ret> = TOpt & InterpolationMap<Ret>,
|
|
10211
|
-
DefaultValue extends string = never,
|
|
10212
|
-
>(
|
|
10213
|
-
...args:
|
|
10214
|
-
| [key: Key | Key[], options?: ActualOptions]
|
|
10215
|
-
| [key: string | string[], options: TOpt & $Dictionary & { defaultValue: DefaultValue }]
|
|
10216
|
-
| [key: string | string[], defaultValue: DefaultValue, options?: TOpt & $Dictionary]
|
|
10217
|
-
): TFunctionReturnOptionalDetails<TFunctionProcessReturnValue<$NoInfer<Ret>, DefaultValue>, TOpt>;
|
|
10218
|
-
}
|
|
10219
|
-
|
|
10220
|
-
type TFunctionSignature<
|
|
10221
|
-
Ns extends Namespace = DefaultNamespace,
|
|
10222
|
-
KPrefix = undefined,
|
|
10223
|
-
> = _EnableSelector$1 extends true | 'optimize'
|
|
10224
|
-
? TFunctionSelector<Ns, KPrefix, GetSource<Ns, KPrefix>>
|
|
10225
|
-
: _StrictKeyChecks extends true
|
|
10226
|
-
? TFunctionStrict<Ns, KPrefix>
|
|
10227
|
-
: TFunctionNonStrict<Ns, KPrefix>;
|
|
10228
|
-
|
|
10229
|
-
interface TFunction<
|
|
10230
|
-
Ns extends Namespace = DefaultNamespace,
|
|
10231
|
-
KPrefix = undefined,
|
|
10232
|
-
> extends TFunctionSignature<Ns, KPrefix> {}
|
|
10233
|
-
|
|
10234
|
-
type KeyPrefix<Ns extends Namespace> = ResourceKeys<true>[$FirstNamespace<Ns>] | undefined;
|
|
10235
|
-
|
|
10236
|
-
/// ////////////// ///
|
|
10237
|
-
/// ↆ selector ↆ ///
|
|
10238
|
-
/// ////////////// ///
|
|
10239
|
-
|
|
10240
|
-
type NsArg<Ns extends Namespace> = Ns[number] | readonly Ns[number][];
|
|
10241
|
-
|
|
10242
|
-
interface TFunctionSelector<Ns extends Namespace, KPrefix, Source> extends Branded<Ns> {
|
|
10243
|
-
<
|
|
10244
|
-
Target extends ConstrainTarget<Opts>,
|
|
10245
|
-
const NewNs extends NsArg<Ns> & Namespace,
|
|
10246
|
-
const Opts extends SelectorOptions<NewNs>,
|
|
10247
|
-
NewSrc extends GetSource<NewNs, KPrefix>,
|
|
10248
|
-
>(
|
|
10249
|
-
selector:
|
|
10250
|
-
| SelectorFn<NewSrc, ApplyTarget<Target, Opts>, Opts>
|
|
10251
|
-
| readonly SelectorFn<NewSrc, ApplyTarget<Target, Opts>, Opts>[],
|
|
10252
|
-
options: Opts & InterpolationMap<Target> & { ns: NewNs },
|
|
10253
|
-
): SelectorReturn<Target, Opts>;
|
|
10254
|
-
|
|
10255
|
-
<
|
|
10256
|
-
Target extends ConstrainTarget<Opts>,
|
|
10257
|
-
const NewNs extends NsArg<Ns> = Ns[number],
|
|
10258
|
-
const Opts extends SelectorOptions<NewNs> = SelectorOptions<NewNs>,
|
|
10259
|
-
>(
|
|
10260
|
-
selector:
|
|
10261
|
-
| SelectorFn<Source, ApplyTarget<Target, Opts>, Opts>
|
|
10262
|
-
| readonly SelectorFn<Source, ApplyTarget<Target, Opts>, Opts>[],
|
|
10263
|
-
options?: Opts & InterpolationMap<Target>,
|
|
10264
|
-
): SelectorReturn<Target, Opts>;
|
|
10265
|
-
}
|
|
10266
|
-
|
|
10267
|
-
interface SelectorOptions<Ns = Namespace>
|
|
10268
|
-
extends Omit<TOptionsBase, 'ns' | 'nsSeparator'>, $Dictionary {
|
|
10269
|
-
ns?: Ns;
|
|
10270
|
-
}
|
|
10271
|
-
|
|
10272
|
-
type SelectorReturn<
|
|
10273
|
-
Target,
|
|
10274
|
-
Opts extends { defaultValue?: unknown; returnObjects?: boolean },
|
|
10275
|
-
> = $IsResourcesDefined extends true
|
|
10276
|
-
? TFunctionReturnOptionalDetails<ProcessReturnValue<Target, Opts['defaultValue']>, Opts>
|
|
10277
|
-
: DefaultTReturn<Opts>;
|
|
10278
|
-
|
|
10279
|
-
interface SelectorFn<Source, Target, Opts extends SelectorOptions<unknown>> {
|
|
10280
|
-
(translations: Select<Source, Opts['context']>): Target;
|
|
10281
|
-
}
|
|
10282
|
-
|
|
10283
|
-
type ApplyKeyPrefix<
|
|
10284
|
-
T extends [any],
|
|
10285
|
-
KPrefix,
|
|
10286
|
-
> = KPrefix extends `${infer Head}${_KeySeparator}${infer Tail}`
|
|
10287
|
-
? ApplyKeyPrefix<[T[0][Head]], Tail>
|
|
10288
|
-
: T[0][KPrefix & string];
|
|
10289
|
-
|
|
10290
|
-
type ApplyTarget<
|
|
10291
|
-
Target,
|
|
10292
|
-
Opts extends { returnObjects?: unknown },
|
|
10293
|
-
> = Opts['returnObjects'] extends true ? unknown : Target;
|
|
10294
|
-
|
|
10295
|
-
type ConstrainTarget<Opts extends SelectorOptions<any>> = _ReturnObjects extends true
|
|
10296
|
-
? unknown
|
|
10297
|
-
: Opts['returnObjects'] extends true
|
|
10298
|
-
? unknown
|
|
10299
|
-
: $IsResourcesDefined extends false
|
|
10300
|
-
? unknown
|
|
10301
|
-
: string;
|
|
10302
|
-
|
|
10303
|
-
type ProcessReturnValue<Target, DefaultValue> = $Turtles extends Target
|
|
10304
|
-
? string
|
|
10305
|
-
: [DefaultValue] extends [never]
|
|
10306
|
-
? Target
|
|
10307
|
-
: unknown extends DefaultValue
|
|
10308
|
-
? Target
|
|
10309
|
-
: Target | DefaultValue;
|
|
10310
|
-
|
|
10311
|
-
type PickNamespaces<T, K extends keyof any> = {
|
|
10312
|
-
[P in K as P extends keyof T ? P : never]: T[P & keyof T];
|
|
10313
|
-
};
|
|
10314
|
-
|
|
10315
|
-
type GetSource<
|
|
10316
|
-
Ns extends Namespace,
|
|
10317
|
-
KPrefix,
|
|
10318
|
-
Res = Ns extends readonly [keyof Resources, any, ...any]
|
|
10319
|
-
? Resources[Ns[0]] & PickNamespaces<Resources, Ns[number]>
|
|
10320
|
-
: Resources[$FirstNamespace<Ns>],
|
|
10321
|
-
> = KPrefix extends keyof Res
|
|
10322
|
-
? Res[KPrefix]
|
|
10323
|
-
: undefined extends KPrefix
|
|
10324
|
-
? Res
|
|
10325
|
-
: ApplyKeyPrefix<[Res], KPrefix>;
|
|
10326
|
-
|
|
10327
|
-
type Select<T, Context> = $IsResourcesDefined extends false
|
|
10328
|
-
? $Turtles
|
|
10329
|
-
: [_EnableSelector$1] extends ['optimize']
|
|
10330
|
-
? T
|
|
10331
|
-
: FilterKeys<T, Context>;
|
|
10332
|
-
|
|
10333
|
-
type FilterKeys<T, Context> = never | T extends readonly any[]
|
|
10334
|
-
? { [I in keyof T]: FilterKeys<T[I], Context> }
|
|
10335
|
-
: $Prune<
|
|
10336
|
-
{
|
|
10337
|
-
[K in keyof T as T[K] extends object
|
|
10338
|
-
? K
|
|
10339
|
-
: Context extends string
|
|
10340
|
-
? never
|
|
10341
|
-
: K extends `${string}${_PluralSeparator}${PluralSuffix}`
|
|
10342
|
-
? never
|
|
10343
|
-
: K]: T[K] extends object ? FilterKeys<T[K], Context> : T[K];
|
|
10344
|
-
} & {
|
|
10345
|
-
[K in keyof T as T[K] extends object
|
|
10346
|
-
? never
|
|
10347
|
-
: Context extends string
|
|
10348
|
-
? never
|
|
10349
|
-
: K extends
|
|
10350
|
-
| `${infer Prefix}${_PluralSeparator}${PluralSuffix}`
|
|
10351
|
-
| `${infer Prefix}${_PluralSeparator}ordinal${_PluralSeparator}${PluralSuffix}`
|
|
10352
|
-
? Prefix
|
|
10353
|
-
: never]: T[K] extends object ? FilterKeys<T[K], Context> : T[K];
|
|
10354
|
-
} & {
|
|
10355
|
-
[K in keyof T as T[K] extends object
|
|
10356
|
-
? never
|
|
10357
|
-
: Context extends string
|
|
10358
|
-
? K extends
|
|
10359
|
-
| `${infer Prefix}${_ContextSeparator}${Context}`
|
|
10360
|
-
| `${infer Prefix}${_ContextSeparator}${Context}${_PluralSeparator}${PluralSuffix}`
|
|
10361
|
-
? Prefix
|
|
10362
|
-
: never
|
|
10363
|
-
: never]: T[K] extends object ? FilterKeys<T[K], Context> : T[K];
|
|
10364
|
-
}
|
|
10365
|
-
>;
|
|
10366
|
-
|
|
10367
|
-
// Internal Helpers
|
|
10368
|
-
|
|
10369
|
-
|
|
10370
|
-
interface Interpolator {
|
|
10371
|
-
init(options: InterpolationOptions, reset: boolean): undefined;
|
|
10372
|
-
reset(): undefined;
|
|
10373
|
-
resetRegExp(): undefined;
|
|
10374
|
-
interpolate(str: string, data: object, lng: string, options: InterpolationOptions): string;
|
|
10375
|
-
nest(str: string, fc: (...args: any[]) => any, options: InterpolationOptions): string;
|
|
10376
|
-
}
|
|
10377
|
-
|
|
10378
|
-
declare class ResourceStore {
|
|
10379
|
-
constructor(data: Resource, options: InitOptions);
|
|
10380
|
-
|
|
10381
|
-
public data: Resource;
|
|
10382
|
-
|
|
10383
|
-
public options: InitOptions;
|
|
10384
|
-
|
|
10385
|
-
/**
|
|
10386
|
-
* Gets fired when resources got added or removed
|
|
10387
|
-
*/
|
|
10388
|
-
on(event: 'added' | 'removed', callback: (lng: string, ns: string) => void): void;
|
|
10389
|
-
|
|
10390
|
-
/**
|
|
10391
|
-
* Remove event listener
|
|
10392
|
-
* removes all callback when callback not specified
|
|
10393
|
-
*/
|
|
10394
|
-
off(event: 'added' | 'removed', callback?: (lng: string, ns: string) => void): void;
|
|
10395
|
-
}
|
|
10396
|
-
|
|
10397
|
-
interface Formatter {
|
|
10398
|
-
init(services: Services, i18nextOptions: InitOptions): void;
|
|
10399
|
-
add(name: string, fc: (value: any, lng: string | undefined, options: any) => string): void;
|
|
10400
|
-
addCached(
|
|
10401
|
-
name: string,
|
|
10402
|
-
fc: (lng: string | undefined, options: any) => (value: any) => string,
|
|
10403
|
-
): void;
|
|
10404
|
-
format: FormatFunction;
|
|
10405
|
-
}
|
|
10406
|
-
|
|
10407
|
-
interface Services {
|
|
10408
|
-
backendConnector: any;
|
|
10409
|
-
i18nFormat: any;
|
|
10410
|
-
interpolator: Interpolator;
|
|
10411
|
-
languageDetector: any;
|
|
10412
|
-
languageUtils: any;
|
|
10413
|
-
logger: any;
|
|
10414
|
-
pluralResolver: any;
|
|
10415
|
-
resourceStore: ResourceStore;
|
|
10416
|
-
formatter?: Formatter;
|
|
10417
|
-
}
|
|
10418
|
-
|
|
10419
|
-
type ModuleType =
|
|
10420
|
-
| 'backend'
|
|
10421
|
-
| 'logger'
|
|
10422
|
-
| 'languageDetector'
|
|
10423
|
-
| 'postProcessor'
|
|
10424
|
-
| 'i18nFormat'
|
|
10425
|
-
| 'formatter'
|
|
10426
|
-
| '3rdParty';
|
|
10427
|
-
|
|
10428
|
-
interface Module {
|
|
10429
|
-
type: ModuleType;
|
|
10430
|
-
}
|
|
10431
|
-
|
|
10432
|
-
type CallbackError = Error | string | null | undefined;
|
|
10433
|
-
type ReadCallback$1 = (
|
|
10434
|
-
err: CallbackError,
|
|
10435
|
-
data: ResourceKey | boolean | null | undefined,
|
|
10436
|
-
) => void;
|
|
10437
|
-
type MultiReadCallback = (err: CallbackError, data: Resource | null | undefined) => void;
|
|
10438
|
-
|
|
10439
|
-
/**
|
|
10440
|
-
* Used to load data for i18next.
|
|
10441
|
-
* Can be provided as a singleton or as a prototype constructor (preferred for supporting multiple instances of i18next).
|
|
10442
|
-
* For singleton set property `type` to `'backend'` For a prototype constructor set static property.
|
|
10443
|
-
*/
|
|
10444
|
-
interface BackendModule<Options = object> extends Module {
|
|
10445
|
-
type: 'backend';
|
|
10446
|
-
init(services: Services, backendOptions: Options, i18nextOptions: InitOptions): void;
|
|
10447
|
-
read(language: string, namespace: string, callback: ReadCallback$1): void;
|
|
10448
|
-
/** Save the missing translation */
|
|
10449
|
-
create?(
|
|
10450
|
-
languages: readonly string[],
|
|
10451
|
-
namespace: string,
|
|
10452
|
-
key: string,
|
|
10453
|
-
fallbackValue: string,
|
|
10454
|
-
): void;
|
|
10455
|
-
/** Load multiple languages and namespaces. For backends supporting multiple resources loading */
|
|
10456
|
-
readMulti?(
|
|
10457
|
-
languages: readonly string[],
|
|
10458
|
-
namespaces: readonly string[],
|
|
10459
|
-
callback: MultiReadCallback,
|
|
10460
|
-
): void;
|
|
10461
|
-
/** Store the translation. For backends acting as cache layer */
|
|
10462
|
-
save?(language: string, namespace: string, data: ResourceLanguage): void;
|
|
10463
|
-
}
|
|
10464
|
-
|
|
10465
|
-
/**
|
|
10466
|
-
* Used to detect language in user land.
|
|
10467
|
-
* Can be provided as a singleton or as a prototype constructor (preferred for supporting multiple instances of i18next).
|
|
10468
|
-
* For singleton set property `type` to `'languageDetector'` For a prototype constructor set static property.
|
|
10469
|
-
*/
|
|
10470
|
-
interface LanguageDetectorModule extends Module {
|
|
10471
|
-
type: 'languageDetector';
|
|
10472
|
-
init?(services: Services, detectorOptions: object, i18nextOptions: InitOptions): void;
|
|
10473
|
-
/** Must return detected language */
|
|
10474
|
-
detect(): string | readonly string[] | undefined;
|
|
10475
|
-
cacheUserLanguage?(lng: string): void;
|
|
10476
|
-
}
|
|
10477
|
-
|
|
10478
|
-
/**
|
|
10479
|
-
* Used to detect language in user land.
|
|
10480
|
-
* Can be provided as a singleton or as a prototype constructor (preferred for supporting multiple instances of i18next).
|
|
10481
|
-
* For singleton set property `type` to `'languageDetector'` For a prototype constructor set static property.
|
|
10482
|
-
*/
|
|
10483
|
-
interface LanguageDetectorAsyncModule extends Module {
|
|
10484
|
-
type: 'languageDetector';
|
|
10485
|
-
/** Set to true to enable async detection */
|
|
10486
|
-
async: true;
|
|
10487
|
-
init?(services: Services, detectorOptions: object, i18nextOptions: InitOptions): void;
|
|
10488
|
-
/** Must call callback passing detected language or return a Promise */
|
|
10489
|
-
detect(
|
|
10490
|
-
callback: (lng: string | readonly string[] | undefined) => void | undefined,
|
|
10491
|
-
): void | Promise<string | readonly string[] | undefined>;
|
|
10492
|
-
cacheUserLanguage?(lng: string): void | Promise<void>;
|
|
10493
|
-
}
|
|
10494
|
-
|
|
10495
|
-
/**
|
|
10496
|
-
* Override the built-in console logger.
|
|
10497
|
-
* Do not need to be a prototype function.
|
|
10498
|
-
*/
|
|
10499
|
-
interface LoggerModule extends Module {
|
|
10500
|
-
type: 'logger';
|
|
10501
|
-
log(...args: any[]): void;
|
|
10502
|
-
warn(...args: any[]): void;
|
|
10503
|
-
error(...args: any[]): void;
|
|
10504
|
-
}
|
|
10505
|
-
|
|
10506
|
-
interface I18nFormatModule extends Module {
|
|
10507
|
-
type: 'i18nFormat';
|
|
10508
|
-
}
|
|
10509
|
-
|
|
10510
|
-
interface FormatterModule extends Module, Formatter {
|
|
10511
|
-
type: 'formatter';
|
|
10512
|
-
}
|
|
10513
|
-
|
|
10514
|
-
interface ThirdPartyModule extends Module {
|
|
10515
|
-
type: '3rdParty';
|
|
10516
|
-
init(i18next: i18n): void;
|
|
10517
|
-
}
|
|
10518
|
-
|
|
10519
|
-
interface Modules {
|
|
10520
|
-
backend?: BackendModule;
|
|
10521
|
-
logger?: LoggerModule;
|
|
10522
|
-
languageDetector?: LanguageDetectorModule | LanguageDetectorAsyncModule;
|
|
10523
|
-
i18nFormat?: I18nFormatModule;
|
|
10524
|
-
formatter?: FormatterModule;
|
|
10525
|
-
external: ThirdPartyModule[];
|
|
10526
|
-
}
|
|
10527
|
-
|
|
10528
|
-
// helper to identify class https://stackoverflow.com/a/45983481/2363935
|
|
10529
|
-
interface Newable<T> {
|
|
10530
|
-
new (...args: any[]): T;
|
|
10531
|
-
}
|
|
10532
|
-
interface NewableModule<T extends Module> extends Newable<T> {
|
|
10533
|
-
type: T['type'];
|
|
10534
|
-
}
|
|
10535
|
-
|
|
10536
|
-
type Callback = (error: any, t: TFunction) => void;
|
|
10537
|
-
|
|
10538
|
-
/**
|
|
10539
|
-
* Uses similar args as the t function and returns true if a key exists.
|
|
10540
|
-
*/
|
|
10541
|
-
interface ExistsFunction<
|
|
10542
|
-
TKeys extends string = string,
|
|
10543
|
-
TInterpolationMap extends object = $Dictionary,
|
|
10544
|
-
> {
|
|
10545
|
-
(key: TKeys | TKeys[], options?: TOptions<TInterpolationMap>): boolean;
|
|
10546
|
-
}
|
|
10547
|
-
|
|
10548
|
-
interface CloneOptions extends InitOptions {
|
|
10549
|
-
/**
|
|
10550
|
-
* Will create a new instance of the resource store and import the existing translation resources.
|
|
10551
|
-
* This way it will not shared the resource store instance.
|
|
10552
|
-
* @default false
|
|
10553
|
-
*/
|
|
10554
|
-
forkResourceStore?: boolean;
|
|
10555
|
-
}
|
|
10556
|
-
|
|
10557
|
-
interface CustomInstanceExtensions {}
|
|
10558
|
-
|
|
10559
|
-
// Used just here to exclude `DefaultNamespace` which can be both string or array from `FlatNamespace`
|
|
10560
|
-
// in TFunction declaration below.
|
|
10561
|
-
// Due to this only very special usage I'm not moving this inside helpers.
|
|
10562
|
-
type InferArrayValuesElseReturnType<T> = T extends (infer A)[] ? A : T;
|
|
10563
|
-
|
|
10564
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10565
|
-
interface i18n extends CustomInstanceExtensions {
|
|
10566
|
-
// Expose parameterized t in the i18next interface hierarchy
|
|
10567
|
-
t: TFunction<
|
|
10568
|
-
[
|
|
10569
|
-
...$NormalizeIntoArray<DefaultNamespace>,
|
|
10570
|
-
...Exclude<FlatNamespace, InferArrayValuesElseReturnType<DefaultNamespace>>[],
|
|
10571
|
-
]
|
|
10572
|
-
>;
|
|
10573
|
-
|
|
10574
|
-
/**
|
|
10575
|
-
* The default of the i18next module is an i18next instance ready to be initialized by calling init.
|
|
10576
|
-
* You can create additional instances using the createInstance function.
|
|
10577
|
-
*
|
|
10578
|
-
* @param options - Initial options.
|
|
10579
|
-
* @param callback - will be called after all translations were loaded or with an error when failed (in case of using a backend).
|
|
10580
|
-
*/
|
|
10581
|
-
init(callback?: Callback): Promise<TFunction>;
|
|
10582
|
-
init<T>(options: InitOptions<T>, callback?: Callback): Promise<TFunction>;
|
|
10583
|
-
|
|
10584
|
-
loadResources(callback?: (err: any) => void): void;
|
|
10585
|
-
|
|
10586
|
-
/**
|
|
10587
|
-
* The use function is there to load additional plugins to i18next.
|
|
10588
|
-
* For available module see the plugins page and don't forget to read the documentation of the plugin.
|
|
10589
|
-
*
|
|
10590
|
-
* @param module Accepts a class or object
|
|
10591
|
-
*/
|
|
10592
|
-
use<T extends Module>(module: T | NewableModule<T> | Newable<T>): this;
|
|
10593
|
-
|
|
10594
|
-
/**
|
|
10595
|
-
* List of modules used
|
|
10596
|
-
*/
|
|
10597
|
-
modules: Modules;
|
|
10598
|
-
|
|
10599
|
-
/**
|
|
10600
|
-
* Internal container for all used plugins and implementation details like languageUtils, pluralResolvers, etc.
|
|
10601
|
-
*/
|
|
10602
|
-
services: Services;
|
|
10603
|
-
|
|
10604
|
-
/**
|
|
10605
|
-
* Internal container for translation resources
|
|
10606
|
-
*/
|
|
10607
|
-
store: ResourceStore;
|
|
10608
|
-
|
|
10609
|
-
/**
|
|
10610
|
-
* Uses similar args as the t function and returns true if a key exists.
|
|
10611
|
-
*/
|
|
10612
|
-
exists: ExistsFunction;
|
|
10613
|
-
|
|
10614
|
-
/**
|
|
10615
|
-
* Returns a resource data by language.
|
|
10616
|
-
*/
|
|
10617
|
-
getDataByLanguage(lng: string): { [key: string]: { [key: string]: string } } | undefined;
|
|
10618
|
-
|
|
10619
|
-
/**
|
|
10620
|
-
* Returns a t function that defaults to given language or namespace.
|
|
10621
|
-
* Both params could be arrays of languages or namespaces and will be treated as fallbacks in that case.
|
|
10622
|
-
* On the returned function you can like in the t function override the languages or namespaces by passing them in options or by prepending namespace.
|
|
10623
|
-
*
|
|
10624
|
-
* Accepts optional keyPrefix that will be automatically applied to returned t function.
|
|
10625
|
-
*/
|
|
10626
|
-
getFixedT<
|
|
10627
|
-
Ns extends Namespace | null = DefaultNamespace,
|
|
10628
|
-
TKPrefix extends KeyPrefix<ActualNs> = undefined,
|
|
10629
|
-
ActualNs extends Namespace = Ns extends null ? DefaultNamespace : Ns,
|
|
10630
|
-
>(
|
|
10631
|
-
...args:
|
|
10632
|
-
| [lng: string | readonly string[], ns?: Ns, keyPrefix?: TKPrefix]
|
|
10633
|
-
| [lng: null, ns: Ns, keyPrefix?: TKPrefix]
|
|
10634
|
-
): TFunction<ActualNs, TKPrefix>;
|
|
10635
|
-
|
|
10636
|
-
/**
|
|
10637
|
-
* Changes the language. The callback will be called as soon translations were loaded or an error occurs while loading.
|
|
10638
|
-
* HINT: For easy testing - setting lng to 'cimode' will set t function to always return the key.
|
|
10639
|
-
*/
|
|
10640
|
-
changeLanguage(lng?: string, callback?: Callback): Promise<TFunction>;
|
|
10641
|
-
|
|
10642
|
-
/**
|
|
10643
|
-
* Is set to the current detected or set language.
|
|
10644
|
-
* If you need the primary used language depending on your configuration (supportedLngs, load) you will prefer using i18next.languages[0].
|
|
10645
|
-
*/
|
|
10646
|
-
language: string;
|
|
10647
|
-
|
|
10648
|
-
/**
|
|
10649
|
-
* Is set to an array of language-codes that will be used it order to lookup the translation value.
|
|
10650
|
-
*/
|
|
10651
|
-
languages: readonly string[];
|
|
10652
|
-
|
|
10653
|
-
/**
|
|
10654
|
-
* Is set to the current resolved language.
|
|
10655
|
-
* It can be used as primary used language, for example in a language switcher.
|
|
10656
|
-
*/
|
|
10657
|
-
resolvedLanguage?: string;
|
|
10658
|
-
|
|
10659
|
-
/**
|
|
10660
|
-
* Checks if namespace has loaded yet.
|
|
10661
|
-
* i.e. used by react-i18next
|
|
10662
|
-
*/
|
|
10663
|
-
hasLoadedNamespace(
|
|
10664
|
-
ns: string | readonly string[],
|
|
10665
|
-
options?: {
|
|
10666
|
-
lng?: string | readonly string[];
|
|
10667
|
-
fallbackLng?: InitOptions['fallbackLng'];
|
|
10668
|
-
/**
|
|
10669
|
-
* if `undefined` is returned default checks are performed.
|
|
10670
|
-
*/
|
|
10671
|
-
precheck?: (
|
|
10672
|
-
i18n: i18n,
|
|
10673
|
-
/**
|
|
10674
|
-
* Check if the language namespace provided are not in loading status:
|
|
10675
|
-
* returns `true` if load is completed successfully or with an error.
|
|
10676
|
-
*/
|
|
10677
|
-
loadNotPending: (
|
|
10678
|
-
lng: string | readonly string[],
|
|
10679
|
-
ns: string | readonly string[],
|
|
10680
|
-
) => boolean,
|
|
10681
|
-
) => boolean | undefined;
|
|
10682
|
-
},
|
|
10683
|
-
): boolean;
|
|
10684
|
-
|
|
10685
|
-
/**
|
|
10686
|
-
* Loads additional namespaces not defined in init options.
|
|
10687
|
-
*/
|
|
10688
|
-
loadNamespaces(ns: string | readonly string[], callback?: Callback): Promise<void>;
|
|
10689
|
-
|
|
10690
|
-
/**
|
|
10691
|
-
* Loads additional languages not defined in init options (preload).
|
|
10692
|
-
*/
|
|
10693
|
-
loadLanguages(lngs: string | readonly string[], callback?: Callback): Promise<void>;
|
|
10694
|
-
|
|
10695
|
-
/**
|
|
10696
|
-
* Reloads resources on given state. Optionally you can pass an array of languages and namespaces as params if you don't want to reload all.
|
|
10697
|
-
*/
|
|
10698
|
-
reloadResources(
|
|
10699
|
-
lngs?: string | readonly string[],
|
|
10700
|
-
ns?: string | readonly string[],
|
|
10701
|
-
callback?: () => void,
|
|
10702
|
-
): Promise<void>;
|
|
10703
|
-
reloadResources(lngs: null, ns: string | readonly string[], callback?: () => void): Promise<void>;
|
|
10704
|
-
|
|
10705
|
-
/**
|
|
10706
|
-
* Changes the default namespace.
|
|
10707
|
-
*/
|
|
10708
|
-
setDefaultNamespace(ns: string | readonly string[]): void;
|
|
10709
|
-
|
|
10710
|
-
/**
|
|
10711
|
-
* Returns rtl or ltr depending on languages read direction.
|
|
10712
|
-
*/
|
|
10713
|
-
dir(lng?: string): 'ltr' | 'rtl';
|
|
10714
|
-
|
|
10715
|
-
/**
|
|
10716
|
-
* Exposes interpolation.format function added on init.
|
|
10717
|
-
*/
|
|
10718
|
-
format: FormatFunction;
|
|
10719
|
-
|
|
10720
|
-
/**
|
|
10721
|
-
* Will return a new i18next instance.
|
|
10722
|
-
* Please read the options page for details on configuration options.
|
|
10723
|
-
* Providing a callback will automatically call init.
|
|
10724
|
-
* The callback will be called after all translations were loaded or with an error when failed (in case of using a backend).
|
|
10725
|
-
*/
|
|
10726
|
-
createInstance(options?: InitOptions, callback?: Callback): i18n;
|
|
10727
|
-
|
|
10728
|
-
/**
|
|
10729
|
-
* Creates a clone of the current instance. Shares store, plugins and initial configuration.
|
|
10730
|
-
* Can be used to create an instance sharing storage but being independent on set language or namespaces.
|
|
10731
|
-
*/
|
|
10732
|
-
cloneInstance(options?: CloneOptions, callback?: Callback): i18n;
|
|
10733
|
-
|
|
10734
|
-
/**
|
|
10735
|
-
* Returns a JSON representation of the i18next instance for serialization.
|
|
10736
|
-
*/
|
|
10737
|
-
toJSON(): {
|
|
10738
|
-
options: InitOptions;
|
|
10739
|
-
store: ResourceStore;
|
|
10740
|
-
language: string;
|
|
10741
|
-
languages: readonly string[];
|
|
10742
|
-
resolvedLanguage?: string;
|
|
10743
|
-
};
|
|
10744
|
-
|
|
10745
|
-
/**
|
|
10746
|
-
* Gets fired after initialization.
|
|
10747
|
-
*/
|
|
10748
|
-
on(event: 'initialized', callback: (options: InitOptions) => void): this;
|
|
10749
|
-
|
|
10750
|
-
/**
|
|
10751
|
-
* Gets fired on loaded resources.
|
|
10752
|
-
*/
|
|
10753
|
-
on(
|
|
10754
|
-
event: 'loaded',
|
|
10755
|
-
callback: (loaded: { [language: string]: { [namespace: string]: boolean } }) => void,
|
|
10756
|
-
): this;
|
|
10757
|
-
|
|
10758
|
-
/**
|
|
10759
|
-
* Gets fired if loading resources failed.
|
|
10760
|
-
*/
|
|
10761
|
-
on(event: 'failedLoading', callback: (lng: string, ns: string, msg: string) => void): this;
|
|
10762
|
-
|
|
10763
|
-
/**
|
|
10764
|
-
* Gets fired on accessing a key not existing.
|
|
10765
|
-
*/
|
|
10766
|
-
on(
|
|
10767
|
-
event: 'missingKey',
|
|
10768
|
-
callback: (lngs: readonly string[], namespace: string, key: string, res: string) => void,
|
|
10769
|
-
): this;
|
|
10770
|
-
|
|
10771
|
-
/**
|
|
10772
|
-
* Gets fired when changeLanguage got called.
|
|
10773
|
-
*/
|
|
10774
|
-
on(event: 'languageChanged', callback: (lng: string) => void): this;
|
|
10775
|
-
|
|
10776
|
-
/**
|
|
10777
|
-
* Event listener
|
|
10778
|
-
*/
|
|
10779
|
-
on(event: string, listener: (...args: any[]) => void): this;
|
|
10780
|
-
|
|
10781
|
-
/**
|
|
10782
|
-
* Remove event listener
|
|
10783
|
-
* removes all callback when callback not specified
|
|
10784
|
-
*/
|
|
10785
|
-
off(event: string, listener?: (...args: any[]) => void): void;
|
|
10786
|
-
|
|
10787
|
-
/**
|
|
10788
|
-
* Gets one value by given key.
|
|
10789
|
-
*/
|
|
10790
|
-
getResource(
|
|
10791
|
-
lng: string,
|
|
10792
|
-
ns: string,
|
|
10793
|
-
key: string,
|
|
10794
|
-
options?: Pick<InitOptions, 'keySeparator' | 'ignoreJSONStructure'>,
|
|
10795
|
-
): any;
|
|
10796
|
-
|
|
10797
|
-
/**
|
|
10798
|
-
* Adds one key/value.
|
|
10799
|
-
*/
|
|
10800
|
-
addResource(
|
|
10801
|
-
lng: string,
|
|
10802
|
-
ns: string,
|
|
10803
|
-
key: string,
|
|
10804
|
-
value: string,
|
|
10805
|
-
options?: { keySeparator?: string; silent?: boolean },
|
|
10806
|
-
): i18n;
|
|
10807
|
-
|
|
10808
|
-
/**
|
|
10809
|
-
* Adds multiple key/values.
|
|
10810
|
-
*/
|
|
10811
|
-
addResources(lng: string, ns: string, resources: any): i18n;
|
|
10812
|
-
|
|
10813
|
-
/**
|
|
10814
|
-
* Adds a complete bundle.
|
|
10815
|
-
* Setting deep param to true will extend existing translations in that file.
|
|
10816
|
-
* Setting overwrite to true it will overwrite existing translations in that file.
|
|
10817
|
-
*/
|
|
10818
|
-
addResourceBundle(
|
|
10819
|
-
lng: string,
|
|
10820
|
-
ns: string,
|
|
10821
|
-
resources: any,
|
|
10822
|
-
deep?: boolean,
|
|
10823
|
-
overwrite?: boolean,
|
|
10824
|
-
): i18n;
|
|
10825
|
-
|
|
10826
|
-
/**
|
|
10827
|
-
* Checks if a resource bundle exists.
|
|
10828
|
-
*/
|
|
10829
|
-
hasResourceBundle(lng: string, ns: string): boolean;
|
|
10830
|
-
|
|
10831
|
-
/**
|
|
10832
|
-
* Returns a resource bundle.
|
|
10833
|
-
*/
|
|
10834
|
-
getResourceBundle(lng: string, ns: string): any;
|
|
10835
|
-
|
|
10836
|
-
/**
|
|
10837
|
-
* Removes an existing bundle.
|
|
10838
|
-
*/
|
|
10839
|
-
removeResourceBundle(lng: string, ns: string): i18n;
|
|
10840
|
-
|
|
10841
|
-
/**
|
|
10842
|
-
* Current options
|
|
10843
|
-
*/
|
|
10844
|
-
options: InitOptions;
|
|
10845
|
-
|
|
10846
|
-
/**
|
|
10847
|
-
* Is initialized
|
|
10848
|
-
*/
|
|
10849
|
-
isInitialized: boolean;
|
|
10850
|
-
|
|
10851
|
-
/**
|
|
10852
|
-
* Is initializing
|
|
10853
|
-
*/
|
|
10854
|
-
isInitializing: boolean;
|
|
10855
|
-
|
|
10856
|
-
/**
|
|
10857
|
-
* Store was initialized
|
|
10858
|
-
*/
|
|
10859
|
-
initializedStoreOnce: boolean;
|
|
10860
|
-
|
|
10861
|
-
/**
|
|
10862
|
-
* Language was initialized
|
|
10863
|
-
*/
|
|
10864
|
-
initializedLanguageOnce: boolean;
|
|
10865
|
-
|
|
10866
|
-
/**
|
|
10867
|
-
* Emit event
|
|
10868
|
-
*/
|
|
10869
|
-
emit(eventName: string, ...args: any[]): void;
|
|
10870
|
-
}
|
|
10871
|
-
|
|
10872
|
-
// Internal Helpers
|
|
10873
|
-
type $Tuple<T> = readonly [T?, ...T[]];
|
|
10874
|
-
|
|
10875
|
-
interface ReportNamespaces {
|
|
10876
|
-
addUsedNamespaces(namespaces: Namespace): void;
|
|
10877
|
-
getUsedNamespaces(): string[];
|
|
10878
|
-
}
|
|
10879
|
-
|
|
10880
|
-
declare module 'i18next' {
|
|
10881
|
-
// interface i18n {
|
|
10882
|
-
// reportNamespaces?: ReportNamespaces;
|
|
10883
|
-
// }
|
|
10884
|
-
interface CustomInstanceExtensions {
|
|
10885
|
-
reportNamespaces?: ReportNamespaces;
|
|
10886
|
-
}
|
|
10887
|
-
}
|
|
10888
|
-
|
|
10889
|
-
type ObjectOrNever = TypeOptions['allowObjectInHTMLChildren'] extends true
|
|
10890
|
-
? Record<string, unknown>
|
|
10891
|
-
: never;
|
|
10892
|
-
|
|
10893
|
-
type ReactI18NextChildren = React.ReactNode | ObjectOrNever;
|
|
10894
|
-
|
|
10895
|
-
declare module 'react' {
|
|
10896
|
-
namespace JSX {
|
|
10897
|
-
interface IntrinsicAttributes {
|
|
10898
|
-
i18nIsDynamicList?: boolean;
|
|
10899
|
-
}
|
|
10900
|
-
}
|
|
10901
|
-
|
|
10902
|
-
interface HTMLAttributes<T> {
|
|
10903
|
-
// This union is inspired by the typings for React.ReactNode. We do this to fix "This JSX tag's 'children' prop
|
|
10904
|
-
// expects a single child of type 'ReactI18NextChildren', but multiple children were provided":
|
|
10905
|
-
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/5a1e9f91ed0143adede394adb3f540e650455f71/types/react/index.d.ts#L268
|
|
10906
|
-
children?: ReactI18NextChildren | Iterable<ReactI18NextChildren>;
|
|
10907
|
-
}
|
|
10908
|
-
}
|
|
10909
|
-
|
|
10910
|
-
type _DefaultNamespace = TypeOptions['defaultNS'];
|
|
10911
|
-
|
|
10912
|
-
// If the version is earlier than i18next v25.4.0, enableSelector does not exist in TypeOptions, so a conditional type is used to maintain type compatibility.
|
|
10913
|
-
type _EnableSelector = TypeOptions extends { enableSelector: infer U } ? U : false;
|
|
10914
|
-
|
|
10915
|
-
type UseTranslationOptions<KPrefix> = {
|
|
10916
|
-
i18n?: i18n;
|
|
10917
|
-
useSuspense?: boolean;
|
|
10918
|
-
keyPrefix?: KPrefix;
|
|
10919
|
-
bindI18n?: string | false;
|
|
10920
|
-
nsMode?: 'fallback' | 'default';
|
|
10921
|
-
lng?: string;
|
|
10922
|
-
// other of these options might also work: https://github.com/i18next/i18next/blob/master/index.d.ts#L127
|
|
10923
|
-
};
|
|
10924
|
-
|
|
10925
|
-
type UseTranslationResponse<Ns extends Namespace, KPrefix> = [
|
|
10926
|
-
t: TFunction<Ns, KPrefix>,
|
|
10927
|
-
i18n: i18n,
|
|
10928
|
-
ready: boolean,
|
|
10929
|
-
] & {
|
|
10930
|
-
t: TFunction<Ns, KPrefix>;
|
|
10931
|
-
i18n: i18n;
|
|
10932
|
-
ready: boolean;
|
|
10933
|
-
};
|
|
10934
|
-
|
|
10935
|
-
// Workaround to make code completion to work when suggesting namespaces.
|
|
10936
|
-
// This is a typescript limitation when using generics with default values,
|
|
10937
|
-
// it'll be addressed in this issue: https://github.com/microsoft/TypeScript/issues/52516
|
|
10938
|
-
type FallbackNs<Ns> = Ns extends undefined
|
|
10939
|
-
? _DefaultNamespace
|
|
10940
|
-
: Ns extends Namespace
|
|
10941
|
-
? Ns
|
|
10942
|
-
: _DefaultNamespace;
|
|
10943
|
-
|
|
10944
|
-
declare const useTranslation: _EnableSelector extends true | 'optimize'
|
|
10945
|
-
? UseTranslationSelector
|
|
10946
|
-
: UseTranslationLegacy;
|
|
10947
|
-
|
|
10948
|
-
interface UseTranslationLegacy {
|
|
10949
|
-
<
|
|
10950
|
-
const Ns extends FlatNamespace | $Tuple<FlatNamespace> | undefined = undefined,
|
|
10951
|
-
const KPrefix extends KeyPrefix<FallbackNs<Ns>> = undefined,
|
|
10952
|
-
>(
|
|
10953
|
-
ns?: Ns,
|
|
10954
|
-
options?: UseTranslationOptions<KPrefix>,
|
|
10955
|
-
): UseTranslationResponse<FallbackNs<Ns>, KPrefix>;
|
|
10027
|
+
/** CRUD auto-generation configuration */
|
|
10028
|
+
crud?: CrudConfig;
|
|
10956
10029
|
}
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10030
|
+
/**
|
|
10031
|
+
* Generated function endpoint entry (for YAML output)
|
|
10032
|
+
*
|
|
10033
|
+
* @version 0.1.0
|
|
10034
|
+
* @since 0.0.1
|
|
10035
|
+
* @author AMBROISE PARK Consulting
|
|
10036
|
+
*/
|
|
10037
|
+
interface FunctionEndpoint {
|
|
10038
|
+
/** Function name (key in endpoints object) */
|
|
10039
|
+
name: string;
|
|
10040
|
+
/** Deployment regions */
|
|
10041
|
+
region: string[];
|
|
10042
|
+
/** Platform version */
|
|
10043
|
+
platform: 'gcfv1' | 'gcfv2';
|
|
10044
|
+
/** Trigger configuration */
|
|
10045
|
+
callableTrigger?: Record<string, never>;
|
|
10046
|
+
httpsTrigger?: Record<string, never>;
|
|
10047
|
+
scheduleTrigger?: {
|
|
10048
|
+
schedule: string;
|
|
10049
|
+
};
|
|
10050
|
+
/** Entry point in bundled code */
|
|
10051
|
+
entryPoint: string;
|
|
10052
|
+
/** Labels for organization */
|
|
10053
|
+
labels: Record<string, string>;
|
|
10054
|
+
/** Memory allocation */
|
|
10055
|
+
memory?: string;
|
|
10056
|
+
/** Timeout */
|
|
10057
|
+
timeoutSeconds?: number;
|
|
10058
|
+
/** Min instances */
|
|
10059
|
+
minInstances?: number;
|
|
10060
|
+
/** Max instances */
|
|
10061
|
+
maxInstances?: number;
|
|
10062
|
+
/** Secret environment variables */
|
|
10063
|
+
secretEnvironmentVariables?: Array<{
|
|
10064
|
+
key: string;
|
|
10065
|
+
}>;
|
|
10966
10066
|
}
|
|
10967
10067
|
|
|
10968
10068
|
/**
|
|
@@ -11313,173 +10413,6 @@ declare function isBreakpoint(width: number, breakpoint: Breakpoint): boolean;
|
|
|
11313
10413
|
*/
|
|
11314
10414
|
declare function getBreakpointUtils(width: number, height: number): BreakpointUtils;
|
|
11315
10415
|
|
|
11316
|
-
/**
|
|
11317
|
-
* @fileoverview Preset Configuration Types
|
|
11318
|
-
* @description Config-based preset system types. Presets are configuration objects
|
|
11319
|
-
* that declare what components go in which slots, replacing the component-based approach.
|
|
11320
|
-
*
|
|
11321
|
-
* @version 0.1.0
|
|
11322
|
-
* @since 0.0.1
|
|
11323
|
-
* @author AMBROISE PARK Consulting
|
|
11324
|
-
*/
|
|
11325
|
-
|
|
11326
|
-
/**
|
|
11327
|
-
* Slot content function - returns ReactNode or null
|
|
11328
|
-
*
|
|
11329
|
-
* Presets use functions that return ReactNode, same API as consumers.
|
|
11330
|
-
* Return null to explicitly hide the slot.
|
|
11331
|
-
*/
|
|
11332
|
-
type SlotContent = () => ReactNode | null;
|
|
11333
|
-
/**
|
|
11334
|
-
* Header zone configuration
|
|
11335
|
-
*
|
|
11336
|
-
* Grid-based layout with start/center/end areas.
|
|
11337
|
-
* - start: start-aligned (typically branding: AppIcon, AppTitle)
|
|
11338
|
-
* - center: absolutely centered (overlay, regardless of start/end content)
|
|
11339
|
-
* - end: end-aligned (typically actions: GoTo, Auth, Language, Theme)
|
|
11340
|
-
*/
|
|
11341
|
-
interface HeaderZoneConfig {
|
|
11342
|
-
/** Start slot - start-aligned, typically branding (AppIcon, AppTitle) */
|
|
11343
|
-
start?: SlotContent;
|
|
11344
|
-
/** Center slot - absolutely centered overlay, optional (navigation, search) */
|
|
11345
|
-
center?: SlotContent;
|
|
11346
|
-
/** End slot - end-aligned, typically actions (GoTo, Auth, Language, Theme) */
|
|
11347
|
-
end?: SlotContent;
|
|
11348
|
-
}
|
|
11349
|
-
/**
|
|
11350
|
-
* Sidebar zone configuration
|
|
11351
|
-
*
|
|
11352
|
-
* Vertical layout with top/content/bottom areas.
|
|
11353
|
-
* All sidebars use ResizableSidebar wrapper.
|
|
11354
|
-
*/
|
|
11355
|
-
interface SidebarZoneConfig {
|
|
11356
|
-
/** Top slot - branding, search */
|
|
11357
|
-
top?: SlotContent;
|
|
11358
|
-
/** Content slot - main scrollable area (defaults to NavigationMenu) */
|
|
11359
|
-
content?: SlotContent;
|
|
11360
|
-
/** Bottom slot - user profile, settings */
|
|
11361
|
-
bottom?: SlotContent;
|
|
11362
|
-
/** Default sidebar width in pixels */
|
|
11363
|
-
defaultWidth?: number;
|
|
11364
|
-
/** Minimum width when resizing */
|
|
11365
|
-
minWidth?: number;
|
|
11366
|
-
/** Maximum width when resizing */
|
|
11367
|
-
maxWidth?: number;
|
|
11368
|
-
}
|
|
11369
|
-
/**
|
|
11370
|
-
* Footer zone configuration
|
|
11371
|
-
*
|
|
11372
|
-
* Simple footer: Copyright (left) | LegalLinks + DoNotDev (right)
|
|
11373
|
-
* - `null`: Hide footer
|
|
11374
|
-
* - `undefined`: Use defaults (copyright + legal links + DoNotDev)
|
|
11375
|
-
* - `{ copyright?: ..., legalLinks?: ... }`: Custom configuration
|
|
11376
|
-
*/
|
|
11377
|
-
interface FooterConfig {
|
|
11378
|
-
/** Copyright configuration
|
|
11379
|
-
* - `null`: Hide copyright
|
|
11380
|
-
* - `undefined`: Use default (© YEAR appName. All rights reserved)
|
|
11381
|
-
* - `string`: Custom copyright text
|
|
11382
|
-
*/
|
|
11383
|
-
copyright?: null | string;
|
|
11384
|
-
/** Legal links configuration
|
|
11385
|
-
* - `null`: Hide legal links
|
|
11386
|
-
* - `Array<{ path, label }>`: Custom legal links
|
|
11387
|
-
* - `undefined`: Use framework defaults
|
|
11388
|
-
*/
|
|
11389
|
-
legalLinks?: null | Array<{
|
|
11390
|
-
path: string;
|
|
11391
|
-
label: string;
|
|
11392
|
-
}>;
|
|
11393
|
-
}
|
|
11394
|
-
/**
|
|
11395
|
-
* Footer zone configuration
|
|
11396
|
-
*
|
|
11397
|
-
* Simple footer: Copyright (left) | LegalLinks + DoNotDev (right)
|
|
11398
|
-
* null = zone hidden
|
|
11399
|
-
*/
|
|
11400
|
-
type FooterZoneConfig = FooterConfig | null;
|
|
11401
|
-
/**
|
|
11402
|
-
* MergedBar configuration for mobile
|
|
11403
|
-
*
|
|
11404
|
-
* Fixed trigger bar that opens a Sheet with navigation content.
|
|
11405
|
-
* Each slot is customizable per-preset, with smart defaults.
|
|
11406
|
-
*/
|
|
11407
|
-
interface MergedBarConfig {
|
|
11408
|
-
/** Position of the trigger bar */
|
|
11409
|
-
position: 'top' | 'bottom';
|
|
11410
|
-
/** Height of the trigger bar (default: 64px for top, 48px for bottom) */
|
|
11411
|
-
height?: string;
|
|
11412
|
-
/** Trigger bar content (default: header.start for top, footer-like for bottom) */
|
|
11413
|
-
trigger?: SlotContent;
|
|
11414
|
-
/** Sheet top slot */
|
|
11415
|
-
top?: SlotContent;
|
|
11416
|
-
/** Sheet content slot - scrollable (default: sidebar.content) */
|
|
11417
|
-
content?: SlotContent;
|
|
11418
|
-
/** Sheet bottom slot (default: sidebar.bottom) */
|
|
11419
|
-
bottom?: SlotContent;
|
|
11420
|
-
}
|
|
11421
|
-
/**
|
|
11422
|
-
* Mobile behavior configuration
|
|
11423
|
-
*
|
|
11424
|
-
* Defines how the layout adapts on mobile/tablet breakpoints.
|
|
11425
|
-
*/
|
|
11426
|
-
interface MobileBehaviorConfig {
|
|
11427
|
-
/** Breakpoint at which mobile behavior activates (default: 1024px) */
|
|
11428
|
-
breakpoint?: number;
|
|
11429
|
-
/** Header slot overrides for mobile (overrides desktop header slots) */
|
|
11430
|
-
header?: HeaderZoneConfig;
|
|
11431
|
-
/** Sidebar slot overrides for mobile (overrides desktop sidebar slots) */
|
|
11432
|
-
sidebar?: SidebarZoneConfig;
|
|
11433
|
-
/** MergedBar configuration - replaces header/footer with sheet trigger */
|
|
11434
|
-
mergedBar?: MergedBarConfig;
|
|
11435
|
-
}
|
|
11436
|
-
/**
|
|
11437
|
-
* Complete preset configuration
|
|
11438
|
-
*
|
|
11439
|
-
* Declarative configuration for a layout preset.
|
|
11440
|
-
* Uses function-based slots, same API as consumers.
|
|
11441
|
-
*
|
|
11442
|
-
* @example
|
|
11443
|
-
* ```typescript
|
|
11444
|
-
* const landingPreset: PresetConfig = {
|
|
11445
|
-
* name: 'landing',
|
|
11446
|
-
* header: {
|
|
11447
|
-
* start: () => <AppBranding />,
|
|
11448
|
-
* center: () => null,
|
|
11449
|
-
* end: () => (
|
|
11450
|
-
* <>
|
|
11451
|
-
* <GoTo />
|
|
11452
|
-
* <AuthHeader />
|
|
11453
|
-
* </>
|
|
11454
|
-
* ),
|
|
11455
|
-
* },
|
|
11456
|
-
* mobile: {
|
|
11457
|
-
* header: {
|
|
11458
|
-
* end: () => <HeaderMenu>{desktop end content}</HeaderMenu>,
|
|
11459
|
-
* },
|
|
11460
|
-
* },
|
|
11461
|
-
* };
|
|
11462
|
-
* ```
|
|
11463
|
-
*/
|
|
11464
|
-
interface PresetConfig {
|
|
11465
|
-
/** Preset identifier (must match LayoutPreset type) */
|
|
11466
|
-
name: LayoutPreset;
|
|
11467
|
-
/** Header zone configuration (undefined = use defaults, object = override slots) */
|
|
11468
|
-
header?: HeaderZoneConfig;
|
|
11469
|
-
/** Sidebar zone configuration (undefined = use defaults, object = override slots) */
|
|
11470
|
-
sidebar?: SidebarZoneConfig;
|
|
11471
|
-
/** Footer zone configuration (undefined = use defaults, object = override) */
|
|
11472
|
-
footer?: FooterZoneConfig;
|
|
11473
|
-
/** Mobile behavior configuration */
|
|
11474
|
-
mobile?: MobileBehaviorConfig;
|
|
11475
|
-
}
|
|
11476
|
-
/**
|
|
11477
|
-
* Preset registry type
|
|
11478
|
-
*
|
|
11479
|
-
* Maps preset names to their configurations.
|
|
11480
|
-
*/
|
|
11481
|
-
type PresetRegistry = Record<LayoutPreset, PresetConfig>;
|
|
11482
|
-
|
|
11483
10416
|
/**
|
|
11484
10417
|
* @fileoverview Legal Configuration Types
|
|
11485
10418
|
* @description Type definitions for legal pages configuration (Terms, Privacy, Legal Notice)
|
|
@@ -12031,19 +10964,6 @@ interface OAuthPartnerState extends PartnerConnectionState {
|
|
|
12031
10964
|
config: OAuthPartner;
|
|
12032
10965
|
credentials: OAuthCredentials | null;
|
|
12033
10966
|
}
|
|
12034
|
-
/**
|
|
12035
|
-
* OAuth partner button interface
|
|
12036
|
-
*
|
|
12037
|
-
* @version 0.1.0
|
|
12038
|
-
* @since 0.0.1
|
|
12039
|
-
* @author AMBROISE PARK Consulting
|
|
12040
|
-
*/
|
|
12041
|
-
interface OAuthPartnerButton extends PartnerButton {
|
|
12042
|
-
partnerId: OAuthPartnerId;
|
|
12043
|
-
purpose?: OAuthPurpose;
|
|
12044
|
-
scopes?: string[];
|
|
12045
|
-
onSuccess?: (result: OAuthPartnerResult) => void;
|
|
12046
|
-
}
|
|
12047
10967
|
/**
|
|
12048
10968
|
* OAuth API request options interface
|
|
12049
10969
|
*
|
|
@@ -12376,6 +11296,8 @@ interface UploadOptions {
|
|
|
12376
11296
|
filename?: string;
|
|
12377
11297
|
/** Progress callback */
|
|
12378
11298
|
onProgress?: UploadProgressCallback;
|
|
11299
|
+
/** AbortSignal to cancel the upload */
|
|
11300
|
+
signal?: AbortSignal;
|
|
12379
11301
|
}
|
|
12380
11302
|
/** Result of an upload operation */
|
|
12381
11303
|
interface UploadResult {
|
|
@@ -12398,7 +11320,9 @@ interface IStorageAdapter {
|
|
|
12398
11320
|
/** Upload a file or blob to storage. Returns the public URL and storage path. */
|
|
12399
11321
|
upload(file: File | Blob, options?: UploadOptions): Promise<UploadResult>;
|
|
12400
11322
|
/** Delete a file by its URL or storage path. */
|
|
12401
|
-
delete(urlOrPath: string
|
|
11323
|
+
delete(urlOrPath: string, options?: {
|
|
11324
|
+
signal?: AbortSignal;
|
|
11325
|
+
}): Promise<void>;
|
|
12402
11326
|
/** Get the public download URL for a storage path. */
|
|
12403
11327
|
getUrl(path: string): Promise<string>;
|
|
12404
11328
|
}
|
|
@@ -12804,6 +11728,12 @@ interface BaseStoreState {
|
|
|
12804
11728
|
isLoading: boolean;
|
|
12805
11729
|
/** Current error message, or null if no error */
|
|
12806
11730
|
error: string | null;
|
|
11731
|
+
/**
|
|
11732
|
+
* Whether Zustand persist middleware has finished rehydrating from storage.
|
|
11733
|
+
* Only present on stores created with persistOptions.
|
|
11734
|
+
* `false` before rehydration, `true` after. Non-persisted stores: undefined.
|
|
11735
|
+
*/
|
|
11736
|
+
_hasHydrated?: boolean;
|
|
12807
11737
|
/**
|
|
12808
11738
|
* Whether the first async data callback has fired.
|
|
12809
11739
|
* Optional - only needed for stores with async data sources (e.g., auth, realtime).
|
|
@@ -13487,6 +12417,7 @@ type FeaturesWithoutConsent = {
|
|
|
13487
12417
|
[K in FeatureName]: FeatureConsentRequirement<K> extends null ? K : never;
|
|
13488
12418
|
}[FeatureName];
|
|
13489
12419
|
|
|
12420
|
+
/** Options for the handleError utility. */
|
|
13490
12421
|
interface HandleErrorOptions {
|
|
13491
12422
|
userMessage?: string;
|
|
13492
12423
|
context?: Record<string, any>;
|
|
@@ -14726,35 +13657,49 @@ declare function hasProvider(key: keyof DndevProviders): boolean;
|
|
|
14726
13657
|
declare function resetProviders(): void;
|
|
14727
13658
|
|
|
14728
13659
|
/**
|
|
14729
|
-
*
|
|
14730
|
-
* @description Provides singleton pattern implementation for the framework
|
|
13660
|
+
* Get or create a singleton backed by `globalThis.__DNDEV_SINGLETONS__`.
|
|
14731
13661
|
*
|
|
14732
|
-
*
|
|
14733
|
-
*
|
|
13662
|
+
* Use this for singletons that must be shared across packages or survive
|
|
13663
|
+
* bundler chunk splits (Vite pre-bundling, esbuild code-splitting, HMR).
|
|
14734
13664
|
*
|
|
14735
|
-
*
|
|
14736
|
-
* -
|
|
14737
|
-
* -
|
|
14738
|
-
* - Error handling and graceful degradation
|
|
14739
|
-
* - Type-safe singleton creation
|
|
14740
|
-
* - Method proxy support for direct access
|
|
13665
|
+
* Module-level `let` singletons break when a bundler evaluates the same
|
|
13666
|
+
* module in two separate chunks - each gets its own `let`. `globalThis`
|
|
13667
|
+
* is process-wide and survives all of that.
|
|
14741
13668
|
*
|
|
14742
|
-
*
|
|
14743
|
-
*
|
|
14744
|
-
*
|
|
13669
|
+
* **When to use:**
|
|
13670
|
+
* - Registries shared between consumer code and framework internals
|
|
13671
|
+
* (e.g. FieldRegistry, providers, auth instance)
|
|
13672
|
+
* - Any singleton where `registerX()` happens in one package and
|
|
13673
|
+
* `getX()` happens in another
|
|
13674
|
+
*
|
|
13675
|
+
* **When NOT to use:**
|
|
13676
|
+
* - Server-only singletons (functions/, tooling/, mcp-server/) - no chunk splits
|
|
13677
|
+
* - File-local caches that are only read in the same file
|
|
14745
13678
|
*
|
|
14746
|
-
*
|
|
13679
|
+
* @param key - Unique key for this singleton (e.g. 'field-registry')
|
|
13680
|
+
* @param factory - Factory function called once to create the instance
|
|
13681
|
+
* @returns The singleton instance (existing or newly created)
|
|
13682
|
+
*
|
|
13683
|
+
* @example
|
|
14747
13684
|
* ```typescript
|
|
14748
|
-
* //
|
|
14749
|
-
*
|
|
13685
|
+
* // In FieldRegistry.ts
|
|
13686
|
+
* import { getGlobalSingleton } from '@donotdev/core';
|
|
14750
13687
|
*
|
|
14751
|
-
*
|
|
14752
|
-
*
|
|
13688
|
+
* export function getFieldRegistry(): FieldRegistry {
|
|
13689
|
+
* return getGlobalSingleton('field-registry', () => new FieldRegistry());
|
|
13690
|
+
* }
|
|
14753
13691
|
*
|
|
14754
|
-
* //
|
|
14755
|
-
*
|
|
13692
|
+
* // In providers.ts
|
|
13693
|
+
* let _providers = getGlobalSingleton('providers', () => ({ current: null }));
|
|
14756
13694
|
* ```
|
|
14757
13695
|
*/
|
|
13696
|
+
declare function getGlobalSingleton<T>(key: string, factory: () => T): T;
|
|
13697
|
+
/**
|
|
13698
|
+
* Clear a global singleton. **Only for testing.**
|
|
13699
|
+
*
|
|
13700
|
+
* @param key - The singleton key to clear
|
|
13701
|
+
*/
|
|
13702
|
+
declare function clearGlobalSingleton(key: string): void;
|
|
14758
13703
|
/**
|
|
14759
13704
|
* Creates a singleton getter function for a class or factory function
|
|
14760
13705
|
*
|
|
@@ -15056,6 +14001,7 @@ interface LockoutEntry {
|
|
|
15056
14001
|
/** null = not locked; number = locked until this timestamp */
|
|
15057
14002
|
lockedUntil: number | null;
|
|
15058
14003
|
}
|
|
14004
|
+
/** Configuration for brute-force lockout and session timeout enforcement. */
|
|
15059
14005
|
interface AuthHardeningConfig {
|
|
15060
14006
|
/**
|
|
15061
14007
|
* Max consecutive failed sign-in attempts before lockout.
|
|
@@ -15074,6 +14020,7 @@ interface AuthHardeningConfig {
|
|
|
15074
14020
|
*/
|
|
15075
14021
|
sessionTimeoutMs?: number;
|
|
15076
14022
|
}
|
|
14023
|
+
/** Result of a lockout status check for an identifier. */
|
|
15077
14024
|
interface LockoutResult {
|
|
15078
14025
|
attempts: number;
|
|
15079
14026
|
locked: boolean;
|
|
@@ -15233,6 +14180,70 @@ declare function when(field: string): WhenFieldBuilder;
|
|
|
15233
14180
|
*/
|
|
15234
14181
|
declare function getConditionDependencies(condition: ConditionExpression | ConditionBuilder): Set<string>;
|
|
15235
14182
|
|
|
14183
|
+
/**
|
|
14184
|
+
* Sanitize a URL for use in href attributes.
|
|
14185
|
+
* Blocks javascript:, data:, vbscript: and other dangerous schemes.
|
|
14186
|
+
* Allows safe schemes and relative URLs.
|
|
14187
|
+
*
|
|
14188
|
+
* @param href - The URL to sanitize
|
|
14189
|
+
* @returns The original URL if safe, empty string if dangerous
|
|
14190
|
+
*/
|
|
14191
|
+
declare function sanitizeHref(href: string): string;
|
|
14192
|
+
|
|
14193
|
+
/**
|
|
14194
|
+
* @fileoverview Safari-safe UUID v4 generator
|
|
14195
|
+
* @description Generates RFC 4122 compliant v4 UUIDs using `crypto.getRandomValues()`,
|
|
14196
|
+
* which is available in ALL modern browsers (Safari 11+, Chrome 11+, Firefox 26+).
|
|
14197
|
+
*
|
|
14198
|
+
* `crypto.randomUUID()` requires Safari 15.4+ and a secure context.
|
|
14199
|
+
* This utility works everywhere `crypto.getRandomValues()` is available,
|
|
14200
|
+
* which covers every browser we support.
|
|
14201
|
+
*
|
|
14202
|
+
* @version 0.1.0
|
|
14203
|
+
* @since 0.1.0
|
|
14204
|
+
* @author AMBROISE PARK Consulting
|
|
14205
|
+
*/
|
|
14206
|
+
/**
|
|
14207
|
+
* Generate a cryptographically random UUID v4.
|
|
14208
|
+
*
|
|
14209
|
+
* Uses `crypto.getRandomValues()` (universal) instead of `crypto.randomUUID()`
|
|
14210
|
+
* (Safari 15.4+ only) for maximum browser compatibility.
|
|
14211
|
+
*
|
|
14212
|
+
* @returns UUID v4 string (e.g. "550e8400-e29b-41d4-a716-446655440000")
|
|
14213
|
+
*
|
|
14214
|
+
* @version 0.1.0
|
|
14215
|
+
* @since 0.1.0
|
|
14216
|
+
*/
|
|
14217
|
+
declare function generateUUID(): string;
|
|
14218
|
+
|
|
14219
|
+
/**
|
|
14220
|
+
* @fileoverview Timeout and abort utilities for async operations
|
|
14221
|
+
* @description Wraps promises with timeout and AbortSignal support.
|
|
14222
|
+
* Used by CRUD and storage adapters to enforce operation deadlines.
|
|
14223
|
+
*
|
|
14224
|
+
* @version 0.1.0
|
|
14225
|
+
* @since 0.5.0
|
|
14226
|
+
* @author AMBROISE PARK Consulting
|
|
14227
|
+
*/
|
|
14228
|
+
/** Default timeout for upload operations (30 seconds) */
|
|
14229
|
+
declare const DEFAULT_UPLOAD_TIMEOUT = 30000;
|
|
14230
|
+
/** Default timeout for CRUD operations (15 seconds) */
|
|
14231
|
+
declare const DEFAULT_CRUD_TIMEOUT = 15000;
|
|
14232
|
+
/**
|
|
14233
|
+
* Wrap a promise with a timeout and optional AbortSignal.
|
|
14234
|
+
*
|
|
14235
|
+
* - If timeout expires: rejects with a TimeoutError
|
|
14236
|
+
* - If signal aborts: rejects with an AbortError
|
|
14237
|
+
* - If promise resolves/rejects first: returns that result
|
|
14238
|
+
* - Cleans up all listeners on completion
|
|
14239
|
+
*
|
|
14240
|
+
* @param promise - The promise to wrap
|
|
14241
|
+
* @param timeoutMs - Timeout in milliseconds (0 or negative = no timeout)
|
|
14242
|
+
* @param signal - Optional AbortSignal
|
|
14243
|
+
* @returns The promise result
|
|
14244
|
+
*/
|
|
14245
|
+
declare function withTimeout<T>(promise: Promise<T>, timeoutMs: number, signal?: AbortSignal): Promise<T>;
|
|
14246
|
+
|
|
15236
14247
|
/**
|
|
15237
14248
|
* @fileoverview Server-side date utilities
|
|
15238
14249
|
* @description Robust date calculation utilities for server environments
|
|
@@ -15358,6 +14369,7 @@ declare function parseServerCookie(cookieHeader: string | undefined, name: strin
|
|
|
15358
14369
|
* @since 0.0.1
|
|
15359
14370
|
* @author AMBROISE PARK Consulting
|
|
15360
14371
|
*/
|
|
14372
|
+
//# sourceMappingURL=index.d.ts.map
|
|
15361
14373
|
|
|
15362
14374
|
type index_d_AuthHardening = AuthHardening;
|
|
15363
14375
|
declare const index_d_AuthHardening: typeof AuthHardening;
|
|
@@ -15366,7 +14378,9 @@ declare const index_d_CURRENCY_MAP: typeof CURRENCY_MAP;
|
|
|
15366
14378
|
type index_d_ConditionBuilder = ConditionBuilder;
|
|
15367
14379
|
declare const index_d_ConditionBuilder: typeof ConditionBuilder;
|
|
15368
14380
|
type index_d_CurrencyEntry = CurrencyEntry;
|
|
14381
|
+
declare const index_d_DEFAULT_CRUD_TIMEOUT: typeof DEFAULT_CRUD_TIMEOUT;
|
|
15369
14382
|
declare const index_d_DEFAULT_ERROR_MESSAGES: typeof DEFAULT_ERROR_MESSAGES;
|
|
14383
|
+
declare const index_d_DEFAULT_UPLOAD_TIMEOUT: typeof DEFAULT_UPLOAD_TIMEOUT;
|
|
15370
14384
|
type index_d_DateFormatOptions = DateFormatOptions;
|
|
15371
14385
|
type index_d_DateFormatPreset = DateFormatPreset;
|
|
15372
14386
|
type index_d_DoNotDevError = DoNotDevError;
|
|
@@ -15383,6 +14397,7 @@ declare const index_d_addMonths: typeof addMonths;
|
|
|
15383
14397
|
declare const index_d_addYears: typeof addYears;
|
|
15384
14398
|
declare const index_d_calculateSubscriptionEndDate: typeof calculateSubscriptionEndDate;
|
|
15385
14399
|
declare const index_d_captureErrorToSentry: typeof captureErrorToSentry;
|
|
14400
|
+
declare const index_d_clearGlobalSingleton: typeof clearGlobalSingleton;
|
|
15386
14401
|
declare const index_d_commonErrorCodeMappings: typeof commonErrorCodeMappings;
|
|
15387
14402
|
declare const index_d_compactToISOString: typeof compactToISOString;
|
|
15388
14403
|
declare const index_d_configureProviders: typeof configureProviders;
|
|
@@ -15404,10 +14419,12 @@ declare const index_d_generateCodeChallenge: typeof generateCodeChallenge;
|
|
|
15404
14419
|
declare const index_d_generateCodeVerifier: typeof generateCodeVerifier;
|
|
15405
14420
|
declare const index_d_generateFirestoreRuleCondition: typeof generateFirestoreRuleCondition;
|
|
15406
14421
|
declare const index_d_generatePKCEPair: typeof generatePKCEPair;
|
|
14422
|
+
declare const index_d_generateUUID: typeof generateUUID;
|
|
15407
14423
|
declare const index_d_getConditionDependencies: typeof getConditionDependencies;
|
|
15408
14424
|
declare const index_d_getCurrencyLocale: typeof getCurrencyLocale;
|
|
15409
14425
|
declare const index_d_getCurrencySymbol: typeof getCurrencySymbol;
|
|
15410
14426
|
declare const index_d_getCurrentTimestamp: typeof getCurrentTimestamp;
|
|
14427
|
+
declare const index_d_getGlobalSingleton: typeof getGlobalSingleton;
|
|
15411
14428
|
declare const index_d_getListCardFieldNames: typeof getListCardFieldNames;
|
|
15412
14429
|
declare const index_d_getProvider: typeof getProvider;
|
|
15413
14430
|
declare const index_d_getRoleFromClaims: typeof getRoleFromClaims;
|
|
@@ -15432,6 +14449,7 @@ declare const index_d_parseISODate: typeof parseISODate;
|
|
|
15432
14449
|
declare const index_d_parseServerCookie: typeof parseServerCookie;
|
|
15433
14450
|
declare const index_d_resetProviders: typeof resetProviders;
|
|
15434
14451
|
declare const index_d_safeValidate: typeof safeValidate;
|
|
14452
|
+
declare const index_d_sanitizeHref: typeof sanitizeHref;
|
|
15435
14453
|
declare const index_d_showNotification: typeof showNotification;
|
|
15436
14454
|
declare const index_d_timestampToISOString: typeof timestampToISOString;
|
|
15437
14455
|
declare const index_d_toDateOnly: typeof toDateOnly;
|
|
@@ -15450,11 +14468,12 @@ declare const index_d_validateWithSchema: typeof validateWithSchema;
|
|
|
15450
14468
|
declare const index_d_when: typeof when;
|
|
15451
14469
|
declare const index_d_withErrorHandling: typeof withErrorHandling;
|
|
15452
14470
|
declare const index_d_withGracefulDegradation: typeof withGracefulDegradation;
|
|
14471
|
+
declare const index_d_withTimeout: typeof withTimeout;
|
|
15453
14472
|
declare const index_d_wrapAuthError: typeof wrapAuthError;
|
|
15454
14473
|
declare const index_d_wrapCrudError: typeof wrapCrudError;
|
|
15455
14474
|
declare const index_d_wrapStorageError: typeof wrapStorageError;
|
|
15456
14475
|
declare namespace index_d {
|
|
15457
|
-
export { index_d_AuthHardening as AuthHardening, index_d_CURRENCY_MAP as CURRENCY_MAP, index_d_ConditionBuilder as ConditionBuilder, index_d_DEFAULT_ERROR_MESSAGES as DEFAULT_ERROR_MESSAGES, index_d_DoNotDevError as DoNotDevError, index_d_SingletonManager as SingletonManager, index_d_addMonths as addMonths, index_d_addYears as addYears, index_d_calculateSubscriptionEndDate as calculateSubscriptionEndDate, index_d_captureErrorToSentry as captureErrorToSentry, index_d_commonErrorCodeMappings as commonErrorCodeMappings, index_d_compactToISOString as compactToISOString, index_d_configureProviders as configureProviders, index_d_createAsyncSingleton as createAsyncSingleton, index_d_createErrorHandler as createErrorHandler, index_d_createMetadata as createMetadata, index_d_createMethodProxy as createMethodProxy, index_d_createSingleton as createSingleton, index_d_createSingletonWithParams as createSingletonWithParams, index_d_detectErrorSource as detectErrorSource, index_d_ensureSpreadable as ensureSpreadable, index_d_evaluateCondition as evaluateCondition, index_d_evaluateFieldConditions as evaluateFieldConditions, index_d_filterVisibleFields as filterVisibleFields, index_d_formatCurrency as formatCurrency, index_d_formatDate as formatDate, index_d_formatRelativeTime as formatRelativeTime, index_d_generateCodeChallenge as generateCodeChallenge, index_d_generateCodeVerifier as generateCodeVerifier, index_d_generateFirestoreRuleCondition as generateFirestoreRuleCondition, index_d_generatePKCEPair as generatePKCEPair, index_d_getConditionDependencies as getConditionDependencies, index_d_getCurrencyLocale as getCurrencyLocale, index_d_getCurrencySymbol as getCurrencySymbol, index_d_getCurrentTimestamp as getCurrentTimestamp, index_d_getListCardFieldNames as getListCardFieldNames, index_d_getProvider as getProvider, index_d_getRoleFromClaims as getRoleFromClaims, index_d_getVisibleFields as getVisibleFields, index_d_getWeekFromISOString as getWeekFromISOString, index_d_handleError as handleError, index_d_hasProvider as hasProvider, index_d_hasRestrictedVisibility as hasRestrictedVisibility, index_d_hasRoleAccess as hasRoleAccess, index_d_hasTierAccess as hasTierAccess, index_d_isCompactDateString as isCompactDateString, index_d_isFieldVisible as isFieldVisible, index_d_isPKCESupported as isPKCESupported, index_d_isoToCompactString as isoToCompactString, index_d_lazyImport as lazyImport, index_d_mapToDoNotDevError as mapToDoNotDevError, index_d_maybeTranslate as maybeTranslate, index_d_normalizeToISOString as normalizeToISOString, index_d_parseDate as parseDate, index_d_parseDateToNoonUTC as parseDateToNoonUTC, index_d_parseISODate as parseISODate, index_d_parseServerCookie as parseServerCookie, index_d_resetProviders as resetProviders, index_d_safeValidate as safeValidate, index_d_showNotification as showNotification, index_d_timestampToISOString as timestampToISOString, index_d_toDateOnly as toDateOnly, index_d_toISOString as toISOString, index_d_translateArray as translateArray, index_d_translateArrayRange as translateArrayRange, index_d_translateArrayWithIndices as translateArrayWithIndices, index_d_translateObjectArray as translateObjectArray, index_d_updateMetadata as updateMetadata, index_d_validateCodeChallenge as validateCodeChallenge, index_d_validateCodeVerifier as validateCodeVerifier, index_d_validateEnvVar as validateEnvVar, index_d_validateMetadata as validateMetadata, index_d_validateUrl as validateUrl, index_d_validateWithSchema as validateWithSchema, index_d_when as when, index_d_withErrorHandling as withErrorHandling, index_d_withGracefulDegradation as withGracefulDegradation, index_d_wrapAuthError as wrapAuthError, index_d_wrapCrudError as wrapCrudError, index_d_wrapStorageError as wrapStorageError };
|
|
14476
|
+
export { index_d_AuthHardening as AuthHardening, index_d_CURRENCY_MAP as CURRENCY_MAP, index_d_ConditionBuilder as ConditionBuilder, index_d_DEFAULT_CRUD_TIMEOUT as DEFAULT_CRUD_TIMEOUT, index_d_DEFAULT_ERROR_MESSAGES as DEFAULT_ERROR_MESSAGES, index_d_DEFAULT_UPLOAD_TIMEOUT as DEFAULT_UPLOAD_TIMEOUT, index_d_DoNotDevError as DoNotDevError, index_d_SingletonManager as SingletonManager, index_d_addMonths as addMonths, index_d_addYears as addYears, index_d_calculateSubscriptionEndDate as calculateSubscriptionEndDate, index_d_captureErrorToSentry as captureErrorToSentry, index_d_clearGlobalSingleton as clearGlobalSingleton, index_d_commonErrorCodeMappings as commonErrorCodeMappings, index_d_compactToISOString as compactToISOString, index_d_configureProviders as configureProviders, index_d_createAsyncSingleton as createAsyncSingleton, index_d_createErrorHandler as createErrorHandler, index_d_createMetadata as createMetadata, index_d_createMethodProxy as createMethodProxy, index_d_createSingleton as createSingleton, index_d_createSingletonWithParams as createSingletonWithParams, index_d_detectErrorSource as detectErrorSource, index_d_ensureSpreadable as ensureSpreadable, index_d_evaluateCondition as evaluateCondition, index_d_evaluateFieldConditions as evaluateFieldConditions, index_d_filterVisibleFields as filterVisibleFields, index_d_formatCurrency as formatCurrency, index_d_formatDate as formatDate, index_d_formatRelativeTime as formatRelativeTime, index_d_generateCodeChallenge as generateCodeChallenge, index_d_generateCodeVerifier as generateCodeVerifier, index_d_generateFirestoreRuleCondition as generateFirestoreRuleCondition, index_d_generatePKCEPair as generatePKCEPair, index_d_generateUUID as generateUUID, index_d_getConditionDependencies as getConditionDependencies, index_d_getCurrencyLocale as getCurrencyLocale, index_d_getCurrencySymbol as getCurrencySymbol, index_d_getCurrentTimestamp as getCurrentTimestamp, index_d_getGlobalSingleton as getGlobalSingleton, index_d_getListCardFieldNames as getListCardFieldNames, index_d_getProvider as getProvider, index_d_getRoleFromClaims as getRoleFromClaims, index_d_getVisibleFields as getVisibleFields, index_d_getWeekFromISOString as getWeekFromISOString, index_d_handleError as handleError, index_d_hasProvider as hasProvider, index_d_hasRestrictedVisibility as hasRestrictedVisibility, index_d_hasRoleAccess as hasRoleAccess, index_d_hasTierAccess as hasTierAccess, index_d_isCompactDateString as isCompactDateString, index_d_isFieldVisible as isFieldVisible, index_d_isPKCESupported as isPKCESupported, index_d_isoToCompactString as isoToCompactString, index_d_lazyImport as lazyImport, index_d_mapToDoNotDevError as mapToDoNotDevError, index_d_maybeTranslate as maybeTranslate, index_d_normalizeToISOString as normalizeToISOString, index_d_parseDate as parseDate, index_d_parseDateToNoonUTC as parseDateToNoonUTC, index_d_parseISODate as parseISODate, index_d_parseServerCookie as parseServerCookie, index_d_resetProviders as resetProviders, index_d_safeValidate as safeValidate, index_d_sanitizeHref as sanitizeHref, index_d_showNotification as showNotification, index_d_timestampToISOString as timestampToISOString, index_d_toDateOnly as toDateOnly, index_d_toISOString as toISOString, index_d_translateArray as translateArray, index_d_translateArrayRange as translateArrayRange, index_d_translateArrayWithIndices as translateArrayWithIndices, index_d_translateObjectArray as translateObjectArray, index_d_updateMetadata as updateMetadata, index_d_validateCodeChallenge as validateCodeChallenge, index_d_validateCodeVerifier as validateCodeVerifier, index_d_validateEnvVar as validateEnvVar, index_d_validateMetadata as validateMetadata, index_d_validateUrl as validateUrl, index_d_validateWithSchema as validateWithSchema, index_d_when as when, index_d_withErrorHandling as withErrorHandling, index_d_withGracefulDegradation as withGracefulDegradation, index_d_withTimeout as withTimeout, index_d_wrapAuthError as wrapAuthError, index_d_wrapCrudError as wrapCrudError, index_d_wrapStorageError as wrapStorageError };
|
|
15458
14477
|
export type { index_d_AuthHardeningConfig as AuthHardeningConfig, index_d_CurrencyEntry as CurrencyEntry, index_d_DateFormatOptions as DateFormatOptions, index_d_DateFormatPreset as DateFormatPreset, index_d_ErrorHandlerConfig as ErrorHandlerConfig, index_d_ErrorHandlerFunction as ErrorHandlerFunction, index_d_FilterVisibleFieldsOptions as FilterVisibleFieldsOptions, index_d_GetVisibleFieldsOptions as GetVisibleFieldsOptions, index_d_HandleErrorOptions as HandleErrorOptions, index_d_LockoutResult as LockoutResult };
|
|
15459
14478
|
}
|
|
15460
14479
|
|
|
@@ -16112,5 +15131,5 @@ declare function getRegisteredScopeProviders(): string[];
|
|
|
16112
15131
|
*/
|
|
16113
15132
|
declare function clearScopeProviders(): void;
|
|
16114
15133
|
|
|
16115
|
-
export { AGGREGATE_FILTER_OPERATORS, AGGREGATE_OPERATIONS, AUTH_EVENTS, AUTH_PARTNERS, AUTH_PARTNER_STATE, AuthHardening, AuthUserSchema, BACKEND_GENERATED_FIELD_NAMES, BILLING_EVENTS, BREAKPOINT_RANGES, BREAKPOINT_THRESHOLDS, COMMON_TIER_CONFIGS, CONFIDENCE_LEVELS, CONSENT_CATEGORY, CONTEXTS, CRUD_OPERATORS, CURRENCY_MAP, CheckoutSessionMetadataSchema, ConditionBuilder, CreateCheckoutSessionRequestSchema, CreateCheckoutSessionResponseSchema, CustomClaimsSchema, DEFAULT_ENTITY_ACCESS, DEFAULT_ERROR_MESSAGES, DEFAULT_LAYOUT_PRESET, DEFAULT_STATUS_OPTIONS, DEFAULT_STATUS_VALUE, DEFAULT_SUBSCRIPTION, DENSITY, DoNotDevError, EDITABLE, EMAIL_VERIFICATION_STATUS, ENTITY_HOOK_ERRORS, ENVIRONMENTS, ERROR_CODES, ERROR_SEVERITY, ERROR_SOURCE, EntityHookError, FEATURES, FEATURE_CONSENT_MATRIX, FEATURE_STATUS, FIELD_TYPES, FIREBASE_ERROR_MAP, GITHUB_PERMISSION_LEVELS, HIDDEN_STATUSES, LAYOUT_PRESET, LIST_SCHEMA_TYPE, OAUTH_EVENTS, OAUTH_PARTNERS, ORDER_DIRECTION, PARTNER_ICONS, PAYLOAD_EVENTS, PERMISSIONS, PLATFORMS, PWA_ASSET_TYPES, PWA_DISPLAY_MODES, ProductDeclarationSchema, ProductDeclarationsSchema, ROUTE_SOURCES, STORAGE_SCOPES, STORAGE_TYPES, STRIPE_EVENTS, STRIPE_MODES, SUBSCRIPTION_DURATIONS, SUBSCRIPTION_STATUS, SUBSCRIPTION_TIERS, index_d as ServerUtils, SingletonManager, StripeBackConfigSchema, StripeFrontConfigSchema, StripePaymentSchema, StripeSubscriptionSchema, SubscriptionClaimsSchema, SubscriptionDataSchema, TECHNICAL_FIELD_NAMES, USER_ROLES, UserSubscriptionSchema, VISIBILITY, WebhookEventSchema, addMonths, addYears, addressSchema, arraySchema, baseFields, booleanSchema, calculateSubscriptionEndDate, captureErrorToSentry, checkGitHubAccessSchema, clearSchemaGenerators, clearScopeProviders, commonErrorCodeMappings, compactToISOString, configureProviders, createAsyncSingleton, createDefaultSubscriptionClaims, createDefaultUserProfile, createEntitySchema, createErrorHandler, createMetadata, createMethodProxy, createSchemas, createSingleton, createSingletonWithParams, dateSchema, defineEntity, deleteEntitySchema, detectErrorSource, disconnectOAuthSchema, emailSchema, enhanceSchema, ensureSpreadable, evaluateCondition, evaluateFieldConditions, exchangeTokenSchema, fileSchema, filesSchema, filterVisibleFields, formatCurrency, formatDate, formatRelativeTime, gdprConsentSchema, generateCodeChallenge, generateCodeVerifier, generateFirestoreRuleCondition, generatePKCEPair, geopointSchema, getBreakpointFromWidth, getBreakpointUtils, getCollectionName, getConditionDependencies, getConnectionsSchema, getCurrencyLocale, getCurrencySymbol, getCurrentTimestamp, getEntitySchema, getListCardFieldNames, getProvider, getRegisteredSchemaTypes, getRegisteredScopeProviders, getRoleFromClaims, getSchemaType, getScopeValue, getVisibleFields, getWeekFromISOString, githubPermissionSchema, githubRepoConfigSchema, grantGitHubAccessSchema, handleError, hasCustomSchemaGenerator, hasMetadata, hasProvider, hasRestrictedVisibility, hasRoleAccess, hasScopeProvider, hasTierAccess, ibanSchema, isAuthPartnerId, isBackendGeneratedField, isBreakpoint, isCompactDateString, isFieldVisible, isFrameworkField, isOAuthPartnerId, isPKCESupported, isoToCompactString, lazyImport, listEntitiesSchema, mapSchema, mapToDoNotDevError, maybeTranslate, multiselectSchema, neverSchema, normalizeToISOString, numberSchema, overrideFeatures, overridePaymentModes, overridePermissions, overrideSubscriptionStatus, overrideSubscriptionTiers, overrideUserRoles, parseDate, parseDateToNoonUTC, parseISODate, parseServerCookie, passwordSchema, pictureSchema, picturesSchema, priceSchema, rangeOptions, referenceSchema, refreshTokenSchema, registerSchemaGenerator, registerScopeProvider, registerUniqueConstraintValidator, resetProviders, revokeGitHubAccessSchema, safeValidate, selectSchema, showNotification, stringSchema, switchSchema, telSchema, textSchema, timestampToISOString, toDateOnly, toISOString, translateArray, translateArrayRange, translateArrayWithIndices, translateObjectArray, unregisterScopeProvider, updateEntitySchema, updateMetadata, urlSchema, validateAuthPartners, validateAuthSchemas, validateAuthUser, validateBillingSchemas, validateCheckoutSessionMetadata, validateCodeChallenge, validateCodeVerifier, validateCreateCheckoutSessionRequest, validateCreateCheckoutSessionResponse, validateCustomClaims, validateDates, validateDocument, validateEnvVar, validateMetadata, validateOAuthPartners, validateStripeBackConfig, validateStripeFrontConfig, validateSubscriptionClaims, validateSubscriptionData, validateUniqueFields, validateUrl, validateUserSubscription, validateWebhookEvent, validateWithSchema, when, withErrorHandling, withGracefulDegradation, wrapAuthError, wrapCrudError, wrapStorageError };
|
|
16116
|
-
export type { AccountLinkResult, AccountLinkingInfo, AdminCheckHookResult, AdminClaims, AggregateConfig, AggregateFilterOperator, AggregateOperation, AggregateRequest, AggregateResponse, AnyFieldValue, ApiResponse, AppConfig, AppCookieCategories, AppMetadata, AppProvidersProps, AssetsPluginConfig, AttemptRecord, AuditEvent, AuditEventType, AuthAPI, AuthActions, AuthConfig, AuthContextValue, AuthCoreHookResult, AuthError, AuthEventData, AuthEventKey, AuthEventName, AuthHardeningConfig, AuthHardeningContext, AuthMethod, AuthPartner,
|
|
15134
|
+
export { AGGREGATE_FILTER_OPERATORS, AGGREGATE_OPERATIONS, AIChatRequestSchema, AIChatResponseSchema, AIMessageSchema, AIProviderConfigSchema, AIToolCallSchema, AIToolDefinitionSchema, AIUsageSchema, AI_ERROR_CODES, AI_MODELS, AI_PROVIDERS, AI_ROLES, AI_TIERS, AI_TOKEN_PRICING, AUTH_EVENTS, AUTH_PARTNERS, AUTH_PARTNER_STATE, AuthHardening, AuthUserSchema, BACKEND_GENERATED_FIELD_NAMES, BILLING_EVENTS, BREAKPOINT_RANGES, BREAKPOINT_THRESHOLDS, COMMON_TIER_CONFIGS, CONFIDENCE_LEVELS, CONSENT_CATEGORY, CONTEXTS, CRUD_OPERATORS, CURRENCY_MAP, CheckoutSessionMetadataSchema, ConditionBuilder, CreateCheckoutSessionRequestSchema, CreateCheckoutSessionResponseSchema, CustomClaimsSchema, DEFAULT_AI_CONFIG, DEFAULT_AI_MARKUP, DEFAULT_CRUD_TIMEOUT, DEFAULT_ENTITY_ACCESS, DEFAULT_ERROR_MESSAGES, DEFAULT_LAYOUT_PRESET, DEFAULT_STATUS_OPTIONS, DEFAULT_STATUS_VALUE, DEFAULT_SUBSCRIPTION, DEFAULT_UPLOAD_TIMEOUT, DENSITY, DoNotDevError, EDITABLE, EMAIL_ERROR_CODES, EMAIL_PROVIDERS, EMAIL_VERIFICATION_STATUS, ENTITY_HOOK_ERRORS, ENVIRONMENTS, ERROR_CODES, ERROR_SEVERITY, ERROR_SOURCE, EntityHookError, FEATURES, FEATURE_CONSENT_MATRIX, FEATURE_STATUS, FIELD_TYPES, FIREBASE_ERROR_MAP, FOOTER_MODE, GITHUB_PERMISSION_LEVELS, HIDDEN_STATUSES, LAYOUT_PRESET, LIST_SCHEMA_TYPE, OAUTH_EVENTS, OAUTH_PARTNERS, ORDER_DIRECTION, PARTNER_ICONS, PAYLOAD_EVENTS, PERMISSIONS, PLATFORMS, PWA_ASSET_TYPES, PWA_DISPLAY_MODES, ProductDeclarationSchema, ProductDeclarationsSchema, ROUTE_SOURCES, STORAGE_SCOPES, STORAGE_TYPES, STRIPE_EVENTS, STRIPE_MODES, SUBSCRIPTION_DURATIONS, SUBSCRIPTION_STATUS, SUBSCRIPTION_TIERS, SendEmailRequestSchema, SendEmailResponseSchema, index_d as ServerUtils, SingletonManager, StripeBackConfigSchema, StripeFrontConfigSchema, StripePaymentSchema, StripeSubscriptionSchema, SubscriptionClaimsSchema, SubscriptionDataSchema, TECHNICAL_FIELD_NAMES, USER_ROLES, UserSubscriptionSchema, VISIBILITY, WebhookEventSchema, addMonths, addYears, addressSchema, arraySchema, baseFields, booleanSchema, calculateSubscriptionEndDate, captureErrorToSentry, checkGitHubAccessSchema, clearGlobalSingleton, clearSchemaGenerators, clearScopeProviders, commonErrorCodeMappings, compactToISOString, configureProviders, createAsyncSingleton, createDefaultSubscriptionClaims, createDefaultUserProfile, createEntitySchema, createErrorHandler, createMetadata, createMethodProxy, createSchemas, createSingleton, createSingletonWithParams, dateSchema, defineEntity, deleteEntitySchema, detectErrorSource, disconnectOAuthSchema, emailSchema, enhanceSchema, ensureSpreadable, evaluateCondition, evaluateFieldConditions, exchangeTokenSchema, fileSchema, filesSchema, filterVisibleFields, formatCurrency, formatDate, formatRelativeTime, gdprConsentSchema, generateCodeChallenge, generateCodeVerifier, generateFirestoreRuleCondition, generatePKCEPair, generateUUID, geopointSchema, getBreakpointFromWidth, getBreakpointUtils, getCollectionName, getConditionDependencies, getConnectionsSchema, getCurrencyLocale, getCurrencySymbol, getCurrentTimestamp, getEntitySchema, getGlobalSingleton, getListCardFieldNames, getProvider, getRegisteredSchemaTypes, getRegisteredScopeProviders, getRoleFromClaims, getSchemaType, getScopeValue, getVisibleFields, getWeekFromISOString, githubPermissionSchema, githubRepoConfigSchema, grantGitHubAccessSchema, handleError, hasCustomSchemaGenerator, hasMetadata, hasProvider, hasRestrictedVisibility, hasRoleAccess, hasScopeProvider, hasTierAccess, ibanSchema, isAuthPartnerId, isBackendGeneratedField, isBreakpoint, isCompactDateString, isFieldVisible, isFrameworkField, isOAuthPartnerId, isPKCESupported, isoToCompactString, lazyImport, listEntitiesSchema, mapSchema, mapToDoNotDevError, maybeTranslate, multiselectSchema, neverSchema, normalizeToISOString, numberSchema, overrideFeatures, overridePaymentModes, overridePermissions, overrideSubscriptionStatus, overrideSubscriptionTiers, overrideUserRoles, parseDate, parseDateToNoonUTC, parseISODate, parseServerCookie, passwordSchema, pictureSchema, picturesSchema, priceSchema, rangeOptions, referenceSchema, refreshTokenSchema, registerSchemaGenerator, registerScopeProvider, registerUniqueConstraintValidator, resetProviders, revokeGitHubAccessSchema, safeValidate, sanitizeHref, selectSchema, showNotification, stringSchema, switchSchema, telSchema, textSchema, timestampToISOString, toDateOnly, toISOString, translateArray, translateArrayRange, translateArrayWithIndices, translateObjectArray, unregisterScopeProvider, updateEntitySchema, updateMetadata, urlSchema, validateAIChatRequest, validateAIChatResponse, validateAuthPartners, validateAuthSchemas, validateAuthUser, validateBillingSchemas, validateCheckoutSessionMetadata, validateCodeChallenge, validateCodeVerifier, validateCreateCheckoutSessionRequest, validateCreateCheckoutSessionResponse, validateCustomClaims, validateDates, validateDocument, validateEnvVar, validateMetadata, validateOAuthPartners, validateSendEmailRequest, validateSendEmailResponse, validateStripeBackConfig, validateStripeFrontConfig, validateSubscriptionClaims, validateSubscriptionData, validateUniqueFields, validateUrl, validateUserSubscription, validateWebhookEvent, validateWithSchema, when, withErrorHandling, withGracefulDegradation, withTimeout, wrapAuthError, wrapCrudError, wrapStorageError };
|
|
15135
|
+
export type { AIAPI, AIChatRequest, AIChatResponse, AIConfig, AICostConfig, AICostEvent, AICostRecord, AICostResult, AIErrorCode, AIMessage, AIModelPricing, AIProvider, AIProviderConfig, AIRateLimitConfig, AIRouteConfig, AITierId, AIToolCall, AIToolDefinition, AIToolParameter, AIUsage, AccountLinkResult, AccountLinkingInfo, AdminCheckHookResult, AdminClaims, AggregateConfig, AggregateFilterOperator, AggregateOperation, AggregateRequest, AggregateResponse, AnyFieldValue, ApiResponse, AppConfig, AppCookieCategories, AppMetadata, AppProvidersProps, AssetsPluginConfig, AttemptRecord, AuditEvent, AuditEventType, AuthAPI, AuthActions, AuthConfig, AuthContextValue, AuthCoreHookResult, AuthError, AuthEventData, AuthEventKey, AuthEventName, AuthHardeningConfig, AuthHardeningContext, AuthMethod, AuthPartner, AuthPartnerHookResult, AuthPartnerId, AuthPartnerResult, AuthPartnerState, AuthProvider, AuthProviderProps, AuthRedirectHookResult, AuthRedirectOperation, AuthRedirectOptions, AuthResult, AuthState, AuthStateStore, AuthStatus, AuthTokenHookResult, AuthUser, BackendGeneratedField, BaseActions, BaseCredentials, BaseDocument, BaseEntityFields, BasePartnerState, BaseState, BaseStoreActions, BaseStoreState, BaseUserProfile, BasicUserInfo, BeforeCheckoutHook, BeforeCheckoutResult, BillingAPI, BillingAdapter, BillingErrorCode, BillingEvent, BillingEventData, BillingEventKey, BillingEventName, BillingProvider, BillingProviderConfig, BillingRedirectOperation, Breakpoint, BreakpointUtils, BuiltInFieldType, BusinessEntity, CachedError, CanAPI, CheckGitHubAccessRequest, CheckoutMode, CheckoutOptions, CheckoutSessionMetadata, CollectionSubscriptionCallback, ColumnDef, CommonSubscriptionFeatures, CommonTranslations, ConditionBuilderLike, ConditionExpression, ConditionGroup, ConditionInput, ConditionNode, ConditionOperator, ConditionResult, ConditionalBehavior, ConfidenceLevel, ConnectOptions, ConsentAPI, ConsentActions, ConsentCategory, ConsentState, Context, CookieOptions, CreateCheckoutSessionRequest, CreateCheckoutSessionResponse, CreateEntityData, CreateEntityRequest, CreateEntityResponse, CrudAPI, CrudCardProps, CrudConfig, CrudOperationOptions, CrudOperator, CurrencyEntry, CustomClaims, CustomFieldOptionsMap, CustomSchemaGenerator, CustomStoreConfig, DateFormatOptions, DateFormatPreset, DateValue, DeleteEntityRequest, DeleteEntityResponse, Density, DnDevOverride, DnDevWrapper, DndevFrameworkConfig, DndevProviders, DndevStoreApi, DoNotDevCookieCategories, DocumentSubscriptionCallback, DynamicFormRule, Editable, EffectiveConnectionType, EmailConfig, EmailErrorCode, EmailProvider, EmailRouteConfig, EmailTemplate, EmailTemplateRegistry, EmailVerificationHookResult, EmailVerificationStatus, Entity, EntityAccessConfig, EntityAccessDefaults, EntityBrowseBaseProps, EntityCardListProps, EntityDisplayRendererProps, EntityField, EntityFormRendererProps, EntityHookErrors, EntityListProps, EntityMetadata, EntityOwnershipConfig, EntityOwnershipPublicCondition, EntityRecommendationsProps, EntityRecord, EntityTemplateProps, EntityTranslations, EnvironmentMode, ErrorCode, ErrorHandlerConfig, ErrorHandlerFunction, ErrorSeverity, ErrorSource, ExchangeTokenParams, ExchangeTokenRequest, ExchangeTokenResponse, FaviconConfig, Feature, FeatureAccessHookResult, FeatureConsentRequirement, FeatureHookResult, FeatureId, FeatureName, FeatureStatus, FeaturesConfig, FeaturesPluginConfig, FeaturesRequiringAnyConsent, FeaturesRequiringConsent, FeaturesWithoutConsent, FieldCondition, FieldType, FieldTypeToValue, FileAsset, FilterVisibleFieldsOptions, FirebaseCallOptions, FirebaseConfig, FirestoreTimestamp, FirestoreUniqueConstraintValidator, FooterConfig, FooterMode, FooterZoneConfig, FormConfig, FormStep, FunctionCallConfig, FunctionCallContext, FunctionCallOptions, FunctionCallResult, FunctionClient, FunctionClientFactoryOptions, FunctionDefaults, FunctionEndpoint, FunctionError, FunctionLoader, FunctionMemory, FunctionMeta, FunctionPlatform, FunctionResponse, FunctionSchema, FunctionSchemas, FunctionSystem, FunctionTrigger, FunctionsConfig, GetCustomClaimsResponse, GetEntityData, GetEntityRequest, GetEntityResponse, GetUserAuthStatusResponse, GetVisibleFieldsOptions, GitHubPermission, GitHubRepoConfig, GrantGitHubAccessRequest, GroupByDefinition, HandleErrorOptions, HeaderZoneConfig, I18nConfig, I18nPluginConfig, I18nProviderProps, ICallableProvider, ICrudAdapter, ID, INetworkManager, IServerAuthAdapter, IStorageAdapter, IStorageManager, IStorageStrategy, Invoice, InvoiceItem, LanguageData, LanguageInfo, LayoutConfig, LayoutPreset, LegalCompanyInfo, LegalConfig, LegalContactInfo, LegalDirectorInfo, LegalHostingInfo, LegalJurisdictionInfo, LegalSectionsConfig, LegalWebsiteInfo, ListCardLayout, ListEntitiesRequest, ListEntitiesResponse, ListEntityData, ListOptions, ListResponse, ListSchemaType, LoadingActions, LoadingState, LockoutResult, MergedBarConfig, MetricDefinition, MobileBehaviorConfig, ModalActions, ModalState, MutationResponse, NavigationRoute, NetworkCheckConfig, NetworkConnectionType, NetworkReconnectCallback, NetworkState, NetworkStatus, NetworkStatusHookResult, OAuthAPI, OAuthApiRequestOptions, OAuthCallbackHookResult, OAuthConnection, OAuthConnectionInfo, OAuthConnectionRequest, OAuthConnectionStatus, OAuthCredentials, OAuthEventData, OAuthEventKey, OAuthEventName, OAuthPartner, OAuthPartnerHookResult, OAuthPartnerId, OAuthPartnerResult, OAuthPartnerState, OAuthPurpose, OAuthRedirectOperation, OAuthRefreshRequest, OAuthRefreshResponse, OAuthResult, OAuthStoreActions, OAuthStoreState, Observable, OperationSchemas, OrderByClause, OrderDirection, PWAAssetType, PWADisplayMode, PWAPluginConfig, PageAuth, PageMeta, PaginatedQueryResult, PaginationOptions, PartnerConnectionState, PartnerIconId, PartnerId, PartnerResult, PartnerType, PayloadCacheEventData, PayloadDocument, PayloadDocumentEventData, PayloadEventKey, PayloadEventName, PayloadGlobalEventData, PayloadMediaEventData, PayloadPageRegenerationEventData, PayloadRequest, PayloadUserEventData, PaymentEventData, PaymentMethod, PaymentMethodType, PaymentMode, Permission, Picture, Platform, PresetConfig, PresetRegistry, ProcessPaymentSuccessRequest, ProcessPaymentSuccessResponse, ProductDeclaration, ProviderInstances, QueryConfig, QueryOptions, QueryOrderBy, QueryWhereClause, RateLimitBackend, RateLimitConfig, RateLimitManager, RateLimitResult, RateLimitState, RateLimiter, ReadCallback, RedirectOperation, RedirectOverlayActions, RedirectOverlayConfig, RedirectOverlayPhase, RedirectOverlayState, Reference, RefreshSubscriptionRequest, RefreshSubscriptionResponse, RemoveCustomClaimsResponse, ResolvedLayoutConfig, RevokeGitHubAccessRequest, RouteMeta, RouteSource, RoutesPluginConfig, SEOConfig, SchemaMetadata, SchemaWithVisibility, ScopeConfig, ScopeProviderFn, SecurityContext, SecurityEntityConfig, SelectOption, SendEmailRequest, SendEmailResponse, SeoMeta, ServerRateLimitConfig, ServerRateLimitResult, ServerUserRecord, SetCustomClaimsResponse, SidebarZoneConfig, SlotContent, StatusField, StorageOptions, StorageScope, StorageType, Store, StripeBackConfig, StripeCheckoutRequest, StripeCheckoutResponse, StripeCheckoutSessionEventData, StripeConfig, StripeCustomer, StripeCustomerEventData, StripeEventData, StripeEventKey, StripeEventName, StripeFrontConfig, StripeInvoice, StripeInvoiceEventData, StripePayment, StripePaymentIntentEventData, StripePaymentMethod, StripePrice, StripeProduct, StripeProvider, StripeSubscription, StripeSubscriptionData, StripeWebhookEvent, StripeWebhookEventData, Subscription, SubscriptionClaims, SubscriptionConfig, SubscriptionData, SubscriptionDuration, SubscriptionEventData, SubscriptionHookResult, SubscriptionInfo, SubscriptionStatus, SubscriptionTier, SupportedLanguage, TechnicalField, ThemeActions, ThemeInfo, ThemeMode, ThemeState, ThemesPluginConfig, TierAccessHookResult, Timestamp, TokenInfo, TokenResponse, TokenState, TokenStatus, TranslationOptions, TranslationResource, TypedBaseFields, UIFieldOptions, UniqueConstraintValidator, UniqueKeyDefinition, UnsubscribeFn, UpdateEntityData, UpdateEntityRequest, UpdateEntityResponse, UploadOptions, UploadProgressCallback, UploadResult, UseFunctionsCallResult, UseFunctionsMutationOptions, UseFunctionsMutationResult, UseFunctionsQueryOptions, UseFunctionsQueryResult, UseTranslationOptionsEnhanced, UserContext, UserProfile, UserProviderData, UserRole, UserSubscription, ValidationRules, ValueTypeForField, VerifiedToken, Visibility, WebhookEvent, WebhookEventData, WhereClause, WhereOperator, WithMetadata, dndevSchema };
|