@digitaldefiance/ecies-lib 4.2.5 → 4.2.7

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
@@ -305,6 +305,14 @@ This release focuses on eliminating type safety escape hatches while maintaining
305
305
 
306
306
  **Migration Guide:** No migration needed - this is a drop-in replacement for 4.2.x versions
307
307
 
308
+ ### v4.2.7
309
+
310
+ - Minor bump. Fix tests
311
+
312
+ ### v4.2.6
313
+
314
+ - Minor bump. Fix exports
315
+
308
316
  ### v4.2.0
309
317
 
310
318
  - Add idToString/idFromString to id provider
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitaldefiance/ecies-lib",
3
- "version": "4.2.5",
3
+ "version": "4.2.7",
4
4
  "description": "Digital Defiance ECIES Library",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -23,6 +23,9 @@
23
23
  "test:stream": "npx nx test --outputStyle=stream digitaldefiance-ecies-lib",
24
24
  "test:logged": "npx nx test --outputStyle=stream digitaldefiance-ecies-lib 2>&1 | ansifilter -o test.log",
25
25
  "test:coverage": "npx jest --coverage --testPathPattern=digitaldefiance-ecies-lib --coverageReporters=text",
26
+ "check:circular": "madge --circular --extensions ts src/index.ts",
27
+ "check:circular:json": "madge --circular --extensions ts --json src/index.ts",
28
+ "check:circular:enums": "madge --circular --extensions ts src/enumerations/index.ts",
26
29
  "lint": "npx nx lint digitaldefiance-ecies-lib",
27
30
  "lint:fix": "npx nx lint digitaldefiance-ecies-lib --fix",
28
31
  "prettier:check": "prettier --check 'src/**/*.{ts,tsx}'",
@@ -56,7 +59,10 @@
56
59
  },
57
60
  "devDependencies": {
58
61
  "@digitaldefiance/express-suite-test-utils": "1.0.10",
59
- "fast-check": "^4.3.0"
62
+ "@swc/core": "^1.15.3",
63
+ "@swc/jest": "^0.2.39",
64
+ "fast-check": "^4.3.0",
65
+ "madge": "^8.0.0"
60
66
  },
61
67
  "module": "./../../dist/packages/digitaldefiance-ecies-lib/packages/digitaldefiance-ecies-lib/src/index.js",
62
68
  "type": "module"
@@ -8,8 +8,4 @@ export declare const EciesEncryptionTypeMap: Record<EciesEncryptionType, EciesEn
8
8
  export declare const EciesEncryptionTypeStringMap: Record<EciesEncryptionType, string>;
9
9
  export declare const EciesEncryptionTypeEnumTypeMap: Record<EciesEncryptionTypeEnum, EciesEncryptionType>;
10
10
  export declare const EciesEncryptionTypeEnumStringMap: Record<EciesEncryptionTypeEnum, string>;
11
- export declare function encryptionTypeToString(type: EciesEncryptionType | EciesEncryptionTypeEnum): string;
12
- export declare function encryptionTypeEnumToType(type: EciesEncryptionTypeEnum): EciesEncryptionType;
13
- export declare function validateEciesEncryptionTypeEnum(type: EciesEncryptionTypeEnum): boolean;
14
- export declare function ensureEciesEncryptionTypeEnum(type: EciesEncryptionTypeEnum): EciesEncryptionTypeEnum;
15
11
  //# sourceMappingURL=ecies-encryption-type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ecies-encryption-type.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/enumerations/ecies-encryption-type.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEnE,oBAAY,uBAAuB;IACjC,MAAM,KAAK;IACX,MAAM,KAAK;IACX,QAAQ,KAAK;CACd;AAED,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,mBAAmB,EACnB,uBAAuB,CAKxB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAK1E,CAAC;AAEJ,eAAO,MAAM,8BAA8B,EAAE,MAAM,CACjD,uBAAuB,EACvB,mBAAmB,CAKpB,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CACnD,uBAAuB,EACvB,MAAM,CAKP,CAAC;AAEF,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,mBAAmB,GAAG,uBAAuB,GAClD,MAAM,CAsBR;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,uBAAuB,GAC5B,mBAAmB,CASrB;AAED,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAET;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,uBAAuB,GAC5B,uBAAuB,CAQzB"}
