@passlock/client 0.9.30 → 0.9.32

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 (89) hide show
  1. package/README.md +1 -1
  2. package/README.template.md +1 -1
  3. package/dist/authentication/authenticate.d.ts +5 -6
  4. package/dist/authentication/authenticate.fixture.d.ts +9 -9
  5. package/dist/authentication/authenticate.fixture.js +8 -8
  6. package/dist/authentication/authenticate.fixture.js.map +1 -1
  7. package/dist/authentication/authenticate.js +4 -5
  8. package/dist/authentication/authenticate.js.map +1 -1
  9. package/dist/connection/connection.d.ts +3 -3
  10. package/dist/connection/connection.fixture.d.ts +2 -2
  11. package/dist/connection/connection.fixture.js +2 -2
  12. package/dist/connection/connection.fixture.js.map +1 -1
  13. package/dist/connection/connection.js +2 -2
  14. package/dist/connection/connection.js.map +1 -1
  15. package/dist/effect.js +2 -2
  16. package/dist/effect.js.map +1 -1
  17. package/dist/email/email.d.ts +1 -1
  18. package/dist/email/email.fixture.d.ts +4 -4
  19. package/dist/email/email.fixture.js +3 -3
  20. package/dist/email/email.fixture.js.map +1 -1
  21. package/dist/email/email.js +2 -2
  22. package/dist/email/email.js.map +1 -1
  23. package/dist/index.d.ts +4 -4
  24. package/dist/registration/register.d.ts +5 -7
  25. package/dist/registration/register.fixture.d.ts +8 -8
  26. package/dist/registration/register.fixture.js +6 -6
  27. package/dist/registration/register.fixture.js.map +1 -1
  28. package/dist/registration/register.js +5 -6
  29. package/dist/registration/register.js.map +1 -1
  30. package/dist/rpc/client.js +1 -1
  31. package/dist/rpc/client.js.map +1 -1
  32. package/dist/rpc/connection.d.ts +1 -1
  33. package/dist/rpc/connection.js +3 -2
  34. package/dist/rpc/connection.js.map +1 -1
  35. package/dist/rpc/{authentication.d.ts → passkey/authentication.d.ts} +4 -4
  36. package/dist/rpc/passkey/authentication.js +17 -0
  37. package/dist/rpc/passkey/authentication.js.map +1 -0
  38. package/dist/rpc/{registration.d.ts → passkey/registration.d.ts} +3 -3
  39. package/dist/rpc/passkey/registration.js +17 -0
  40. package/dist/rpc/passkey/registration.js.map +1 -0
  41. package/dist/rpc/social.d.ts +1 -1
  42. package/dist/rpc/social.js +6 -5
  43. package/dist/rpc/social.js.map +1 -1
  44. package/dist/rpc/user.d.ts +1 -1
  45. package/dist/rpc/user.js +5 -4
  46. package/dist/rpc/user.js.map +1 -1
  47. package/dist/social/social.d.ts +7 -8
  48. package/dist/social/social.fixture.d.ts +5 -5
  49. package/dist/social/social.fixture.js +7 -7
  50. package/dist/social/social.fixture.js.map +1 -1
  51. package/dist/social/social.js +7 -8
  52. package/dist/social/social.js.map +1 -1
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/dist/user/user.d.ts +3 -3
  55. package/dist/user/user.fixture.d.ts +6 -6
  56. package/dist/user/user.fixture.js +6 -6
  57. package/dist/user/user.fixture.js.map +1 -1
  58. package/dist/user/user.js +5 -6
  59. package/dist/user/user.js.map +1 -1
  60. package/dist/version.d.ts +1 -1
  61. package/dist/version.js +1 -1
  62. package/package.json +2 -2
  63. package/src/authentication/authenticate.fixture.ts +11 -11
  64. package/src/authentication/authenticate.test.ts +1 -1
  65. package/src/authentication/authenticate.ts +10 -16
  66. package/src/connection/connection.fixture.ts +2 -2
  67. package/src/connection/connection.ts +3 -3
  68. package/src/effect.ts +2 -2
  69. package/src/email/email.fixture.ts +3 -3
  70. package/src/email/email.ts +2 -2
  71. package/src/registration/register.fixture.ts +11 -11
  72. package/src/registration/register.test.ts +1 -1
  73. package/src/registration/register.ts +11 -13
  74. package/src/rpc/client.ts +1 -1
  75. package/src/rpc/connection.ts +4 -2
  76. package/src/rpc/{authentication.ts → passkey/authentication.ts} +22 -13
  77. package/src/rpc/passkey/registration.ts +52 -0
  78. package/src/rpc/social.ts +24 -14
  79. package/src/rpc/user.ts +23 -12
  80. package/src/social/social.fixture.ts +7 -8
  81. package/src/social/social.test.ts +8 -8
  82. package/src/social/social.ts +13 -16
  83. package/src/user/user.fixture.ts +10 -10
  84. package/src/user/user.ts +7 -9
  85. package/dist/rpc/authentication.js +0 -16
  86. package/dist/rpc/authentication.js.map +0 -1
  87. package/dist/rpc/registration.js +0 -16
  88. package/dist/rpc/registration.js.map +0 -1
  89. package/src/rpc/registration.ts +0 -41
