@digitaldefiance/suite-core-lib 1.0.2 โ†’ 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -182,22 +182,29 @@ const userSchema = new mongoose.Schema<IBackendUser<'en'>>({
182
182
 
183
183
  ## ๐Ÿ”ง Advanced Configuration
184
184
 
185
- ### Custom Model Extensions
185
+ ### Custom Model Extensions & Dynamic Registration
186
186
 
187
- ```typescript
188
- import { BaseModelName, ExtendedModelName } from '@digitaldefiance/suite-core-lib';
187
+ > **Note:** The static `ModelName` and `BaseModelName` enums are deprecated. For extensibility, use dynamic model registration (see `ModelRegistry` in `node-express-suite`).
189
188
 
190
- // Extend the base models for your application
191
- enum CustomModels {
192
- Organization = 'Organization',
193
- Subscription = 'Subscription',
194
- AuditLog = 'AuditLog'
195
- }
189
+ You can now register and extend models dynamically:
190
+
191
+ ```typescript
192
+ import { ModelRegistry } from '@digitaldefiance/node-express-suite';
193
+
194
+ // Register a custom model (e.g., Organization)
195
+ ModelRegistry.instance.register({
196
+ modelName: 'Organization',
197
+ schema: organizationSchema,
198
+ model: OrganizationModel,
199
+ collection: 'organizations',
200
+ });
196
201
 
197
- type AppModelName = ExtendedModelName<typeof CustomModels>;
198
- // Includes: User, Role, EmailToken, Mnemonic, UserRole, Organization, Subscription, AuditLog
202
+ // Retrieve a model anywhere in your app
203
+ const orgModel = ModelRegistry.instance.get('Organization')?.model;
199
204
  ```
200
205
 
206
+ This approach allows other libraries and apps to extend or override models at runtime, supporting advanced use cases like multi-tenancy and plugin architectures.
207
+
201
208
  ### Email Token Types
202
209
 
203
210
  ```typescript
@@ -243,6 +250,36 @@ The **@digitaldefiance/node-ecies** and **@digitaldefiance/node-express-suite**
243
250
 
244
251
  ## ๐Ÿงช Testing & Quality
245
252
 
253
+ ## ๐Ÿ› ๏ธ Runtime Configuration Registry
254
+
255
+ This package uses a runtime configuration registry for all constants and cryptographic parameters. You can override defaults at runtime for advanced use cases:
256
+
257
+ ```typescript
258
+ import {
259
+ getSuiteCoreRuntimeConfiguration,
260
+ registerSuiteCoreRuntimeConfiguration,
261
+ } from '@digitaldefiance/suite-core-lib';
262
+
263
+ // Get current config
264
+ const config = getSuiteCoreRuntimeConfiguration();
265
+
266
+ // Register a custom config
267
+ const customKey = Symbol('custom-suite-core-config');
268
+ registerSuiteCoreRuntimeConfiguration(customKey, 'example.com', { BcryptRounds: 12 });
269
+ const customConfig = getSuiteCoreRuntimeConfiguration(customKey);
270
+ ```
271
+
272
+ All constants are immutable and accessible via the registry/config API. See `src/constants.ts` and `src/defaults.ts` for details.
273
+
274
+ ## ๐Ÿ›๏ธ Architectural Conventions
275
+
276
+ - Centralized constants file
277
+ - Immutability via Object.freeze
278
+ - Registry/config pattern for runtime overrides
279
+ - Type-safe interfaces for all config objects
280
+
281
+ ## ๐Ÿงช Testing & Quality
282
+
246
283
  ```bash
247
284
  # Run the comprehensive test suite
248
285
  yarn test
@@ -1,6 +1,7 @@
1
- import { IBackupCodeConstants } from './interfaces';
1
+ import { IBackupCodeConstants, ICoreConstants } from './interfaces';
2
2
  import { IConstants } from './interfaces/constants';
3
3
  export declare const BACKUP_CODES: IBackupCodeConstants;
4
+ export declare const CORE: ICoreConstants;
4
5
  export declare const createConstants: (siteDomain: string, overrides?: Partial<IConstants>) => IConstants;
5
6
  export declare const Constants: IConstants;
6
7
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,eAAO,MAAM,YAAY,EAAE,oBAOhB,CAAC;AAEZ,eAAO,MAAM,eAAe,EAAE,CAC5B,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,KAC5B,UAqHJ,CAAC;AAEF,eAAO,MAAM,SAAS,YAA+B,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,eAAO,MAAM,YAAY,EAAE,oBAOhB,CAAC;AAEZ,eAAO,MAAM,IAAI,EAAE,cAoGR,CAAC;AAEZ,eAAO,MAAM,eAAe,EAAE,CAC5B,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,KAC5B,UAiBJ,CAAC;AAEF,eAAO,MAAM,SAAS,YAA+B,CAAC"}
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Constants = exports.createConstants = exports.BACKUP_CODES = void 0;
3
+ exports.Constants = exports.createConstants = exports.CORE = exports.BACKUP_CODES = void 0;
4
4
  const role_1 = require("./enumerations/role");
5
5
  exports.BACKUP_CODES = Object.freeze({
6
6
  /**
@@ -10,116 +10,118 @@ exports.BACKUP_CODES = Object.freeze({
10
10
  NormalizedHexRegex: /^[a-z0-9]{32}$/, // exactly 32 lowercase alphanumeric chars
11
11
  DisplayRegex: /^([a-z0-9]{4}-){7}[a-z0-9]{4}$/, // xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx
12
12
  });
13
+ exports.CORE = Object.freeze({
14
+ /**
15
+ * Default duration in seconds for which a mnemonic is kept in memory
16
+ */
17
+ DefaultExpireMemoryMnemonicSeconds: 300, // 5 minutes
18
+ /**
19
+ * Default duration in seconds for which a wallet is kept in memory
20
+ */
21
+ DefaultExpireMemoryWalletSeconds: 300, // 5 minutes
22
+ /**
23
+ * Duration in milliseconds for which a login challenge is valid.
24
+ */
25
+ LoginChallengeExpiration: 60000, // 60 seconds
26
+ /**
27
+ * The expected length of a direct login challenge in bytes
28
+ */
29
+ DirectLoginChallengeLength: 104,
30
+ /**
31
+ * Backup code system configuration
32
+ */
33
+ BACKUP_CODES: exports.BACKUP_CODES,
34
+ /**
35
+ * Duration in milliseconds for which an email token is valid.
36
+ */
37
+ EmailTokenExpiration: 86400000, // 24 * 60 * 60 * 1000
38
+ /**
39
+ * Length in bytes of the email token generated (is represented as a hex string of twice as many)
40
+ */
41
+ EmailTokenLength: 32,
42
+ /**
43
+ * Number of rounds for bcrypt hashing. Higher values increase security but also consume more CPU resources.
44
+ */
45
+ BcryptRounds: 10,
46
+ /**
47
+ * The username of the administrator user.
48
+ */
49
+ AdministratorUser: 'admin',
50
+ /**
51
+ * The name of the administrator role.
52
+ */
53
+ AdministratorRole: role_1.Role.Admin,
54
+ /**
55
+ * The name of the member role.
56
+ */
57
+ MemberRole: role_1.Role.Member,
58
+ /**
59
+ * The username of the test user.
60
+ */
61
+ MemberUser: 'test',
62
+ /**
63
+ * The name of the system role.
64
+ */
65
+ SystemRole: role_1.Role.System,
66
+ /**
67
+ * The username of the system user.
68
+ */
69
+ SystemUser: 'system',
70
+ /**
71
+ * Minimum username length
72
+ */
73
+ UsernameMinLength: 3,
74
+ /**
75
+ * Maximum username length
76
+ */
77
+ UsernameMaxLength: 30,
78
+ /**
79
+ * The regular expression for valid usernames.
80
+ */
81
+ UsernameRegex: /^[A-Za-z0-9]{3,30}$/,
82
+ /**
83
+ * Minimum password length
84
+ */
85
+ PasswordMinLength: 8,
86
+ /**
87
+ * The regular expression for valid passwords.
88
+ */
89
+ PasswordRegex: /^(?=.*[A-Za-z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?])[A-Za-z\d!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]{8,}$/,
90
+ /**
91
+ * The regular expression for valid mnemonic phrases.
92
+ * BIP39 - supports 12, 15, 18, 21, or 24 word mnemonics
93
+ */
94
+ MnemonicRegex: /^(?:\w+\s){11}\w+$|^(?:\w+\s){14}\w+$|^(?:\w+\s){17}\w+$|^(?:\w+\s){20}\w+$|^(?:\w+\s){23}\w+$/i,
95
+ /**
96
+ * Matches a 64-character hexadecimal string (SHA-256).
97
+ */
98
+ HmacRegex: /^[a-f0-9]{64}$/,
99
+ /**
100
+ * The amount of time in milliseconds after which an email token can be resent.
101
+ */
102
+ EmailTokenResendInterval: 300000, // 5 * 60 * 1000 = 5 minutes
103
+ /**
104
+ * The interval in minutes after which an email token can be resent.
105
+ */
106
+ EmailTokenResendIntervalMinutes: 5,
107
+ });
13
108
  const createConstants = (siteDomain, overrides) => {
14
- const result = {
15
- /**
16
- * Default duration in seconds for which a mnemonic is kept in memory
17
- */
18
- DefaultExpireMemoryMnemonicSeconds: 300, // 5 minutes
19
- /**
20
- * Default duration in seconds for which a wallet is kept in memory
21
- */
22
- DefaultExpireMemoryWalletSeconds: 300, // 5 minutes
23
- /**
24
- * Duration in milliseconds for which a login challenge is valid.
25
- */
26
- LoginChallengeExpiration: 60000, // 60 seconds
27
- /**
28
- * The expected length of a direct login challenge in bytes
29
- */
30
- DirectLoginChallengeLength: 104,
31
- /**
32
- * Backup code system configuration
33
- */
34
- BACKUP_CODES: exports.BACKUP_CODES,
35
- /**
36
- * Duration in milliseconds for which an email token is valid.
37
- */
38
- EmailTokenExpiration: 86400000, // 24 * 60 * 60 * 1000
39
- /**
40
- * Length in bytes of the email token generated (is represented as a hex string of twice as many)
41
- */
42
- EmailTokenLength: 32,
43
- /**
44
- * Number of rounds for bcrypt hashing. Higher values increase security but also consume more CPU resources.
45
- */
46
- BcryptRounds: 10,
47
- /**
48
- * The username of the administrator user.
49
- */
50
- AdministratorUser: 'admin',
51
- /**
52
- * The name of the administrator role.
53
- */
54
- AdministratorRole: role_1.Role.Admin,
109
+ return Object.freeze({
110
+ ...exports.CORE,
55
111
  /**
56
112
  * The email of the administrator user/admin contact
57
113
  */
58
114
  AdministratorEmail: `admin@${siteDomain}`,
59
- /**
60
- * The name of the member role.
61
- */
62
- MemberRole: role_1.Role.Member,
63
115
  /**
64
116
  * The email of the test user.
65
117
  */
66
118
  MemberEmail: `test@${siteDomain}`,
67
- /**
68
- * The username of the test user.
69
- */
70
- MemberUser: 'test',
71
- /**
72
- * The name of the system role.
73
- */
74
- SystemRole: role_1.Role.System,
75
- /**
76
- * The username of the system user.
77
- */
78
- SystemUser: 'system',
79
119
  /**
80
120
  * The email of the system user.
81
121
  */
82
122
  SystemEmail: `system@${siteDomain}`,
83
- /**
84
- * Minimum username length
85
- */
86
- UsernameMinLength: 3,
87
- /**
88
- * Maximum username length
89
- */
90
- UsernameMaxLength: 30,
91
- /**
92
- * The regular expression for valid usernames.
93
- */
94
- UsernameRegex: /^[A-Za-z0-9]{3,30}$/,
95
- /**
96
- * Minimum password length
97
- */
98
- PasswordMinLength: 8,
99
- /**
100
- * The regular expression for valid passwords.
101
- */
102
- PasswordRegex: /^(?=.*[A-Za-z])(?=.*\d)(?=.*[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?])[A-Za-z\d!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]{8,}$/,
103
- /**
104
- * The regular expression for valid mnemonic phrases.
105
- * BIP39 - supports 12, 15, 18, 21, or 24 word mnemonics
106
- */
107
- MnemonicRegex: /^(?:\w+\s){11}\w+$|^(?:\w+\s){14}\w+$|^(?:\w+\s){17}\w+$|^(?:\w+\s){20}\w+$|^(?:\w+\s){23}\w+$/i,
108
- /**
109
- * Matches a 64-character hexadecimal string (SHA-256).
110
- */
111
- HmacRegex: /^[a-f0-9]{64}$/,
112
- /**
113
- * The amount of time in milliseconds after which an email token can be resent.
114
- */
115
- EmailTokenResendInterval: 300000, // 5 * 60 * 1000 = 5 minutes
116
- /**
117
- * The interval in minutes after which an email token can be resent.
118
- */
119
- EmailTokenResendIntervalMinutes: 5,
120
123
  ...(overrides ?? {}),
121
- };
122
- return Object.freeze(result);
124
+ });
123
125
  };
124
126
  exports.createConstants = createConstants;
125
127
  exports.Constants = (0, exports.createConstants)('localhost');
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,8CAA2C;AAI9B,QAAA,YAAY,GAAyB,MAAM,CAAC,MAAM,CAAC;IAC9D;;OAEG;IACH,KAAK,EAAE,EAAW;IAClB,kBAAkB,EAAE,gBAAgB,EAAE,0CAA0C;IAChF,YAAY,EAAE,gCAAgC,EAAE,0CAA0C;CAClF,CAAC,CAAC;AAEL,MAAM,eAAe,GAGV,CAAC,UAAkB,EAAE,SAA+B,EAAE,EAAE;IACxE,MAAM,MAAM,GAAG;QACb;;WAEG;QACH,kCAAkC,EAAE,GAAY,EAAE,YAAY;QAC9D;;WAEG;QACH,gCAAgC,EAAE,GAAY,EAAE,YAAY;QAE5D;;WAEG;QACH,wBAAwB,EAAE,KAAc,EAAE,aAAa;QAEvD;;WAEG;QACH,0BAA0B,EAAE,GAAY;QAExC;;WAEG;QACH,YAAY,EAAE,oBAAY;QAE1B;;WAEG;QACH,oBAAoB,EAAE,QAAiB,EAAE,sBAAsB;QAC/D;;WAEG;QACH,gBAAgB,EAAE,EAAW;QAC7B;;WAEG;QACH,YAAY,EAAE,EAAW;QACzB;;WAEG;QACH,iBAAiB,EAAE,OAAgB;QACnC;;WAEG;QACH,iBAAiB,EAAE,WAAI,CAAC,KAAc;QACtC;;WAEG;QACH,kBAAkB,EAAE,SAAS,UAAU,EAAW;QAClD;;WAEG;QACH,UAAU,EAAE,WAAI,CAAC,MAAe;QAChC;;WAEG;QACH,WAAW,EAAE,QAAQ,UAAU,EAAW;QAC1C;;WAEG;QACH,UAAU,EAAE,MAAe;QAC3B;;WAEG;QACH,UAAU,EAAE,WAAI,CAAC,MAAe;QAChC;;WAEG;QACH,UAAU,EAAE,QAAiB;QAC7B;;WAEG;QACH,WAAW,EAAE,UAAU,UAAU,EAAW;QAC5C;;WAEG;QACH,iBAAiB,EAAE,CAAU;QAC7B;;WAEG;QACH,iBAAiB,EAAE,EAAW;QAC9B;;WAEG;QACH,aAAa,EAAE,qBAAqB;QACpC;;WAEG;QACH,iBAAiB,EAAE,CAAU;QAC7B;;WAEG;QACH,aAAa,EACX,kHAAkH;QACpH;;;WAGG;QACH,aAAa,EACX,iGAAiG;QACnG;;WAEG;QACH,SAAS,EAAE,gBAAgB;QAC3B;;WAEG;QACH,wBAAwB,EAAE,MAAe,EAAE,4BAA4B;QACvE;;WAEG;QACH,+BAA+B,EAAE,CAAU;QAC3C,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;KACZ,CAAC;IAEX,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAxHW,QAAA,eAAe,mBAwH1B;AAEW,QAAA,SAAS,GAAG,IAAA,uBAAe,EAAC,WAAW,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA,8CAA2C;AAI9B,QAAA,YAAY,GAAyB,MAAM,CAAC,MAAM,CAAC;IAC9D;;OAEG;IACH,KAAK,EAAE,EAAW;IAClB,kBAAkB,EAAE,gBAAgB,EAAE,0CAA0C;IAChF,YAAY,EAAE,gCAAgC,EAAE,0CAA0C;CAClF,CAAC,CAAC;AAEC,QAAA,IAAI,GAAmB,MAAM,CAAC,MAAM,CAAC;IAChD;;OAEG;IACH,kCAAkC,EAAE,GAAY,EAAE,YAAY;IAC9D;;OAEG;IACH,gCAAgC,EAAE,GAAY,EAAE,YAAY;IAE5D;;OAEG;IACH,wBAAwB,EAAE,KAAc,EAAE,aAAa;IAEvD;;OAEG;IACH,0BAA0B,EAAE,GAAY;IAExC;;OAEG;IACH,YAAY,EAAE,oBAAY;IAE1B;;OAEG;IACH,oBAAoB,EAAE,QAAiB,EAAE,sBAAsB;IAC/D;;OAEG;IACH,gBAAgB,EAAE,EAAW;IAC7B;;OAEG;IACH,YAAY,EAAE,EAAW;IACzB;;OAEG;IACH,iBAAiB,EAAE,OAAgB;IACnC;;OAEG;IACH,iBAAiB,EAAE,WAAI,CAAC,KAAc;IACtC;;OAEG;IACH,UAAU,EAAE,WAAI,CAAC,MAAe;IAChC;;OAEG;IACH,UAAU,EAAE,MAAe;IAC3B;;OAEG;IACH,UAAU,EAAE,WAAI,CAAC,MAAe;IAChC;;OAEG;IACH,UAAU,EAAE,QAAiB;IAC7B;;OAEG;IACH,iBAAiB,EAAE,CAAU;IAC7B;;OAEG;IACH,iBAAiB,EAAE,EAAW;IAC9B;;OAEG;IACH,aAAa,EAAE,qBAAqB;IACpC;;OAEG;IACH,iBAAiB,EAAE,CAAU;IAC7B;;OAEG;IACH,aAAa,EACX,kHAAkH;IACpH;;;OAGG;IACH,aAAa,EACX,iGAAiG;IACnG;;OAEG;IACH,SAAS,EAAE,gBAAgB;IAC3B;;OAEG;IACH,wBAAwB,EAAE,MAAe,EAAE,4BAA4B;IACvE;;OAEG;IACH,+BAA+B,EAAE,CAAU;CACnC,CAAC,CAAC;AAEL,MAAM,eAAe,GAGV,CAAC,UAAkB,EAAE,SAA+B,EAAE,EAAE;IACxE,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,YAAI;QACP;;WAEG;QACH,kBAAkB,EAAE,SAAS,UAAU,EAAW;QAClD;;WAEG;QACH,WAAW,EAAE,QAAQ,UAAU,EAAW;QAC1C;;WAEG;QACH,WAAW,EAAE,UAAU,UAAU,EAAW;QAC5C,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;KACZ,CAAC,CAAC;AACd,CAAC,CAAC;AApBW,QAAA,eAAe,mBAoB1B;AAEW,QAAA,SAAS,GAAG,IAAA,uBAAe,EAAC,WAAW,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { IConstants } from './interfaces/constants';
2
+ import { DeepPartial } from './interfaces/deep-partial';
3
+ export type ConfigurationKey = string | symbol;
4
+ export declare function createSuiteCoreRuntimeConfiguration(siteDomain?: string, overrides?: DeepPartial<IConstants>): IConstants;
5
+ export declare function registerSuiteCoreRuntimeConfiguration(key?: ConfigurationKey, siteDomain?: string, overrides?: DeepPartial<IConstants>): IConstants;
6
+ export declare function getSuiteCoreRuntimeConfiguration(key?: ConfigurationKey): IConstants;
7
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAAC;AA2C/C,wBAAgB,mCAAmC,CACjD,UAAU,GAAE,MAAoB,EAChC,SAAS,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,GAClC,UAAU,CAGZ;AAED,wBAAgB,qCAAqC,CACnD,GAAG,GAAE,gBAA4C,EACjD,UAAU,GAAE,MAAoB,EAChC,SAAS,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,GAClC,UAAU,CAIZ;AAED,wBAAgB,gCAAgC,CAC9C,GAAG,GAAE,gBAA4C,GAChD,UAAU,CAKZ"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSuiteCoreRuntimeConfiguration = createSuiteCoreRuntimeConfiguration;
4
+ exports.registerSuiteCoreRuntimeConfiguration = registerSuiteCoreRuntimeConfiguration;
5
+ exports.getSuiteCoreRuntimeConfiguration = getSuiteCoreRuntimeConfiguration;
6
+ const constants_1 = require("./constants");
7
+ const DEFAULT_CONFIGURATION_KEY = Symbol.for('digitaldefiance.suite-core.defaults.default');
8
+ const registry = new Map();
9
+ function deepClone(input) {
10
+ if (input === null || typeof input !== 'object')
11
+ return input;
12
+ if (Array.isArray(input))
13
+ return input.map(deepClone);
14
+ if (input instanceof RegExp)
15
+ return new RegExp(input.source, input.flags);
16
+ if (input instanceof Date)
17
+ return new Date(input.getTime());
18
+ const result = {};
19
+ for (const [key, value] of Object.entries(input)) {
20
+ result[key] = deepClone(value);
21
+ }
22
+ return result;
23
+ }
24
+ function deepFreeze(obj) {
25
+ Object.freeze(obj);
26
+ Object.getOwnPropertyNames(obj).forEach((prop) => {
27
+ const value = obj[prop];
28
+ if (value && typeof value === 'object' && !Object.isFrozen(value)) {
29
+ deepFreeze(value);
30
+ }
31
+ });
32
+ return obj;
33
+ }
34
+ function applyOverrides(target, overrides) {
35
+ if (!overrides)
36
+ return target;
37
+ const result = deepClone(target);
38
+ for (const [key, value] of Object.entries(overrides)) {
39
+ if (value !== undefined) {
40
+ result[key] = value;
41
+ }
42
+ }
43
+ return result;
44
+ }
45
+ function createSuiteCoreRuntimeConfiguration(siteDomain = 'localhost', overrides) {
46
+ const config = applyOverrides((0, constants_1.createConstants)(siteDomain), overrides);
47
+ return deepFreeze(config);
48
+ }
49
+ function registerSuiteCoreRuntimeConfiguration(key = DEFAULT_CONFIGURATION_KEY, siteDomain = 'localhost', overrides) {
50
+ const config = createSuiteCoreRuntimeConfiguration(siteDomain, overrides);
51
+ registry.set(key, config);
52
+ return config;
53
+ }
54
+ function getSuiteCoreRuntimeConfiguration(key = DEFAULT_CONFIGURATION_KEY) {
55
+ if (!registry.has(key)) {
56
+ registry.set(key, createSuiteCoreRuntimeConfiguration());
57
+ }
58
+ return registry.get(key);
59
+ }
60
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"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"}
package/dist/index.d.ts CHANGED
@@ -4,4 +4,5 @@ export * from './enumerations';
4
4
  export * from './errors';
5
5
  export * from './i18n-setup';
6
6
  export * from './interfaces';
7
+ export * from './defaults';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAE7B,cAAc,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -20,4 +20,5 @@ __exportStar(require("./enumerations"), exports);
20
20
  __exportStar(require("./errors"), exports);
21
21
  __exportStar(require("./i18n-setup"), exports);
22
22
  __exportStar(require("./interfaces"), exports);
23
+ __exportStar(require("./defaults"), exports);
23
24
  //# 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":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,8CAA4B;AAC5B,iDAA+B;AAC/B,2CAAyB;AACzB,+CAA6B;AAC7B,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,8CAA4B;AAC5B,iDAA+B;AAC/B,2CAAyB;AACzB,+CAA6B;AAC7B,+CAA6B;AAE7B,6CAA2B"}
@@ -1 +1 @@
1
- {"version":3,"file":"email-token.d.ts","sourceRoot":"","sources":["../../../src/interfaces/bases/email-token.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,eAAe,CAC9B,CAAC,EACD,CAAC,SAAS,IAAI,GAAG,MAAM,EACvB,CAAC,SAAS,cAAc,GAAG,MAAM,CACjC,SAAQ,MAAM,CAAC,CAAC,CAAC,EACf,cAAc,CAAC,CAAC,CAAC;IACnB;;OAEG;IACH,MAAM,EAAE,CAAC,CAAC;IACV;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC;IACR;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb;;OAEG;IACH,SAAS,EAAE,CAAC,CAAC;CACd"}
1
+ {"version":3,"file":"email-token.d.ts","sourceRoot":"","sources":["../../../src/interfaces/bases/email-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,eAAe,CAC9B,CAAC,EACD,CAAC,SAAS,IAAI,GAAG,MAAM,EACvB,CAAC,SAAS,cAAc,GAAG,MAAM,CACjC,SAAQ,MAAM,CAAC,CAAC,CAAC,EACf,cAAc,CAAC,CAAC,CAAC;IACnB;;OAEG;IACH,MAAM,EAAE,CAAC,CAAC;IACV;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC;IACR;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb;;OAEG;IACH,SAAS,EAAE,CAAC,CAAC;CACd"}
@@ -1 +1 @@
1
- {"version":3,"file":"token-role.d.ts","sourceRoot":"","sources":["../../../src/interfaces/bases/token-role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,WAAW,UAAU,CACzB,CAAC,EACD,CAAC,SAAS,IAAI,GAAG,MAAM,GAAG,IAAI,CAC9B,SAAQ,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;IACvB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB"}
1
+ {"version":3,"file":"token-role.d.ts","sourceRoot":"","sources":["../../../src/interfaces/bases/token-role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,WAAW,UAAU,CAAC,CAAC,EAAE,CAAC,SAAS,IAAI,GAAG,MAAM,GAAG,IAAI,CAC3D,SAAQ,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;IACvB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB"}
@@ -1,5 +1,6 @@
1
1
  import { IBackupCodeConstants } from './backup-code-consts';
2
- export interface IConstants {
2
+ import { ICoreConstants } from './core-consts';
3
+ export interface IConstants extends ICoreConstants {
3
4
  /**
4
5
  * Backup code related constants
5
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/interfaces/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,YAAY,EAAE,oBAAoB,CAAC;IACnC;;OAEG;IACH,wBAAwB,EAAE,MAAM,CAAC;IACjC;;OAEG;IACH,kCAAkC,EAAE,MAAM,CAAC;IAC3C;;OAEG;IACH,gCAAgC,EAAE,MAAM,CAAC;IACzC;;OAEG;IACH,0BAA0B,EAAE,MAAM,CAAC;IACnC;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,wBAAwB,EAAE,MAAM,CAAC;IACjC;;OAEG;IACH,+BAA+B,EAAE,MAAM,CAAC;CACzC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/interfaces/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD;;OAEG;IACH,YAAY,EAAE,oBAAoB,CAAC;IACnC;;OAEG;IACH,wBAAwB,EAAE,MAAM,CAAC;IACjC;;OAEG;IACH,kCAAkC,EAAE,MAAM,CAAC;IAC3C;;OAEG;IACH,gCAAgC,EAAE,MAAM,CAAC;IACzC;;OAEG;IACH,0BAA0B,EAAE,MAAM,CAAC;IACnC;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,wBAAwB,EAAE,MAAM,CAAC;IACjC;;OAEG;IACH,+BAA+B,EAAE,MAAM,CAAC;CACzC"}
@@ -0,0 +1,97 @@
1
+ import { IBackupCodeConstants } from './backup-code-consts';
2
+ export interface ICoreConstants {
3
+ /**
4
+ * Backup code related constants
5
+ */
6
+ BACKUP_CODES: IBackupCodeConstants;
7
+ /**
8
+ * Duration in milliseconds for a login challenge
9
+ */
10
+ LoginChallengeExpiration: number;
11
+ /**
12
+ * Default duration in seconds for which mnemonics are kept in memory
13
+ */
14
+ DefaultExpireMemoryMnemonicSeconds: number;
15
+ /**
16
+ * Default duration in seconds for which wallets are kept in memory
17
+ */
18
+ DefaultExpireMemoryWalletSeconds: number;
19
+ /**
20
+ * The expected length of a direct login challenge in bytes
21
+ */
22
+ DirectLoginChallengeLength: number;
23
+ /**
24
+ * Duration in milliseconds for which an email token is valid.
25
+ */
26
+ EmailTokenExpiration: number;
27
+ /**
28
+ * Length in bytes of the email token generated (is represented as a hex string of twice as many)
29
+ */
30
+ EmailTokenLength: number;
31
+ /**
32
+ * Number of rounds for bcrypt hashing. Higher values increase security but also consume more CPU resources.
33
+ */
34
+ BcryptRounds: number;
35
+ /**
36
+ * The username of the administrator user.
37
+ */
38
+ AdministratorUser: string;
39
+ /**
40
+ * The name of the administrator role.
41
+ */
42
+ AdministratorRole: string;
43
+ /**
44
+ * The name of the member role.
45
+ */
46
+ MemberRole: string;
47
+ /**
48
+ * The username of the test user.
49
+ */
50
+ MemberUser: string;
51
+ /**
52
+ * The name of the system role.
53
+ */
54
+ SystemRole: string;
55
+ /**
56
+ * The username of the system user.
57
+ */
58
+ SystemUser: string;
59
+ /**
60
+ * Minimum username length
61
+ */
62
+ UsernameMinLength: number;
63
+ /**
64
+ * Maximum username length
65
+ */
66
+ UsernameMaxLength: number;
67
+ /**
68
+ * The regular expression for valid usernames.
69
+ */
70
+ UsernameRegex: RegExp;
71
+ /**
72
+ * Minimum password length
73
+ */
74
+ PasswordMinLength: number;
75
+ /**
76
+ * The regular expression for valid passwords.
77
+ */
78
+ PasswordRegex: RegExp;
79
+ /**
80
+ * The regular expression for valid mnemonic phrases.
81
+ * BIP39
82
+ */
83
+ MnemonicRegex: RegExp;
84
+ /**
85
+ * The regular expression for valid HMAC keys.
86
+ */
87
+ HmacRegex: RegExp;
88
+ /**
89
+ * The amount of time in milliseconds after which an email token can be resent.
90
+ */
91
+ EmailTokenResendInterval: number;
92
+ /**
93
+ * The interval in minutes after which an email token can be resent.
94
+ */
95
+ EmailTokenResendIntervalMinutes: number;
96
+ }
97
+ //# sourceMappingURL=core-consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-consts.d.ts","sourceRoot":"","sources":["../../src/interfaces/core-consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,YAAY,EAAE,oBAAoB,CAAC;IACnC;;OAEG;IACH,wBAAwB,EAAE,MAAM,CAAC;IACjC;;OAEG;IACH,kCAAkC,EAAE,MAAM,CAAC;IAC3C;;OAEG;IACH,gCAAgC,EAAE,MAAM,CAAC;IACzC;;OAEG;IACH,0BAA0B,EAAE,MAAM,CAAC;IACnC;;OAEG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,wBAAwB,EAAE,MAAM,CAAC;IACjC;;OAEG;IACH,+BAA+B,EAAE,MAAM,CAAC;CACzC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=core-consts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core-consts.js","sourceRoot":"","sources":["../../src/interfaces/core-consts.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export type DeepPartial<T> = {
2
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
3
+ };
4
+ //# sourceMappingURL=deep-partial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-partial.d.ts","sourceRoot":"","sources":["../../src/interfaces/deep-partial.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=deep-partial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-partial.js","sourceRoot":"","sources":["../../src/interfaces/deep-partial.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"has-soft-deleter.d.ts","sourceRoot":"","sources":["../../src/interfaces/has-soft-deleter.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,CAAC;CACf"}
1
+ {"version":3,"file":"has-soft-deleter.d.ts","sourceRoot":"","sources":["../../src/interfaces/has-soft-deleter.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,CAAC;CACf"}
@@ -2,6 +2,7 @@ export * from './backup-code';
2
2
  export * from './backup-code-consts';
3
3
  export * from './bases';
4
4
  export * from './constants';
5
+ export * from './core-consts';
5
6
  export * from './dto';
6
7
  export * from './has-creation';
7
8
  export * from './has-creator';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,OAAO,CAAC;AACtB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC"}
@@ -18,6 +18,7 @@ __exportStar(require("./backup-code"), exports);
18
18
  __exportStar(require("./backup-code-consts"), exports);
19
19
  __exportStar(require("./bases"), exports);
20
20
  __exportStar(require("./constants"), exports);
21
+ __exportStar(require("./core-consts"), exports);
21
22
  __exportStar(require("./dto"), exports);
22
23
  __exportStar(require("./has-creation"), exports);
23
24
  __exportStar(require("./has-creator"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,uDAAqC;AACrC,0CAAwB;AACxB,8CAA4B;AAC5B,wCAAsB;AACtB,iDAA+B;AAC/B,gDAA8B;AAC9B,2CAAyB;AACzB,oDAAkC;AAClC,qDAAmC;AACnC,yDAAuC;AACvC,mDAAiC;AACjC,gDAA8B;AAC9B,gDAA8B;AAC9B,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,uDAAqC;AACrC,0CAAwB;AACxB,8CAA4B;AAC5B,gDAA8B;AAC9B,wCAAsB;AACtB,iDAA+B;AAC/B,gDAA8B;AAC9B,2CAAyB;AACzB,oDAAkC;AAClC,qDAAmC;AACnC,yDAAuC;AACvC,mDAAiC;AACjC,gDAA8B;AAC9B,gDAA8B;AAC9B,2CAAyB"}
@@ -1 +1 @@
1
- {"version":3,"file":"email-token.d.ts","sourceRoot":"","sources":["../../../src/interfaces/models/email-token.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC"}
1
+ {"version":3,"file":"email-token.d.ts","sourceRoot":"","sources":["../../../src/interfaces/models/email-token.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitaldefiance/suite-core-lib",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Generic user system and document system common core for applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,9 +16,9 @@
16
16
  "publish:public": "npm publish --access public"
17
17
  },
18
18
  "dependencies": {
19
- "@digitaldefiance/ecies-lib": "1.0.22",
20
- "@digitaldefiance/i18n-lib": "1.1.2",
21
- "@digitaldefiance/node-ecies-lib": "^1.0.4"
19
+ "@digitaldefiance/ecies-lib": "1.0.27",
20
+ "@digitaldefiance/i18n-lib": "1.1.5",
21
+ "@digitaldefiance/node-ecies-lib": "1.0.9"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@babel/core": "^7.28.4",