@aidc-toolkit/core 1.0.31-beta → 1.0.33-beta

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 (73) hide show
  1. package/README.md +98 -87
  2. package/dist/app-data-storage.d.ts +118 -0
  3. package/dist/app-data-storage.d.ts.map +1 -0
  4. package/dist/app-data-storage.js +117 -0
  5. package/dist/app-data-storage.js.map +1 -0
  6. package/dist/app-data.d.ts +26 -0
  7. package/dist/app-data.d.ts.map +1 -0
  8. package/dist/app-data.js +79 -0
  9. package/dist/app-data.js.map +1 -0
  10. package/dist/browser-app-data-storage.d.ts +26 -0
  11. package/dist/browser-app-data-storage.d.ts.map +1 -0
  12. package/dist/browser-app-data-storage.js +34 -0
  13. package/dist/browser-app-data-storage.js.map +1 -0
  14. package/dist/cache.d.ts +58 -0
  15. package/dist/cache.d.ts.map +1 -0
  16. package/dist/cache.js +12 -0
  17. package/dist/cache.js.map +1 -0
  18. package/dist/file-app-data-storage.d.ts +26 -0
  19. package/dist/file-app-data-storage.d.ts.map +1 -0
  20. package/dist/file-app-data-storage.js +40 -0
  21. package/dist/file-app-data-storage.js.map +1 -0
  22. package/dist/hyperlink.d.ts +18 -0
  23. package/dist/hyperlink.d.ts.map +1 -0
  24. package/dist/hyperlink.js +2 -0
  25. package/dist/hyperlink.js.map +1 -0
  26. package/dist/index.d.ts +6 -0
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +5 -0
  29. package/dist/index.js.map +1 -1
  30. package/dist/local-app-data-storage.d.ts +8 -0
  31. package/dist/local-app-data-storage.d.ts.map +1 -0
  32. package/dist/local-app-data-storage.js +11 -0
  33. package/dist/local-app-data-storage.js.map +1 -0
  34. package/dist/locale/en/locale-resources.d.ts +10 -0
  35. package/dist/locale/en/locale-resources.d.ts.map +1 -0
  36. package/dist/locale/en/locale-resources.js +9 -0
  37. package/dist/locale/en/locale-resources.js.map +1 -0
  38. package/dist/locale/fr/locale-resources.d.ts +10 -0
  39. package/dist/locale/fr/locale-resources.d.ts.map +1 -0
  40. package/dist/locale/fr/locale-resources.js +9 -0
  41. package/dist/locale/fr/locale-resources.js.map +1 -0
  42. package/dist/locale/i18n.d.ts +33 -6
  43. package/dist/locale/i18n.d.ts.map +1 -1
  44. package/dist/locale/i18n.js +76 -31
  45. package/dist/locale/i18n.js.map +1 -1
  46. package/dist/logger.d.ts +108 -4
  47. package/dist/logger.d.ts.map +1 -1
  48. package/dist/logger.js +227 -12
  49. package/dist/logger.js.map +1 -1
  50. package/dist/remote-app-data-storage.d.ts +18 -0
  51. package/dist/remote-app-data-storage.d.ts.map +1 -0
  52. package/dist/remote-app-data-storage.js +37 -0
  53. package/dist/remote-app-data-storage.js.map +1 -0
  54. package/dist/type-helper.js.map +1 -1
  55. package/dist/type.d.ts +5 -0
  56. package/dist/type.d.ts.map +1 -1
  57. package/package.json +10 -8
  58. package/src/app-data-storage.ts +166 -0
  59. package/src/app-data.ts +94 -0
  60. package/src/browser-app-data-storage.ts +37 -0
  61. package/src/cache.ts +64 -0
  62. package/src/file-app-data-storage.ts +49 -0
  63. package/src/hyperlink.ts +19 -0
  64. package/src/index.ts +10 -0
  65. package/src/local-app-data-storage.ts +12 -0
  66. package/src/locale/en/locale-resources.ts +8 -0
  67. package/src/locale/fr/locale-resources.ts +8 -0
  68. package/src/locale/i18n.ts +102 -36
  69. package/src/locale/i18next.d.ts +16 -0
  70. package/src/logger.ts +250 -13
  71. package/src/remote-app-data-storage.ts +38 -0
  72. package/src/type-helper.ts +2 -2
  73. package/src/type.ts +6 -0