package/src/rpc/user.ts CHANGED
@@ -2,18 +2,18 @@ import * as S from '@effect/schema/Schema'
2
2
  import { Context, Effect as E, Layer } from 'effect'
3
3
 
4
4
  import {
5
- IsExistingUserReq,
6
- IsExistingUserRes,
5
+ IsExistingUserRequest,
6
+ IsExistingUserResponse,
7
7
  RESEND_EMAIL_ENDPOINT,
8
8
  ResendEmailErrors,
9
- ResendEmailReq,
10
- ResendEmailRes,
9
+ ResendEmailRequest,
10
+ ResendEmailResponse,
11
11
  USER_STATUS_ENDPOINT,
12
12
  type UserService,
13
13
  VERIFY_EMAIL_ENDPOINT,
14
14
  VerifyEmailErrors,
15
- VerifyEmailReq,
16
- VerifyEmailRes,
15
+ VerifyEmailRequest,
16
+ VerifyEmailResponse,
17
17
  } from '@passlock/shared/dist/rpc/user.js'
18
18
 
19
19
  import { Dispatcher, makePostRequest } from './client.js'
@@ -28,22 +28,22 @@ export const UserClientLive = Layer.effect(
28
28
  const dispatcher = yield* _(Dispatcher)
29
29
 
30
30
  const isExistingUserResolver = makePostRequest(
31
- IsExistingUserReq,
32
- IsExistingUserRes,
31
+ IsExistingUserRequest,
32
+ IsExistingUserResponse,
33
33
  S.Never,
34
34
  dispatcher,
35
35
  )
36
36
 
37
37
  const verifyEmailResolver = makePostRequest(
38
- VerifyEmailReq,
39
- VerifyEmailRes,
38
+ VerifyEmailRequest,
39
+ VerifyEmailResponse,
40
40
  VerifyEmailErrors,
41
41
  dispatcher,
42
42
  )
43
43
 
44
44
  const resendEmailResolver = makePostRequest(
45
- ResendEmailReq,
46
- ResendEmailRes,
45
+ ResendEmailRequest,
46
+ ResendEmailResponse,
47
47
  ResendEmailErrors,
48
48
  dispatcher,
49
49
  )
@@ -55,3 +55,14 @@ export const UserClientLive = Layer.effect(
55
55
  }
56
56
  }),
57
57
  )
58
+
59
+ export {
60
+ IsExistingUserRequest,
61
+ IsExistingUserResponse,
62
+ ResendEmailErrors,
63
+ ResendEmailRequest,
64
+ ResendEmailResponse,
65
+ VerifyEmailErrors,
66
+ VerifyEmailRequest,
67
+ VerifyEmailResponse,
68
+ } from '@passlock/shared/dist/rpc/user.js'
@@ -1,10 +1,9 @@
1
1
  import { Effect as E, Layer as L, Option as O } from 'effect'
2
2
 
3
- import * as Shared from '@passlock/shared/dist/rpc/social.js'
4
-
5
3
  import * as Fixtures from '../test/fixtures.js'
6
4
  import { SocialClient } from '../rpc/social.js'
7
5
  import type { AuthenticateOidcReq } from './social.js'