1
+ {"version":3,"file":"ecies-encryption-type.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/enumerations/ecies-encryption-type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEnE,oBAAY,uBAAuB;IACjC,MAAM,KAAK;IACX,MAAM,KAAK;IACX,QAAQ,KAAK;CACd;AAED,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,mBAAmB,EACnB,uBAAuB,CAKxB,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAK1E,CAAC;AAEJ,eAAO,MAAM,8BAA8B,EAAE,MAAM,CACjD,uBAAuB,EACvB,mBAAmB,CAKpB,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CACnD,uBAAuB,EACvB,MAAM,CAKP,CAAC"}
@@ -1,5 +1,3 @@
1
- import { ECIESError } from '../errors/ecies';
2
- import { ECIESErrorTypeEnum } from './ecies-error-type';
3
1
  export var EciesEncryptionTypeEnum;
4
2
  (function (EciesEncryptionTypeEnum) {
5
3
  EciesEncryptionTypeEnum[EciesEncryptionTypeEnum["Simple"] = 33] = "Simple";
@@ -17,47 +15,13 @@ export const EciesEncryptionTypeStringMap = {
17
15
  multiple: 'multiple',
18
16
  };
19
17
  export const EciesEncryptionTypeEnumTypeMap = {
20
- [EciesEncryptionTypeEnum.Simple]: 'simple',
21
- [EciesEncryptionTypeEnum.Single]: 'single',
22
- [EciesEncryptionTypeEnum.Multiple]: 'multiple',
18
+ 33: 'simple',
19
+ 66: 'single',
20
+ 99: 'multiple',
23
21
  };
24
22
  export const EciesEncryptionTypeEnumStringMap = {
25
- [EciesEncryptionTypeEnum.Simple]: 'simple',
26
- [EciesEncryptionTypeEnum.Single]: 'single',
27
- [EciesEncryptionTypeEnum.Multiple]: 'multiple',
23
+ 33: 'simple',
24
+ 66: 'single',
25
+ 99: 'multiple',
28
26
  };
29
- export function encryptionTypeToString(type) {
30
- // if enum
31
- let resultType;
32
- if (typeof type === 'number') {
33
- resultType = EciesEncryptionTypeEnumTypeMap[type];
34
- if (resultType === undefined) {
35
- throw new ECIESError(ECIESErrorTypeEnum.InvalidEncryptionType);
36
- }
37
- }
38
- else {
39
- resultType = type;
40
- }
41
- const result = EciesEncryptionTypeStringMap[resultType];
42
- if (result === undefined) {
43
- throw new ECIESError(ECIESErrorTypeEnum.InvalidEncryptionType);
44
- }
45
- return result;
46
- }
47
- export function encryptionTypeEnumToType(type) {
48
- const result = EciesEncryptionTypeEnumTypeMap[type];
49
- if (result === undefined) {
50
- throw new ECIESError(ECIESErrorTypeEnum.InvalidEncryptionType);
51
- }
52
- return result;
53
- }
54
- export function validateEciesEncryptionTypeEnum(type) {
55
- return Object.values(EciesEncryptionTypeEnum).includes(type);
56
- }
57
- export function ensureEciesEncryptionTypeEnum(type) {
58
- if (!validateEciesEncryptionTypeEnum(type)) {
59
- throw new ECIESError(ECIESErrorTypeEnum.InvalidEncryptionType);
60
- }
61
- return type;
62
- }
63
27
  //# sourceMappingURL=ecies-encryption-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ecies-encryption-type.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/enumerations/ecies-encryption-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAIxD,MAAM,CA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M,GAAG,4BAA4B,CAAC,UAAU,CAAC,CAAC;IACxD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,UAAU,CAClB,kBAAkB,CAAC,qBAAqB,CAEzC,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,IAA6B;IAE7B,MAAM,MAAM,GAAG,8BAA8B,CAAC,IAAI,CAAC,CAAC;IACpD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,UAAU,CAClB,kBAAkB,CAAC,qBAAqB,CAEzC,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,+BAA+B,CAC7C,IAA6B;IAE7B,OAAO,MAAM,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,IAA6B;IAE7B,IAAI,CAAC,+BAA+B,CAAC,IAAI,CAAC,EAAE,CAAC;QAC3C,MAAM,IAAI,UAAU,CAClB,kBAAkB,CAAC,qBAAqB,CAEzC,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"ecies-encryption-type.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/enumerations/ecies-encryption-type.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,0EAAW,CAAA;IACX,0EAAW,CAAA;IACX,8EAAa,CAAA;AACf,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAG/B;IACF,MAAM,EAAE,uBAAuB,CAAC,MAAM;IACtC,MAAM,EAAE,uBAAuB,CAAC,MAAM;IACtC,QAAQ,EAAE,uBAAuB,CAAC,QAAQ;CAC3C,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GACvC;IACE,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEJ,MAAM,CAAC,MAAM,8BAA8B,GAGvC;IACF,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,UAAU;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAGzC;IACF,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,UAAU;CACf,CAAC"}
package/src/index.d.ts CHANGED
@@ -8,66 +8,73 @@
8
8
  * - Result pattern
9
9
  * - i18n 2.0 integration
10
10
  */
11
- export * from './core';
12
11
  export * from './builders';
12
+ export * from './core';
13
13
  export * from './lib';
14
- export { getEciesI18nEngine, resetEciesI18nEngine, getEciesTranslation, safeEciesTranslation, EciesI18nEngineKey, EciesComponentId, } from './i18n-setup';
14
+ export { EciesComponentId, EciesI18nEngineKey, getEciesI18nEngine, getEciesTranslation, resetEciesI18nEngine, safeEciesTranslation, } from './i18n-setup';
15
15
  export { EciesStringKey } from './enumerations/ecies-string-key';
16
16
  export { MemberType } from './enumerations/member-type';
17
17
  export { Pbkdf2ProfileEnum } from './enumerations/pbkdf2-profile';
18
18
  export { EmailString } from './email-string';
19
- export { SecureString } from './secure-string';
20
19
  export { SecureBuffer } from './secure-buffer';
20
+ export { SecureString } from './secure-string';
21
21
  export { Constants, ConstantsRegistry } from './constants';
22
22
  export type { IConstants } from './interfaces';
23
- export type { IECIESConstants, IECIESConfig, IPbkdf2Config, IPBkdf2Consts, IMemberStorageData, } from './interfaces';
24
- export type { HexString } from './types';
25
- export { LengthEncodingType } from './enumerations/length-encoding-type';
26
- export { MemberErrorType } from './enumerations/member-error-type';
27
- export { InvalidEmailErrorType } from './enumerations/invalid-email-type';
28
- export { EciesEncryptionTypeEnum, type EciesEncryptionType, EciesEncryptionTypeMap, encryptionTypeEnumToType, encryptionTypeToString, ensureEciesEncryptionTypeEnum, } from './enumerations/ecies-encryption-type';
29
- export { EciesVersionEnum } from './enumerations/ecies-version';
23
+ export { ECIES, OBJECT_ID_LENGTH, UINT32_MAX, UINT64_SIZE } from './constants';
30
24
  export { EciesCipherSuiteEnum } from './enumerations/ecies-cipher-suite';
25
+ export { EciesEncryptionTypeEnum, EciesEncryptionTypeMap, type EciesEncryptionType, } from './enumerations/ecies-encryption-type';
31
26
  export { ECIESErrorTypeEnum } from './enumerations/ecies-error-type';
32
- export { ECIESError } from './errors/ecies';
27
+ export { EciesVersionEnum } from './enumerations/ecies-version';
28
+ export { InvalidEmailErrorType } from './enumerations/invalid-email-type';
29
+ export { LengthEncodingType } from './enumerations/length-encoding-type';
30
+ export { MemberErrorType } from './enumerations/member-error-type';
33
31
  export { Pbkdf2ErrorType } from './enumerations/pbkdf2-error-type';
34
- export { ECIES, UINT32_MAX, UINT64_SIZE, OBJECT_ID_LENGTH } from './constants';
32
+ export { ECIESError } from './errors/ecies';
33
+ export type { IECIESConfig, IECIESConstants, IMemberStorageData, IPBkdf2Consts, IPbkdf2Config, } from './interfaces';
34
+ export type { HexString } from './types';
35
35
  export { getLengthEncodingTypeForLength, getLengthEncodingTypeFromValue, getLengthForLengthType, } from './utils';
36
- export * from './lib/id-providers';
37
- export type { IIdProvider } from './interfaces/id-provider';
36
+ export { encryptionTypeEnumToType, encryptionTypeToString, ensureEciesEncryptionTypeEnum, validateEciesEncryptionTypeEnum, } from './utils/encryption-type-utils';
38
37
  export { BaseIdProvider } from './interfaces/id-provider';
38
+ export type { IIdProvider } from './interfaces/id-provider';
39
+ export * from './lib/id-providers';
39
40
  export { ObjectIdProvider } from './lib/id-providers/objectid-provider';
40
- export { InvariantValidator } from './lib/invariant-validator';
41
- export type { IInvariant } from './interfaces/invariant';
42
41
  export { BaseInvariant } from './interfaces/invariant';
42
+ export type { IInvariant } from './interfaces/invariant';
43
+ export { InvariantValidator } from './lib/invariant-validator';
43
44
  export * from './lib/invariants';
44
- export { createRuntimeConfiguration, registerRuntimeConfiguration, unregisterRuntimeConfiguration, clearRuntimeConfigurations, getRuntimeConfiguration, } from './constants';
45
+ export { clearRuntimeConfigurations, createRuntimeConfiguration, getRuntimeConfiguration, registerRuntimeConfiguration, unregisterRuntimeConfiguration, } from './constants';
46
+ export { calculateConfigChecksum, captureCreationStack, } from './interfaces/configuration-provenance';
45
47
  export type { IConfigurationProvenance } from './interfaces/configuration-provenance';
46
- export { calculateConfigChecksum, captureCreationStack } from './interfaces/configuration-provenance';
47
48
  export * from './constants';
48
49
  export * from './email-string';
49
50
  export * from './enumerations';
50
51
  export * from './errors';
51
52
  export * from './i18n-setup';
52
53
  export * from './interfaces';
53
- export * from './interfaces/stream-config';
54
54
  export * from './interfaces/encrypted-chunk';
55
- export * from './interfaces/stream-progress';
55
+ export { ENCRYPTION_STATE_VERSION } from './interfaces/encryption-state';
56
+ export type { IEncryptionState } from './interfaces/encryption-state';
57
+ export * from './interfaces/stream-config';
56
58
  export * from './interfaces/stream-header';
59
+ export * from './interfaces/stream-progress';
57
60
  export * from './member';
61
+ export { Member } from './member';
58
62
  export * from './pbkdf2-profiles';
59
63
  export * from './phone-number';
60
64
  export * from './secure-buffer';
61
65
  export * from './secure-string';
62
66
  export * from './services';
63
67
  export { ChunkProcessor } from './services/chunk-processor';
68
+ export { EciesCryptoCore } from './services/ecies/crypto-core';
69
+ export { ECIESService } from './services/ecies/service';
64
70
  export { EncryptionStream } from './services/encryption-stream';
71
+ export type { IDecryptStreamOptions, IEncryptStreamOptions, } from './services/encryption-stream';
72
+ export { PasswordLoginService } from './services/password-login';
73
+ export { Pbkdf2Service } from './services/pbkdf2';
65
74
  export { ProgressTracker } from './services/progress-tracker';
66
75
  export { ResumableEncryption } from './services/resumable-encryption';
67
- export type { IEncryptStreamOptions, IDecryptStreamOptions, } from './services/encryption-stream';
68
76
  export type { IResumableOptions } from './services/resumable-encryption';
69
- export type { IEncryptionState } from './interfaces/encryption-state';
70
- export { ENCRYPTION_STATE_VERSION } from './interfaces/encryption-state';
71
77
  export * from './types';
72
78
  export * from './utils';
79
+ export { hexToUint8Array, uint8ArrayToHex } from './utils';
73
80
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/digitaldefiance-ecies-lib/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AAGtB,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAGlE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC3D,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,YAAY,EACV,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EACb,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EACL,uBAAuB,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AAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,YAAY,EACV,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,YAAY,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
package/src/index.js CHANGED
@@ -9,43 +9,46 @@
9
9
  * - i18n 2.0 integration
10
10
  */
11
11
  // Core v2 exports
12
- export * from './core';
13
12
  export * from './builders';
13
+ export * from './core';
14
14
  export * from './lib';
15
15
  // i18n v2
16
- export { getEciesI18nEngine, resetEciesI18nEngine, getEciesTranslation, safeEciesTranslation, EciesI18nEngineKey, EciesComponentId, } from './i18n-setup';
16
+ export { EciesComponentId, EciesI18nEngineKey, getEciesI18nEngine, getEciesTranslation, resetEciesI18nEngine, safeEciesTranslation, } from './i18n-setup';
17
17
  // Re-export existing types and enums (unchanged)
18
18
  export { EciesStringKey } from './enumerations/ecies-string-key';
19
19
  export { MemberType } from './enumerations/member-type';
20
20
  export { Pbkdf2ProfileEnum } from './enumerations/pbkdf2-profile';
21
21
  // Re-export value objects (unchanged)
22
22
  export { EmailString } from './email-string';
23
- export { SecureString } from './secure-string';
24
23
  export { SecureBuffer } from './secure-buffer';
24
+ export { SecureString } from './secure-string';
25
25
  // Re-export constants (unchanged)
26
26
  export { Constants, ConstantsRegistry } from './constants';
27
- export { LengthEncodingType } from './enumerations/length-encoding-type';
28
- export { MemberErrorType } from './enumerations/member-error-type';
29
- export { InvalidEmailErrorType } from './enumerations/invalid-email-type';
30
- export { EciesEncryptionTypeEnum, EciesEncryptionTypeMap, encryptionTypeEnumToType, encryptionTypeToString, ensureEciesEncryptionTypeEnum, } from './enumerations/ecies-encryption-type';
31
- export { EciesVersionEnum } from './enumerations/ecies-version';
27
+ // Also export specific interfaces, types, and enums that are needed
28
+ export { ECIES, OBJECT_ID_LENGTH, UINT32_MAX, UINT64_SIZE } from './constants';
32
29
  export { EciesCipherSuiteEnum } from './enumerations/ecies-cipher-suite';
30
+ export { EciesEncryptionTypeEnum, EciesEncryptionTypeMap, } from './enumerations/ecies-encryption-type';
31
+ // Export utility functions from utils module (moved from enumerations for circular dependency fix)
33
32
  export { ECIESErrorTypeEnum } from './enumerations/ecies-error-type';
34
- export { ECIESError } from './errors/ecies';
33
+ export { EciesVersionEnum } from './enumerations/ecies-version';
34
+ export { InvalidEmailErrorType } from './enumerations/invalid-email-type';
35
+ export { LengthEncodingType } from './enumerations/length-encoding-type';
36
+ export { MemberErrorType } from './enumerations/member-error-type';
35
37
  export { Pbkdf2ErrorType } from './enumerations/pbkdf2-error-type';
36
- export { ECIES, UINT32_MAX, UINT64_SIZE, OBJECT_ID_LENGTH } from './constants';
38
+ export { ECIESError } from './errors/ecies';
37
39
  export { getLengthEncodingTypeForLength, getLengthEncodingTypeFromValue, getLengthForLengthType, } from './utils';
40
+ export { encryptionTypeEnumToType, encryptionTypeToString, ensureEciesEncryptionTypeEnum, validateEciesEncryptionTypeEnum, } from './utils/encryption-type-utils';
38
41
  // ID Provider system
39
- export * from './lib/id-providers';
40
42
  export { BaseIdProvider } from './interfaces/id-provider';
43
+ export * from './lib/id-providers';
41
44
  export { ObjectIdProvider } from './lib/id-providers/objectid-provider';
42
45
  // Invariant validation system
43
- export { InvariantValidator } from './lib/invariant-validator';
44
46
  export { BaseInvariant } from './interfaces/invariant';
47
+ export { InvariantValidator } from './lib/invariant-validator';
45
48
  export * from './lib/invariants';
46
49
  // Configuration helpers
47
- export { createRuntimeConfiguration, registerRuntimeConfiguration, unregisterRuntimeConfiguration, clearRuntimeConfigurations, getRuntimeConfiguration, } from './constants';
48
- export { calculateConfigChecksum, captureCreationStack } from './interfaces/configuration-provenance';
50
+ export { clearRuntimeConfigurations, createRuntimeConfiguration, getRuntimeConfiguration, registerRuntimeConfiguration, unregisterRuntimeConfiguration, } from './constants';
51
+ export { calculateConfigChecksum, captureCreationStack, } from './interfaces/configuration-provenance';
49
52
  // Note: Existing services will be re-exported once migrated to v2
50
53
  // For now, import from main index.ts for backward compatibility
51
54
  export * from './constants';
@@ -54,21 +57,27 @@ export * from './enumerations';
54
57
  export * from './errors';
55
58
  export * from './i18n-setup';
56
59
  export * from './interfaces';
57
- export * from './interfaces/stream-config';
58
60
  export * from './interfaces/encrypted-chunk';
59
- export * from './interfaces/stream-progress';
61
+ export { ENCRYPTION_STATE_VERSION } from './interfaces/encryption-state';
62
+ export * from './interfaces/stream-config';
60
63
  export * from './interfaces/stream-header';
64
+ export * from './interfaces/stream-progress';
61
65
  export * from './member';
66
+ export { Member } from './member';
62
67
  export * from './pbkdf2-profiles';
63
68
  export * from './phone-number';
64
69
  export * from './secure-buffer';
65
70
  export * from './secure-string';
66
71
  export * from './services';
67
72
  export { ChunkProcessor } from './services/chunk-processor';
73
+ export { EciesCryptoCore } from './services/ecies/crypto-core';
74
+ export { ECIESService } from './services/ecies/service';
68
75
  export { EncryptionStream } from './services/encryption-stream';
76
+ export { PasswordLoginService } from './services/password-login';
77
+ export { Pbkdf2Service } from './services/pbkdf2';
69
78
  export { ProgressTracker } from './services/progress-tracker';
70
79
  export { ResumableEncryption } from './services/resumable-encryption';
71
- export { ENCRYPTION_STATE_VERSION } from './interfaces/encryption-state';
72
80
  export * from './types';
73
81
  export * from './utils';
82
+ export { hexToUint8Array, uint8ArrayToHex } from './utils';
74
83
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/digitaldefiance-ecies-lib/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,kBAAkB;AAClB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AAEtB,UAAU;AACV,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAEtB,iDAAiD;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,sCAAsC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,kCAAkC;AAClC,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAW3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EACL,uBAAuB,EAEvB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,6BAA6B,GAC9B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO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C7B,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAKhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -1,6 +1,11 @@
1
1
  export * from './aes-gcm';
2
+ export * from './chunk-processor';
2
3
  export * from './ecies';
4
+ export * from './encryption-stream';
5
+ export * from './multi-recipient-processor';
3
6
  export * from './password-login';
4
7
  export * from './pbkdf2';
8
+ export * from './progress-tracker';
9
+ export * from './resumable-encryption';
5
10
  export * from './xor';
6
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,OAAO,CAAC"}
@@ -1,6 +1,11 @@
1
1
  export * from './aes-gcm';
2
+ export * from './chunk-processor';
2
3
  export * from './ecies';
4
+ export * from './encryption-stream';
5
+ export * from './multi-recipient-processor';
3
6
  export * from './password-login';
4
7
  export * from './pbkdf2';
8
+ export * from './progress-tracker';
9
+ export * from './resumable-encryption';
5
10
  export * from './xor';
6
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC;AACxB,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,OAAO,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { EciesEncryptionType, EciesEncryptionTypeEnum } from '../enumerations/ecies-encryption-type';
2
+ /**
3
+ * Converts an encryption type (string or enum) to its string representation
4
+ * @param type The encryption type to convert
5
+ * @returns The string representation of the encryption type
6
+ * @throws ECIESError if the type is invalid
7
+ */
8
+ export declare function encryptionTypeToString(type: EciesEncryptionType | EciesEncryptionTypeEnum): string;
9
+ /**
10
+ * Converts an encryption type enum to its type representation
11
+ * @param type The encryption type enum to convert
12
+ * @returns The type representation of the encryption type
13
+ * @throws ECIESError if the type is invalid
14
+ */
15
+ export declare function encryptionTypeEnumToType(type: EciesEncryptionTypeEnum): EciesEncryptionType;
16
+ /**
17
+ * Validates that a value is a valid EciesEncryptionTypeEnum
18
+ * @param type The value to validate
19
+ * @returns true if the value is a valid EciesEncryptionTypeEnum, false otherwise
20
+ */
21
+ export declare function validateEciesEncryptionTypeEnum(type: EciesEncryptionTypeEnum): boolean;
22
+ /**
23
+ * Ensures that a value is a valid EciesEncryptionTypeEnum
24
+ * @param type The value to validate
25
+ * @returns The validated EciesEncryptionTypeEnum
26
+ * @throws ECIESError if the type is invalid
27
+ */
28
+ export declare function ensureEciesEncryptionTypeEnum(type: EciesEncryptionTypeEnum): EciesEncryptionTypeEnum;
29
+ //# sourceMappingURL=encryption-type-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryption-type-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/utils/encryption-type-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EAGxB,MAAM,uCAAuC,CAAC;AAI/C;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,mBAAmB,GAAG,uBAAuB,GAClD,MAAM,CAgBR;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,uBAAuB,GAC5B,mBAAmB,CAMrB;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,uBAAuB,GAC5B,uBAAuB,CAKzB"}
@@ -0,0 +1,61 @@
1
+ import { EciesEncryptionTypeEnum, EciesEncryptionTypeEnumTypeMap, EciesEncryptionTypeStringMap, } from '../enumerations/ecies-encryption-type';
2
+ import { ECIESErrorTypeEnum } from '../enumerations/ecies-error-type';
3
+ import { ECIESError } from '../errors/ecies';
4
+ /**
5
+ * Converts an encryption type (string or enum) to its string representation
6
+ * @param type The encryption type to convert
7
+ * @returns The string representation of the encryption type
8
+ * @throws ECIESError if the type is invalid
9
+ */
10
+ export function encryptionTypeToString(type) {
11
+ // if enum
12
+ let resultType;
13
+ if (typeof type === 'number') {
14
+ resultType = EciesEncryptionTypeEnumTypeMap[type];
15
+ if (resultType === undefined) {
16
+ throw new ECIESError(ECIESErrorTypeEnum.InvalidEncryptionType);
17
+ }
18
+ }
19
+ else {
20
+ resultType = type;
21
+ }
22
+ const result = EciesEncryptionTypeStringMap[resultType];
23
+ if (result === undefined) {
24
+ throw new ECIESError(ECIESErrorTypeEnum.InvalidEncryptionType);
25
+ }
26
+ return result;
27
+ }
28
+ /**
29
+ * Converts an encryption type enum to its type representation
30
+ * @param type The encryption type enum to convert
31
+ * @returns The type representation of the encryption type
32
+ * @throws ECIESError if the type is invalid
33
+ */
34
+ export function encryptionTypeEnumToType(type) {
35
+ const result = EciesEncryptionTypeEnumTypeMap[type];
36
+ if (result === undefined) {
37
+ throw new ECIESError(ECIESErrorTypeEnum.InvalidEncryptionType);
38
+ }
39
+ return result;
40
+ }
41
+ /**
42
+ * Validates that a value is a valid EciesEncryptionTypeEnum
43
+ * @param type The value to validate
44
+ * @returns true if the value is a valid EciesEncryptionTypeEnum, false otherwise
45
+ */
46
+ export function validateEciesEncryptionTypeEnum(type) {
47
+ return Object.values(EciesEncryptionTypeEnum).includes(type);
48
+ }
49
+ /**
50
+ * Ensures that a value is a valid EciesEncryptionTypeEnum
51
+ * @param type The value to validate
52
+ * @returns The validated EciesEncryptionTypeEnum
53
+ * @throws ECIESError if the type is invalid
54
+ */
55
+ export function ensureEciesEncryptionTypeEnum(type) {
56
+ if (!validateEciesEncryptionTypeEnum(type)) {
57
+ throw new ECIESError(ECIESErrorTypeEnum.InvalidEncryptionType);
58
+ }
59
+ return type;
60
+ }
61
+ //# sourceMappingURL=encryption-type-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"encryption-type-utils.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-ecies-lib/src/utils/encryption-type-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,uBAAuB,EACvB,8BAA8B,EAC9B,4BAA4B,GAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAAmD;IAEnD,UAAU;IACV,IAAI,UAA+B,CAAC;IACpC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,UAAU,GAAG,8BAA8B,CAAC,IAAI,CAAC,CAAC;QAClD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,IAAI,UAAU,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;QACjE,CAAC;IACH,CAAC;SAAM,CAAC;QACN,UAAU,GAAG,IAAI,CAAC;IACpB,CAAC;IACD,MAAM,MAAM,GAAG,4BAA4B,CAAC,UAAU,CAAC,CAAC;IACxD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,MAAM,IAAI,UAAU,CAAC,kBAA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