libmodulor 0.23.0 → 0.25.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 (132) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +154 -2
  3. package/dist/esm/apps/Helper/src/lib/project.js +6 -6
  4. package/dist/esm/apps/Helper/src/ucds/TestAppUCD.d.ts +2 -1
  5. package/dist/esm/apps/Helper/src/ucds/TestAppUCD.js +8 -0
  6. package/dist/esm/convention.d.ts +3 -0
  7. package/dist/esm/convention.js +3 -0
  8. package/dist/esm/dt/DataTypes.d.ts +1 -2
  9. package/dist/esm/dt/Validation.d.ts +2 -2
  10. package/dist/esm/dt/base/TBase.d.ts +2 -0
  11. package/dist/esm/dt/base/TBase.js +3 -0
  12. package/dist/esm/dt/base/TObject.d.ts +6 -4
  13. package/dist/esm/dt/base/TObject.js +5 -6
  14. package/dist/esm/dt/base/TString.d.ts +2 -1
  15. package/dist/esm/dt/base/TString.js +22 -0
  16. package/dist/esm/dt/final/TFile.d.ts +13 -4
  17. package/dist/esm/dt/final/TFile.js +70 -8
  18. package/dist/esm/dt/final/TFileExtension.d.ts +1 -1
  19. package/dist/esm/dt/final/TFileMimeType.d.ts +2 -6
  20. package/dist/esm/dt/final/TFileMimeType.js +0 -6
  21. package/dist/esm/dt/final/TFilePath.d.ts +7 -0
  22. package/dist/esm/dt/final/TFilePath.js +5 -1
  23. package/dist/esm/dt/index.d.ts +1 -1
  24. package/dist/esm/i18n/WordingManager.d.ts +2 -1
  25. package/dist/esm/i18n/WordingManager.js +23 -2
  26. package/dist/esm/i18n/index.d.ts +1 -1
  27. package/dist/esm/i18n/locales/de.d.ts +2 -0
  28. package/dist/esm/i18n/locales/de.js +62 -0
  29. package/dist/esm/i18n/locales/en.js +8 -0
  30. package/dist/esm/i18n/locales/es.d.ts +2 -0
  31. package/dist/esm/i18n/locales/es.js +62 -0
  32. package/dist/esm/i18n/locales/fr.js +8 -0
  33. package/dist/esm/i18n/types.d.ts +5 -4
  34. package/dist/esm/index.babel.d.ts +1 -0
  35. package/dist/esm/index.babel.js +1 -0
  36. package/dist/esm/index.node-stricli-cli.d.ts +2 -0
  37. package/dist/esm/index.node-stricli-cli.js +2 -0
  38. package/dist/esm/index.vite.d.ts +1 -1
  39. package/dist/esm/index.vite.js +1 -1
  40. package/dist/esm/index.webpack.d.ts +1 -0
  41. package/dist/esm/index.webpack.js +1 -0
  42. package/dist/esm/std/FSManager.d.ts +7 -5
  43. package/dist/esm/std/FSManager.js +5 -6
  44. package/dist/esm/std/FormDataBuilder.d.ts +2 -1
  45. package/dist/esm/std/I18nManager.d.ts +12 -0
  46. package/dist/esm/std/impl/NodeFSManager.js +4 -3
  47. package/dist/esm/std/impl/SimpleMapI18nManager.d.ts +6 -1
  48. package/dist/esm/std/impl/SimpleMapI18nManager.js +41 -12
  49. package/dist/esm/target/lib/react/StyleContextProvider.d.ts +1 -0
  50. package/dist/esm/target/lib/react/form.d.ts +1 -1
  51. package/dist/esm/target/lib/react/form.js +1 -0
  52. package/dist/esm/target/lib/react/useAction.d.ts +1 -1
  53. package/dist/esm/target/lib/react/useAction.js +13 -12
  54. package/dist/esm/target/lib/server/AuthenticationChecker.js +1 -1
  55. package/dist/esm/target/lib/server/PublicApiKeyChecker.js +1 -1
  56. package/dist/esm/target/lib/server/ServerRequestHandler.js +2 -2
  57. package/dist/esm/target/lib/server-express/funcs.js +4 -3
  58. package/dist/esm/target/lib/server-hono/funcs.js +2 -2
  59. package/dist/esm/target/lib/server-node/funcs.js +1 -1
  60. package/dist/esm/target/lib/web/input.d.ts +1 -0
  61. package/dist/esm/target/lib/web/input.js +5 -1
  62. package/dist/esm/target/node-stricli-cli/NodeStricliCLIManager.d.ts +12 -0
  63. package/dist/esm/target/node-stricli-cli/NodeStricliCLIManager.js +118 -0
  64. package/dist/esm/target/react-native-pure/UCFormField.js +2 -1
  65. package/dist/esm/target/react-native-pure/UCFormFieldControl.js +6 -4
  66. package/dist/esm/target/react-native-pure/UCFormFieldErr.d.ts +1 -1
  67. package/dist/esm/target/react-native-pure/UCFormFieldErr.js +4 -1
  68. package/dist/esm/target/react-native-pure/UCFormFieldHelp.d.ts +4 -0
  69. package/dist/esm/target/react-native-pure/UCFormFieldHelp.js +15 -0
  70. package/dist/esm/target/react-web-pure/UCFormField.js +2 -1
  71. package/dist/esm/target/react-web-pure/UCFormFieldErr.d.ts +1 -1
  72. package/dist/esm/target/react-web-pure/UCFormFieldErr.js +4 -1
  73. package/dist/esm/target/react-web-pure/UCFormFieldHelp.d.ts +4 -0
  74. package/dist/esm/target/react-web-pure/UCFormFieldHelp.js +14 -0
  75. package/dist/esm/testing/AppTester.js +4 -5
  76. package/dist/esm/testing/UCDefASTParser.d.ts +24 -6
  77. package/dist/esm/testing/impl/SimpleAppDocsEmitter/SimpleAppDocsEmitter.d.ts +7 -0
  78. package/dist/esm/testing/impl/SimpleAppDocsEmitter/SimpleAppDocsEmitter.js +59 -0
  79. package/dist/esm/testing/impl/SimpleAppDocsEmitter/markdown.d.ts +2 -0
  80. package/dist/esm/testing/impl/SimpleAppDocsEmitter/markdown.js +10 -0
  81. package/dist/esm/testing/impl/SimpleAppDocsEmitter/sequence-diagram.d.ts +2 -0
  82. package/dist/esm/testing/impl/SimpleAppDocsEmitter/sequence-diagram.js +92 -0
  83. package/dist/esm/testing/impl/SimpleAppDocsEmitter/tech-summary.d.ts +2 -0
  84. package/dist/esm/testing/impl/SimpleAppDocsEmitter/tech-summary.js +27 -0
  85. package/dist/esm/testing/impl/SimpleAppDocsEmitter/uc-summary.d.ts +2 -0
  86. package/dist/esm/testing/impl/SimpleAppDocsEmitter/uc-summary.js +63 -0
  87. package/dist/esm/testing/impl/SimpleAppDocsEmitter.js +4 -5
  88. package/dist/esm/testing/impl/TypeScriptLibUCDefASTParser.js +38 -11
  89. package/dist/esm/testing/impl/VitestAppTestSuiteRunner.d.ts +1 -1
  90. package/dist/esm/testing/impl/VitestAppTestSuiteRunner.js +17 -2
  91. package/dist/esm/testing/impl/newNodeAppTester.js +1 -1
  92. package/dist/esm/testing/opts.js +1 -1
  93. package/dist/esm/testing/uc-input.js +5 -2
  94. package/dist/esm/testing/workers/AppTestSuiteRunner.d.ts +2 -0
  95. package/dist/esm/testing/workers/UCExecutor.js +1 -1
  96. package/dist/esm/testing/workers/checkers/AppI18nChecker.d.ts +8 -2
  97. package/dist/esm/testing/workers/checkers/AppI18nChecker.js +44 -2
  98. package/dist/esm/testing/workers/checkers/UCDefSourcesChecker.js +12 -12
  99. package/dist/esm/uc/exec.d.ts +42 -21
  100. package/dist/esm/uc/exec.js +48 -13
  101. package/dist/esm/uc/impl/HTTPUCTransporter.js +2 -2
  102. package/dist/esm/uc/impl/KnexUCDataStore.js +2 -2
  103. package/dist/esm/uc/index.d.ts +0 -1
  104. package/dist/esm/uc/index.js +0 -1
  105. package/dist/esm/uc/input-field.d.ts +6 -4
  106. package/dist/esm/uc/input-field.js +4 -5
  107. package/dist/esm/uc/side-effect.d.ts +10 -8
  108. package/dist/esm/uc/side-effect.js +5 -6
  109. package/dist/esm/uc/workers/UCExecChecker.js +1 -1
  110. package/dist/esm/uc/workers/UCInputFilesProcessor.js +3 -3
  111. package/dist/esm/uc/workers/UCInputValidator.js +2 -1
  112. package/dist/esm/uc/workers/UCOutputFilesProcessor.js +1 -1
  113. package/dist/esm/utils/bundling/babel/plugin.d.ts +2 -0
  114. package/dist/esm/utils/bundling/babel/plugin.js +38 -0
  115. package/dist/esm/utils/bundling/funcs.d.ts +6 -0
  116. package/dist/esm/utils/bundling/funcs.js +20 -0
  117. package/dist/esm/utils/bundling/typescript.d.ts +3 -0
  118. package/dist/esm/utils/bundling/typescript.js +61 -0
  119. package/dist/esm/utils/bundling/vite/plugin.d.ts +6 -0
  120. package/dist/esm/utils/bundling/vite/plugin.js +17 -0
  121. package/dist/esm/utils/bundling/webpack/loader.d.ts +2 -0
  122. package/dist/esm/utils/bundling/webpack/loader.js +12 -0
  123. package/dist/esm/utils/http/HTTPRequestBuilder.js +1 -1
  124. package/dist/esm/utils/index.d.ts +1 -1
  125. package/dist/esm/utils/ioc/bindCommon.js +1 -1
  126. package/dist/esm/utils/terminal/fmt.js +1 -1
  127. package/dist/esm/utils/types/utility-types.d.ts +4 -0
  128. package/package.json +36 -12
  129. package/pnpm-workspace.yaml +1 -4
  130. package/tsconfig.build.examples.json +8 -0
  131. package/tsconfig.json +1 -0
  132. package/vitest.config.ts +16 -0
