@openwallet-foundation/askar-nodejs 0.7.0-alpha-20261028112522 → 0.7.0-alpha-20261028113056

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 (43) hide show
  1. package/build/index.d.mts +111 -0
  2. package/build/index.mjs +1411 -0
  3. package/build/index.mjs.map +1 -0
  4. package/package.json +15 -8
  5. package/build/NodeJSAskar.d.ts +0 -105
  6. package/build/NodeJSAskar.js +0 -752
  7. package/build/NodeJSAskar.js.map +0 -1
  8. package/build/ffi/alloc.d.ts +0 -9
  9. package/build/ffi/alloc.js +0 -34
  10. package/build/ffi/alloc.js.map +0 -1
  11. package/build/ffi/callbacks.d.ts +0 -14
  12. package/build/ffi/callbacks.js +0 -75
  13. package/build/ffi/callbacks.js.map +0 -1
  14. package/build/ffi/conversion.d.ts +0 -11
  15. package/build/ffi/conversion.js +0 -70
  16. package/build/ffi/conversion.js.map +0 -1
  17. package/build/ffi/index.d.ts +0 -6
  18. package/build/ffi/index.js +0 -23
  19. package/build/ffi/index.js.map +0 -1
  20. package/build/ffi/primitives.d.ts +0 -22
  21. package/build/ffi/primitives.js +0 -67
  22. package/build/ffi/primitives.js.map +0 -1
  23. package/build/ffi/serialize.d.ts +0 -11
  24. package/build/ffi/serialize.js +0 -51
  25. package/build/ffi/serialize.js.map +0 -1
  26. package/build/ffi/structures.d.ts +0 -31
  27. package/build/ffi/structures.js +0 -67
  28. package/build/ffi/structures.js.map +0 -1
  29. package/build/index.d.ts +0 -3
  30. package/build/index.js +0 -23
  31. package/build/index.js.map +0 -1
  32. package/build/library/NativeBindingInterface.d.ts +0 -2
  33. package/build/library/NativeBindingInterface.js +0 -3
  34. package/build/library/NativeBindingInterface.js.map +0 -1
  35. package/build/library/bindings.d.ts +0 -2
  36. package/build/library/bindings.js +0 -480
  37. package/build/library/bindings.js.map +0 -1
  38. package/build/library/index.d.ts +0 -3
  39. package/build/library/index.js +0 -20
  40. package/build/library/index.js.map +0 -1
  41. package/build/library/register.d.ts +0 -2
  42. package/build/library/register.js +0 -102
  43. package/build/library/register.js.map +0 -1