6
+ import { OIDCAuthenticationRequest, OIDCRegistrationRequest, PrincipalResponse } from '@passlock/shared/dist/rpc/social.js'
8
7
 
9
8
  export const session = 'session'
10
9
  export const token = 'token'
@@ -12,7 +11,7 @@ export const code = 'code'
12
11
  export const authType = 'passkey'
13
12
  export const expireAt = Date.now() + 10000
14
13
 
15
- export const registerOidcReq = new Shared.RegisterOidcReq({
14
+ export const registerOidcReq = new OIDCRegistrationRequest({
16
15
  provider: 'google',
17
16
  idToken: 'google-token',
18
17
  nonce: 'nonce',
@@ -20,21 +19,21 @@ export const registerOidcReq = new Shared.RegisterOidcReq({
20
19
  familyName: O.some('doe'),
21
20
  })
22
21
 
23
- export const authOidcReq: AuthenticateOidcReq = new Shared.AuthOidcReq({
22
+ export const authOidcReq: AuthenticateOidcReq = new OIDCAuthenticationRequest({
24
23
  provider: 'google',
25
24
  idToken: 'google-token',
26
25
  nonce: 'nonce',
27
26
  })
28
27
 
29
- export const rpcRegisterRes = new Shared.PrincipalRes({ principal: Fixtures.principal })
28
+ export const rpcRegisterRes = new PrincipalResponse({ principal: Fixtures.principal })
30
29
 
31
- export const rpcAuthenticateRes = new Shared.PrincipalRes({ principal: Fixtures.principal })
30
+ export const rpcAuthenticateRes = new PrincipalResponse({ principal: Fixtures.principal })
32
31
 
33
32
  export const rpcClientTest = L.succeed(
34
33
  SocialClient,
35
34
  SocialClient.of({
36
- registerOidc: () => E.fail(Fixtures.notImplemented),
37
- authenticateOidc: () => E.fail(Fixtures.notImplemented),
35
+ oidcRegistration: () => E.fail(Fixtures.notImplemented),
36
+ oidcAuthentication: () => E.fail(Fixtures.notImplemented),
38
37
  }),
39
38
  )
40
39
 
@@ -21,7 +21,7 @@ describe('registerOidc should', () => {
21
21
  E.sync(() => {
22
22
  const rpcMock = mock<SocialClient['Type']>()
23
23
 
24
- rpcMock.registerOidc.mockReturnValue(E.succeed(Fixture.rpcRegisterRes))
24
+ rpcMock.oidcRegistration.mockReturnValue(E.succeed(Fixture.rpcRegisterRes))
25
25
 
26
26
  return rpcMock
27
27
  }),
@@ -41,7 +41,7 @@ describe('registerOidc should', () => {
41
41
  yield* _(service.registerOidc(Fixture.registerOidcReq))
42
42
 
43
43
  const rpcClient = yield* _(SocialClient)
44
- expect(rpcClient.registerOidc).toHaveBeenCalledWith(Fixture.registerOidcReq)
44
+ expect(rpcClient.oidcRegistration).toHaveBeenCalledWith(Fixture.registerOidcReq)
45
45
  })
46
46
 
47
47
  const rpcClientTest = L.effect(
@@ -49,7 +49,7 @@ describe('registerOidc should', () => {
49
49
  E.sync(() => {
50
50
  const rpcMock = mock<SocialClient['Type']>()
51
51
 
52
- rpcMock.registerOidc.mockReturnValue(E.succeed(Fixture.rpcRegisterRes))
52
+ rpcMock.oidcRegistration.mockReturnValue(E.succeed(Fixture.rpcRegisterRes))
53
53
 
54
54
  return rpcMock
55
55
  }),
@@ -77,7 +77,7 @@ describe('registerOidc should', () => {
77
77
  E.sync(() => {
78
78
  const rpcMock = mock<SocialClient['Type']>()
79
79
 
80
- rpcMock.registerOidc.mockReturnValue(E.fail(new Duplicate({ message: 'Duplicate user' })))
80
+ rpcMock.oidcRegistration.mockReturnValue(E.fail(new Duplicate({ message: 'Duplicate user' })))
81
81
 
82
82
  return rpcMock
83
83
  }),
@@ -105,7 +105,7 @@ describe('authenticateIodc should', () => {
105
105
  E.sync(() => {
106
106
  const rpcMock = mock<SocialClient['Type']>()
107
107
 
108
- rpcMock.authenticateOidc.mockReturnValue(E.succeed(Fixture.rpcRegisterRes))
108
+ rpcMock.oidcAuthentication.mockReturnValue(E.succeed(Fixture.rpcRegisterRes))
109
109
 
110
110
  return rpcMock
111
111
  }),
@@ -125,7 +125,7 @@ describe('authenticateIodc should', () => {
125
125
  yield* _(service.authenticateOidc(Fixture.authOidcReq))
126
126
 
127
127
  const rpcClient = yield* _(SocialClient)
128
- expect(rpcClient.authenticateOidc).toHaveBeenCalledWith(Fixture.authOidcReq)
128
+ expect(rpcClient.oidcAuthentication).toHaveBeenCalledWith(Fixture.authOidcReq)
129
129
  })
130
130
 
131
131
  const rpcClientTest = L.effect(
@@ -133,7 +133,7 @@ describe('authenticateIodc should', () => {
133
133
  E.sync(() => {
134
134
  const rpcMock = mock<SocialClient['Type']>()
135
135
 
136
- rpcMock.authenticateOidc.mockReturnValue(E.succeed(Fixture.rpcAuthenticateRes))
136
+ rpcMock.oidcAuthentication.mockReturnValue(E.succeed(Fixture.rpcAuthenticateRes))
137
137
 
138
138
  return rpcMock
139
139
  }),
@@ -161,7 +161,7 @@ describe('authenticateIodc should', () => {
161
161
  E.sync(() => {
162
162
  const rpcMock = mock<SocialClient['Type']>()
163
163
 
164
- rpcMock.authenticateOidc.mockReturnValue(
164
+ rpcMock.oidcAuthentication.mockReturnValue(
165
165
  E.fail(new NotFound({ message: 'User not found' })),
166
166
  )
167
167
 
@@ -2,26 +2,23 @@
2
2
  * Passkey authentication effects
3
3
  */
4
4
  import { Context, Effect as E, Layer, flow } from 'effect'
5
-
6
- import * as RPC from '@passlock/shared/dist/rpc/social.js'
5
+ import * as RPC from '../rpc/social.js'
7
6
  import { type BadRequest, type NotSupported } from '@passlock/shared/dist/error/error.js'
8
7
  import type { Principal } from '@passlock/shared/dist/schema/principal.js'
9
8
 
10
- import { SocialClient } from '../rpc/social.js'
11
-
12
9
  /* Requests */
13
10
 
14
11
  export type Provider = 'apple' | 'google'
15
12
 
16
- export type RegisterOidcReq = RPC.RegisterOidcReq
13
+ export type RegisterOidcReq = RPC.OIDCRegistrationRequest
17
14
 
18
- export type AuthenticateOidcReq = RPC.AuthOidcReq
15
+ export type AuthenticateOidcReq = RPC.OIDCAuthenticationRequest
19
16
 
20
17
  /* Errors */
21
18
 
22
- export type RegistrationErrors = NotSupported | BadRequest | RPC.RegisterOidcErrors
19
+ export type RegistrationErrors = NotSupported | BadRequest | RPC.OIDCRegistrationErrors
23
20
 
24
- export type AuthenticationErrors = NotSupported | BadRequest | RPC.AuthOidcErrors
21
+ export type AuthenticationErrors = NotSupported | BadRequest | RPC.OIDCAuthenticationErrors
25
22
 
26
23
  /* Service */
27
24
 
@@ -35,7 +32,7 @@ export class SocialService extends Context.Tag('@services/SocialService')<
35
32
 
36
33
  /* Effects */
37
34
 
38
- type Dependencies = SocialClient
35
+ type Dependencies = RPC.SocialClient
39
36
 
40
37
  export const registerOidc = (
41
38
  request: RegisterOidcReq,
@@ -43,9 +40,9 @@ export const registerOidc = (
43
40
  return E.gen(function* (_) {
44
41
  yield* _(E.logInfo('Registering social account'))
45
42
 
46
- const rpcClient = yield* _(SocialClient)
47
- const rpcRequest = new RPC.RegisterOidcReq(request)
48
- const { principal } = yield* _(rpcClient.registerOidc(rpcRequest))
43
+ const rpcClient = yield* _(RPC.SocialClient)
44
+ const rpcRequest = new RPC.OIDCRegistrationRequest(request)
45
+ const { principal } = yield* _(rpcClient.oidcRegistration(rpcRequest))
49
46
 
50
47
  return principal
51
48
  })
@@ -57,9 +54,9 @@ export const authenticateOidc = (
57
54
  return E.gen(function* (_) {
58
55
  yield* _(E.logInfo('Authenticating with social account'))
59
56
 
60
- const rpcClient = yield* _(SocialClient)
61
- const rpcRequest = new RPC.AuthOidcReq(request)
62
- const { principal } = yield* _(rpcClient.authenticateOidc(rpcRequest))
57
+ const rpcClient = yield* _(RPC.SocialClient)
58
+ const rpcRequest = new RPC.OIDCAuthenticationRequest(request)
59
+ const { principal } = yield* _(rpcClient.oidcAuthentication(rpcRequest))
63
60
 
64
61
  return principal
65
62
  })
@@ -71,7 +68,7 @@ export const authenticateOidc = (
71
68
  export const SocialServiceLive = Layer.effect(
72
69
  SocialService,
73
70
  E.gen(function* (_) {
74
- const context = yield* _(E.context<SocialClient>())
71
+ const context = yield* _(E.context<RPC.SocialClient>())
75
72
 
76
73
  return SocialService.of({
77
74
  registerOidc: flow(registerOidc, E.provide(context)),
@@ -1,11 +1,11 @@
1
1
  import { Effect as E, Layer as L, Option as O } from 'effect'
2
2
 
3
3
  import {
4
- IsExistingUserReq,
5
- IsExistingUserRes,
6
- ResendEmailReq,
7
- ResendEmailRes,
8
- VerifyEmailRes,
4
+ IsExistingUserRequest,
5
+ IsExistingUserResponse,
6
+ ResendEmailRequest,
7
+ ResendEmailResponse,
8
+ VerifyEmailResponse,
9
9
  } from '@passlock/shared/dist/rpc/user.js'
10
10
 
11
11
  import * as Fixtures from '../test/fixtures.js'
@@ -13,15 +13,15 @@ import { UserClient } from '../rpc/user.js'
13
13
  import type { ResendEmail } from './user.js'
14
14
 
15
15
  export const email = 'jdoe@gmail.com'
16
- export const isRegisteredReq = new IsExistingUserReq({ email })
17
- export const isRegisteredRes = new IsExistingUserRes({ existingUser: false, detail: O.none() })
18
- export const verifyEmailRes = new VerifyEmailRes({ principal: Fixtures.principal })
16
+ export const isRegisteredReq = new IsExistingUserRequest({ email })
17
+ export const isRegisteredRes = new IsExistingUserResponse({ existingUser: false, detail: O.none() })
18
+ export const verifyEmailRes = new VerifyEmailResponse({ principal: Fixtures.principal })
19
19
  export const resendEmailReq: ResendEmail = { userId: '123', method: 'code' }
20
- export const rpcResendEmailReq = new ResendEmailReq({
20
+ export const rpcResendEmailReq = new ResendEmailRequest({
21
21
  userId: '123',
22
22
  verifyEmail: { method: 'code' },
23
23
  })
24
- export const rpcResendEmailRes = new ResendEmailRes({})
24
+ export const rpcResendEmailRes = new ResendEmailResponse({})
25
25
 
26
26
  export const rpcClientTest = L.succeed(
27
27
  UserClient,
package/src/user/user.ts CHANGED
@@ -4,10 +4,8 @@
4
4
  import { Context, Effect as E, Layer, flow } from 'effect'
5
5
 
6
6
  import type { BadRequest, Disabled, NotFound } from '@passlock/shared/dist/error/error.js'
7
- import { IsExistingUserReq, ResendEmailReq } from '@passlock/shared/dist/rpc/user.js'
8
7
  import type { VerifyEmail } from '@passlock/shared/dist/schema/email.js'
9
-
10
- import { UserClient } from '../rpc/user.js'
8
+ import * as RPC from '../rpc/user.js'
11
9
 
12
10
  /* Requests */
13
11
 
@@ -30,15 +28,15 @@ export class UserService extends Context.Tag('@services/UserService')<
30
28
 
31
29
  /* Effects */
32
30
 
33
- type Dependencies = UserClient
31
+ type Dependencies = RPC.UserClient
34
32
 
35
33
  export const isExistingUser = (request: Email): E.Effect<boolean, BadRequest, Dependencies> => {
36
34
  return E.gen(function* (_) {
37
35
  yield* _(E.logInfo('Checking registration status'))
38
- const rpcClient = yield* _(UserClient)
36
+ const rpcClient = yield* _(RPC.UserClient)
39
37
 
40
38
  yield* _(E.logDebug('Making RPC request'))
41
- const { existingUser } = yield* _(rpcClient.isExistingUser(new IsExistingUserReq(request)))
39
+ const { existingUser } = yield* _(rpcClient.isExistingUser(new RPC.IsExistingUserRequest(request)))
42
40
 
43
41
  return existingUser
44
42
  })
@@ -49,11 +47,11 @@ export const resendVerificationEmail = (
49
47
  ): E.Effect<void, ResendEmailErrors, Dependencies> => {
50
48
  return E.gen(function* (_) {
51
49
  yield* _(E.logInfo('Resending verification email'))
52
- const rpcClient = yield* _(UserClient)
50
+ const rpcClient = yield* _(RPC.UserClient)
53
51
 
54
52
  yield* _(E.logDebug('Making RPC request'))
55
53
  const { userId, ...verifyEmail } = request
56
- yield* _(rpcClient.resendVerificationEmail(new ResendEmailReq({ userId, verifyEmail })))
54
+ yield* _(rpcClient.resendVerificationEmail(new RPC.ResendEmailRequest({ userId, verifyEmail })))
57
55
  })
58
56
  }
59
57
 
@@ -63,7 +61,7 @@ export const resendVerificationEmail = (
63
61
  export const UserServiceLive = Layer.effect(
64
62
  UserService,
65
63
  E.gen(function* (_) {
66
- const context = yield* _(E.context<UserClient>())
64
+ const context = yield* _(E.context<RPC.UserClient>())
67
65
  return UserService.of({
68
66
  isExistingUser: flow(isExistingUser, E.provide(context)),
69
67
  resendVerificationEmail: flow(resendVerificationEmail, E.provide(context)),
@@ -1,16 +0,0 @@
1
- import { Context, Effect as E, Layer } from 'effect';
2
- import { OPTIONS_ENDPOINT, OptionsErrors, OptionsReq, OptionsRes, VERIFY_ENDPOINT, VerificationErrors, VerificationReq, VerificationRes, } from '@passlock/shared/dist/rpc/authentication.js';
3
- import { Dispatcher, makePostRequest } from './client.js';
4
- /* Client */
5
- export class AuthenticationClient extends Context.Tag('@passkey/auth/client')() {
6
- }
7
- export const AuthenticationClientLive = Layer.effect(AuthenticationClient, E.gen(function* (_) {
8
- const dispatcher = yield* _(Dispatcher);
9
- const optionsResolver = makePostRequest(OptionsReq, OptionsRes, OptionsErrors, dispatcher);
10
- const verifyResolver = makePostRequest(VerificationReq, VerificationRes, VerificationErrors, dispatcher);
11
- return {
12
- getAuthenticationOptions: req => optionsResolver(OPTIONS_ENDPOINT, req),
13
- verifyAuthenticationCredential: req => verifyResolver(VERIFY_ENDPOINT, req),
14
- };
15
- }));
16
- //# sourceMappingURL=authentication.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authentication.js","sourceRoot":"","sources":["../../src/rpc/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAEpD,OAAO,EAEL,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,eAAe,GAChB,MAAM,6CAA6C,CAAA;AAEpD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAEzD,YAAY;AAEZ,MAAM,OAAO,oBAAqB,SAAQ,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAG1E;CAAG;AAEN,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC,MAAM,CAClD,oBAAoB,EACpB,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;IAChB,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IAEvC,MAAM,eAAe,GAAG,eAAe,CAAC,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,CAAC,CAAA;IAE1F,MAAM,cAAc,GAAG,eAAe,CACpC,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,UAAU,CACX,CAAA;IAED,OAAO;QACL,wBAAwB,EAAE,GAAG,CAAC,EAAE,CAAC,eAAe,CAAC,gBAAgB,EAAE,GAAG,CAAC;QACvE,8BAA8B,EAAE,GAAG,CAAC,EAAE,CAAC,cAAc,CAAC,eAAe,EAAE,GAAG,CAAC;KAC5E,CAAA;AACH,CAAC,CAAC,CACH,CAAA"}
@@ -1,16 +0,0 @@
1
- import { Context, Effect as E, Layer } from 'effect';
2
- import { OptionsErrors, OptionsReq, OptionsRes, VerificationErrors, VerificationReq, VerificationRes, } from '@passlock/shared/dist/rpc/registration.js';
3
- import { Dispatcher, makePostRequest } from './client.js';
4
- /* Client */
5
- export class RegistrationClient extends Context.Tag('@passkey/register/client')() {
6
- }
7
- export const RegistrationClientLive = Layer.effect(RegistrationClient, E.gen(function* (_) {
8
- const dispatcher = yield* _(Dispatcher);
9
- const optionsResolver = makePostRequest(OptionsReq, OptionsRes, OptionsErrors, dispatcher);
10
- const verifyResolver = makePostRequest(VerificationReq, VerificationRes, VerificationErrors, dispatcher);
11
- return {
12
- getRegistrationOptions: req => optionsResolver('/passkey/register/options', req),
13
- verifyRegistrationCredential: req => verifyResolver('/passkey/register/verify', req),
14
- };
15
- }));
16
- //# sourceMappingURL=registration.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registration.js","sourceRoot":"","sources":["../../src/rpc/registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAEpD,OAAO,EACL,aAAa,EACb,UAAU,EACV,UAAU,EAEV,kBAAkB,EAClB,eAAe,EACf,eAAe,GAChB,MAAM,2CAA2C,CAAA;AAElD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAEzD,YAAY;AAEZ,MAAM,OAAO,kBAAmB,SAAQ,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,EAG5E;CAAG;AAEN,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,CAAC,MAAM,CAChD,kBAAkB,EAClB,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;IAChB,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IAEvC,MAAM,eAAe,GAAG,eAAe,CAAC,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,CAAC,CAAA;IAE1F,MAAM,cAAc,GAAG,eAAe,CACpC,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,UAAU,CACX,CAAA;IAED,OAAO;QACL,sBAAsB,EAAE,GAAG,CAAC,EAAE,CAAC,eAAe,CAAC,2BAA2B,EAAE,GAAG,CAAC;QAChF,4BAA4B,EAAE,GAAG,CAAC,EAAE,CAAC,cAAc,CAAC,0BAA0B,EAAE,GAAG,CAAC;KACrF,CAAA;AACH,CAAC,CAAC,CACH,CAAA"}
@@ -1,41 +0,0 @@
1
- import { Context, Effect as E, Layer } from 'effect'
2
-
3
- import {
4
- OptionsErrors,
5
- OptionsReq,
6
- OptionsRes,
7
- type RegistrationService,
8
- VerificationErrors,
9
- VerificationReq,
10
- VerificationRes,
11
- } from '@passlock/shared/dist/rpc/registration.js'
12
-
13
- import { Dispatcher, makePostRequest } from './client.js'
14
-
15
- /* Client */
16
-
17
- export class RegistrationClient extends Context.Tag('@passkey/register/client')<
18
- RegistrationClient,
19
- RegistrationService
20
- >() {}
21
-
22
- export const RegistrationClientLive = Layer.effect(
23
- RegistrationClient,
24
- E.gen(function* (_) {
25
- const dispatcher = yield* _(Dispatcher)
26
-
27
- const optionsResolver = makePostRequest(OptionsReq, OptionsRes, OptionsErrors, dispatcher)
28
-
29
- const verifyResolver = makePostRequest(
30
- VerificationReq,
31
- VerificationRes,
32
- VerificationErrors,
33
- dispatcher,
34
- )
35
-
36
- return {
37
- getRegistrationOptions: req => optionsResolver('/passkey/register/options', req),
38
- verifyRegistrationCredential: req => verifyResolver('/passkey/register/verify', req),
39
- }
40
- }),
41
- )