@@ -1,7 +1,14 @@
1
1
  import type { TName } from '../base/TBase.js';
2
2
  import { TString, type TStringConstraints } from '../base/TString.js';
3
+ import type { FileMimeType } from './TFileMimeType.js';
4
+ import type { FileName } from './TFileName.js';
5
+ import type { UIntQuantity } from './TUIntQuantity.js';
3
6
  export type FilePath = string;
4
7
  export declare class TFilePath extends TString<FilePath> {
8
+ static readonly ABS_PATH: FilePath;
9
+ static readonly FILE_NAME: FileName;
10
+ static readonly FILE_SIZE: UIntQuantity;
11
+ static readonly MIME_TYPE: FileMimeType;
5
12
  static readonly FORMAT: RegExp;
6
13
  constructor(constraints?: TStringConstraints);
7
14
  tName(): TName;
@@ -1,5 +1,9 @@
1
1
  import { TString } from '../base/TString.js';
2
2
  export class TFilePath extends TString {
3
+ static ABS_PATH = '/Users/dexter/Desktop';
4
+ static FILE_NAME = 'picture.png';
5
+ static FILE_SIZE = 32;
6
+ static MIME_TYPE = 'image/png';
3
7
  static FORMAT = /^[a-z0-9_/.][a-z0-9-_/.]+/i;
4
8
  constructor(constraints) {
5
9
  super({
@@ -11,6 +15,6 @@ export class TFilePath extends TString {
11
15
  return 'FilePath';
12
16
  }
13
17
  example() {
14
- return '/Users/dexter/Desktop/picture.png';
18
+ return `${TFilePath.ABS_PATH}/${TFilePath.FILE_NAME}`;
15
19
  }
16
20
  }
@@ -27,7 +27,7 @@ export { type Emoji, TEmoji } from './final/TEmoji.js';
27
27
  export { type EncryptionKey, TEncryptionKey } from './final/TEncryptionKey.js';
28
28
  export { type ErrorMessage, TErrorMessage } from './final/TErrorMessage.js';
29
29
  export { type ExternalServiceId, TExternalServiceId, } from './final/TExternalServiceId.js';
30
- export { type File, TFile } from './final/TFile.js';
30
+ export { type File, TFile, type TFileConstraints } from './final/TFile.js';
31
31
  export { type FileExtension, TFileExtension } from './final/TFileExtension.js';
32
32
  export { type FileMimeType, TFileMimeType } from './final/TFileMimeType.js';
33
33
  export { type FileName, TFileName } from './final/TFileName.js';
@@ -18,11 +18,12 @@ import type { UCClientConfirmConfig, UCDef, UCExecState, UCFieldKey, UCInput, UC
18
18
  * One might argue that a label can be different for "name" in "CreateX" and "CreateY".
19
19
  * In this case, we consider that the input field shouldn't be named "name" in both places.
20
20
  */
21
- export type WordingManagerKey = `dt_${TName}_${string}_${keyof UCWording}` | `p_${keyof ProductWording}` | `uc_${UCName}_${keyof UCWording}` | `uc_${UCName}_client_confirm_${keyof UCClientConfirmConfig}` | `uc_${UCName}_i_submit_${UCExecState}` | `uc_${UCName}_op_${UCOutputPartIdx}_${keyof UCOutputPartWording}` | `ucif_${UCFieldKey}_${keyof UCWording}` | `ucof_${UCFieldKey}_${keyof UCWording}`;
21
+ export type WordingManagerKey = `dt_${TName}_constr_${string}` | `dt_${TName}_${string}_${keyof UCWording}` | `p_${keyof ProductWording}` | `uc_${UCName}_${keyof UCWording}` | `uc_${UCName}_client_confirm_${keyof UCClientConfirmConfig}` | `uc_${UCName}_i_submit_${UCExecState}` | `uc_${UCName}_op_${UCOutputPartIdx}_${keyof UCOutputPartWording}` | `ucif_${UCFieldKey}_${keyof UCWording}` | `ucof_${UCFieldKey}_${keyof UCWording}`;
22
22
  export declare class WordingManager {
23
23
  private i18nManager;
24
24
  constructor(i18nManager: I18nManager);
25
25
  dt<DT extends DataType>(type: TBase<DT>): UCWording;
26
+ dtConstr<DT extends DataType>(type: TBase<DT>): string[] | null;
26
27
  p(): ProductWording;
27
28
  uc<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined>(def: UCDef<I, OPI0, OPI1>): UCWording;
28
29
  ucClientConfirm<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined>(def: UCDef<I, OPI0, OPI1>): UCClientConfirmConfig;
@@ -39,6 +39,24 @@ let WordingManager = class WordingManager {
39
39
  }
40
40
  return { desc, label };
41
41
  }
42
+ dtConstr(type) {
43
+ const constraints = type.getConstraintsForHuman();
44
+ if (!constraints) {
45
+ return null;
46
+ }
47
+ const entries = Object.entries(constraints);
48
+ if (entries.length === 0) {
49
+ return null;
50
+ }
51
+ const parts = [];
52
+ for (const [k, v] of Object.entries(constraints)) {
53
+ parts.push(
54
+ // TODO : Consider moving up the type hierarchy to fetch the constr of the parent when missing
55
+ // e.g. TFreeTextShort > TString
56
+ this.t(`dt_${type.tName()}_constr_${k}`, undefined, v));
57
+ }
58
+ return parts;
59
+ }
42
60
  p() {
43
61
  return {
44
62
  desc: this.tOrNull('p_desc'),
@@ -87,8 +105,11 @@ let WordingManager = class WordingManager {
87
105
  label: this.tOrNull(`uc_${name}_op_${idx}_label`),
88
106
  };
89
107
  }
90
- t(key, fallback = undefined) {
91
- return this.i18nManager.t(key, { fallback });
108
+ t(key, fallback = undefined, expected = undefined) {
109
+ return this.i18nManager.t(key, {
110
+ fallback,
111
+ vars: expected ? { expected } : {},
112
+ });
92
113
  }
93
114
  tOr(key, fallbackKey) {
94
115
  let val = this.tOrNull(key);
@@ -1,3 +1,3 @@
1
1
  export { I18N_DEFAULT_LANG } from './consts.js';
2
- export type { I18n, I18nCoreKey, I18nCoreTranslations, I18nLanguageCode, I18nSource, I18nSourceSafe, I18nTranslation, I18nTranslationKey, } from './types.js';
2
+ export type { I18n, I18nCoreKey, I18nCoreTranslations, I18nEntry, I18nLanguageCode, I18nSource, I18nSourceSafe, I18nTranslation, I18nTranslationKey, } from './types.js';
3
3
  export { WordingManager, type WordingManagerKey } from './WordingManager.js';
@@ -0,0 +1,2 @@
1
+ import type { I18nCoreTranslations } from '../types.js';
2
+ export declare const I18nDE: I18nCoreTranslations;
@@ -0,0 +1,62 @@
1
+ export const I18nDE = {
2
+ dt_File_constr_accept: 'Akzeptierte Typen: {{expected}}',
3
+ dt_File_constr_maxSizeInBytes: 'Maximale Größe: {{expected}}',
4
+ dt_File_constr_minSizeInBytes: 'Minimale Größe: {{expected}}',
5
+ dt_FreeTextShort_constr_format: 'Format: {{expected}}',
6
+ dt_FreeTextShort_constr_maxLength: 'Maximale Länge: {{expected}}',
7
+ dt_FreeTextShort_constr_minLength: 'Minimale Länge: {{expected}}',
8
+ dt_YesNo_N_desc: '',
9
+ dt_YesNo_N_label: 'Nein',
10
+ dt_YesNo_Y_desc: '',
11
+ dt_YesNo_Y_label: 'Ja',
12
+ uc_client_confirm_cancel: 'Abbrechen',
13
+ uc_client_confirm_confirm: 'Ja',
14
+ uc_client_confirm_message: '',
15
+ uc_client_confirm_title: 'Sind Sie sicher?',
16
+ uc_i_submit_changing: 'Laden',
17
+ uc_i_submit_idle: 'Speichern',
18
+ uc_i_submit_initializing: 'Laden',
19
+ uc_i_submit_submitting: 'Speichern',
20
+ validation_fieldsOr: 'Mindestens eines dieser Felder muss ausgefüllt werden: {{expected}}',
21
+ validation_format_ColorRGBA: 'Muss eine gültige RGBA-Farbe sein',
22
+ validation_format_DateISO8601: 'Muss ein gültiges Datum im ISO8601-Format sein',
23
+ validation_format_DirPath: 'Muss ein gültiger Verzeichnispfad sein',
24
+ validation_format_DomainName: 'Muss ein gültiger Domainname sein',
25
+ validation_format_Email: 'Muss eine gültige E-Mail-Adresse sein',
26
+ validation_format_FilePath: 'Muss ein gültiger Dateipfad sein',
27
+ validation_format_GitSSHURL: 'Muss eine gültige Git-SSH-URL sein',
28
+ validation_format_IPv4: 'Muss eine gültige IPv4-Adresse sein',
29
+ validation_format_IPv6: 'Muss eine gültige IPv6-Adresse sein',
30
+ validation_format_JSON: 'Muss ein gültiger JSON-String sein',
31
+ validation_format_JWT: 'Muss ein gültiges JWT sein',
32
+ validation_format_PersonFirstname: 'Muss ein gültiger Vorname sein, beginnend mit einem Großbuchstaben',
33
+ validation_format_PersonFullname: 'Muss ein gültiger vollständiger Name sein, beginnend mit einem Großbuchstaben',
34
+ validation_format_PersonInitials: 'Muss gültige Initialen aus Großbuchstaben enthalten',
35
+ validation_format_PersonLastname: 'Muss ein gültiger Nachname sein, beginnend mit einem Großbuchstaben',
36
+ validation_format_QRCode: 'Muss ein gültiger QR-Code im Base64-Format sein',
37
+ validation_format_SemVerVersion: 'Muss eine gültige SemVer-Version sein (X.X.X)',
38
+ validation_format_Slug: 'Darf nur Kleinbuchstaben, Ziffern und Bindestriche (-) enthalten',
39
+ validation_format_SSHPrivateKey: 'Muss ein gültiger privater SSH-Schlüssel sein',
40
+ validation_format_SSHPublicKey: 'Muss ein gültiger öffentlicher SSH-Schlüssel sein',
41
+ validation_format_Time: 'Muss eine gültige Uhrzeit sein',
42
+ validation_format_URL: 'Muss eine gültige URL sein',
43
+ validation_format_UUID: 'Muss eine gültige UUID sein',
44
+ validation_mandatory: 'Muss ausgefüllt werden',
45
+ validation_max: 'Muss kleiner oder gleich {{expected}} sein',
46
+ validation_maxCount: 'Darf höchstens {{expected}} Element(e) enthalten',
47
+ validation_maxLength: 'Darf höchstens {{expected}} Zeichen enthalten',
48
+ validation_maxSize: 'Muss eine maximale Größe von {{expected}} haben',
49
+ validation_min: 'Muss größer oder gleich {{expected}} sein',
50
+ validation_minCount: 'Muss mindestens {{expected}} Element(e) enthalten',
51
+ validation_minLength: 'Muss mindestens {{expected}} Zeichen enthalten',
52
+ validation_minSize: 'Muss eine minimale Größe von {{expected}} haben',
53
+ validation_oneOf: 'Muss eines der Elemente der Liste sein',
54
+ validation_shape: 'Muss der erwarteten Objektstruktur entsprechen',
55
+ validation_type_array: 'Muss ein Array sein',
56
+ validation_type_boolean: 'Muss ein Boolescher Wert sein',
57
+ validation_type_int: 'Muss eine ganze Zahl sein',
58
+ validation_type_number: 'Muss eine Zahl sein',
59
+ validation_type_object: 'Muss ein Objekt sein',
60
+ validation_type_scalar: 'Muss ein Skalar sein',
61
+ validation_type_string: 'Muss ein String sein',
62
+ };
@@ -1,4 +1,10 @@
1
1
  export const I18nEN = {
2
+ dt_File_constr_accept: 'Accepted types: {{expected}}',
3
+ dt_File_constr_maxSizeInBytes: 'Max size: {{expected}}',
4
+ dt_File_constr_minSizeInBytes: 'Min size: {{expected}}',
5
+ dt_FreeTextShort_constr_format: 'Format : {{expected}}',
6
+ dt_FreeTextShort_constr_maxLength: 'Max length : {{expected}}',
7
+ dt_FreeTextShort_constr_minLength: 'Min length : {{expected}}',
2
8
  dt_YesNo_N_desc: '',
3
9
  dt_YesNo_N_label: 'No',
4
10
  dt_YesNo_Y_desc: '',
@@ -39,9 +45,11 @@ export const I18nEN = {
39
45
  validation_max: 'Must be lower than or equal to {{expected}}',
40
46
  validation_maxCount: 'Must contain at most {{expected}} item(s)',
41
47
  validation_maxLength: 'Must contain at most {{expected}} character(s)',
48
+ validation_maxSize: 'Must have a max size of {{expected}}',
42
49
  validation_min: 'Must be greater than or equal to {{expected}}',
43
50
  validation_minCount: 'Must contain at least {{expected}} item(s)',
44
51
  validation_minLength: 'Must contain at least {{expected}} character(s)',
52
+ validation_minSize: 'Must have a min size of {{expected}}',
45
53
  validation_oneOf: 'Must be one of the elements of the list',
46
54
  validation_shape: 'Must respect the expected object shape',
47
55
  validation_type_array: 'Must be an array',
@@ -0,0 +1,2 @@
1
+ import type { I18nCoreTranslations } from '../types.js';
2
+ export declare const I18nES: I18nCoreTranslations;
@@ -0,0 +1,62 @@
1
+ export const I18nES = {
2
+ dt_File_constr_accept: 'Tipos aceptados: {{expected}}',
3
+ dt_File_constr_maxSizeInBytes: 'Tamaño máximo: {{expected}}',
4
+ dt_File_constr_minSizeInBytes: 'Tamaño mínimo: {{expected}}',
5
+ dt_FreeTextShort_constr_format: 'Formato: {{expected}}',
6
+ dt_FreeTextShort_constr_maxLength: 'Longitud máxima: {{expected}}',
7
+ dt_FreeTextShort_constr_minLength: 'Longitud mínima: {{expected}}',
8
+ dt_YesNo_N_desc: '',
9
+ dt_YesNo_N_label: 'No',
10
+ dt_YesNo_Y_desc: '',
11
+ dt_YesNo_Y_label: 'Sí',
12
+ uc_client_confirm_cancel: 'Cancelar',
13
+ uc_client_confirm_confirm: 'Sí',
14
+ uc_client_confirm_message: '',
15
+ uc_client_confirm_title: '¿Estás seguro?',
16
+ uc_i_submit_changing: 'Cargando',
17
+ uc_i_submit_idle: 'Guardar',
18
+ uc_i_submit_initializing: 'Cargando',
19
+ uc_i_submit_submitting: 'Guardando',
20
+ validation_fieldsOr: 'Al menos uno de estos campos debe estar completado: {{expected}}',
21
+ validation_format_ColorRGBA: 'Debe ser un color RGBA válido',
22
+ validation_format_DateISO8601: 'Debe ser una fecha válida con formato ISO8601',
23
+ validation_format_DirPath: 'Debe ser una ruta de directorio válida',
24
+ validation_format_DomainName: 'Debe ser un nombre de dominio válido',
25
+ validation_format_Email: 'Debe ser una dirección de correo válida',
26
+ validation_format_FilePath: 'Debe ser una ruta de archivo válida',
27
+ validation_format_GitSSHURL: 'Debe ser una URL SSH de Git válida',
28
+ validation_format_IPv4: 'Debe ser una dirección IPv4 válida',
29
+ validation_format_IPv6: 'Debe ser una dirección IPv6 válida',
30
+ validation_format_JSON: 'Debe ser una cadena JSON válida',
31
+ validation_format_JWT: 'Debe ser un JWT válido',
32
+ validation_format_PersonFirstname: 'Debe ser un nombre válido comenzando con mayúscula',
33
+ validation_format_PersonFullname: 'Debe ser un nombre completo válido comenzando con mayúscula',
34
+ validation_format_PersonInitials: 'Debe contener iniciales válidas compuestas por letras mayúsculas',
35
+ validation_format_PersonLastname: 'Debe ser un apellido válido comenzando con mayúscula',
36
+ validation_format_QRCode: 'Debe ser un código QR válido en formato base64',
37
+ validation_format_SemVerVersion: 'Debe ser una versión SemVer válida (X.X.X)',
38
+ validation_format_Slug: 'Debe contener solo letras minúsculas, dígitos y guiones (-)',
39
+ validation_format_SSHPrivateKey: 'Debe ser una clave privada SSH válida',
40
+ validation_format_SSHPublicKey: 'Debe ser una clave pública SSH válida',
41
+ validation_format_Time: 'Debe ser una hora válida',
42
+ validation_format_URL: 'Debe ser una URL válida',
43
+ validation_format_UUID: 'Debe ser un UUID válido',
44
+ validation_mandatory: 'Debe completarse',
45
+ validation_max: 'Debe ser menor o igual que {{expected}}',
46
+ validation_maxCount: 'Debe contener como máximo {{expected}} elemento(s)',
47
+ validation_maxLength: 'Debe contener como máximo {{expected}} carácter(es)',
48
+ validation_maxSize: 'Debe tener un tamaño máximo de {{expected}}',
49
+ validation_min: 'Debe ser mayor o igual que {{expected}}',
50
+ validation_minCount: 'Debe contener al menos {{expected}} elemento(s)',
51
+ validation_minLength: 'Debe contener al menos {{expected}} carácter(es)',
52
+ validation_minSize: 'Debe tener un tamaño mínimo de {{expected}}',
53
+ validation_oneOf: 'Debe ser uno de los elementos de la lista',
54
+ validation_shape: 'Debe respetar la estructura esperada del objeto',
55
+ validation_type_array: 'Debe ser un array',
56
+ validation_type_boolean: 'Debe ser un valor booleano',
57
+ validation_type_int: 'Debe ser un número entero',
58
+ validation_type_number: 'Debe ser un número',
59
+ validation_type_object: 'Debe ser un objeto',
60
+ validation_type_scalar: 'Debe ser un escalar',
61
+ validation_type_string: 'Debe ser una cadena',
62
+ };
@@ -1,4 +1,10 @@
1
1
  export const I18nFR = {
2
+ dt_File_constr_accept: 'Types acceptés : {{expected}}',
3
+ dt_File_constr_maxSizeInBytes: 'Taille max : {{expected}}',
4
+ dt_File_constr_minSizeInBytes: 'Taille min : {{expected}}',
5
+ dt_FreeTextShort_constr_format: 'Format : {{expected}}',
6
+ dt_FreeTextShort_constr_maxLength: 'Longueur max : {{expected}}',
7
+ dt_FreeTextShort_constr_minLength: 'Longueur min : {{expected}}',
2
8
  dt_YesNo_N_desc: '',
3
9
  dt_YesNo_N_label: 'Non',
4
10
  dt_YesNo_Y_desc: '',
@@ -39,9 +45,11 @@ export const I18nFR = {
39
45
  validation_max: 'Doit être inférieur ou égal à {{expected}}',
40
46
  validation_maxCount: 'Doit contenir au maximim {{expected}} élément(s)',
41
47
  validation_maxLength: 'Doit contenir au maximum {{expected}} caractère(s)',
48
+ validation_maxSize: 'Doit avoir une taille maximum de {{expected}}',
42
49
  validation_min: 'Doit être supérieur ou égal à {{expected}}',
43
50
  validation_minCount: 'Doit contenir au minimum {{expected}} élément(s)',
44
51
  validation_minLength: 'Doit contenir au minimum {{expected}} caractère(s)',
52
+ validation_minSize: 'Doit avoir une taille minimum de {{expected}}',
45
53
  validation_oneOf: 'Doit être un des éléments de la liste',
46
54
  validation_shape: "Doit respecter la forme de l'objet attendue",
47
55
  validation_type_array: 'Doît être un tableau',
@@ -1,6 +1,6 @@
1
- import type { ViolationI18nable, YesNo } from '../dt/index.js';
1
+ import type { TFileConstraints, TStringConstraints, ViolationI18nable, YesNo } from '../dt/index.js';
2
2
  import type { UCClientConfirmConfig, UCExecState, UCWording } from '../uc/index.js';
3
- export type I18nLanguageCode = 'en' | 'fr';
3
+ export type I18nLanguageCode = 'de' | 'en' | 'es' | 'fr';
4
4
  /**
5
5
  * A translation value
6
6
  *
@@ -8,12 +8,13 @@ export type I18nLanguageCode = 'en' | 'fr';
8
8
  */
9
9
  export type I18nTranslation = string;
10
10
  export type I18nTranslationKey = string;
11
- export type I18nCoreKey = ViolationI18nable | `dt_YesNo_${YesNo}_${keyof UCWording}` | `uc_client_confirm_${keyof UCClientConfirmConfig}` | `uc_i_submit_${UCExecState}`;
11
+ export type I18nCoreKey = ViolationI18nable | `dt_FreeTextShort_constr_${keyof TStringConstraints}` | `dt_File_constr_${keyof TFileConstraints}` | `dt_YesNo_${YesNo}_${keyof UCWording}` | `uc_client_confirm_${keyof UCClientConfirmConfig}` | `uc_i_submit_${UCExecState}`;
12
12
  export type I18nCoreTranslations = Record<I18nCoreKey, I18nTranslation>;
13
13
  export type I18nSource = any;
14
14
  export type I18nSourceSafe = {
15
15
  I18n: I18n;
16
16
  };
17
+ export type I18nEntry = Record<I18nTranslationKey, I18nTranslation>;
17
18
  export type I18n = {
18
- [key in I18nLanguageCode]?: Record<I18nTranslationKey, I18nTranslation>;
19
+ [key in I18nLanguageCode]?: I18nEntry;
19
20
  };
@@ -0,0 +1 @@
1
+ export { Plugin } from './utils/bundling/babel/plugin.js';
@@ -0,0 +1 @@
1
+ export { Plugin } from './utils/bundling/babel/plugin.js';
@@ -0,0 +1,2 @@
1
+ export { NodeStricliCLIManager } from './target/node-stricli-cli/NodeStricliCLIManager.js';
2
+ export { bindNodeCLI } from './utils/ioc/bindNodeCLI.js';
@@ -0,0 +1,2 @@
1
+ export { NodeStricliCLIManager } from './target/node-stricli-cli/NodeStricliCLIManager.js';
2
+ export { bindNodeCLI } from './utils/ioc/bindNodeCLI.js';
@@ -1 +1 @@
1
- export { StripUCDLifecycleServerPlugin } from './utils/bundling/vite/StripUCDLifecycleServerPlugin.js';
1
+ export { Plugin } from './utils/bundling/vite/plugin.js';
@@ -1 +1 @@
1
- export { StripUCDLifecycleServerPlugin } from './utils/bundling/vite/StripUCDLifecycleServerPlugin.js';
1
+ export { Plugin } from './utils/bundling/vite/plugin.js';
@@ -0,0 +1 @@
1
+ export { default } from './utils/bundling/webpack/loader.js';
@@ -0,0 +1 @@
1
+ export { default } from './utils/bundling/webpack/loader.js';
@@ -1,4 +1,5 @@
1
1
  import type { DateISO8601, DirPath, File, FileExtension, FileMimeType, FileName, FilePath, UIntQuantity } from '../dt/index.js';
2
+ import type { EnumOf } from '../utils/index.js';
2
3
  export type FSManagerChmodMode = number | string;
3
4
  export interface FSManagerCatOpts {
4
5
  encoding?: FSManagerEncoding;
@@ -9,11 +10,12 @@ export interface FSManagerFilePickerOpts {
9
10
  path?: FilePath;
10
11
  }
11
12
  export type FSManagerFilePickerSource = 'camera' | 'library' | 'path';
12
- export declare enum FSManagerItemInfoType {
13
- DIR = "DIR",
14
- FILE = "FILE",
15
- OTHER = "OTHER"
16
- }
13
+ export declare const FSManagerItemInfoType: {
14
+ readonly DIR: "DIR";
15
+ readonly FILE: "FILE";
16
+ readonly OTHER: "OTHER";
17
+ };
18
+ export type FSManagerItemInfoType = EnumOf<typeof FSManagerItemInfoType>;
17
19
  export interface FSManagerItemInfo {
18
20
  base: string;
19
21
  birthtime: DateISO8601;
@@ -1,6 +1,5 @@
1
- export var FSManagerItemInfoType;
2
- (function (FSManagerItemInfoType) {
3
- FSManagerItemInfoType["DIR"] = "DIR";
4
- FSManagerItemInfoType["FILE"] = "FILE";
5
- FSManagerItemInfoType["OTHER"] = "OTHER";
6
- })(FSManagerItemInfoType || (FSManagerItemInfoType = {}));
1
+ export const FSManagerItemInfoType = {
2
+ DIR: 'DIR',
3
+ FILE: 'FILE',
4
+ OTHER: 'OTHER',
5
+ };
@@ -1,5 +1,6 @@
1
- import type { FileMimeType, FilePath } from '../dt/index.js';
1
+ import type { FileMimeType, FileName, FilePath } from '../dt/index.js';
2
2
  export interface BlobLike {
3
+ name: FileName;
3
4
  type: FileMimeType;
4
5
  uri: FilePath;
5
6
  }
@@ -16,6 +16,18 @@ export interface I18nManager extends Initializable {
16
16
  * @param value
17
17
  */
18
18
  add<K extends I18nTranslationKey>(key: K, value: string): Promise<void>;
19
+ /**
20
+ * Get the list of available languages
21
+ */
22
+ availableLangs(): I18nLanguageCode[];
23
+ /**
24
+ * Change the current language
25
+ *
26
+ * It might not work for all the implementations, depending on how langs are managed.
27
+ *
28
+ * @param lang
29
+ */
30
+ changeLang(lang: I18nLanguageCode): Promise<void>;
19
31
  /**
20
32
  * Get the current lang code
21
33
  */
@@ -94,15 +94,16 @@ let NodeFSManager = class NodeFSManager {
94
94
  }
95
95
  switch (source) {
96
96
  case 'path': {
97
- const { base: name, mimeType: type } = await this.info(path);
97
+ const { base: name, mimeType: type, size, } = await this.info(path);
98
98
  if (!type) {
99
99
  return [];
100
100
  }
101
101
  return [
102
102
  {
103
103
  name,
104
- path,
104
+ size,
105
105
  type,
106
+ uri: path,
106
107
  },
107
108
  ];
108
109
  }
@@ -110,7 +111,7 @@ let NodeFSManager = class NodeFSManager {
110
111
  case 'library':
111
112
  return [];
112
113
  default:
113
- ((_) => { })(source);
114
+ source;
114
115
  return [];
115
116
  }
116
117
  }
@@ -1,18 +1,23 @@
1
- import { type I18n, type I18nLanguageCode, type I18nTranslationKey } from '../../i18n/index.js';
1
+ import type { I18n, I18nLanguageCode, I18nTranslationKey } from '../../i18n/index.js';
2
2
  import type { I18nManager, I18nManagerTOpts } from '../I18nManager.js';
3
3
  import type { Logger } from '../Logger.js';
4
4
  export declare class SimpleMapI18nManager implements I18nManager {
5
5
  private i18n;
6
6
  private logger;
7
7
  private static PLACEHOLDERS_REGEX;
8
+ private langs;
8
9
  private entries;
10
+ private currentLang;
9
11
  constructor(i18n: I18n, logger: Logger);
10
12
  add<K extends I18nTranslationKey>(key: K, value: string): Promise<void>;
13
+ availableLangs(): I18nLanguageCode[];
14
+ changeLang(lang: I18nLanguageCode): Promise<void>;
11
15
  init(): Promise<void>;
12
16
  initSync(): void;
13
17
  l(): I18nLanguageCode;
14
18
  t<K extends I18nTranslationKey>(key: K, opts?: I18nManagerTOpts): string;
15
19
  private initCommon;
16
20
  tOrNull<K extends I18nTranslationKey>(key: K, _opts?: I18nManagerTOpts): string | null;
21
+ private current;
17
22
  private replacePlaceholders;
18
23
  }
@@ -12,20 +12,34 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
12
  };
13
13
  var SimpleMapI18nManager_1;
14
14
  import { inject, injectable } from 'inversify';
15
- import { I18N_DEFAULT_LANG, } from '../../i18n/index.js';
16
15
  let SimpleMapI18nManager = class SimpleMapI18nManager {
17
16
  static { SimpleMapI18nManager_1 = this; }
18
17
  i18n;
19
18
  logger;
20
19
  static PLACEHOLDERS_REGEX = /{{([A-Z-a-z0-9]+)}}/g; // Note the 'g' so it can be used with `matchAll`
20
+ langs;
21
21
  entries;
22
+ currentLang;
22
23
  constructor(i18n, logger) {
23
24
  this.i18n = i18n;
24
25
  this.logger = logger;
26
+ this.langs = Object.keys(i18n);
27
+ if (this.langs.length === 0) {
28
+ throw new Error('I18n must define at least one lang');
29
+ }
25
30
  this.entries = new Map();
31
+ // biome-ignore lint/style/noNonNullAssertion: we want it
32
+ this.currentLang = this.langs[0];
26
33
  }
27
34
  async add(key, value) {
28
- this.entries.set(key, value);
35
+ this.current().set(key, value);
36
+ }
37
+ availableLangs() {
38
+ return this.langs;
39
+ }
40
+ async changeLang(lang) {
41
+ this.currentLang = lang;
42
+ this.initCommon();
29
43
  }
30
44
  async init() {
31
45
  this.initCommon();
@@ -34,10 +48,10 @@ let SimpleMapI18nManager = class SimpleMapI18nManager {
34
48
  this.initCommon();
35
49
  }
36
50
  l() {
37
- return I18N_DEFAULT_LANG;
51
+ return this.currentLang;
38
52
  }
39
53
  t(key, opts) {
40
- const v = this.entries.get(key);
54
+ const v = this.current().get(key);
41
55
  if (v) {
42
56
  return this.replacePlaceholders(v, opts);
43
57
  }
@@ -47,17 +61,32 @@ let SimpleMapI18nManager = class SimpleMapI18nManager {
47
61
  return key; // Mimic the behavior of some common libraries like i18next
48
62
  }
49
63
  initCommon() {
50
- const translations = this.i18n[this.l()];
51
- this.logger.trace('Initializing I18nManager', { translations });
52
- if (!translations) {
53
- return;
54
- }
55
- for (const [k, v] of Object.entries(translations)) {
56
- this.entries.set(k, v);
64
+ for (const lang of this.langs) {
65
+ const translations = this.i18n[lang];
66
+ this.logger.trace('Initializing I18nManager', {
67
+ lang,
68
+ translations,
69
+ });
70
+ if (!translations) {
71
+ return;
72
+ }
73
+ if (!this.entries.has(lang)) {
74
+ this.entries.set(lang, new Map());
75
+ }
76
+ for (const [k, v] of Object.entries(translations)) {
77
+ this.entries.get(lang)?.set(k, v);
78
+ }
57
79
  }
58
80
  }
59
81
  tOrNull(key, _opts) {
60
- return this.entries.get(key) || null;
82
+ return this.current().get(key) || null;
83
+ }
84
+ current() {
85
+ const entry = this.entries.get(this.currentLang);
86
+ if (!entry) {
87
+ throw new Error(`I18nManager must contain an entry for lang : ${this.currentLang}`);
88
+ }
89
+ return entry;
61
90
  }
62
91
  replacePlaceholders(v, opts) {
63
92
  // DO NOT USE THIS IN PRODUCTION
@@ -18,6 +18,7 @@ export interface StyleContextT {
18
18
  formField?: StyleDef | undefined;
19
19
  formFieldControl?: Record<SelectiveStyleDefKey, StyleDef | undefined>;
20
20
  formFieldDesc?: StyleDef | undefined;
21
+ formFieldHelp?: StyleDef | undefined;
21
22
  formFieldErr?: StyleDef | undefined;
22
23
  formFieldLabel?: StyleDef | undefined;
23
24
  formSubmitControl?: StyleDef | undefined;
@@ -18,7 +18,7 @@ export interface UCFormFieldErrProps {
18
18
  export interface UCFormFieldLabelProps<T extends DataType> {
19
19
  f: UCInputField<T>;
20
20
  }
21
- export declare const UC_FORM_FIELD_ELEMENTS: readonly ["control", "desc", "err", "label"];
21
+ export declare const UC_FORM_FIELD_ELEMENTS: readonly ["control", "desc", "err", "help", "label"];
22
22
  export type UCFormFieldElement = (typeof UC_FORM_FIELD_ELEMENTS)[number];
23
23
  export type UCFormFieldProps<T extends DataType> = Omit<UCFormFieldControlProps<T>, 'onChange'> & {
24
24
  only?: UCFormFieldElement[];
@@ -3,6 +3,7 @@ export const UC_FORM_FIELD_ELEMENTS = [
3
3
  'control',
4
4
  'desc',
5
5
  'err',
6
+ 'help',
6
7
  'label',
7
8
  ];
8
9
  export function validateFormField(i18nManager, f) {
@@ -1,5 +1,5 @@
1
1
  import type { ErrorMessage, UIntDuration } from '../../../dt/index.js';
2
- import type { UCExecRes, UCExecState } from '../../../uc/index.js';
2
+ import { UCExecRes, UCExecState } from '../../../uc/index.js';
3
3
  export type UseActionAction = () => Promise<void>;
4
4
  export type UseActionConfirm = () => Promise<boolean>;
5
5
  export type UseActionExec = () => Promise<UCExecRes>;