@@ -0,0 +1,111 @@
1
+ import { AeadParams, ArcHandle, Argon2DerivePasswordOptions, Askar, AskarErrorObject, EncryptedBuffer, EntryListCountOptions, EntryListFreeOptions, EntryListGetCategoryOptions, EntryListGetNameOptions, EntryListGetTagsOptions, EntryListGetValueOptions, EntryListHandle, Jwk, Key, KeyAeadDecryptOptions, KeyAeadEncryptOptions, KeyAeadGetPaddingOptions, KeyAeadGetParamsOptions, KeyAeadRandomNonceOptions, KeyConvertOptions, KeyCryptoBoxOpenOptions, KeyCryptoBoxOptions, KeyCryptoBoxSealOpenOptions, KeyCryptoBoxSealOptions, KeyDeriveEcdh1puOptions, KeyDeriveEcdhEsOptions, KeyEntryListCountOptions, KeyEntryListFreeOptions, KeyEntryListGetAlgorithmOptions, KeyEntryListGetMetadataOptions, KeyEntryListGetNameOptions, KeyEntryListGetTagsOptions, KeyEntryListHandle, KeyEntryListLoadLocalOptions, KeyFreeOptions, KeyFromJwkOptions, KeyFromKeyExchangeOptions, KeyFromPublicBytesOptions, KeyFromSecretBytesOptions, KeyFromSeedOptions, KeyGenerateOptions, KeyGetAlgorithmOptions, KeyGetEphemeralOptions, KeyGetJwkPublicOptions, KeyGetJwkSecretOptions, KeyGetJwkThumbprintOptions, KeyGetPublicBytesOptions, KeyGetSecretBytesOptions, KeySignMessageOptions, KeyUnwrapKeyOptions, KeyVerifySignatureOptions, KeyWrapKeyOptions, LocalKeyHandle, MigrateIndySdkOptions, ScanFreeOptions, ScanHandle, ScanNextOptions, ScanStartOptions, SessionCloseOptions, SessionCountOptions, SessionFetchAllKeysOptions, SessionFetchAllOptions, SessionFetchKeyOptions, SessionFetchOptions, SessionHandle, SessionInsertKeyOptions, SessionRemoveAllOptions, SessionRemoveKeyOptions, SessionStartOptions, SessionUpdateKeyOptions, SessionUpdateOptions, SetCustomLoggerOptions, SetMaxLogLevelOptions, StoreCloseOptions, StoreCopyProfileOptions, StoreCopyToOptions, StoreCreateProfileOptions, StoreGenerateRawKeyOptions, StoreGetDefaultProfileOptions, StoreGetProfileNameOptions, StoreHandle, StoreListProfilesOptions, StoreListScansOptions, StoreListSessionsOptions, StoreOpenOptions, StoreProvisionOptions, StoreRekeyOptions, StoreRemoveOptions, StoreRemoveProfileOptions, StoreRenameProfileOptions, StoreSetDefaultProfileOptions } from "@openwallet-foundation/askar-shared";
2
+ import * as koffi from "koffi";
3
+ export * from "@openwallet-foundation/askar-shared";
4
+ type TypeSpec = Parameters<typeof koffi.out>[0];
5
+ declare const nativeBindings: Record<string, [TypeSpec, Array<TypeSpec>]>;
6
+ type NativeMethods = Record<keyof typeof nativeBindings, (...args: unknown[]) => any>;
7
+ declare class NodeJSAskar implements Askar {
8
+ private callbackId;
9
+ private promisify;
10
+ /**
11
+ * Fetch the error from the native library and throw it as a JS error
12
+ *
13
+ * NOTE:
14
+ * Checks whether the error code of the returned error matches the error code that was passed to the function.
15
+ * If it doesn't, we throw an error with the original errorCode, and a custom message explaining we weren't able
16
+ * to retrieve the error message from the native library. This should however not break functionality as long as
17
+ * error codes are used rather than error messages for error handling.
18
+ *
19
+ */
20
+ private getAskarError;
21
+ private handleError;
22
+ private handleListFree;
23
+ get nativeAskar(): NativeMethods;
24
+ version(): string;
25
+ getCurrentError(): AskarErrorObject;
26
+ clearCustomLogger(): void;
27
+ setCustomLogger({ logLevel, logger }: SetCustomLoggerOptions): void;
28
+ setDefaultLogger(): void;
29
+ setMaxLogLevel(options: SetMaxLogLevelOptions): void;
30
+ argon2DerivePassword(options: Argon2DerivePasswordOptions): Uint8Array;
31
+ entryListCount(options: EntryListCountOptions): number;
32
+ entryListFree(options: EntryListFreeOptions): void;
33
+ entryListGetCategory(options: EntryListGetCategoryOptions): string;
34
+ entryListGetName(options: EntryListGetNameOptions): string;
35
+ entryListGetTags(options: EntryListGetTagsOptions): string | null;
36
+ entryListGetValue(options: EntryListGetValueOptions): Uint8Array;
37
+ keyAeadDecrypt(options: KeyAeadDecryptOptions): Uint8Array;
38
+ keyAeadEncrypt(options: KeyAeadEncryptOptions): EncryptedBuffer;
39
+ keyAeadGetPadding(options: KeyAeadGetPaddingOptions): number;
40
+ keyAeadGetParams(options: KeyAeadGetParamsOptions): AeadParams;
41
+ keyAeadRandomNonce(options: KeyAeadRandomNonceOptions): Uint8Array;
42
+ keyConvert(options: KeyConvertOptions): LocalKeyHandle;
43
+ keyCryptoBox(options: KeyCryptoBoxOptions): Uint8Array;
44
+ keyCryptoBoxOpen(options: KeyCryptoBoxOpenOptions): Uint8Array;
45
+ keyCryptoBoxRandomNonce(): Uint8Array;
46
+ keyCryptoBoxSeal(options: KeyCryptoBoxSealOptions): Uint8Array;
47
+ keyCryptoBoxSealOpen(options: KeyCryptoBoxSealOpenOptions): Uint8Array;
48
+ keyDeriveEcdh1pu(options: KeyDeriveEcdh1puOptions): LocalKeyHandle;
49
+ keyDeriveEcdhEs(options: KeyDeriveEcdhEsOptions): LocalKeyHandle;
50
+ keyEntryListCount(options: KeyEntryListCountOptions): number;
51
+ keyEntryListFree(options: KeyEntryListFreeOptions): void;
52
+ keyEntryListGetAlgorithm(options: KeyEntryListGetAlgorithmOptions): string;
53
+ keyEntryListGetMetadata(options: KeyEntryListGetMetadataOptions): string | null;
54
+ keyEntryListGetName(options: KeyEntryListGetNameOptions): string;
55
+ keyEntryListGetTags(options: KeyEntryListGetTagsOptions): string | null;
56
+ keyEntryListLoadLocal(options: KeyEntryListLoadLocalOptions): LocalKeyHandle;
57
+ keyFree(options: KeyFreeOptions): void;
58
+ keyFromJwk(options: KeyFromJwkOptions): LocalKeyHandle;
59
+ keyFromKeyExchange(options: KeyFromKeyExchangeOptions): LocalKeyHandle;
60
+ keyFromPublicBytes(options: KeyFromPublicBytesOptions): LocalKeyHandle;
61
+ keyFromSecretBytes(options: KeyFromSecretBytesOptions): LocalKeyHandle;
62
+ keyFromSeed(options: KeyFromSeedOptions): LocalKeyHandle;
63
+ keyGenerate(options: KeyGenerateOptions): LocalKeyHandle;
64
+ keyGetAlgorithm(options: KeyGetAlgorithmOptions): string;
65
+ keyGetEphemeral(options: KeyGetEphemeralOptions): number;
66
+ keyGetJwkPublic(options: KeyGetJwkPublicOptions): string;
67
+ keyGetJwkSecret(options: KeyGetJwkSecretOptions): Uint8Array;
68
+ keyGetJwkThumbprint(options: KeyGetJwkThumbprintOptions): string;
69
+ keyGetPublicBytes(options: KeyGetPublicBytesOptions): Uint8Array;
70
+ keyGetSecretBytes(options: KeyGetSecretBytesOptions): Uint8Array;
71
+ keySignMessage(options: KeySignMessageOptions): Uint8Array;
72
+ keyUnwrapKey(options: KeyUnwrapKeyOptions): LocalKeyHandle;
73
+ keyVerifySignature(options: KeyVerifySignatureOptions): boolean;
74
+ keyWrapKey(options: KeyWrapKeyOptions): EncryptedBuffer;
75
+ keyGetSupportedBackends(): string[];
76
+ scanFree(options: ScanFreeOptions): void;
77
+ scanNext(options: ScanNextOptions): Promise<EntryListHandle | null>;
78
+ scanStart(options: ScanStartOptions): Promise<ScanHandle>;
79
+ sessionClose(options: SessionCloseOptions): Promise<void>;
80
+ sessionCount(options: SessionCountOptions): Promise<number>;
81
+ sessionFetch(options: SessionFetchOptions): Promise<EntryListHandle | null>;
82
+ sessionFetchAll(options: SessionFetchAllOptions): Promise<EntryListHandle | null>;
83
+ sessionFetchAllKeys(options: SessionFetchAllKeysOptions): Promise<KeyEntryListHandle | null>;
84
+ sessionFetchKey(options: SessionFetchKeyOptions): Promise<KeyEntryListHandle | null>;
85
+ sessionInsertKey(options: SessionInsertKeyOptions): Promise<void>;
86
+ sessionRemoveAll(options: SessionRemoveAllOptions): Promise<number>;
87
+ sessionRemoveKey(options: SessionRemoveKeyOptions): Promise<void>;
88
+ sessionStart(options: SessionStartOptions): Promise<SessionHandle>;
89
+ sessionUpdate(options: SessionUpdateOptions): Promise<void>;
90
+ sessionUpdateKey(options: SessionUpdateKeyOptions): Promise<void>;
91
+ storeClose(options: StoreCloseOptions): Promise<void>;
92
+ storeCopyTo(options: StoreCopyToOptions): Promise<StoreHandle>;
93
+ storeCreateProfile(options: StoreCreateProfileOptions): Promise<string>;
94
+ storeGenerateRawKey(options: StoreGenerateRawKeyOptions): string;
95
+ storeGetDefaultProfile(options: StoreGetDefaultProfileOptions): Promise<string>;
96
+ storeGetProfileName(options: StoreGetProfileNameOptions): Promise<string>;
97
+ storeListProfiles(options: StoreListProfilesOptions): Promise<string[]>;
98
+ storeListScans(options: StoreListScansOptions): Promise<ScanHandle[]>;
99
+ storeListSessions(options: StoreListSessionsOptions): Promise<SessionHandle[]>;
100
+ storeOpen(options: StoreOpenOptions): Promise<StoreHandle>;
101
+ storeProvision(options: StoreProvisionOptions): Promise<StoreHandle>;
102
+ storeRekey(options: StoreRekeyOptions): Promise<void>;
103
+ storeRemove(options: StoreRemoveOptions): Promise<number>;
104
+ storeRemoveProfile(options: StoreRemoveProfileOptions): Promise<number>;
105
+ storeSetDefaultProfile(options: StoreSetDefaultProfileOptions): Promise<void>;
106
+ storeRenameProfile(options: StoreRenameProfileOptions): Promise<number>;
107
+ storeCopyProfile(options: StoreCopyProfileOptions): Promise<void>;
108
+ migrateIndySdk(options: MigrateIndySdkOptions): Promise<void>;
109
+ }
110
+ export declare const askarNodeJS: NodeJSAskar;
111
+ //# sourceMappingURL=index.d.mts.map