@scalio-cloud/ui 0.108.0 → 0.110.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/app-kit/ScalioAuditPages.d.ts +37 -0
  2. package/dist/app-kit/ScalioAuditPages.d.ts.map +1 -0
  3. package/dist/app-kit/ScalioBackupSection.d.ts +27 -0
  4. package/dist/app-kit/ScalioBackupSection.d.ts.map +1 -0
  5. package/dist/app-kit/ScalioFactoryReset.d.ts +15 -0
  6. package/dist/app-kit/ScalioFactoryReset.d.ts.map +1 -0
  7. package/dist/app-kit/ScalioInvitePage.d.ts +24 -0
  8. package/dist/app-kit/ScalioInvitePage.d.ts.map +1 -0
  9. package/dist/app-kit/ScalioLicensePanel.d.ts +23 -0
  10. package/dist/app-kit/ScalioLicensePanel.d.ts.map +1 -0
  11. package/dist/app-kit/ScalioLoginPage.d.ts +31 -0
  12. package/dist/app-kit/ScalioLoginPage.d.ts.map +1 -0
  13. package/dist/app-kit/ScalioMailSettings.d.ts +13 -0
  14. package/dist/app-kit/ScalioMailSettings.d.ts.map +1 -0
  15. package/dist/app-kit/ScalioPasswordChangePage.d.ts +21 -0
  16. package/dist/app-kit/ScalioPasswordChangePage.d.ts.map +1 -0
  17. package/dist/app-kit/ScalioProfilePage.d.ts +39 -0
  18. package/dist/app-kit/ScalioProfilePage.d.ts.map +1 -0
  19. package/dist/app-kit/ScalioRoleTenants.d.ts +22 -0
  20. package/dist/app-kit/ScalioRoleTenants.d.ts.map +1 -0
  21. package/dist/app-kit/ScalioSaasUpdatesSection.d.ts +23 -0
  22. package/dist/app-kit/ScalioSaasUpdatesSection.d.ts.map +1 -0
  23. package/dist/app-kit/ScalioSecurityFactors.d.ts +28 -0
  24. package/dist/app-kit/ScalioSecurityFactors.d.ts.map +1 -0
  25. package/dist/app-kit/ScalioSelfTestPage.d.ts +14 -0
  26. package/dist/app-kit/ScalioSelfTestPage.d.ts.map +1 -0
  27. package/dist/app-kit/ScalioSupportCard.d.ts +13 -0
  28. package/dist/app-kit/ScalioSupportCard.d.ts.map +1 -0
  29. package/dist/app-kit/ScalioUsersPage.d.ts +48 -0
  30. package/dist/app-kit/ScalioUsersPage.d.ts.map +1 -0
  31. package/dist/app-kit/_uiReact.d.ts +307 -0
  32. package/dist/app-kit/_uiReact.d.ts.map +1 -0
  33. package/dist/app-kit/index.d.ts +31 -0
  34. package/dist/app-kit/index.d.ts.map +1 -0
  35. package/dist/app-kit/index.js +1128 -0
  36. package/dist/app-kit/index.js.map +1 -0
  37. package/dist/app-kit/index.mjs +1051 -0
  38. package/dist/app-kit/index.mjs.map +1 -0
  39. package/dist/chunk-A7O3P4YV.mjs +457 -0
  40. package/dist/chunk-A7O3P4YV.mjs.map +1 -0
  41. package/dist/config/i18nCheck.d.ts +49 -0
  42. package/dist/config/i18nCheck.d.ts.map +1 -0
  43. package/dist/config/index.d.ts +37 -0
  44. package/dist/config/index.d.ts.map +1 -0
  45. package/dist/config/index.js +268 -0
  46. package/dist/config/index.js.map +1 -0
  47. package/dist/config/index.mjs +234 -0
  48. package/dist/config/index.mjs.map +1 -0
  49. package/dist/config/openapi.d.ts +34 -0
  50. package/dist/config/openapi.d.ts.map +1 -0
  51. package/dist/core/afterLogin.d.ts +6 -0
  52. package/dist/core/afterLogin.d.ts.map +1 -0
  53. package/dist/core/api.d.ts +48 -0
  54. package/dist/core/api.d.ts.map +1 -0
  55. package/dist/core/auditActions.d.ts +17 -0
  56. package/dist/core/auditActions.d.ts.map +1 -0
  57. package/dist/core/datetime.d.ts +18 -0
  58. package/dist/core/datetime.d.ts.map +1 -0
  59. package/dist/core/i18n.d.ts +51 -0
  60. package/dist/core/i18n.d.ts.map +1 -0
  61. package/dist/core/index.d.ts +14 -0
  62. package/dist/core/index.d.ts.map +1 -0
  63. package/dist/core/index.js +509 -0
  64. package/dist/core/index.js.map +1 -0
  65. package/dist/core/index.mjs +39 -0
  66. package/dist/core/index.mjs.map +1 -0
  67. package/dist/core/legal.d.ts +17 -0
  68. package/dist/core/legal.d.ts.map +1 -0
  69. package/dist/core/mailReady.d.ts +12 -0
  70. package/dist/core/mailReady.d.ts.map +1 -0
  71. package/dist/core/passkeys.d.ts +30 -0
  72. package/dist/core/passkeys.d.ts.map +1 -0
  73. package/dist/core/permissions.d.ts +10 -0
  74. package/dist/core/permissions.d.ts.map +1 -0
  75. package/dist/editor/RichTextEditor.d.ts +58 -0
  76. package/dist/editor/RichTextEditor.d.ts.map +1 -0
  77. package/dist/editor/index.d.ts +5 -0
  78. package/dist/editor/index.d.ts.map +1 -0
  79. package/dist/editor/index.js +350 -0
  80. package/dist/editor/index.js.map +1 -0
  81. package/dist/editor/index.mjs +324 -0
  82. package/dist/editor/index.mjs.map +1 -0
  83. package/package.json +68 -3