@@ -0,0 +1,34 @@
1
+ import { AppDataStorage } from "./app-data-storage.js";
2
+ /**
3
+ * Application data storage using the browser local storage.
4
+ */
5
+ export class BrowserAppDataStorage extends AppDataStorage {
6
+ /**
7
+ * Constructor.
8
+ *
9
+ * @param path
10
+ * Storage path prepended to each key along with '/' if defined, empty string if not.
11
+ */
12
+ constructor(path) {
13
+ super(false, path);
14
+ }
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ doRead(key) {
19
+ return localStorage.getItem(key) ?? undefined;
20
+ }
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ doWrite(key, s) {
25
+ localStorage.setItem(key, s);
26
+ }
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ doDelete(key) {
31
+ localStorage.removeItem(key);
32
+ }
33
+ }
34
+ //# sourceMappingURL=browser-app-data-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-app-data-storage.js","sourceRoot":"","sources":["../src/browser-app-data-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,cAAqB;IAC5D;;;;;OAKG;IACH,YAAY,IAAa;QACrB,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACvB,CAAC;IAED;;OAEG;IACgB,MAAM,CAAC,GAAW;QACjC,OAAO,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC;IAClD,CAAC;IAED;;OAEG;IACgB,OAAO,CAAC,GAAW,EAAE,CAAS;QAC7C,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACgB,QAAQ,CAAC,GAAW;QACnC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;CACJ"}
@@ -0,0 +1,58 @@
1
+ import type { Promisable } from "./type.js";
2
+ /**
3
+ * Generic cache. Typically used to manage a local copy of remote data that is not refreshed regularly.
4
+ *
5
+ * @template TCache
6
+ * Type of cached data.
7
+ *
8
+ * @template TSource
9
+ * Type of source data. The type may be different from the cached data type if a transformation is required.
10
+ */
11
+ export declare abstract class Cache<TCache, TSource = TCache> {
12
+ /**
13
+ * Get the date/time at or after which the source should be checked for updates. If the value is undefined, this is
14
+ * the first usage.
15
+ */
16
+ abstract get nextCheckDateTime(): Promisable<Date | undefined>;
17
+ /**
18
+ * Get the date/time at which the cache was last updated. This may more accurately reflect the date/time at which
19
+ * the last source retrieved was updated. If the value is undefined, there is no data in the cache.
20
+ */
21
+ abstract get cacheDateTime(): Promisable<Date | undefined>;
22
+ /**
23
+ * Get the cache data. This should only ever be called if the cache date/time is defined.
24
+ */
25
+ abstract get cacheData(): Promisable<TCache>;
26
+ /**
27
+ * Get the date/time at which the source was last updated. This should not be called unless the next check date/time
28
+ * has passed, as it may trigger an expensive remote retrieval.
29
+ */
30
+ abstract get sourceDateTime(): Promisable<Date>;
31
+ /**
32
+ * Get the source data. This should not be called unless the next check date/time has passed, as it may trigger an
33
+ * expensive remote retrieval.
34
+ */
35
+ abstract get sourceData(): Promisable<TSource>;
36
+ /**
37
+ * Update the cache with only the next check date/time. The cache date/time and cache data must not be modified.
38
+ * This is typically called when the cache is up to date with the source or source retrieval has failed.
39
+ *
40
+ * @param nextCheckDateTime
41
+ * Next check date/time.
42
+ */
43
+ abstract update(nextCheckDateTime: Date): Promisable<void>;
44
+ /**
45
+ * Update all cache parameters. This is typically called when the cache is updated from the source.
46
+ *
47
+ * @param nextCheckDateTime
48
+ * Next check date/time.
49
+ *
50
+ * @param cacheDateTime
51
+ * Cache date/time.
52
+ *
53
+ * @param cacheData
54
+ * Cache data.
55
+ */
56
+ abstract update(nextCheckDateTime: Date, cacheDateTime: Date, cacheData: TCache): Promisable<void>;
57
+ }
58
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE5C;;;;;;;;GAQG;AACH,8BAAsB,KAAK,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM;IAChD;;;OAGG;IACH,QAAQ,KAAK,iBAAiB,IAAI,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IAE/D;;;OAGG;IACH,QAAQ,KAAK,aAAa,IAAI,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC;IAE3D;;OAEG;IACH,QAAQ,KAAK,SAAS,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;IAE7C;;;OAGG;IACH,QAAQ,KAAK,cAAc,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;IAEhD;;;OAGG;IACH,QAAQ,KAAK,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC;IAE/C;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC;IAE1D;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,CAAC,iBAAiB,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC;CACrG"}
package/dist/cache.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Generic cache. Typically used to manage a local copy of remote data that is not refreshed regularly.
3
+ *
4
+ * @template TCache
5
+ * Type of cached data.
6
+ *
7
+ * @template TSource
8
+ * Type of source data. The type may be different from the cached data type if a transformation is required.
9
+ */
10
+ export class Cache {
11
+ }
12
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,OAAgB,KAAK;CAoD1B"}
@@ -0,0 +1,26 @@
1
+ import { AppDataStorage } from "./app-data-storage.js";
2
+ /**
3
+ * Application data storage using the file system.
4
+ */
5
+ export declare class FileAppDataStorage extends AppDataStorage<true> {
6
+ /**
7
+ * Constructor.
8
+ *
9
+ * @param path
10
+ * Storage path prepended to each key along with '/' if defined, empty string if not.
11
+ */
12
+ constructor(path?: string);
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ protected doRead(key: string, asBinary: boolean | undefined): Promise<string | Uint8Array | undefined>;
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ protected doWrite(key: string, data: string | Uint8Array): Promise<void>;
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ protected doDelete(key: string): Promise<void>;
25
+ }
26
+ //# sourceMappingURL=file-app-data-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-app-data-storage.d.ts","sourceRoot":"","sources":["../src/file-app-data-storage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,cAAc,CAAC,IAAI,CAAC;IACxD;;;;;OAKG;gBACS,IAAI,CAAC,EAAE,MAAM;IAIzB;;OAEG;cACsB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAQrH;;OAEG;cACsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAQvF;;OAEG;cACsB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAKhE"}
@@ -0,0 +1,40 @@
1
+ import * as fs from "node:fs";
2
+ import * as path from "node:path";
3
+ import { AppDataStorage } from "./app-data-storage.js";
4
+ /**
5
+ * Application data storage using the file system.
6
+ */
7
+ export class FileAppDataStorage extends AppDataStorage {
8
+ /**
9
+ * Constructor.
10
+ *
11
+ * @param path
12
+ * Storage path prepended to each key along with '/' if defined, empty string if not.
13
+ */
14
+ constructor(path) {
15
+ super(true, path);
16
+ }
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ async doRead(key, asBinary) {
21
+ return fs.promises.readFile(key).then(buffer => asBinary === true ? buffer : buffer.toString()).catch(() => undefined);
22
+ }
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ async doWrite(key, data) {
27
+ return fs.promises.mkdir(path.dirname(key), {
28
+ recursive: true
29
+ }).then(async () => fs.promises.writeFile(key, data));
30
+ }
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ async doDelete(key) {
35
+ return fs.promises.rm(key, {
36
+ force: true
37
+ });
38
+ }
39
+ }
40
+ //# sourceMappingURL=file-app-data-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-app-data-storage.js","sourceRoot":"","sources":["../src/file-app-data-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,cAAoB;IACxD;;;;;OAKG;IACH,YAAY,IAAa;QACrB,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACtB,CAAC;IAED;;OAEG;IACgB,KAAK,CAAC,MAAM,CAAC,GAAW,EAAE,QAA6B;QACtE,OAAO,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAC3C,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CACjD,CAAC,KAAK,CAAC,GAAG,EAAE,CACT,SAAS,CACZ,CAAC;IACN,CAAC;IAED;;OAEG;IACgB,KAAK,CAAC,OAAO,CAAC,GAAW,EAAE,IAAyB;QACnE,OAAO,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;YACxC,SAAS,EAAE,IAAI;SAClB,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CACf,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CACnC,CAAC;IACN,CAAC;IAED;;OAEG;IACgB,KAAK,CAAC,QAAQ,CAAC,GAAW;QACzC,OAAO,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE;YACvB,KAAK,EAAE,IAAI;SACd,CAAC,CAAC;IACP,CAAC;CACJ"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Hyperlink.
3
+ */
4
+ export interface Hyperlink {
5
+ /**
6
+ * Reference, relative or absolute depending on the application.
7
+ */
8
+ readonly reference: string;
9
+ /**
10
+ * Human-readable text.
11
+ */
12
+ readonly text?: string | undefined;
13
+ /**
14
+ * Additional details.
15
+ */
16
+ readonly details?: string | undefined;
17
+ }
18
+ //# sourceMappingURL=hyperlink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hyperlink.d.ts","sourceRoot":"","sources":["../src/hyperlink.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEnC;;OAEG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=hyperlink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hyperlink.js","sourceRoot":"","sources":["../src/hyperlink.ts"],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -17,5 +17,11 @@
17
17
  export type * from "./type.js";
