@bitwarden/sdk-internal 0.2.0-main.211 → 0.2.0-main.212
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/VERSION +1 -1
- package/bitwarden_wasm_internal.d.ts +21 -0
- package/bitwarden_wasm_internal_bg.js +135 -8
- package/bitwarden_wasm_internal_bg.wasm +0 -0
- package/bitwarden_wasm_internal_bg.wasm.d.ts +5 -0
- package/bitwarden_wasm_internal_bg.wasm.js +1 -1
- package/node/bitwarden_wasm_internal.d.ts +21 -0
- package/node/bitwarden_wasm_internal.js +137 -8
- package/node/bitwarden_wasm_internal_bg.wasm +0 -0
- package/node/bitwarden_wasm_internal_bg.wasm.d.ts +5 -0
- package/package.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
a3d748a6c1e0828313849c7e540a8d2e477de3da
|
|
@@ -1151,6 +1151,13 @@ export type Utc = unknown;
|
|
|
1151
1151
|
*/
|
|
1152
1152
|
export type NonZeroU32 = number;
|
|
1153
1153
|
|
|
1154
|
+
export interface Repository<T> {
|
|
1155
|
+
get(id: string): Promise<T | null>;
|
|
1156
|
+
list(): Promise<T[]>;
|
|
1157
|
+
set(id: string, value: T): Promise<void>;
|
|
1158
|
+
remove(id: string): Promise<void>;
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1154
1161
|
export interface TestError extends Error {
|
|
1155
1162
|
name: "TestError";
|
|
1156
1163
|
}
|
|
@@ -1181,6 +1188,10 @@ export class BitwardenClient {
|
|
|
1181
1188
|
http_get(url: string): Promise<string>;
|
|
1182
1189
|
crypto(): CryptoClient;
|
|
1183
1190
|
vault(): VaultClient;
|
|
1191
|
+
/**
|
|
1192
|
+
* Constructs a specific client for platform-specific functionality
|
|
1193
|
+
*/
|
|
1194
|
+
platform(): PlatformClient;
|
|
1184
1195
|
/**
|
|
1185
1196
|
* Constructs a specific client for generating passwords and passphrases
|
|
1186
1197
|
*/
|
|
@@ -1385,6 +1396,11 @@ export class OutgoingMessage {
|
|
|
1385
1396
|
get topic(): string | undefined;
|
|
1386
1397
|
set topic(value: string | null | undefined);
|
|
1387
1398
|
}
|
|
1399
|
+
export class PlatformClient {
|
|
1400
|
+
private constructor();
|
|
1401
|
+
free(): void;
|
|
1402
|
+
state(): StateClient;
|
|
1403
|
+
}
|
|
1388
1404
|
/**
|
|
1389
1405
|
* This module represents a stopgap solution to provide access to primitive crypto functions for JS
|
|
1390
1406
|
* clients. It is not intended to be used outside of the JS clients and this pattern should not be
|
|
@@ -1492,6 +1508,11 @@ export class PureCrypto {
|
|
|
1492
1508
|
verifying_key: Uint8Array,
|
|
1493
1509
|
): Uint8Array;
|
|
1494
1510
|
}
|
|
1511
|
+
export class StateClient {
|
|
1512
|
+
private constructor();
|
|
1513
|
+
free(): void;
|
|
1514
|
+
register_cipher_repository(store: Repository<Cipher>): void;
|
|
1515
|
+
}
|
|
1495
1516
|
export class TotpClient {
|
|
1496
1517
|
private constructor();
|
|
1497
1518
|
free(): void;
|
|
@@ -711,7 +711,7 @@ function __wbg_adapter_56(arg0, arg1, arg2) {
|
|
|
711
711
|
);
|
|
712
712
|
}
|
|
713
713
|
|
|
714
|
-
function
|
|
714
|
+
function __wbg_adapter_271(arg0, arg1, arg2, arg3) {
|
|
715
715
|
wasm.wasm_bindgen__convert__closures__invoke2_mut__h8776500d04a3e634(
|
|
716
716
|
arg0,
|
|
717
717
|
arg1,
|
|
@@ -1041,6 +1041,14 @@ export class BitwardenClient {
|
|
|
1041
1041
|
const ret = wasm.bitwardenclient_crypto(this.__wbg_ptr);
|
|
1042
1042
|
return VaultClient.__wrap(ret);
|
|
1043
1043
|
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Constructs a specific client for platform-specific functionality
|
|
1046
|
+
* @returns {PlatformClient}
|
|
1047
|
+
*/
|
|
1048
|
+
platform() {
|
|
1049
|
+
const ret = wasm.bitwardenclient_platform(this.__wbg_ptr);
|
|
1050
|
+
return PlatformClient.__wrap(ret);
|
|
1051
|
+
}
|
|
1044
1052
|
/**
|
|
1045
1053
|
* Constructs a specific client for generating passwords and passphrases
|
|
1046
1054
|
* @returns {GeneratorClient}
|
|
@@ -2180,6 +2188,40 @@ export class OutgoingMessage {
|
|
|
2180
2188
|
}
|
|
2181
2189
|
}
|
|
2182
2190
|
|
|
2191
|
+
const PlatformClientFinalization =
|
|
2192
|
+
typeof FinalizationRegistry === "undefined"
|
|
2193
|
+
? { register: () => {}, unregister: () => {} }
|
|
2194
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_platformclient_free(ptr >>> 0, 1));
|
|
2195
|
+
|
|
2196
|
+
export class PlatformClient {
|
|
2197
|
+
static __wrap(ptr) {
|
|
2198
|
+
ptr = ptr >>> 0;
|
|
2199
|
+
const obj = Object.create(PlatformClient.prototype);
|
|
2200
|
+
obj.__wbg_ptr = ptr;
|
|
2201
|
+
PlatformClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2202
|
+
return obj;
|
|
2203
|
+
}
|
|
2204
|
+
|
|
2205
|
+
__destroy_into_raw() {
|
|
2206
|
+
const ptr = this.__wbg_ptr;
|
|
2207
|
+
this.__wbg_ptr = 0;
|
|
2208
|
+
PlatformClientFinalization.unregister(this);
|
|
2209
|
+
return ptr;
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
free() {
|
|
2213
|
+
const ptr = this.__destroy_into_raw();
|
|
2214
|
+
wasm.__wbg_platformclient_free(ptr, 0);
|
|
2215
|
+
}
|
|
2216
|
+
/**
|
|
2217
|
+
* @returns {StateClient}
|
|
2218
|
+
*/
|
|
2219
|
+
state() {
|
|
2220
|
+
const ret = wasm.bitwardenclient_platform(this.__wbg_ptr);
|
|
2221
|
+
return StateClient.__wrap(ret);
|
|
2222
|
+
}
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2183
2225
|
const PureCryptoFinalization =
|
|
2184
2226
|
typeof FinalizationRegistry === "undefined"
|
|
2185
2227
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2934,6 +2976,39 @@ export class PureCrypto {
|
|
|
2934
2976
|
}
|
|
2935
2977
|
}
|
|
2936
2978
|
|
|
2979
|
+
const StateClientFinalization =
|
|
2980
|
+
typeof FinalizationRegistry === "undefined"
|
|
2981
|
+
? { register: () => {}, unregister: () => {} }
|
|
2982
|
+
: new FinalizationRegistry((ptr) => wasm.__wbg_stateclient_free(ptr >>> 0, 1));
|
|
2983
|
+
|
|
2984
|
+
export class StateClient {
|
|
2985
|
+
static __wrap(ptr) {
|
|
2986
|
+
ptr = ptr >>> 0;
|
|
2987
|
+
const obj = Object.create(StateClient.prototype);
|
|
2988
|
+
obj.__wbg_ptr = ptr;
|
|
2989
|
+
StateClientFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2990
|
+
return obj;
|
|
2991
|
+
}
|
|
2992
|
+
|
|
2993
|
+
__destroy_into_raw() {
|
|
2994
|
+
const ptr = this.__wbg_ptr;
|
|
2995
|
+
this.__wbg_ptr = 0;
|
|
2996
|
+
StateClientFinalization.unregister(this);
|
|
2997
|
+
return ptr;
|
|
2998
|
+
}
|
|
2999
|
+
|
|
3000
|
+
free() {
|
|
3001
|
+
const ptr = this.__destroy_into_raw();
|
|
3002
|
+
wasm.__wbg_stateclient_free(ptr, 0);
|
|
3003
|
+
}
|
|
3004
|
+
/**
|
|
3005
|
+
* @param {Repository<Cipher>} store
|
|
3006
|
+
*/
|
|
3007
|
+
register_cipher_repository(store) {
|
|
3008
|
+
wasm.stateclient_register_cipher_repository(this.__wbg_ptr, addHeapObject(store));
|
|
3009
|
+
}
|
|
3010
|
+
}
|
|
3011
|
+
|
|
2937
3012
|
const TotpClientFinalization =
|
|
2938
3013
|
typeof FinalizationRegistry === "undefined"
|
|
2939
3014
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -3203,6 +3278,21 @@ export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
|
|
|
3203
3278
|
return addHeapObject(ret);
|
|
3204
3279
|
}
|
|
3205
3280
|
|
|
3281
|
+
export function __wbg_get_f7bd93223b71a83e() {
|
|
3282
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
3283
|
+
let deferred0_0;
|
|
3284
|
+
let deferred0_1;
|
|
3285
|
+
try {
|
|
3286
|
+
deferred0_0 = arg1;
|
|
3287
|
+
deferred0_1 = arg2;
|
|
3288
|
+
const ret = getObject(arg0).get(getStringFromWasm0(arg1, arg2));
|
|
3289
|
+
return addHeapObject(ret);
|
|
3290
|
+
} finally {
|
|
3291
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
3292
|
+
}
|
|
3293
|
+
}, arguments);
|
|
3294
|
+
}
|
|
3295
|
+
|
|
3206
3296
|
export function __wbg_getwithrefkey_1dc361bd10053bfe(arg0, arg1) {
|
|
3207
3297
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
3208
3298
|
return addHeapObject(ret);
|
|
@@ -3303,6 +3393,13 @@ export function __wbg_length_e2d2a49132c1b256(arg0) {
|
|
|
3303
3393
|
return ret;
|
|
3304
3394
|
}
|
|
3305
3395
|
|
|
3396
|
+
export function __wbg_list_a632257712ef903a() {
|
|
3397
|
+
return handleError(function (arg0) {
|
|
3398
|
+
const ret = getObject(arg0).list();
|
|
3399
|
+
return addHeapObject(ret);
|
|
3400
|
+
}, arguments);
|
|
3401
|
+
}
|
|
3402
|
+
|
|
3306
3403
|
export function __wbg_log_cad59bb680daec67(arg0, arg1, arg2, arg3) {
|
|
3307
3404
|
console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
3308
3405
|
}
|
|
@@ -3331,7 +3428,7 @@ export function __wbg_new_23a2665fac83c611(arg0, arg1) {
|
|
|
3331
3428
|
const a = state0.a;
|
|
3332
3429
|
state0.a = 0;
|
|
3333
3430
|
try {
|
|
3334
|
-
return
|
|
3431
|
+
return __wbg_adapter_271(a, state0.b, arg0, arg1);
|
|
3335
3432
|
} finally {
|
|
3336
3433
|
state0.a = a;
|
|
3337
3434
|
}
|
|
@@ -3473,6 +3570,21 @@ export function __wbg_randomFillSync_ac0988aba3254290() {
|
|
|
3473
3570
|
}, arguments);
|
|
3474
3571
|
}
|
|
3475
3572
|
|
|
3573
|
+
export function __wbg_remove_bb1b975ea93b448a() {
|
|
3574
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
3575
|
+
let deferred0_0;
|
|
3576
|
+
let deferred0_1;
|
|
3577
|
+
try {
|
|
3578
|
+
deferred0_0 = arg1;
|
|
3579
|
+
deferred0_1 = arg2;
|
|
3580
|
+
const ret = getObject(arg0).remove(getStringFromWasm0(arg1, arg2));
|
|
3581
|
+
return addHeapObject(ret);
|
|
3582
|
+
} finally {
|
|
3583
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
3584
|
+
}
|
|
3585
|
+
}, arguments);
|
|
3586
|
+
}
|
|
3587
|
+
|
|
3476
3588
|
export function __wbg_require_60cc747a6bc5215a() {
|
|
3477
3589
|
return handleError(function () {
|
|
3478
3590
|
const ret = module.require;
|
|
@@ -3505,6 +3617,21 @@ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
|
|
|
3505
3617
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
3506
3618
|
}
|
|
3507
3619
|
|
|
3620
|
+
export function __wbg_set_581efd75a64cfdb7() {
|
|
3621
|
+
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
3622
|
+
let deferred0_0;
|
|
3623
|
+
let deferred0_1;
|
|
3624
|
+
try {
|
|
3625
|
+
deferred0_0 = arg1;
|
|
3626
|
+
deferred0_1 = arg2;
|
|
3627
|
+
const ret = getObject(arg0).set(getStringFromWasm0(arg1, arg2), takeObject(arg3));
|
|
3628
|
+
return addHeapObject(ret);
|
|
3629
|
+
} finally {
|
|
3630
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
3631
|
+
}
|
|
3632
|
+
}, arguments);
|
|
3633
|
+
}
|
|
3634
|
+
|
|
3508
3635
|
export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
|
|
3509
3636
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
3510
3637
|
}
|
|
@@ -3688,18 +3815,18 @@ export function __wbindgen_cb_drop(arg0) {
|
|
|
3688
3815
|
return ret;
|
|
3689
3816
|
}
|
|
3690
3817
|
|
|
3691
|
-
export function
|
|
3692
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3818
|
+
export function __wbindgen_closure_wrapper2654(arg0, arg1, arg2) {
|
|
3819
|
+
const ret = makeMutClosure(arg0, arg1, 795, __wbg_adapter_50);
|
|
3693
3820
|
return addHeapObject(ret);
|
|
3694
3821
|
}
|
|
3695
3822
|
|
|
3696
|
-
export function
|
|
3697
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3823
|
+
export function __wbindgen_closure_wrapper3494(arg0, arg1, arg2) {
|
|
3824
|
+
const ret = makeMutClosure(arg0, arg1, 879, __wbg_adapter_53);
|
|
3698
3825
|
return addHeapObject(ret);
|
|
3699
3826
|
}
|
|
3700
3827
|
|
|
3701
|
-
export function
|
|
3702
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
3828
|
+
export function __wbindgen_closure_wrapper3907(arg0, arg1, arg2) {
|
|
3829
|
+
const ret = makeMutClosure(arg0, arg1, 1002, __wbg_adapter_56);
|
|
3703
3830
|
return addHeapObject(ret);
|
|
3704
3831
|
}
|
|
3705
3832
|
|
|
Binary file
|
|
@@ -151,8 +151,10 @@ export const bitwardenclient_version: (a: number, b: number) => void;
|
|
|
151
151
|
export const bitwardenclient_throw: (a: number, b: number, c: number, d: number) => void;
|
|
152
152
|
export const bitwardenclient_http_get: (a: number, b: number, c: number) => number;
|
|
153
153
|
export const bitwardenclient_crypto: (a: number) => number;
|
|
154
|
+
export const bitwardenclient_platform: (a: number) => number;
|
|
154
155
|
export const set_log_level: (a: number) => void;
|
|
155
156
|
export const init_sdk: (a: number) => void;
|
|
157
|
+
export const stateclient_register_cipher_repository: (a: number, b: number) => void;
|
|
156
158
|
export const __wbg_purecrypto_free: (a: number, b: number) => void;
|
|
157
159
|
export const purecrypto_symmetric_decrypt: (
|
|
158
160
|
a: number,
|
|
@@ -309,6 +311,9 @@ export const purecrypto_unwrap_encapsulation_key: (
|
|
|
309
311
|
export const bitwardenclient_vault: (a: number) => number;
|
|
310
312
|
export const bitwardenclient_generator: (a: number) => number;
|
|
311
313
|
export const bitwardenclient_exporters: (a: number) => number;
|
|
314
|
+
export const __wbg_stateclient_free: (a: number, b: number) => void;
|
|
315
|
+
export const __wbg_platformclient_free: (a: number, b: number) => void;
|
|
316
|
+
export const platformclient_state: (a: number) => number;
|
|
312
317
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
313
318
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
314
319
|
export const __wbindgen_exn_store: (a: number) => void;
|