@dynamic-labs-sdk/client 0.0.1-alpha.13 → 0.0.1-alpha.14
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/CHANGELOG.md +6 -0
- package/getWalletProviderFromWalletAccount.cjs.js +1 -1
- package/getWalletProviderFromWalletAccount.esm.js +1 -1
- package/index.cjs.js +34 -15
- package/index.esm.js +1 -1
- package/package.json +1 -1
- package/src/modules/auth/social/oauth/redirectStateStorageSchema/redirectStateStorageSchema.d.ts +2 -2
- package/src/modules/auth/social/oauth/redirectStateStorageSchema/redirectStateStorageSchema.d.ts.map +1 -1
- package/src/modules/wallets/unverifiedWalletAccounts/schema.d.ts +1 -1
- package/src/modules/wallets/unverifiedWalletAccounts/schema.d.ts.map +1 -1
- package/src/modules/wallets/unverifiedWalletAccounts/types.d.ts +1 -1
- package/src/modules/wallets/unverifiedWalletAccounts/types.d.ts.map +1 -1
- package/src/services/storage/createStorageKeySchema/createStorageKeySchema.d.ts +2 -2
- package/src/services/storage/createStorageKeySchema/createStorageKeySchema.d.ts.map +1 -1
- package/src/services/storage/types.d.ts +2 -2
- package/src/services/storage/types.d.ts.map +1 -1
package/CHANGELOG.md
CHANGED
package/index.cjs.js
CHANGED
|
@@ -2,10 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
var getWalletProviderFromWalletAccount = require('./getWalletProviderFromWalletAccount.cjs.js');
|
|
4
4
|
var sdkApiCore = require('@dynamic-labs/sdk-api-core');
|
|
5
|
-
var
|
|
5
|
+
var z = require('@zod/mini');
|
|
6
6
|
var EventEmitter = require('eventemitter3');
|
|
7
7
|
var browser = require('@simplewebauthn/browser');
|
|
8
8
|
|
|
9
|
+
function _interopNamespaceDefault(e) {
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
|
|
27
|
+
|
|
9
28
|
/**
|
|
10
29
|
* Maps the state keys to the event names.
|
|
11
30
|
*
|
|
@@ -224,7 +243,7 @@ const parseFromStorage = (value)=>{
|
|
|
224
243
|
* The schema to track the expiration time of the project settings.
|
|
225
244
|
*/ const projectSettingsExpirationScheme = createStorageKeySchema({
|
|
226
245
|
key: 'projectSettingsExpiration',
|
|
227
|
-
schema:
|
|
246
|
+
schema: z__namespace.number()
|
|
228
247
|
});
|
|
229
248
|
|
|
230
249
|
/**
|
|
@@ -346,24 +365,24 @@ const SDK_API_CORE_VERSION = getWalletProviderFromWalletAccount.dependencies['@d
|
|
|
346
365
|
|
|
347
366
|
const stateStorageKeySchema = createStorageKeySchema({
|
|
348
367
|
key: 'state',
|
|
349
|
-
schema:
|
|
350
|
-
apiVersion:
|
|
351
|
-
projectSettings:
|
|
352
|
-
user:
|
|
368
|
+
schema: z__namespace.object({
|
|
369
|
+
apiVersion: z__namespace.string(),
|
|
370
|
+
projectSettings: z__namespace.custom(),
|
|
371
|
+
user: z__namespace.custom()
|
|
353
372
|
})
|
|
354
373
|
});
|
|
355
374
|
const sessionKeySchema = createStorageKeySchema({
|
|
356
375
|
key: 'session',
|
|
357
|
-
schema:
|
|
376
|
+
schema: z__namespace.object({
|
|
358
377
|
/**
|
|
359
378
|
* The current available MFA token.
|
|
360
|
-
*/ mfaToken:
|
|
379
|
+
*/ mfaToken: z__namespace.nullable(z__namespace.string()),
|
|
361
380
|
/**
|
|
362
381
|
* Milliseconds since epoch of session expiration.
|
|
363
|
-
*/ sessionExpiration:
|
|
382
|
+
*/ sessionExpiration: z__namespace.number(),
|
|
364
383
|
/**
|
|
365
384
|
* Token will be undefined in environments with cookie based sessions.
|
|
366
|
-
*/ token:
|
|
385
|
+
*/ token: z__namespace.nullable(z__namespace.string())
|
|
367
386
|
})
|
|
368
387
|
});
|
|
369
388
|
|
|
@@ -1020,11 +1039,11 @@ const updateAuthFromVerifyResponse = (client, response)=>{
|
|
|
1020
1039
|
|
|
1021
1040
|
/** The schema to track the state of the OAuth flow. */ const redirectStateStorageSchema = createStorageKeySchema({
|
|
1022
1041
|
key: 'redirectState',
|
|
1023
|
-
schema:
|
|
1024
|
-
captchaToken:
|
|
1025
|
-
codeVerifier:
|
|
1026
|
-
provider:
|
|
1027
|
-
state:
|
|
1042
|
+
schema: z__namespace.object({
|
|
1043
|
+
captchaToken: z__namespace.optional(z__namespace.string()),
|
|
1044
|
+
codeVerifier: z__namespace.optional(z__namespace.string()),
|
|
1045
|
+
provider: z__namespace.enum(sdkApiCore.ProviderEnum),
|
|
1046
|
+
state: z__namespace.string()
|
|
1028
1047
|
})
|
|
1029
1048
|
});
|
|
1030
1049
|
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { B as BaseError, a as assertDefined, g as getCore, b as assignClient, I as InvalidStorageSet, c as createApiClient, e as emitEvent, s as subscribeWithSelector, i as isEqualShallow, d as dependencies, C as CannotTrackError, v as version, _ as _extends, r as randomString, f as getClient, h as getWalletProviderFromWalletAccount, j as getWalletProviderRegistry } from './getWalletProviderFromWalletAccount.esm.js';
|
|
2
2
|
export { M as MfaInvalidOtpError, k as MfaRateLimitedError, n as hasExtension, o as offEvent, m as onEvent, l as onceEvent } from './getWalletProviderFromWalletAccount.esm.js';
|
|
3
3
|
import { JwtVerifiedCredentialFormatEnum, ProviderEnum, MfaBackupCodeAcknowledgement } from '@dynamic-labs/sdk-api-core';
|
|
4
|
-
import
|
|
4
|
+
import * as z from '@zod/mini';
|
|
5
5
|
import EventEmitter$1, { EventEmitter } from 'eventemitter3';
|
|
6
6
|
import { startRegistration, browserSupportsWebAuthn, startAuthentication } from '@simplewebauthn/browser';
|
|
7
7
|
|
package/package.json
CHANGED
package/src/modules/auth/social/oauth/redirectStateStorageSchema/redirectStateStorageSchema.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ProviderEnum } from '@dynamic-labs/sdk-api-core';
|
|
2
|
-
import
|
|
2
|
+
import * as z from '@zod/mini';
|
|
3
3
|
/** The schema to track the state of the OAuth flow. */
|
|
4
4
|
export declare const redirectStateStorageSchema: import("../../../../../services/storage/types").StorageKeySchema<{
|
|
5
5
|
captchaToken?: string | undefined;
|
|
6
6
|
codeVerifier?: string | undefined;
|
|
7
|
-
provider: z.core.$InferEnumOutput<typeof ProviderEnum>;
|
|
7
|
+
provider: z.z.core.$InferEnumOutput<typeof ProviderEnum>;
|
|
8
8
|
state: string;
|
|
9
9
|
}>;
|
|
10
10
|
//# sourceMappingURL=redirectStateStorageSchema.d.ts.map
|
package/src/modules/auth/social/oauth/redirectStateStorageSchema/redirectStateStorageSchema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redirectStateStorageSchema.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/client/src/modules/auth/social/oauth/redirectStateStorageSchema/redirectStateStorageSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"redirectStateStorageSchema.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/client/src/modules/auth/social/oauth/redirectStateStorageSchema/redirectStateStorageSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,KAAK,CAAC,MAAM,WAAW,CAAC;AAI/B,uDAAuD;AACvD,eAAO,MAAM,0BAA0B;;;;;EAQrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../../../packages/client/src/modules/wallets/unverifiedWalletAccounts/schema.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../../../../packages/client/src/modules/wallets/unverifiedWalletAccounts/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAC;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,6BAA6B;;;;;;MAMxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/client/src/modules/wallets/unverifiedWalletAccounts/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../packages/client/src/modules/wallets/unverifiedWalletAccounts/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAC;AAE9D,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAC3C,OAAO,6BAA6B,CACrC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type * as z from '@zod/mini';
|
|
2
2
|
import type { StorageKeySchema } from '../types';
|
|
3
3
|
export declare const createStorageKeySchema: <T>(params: {
|
|
4
4
|
key: string;
|
|
5
|
-
schema: ZodMiniType<T>;
|
|
5
|
+
schema: z.ZodMiniType<T>;
|
|
6
6
|
}) => StorageKeySchema<T>;
|
|
7
7
|
//# sourceMappingURL=createStorageKeySchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createStorageKeySchema.d.ts","sourceRoot":"","sources":["../../../../../../../packages/client/src/services/storage/createStorageKeySchema/createStorageKeySchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"createStorageKeySchema.d.ts","sourceRoot":"","sources":["../../../../../../../packages/client/src/services/storage/createStorageKeySchema/createStorageKeySchema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD,eAAO,MAAM,sBAAsB,GAAI,CAAC,UAAU;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAC1B,KAAG,gBAAgB,CAAC,CAAC,CAErB,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type * as z from '@zod/mini';
|
|
2
2
|
/**
|
|
3
3
|
* The store item definition is used to identify in which key
|
|
4
4
|
* the value should be stored and the validation schema of the value.
|
|
5
5
|
*/
|
|
6
6
|
export type StorageKeySchema<T> = {
|
|
7
7
|
key: string;
|
|
8
|
-
schema: ZodMiniType<T>;
|
|
8
|
+
schema: z.ZodMiniType<T>;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Set of methods used to store and retrieve items from a storage medium.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/client/src/services/storage/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../packages/client/src/services/storage/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,CAAC,MAAM,WAAW,CAAC;AAEpC;;;GAGG;AACH,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB;;OAEG;IACH,OAAO,EAAE,CAAC,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAEzE;;OAEG;IACH,UAAU,EAAE,CAAC,CAAC,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAExE;;OAEG;IACH,OAAO,EAAE,CAAC,CAAC,EACT,gBAAgB,EAAE,gBAAgB,CAAC,CAAC,CAAC,EACrC,KAAK,EAAE,CAAC,KACL,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAC7B,KAAK,EAAE,CAAC,CAAC;CACV,CAAC"}
|