18
18
  export * from "./type-helper.js";
19
19
  export * from "./logger.js";
20
+ export * from "./app-data.js";
21
+ export * from "./app-data-storage.js";
22
+ export * from "./local-app-data-storage.js";
23
+ export * from "./remote-app-data-storage.js";
24
+ export * from "./cache.js";
25
+ export type * from "./hyperlink.js";
20
26
  export * from "./locale/i18n.js";
21
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,mBAAmB,WAAW,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,mBAAmB,WAAW,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,aAAa,CAAC;AAE5B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,YAAY,CAAC;AAE3B,mBAAmB,gBAAgB,CAAC;AAEpC,cAAc,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,9 @@
1
1
  export * from "./type-helper.js";
2
2
  export * from "./logger.js";
3
+ export * from "./app-data.js";
4
+ export * from "./app-data-storage.js";
5
+ export * from "./local-app-data-storage.js";
6
+ export * from "./remote-app-data-storage.js";
7
+ export * from "./cache.js";
3
8
  export * from "./locale/i18n.js";
4
9
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,cAAc,kBAAkB,CAAC;AAEjC,cAAc,aAAa,CAAC;AAE5B,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,YAAY,CAAC;AAI3B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { AppDataStorage } from "./app-data-storage.js";
2
+ /**
3
+ * Local application data storage class for the current environment. This is a variable representing a `Promise` as the
4
+ * implementing class is loaded dynamically to prevent the inclusion of unnecessary node dependencies in a browser
5
+ * environment.
6
+ */
7
+ export declare const LocalAppDataStorage: Promise<new (path?: string) => AppDataStorage<boolean>>;
8
+ //# sourceMappingURL=local-app-data-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-app-data-storage.d.ts","sourceRoot":"","sources":["../src/local-app-data-storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC,EAAE,MAAM,KAAK,cAAc,CAAC,OAAO,CAAC,CAII,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Local application data storage class for the current environment. This is a variable representing a `Promise` as the
3
+ * implementing class is loaded dynamically to prevent the inclusion of unnecessary node dependencies in a browser
4
+ * environment.
5
+ */
6
+ export const LocalAppDataStorage =
7
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- localStorage is undefined when running under Node.js.
8
+ globalThis.localStorage === undefined ?
9
+ import("./file-app-data-storage.js").then(module => module.FileAppDataStorage) :
10
+ import("./browser-app-data-storage.js").then(module => module.BrowserAppDataStorage);
11
+ //# sourceMappingURL=local-app-data-storage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"local-app-data-storage.js","sourceRoot":"","sources":["../src/local-app-data-storage.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB;AAC5B,gIAAgI;AAChI,UAAU,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC;IACnC,MAAM,CAAC,4BAA4B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAChF,MAAM,CAAC,+BAA+B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ declare const _default: {
2
+ Logger: {
3
+ unknownLogLevel: string;
4
+ };
5
+ RemoteAppDataStorage: {
6
+ httpError: string;
7
+ };
8
+ };
9
+ export default _default;
10
+ //# sourceMappingURL=locale-resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale-resources.d.ts","sourceRoot":"","sources":["../../../src/locale/en/locale-resources.ts"],"names":[],"mappings":";;;;;;;;AAAA,wBAOE"}
@@ -0,0 +1,9 @@
1
+ export default {
2
+ Logger: {
3
+ unknownLogLevel: "Unknown log level \"{{logLevel}}\""
4
+ },
5
+ RemoteAppDataStorage: {
6
+ httpError: "HTTP error {{status, number}} retrieving file"
7
+ }
8
+ };
9
+ //# sourceMappingURL=locale-resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale-resources.js","sourceRoot":"","sources":["../../../src/locale/en/locale-resources.ts"],"names":[],"mappings":"AAAA,eAAe;IACX,MAAM,EAAE;QACJ,eAAe,EAAE,oCAAoC;KACxD;IACD,oBAAoB,EAAE;QAClB,SAAS,EAAE,+CAA+C;KAC7D;CACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ declare const _default: {
2
+ Logger: {
3
+ unknownLogLevel: string;
4
+ };
5
+ RemoteAppDataStorage: {
6
+ httpError: string;
7
+ };
8
+ };
9
+ export default _default;
10
+ //# sourceMappingURL=locale-resources.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale-resources.d.ts","sourceRoot":"","sources":["../../../src/locale/fr/locale-resources.ts"],"names":[],"mappings":";;;;;;;;AAAA,wBAOE"}
@@ -0,0 +1,9 @@
1
+ export default {
2
+ Logger: {
3
+ unknownLogLevel: "Niveau de journalisation inconnu «{{logLevel}}»"
4
+ },
5
+ RemoteAppDataStorage: {
6
+ httpError: "Erreur HTTP {{status, number}} lors de la récupération du fichier"
7
+ }
8
+ };
9
+ //# sourceMappingURL=locale-resources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale-resources.js","sourceRoot":"","sources":["../../../src/locale/fr/locale-resources.ts"],"names":[],"mappings":"AAAA,eAAe;IACX,MAAM,EAAE;QACJ,eAAe,EAAE,iDAAiD;KACrE;IACD,oBAAoB,EAAE;QAClB,SAAS,EAAE,mEAAmE;KACjF;CACJ,CAAC"}
@@ -1,4 +1,5 @@
1
- import type { i18n, Resource } from "i18next";
1
+ import { type i18n, type Resource } from "i18next";
2
+ import enLocaleResources from "./en/locale-resources.js";
2
3
  /**
3
4
  * Locale strings type for generic manipulation.
4
5
  */
