@passlock/client 0.9.4 → 0.9.5
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/dist/authentication/authenticate.d.ts +6 -6
- package/dist/authentication/authenticate.d.ts.map +1 -1
- package/dist/authentication/authenticate.fixture.d.ts +6 -6
- package/dist/authentication/authenticate.fixture.d.ts.map +1 -1
- package/dist/authentication/authenticate.fixture.js +5 -5
- package/dist/authentication/authenticate.fixture.js.map +1 -1
- package/dist/authentication/authenticate.js +5 -5
- package/dist/authentication/authenticate.js.map +1 -1
- package/dist/authentication/authenticate.test.js +4 -4
- package/dist/authentication/authenticate.test.js.map +1 -1
- package/dist/capabilities/capabilities.d.ts +1 -1
- package/dist/capabilities/capabilities.d.ts.map +1 -1
- package/dist/capabilities/capabilities.js +1 -1
- package/dist/capabilities/capabilities.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/connection/connection.d.ts +2 -2
- package/dist/connection/connection.d.ts.map +1 -1
- package/dist/connection/connection.fixture.d.ts +2 -2
- package/dist/connection/connection.fixture.d.ts.map +1 -1
- package/dist/connection/connection.fixture.js +3 -3
- package/dist/connection/connection.fixture.js.map +1 -1
- package/dist/connection/connection.js +2 -2
- package/dist/connection/connection.js.map +1 -1
- package/dist/connection/connection.test.js +3 -3
- package/dist/connection/connection.test.js.map +1 -1
- package/dist/effect.d.ts +12 -12
- package/dist/effect.d.ts.map +1 -1
- package/dist/effect.js +9 -9
- package/dist/effect.js.map +1 -1
- package/dist/email/email.d.ts +4 -4
- package/dist/email/email.d.ts.map +1 -1
- package/dist/email/email.fixture.d.ts +6 -6
- package/dist/email/email.fixture.d.ts.map +1 -1
- package/dist/email/email.fixture.js +6 -6
- package/dist/email/email.fixture.js.map +1 -1
- package/dist/email/email.js +5 -5
- package/dist/email/email.js.map +1 -1
- package/dist/email/email.test.js +5 -5
- package/dist/email/email.test.js.map +1 -1
- package/dist/event/event.d.ts +1 -1
- package/dist/event/event.d.ts.map +1 -1
- package/dist/event/event.js +1 -1
- package/dist/event/event.js.map +1 -1
- package/dist/event/event.node.test.js +1 -1
- package/dist/event/event.node.test.js.map +1 -1
- package/dist/event/event.test.js +1 -1
- package/dist/event/event.test.js.map +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/logging/eventLogger.test.js +1 -1
- package/dist/logging/eventLogger.test.js.map +1 -1
- package/dist/registration/register.d.ts +8 -8
- package/dist/registration/register.d.ts.map +1 -1
- package/dist/registration/register.fixture.d.ts +7 -7
- package/dist/registration/register.fixture.d.ts.map +1 -1
- package/dist/registration/register.fixture.js +6 -6
- package/dist/registration/register.fixture.js.map +1 -1
- package/dist/registration/register.js +6 -6
- package/dist/registration/register.js.map +1 -1
- package/dist/registration/register.test.js +5 -5
- package/dist/registration/register.test.js.map +1 -1
- package/dist/storage/storage.d.ts +1 -1
- package/dist/storage/storage.d.ts.map +1 -1
- package/dist/storage/storage.fixture.d.ts +2 -2
- package/dist/storage/storage.fixture.d.ts.map +1 -1
- package/dist/storage/storage.fixture.js +1 -1
- package/dist/storage/storage.fixture.js.map +1 -1
- package/dist/storage/storage.test.js +2 -2
- package/dist/storage/storage.test.js.map +1 -1
- package/dist/test/fixtures.d.ts +3 -3
- package/dist/test/fixtures.d.ts.map +1 -1
- package/dist/test/fixtures.js +2 -2
- package/dist/test/fixtures.js.map +1 -1
- package/dist/user/user.d.ts +2 -2
- package/dist/user/user.d.ts.map +1 -1
- package/dist/user/user.fixture.d.ts +2 -2
- package/dist/user/user.fixture.d.ts.map +1 -1
- package/dist/user/user.fixture.js +3 -3
- package/dist/user/user.fixture.js.map +1 -1
- package/dist/user/user.js +2 -2
- package/dist/user/user.js.map +1 -1
- package/dist/user/user.test.js +3 -3
- package/dist/user/user.test.js.map +1 -1
- package/package.json +2 -2
- package/src/authentication/authenticate.fixture.ts +6 -6
- package/src/authentication/authenticate.test.ts +4 -4
- package/src/authentication/authenticate.ts +7 -7
- package/src/capabilities/capabilities.ts +1 -1
- package/src/config.ts +1 -1
- package/src/connection/connection.fixture.ts +3 -3
- package/src/connection/connection.test.ts +3 -3
- package/src/connection/connection.ts +3 -3
- package/src/effect.ts +12 -12
- package/src/email/email.fixture.ts +6 -6
- package/src/email/email.test.ts +5 -5
- package/src/email/email.ts +6 -6
- package/src/event/event.node.test.ts +1 -1
- package/src/event/event.test.ts +1 -1
- package/src/event/event.ts +1 -1
- package/src/index.ts +13 -13
- package/src/logging/eventLogger.test.ts +1 -1
- package/src/registration/register.fixture.ts +7 -7
- package/src/registration/register.test.ts +5 -5
- package/src/registration/register.ts +9 -9
- package/src/storage/storage.fixture.ts +2 -2
- package/src/storage/storage.test.ts +2 -2
- package/src/storage/storage.ts +1 -1
- package/src/test/fixtures.ts +3 -3
- package/src/user/user.fixture.ts +3 -3
- package/src/user/user.test.ts +3 -3
- package/src/user/user.ts +3 -3
package/dist/test/fixtures.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Principal } from '@passlock/shared/dist/schema/schema';
|
|
1
|
+
import type { Principal } from '@passlock/shared/dist/schema/schema.js';
|
|
2
2
|
import { Layer as L } from 'effect';
|
|
3
|
-
import { Capabilities } from '../capabilities/capabilities';
|
|
4
|
-
import { StorageService, type StoredToken } from '../storage/storage';
|
|
3
|
+
import { Capabilities } from '../capabilities/capabilities.js';
|
|
4
|
+
import { StorageService, type StoredToken } from '../storage/storage.js';
|
|
5
5
|
export declare const session = "session";
|
|
6
6
|
export declare const token = "token";
|
|
7
7
|
export declare const code = "code";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/test/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/test/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAA;AACvE,OAAO,EAAe,KAAK,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExE,eAAO,MAAM,OAAO,YAAY,CAAA;AAChC,eAAO,MAAM,KAAK,UAAU,CAAA;AAC5B,eAAO,MAAM,IAAI,SAAS,CAAA;AAC1B,eAAO,MAAM,QAAQ,YAAY,CAAA;AACjC,eAAO,MAAM,QAAQ,QAAqB,CAAA;AAE1C,eAAO,MAAM,SAAS,EAAE,SAevB,CAAA;AAED,eAAO,MAAM,gBAAgB,qCAQ5B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,WAA2C,CAAA;AAErE,eAAO,MAAM,kBAAkB,uCAS9B,CAAA"}
|
package/dist/test/fixtures.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect as E, Layer as L } from 'effect';
|
|
2
|
-
import { Capabilities } from '../capabilities/capabilities';
|
|
3
|
-
import { StorageService } from '../storage/storage';
|
|
2
|
+
import { Capabilities } from '../capabilities/capabilities.js';
|
|
3
|
+
import { StorageService } from '../storage/storage.js';
|
|
4
4
|
export const session = 'session';
|
|
5
5
|
export const token = 'token';
|
|
6
6
|
export const code = 'code';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../src/test/fixtures.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":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K,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAA;AAErE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,OAAO,CACzC,cAAc,EACd,cAAc,CAAC,EAAE,CAAC;IAChB,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI;IACxB,QAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IACtC,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI;IACxB,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI;IAC/B,kBAAkB,EAAE,CAAC,CAAC,IAAI;CAC3B,CAAC,CACH,CAAA"}
|
package/dist/user/user.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BadRequest } from '@passlock/shared/dist/error/error';
|
|
2
|
-
import { RpcClient } from '@passlock/shared/dist/rpc/rpc';
|
|
1
|
+
import type { BadRequest } from '@passlock/shared/dist/error/error.js';
|
|
2
|
+
import { RpcClient } from '@passlock/shared/dist/rpc/rpc.js';
|
|
3
3
|
import { Context, Effect as E, Layer } from 'effect';
|
|
4
4
|
export type Email = {
|
|
5
5
|
email: string;
|
package/dist/user/user.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/user/user.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../src/user/user.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,KAAK,EAAQ,MAAM,QAAQ,CAAA;AAI1D,MAAM,MAAM,KAAK,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAIrC,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;CAChE,CAAA;AAED,eAAO,MAAM,WAAW,uCAA2D,CAAA;AAInF,KAAK,YAAY,GAAG,SAAS,CAAA;AAE7B,eAAO,MAAM,cAAc,YAAa,KAAK,KAAG,EAAE,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,CAUzF,CAAA;AAKD,eAAO,MAAM,eAAe,4CAQ3B,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RpcClient } from '@passlock/shared/dist/rpc/rpc';
|
|
2
|
-
import { IsExistingUserReq, IsExistingUserRes } from '@passlock/shared/dist/rpc/user';
|
|
1
|
+
import { RpcClient } from '@passlock/shared/dist/rpc/rpc.js';
|
|
2
|
+
import { IsExistingUserReq, IsExistingUserRes } from '@passlock/shared/dist/rpc/user.js';
|
|
3
3
|
import { Layer as L } from 'effect';
|
|
4
4
|
export declare const email = "jdoe@gmail.com";
|
|
5
5
|
export declare const rpcClientTest: L.Layer<RpcClient, never, never>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.fixture.d.ts","sourceRoot":"","sources":["../../src/user/user.fixture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"user.fixture.d.ts","sourceRoot":"","sources":["../../src/user/user.fixture.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AACxF,OAAO,EAAe,KAAK,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,eAAO,MAAM,KAAK,mBAAmB,CAAA;AAErC,eAAO,MAAM,aAAa,kCAWzB,CAAA;AAED,eAAO,MAAM,eAAe,mBAAmC,CAAA;AAC/D,eAAO,MAAM,eAAe,mBAAiD,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BadRequest } from '@passlock/shared/dist/error/error';
|
|
2
|
-
import { RpcClient } from '@passlock/shared/dist/rpc/rpc';
|
|
3
|
-
import { IsExistingUserReq, IsExistingUserRes } from '@passlock/shared/dist/rpc/user';
|
|
1
|
+
import { BadRequest } from '@passlock/shared/dist/error/error.js';
|
|
2
|
+
import { RpcClient } from '@passlock/shared/dist/rpc/rpc.js';
|
|
3
|
+
import { IsExistingUserReq, IsExistingUserRes } from '@passlock/shared/dist/rpc/user.js';
|
|
4
4
|
import { Effect as E, Layer as L } from 'effect';
|
|
5
5
|
export const email = 'jdoe@gmail.com';
|
|
6
6
|
export const rpcClientTest = L.succeed(RpcClient, RpcClient.of({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.fixture.js","sourceRoot":"","sources":["../../src/user/user.fixture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"user.fixture.js","sourceRoot":"","sources":["../../src/user/user.fixture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AACxF,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAEhD,MAAM,CAAC,MAAM,KAAK,GAAG,gBAAgB,CAAA;AAErC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,OAAO,CACpC,SAAS,EACT,SAAS,CAAC,EAAE,CAAC;IACX,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC7C,cAAc,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;IACvD,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAChD,sBAAsB,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACrF,4BAA4B,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC,CAAC;IAC3F,wBAAwB,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACvF,8BAA8B,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC,CAAC;CAC9F,CAAC,CACH,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,iBAAiB,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;AAC/D,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,iBAAiB,CAAC,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAA"}
|
package/dist/user/user.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RpcClient } from '@passlock/shared/dist/rpc/rpc';
|
|
2
|
-
import { IsExistingUserReq } from '@passlock/shared/dist/rpc/user';
|
|
1
|
+
import { RpcClient } from '@passlock/shared/dist/rpc/rpc.js';
|
|
2
|
+
import { IsExistingUserReq } from '@passlock/shared/dist/rpc/user.js';
|
|
3
3
|
import { Context, Effect as E, Layer, flow } from 'effect';
|
|
4
4
|
export const UserService = Context.GenericTag('@services/UserService');
|
|
5
5
|
export const isExistingUser = (request) => {
|
package/dist/user/user.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/user/user.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/user/user.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAY1D,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,UAAU,CAAc,uBAAuB,CAAC,CAAA;AAMnF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAAc,EAA+C,EAAE;IAC5F,OAAO,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC,CAAA;QACnD,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;QAErC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAA;QAC1C,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QAE3F,OAAO,YAAY,CAAA;IACrB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAKD,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,MAAM,CACzC,WAAW,EACX,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;IAChB,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,EAAa,CAAC,CAAA;IAChD,OAAO,WAAW,CAAC,EAAE,CAAC;QACpB,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;KACzD,CAAC,CAAA;AACJ,CAAC,CAAC,CACH,CAAA"}
|
package/dist/user/user.test.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { RpcClient } from '@passlock/shared/dist/rpc/rpc';
|
|
1
|
+
import { RpcClient } from '@passlock/shared/dist/rpc/rpc.js';
|
|
2
2
|
import { Effect as E, Layer as L, Layer, LogLevel, Logger, pipe } from 'effect';
|
|
3
3
|
import { describe, expect, test } from 'vitest';
|
|
4
4
|
import { mock } from 'vitest-mock-extended';
|
|
5
|
-
import { UserService, UserServiceLive } from './user';
|
|
6
|
-
import * as Fixture from './user.fixture';
|
|
5
|
+
import { UserService, UserServiceLive } from './user.js';
|
|
6
|
+
import * as Fixture from './user.fixture.js';
|
|
7
7
|
describe('isExistingUser should', () => {
|
|
8
8
|
test('return true when the user already has a passkey', async () => {
|
|
9
9
|
const assertions = E.gen(function* (_) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.test.js","sourceRoot":"","sources":["../../src/user/user.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"user.test.js","sourceRoot":"","sources":["../../src/user/user.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,MAAM,kCAAkC,CAAA;AAC5E,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ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
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"description": "Easy WebAuthn/FIDO Passkey authentication for your web apps. This library works with pretty much any frontend/backend stack including React/Next.js, Vue, SvelteKit etc - check out the tutorial",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"passkey",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"effect": "2.4.18",
|
|
43
|
-
"@passlock/shared": "0.9.
|
|
43
|
+
"@passlock/shared": "0.9.5"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@github/webauthn-json": "^2.1.1",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { BadRequest } from '@passlock/shared/dist/error/error'
|
|
1
|
+
import { BadRequest } from '@passlock/shared/dist/error/error.js'
|
|
2
2
|
import {
|
|
3
3
|
OptionsRes,
|
|
4
4
|
VerificationReq,
|
|
5
5
|
VerificationRes,
|
|
6
|
-
} from '@passlock/shared/dist/rpc/authentication'
|
|
7
|
-
import { RpcClient } from '@passlock/shared/dist/rpc/rpc'
|
|
8
|
-
import type { AuthenticationCredential } from '@passlock/shared/dist/schema/schema'
|
|
6
|
+
} from '@passlock/shared/dist/rpc/authentication.js'
|
|
7
|
+
import { RpcClient } from '@passlock/shared/dist/rpc/rpc.js'
|
|
8
|
+
import type { AuthenticationCredential } from '@passlock/shared/dist/schema/schema.js'
|
|
9
9
|
import { Effect as E, Layer as L } from 'effect'
|
|
10
|
-
import { type AuthenticationRequest, GetCredential } from './authenticate'
|
|
11
|
-
import * as Fixtures from '../test/fixtures'
|
|
10
|
+
import { type AuthenticationRequest, GetCredential } from './authenticate.js'
|
|
11
|
+
import * as Fixtures from '../test/fixtures.js'
|
|
12
12
|
|
|
13
13
|
export const session = 'session'
|
|
14
14
|
export const token = 'token'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type RouterOps, RpcClient } from '@passlock/shared/dist/rpc/rpc'
|
|
1
|
+
import { type RouterOps, RpcClient } from '@passlock/shared/dist/rpc/rpc.js'
|
|
2
2
|
import { Effect as E, Layer as L, Layer, LogLevel, Logger, pipe } from 'effect'
|
|
3
3
|
import { describe, expect, test, vi } from 'vitest'
|
|
4
4
|
import { mock } from 'vitest-mock-extended'
|
|
5
|
-
import { AuthenticateServiceLive, AuthenticationService, GetCredential } from './authenticate'
|
|
6
|
-
import * as Fixture from './authenticate.fixture'
|
|
7
|
-
import { StorageService } from '../storage/storage'
|
|
5
|
+
import { AuthenticateServiceLive, AuthenticationService, GetCredential } from './authenticate.js'
|
|
6
|
+
import * as Fixture from './authenticate.fixture.js'
|
|
7
|
+
import { StorageService } from '../storage/storage.js'
|
|
8
8
|
|
|
9
9
|
describe('authenticate should', () => {
|
|
10
10
|
test('return a valid principal', async () => {
|
|
@@ -9,18 +9,18 @@ import {
|
|
|
9
9
|
type BadRequest,
|
|
10
10
|
InternalBrowserError,
|
|
11
11
|
type NotSupported,
|
|
12
|
-
} from '@passlock/shared/dist/error/error'
|
|
13
|
-
import type { VerificationErrors } from '@passlock/shared/dist/rpc/authentication'
|
|
14
|
-
import { OptionsReq, VerificationReq } from '@passlock/shared/dist/rpc/authentication'
|
|
15
|
-
import { RpcClient } from '@passlock/shared/dist/rpc/rpc'
|
|
12
|
+
} from '@passlock/shared/dist/error/error.js'
|
|
13
|
+
import type { VerificationErrors } from '@passlock/shared/dist/rpc/authentication.js'
|
|
14
|
+
import { OptionsReq, VerificationReq } from '@passlock/shared/dist/rpc/authentication.js'
|
|
15
|
+
import { RpcClient } from '@passlock/shared/dist/rpc/rpc.js'
|
|
16
16
|
import type {
|
|
17
17
|
AuthenticationCredential,
|
|
18
18
|
Principal,
|
|
19
19
|
UserVerification,
|
|
20
|
-
} from '@passlock/shared/dist/schema/schema'
|
|
20
|
+
} from '@passlock/shared/dist/schema/schema.js'
|
|
21
21
|
import { Context, Effect as E, Layer, flow, pipe } from 'effect'
|
|
22
|
-
import { Capabilities } from '../capabilities/capabilities'
|
|
23
|
-
import { StorageService } from '../storage/storage'
|
|
22
|
+
import { Capabilities } from '../capabilities/capabilities.js'
|
|
23
|
+
import { StorageService } from '../storage/storage.js'
|
|
24
24
|
|
|
25
25
|
/* Requests */
|
|
26
26
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Test if the browser supports passkeys, conditional UI etc
|
|
3
3
|
*/
|
|
4
|
-
import { NotSupported } from '@passlock/shared/dist/error/error'
|
|
4
|
+
import { NotSupported } from '@passlock/shared/dist/error/error.js'
|
|
5
5
|
import { Context, Effect as E, Layer, identity, pipe } from 'effect'
|
|
6
6
|
|
|
7
7
|
/* Service */
|
package/src/config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BadRequest } from '@passlock/shared/dist/error/error'
|
|
2
|
-
import { PreConnectReq, PreConnectRes } from '@passlock/shared/dist/rpc/connection'
|
|
3
|
-
import { RpcClient } from '@passlock/shared/dist/rpc/rpc'
|
|
1
|
+
import { BadRequest } from '@passlock/shared/dist/error/error.js'
|
|
2
|
+
import { PreConnectReq, PreConnectRes } from '@passlock/shared/dist/rpc/connection.js'
|
|
3
|
+
import { RpcClient } from '@passlock/shared/dist/rpc/rpc.js'
|
|
4
4
|
import { Effect as E, Layer as L } from 'effect'
|
|
5
5
|
|
|
6
6
|
export const rpcClientTest = L.succeed(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Dispatcher, type RouterOps, RpcClient, RpcConfig } from '@passlock/shared/dist/rpc/rpc'
|
|
1
|
+
import { Dispatcher, type RouterOps, RpcClient, RpcConfig } from '@passlock/shared/dist/rpc/rpc.js'
|
|
2
2
|
import { Effect as E, Layer as L, Layer, LogLevel, Logger, pipe } from 'effect'
|
|
3
3
|
import { describe, expect, test } from 'vitest'
|
|
4
4
|
import { mock } from 'vitest-mock-extended'
|
|
5
|
-
import { ConnectionService, ConnectionServiceLive } from './connection'
|
|
6
|
-
import * as Fixture from './connection.fixture'
|
|
5
|
+
import { ConnectionService, ConnectionServiceLive } from './connection.js'
|
|
6
|
+
import * as Fixture from './connection.fixture.js'
|
|
7
7
|
|
|
8
8
|
describe('preConnect should', () => {
|
|
9
9
|
test('hit the rpc endpoint', async () => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hits the rpc endpoint to warm up a lambda
|
|
3
3
|
*/
|
|
4
|
-
import { PreConnectReq } from '@passlock/shared/dist/rpc/connection'
|
|
5
|
-
import type { RpcConfig } from '@passlock/shared/dist/rpc/rpc';
|
|
6
|
-
import { Dispatcher, RpcClient } from '@passlock/shared/dist/rpc/rpc'
|
|
4
|
+
import { PreConnectReq } from '@passlock/shared/dist/rpc/connection.js'
|
|
5
|
+
import type { RpcConfig } from '@passlock/shared/dist/rpc/rpc.js';
|
|
6
|
+
import { Dispatcher, RpcClient } from '@passlock/shared/dist/rpc/rpc.js'
|
|
7
7
|
import { Context, Effect as E, Layer, flow, pipe } from 'effect'
|
|
8
8
|
|
|
9
9
|
/* Service */
|
package/src/effect.ts
CHANGED
|
@@ -9,9 +9,9 @@ export type {
|
|
|
9
9
|
NotFound,
|
|
10
10
|
NotSupported,
|
|
11
11
|
Unauthorized,
|
|
12
|
-
} from '@passlock/shared/dist/error/error'
|
|
12
|
+
} from '@passlock/shared/dist/error/error.js'
|
|
13
13
|
|
|
14
|
-
export type { Principal } from '@passlock/shared/dist/schema/schema'
|
|
14
|
+
export type { Principal } from '@passlock/shared/dist/schema/schema.js'
|
|
15
15
|
|
|
16
16
|
import {
|
|
17
17
|
type BadRequest,
|
|
@@ -22,16 +22,16 @@ import {
|
|
|
22
22
|
type NotFound,
|
|
23
23
|
type NotSupported,
|
|
24
24
|
type Unauthorized,
|
|
25
|
-
} from '@passlock/shared/dist/error/error'
|
|
25
|
+
} from '@passlock/shared/dist/error/error.js'
|
|
26
26
|
|
|
27
27
|
import {
|
|
28
28
|
DispatcherLive,
|
|
29
29
|
RetrySchedule,
|
|
30
30
|
RpcClientLive,
|
|
31
31
|
RpcConfig,
|
|
32
|
-
} from '@passlock/shared/dist/rpc/rpc'
|
|
32
|
+
} from '@passlock/shared/dist/rpc/rpc.js'
|
|
33
33
|
|
|
34
|
-
import type { Principal } from '@passlock/shared/dist/schema/schema'
|
|
34
|
+
import type { Principal } from '@passlock/shared/dist/schema/schema.js'
|
|
35
35
|
import { Context, Effect as E, Layer as L, Layer, Schedule, pipe } from 'effect'
|
|
36
36
|
import type { NoSuchElementException } from 'effect/Cause'
|
|
37
37
|
|
|
@@ -40,18 +40,18 @@ import {
|
|
|
40
40
|
type AuthenticationRequest,
|
|
41
41
|
AuthenticationService,
|
|
42
42
|
GetCredential,
|
|
43
|
-
} from './authentication/authenticate'
|
|
43
|
+
} from './authentication/authenticate.js'
|
|
44
44
|
|
|
45
|
-
import { capabilitiesLive } from './capabilities/capabilities'
|
|
46
|
-
import { ConnectionService, ConnectionServiceLive } from './connection/connection'
|
|
47
|
-
import { EmailService, EmailServiceLive, LocationSearch, type VerifyRequest } from './email/email'
|
|
45
|
+
import { capabilitiesLive } from './capabilities/capabilities.js'
|
|
46
|
+
import { ConnectionService, ConnectionServiceLive } from './connection/connection.js'
|
|
47
|
+
import { EmailService, EmailServiceLive, LocationSearch, type VerifyRequest } from './email/email.js'
|
|
48
48
|
|
|
49
49
|
import {
|
|
50
50
|
CreateCredential,
|
|
51
51
|
type RegistrationRequest,
|
|
52
52
|
RegistrationService,
|
|
53
53
|
RegistrationServiceLive,
|
|
54
|
-
} from './registration/register'
|
|
54
|
+
} from './registration/register.js'
|
|
55
55
|
|
|
56
56
|
import {
|
|
57
57
|
type AuthType,
|
|
@@ -59,9 +59,9 @@ import {
|
|
|
59
59
|
StorageService,
|
|
60
60
|
StorageServiceLive,
|
|
61
61
|
type StoredToken,
|
|
62
|
-
} from './storage/storage'
|
|
62
|
+
} from './storage/storage.js'
|
|
63
63
|
|
|
64
|
-
import { type Email, UserService, UserServiceLive } from './user/user'
|
|
64
|
+
import { type Email, UserService, UserServiceLive } from './user/user.js'
|
|
65
65
|
|
|
66
66
|
/* Layers */
|
|
67
67
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BadRequest } from '@passlock/shared/dist/error/error'
|
|
2
|
-
import { RpcClient } from '@passlock/shared/dist/rpc/rpc'
|
|
3
|
-
import { VerifyEmailReq, VerifyEmailRes } from '@passlock/shared/dist/rpc/user'
|
|
1
|
+
import { BadRequest } from '@passlock/shared/dist/error/error.js'
|
|
2
|
+
import { RpcClient } from '@passlock/shared/dist/rpc/rpc.js'
|
|
3
|
+
import { VerifyEmailReq, VerifyEmailRes } from '@passlock/shared/dist/rpc/user.js'
|
|
4
4
|
import { Effect as E, Layer as L } from 'effect'
|
|
5
|
-
import { LocationSearch } from './email'
|
|
6
|
-
import { AuthenticationService } from '../authentication/authenticate'
|
|
7
|
-
import * as Fixtures from '../test/fixtures'
|
|
5
|
+
import { LocationSearch } from './email.js'
|
|
6
|
+
import { AuthenticationService } from '../authentication/authenticate.js'
|
|
7
|
+
import * as Fixtures from '../test/fixtures.js'
|
|
8
8
|
|
|
9
9
|
export const token = 'token'
|
|
10
10
|
export const code = 'code'
|
package/src/email/email.test.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { type RouterOps, RpcClient } from '@passlock/shared/dist/rpc/rpc'
|
|
1
|
+
import { type RouterOps, RpcClient } from '@passlock/shared/dist/rpc/rpc.js'
|
|
2
2
|
import { Effect as E, Layer as L, LogLevel, Logger, pipe } from 'effect'
|
|
3
3
|
import { NoSuchElementException } from 'effect/Cause'
|
|
4
4
|
import { describe, expect, test } from 'vitest'
|
|
5
5
|
import { mock } from 'vitest-mock-extended'
|
|
6
|
-
import { EmailService, EmailServiceLive } from './email'
|
|
7
|
-
import * as Fixture from './email.fixture'
|
|
8
|
-
import { AuthenticationService } from '../authentication/authenticate'
|
|
9
|
-
import { StorageService } from '../storage/storage'
|
|
6
|
+
import { EmailService, EmailServiceLive } from './email.js'
|
|
7
|
+
import * as Fixture from './email.fixture.js'
|
|
8
|
+
import { AuthenticationService } from '../authentication/authenticate.js'
|
|
9
|
+
import { StorageService } from '../storage/storage.js'
|
|
10
10
|
|
|
11
11
|
describe('verifyEmailCode should', () => {
|
|
12
12
|
test('return true when the verification is successful', async () => {
|
package/src/email/email.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Email verification effects
|
|
3
3
|
*/
|
|
4
|
-
import { BadRequest } from '@passlock/shared/dist/error/error'
|
|
5
|
-
import { RpcClient } from '@passlock/shared/dist/rpc/rpc'
|
|
6
|
-
import type { VerifyEmailErrors as RpcErrors } from '@passlock/shared/dist/rpc/user'
|
|
7
|
-
import { VerifyEmailReq } from '@passlock/shared/dist/rpc/user'
|
|
4
|
+
import { BadRequest } from '@passlock/shared/dist/error/error.js'
|
|
5
|
+
import { RpcClient } from '@passlock/shared/dist/rpc/rpc.js'
|
|
6
|
+
import type { VerifyEmailErrors as RpcErrors } from '@passlock/shared/dist/rpc/user.js'
|
|
7
|
+
import { VerifyEmailReq } from '@passlock/shared/dist/rpc/user.js'
|
|
8
8
|
import { Context, Effect as E, Layer, Option as O, flow, identity, pipe } from 'effect'
|
|
9
|
-
import { type AuthenticationErrors, AuthenticationService } from '../authentication/authenticate'
|
|
10
|
-
import { StorageService } from '../storage/storage'
|
|
9
|
+
import { type AuthenticationErrors, AuthenticationService } from '../authentication/authenticate.js'
|
|
10
|
+
import { StorageService } from '../storage/storage.js'
|
|
11
11
|
|
|
12
12
|
/* Requests */
|
|
13
13
|
|
package/src/event/event.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect } from 'effect'
|
|
2
2
|
import { afterEach, describe, expect, test, vi } from 'vitest'
|
|
3
|
-
import { DebugMessage, fireEvent, isPasslockEvent } from './event'
|
|
3
|
+
import { DebugMessage, fireEvent, isPasslockEvent } from './event.js'
|
|
4
4
|
|
|
5
5
|
describe('fireEvent', () => {
|
|
6
6
|
afterEach(() => {
|
package/src/event/event.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Fire DOM events
|
|
3
3
|
*/
|
|
4
|
-
import { InternalBrowserError } from '@passlock/shared/dist/error/error'
|
|
4
|
+
import { InternalBrowserError } from '@passlock/shared/dist/error/error.js'
|
|
5
5
|
import { Effect } from 'effect'
|
|
6
6
|
|
|
7
7
|
export const DebugMessage = 'PasslogDebugMessage'
|
package/src/index.ts
CHANGED
|
@@ -6,20 +6,20 @@ import type {
|
|
|
6
6
|
NotFound,
|
|
7
7
|
NotSupported,
|
|
8
8
|
Unauthorized,
|
|
9
|
-
} from '@passlock/shared/dist/error/error'
|
|
10
|
-
import { ErrorCode } from '@passlock/shared/dist/error/error'
|
|
11
|
-
import { RpcConfig } from '@passlock/shared/dist/rpc/rpc'
|
|
9
|
+
} from '@passlock/shared/dist/error/error.js'
|
|
10
|
+
import { ErrorCode } from '@passlock/shared/dist/error/error.js'
|
|
11
|
+
import { RpcConfig } from '@passlock/shared/dist/rpc/rpc.js'
|
|
12
12
|
import { Effect as E, Layer as L, Layer, Option, Runtime, Scope, pipe } from 'effect'
|
|
13
|
-
import { type AuthenticationRequest, AuthenticationService } from './authentication/authenticate'
|
|
14
|
-
import { Capabilities } from './capabilities/capabilities'
|
|
15
|
-
import { ConnectionService } from './connection/connection'
|
|
16
|
-
import { allRequirements } from './effect'
|
|
17
|
-
import { EmailService, type VerifyRequest } from './email/email'
|
|
18
|
-
import { type RegistrationRequest, RegistrationService } from './registration/register'
|
|
19
|
-
import { type AuthType, Storage, StorageService } from './storage/storage'
|
|
20
|
-
import { type Email, UserService } from './user/user'
|
|
21
|
-
|
|
22
|
-
export { ErrorCode } from '@passlock/shared/dist/error/error'
|
|
13
|
+
import { type AuthenticationRequest, AuthenticationService } from './authentication/authenticate.js'
|
|
14
|
+
import { Capabilities } from './capabilities/capabilities.js'
|
|
15
|
+
import { ConnectionService } from './connection/connection.js'
|
|
16
|
+
import { allRequirements } from './effect.js'
|
|
17
|
+
import { EmailService, type VerifyRequest } from './email/email.js'
|
|
18
|
+
import { type RegistrationRequest, RegistrationService } from './registration/register.js'
|
|
19
|
+
import { type AuthType, Storage, StorageService } from './storage/storage.js'
|
|
20
|
+
import { type Email, UserService } from './user/user.js'
|
|
21
|
+
|
|
22
|
+
export { ErrorCode } from '@passlock/shared/dist/error/error.js'
|
|
23
23
|
|
|
24
24
|
export class PasslockError extends Error {
|
|
25
25
|
readonly _tag = 'PasslockError'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect as E, LogLevel, Logger } from 'effect'
|
|
2
2
|
import { describe, expect, test, vi } from 'vitest'
|
|
3
|
-
import { eventLoggerLive, logRaw } from './eventLogger'
|
|
3
|
+
import { eventLoggerLive, logRaw } from './eventLogger.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Although the core log functionality is tested alongside the logger in the @passlock/shared
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { BadRequest } from '@passlock/shared/dist/error/error'
|
|
1
|
+
import { BadRequest } from '@passlock/shared/dist/error/error.js'
|
|
2
2
|
import {
|
|
3
3
|
OptionsReq,
|
|
4
4
|
OptionsRes,
|
|
5
5
|
VerificationReq,
|
|
6
6
|
VerificationRes,
|
|
7
|
-
} from '@passlock/shared/dist/rpc/registration'
|
|
8
|
-
import { RpcClient } from '@passlock/shared/dist/rpc/rpc'
|
|
9
|
-
import type { RegistrationCredential } from '@passlock/shared/dist/schema/schema'
|
|
7
|
+
} from '@passlock/shared/dist/rpc/registration.js'
|
|
8
|
+
import { RpcClient } from '@passlock/shared/dist/rpc/rpc.js'
|
|
9
|
+
import type { RegistrationCredential } from '@passlock/shared/dist/schema/schema.js'
|
|
10
10
|
import { Effect as E, Layer as L } from 'effect'
|
|
11
|
-
import { CreateCredential, type RegistrationRequest } from './register'
|
|
12
|
-
import * as Fixtures from '../test/fixtures'
|
|
13
|
-
import { UserService } from '../user/user'
|
|
11
|
+
import { CreateCredential, type RegistrationRequest } from './register.js'
|
|
12
|
+
import * as Fixtures from '../test/fixtures.js'
|
|
13
|
+
import { UserService } from '../user/user.js'
|
|
14
14
|
|
|
15
15
|
export const session = 'session'
|
|
16
16
|
export const token = 'token'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Duplicate, InternalBrowserError } from '@passlock/shared/dist/error/error'
|
|
2
|
-
import { type RouterOps, RpcClient } from '@passlock/shared/dist/rpc/rpc'
|
|
1
|
+
import { Duplicate, InternalBrowserError } from '@passlock/shared/dist/error/error.js'
|
|
2
|
+
import { type RouterOps, RpcClient } from '@passlock/shared/dist/rpc/rpc.js'
|
|
3
3
|
import { Effect as E, Layer as L, Layer, LogLevel, Logger, pipe } from 'effect'
|
|
4
4
|
import { describe, expect, test, vi } from 'vitest'
|
|
5
5
|
import { mock } from 'vitest-mock-extended'
|
|
6
|
-
import { CreateCredential, RegistrationService, RegistrationServiceLive } from './register'
|
|
7
|
-
import * as Fixture from './register.fixture'
|
|
8
|
-
import { UserService } from '../user/user'
|
|
6
|
+
import { CreateCredential, RegistrationService, RegistrationServiceLive } from './register.js'
|
|
7
|
+
import * as Fixture from './register.fixture.js'
|
|
8
|
+
import { UserService } from '../user/user.js'
|
|
9
9
|
|
|
10
10
|
describe('register should', () => {
|
|
11
11
|
test('return a valid credential', async () => {
|
|
@@ -5,21 +5,21 @@ import {
|
|
|
5
5
|
type CredentialCreationOptionsJSON,
|
|
6
6
|
parseCreationOptionsFromJSON,
|
|
7
7
|
} from '@github/webauthn-json/browser-ponyfill'
|
|
8
|
-
import type { NotSupported } from '@passlock/shared/dist/error/error'
|
|
9
|
-
import { Duplicate, InternalBrowserError } from '@passlock/shared/dist/error/error'
|
|
10
|
-
import type { OptionsErrors, VerificationErrors } from '@passlock/shared/dist/rpc/registration'
|
|
11
|
-
import { OptionsReq, VerificationReq } from '@passlock/shared/dist/rpc/registration'
|
|
12
|
-
import { RpcClient } from '@passlock/shared/dist/rpc/rpc'
|
|
8
|
+
import type { NotSupported } from '@passlock/shared/dist/error/error.js'
|
|
9
|
+
import { Duplicate, InternalBrowserError } from '@passlock/shared/dist/error/error.js'
|
|
10
|
+
import type { OptionsErrors, VerificationErrors } from '@passlock/shared/dist/rpc/registration.js'
|
|
11
|
+
import { OptionsReq, VerificationReq } from '@passlock/shared/dist/rpc/registration.js'
|
|
12
|
+
import { RpcClient } from '@passlock/shared/dist/rpc/rpc.js'
|
|
13
13
|
import type {
|
|
14
14
|
Principal,
|
|
15
15
|
RegistrationCredential,
|
|
16
16
|
UserVerification,
|
|
17
17
|
VerifyEmail,
|
|
18
|
-
} from '@passlock/shared/dist/schema/schema'
|
|
18
|
+
} from '@passlock/shared/dist/schema/schema.js'
|
|
19
19
|
import { Context, Effect as E, Layer, flow, pipe } from 'effect'
|
|
20
|
-
import { Capabilities } from '../capabilities/capabilities'
|
|
21
|
-
import { StorageService } from '../storage/storage'
|
|
22
|
-
import { UserService } from '../user/user'
|
|
20
|
+
import { Capabilities } from '../capabilities/capabilities.js'
|
|
21
|
+
import { StorageService } from '../storage/storage.js'
|
|
22
|
+
import { UserService } from '../user/user.js'
|
|
23
23
|
|
|
24
24
|
/* Requests */
|
|
25
25
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Principal } from '@passlock/shared/dist/schema/schema'
|
|
1
|
+
import type { Principal } from '@passlock/shared/dist/schema/schema.js'
|
|
2
2
|
import { Effect as E, Layer, pipe } from 'effect'
|
|
3
3
|
import { mock } from 'vitest-mock-extended'
|
|
4
|
-
import { Storage, StorageServiceLive } from './storage'
|
|
4
|
+
import { Storage, StorageServiceLive } from './storage.js'
|
|
5
5
|
|
|
6
6
|
// Frontend receives dates as objects
|
|
7
7
|
export const principal: Principal = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Effect as E, Layer, LogLevel, Logger, identity, pipe } from 'effect'
|
|
2
2
|
import { describe, expect, test } from 'vitest'
|
|
3
3
|
import { mock } from 'vitest-mock-extended'
|
|
4
|
-
import { Storage, StorageService, clearExpiredToken, clearToken, getToken } from './storage'
|
|
5
|
-
import { principal, testLayers } from './storage.fixture'
|
|
4
|
+
import { Storage, StorageService, clearExpiredToken, clearToken, getToken } from './storage.js'
|
|
5
|
+
import { principal, testLayers } from './storage.fixture.js'
|
|
6
6
|
|
|
7
7
|
// eslint chokes on expect(storage.setItem) etc
|
|
8
8
|
/* eslint @typescript-eslint/unbound-method: 0 */
|
package/src/storage/storage.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Wrapper around local storage that allows us to store
|
|
3
3
|
* authentication tokens in local storage for a short period.
|
|
4
4
|
*/
|
|
5
|
-
import type { Principal } from '@passlock/shared/dist/schema/schema'
|
|
5
|
+
import type { Principal } from '@passlock/shared/dist/schema/schema.js'
|
|
6
6
|
import { Context, Effect as E, Layer, Option as O, flow, pipe } from 'effect'
|
|
7
7
|
import type { NoSuchElementException } from 'effect/Cause'
|
|
8
8
|
|
package/src/test/fixtures.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Principal } from '@passlock/shared/dist/schema/schema'
|
|
1
|
+
import type { Principal } from '@passlock/shared/dist/schema/schema.js'
|
|
2
2
|
import { Effect as E, Layer as L } from 'effect'
|
|
3
|
-
import { Capabilities } from '../capabilities/capabilities'
|
|
4
|
-
import { StorageService, type StoredToken } from '../storage/storage'
|
|
3
|
+
import { Capabilities } from '../capabilities/capabilities.js'
|
|
4
|
+
import { StorageService, type StoredToken } from '../storage/storage.js'
|
|
5
5
|
|
|
6
6
|
export const session = 'session'
|
|
7
7
|
export const token = 'token'
|