@@ -0,0 +1,234 @@
1
+ // src/config/openapi.ts
2
+ var DEFAULT_OPENAPI_TYPEGEN_CONFIG = {
3
+ input: "../openapi.json",
4
+ output: "src/api/schema.d.ts",
5
+ immutableTypes: true,
6
+ exportType: true,
7
+ alphabetize: true,
8
+ emptyObjectsUnknown: true
9
+ };
10
+ function createOpenApiTypegenConfig(overrides = {}) {
11
+ return {
12
+ ...DEFAULT_OPENAPI_TYPEGEN_CONFIG,
13
+ ...overrides
14
+ };
15
+ }
16
+ function buildOpenApiTypegenArgs(config = {}) {
17
+ const resolved = createOpenApiTypegenConfig(config);
18
+ const args = [resolved.input, "-o", resolved.output];
19
+ if (resolved.immutableTypes) {
20
+ args.push("--immutable");
21
+ }
22
+ if (resolved.exportType) {
23
+ args.push("--export-type");
24
+ }
25
+ if (resolved.alphabetize) {
26
+ args.push("--alphabetize");
27
+ }
28
+ if (resolved.emptyObjectsUnknown) {
29
+ args.push("--empty-objects-unknown");
30
+ }
31
+ return args;
32
+ }
33
+
34
+ // src/config/i18nCheck.ts
35
+ var PLACEHOLDER_RE = /\{\{\s*([a-zA-Z0-9_.-]+)\s*\}\}|\{\s*([a-zA-Z0-9_.-]+)\s*\}/g;
36
+ var SHARP_S = "\xDF";
37
+ function extractPlaceholders(text) {
38
+ const found = /* @__PURE__ */ new Set();
39
+ for (const match of text.matchAll(PLACEHOLDER_RE)) {
40
+ const name = match[1] ?? match[2];
41
+ if (name) {
42
+ found.add(name);
43
+ }
44
+ }
45
+ return Array.from(found).sort();
46
+ }
47
+ function isGermanLocale(locale) {
48
+ const lower = locale.toLowerCase();
49
+ return lower === "de" || lower.startsWith("de-") || lower.startsWith("de_");
50
+ }
51
+ function sameStringList(a, b) {
52
+ if (a.length !== b.length) return false;
53
+ for (let i = 0; i < a.length; i += 1) {
54
+ if (a[i] !== b[i]) return false;
55
+ }
56
+ return true;
57
+ }
58
+ function validateI18nCatalogs(catalogs, options = {}) {
59
+ const sourceLocale = options.sourceLocale ?? "en";
60
+ const failOnExtraKeys = options.failOnExtraKeys ?? true;
61
+ const forbidSharpSInGerman = options.forbidSharpSInGerman ?? true;
62
+ const failOnEmptyValues = options.failOnEmptyValues ?? true;
63
+ const issues = [];
64
+ const localeNames = Object.keys(catalogs).sort();
65
+ const source = catalogs[sourceLocale];
66
+ if (!source) {
67
+ issues.push({
68
+ locale: sourceLocale,
69
+ key: "*",
70
+ kind: "missing-source-locale",
71
+ message: `Source locale "${sourceLocale}" is missing from catalogs.`
72
+ });
73
+ return {
74
+ ok: false,
75
+ sourceLocale,
76
+ localesChecked: localeNames,
77
+ issues
78
+ };
79
+ }
80
+ const sourceKeys = Object.keys(source).sort();
81
+ if (failOnEmptyValues) {
82
+ for (const key of sourceKeys) {
83
+ const sourceValue = source[key];
84
+ if (sourceValue !== void 0 && sourceValue.trim().length === 0) {
85
+ issues.push({
86
+ locale: sourceLocale,
87
+ key,
88
+ kind: "empty-value",
89
+ message: `Empty translation value in source locale "${sourceLocale}" for key "${key}".`
90
+ });
91
+ }
92
+ }
93
+ }
94
+ for (const locale of localeNames) {
95
+ if (locale === sourceLocale) continue;
96
+ const target = catalogs[locale];
97
+ if (!target) continue;
98
+ const targetKeys = Object.keys(target).sort();
99
+ const checkSharpS = forbidSharpSInGerman && isGermanLocale(locale);
100
+ for (const key of sourceKeys) {
101
+ if (!Object.prototype.hasOwnProperty.call(target, key)) {
102
+ issues.push({
103
+ locale,
104
+ key,
105
+ kind: "missing-key",
106
+ message: `Locale "${locale}" is missing key "${key}".`
107
+ });
108
+ continue;
109
+ }
110
+ const sourceValue = source[key] ?? "";
111
+ const value = target[key] ?? "";
112
+ if (failOnEmptyValues && value.trim().length === 0) {
113
+ issues.push({
114
+ locale,
115
+ key,
116
+ kind: "empty-value",
117
+ message: `Empty translation value in locale "${locale}" for key "${key}".`
118
+ });
119
+ }
120
+ const expectedPlaceholders = extractPlaceholders(sourceValue);
121
+ const actualPlaceholders = extractPlaceholders(value);
122
+ if (!sameStringList(expectedPlaceholders, actualPlaceholders)) {
123
+ issues.push({
124
+ locale,
125
+ key,
126
+ kind: "placeholder-mismatch",
127
+ message: `Placeholder mismatch in "${locale}.${key}": expected [${expectedPlaceholders.join(", ")}], got [${actualPlaceholders.join(", ")}].`
128
+ });
129
+ }
130
+ if (checkSharpS && value.includes(SHARP_S)) {
131
+ issues.push({
132
+ locale,
133
+ key,
134
+ kind: "sharp-s",
135
+ message: `Locale "${locale}" key "${key}" contains forbidden sharp-s; use "ss" instead.`
136
+ });
137
+ }
138
+ }
139
+ if (failOnExtraKeys) {
140
+ for (const key of targetKeys) {
141
+ if (!Object.prototype.hasOwnProperty.call(source, key)) {
142
+ issues.push({
143
+ locale,
144
+ key,
145
+ kind: "extra-key",
146
+ message: `Locale "${locale}" contains unknown key "${key}" not present in "${sourceLocale}".`
147
+ });
148
+ }
149
+ }
150
+ }
151
+ }
152
+ return {
153
+ ok: issues.length === 0,
154
+ sourceLocale,
155
+ localesChecked: localeNames,
156
+ issues
157
+ };
158
+ }
159
+ function formatI18nValidationReport(result) {
160
+ if (result.ok) {
161
+ return `i18n ok (${result.localesChecked.length} locales checked against "${result.sourceLocale}").`;
162
+ }
163
+ const lines = [
164
+ `i18n validation failed (${result.issues.length} issue${result.issues.length === 1 ? "" : "s"}):`,
165
+ ...result.issues.map((issue) => ` - [${issue.locale}] (${issue.kind}) ${issue.message}`)
166
+ ];
167
+ return lines.join("\n");
168
+ }
169
+
170
+ // src/config/index.ts
171
+ function createPostcssConfig() {
172
+ return {
173
+ plugins: {
174
+ tailwindcss: {},
175
+ autoprefixer: {}
176
+ }
177
+ };
178
+ }
179
+ function createEslintConfig(options) {
180
+ const { js, globals, reactPlugin, reactHooks, ignores = [], rules = {} } = options;
181
+ return [
182
+ {
183
+ ignores: ["build/**", "dist/**", "node_modules/**", "src/vendor/**", "**/*.d.ts", ...ignores]
184
+ },
185
+ js.configs.recommended,
186
+ {
187
+ files: ["**/*.{js,jsx,cjs,mjs}"],
188
+ linterOptions: {
189
+ reportUnusedDisableDirectives: false
190
+ },
191
+ languageOptions: {
192
+ ecmaVersion: 2022,
193
+ sourceType: "module",
194
+ parserOptions: {
195
+ ecmaFeatures: { jsx: true }
196
+ },
197
+ globals: {
198
+ ...globals.browser,
199
+ ...globals.node,
200
+ ...globals.vitest ?? {}
201
+ }
202
+ },
203
+ plugins: {
204
+ react: reactPlugin,
205
+ "react-hooks": reactHooks
206
+ },
207
+ settings: {
208
+ react: { version: "detect" }
209
+ },
210
+ rules: {
211
+ "no-unused-vars": "off",
212
+ "no-undef": "off",
213
+ "react/prop-types": "off",
214
+ "react/react-in-jsx-scope": "off",
215
+ "no-empty": "off",
216
+ "no-constant-condition": "off",
217
+ "no-useless-escape": "off",
218
+ "no-prototype-builtins": "off",
219
+ ...rules
220
+ }
221
+ }
222
+ ];
223
+ }
224
+ export {
225
+ DEFAULT_OPENAPI_TYPEGEN_CONFIG,
226
+ buildOpenApiTypegenArgs,
227
+ createEslintConfig,
228
+ createOpenApiTypegenConfig,
229
+ createPostcssConfig,
230
+ extractPlaceholders,
231
+ formatI18nValidationReport,
232
+ validateI18nCatalogs
233
+ };
234
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/config/openapi.ts","../../src/config/i18nCheck.ts","../../src/config/index.ts"],"sourcesContent":["/**\n * Standard OpenAPI-to-TypeScript generation configuration for Scalio frontends.\n *\n * Consumes the `openapi.json` exported by each Rust backend (`utoipa`) and produces\n * deterministic, readonly TypeScript definitions via `openapi-typescript`.\n */\n\nexport interface OpenApiTypegenConfig {\n /** Path to the OpenAPI 3.x specification file (default: `\"../openapi.json\"`). */\n readonly input: string;\n /** Output path for the generated `.d.ts` file (default: `\"src/api/schema.d.ts\"`). */\n readonly output: string;\n /** Emit `readonly` properties on generated object types (default: `true`). */\n readonly immutableTypes: boolean;\n /** Prefer `type` aliases over `interface` declarations (default: `true`). */\n readonly exportType: boolean;\n /** Sort generated keys alphabetically for minimal diffs (default: `true`). */\n readonly alphabetize: boolean;\n /** Emit `Record<string, unknown>` instead of `Record<string, never>` for open objects (default: `true`). */\n readonly emptyObjectsUnknown: boolean;\n}\n\nexport type OpenApiTypegenOverrides = Partial<OpenApiTypegenConfig>;\n\nexport const DEFAULT_OPENAPI_TYPEGEN_CONFIG: OpenApiTypegenConfig = {\n input: \"../openapi.json\",\n output: \"src/api/schema.d.ts\",\n immutableTypes: true,\n exportType: true,\n alphabetize: true,\n emptyObjectsUnknown: true,\n};\n\n/**\n * Returns the standard OpenAPI type generation configuration merged with optional overrides.\n */\nexport function createOpenApiTypegenConfig(\n overrides: OpenApiTypegenOverrides = {},\n): OpenApiTypegenConfig {\n return {\n ...DEFAULT_OPENAPI_TYPEGEN_CONFIG,\n ...overrides,\n };\n}\n\n/**\n * Builds the CLI argument list for `openapi-typescript` from a configuration object.\n *\n * Example usage in an app script:\n * `npx openapi-typescript ...buildOpenApiTypegenArgs()`\n */\nexport function buildOpenApiTypegenArgs(\n config: OpenApiTypegenOverrides = {},\n): readonly string[] {\n const resolved = createOpenApiTypegenConfig(config);\n const args: string[] = [resolved.input, \"-o\", resolved.output];\n\n if (resolved.immutableTypes) {\n args.push(\"--immutable\");\n }\n if (resolved.exportType) {\n args.push(\"--export-type\");\n }\n if (resolved.alphabetize) {\n args.push(\"--alphabetize\");\n }\n if (resolved.emptyObjectsUnknown) {\n args.push(\"--empty-objects-unknown\");\n }\n\n return args;\n}\n","/**\n * Translation catalog validator for Scalio frontends.\n *\n * Ensures that every target locale matches the English source catalog:\n * - No missing or orphan keys\n * - No empty translation values\n * - Identical `{placeholder}` / `{{placeholder}}` sets\n * - Swiss German spelling (no sharp-s `\\u00df`) in German catalogs\n */\n\nexport type I18nCatalog = Readonly<Record<string, string>>;\nexport type I18nCatalogMap = Readonly<Record<string, I18nCatalog>>;\n\nexport type I18nIssueKind =\n | \"missing-source-locale\"\n | \"missing-key\"\n | \"extra-key\"\n | \"empty-value\"\n | \"placeholder-mismatch\"\n | \"sharp-s\";\n\nexport interface I18nValidationIssue {\n readonly locale: string;\n readonly key: string;\n readonly kind: I18nIssueKind;\n readonly message: string;\n}\n\nexport interface I18nValidationOptions {\n /** Authoritative source locale (default: `\"en\"`). */\n readonly sourceLocale?: string;\n /** Report keys that exist in a target locale but not in the source locale (default: `true`). */\n readonly failOnExtraKeys?: boolean;\n /** Forbid sharp-s (`\\u00df`) in German locales (`de`, `de-*`, default: `true`). */\n readonly forbidSharpSInGerman?: boolean;\n /** Report empty or whitespace-only values (default: `true`). */\n readonly failOnEmptyValues?: boolean;\n}\n\nexport interface I18nValidationResult {\n readonly ok: boolean;\n readonly sourceLocale: string;\n readonly localesChecked: readonly string[];\n readonly issues: readonly I18nValidationIssue[];\n}\n\nconst PLACEHOLDER_RE = /\\{\\{\\s*([a-zA-Z0-9_.-]+)\\s*\\}\\}|\\{\\s*([a-zA-Z0-9_.-]+)\\s*\\}/g;\nconst SHARP_S = \"\\u00df\";\n\n/**\n * Extracts all unique `{name}` and `{{name}}` placeholders from a translation string,\n * sorted lexicographically for deterministic comparison.\n */\nexport function extractPlaceholders(text: string): readonly string[] {\n const found = new Set<string>();\n for (const match of text.matchAll(PLACEHOLDER_RE)) {\n const name = match[1] ?? match[2];\n if (name) {\n found.add(name);\n }\n }\n return Array.from(found).sort();\n}\n\nfunction isGermanLocale(locale: string): boolean {\n const lower = locale.toLowerCase();\n return lower === \"de\" || lower.startsWith(\"de-\") || lower.startsWith(\"de_\");\n}\n\nfunction sameStringList(a: readonly string[], b: readonly string[]): boolean {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i += 1) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n}\n\n/**\n * Validates a map of locale catalogs (e.g. `{ en: {...}, de: {...} }`) against\n * the source locale catalog.\n */\nexport function validateI18nCatalogs(\n catalogs: I18nCatalogMap,\n options: I18nValidationOptions = {},\n): I18nValidationResult {\n const sourceLocale = options.sourceLocale ?? \"en\";\n const failOnExtraKeys = options.failOnExtraKeys ?? true;\n const forbidSharpSInGerman = options.forbidSharpSInGerman ?? true;\n const failOnEmptyValues = options.failOnEmptyValues ?? true;\n\n const issues: I18nValidationIssue[] = [];\n const localeNames = Object.keys(catalogs).sort();\n const source = catalogs[sourceLocale];\n\n if (!source) {\n issues.push({\n locale: sourceLocale,\n key: \"*\",\n kind: \"missing-source-locale\",\n message: `Source locale \"${sourceLocale}\" is missing from catalogs.`,\n });\n return {\n ok: false,\n sourceLocale,\n localesChecked: localeNames,\n issues,\n };\n }\n\n const sourceKeys = Object.keys(source).sort();\n\n // Check source catalog itself for empty values.\n if (failOnEmptyValues) {\n for (const key of sourceKeys) {\n const sourceValue = source[key];\n if (sourceValue !== undefined && sourceValue.trim().length === 0) {\n issues.push({\n locale: sourceLocale,\n key,\n kind: \"empty-value\",\n message: `Empty translation value in source locale \"${sourceLocale}\" for key \"${key}\".`,\n });\n }\n }\n }\n\n for (const locale of localeNames) {\n if (locale === sourceLocale) continue;\n const target = catalogs[locale];\n if (!target) continue;\n const targetKeys = Object.keys(target).sort();\n const checkSharpS = forbidSharpSInGerman && isGermanLocale(locale);\n\n for (const key of sourceKeys) {\n if (!Object.prototype.hasOwnProperty.call(target, key)) {\n issues.push({\n locale,\n key,\n kind: \"missing-key\",\n message: `Locale \"${locale}\" is missing key \"${key}\".`,\n });\n continue;\n }\n\n const sourceValue = source[key] ?? \"\";\n const value = target[key] ?? \"\";\n if (failOnEmptyValues && value.trim().length === 0) {\n issues.push({\n locale,\n key,\n kind: \"empty-value\",\n message: `Empty translation value in locale \"${locale}\" for key \"${key}\".`,\n });\n }\n\n const expectedPlaceholders = extractPlaceholders(sourceValue);\n const actualPlaceholders = extractPlaceholders(value);\n if (!sameStringList(expectedPlaceholders, actualPlaceholders)) {\n issues.push({\n locale,\n key,\n kind: \"placeholder-mismatch\",\n message: `Placeholder mismatch in \"${locale}.${key}\": expected [${expectedPlaceholders.join(\", \")}], got [${actualPlaceholders.join(\", \")}].`,\n });\n }\n\n if (checkSharpS && value.includes(SHARP_S)) {\n issues.push({\n locale,\n key,\n kind: \"sharp-s\",\n message: `Locale \"${locale}\" key \"${key}\" contains forbidden sharp-s; use \"ss\" instead.`,\n });\n }\n }\n\n if (failOnExtraKeys) {\n for (const key of targetKeys) {\n if (!Object.prototype.hasOwnProperty.call(source, key)) {\n issues.push({\n locale,\n key,\n kind: \"extra-key\",\n message: `Locale \"${locale}\" contains unknown key \"${key}\" not present in \"${sourceLocale}\".`,\n });\n }\n }\n }\n }\n\n return {\n ok: issues.length === 0,\n sourceLocale,\n localesChecked: localeNames,\n issues,\n };\n}\n\n/**\n * Formats an `I18nValidationResult` as a human-readable CI report.\n */\nexport function formatI18nValidationReport(result: I18nValidationResult): string {\n if (result.ok) {\n return `i18n ok (${result.localesChecked.length} locales checked against \"${result.sourceLocale}\").`;\n }\n const lines = [\n `i18n validation failed (${result.issues.length} issue${result.issues.length === 1 ? \"\" : \"s\"}):`,\n ...result.issues.map((issue) => ` - [${issue.locale}] (${issue.kind}) ${issue.message}`),\n ];\n return lines.join(\"\\n\");\n}\n","/**\n * @scalio-cloud/ui/config — Shared build, styling and lint configuration helpers\n * for Scalio frontend apps (ADR 0151).\n */\n\nexport interface ScalioPostcssConfig {\n readonly plugins: {\n readonly tailwindcss: Record<string, never>;\n readonly autoprefixer: Record<string, never>;\n };\n}\n\n/**\n * Standard PostCSS configuration used across Scalio Tailwind 3 frontends.\n */\nexport function createPostcssConfig(): ScalioPostcssConfig {\n return {\n plugins: {\n tailwindcss: {},\n autoprefixer: {},\n },\n };\n}\n\nexport interface CreateEslintConfigOptions {\n readonly js: { readonly configs: { readonly recommended: Record<string, unknown> } };\n readonly globals: {\n readonly browser: Record<string, unknown>;\n readonly node: Record<string, unknown>;\n readonly vitest?: Record<string, unknown>;\n };\n readonly reactPlugin: unknown;\n readonly reactHooks: unknown;\n readonly ignores?: readonly string[];\n readonly rules?: Readonly<Record<string, unknown>>;\n}\n\n/**\n * Standard flat ESLint configuration shared across Scalio React frontends.\n */\nexport function createEslintConfig(options: CreateEslintConfigOptions): readonly Record<string, unknown>[] {\n const { js, globals, reactPlugin, reactHooks, ignores = [], rules = {} } = options;\n return [\n {\n ignores: [\"build/**\", \"dist/**\", \"node_modules/**\", \"src/vendor/**\", \"**/*.d.ts\", ...ignores],\n },\n js.configs.recommended,\n {\n files: [\"**/*.{js,jsx,cjs,mjs}\"],\n linterOptions: {\n reportUnusedDisableDirectives: false,\n },\n languageOptions: {\n ecmaVersion: 2022,\n sourceType: \"module\",\n parserOptions: {\n ecmaFeatures: { jsx: true },\n },\n globals: {\n ...globals.browser,\n ...globals.node,\n ...(globals.vitest ?? {}),\n },\n },\n plugins: {\n react: reactPlugin,\n \"react-hooks\": reactHooks,\n },\n settings: {\n react: { version: \"detect\" },\n },\n rules: {\n \"no-unused-vars\": \"off\",\n \"no-undef\": \"off\",\n \"react/prop-types\": \"off\",\n \"react/react-in-jsx-scope\": \"off\",\n \"no-empty\": \"off\",\n \"no-constant-condition\": \"off\",\n \"no-useless-escape\": \"off\",\n \"no-prototype-builtins\": \"off\",\n ...rules,\n },\n },\n ];\n}\n\nexport {\n DEFAULT_OPENAPI_TYPEGEN_CONFIG,\n createOpenApiTypegenConfig,\n buildOpenApiTypegenArgs,\n type OpenApiTypegenConfig,\n type OpenApiTypegenOverrides,\n} from \"./openapi.js\";\n\nexport {\n extractPlaceholders,\n validateI18nCatalogs,\n formatI18nValidationReport,\n type I18nCatalog,\n type I18nCatalogMap,\n type I18nIssueKind,\n type I18nValidationIssue,\n type I18nValidationOptions,\n type I18nValidationResult,\n} from \"./i18nCheck.js\";\n"],"mappings":";AAwBO,IAAM,iCAAuD;AAAA,EAClE,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,qBAAqB;AACvB;AAKO,SAAS,2BACd,YAAqC,CAAC,GAChB;AACtB,SAAO;AAAA,IACL,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AACF;AAQO,SAAS,wBACd,SAAkC,CAAC,GAChB;AACnB,QAAM,WAAW,2BAA2B,MAAM;AAClD,QAAM,OAAiB,CAAC,SAAS,OAAO,MAAM,SAAS,MAAM;AAE7D,MAAI,SAAS,gBAAgB;AAC3B,SAAK,KAAK,aAAa;AAAA,EACzB;AACA,MAAI,SAAS,YAAY;AACvB,SAAK,KAAK,eAAe;AAAA,EAC3B;AACA,MAAI,SAAS,aAAa;AACxB,SAAK,KAAK,eAAe;AAAA,EAC3B;AACA,MAAI,SAAS,qBAAqB;AAChC,SAAK,KAAK,yBAAyB;AAAA,EACrC;AAEA,SAAO;AACT;;;ACzBA,IAAM,iBAAiB;AACvB,IAAM,UAAU;AAMT,SAAS,oBAAoB,MAAiC;AACnE,QAAM,QAAQ,oBAAI,IAAY;AAC9B,aAAW,SAAS,KAAK,SAAS,cAAc,GAAG;AACjD,UAAM,OAAO,MAAM,CAAC,KAAK,MAAM,CAAC;AAChC,QAAI,MAAM;AACR,YAAM,IAAI,IAAI;AAAA,IAChB;AAAA,EACF;AACA,SAAO,MAAM,KAAK,KAAK,EAAE,KAAK;AAChC;AAEA,SAAS,eAAe,QAAyB;AAC/C,QAAM,QAAQ,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SAAS;AAAA,UACP,GAAG,QAAQ;AAAA,UACX,GAAG,QAAQ;AAAA,UACX,GAAI,QAAQ,UAAU,CAAC;AAAA,QACzB;AAAA,MACF;AAAA,MACA,SAAS;AAAA,QACP,OAAO;AAAA,QACP,eAAe;AAAA,MACjB;AAAA,MACA,UAAU;AAAA,QACR,OAAO,EAAE,SAAS,SAAS;AAAA,MAC7B;AAAA,MACA,OAAO;AAAA,QACL,kBAAkB;AAAA,QAClB,YAAY;AAAA,QACZ,oBAAoB;AAAA,QACpB,4BAA4B;AAAA,QAC5B,YAAY;AAAA,QACZ,yBAAyB;AAAA,QACzB,qBAAqB;AAAA,QACrB,yBAAyB;AAAA,QACzB,GAAG;AAAA,MACL;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Standard OpenAPI-to-TypeScript generation configuration for Scalio frontends.
3
+ *
4
+ * Consumes the `openapi.json` exported by each Rust backend (`utoipa`) and produces
5
+ * deterministic, readonly TypeScript definitions via `openapi-typescript`.
6
+ */
7
+ export interface OpenApiTypegenConfig {
8
+ /** Path to the OpenAPI 3.x specification file (default: `"../openapi.json"`). */
9
+ readonly input: string;
10
+ /** Output path for the generated `.d.ts` file (default: `"src/api/schema.d.ts"`). */
11
+ readonly output: string;
12
+ /** Emit `readonly` properties on generated object types (default: `true`). */
13
+ readonly immutableTypes: boolean;
14
+ /** Prefer `type` aliases over `interface` declarations (default: `true`). */
15
+ readonly exportType: boolean;
16
+ /** Sort generated keys alphabetically for minimal diffs (default: `true`). */
17
+ readonly alphabetize: boolean;
18
+ /** Emit `Record<string, unknown>` instead of `Record<string, never>` for open objects (default: `true`). */
19
+ readonly emptyObjectsUnknown: boolean;
20
+ }
21
+ export type OpenApiTypegenOverrides = Partial<OpenApiTypegenConfig>;
22
+ export declare const DEFAULT_OPENAPI_TYPEGEN_CONFIG: OpenApiTypegenConfig;
23
+ /**
24
+ * Returns the standard OpenAPI type generation configuration merged with optional overrides.
25
+ */
26
+ export declare function createOpenApiTypegenConfig(overrides?: OpenApiTypegenOverrides): OpenApiTypegenConfig;
27
+ /**
28
+ * Builds the CLI argument list for `openapi-typescript` from a configuration object.
29
+ *
30
+ * Example usage in an app script:
31
+ * `npx openapi-typescript ...buildOpenApiTypegenArgs()`
32
+ */
33
+ export declare function buildOpenApiTypegenArgs(config?: OpenApiTypegenOverrides): readonly string[];
34
+ //# sourceMappingURL=openapi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/config/openapi.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,oBAAoB;IACnC,iFAAiF;IACjF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,6EAA6E;IAC7E,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,4GAA4G;IAC5G,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;CACvC;AAED,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AAEpE,eAAO,MAAM,8BAA8B,EAAE,oBAO5C,CAAC;AAEF;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,GAAE,uBAA4B,GACtC,oBAAoB,CAKtB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,GAAE,uBAA4B,GACnC,SAAS,MAAM,EAAE,CAkBnB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Sanitizes a post-login redirect target so only same-origin relative paths are accepted.
3
+ * Rejects protocol-relative URLs (`//evil.com`), external schemes, and auth-loop paths.
4
+ */
5
+ export declare function resolveAfterLogin(candidate: string | null | undefined, fallback?: string, blockedPrefixes?: readonly string[]): string;
6
+ //# sourceMappingURL=afterLogin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"afterLogin.d.ts","sourceRoot":"","sources":["../../src/core/afterLogin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,QAAQ,SAAM,EACd,eAAe,GAAE,SAAS,MAAM,EAA0B,GACzD,MAAM,CAQR"}
@@ -0,0 +1,48 @@
1
+ import { type AxiosError, type AxiosInstance } from "axios";
2
+ export interface ScalioApiErrorDetail {
3
+ readonly code?: string;
4
+ readonly message?: string;
5
+ readonly msg?: string;
6
+ readonly limit?: number;
7
+ readonly kind?: string;
8
+ readonly feature?: string;
9
+ }
10
+ export interface ScalioAxiosError<T = unknown> extends AxiosError<T> {
11
+ licenseShown?: boolean;
12
+ }
13
+ export type TranslateFn = (key: string, vars?: Record<string, string | number>) => string;
14
+ export interface CreateScalioApiOptions {
15
+ /** Base URL for API calls (e.g. `${import.meta.env.VITE_BACKEND_URL || ""}/api`). */
16
+ readonly baseURL: string;
17
+ /** Translation function for error and license messages. Defaults to identity with `{var}` interpolation. */
18
+ readonly tx?: TranslateFn;
19
+ /** App-specific license kind labels (English source strings, translated via `tx`). */
20
+ readonly licenseKinds?: Readonly<Record<string, string>>;
21
+ /** App-specific license feature labels (English source strings, translated via `tx`). */
22
+ readonly licenseFeatures?: Readonly<Record<string, string>>;
23
+ /** Optional custom message for `license_limited` (402/423). */
24
+ readonly limitedMessage?: string;
25
+ /** Optional map of domain-specific error codes (e.g. `agent_blocked`, `agent_unknown`) to messages. */
26
+ readonly errorCodeMessages?: Readonly<Record<string, string>>;
27
+ /** Toast/notification callback for automatic license errors. */
28
+ readonly onToastError?: (message: string) => void;
29
+ /** Called when the backend answers 423 with `detail === "maintenance"`. Defaults to dispatching `scalio-maintenance`. */
30
+ readonly onMaintenance?: () => void;
31
+ /** Optional callback for 401 responses. */
32
+ readonly onUnauthorized?: (error: ScalioAxiosError) => void;
33
+ /** Whether to send credentials (HttpOnly session cookies). Defaults to `true`. */
34
+ readonly withCredentials?: boolean;
35
+ }
36
+ export interface ScalioApiBundle {
37
+ readonly API: string;
38
+ readonly api: AxiosInstance;
39
+ readonly licenseKindLabel: (kind: string) => string;
40
+ readonly licenseFeatureLabel: (feature: string) => string;
41
+ readonly formatApiErrorDetail: (detail: unknown) => string;
42
+ }
43
+ /**
44
+ * Creates a standardized Axios client with Scalio license error formatting,
45
+ * automatic 402/423 license toast handling and 423 maintenance event dispatching (ADR 0151 fe/F5).
46
+ */
47
+ export declare function createScalioApi(options: CreateScalioApiOptions): ScalioApiBundle;
48
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/core/api.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAEnE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,OAAO,CAAE,SAAQ,UAAU,CAAC,CAAC,CAAC;IAClE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,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,MAAM,CAAC;CAC5D;AAWD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAsGhF"}
@@ -0,0 +1,17 @@
1
+ import type { ScalioLang } from "./i18n.js";
2
+ export type AuditActionTuple = readonly [de: string, en: string];
3
+ export type AuditActionMap = Readonly<Record<string, AuditActionTuple>>;
4
+ /**
5
+ * Shared platform audit actions (backend protocol.py, ADR 0070).
6
+ * German strings strictly use Swiss spelling ("ss").
7
+ */
8
+ export declare const BASE_AUDIT_ACTIONS: AuditActionMap;
9
+ export interface AuditActionsBundle {
10
+ readonly ACTIONS: AuditActionMap;
11
+ readonly actionLabel: (key: string, lang?: ScalioLang | string) => string;
12
+ }
13
+ /**
14
+ * Merges app-specific audit actions on top of `BASE_AUDIT_ACTIONS`.
15
+ */
16
+ export declare function createAuditActions(extra?: AuditActionMap): AuditActionsBundle;
17
+ //# sourceMappingURL=auditActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auditActions.d.ts","sourceRoot":"","sources":["../../src/core/auditActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;AACjE,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,cAsChC,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,KAAK,MAAM,CAAC;CAC3E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,GAAE,cAAmB,GAAG,kBAAkB,CAOjF"}
@@ -0,0 +1,18 @@
1
+ export type DateInput = string | number | Date | null | undefined;
2
+ export interface FormatDateOptions extends Intl.DateTimeFormatOptions {
3
+ /** Override locale (defaults to `en-GB` when `<html lang="en">`, otherwise `de-CH`). */
4
+ readonly locale?: string;
5
+ }
6
+ /**
7
+ * Parses a date input, treating naive ISO strings (without offset) as UTC.
8
+ */
9
+ export declare function toUtcDate(value: string | number | Date): Date;
10
+ /**
11
+ * Formats a date/time value using the active locale and optional IANA timezone.
12
+ */
13
+ export declare function fmtDateTime(value: DateInput, options?: FormatDateOptions, timeZone?: string): string;
14
+ /**
15
+ * Formats a date-only value using the active locale and optional IANA timezone.
16
+ */
17
+ export declare function fmtDate(value: DateInput, timeZone?: string, locale?: string): string;
18
+ //# sourceMappingURL=datetime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"datetime.d.ts","sourceRoot":"","sources":["../../src/core/datetime.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;AAElE,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,qBAAqB;IACnE,wFAAwF;IACxF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AASD;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAK7D;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,SAAS,EAChB,OAAO,GAAE,iBAA+D,EACxE,QAAQ,CAAC,EAAE,MAAM,GAChB,MAAM,CASR;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAQpF"}
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+ export type ScalioLang = "en" | "de";
3
+ export declare const LANGS: readonly ScalioLang[];
4
+ /**
5
+ * Identity marker for translatable strings (compatible with i18n extraction tools).
6
+ */
7
+ export declare function N_<T extends string>(text: T): T;
8
+ /**
9
+ * Shared German base dictionary for cross-app Scalio platform strings (Swiss spelling: always "ss").
10
+ * English is the source language (key = English text, ADR 0150 rust/R13 & ADR 0151 fe/F6).
11
+ */
12
+ export declare const BASE_DE: Readonly<Record<string, string>>;
13
+ export declare const STATUS_DE: Readonly<Record<string, string>>;
14
+ export interface I18nContextValue {
15
+ readonly lang: ScalioLang;
16
+ readonly setLang: (lang: ScalioLang | string) => void;
17
+ readonly adoptProfileLang: (lang: string | null | undefined) => void;
18
+ readonly t: (key: string, vars?: Record<string, string | number>) => string;
19
+ }
20
+ export interface CreateScalioI18nOptions {
21
+ /** App-specific German overrides/additions merged on top of `BASE_DE`. */
22
+ readonly de?: Readonly<Record<string, string>>;
23
+ /** localStorage key for persisting language choice (e.g. `"atrium_lang"`). */
24
+ readonly storeKey: string;
25
+ /** Default language when browser detection is unavailable. Defaults to `"en"` (ADR 0150 rust/R13). */
26
+ readonly defaultLang?: ScalioLang;
27
+ }
28
+ export interface ScalioI18nBundle {
29
+ readonly DICT: {
30
+ readonly de: Readonly<Record<string, string>>;
31
+ };
32
+ readonly LANGS: readonly ScalioLang[];
33
+ readonly setCurrentLang: (lang: string) => void;
34
+ readonly currentLang: () => ScalioLang;
35
+ readonly locale: () => "de-CH" | "en-GB";
36
+ readonly translate: (lang: string, key: string, vars?: Record<string, string | number>) => string;
37
+ readonly tx: (key: string, vars?: Record<string, string | number>) => string;
38
+ readonly N_: typeof N_;
39
+ readonly STATUS_DE: Readonly<Record<string, string>>;
40
+ readonly statusLabel: (lang: string, status: string) => string;
41
+ readonly I18nProvider: React.FC<{
42
+ children?: React.ReactNode;
43
+ }>;
44
+ readonly useI18n: () => I18nContextValue;
45
+ readonly useT: () => I18nContextValue["t"];
46
+ }
47
+ /**
48
+ * Creates a complete i18n module + React Context/Provider merging app texts with `BASE_DE` (ADR 0151 fe/F6).
49
+ */
50
+ export declare function createScalioI18n(options: CreateScalioI18nOptions): ScalioI18nBundle;
51
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/core/i18n.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+E,MAAM,OAAO,CAAC;AAEpG,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC,eAAO,MAAM,KAAK,EAAE,SAAS,UAAU,EAA0B,CAAC;AAElE;;GAEG;AACH,wBAAgB,EAAE,CAAC,CAAC,SAAS,MAAM,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAE/C;AAED;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAqEpD,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOtD,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;IACrE,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;CAC7E;AAED,MAAM,WAAW,uBAAuB;IACtC,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;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,OAAO,EAAE,MAAM,gBAAgB,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,gBAAgB,CAAC,GAAG,CAAC,CAAC;CAC5C;AAOD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,CAgHnF"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @scalio-cloud/ui/core — TypeScript-First core utilities, API client factory,
3
+ * i18n engine and shared helpers for all Scalio frontend apps (ADR 0151).
4
+ */
5
+ export { createScalioApi, type CreateScalioApiOptions, type ScalioApiBundle, type ScalioApiErrorDetail, type ScalioAxiosError, type TranslateFn, } from "./api.js";
6
+ export { BASE_DE, LANGS, N_, STATUS_DE, createScalioI18n, type CreateScalioI18nOptions, type I18nContextValue, type ScalioI18nBundle, type ScalioLang, } from "./i18n.js";
7
+ export { fmtDate, fmtDateTime, toUtcDate, type DateInput, type FormatDateOptions } from "./datetime.js";
8
+ export { can, type ScalioUserLike } from "./permissions.js";
9
+ export { mailReady, type MailSettingsLike } from "./mailReady.js";
10
+ export { createPasskeyClient, passkeyCancelled, type CreatePasskeyClientOptions, type PasskeyApiClient, type PasskeyClient, type PasskeyOptionsResponse, } from "./passkeys.js";
11
+ export { createLegalUrlLoader, type LegalApiClient, type LegalUrlLoader } from "./legal.js";
12
+ export { BASE_AUDIT_ACTIONS, createAuditActions, type AuditActionMap, type AuditActionTuple, type AuditActionsBundle, } from "./auditActions.js";
13
+ export { resolveAfterLogin } from "./afterLogin.js";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,WAAW,GACjB,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,OAAO,EACP,KAAK,EACL,EAAE,EACF,SAAS,EACT,gBAAgB,EAChB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GAChB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACxG,OAAO,EAAE,GAAG,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,KAAK,0BAA0B,EAC/B,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,sBAAsB,GAC5B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}