@@ -30,11 +31,21 @@ export type I18nEnvironmentKey = keyof typeof I18nEnvironments;
30
31
  * Internationalization operating environment.
31
32
  */
32
33
  export type I18nEnvironment = typeof I18nEnvironments[I18nEnvironmentKey];
34
+ export declare const coreNS = "aidct_core";
35
+ /**
36
+ * Locale resources type is extracted from the English locale resources object.
37
+ */
38
+ export type CoreLocaleResources = typeof enLocaleResources;
39
+ /**
40
+ * Core resource bundle.
41
+ */
42
+ export declare const coreResourceBundle: Resource;
43
+ export declare const i18nextCore: i18n;
33
44
  /**
34
45
  * Initialize internationalization.
35
46
  *
36
47
  * @param i18next
37
- * Internationalization object. As multiple objects exists, this parameter represents the one for the module for which
48
+ * Internationalization object. As multiple objects exist, this parameter represents the one for the module for which
38
49
  * internationalization is being initialized.
39
50
  *
40
51
  * @param environment
@@ -46,11 +57,27 @@ export type I18nEnvironment = typeof I18nEnvironments[I18nEnvironmentKey];
46
57
  * @param defaultNS
47
58
  * Default namespace.
48
59
  *
49
- * @param resources
50
- * Resources.
60
+ * @param defaultResourceBundle
61
+ * Default resource bundle.
62
+ *
63
+ * @param i18nDependencyInits
64
+ * Dependency internationalization initialization functions.
65
+ *
66
+ * @returns
67
+ * Default resource bundle.
68
+ */
69
+ export declare function i18nInit(i18next: i18n, environment: I18nEnvironment, debug: boolean, defaultNS: string, defaultResourceBundle: Resource, ...i18nDependencyInits: Array<(environment: I18nEnvironment, debug: boolean) => Promise<Resource>>): Promise<Resource>;
70
+ /**
71
+ * Initialize internationalization.
72
+ *
73
+ * @param environment
74
+ * Environment in which the application is running.
75
+ *
76
+ * @param debug
77
+ * Debug setting.
51
78
  *
52
79
  * @returns
53
- * Void promise.
80
+ * Core resource bundle.
54
81
  */
55
- export declare function i18nCoreInit(i18next: i18n, environment: I18nEnvironment, debug: boolean, defaultNS: string, ...resources: Resource[]): Promise<void>;
82
+ export declare function i18nCoreInit(environment: I18nEnvironment, debug?: boolean): Promise<Resource>;
56
83
  //# sourceMappingURL=i18n.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/locale/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAA0B,QAAQ,EAAE,MAAM,SAAS,CAAC;AAItE;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,MAAM,CAAC;CAC3C;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;IACzB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEG,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;AAgB1E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CA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,CAEjG"}
@@ -1,5 +1,8 @@
1
+ import i18next from "i18next";
1
2
  import I18nextBrowserLanguageDetector from "i18next-browser-languagedetector";
2
3
  import I18nextCLILanguageDetector from "i18next-cli-language-detector";
4
+ import enLocaleResources from "./en/locale-resources.js";
5
+ import frLocaleResources from "./fr/locale-resources.js";
3
6
  /**
4
7
  * Internationalization operating environments.
5
8
  */
@@ -28,13 +31,27 @@ export const I18nEnvironments = {
28
31
  */
29
32
  function toLowerCase(s) {
30
33
  // Words with no lower case letters are preserved as they are likely mnemonics.
31
- return s.split(" ").map(word => /[a-z]/.test(word) ? word.toLowerCase() : word).join(" ");
34
+ return s.split(" ").map(word => /[a-z]/u.test(word) ? word.toLowerCase() : word).join(" ");
32
35
  }
36
+ export const coreNS = "aidct_core";
37
+ /**
38
+ * Core resource bundle.
39
+ */
40
+ export const coreResourceBundle = {
41
+ en: {
42
+ aidct_core: enLocaleResources
43
+ },
44
+ fr: {
45
+ aidct_core: frLocaleResources
46
+ }
47
+ };
48
+ // Explicit type is necessary because type can't be inferred without additional references.
49
+ export const i18nextCore = i18next.createInstance();
33
50
  /**
34
51
  * Initialize internationalization.
35
52
  *
36
53
  * @param i18next
37
- * Internationalization object. As multiple objects exists, this parameter represents the one for the module for which
54
+ * Internationalization object. As multiple objects exist, this parameter represents the one for the module for which
38
55
  * internationalization is being initialized.
39
56
  *
40
57
  * @param environment
@@ -46,52 +63,80 @@ function toLowerCase(s) {
46
63
  * @param defaultNS
47
64
  * Default namespace.
48
65
  *
49
- * @param resources
50
- * Resources.
66
+ * @param defaultResourceBundle
67
+ * Default resource bundle.
68
+ *
69
+ * @param i18nDependencyInits
70
+ * Dependency internationalization initialization functions.
51
71
  *
52
72
  * @returns
53
- * Void promise.
73
+ * Default resource bundle.
54
74
  */
55
- export async function i18nCoreInit(i18next, environment, debug, defaultNS, ...resources) {
75
+ export async function i18nInit(i18next, environment, debug, defaultNS, defaultResourceBundle, ...i18nDependencyInits) {
56
76
  // Initialization may be called more than once.
57
77
  if (!i18next.isInitialized) {
58
- const mergedResource = {};
59
- // Merge resources.
60
- for (const resource of resources) {
78
+ const mergedResourceBundle = {};
79
+ /**
80
+ * Merge a package resource bundle into the merged resource bundle.
81
+ *
82
+ * @param resourceBundle
83
+ * Package resource bundle.
84
+ */
85
+ function mergeResourceBundle(resourceBundle) {
61
86
  // Merge languages.
62
- for (const [language, resourceLanguage] of Object.entries(resource)) {
63
- if (!(language in mergedResource)) {
64
- mergedResource[language] = {};
87
+ for (const [language, languageResourceBundle] of Object.entries(resourceBundle)) {
88
+ if (!(language in mergedResourceBundle)) {
89
+ mergedResourceBundle[language] = {};
65
90
  }
66
- const mergedResourceLanguage = mergedResource[language];
91
+ const mergedLanguageResourceBundle = mergedResourceBundle[language];
67
92
  // Merge namespaces.
68
- for (const [namespace, resourceKey] of Object.entries(resourceLanguage)) {
69
- mergedResourceLanguage[namespace] = resourceKey;
93
+ for (const [namespace, resourceKey] of Object.entries(languageResourceBundle)) {
94
+ mergedLanguageResourceBundle[namespace] = resourceKey;
70
95
  }
71
96
  }
72
97
  }
73
- let module;
74
- switch (environment) {
75
- case I18nEnvironments.CLI:
76
- // TODO Refactor when https://github.com/neet/i18next-cli-language-detector/issues/281 resolved.
77
- // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Per above.
78
- module = I18nextCLILanguageDetector;
79
- break;
80
- case I18nEnvironments.Browser:
81
- module = I18nextBrowserLanguageDetector;
82
- break;
83
- default:
84
- throw new Error("Not supported");
85
- }
86
- await i18next.use(module).init({
98
+ mergeResourceBundle(defaultResourceBundle);
99
+ // Initialize dependencies and merge their resource bundles.
100
+ await Promise.all(i18nDependencyInits.map(async (i18nDependencyInit) => i18nDependencyInit(environment, debug).then(mergeResourceBundle))).then(() => {
101
+ let module;
102
+ switch (environment) {
103
+ case I18nEnvironments.CLI:
104
+ // TODO Refactor when https://github.com/neet/i18next-cli-language-detector/issues/281 resolved.
105
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Per above.
106
+ module = I18nextCLILanguageDetector;
107
+ break;
108
+ case I18nEnvironments.Browser:
109
+ module = I18nextBrowserLanguageDetector;
110
+ break;
111
+ default:
112
+ throw new Error("Not supported");
113
+ }
114
+ return module;
115
+ }).then(async (module) => i18next.use(module).init({
87
116
  debug,
88
- resources: mergedResource,
117
+ resources: mergedResourceBundle,
89
118
  fallbackLng: "en",
90
119
  defaultNS
91
- }).then(() => {
120
+ })).then(() => {
92
121
  // Add toLowerCase function.
93
122
  i18next.services.formatter?.add("toLowerCase", value => typeof value === "string" ? toLowerCase(value) : String(value));
94
123
  });
95
124
  }
125
+ return defaultResourceBundle;
126
+ }
127
+ /**
128
+ * Initialize internationalization.
129
+ *
130
+ * @param environment
131
+ * Environment in which the application is running.
132
+ *
133
+ * @param debug
134
+ * Debug setting.
135
+ *
136
+ * @returns
137
+ * Core resource bundle.
138
+ */
139
+ export async function i18nCoreInit(environment, debug = false) {
140
+ return i18nInit(i18nextCore, environment, debug, coreNS, coreResourceBundle);
96
141
  }
97
142
  //# sourceMappingURL=i18n.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/locale/i18n.ts"],"names":[],"mappings":"AACA,OAAO,8BAA8B,MAAM,kCAAkC,CAAC;AAC9E,OAAO,0BAA0B,MAAM,+BAA+B,CAAC;AASvE;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC5B;;OAEG;IACH,GAAG,EAAE,CAAC;IAEN;;OAEG;IACH,MAAM,EAAE,CAAC;IAET;;OAEG;IACH,OAAO,EAAE,CAAC;CACJ,CAAC;AAYX;;;;;;;;GAQG;AACH,SAAS,WAAW,CAAC,CAAS;IAC1B,+EAA+E;IAC/E,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,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