@passlock/client 0.9.0 → 0.9.2

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 (98) hide show
  1. package/README.md +83 -11
  2. package/dist/authentication/authenticate.d.ts.map +1 -1
  3. package/dist/authentication/authenticate.fixture.d.ts +1 -1
  4. package/dist/authentication/authenticate.fixture.d.ts.map +1 -1
  5. package/dist/authentication/authenticate.fixture.js.map +1 -1
  6. package/dist/authentication/authenticate.js +1 -8
  7. package/dist/authentication/authenticate.js.map +1 -1
  8. package/dist/authentication/authenticate.test.js.map +1 -1
  9. package/dist/capabilities/capabilities.d.ts +0 -3
  10. package/dist/capabilities/capabilities.d.ts.map +1 -1
  11. package/dist/capabilities/capabilities.js +0 -7
  12. package/dist/capabilities/capabilities.js.map +1 -1
  13. package/dist/config.d.ts +0 -4
  14. package/dist/config.d.ts.map +1 -1
  15. package/dist/config.js.map +1 -1
  16. package/dist/connection/connection.d.ts +4 -3
  17. package/dist/connection/connection.d.ts.map +1 -1
  18. package/dist/connection/connection.fixture.d.ts.map +1 -1
  19. package/dist/connection/connection.fixture.js +2 -1
  20. package/dist/connection/connection.fixture.js.map +1 -1
  21. package/dist/connection/connection.js +2 -9
  22. package/dist/connection/connection.js.map +1 -1
  23. package/dist/connection/connection.test.js +9 -9
  24. package/dist/connection/connection.test.js.map +1 -1
  25. package/dist/effect.js +4 -5
  26. package/dist/effect.js.map +1 -1
  27. package/dist/email/email.d.ts +0 -13
  28. package/dist/email/email.d.ts.map +1 -1
  29. package/dist/email/email.fixture.d.ts +1 -1
  30. package/dist/email/email.fixture.d.ts.map +1 -1
  31. package/dist/email/email.fixture.js.map +1 -1
  32. package/dist/email/email.js +1 -31
  33. package/dist/email/email.js.map +1 -1
  34. package/dist/email/email.test.js +0 -2
  35. package/dist/email/email.test.js.map +1 -1
  36. package/dist/event/event.d.ts +0 -3
  37. package/dist/event/event.d.ts.map +1 -1
  38. package/dist/event/event.js +0 -3
  39. package/dist/event/event.js.map +1 -1
  40. package/dist/event/event.node.test.js +0 -1
  41. package/dist/event/event.node.test.js.map +1 -1
  42. package/dist/event/event.test.js.map +1 -1
  43. package/dist/index.d.ts +24 -21
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +19 -19
  46. package/dist/index.js.map +1 -1
  47. package/dist/logging/eventLogger.d.ts +0 -13
  48. package/dist/logging/eventLogger.d.ts.map +1 -1
  49. package/dist/logging/eventLogger.js +0 -13
  50. package/dist/logging/eventLogger.js.map +1 -1
  51. package/dist/logging/eventLogger.test.js +0 -7
  52. package/dist/logging/eventLogger.test.js.map +1 -1
  53. package/dist/registration/register.d.ts.map +1 -1
  54. package/dist/registration/register.fixture.d.ts +1 -1
  55. package/dist/registration/register.fixture.d.ts.map +1 -1
  56. package/dist/registration/register.fixture.js.map +1 -1
  57. package/dist/registration/register.js +1 -8
  58. package/dist/registration/register.js.map +1 -1
  59. package/dist/registration/register.test.js.map +1 -1
  60. package/dist/storage/storage.d.ts +0 -25
  61. package/dist/storage/storage.d.ts.map +1 -1
  62. package/dist/storage/storage.fixture.js +0 -1
  63. package/dist/storage/storage.fixture.js.map +1 -1
  64. package/dist/storage/storage.js +1 -31
  65. package/dist/storage/storage.js.map +1 -1
  66. package/dist/storage/storage.test.js +0 -2
  67. package/dist/storage/storage.test.js.map +1 -1
  68. package/dist/test/fixtures.d.ts.map +1 -1
  69. package/dist/test/fixtures.js.map +1 -1
  70. package/dist/user/user.d.ts +0 -3
  71. package/dist/user/user.d.ts.map +1 -1
  72. package/dist/user/user.fixture.d.ts.map +1 -1
  73. package/dist/user/user.fixture.js.map +1 -1
  74. package/dist/user/user.js +0 -3
  75. package/dist/user/user.js.map +1 -1
  76. package/dist/user/user.test.js.map +1 -1
  77. package/package.json +12 -18
  78. package/src/authentication/authenticate.fixture.ts +0 -1
  79. package/src/authentication/authenticate.test.ts +0 -1
  80. package/src/authentication/authenticate.ts +4 -8
  81. package/src/config.ts +0 -1
  82. package/src/connection/connection.fixture.ts +4 -5
  83. package/src/connection/connection.test.ts +14 -18
  84. package/src/connection/connection.ts +8 -10
  85. package/src/effect.ts +6 -6
  86. package/src/email/email.fixture.ts +0 -2
  87. package/src/email/email.test.ts +0 -1
  88. package/src/email/email.ts +1 -2
  89. package/src/event/event.test.ts +0 -1
  90. package/src/event/event.ts +0 -1
  91. package/src/index.ts +54 -42
  92. package/src/registration/register.fixture.ts +0 -1
  93. package/src/registration/register.test.ts +0 -1
  94. package/src/registration/register.ts +3 -8
  95. package/src/test/fixtures.ts +0 -1
  96. package/src/user/user.fixture.ts +0 -1
  97. package/src/user/user.test.ts +0 -1
  98. package/src/user/user.ts +0 -1
@@ -2,7 +2,8 @@
2
2
  * Hits the rpc endpoint to warm up a lambda
3
3
  */
4
4
  import { PreConnectReq } from '@passlock/shared/dist/rpc/connection'
5
- import { NetworkService, RpcClient, RpcConfig } from '@passlock/shared/dist/rpc/rpc'
5
+ import type { RpcConfig } from '@passlock/shared/dist/rpc/rpc';
6
+ import { Dispatcher, RpcClient } from '@passlock/shared/dist/rpc/rpc'
6
7
  import { Context, Effect as E, Layer, flow, pipe } from 'effect'
7
8
 
8
9
  /* Service */
@@ -17,23 +18,20 @@ export const ConnectionService = Context.GenericTag<ConnectionService>('@service
17
18
 
18
19
  const hitPrincipal = pipe(
19
20
  E.logInfo('Pre-connecting to Principal endpoint'),
20
- E.zipRight(NetworkService),
21
- E.flatMap(networkService => networkService.get('/token/token?warm=true')),
21
+ E.zipRight(Dispatcher),
22
+ E.flatMap(dispatcher => dispatcher.get('/token/token?warm=true')),
22
23
  E.asUnit,
23
- E.catchAll(() => E.unit)
24
+ E.catchAll(() => E.unit),
24
25
  )
25
26
 
26
27
  const hitRpc = pipe(
27
28
  E.logInfo('Pre-connecting to RPC endpoint'),
28
29
  E.zipRight(RpcClient),
29
30
  E.flatMap(rpcClient => rpcClient.preConnect(new PreConnectReq({}))),
30
- E.asUnit
31
+ E.asUnit,
31
32
  )
32
33
 
33
- export const preConnect = () => pipe(
34
- E.all([hitPrincipal, hitRpc], { concurrency: 2 }),
35
- E.asUnit
36
- )
34
+ export const preConnect = () => pipe(E.all([hitPrincipal, hitRpc], { concurrency: 2 }), E.asUnit)
37
35
 
38
36
  /* Live */
39
37
 
@@ -41,7 +39,7 @@ export const preConnect = () => pipe(
41
39
  export const ConnectionServiceLive = Layer.effect(
42
40
  ConnectionService,
43
41
  E.gen(function* (_) {
44
- const context = yield* _(E.context<RpcClient | NetworkService | RpcConfig>())
42
+ const context = yield* _(E.context<RpcClient | Dispatcher | RpcConfig>())
45
43
 
46
44
  return ConnectionService.of({
47
45
  preConnect: flow(preConnect, E.provide(context)),
package/src/effect.ts CHANGED
@@ -25,7 +25,7 @@ import {
25
25
  } from '@passlock/shared/dist/error/error'
26
26
 
27
27
  import {
28
- NetworkServiceLive,
28
+ DispatcherLive,
29
29
  RetrySchedule,
30
30
  RpcClientLive,
31
31
  RpcConfig,
@@ -110,9 +110,9 @@ const schedule = Schedule.intersect(Schedule.recurs(3), Schedule.exponential('10
110
110
 
111
111
  const retryScheduleLive = L.succeed(RetrySchedule, RetrySchedule.of({ schedule }))
112
112
 
113
- const networkServiceLive = pipe(NetworkServiceLive, L.provide(retryScheduleLive))
113
+ const dispatcherLive = pipe(DispatcherLive, L.provide(retryScheduleLive))
114
114
 
115
- const rpcClientLive = pipe(RpcClientLive, L.provide(networkServiceLive))
115
+ const rpcClientLive = pipe(RpcClientLive, L.provide(dispatcherLive))
116
116
 
117
117
  const storageServiceLive = StorageServiceLive
118
118
 
@@ -136,9 +136,9 @@ const authenticationServiceLive = pipe(
136
136
  )
137
137
 
138
138
  const connectionServiceLive = pipe(
139
- ConnectionServiceLive,
140
- L.provide(rpcClientLive),
141
- L.provide(networkServiceLive)
139
+ ConnectionServiceLive,
140
+ L.provide(rpcClientLive),
141
+ L.provide(dispatcherLive),
142
142
  )
143
143
 
144
144
  const locationSearchLive = Layer.succeed(
@@ -1,4 +1,3 @@
1
-
2
1
  import { BadRequest } from '@passlock/shared/dist/error/error'
3
2
  import { RpcClient } from '@passlock/shared/dist/rpc/rpc'
4
3
  import { VerifyEmailReq, VerifyEmailRes } from '@passlock/shared/dist/rpc/user'
@@ -7,7 +6,6 @@ import { LocationSearch } from './email'
7
6
  import { AuthenticationService } from '../authentication/authenticate'
8
7
  import * as Fixtures from '../test/fixtures'
9
8
 
10
-
11
9
  export const token = 'token'
12
10
  export const code = 'code'
13
11
  export const authType = 'passkey'
@@ -8,7 +8,6 @@ import * as Fixture from './email.fixture'
8
8
  import { AuthenticationService } from '../authentication/authenticate'
9
9
  import { StorageService } from '../storage/storage'
10
10
 
11
-
12
11
  describe('verifyEmailCode should', () => {
13
12
  test('return true when the verification is successful', async () => {
14
13
  const assertions = E.gen(function* (_) {
@@ -3,13 +3,12 @@
3
3
  */
4
4
  import { BadRequest } from '@passlock/shared/dist/error/error'
5
5
  import { RpcClient } from '@passlock/shared/dist/rpc/rpc'
6
- import type { VerifyEmailErrors as RpcErrors} from '@passlock/shared/dist/rpc/user';
6
+ import type { VerifyEmailErrors as RpcErrors } from '@passlock/shared/dist/rpc/user'
7
7
  import { VerifyEmailReq } from '@passlock/shared/dist/rpc/user'
8
8
  import { Context, Effect as E, Layer, Option as O, flow, identity, pipe } from 'effect'
9
9
  import { type AuthenticationErrors, AuthenticationService } from '../authentication/authenticate'
10
10
  import { StorageService } from '../storage/storage'
11
11
 
12
-
13
12
  /* Requests */
14
13
 
15
14
  export type VerifyRequest = {
@@ -2,7 +2,6 @@ import { Effect } from 'effect'
2
2
  import { afterEach, describe, expect, test, vi } from 'vitest'
3
3
  import { DebugMessage, fireEvent, isPasslockEvent } from './event'
4
4
 
5
-
6
5
  describe('fireEvent', () => {
7
6
  afterEach(() => {
8
7
  vi.restoreAllMocks()
@@ -4,7 +4,6 @@
4
4
  import { InternalBrowserError } from '@passlock/shared/dist/error/error'
5
5
  import { Effect } from 'effect'
6
6
 
7
-
8
7
  export const DebugMessage = 'PasslogDebugMessage'
9
8
 
10
9
  export const fireEvent = (message: string) => {
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ import type {
7
7
  NotSupported,
8
8
  Unauthorized,
9
9
  } from '@passlock/shared/dist/error/error'
10
+ import { ErrorCode } from '@passlock/shared/dist/error/error'
10
11
  import { RpcConfig } from '@passlock/shared/dist/rpc/rpc'
11
12
  import { Effect as E, Layer as L, Layer, Option, Runtime, Scope, pipe } from 'effect'
12
13
  import { type AuthenticationRequest, AuthenticationService } from './authentication/authenticate'
@@ -17,7 +18,7 @@ import { EmailService, type VerifyRequest } from './email/email'
17
18
  import { type RegistrationRequest, RegistrationService } from './registration/register'
18
19
  import { type AuthType, Storage, StorageService } from './storage/storage'
19
20
  import { type Email, UserService } from './user/user'
20
- import { ErrorCode } from '@passlock/shared/dist/error/error'
21
+
21
22
  export { ErrorCode } from '@passlock/shared/dist/error/error'
22
23
 
23
24
  export class PasslockError extends Error {
@@ -85,12 +86,16 @@ const transformErrors = <A, R>(
85
86
 
86
87
  Sequential: errors => {
87
88
  console.error(errors)
88
- return E.succeed(new PasslockError('Sorry, something went wrong', ErrorCode.InternalServerError))
89
+ return E.succeed(
90
+ new PasslockError('Sorry, something went wrong', ErrorCode.InternalServerError),
91
+ )
89
92
  },
90
93
 
91
94
  Parallel: errors => {
92
95
  console.error(errors)
93
- return E.succeed(new PasslockError('Sorry, something went wrong', ErrorCode.InternalServerError))
96
+ return E.succeed(
97
+ new PasslockError('Sorry, something went wrong', ErrorCode.InternalServerError),
98
+ )
94
99
  },
95
100
  })
96
101
 
@@ -106,10 +111,12 @@ type Requirements =
106
111
  | StorageService
107
112
  | Capabilities
108
113
 
109
- export class Passlock {
114
+ export type Options = { signal?: AbortSignal }
115
+
116
+ export class PasslockUnsafe {
110
117
  private readonly runtime: Runtime.Runtime<Requirements>
111
118
 
112
- constructor(config: { tenancyId: string; clientId: string; endpoint: string }) {
119
+ constructor(config: { tenancyId: string; clientId: string; endpoint?: string }) {
113
120
  const rpcConfig = Layer.succeed(RpcConfig, RpcConfig.of(config))
114
121
  const storage = Layer.succeed(Storage, Storage.of(globalThis.localStorage))
115
122
  const allLayers = pipe(allRequirements, L.provide(rpcConfig), L.provide(storage))
@@ -119,19 +126,20 @@ export class Passlock {
119
126
 
120
127
  private readonly runPromise = <A, R extends Requirements>(
121
128
  effect: E.Effect<A, PasslockErrors, R>,
129
+ options: Options | undefined = undefined
122
130
  ) => {
123
131
  return pipe(
124
132
  transformErrors(effect),
125
133
  E.flatMap(result => (PasslockError.isError(result) ? E.fail(result) : E.succeed(result))),
126
- effect => Runtime.runPromise(this.runtime)(effect),
134
+ effect => Runtime.runPromise(this.runtime)(effect, options),
127
135
  )
128
136
  }
129
137
 
130
- preConnect = () =>
138
+ preConnect = (options?: Options) =>
131
139
  pipe(
132
140
  ConnectionService,
133
141
  E.flatMap(service => service.preConnect()),
134
- effect => Runtime.runPromise(this.runtime)(effect),
142
+ effect => Runtime.runPromise(this.runtime)(effect, options),
135
143
  )
136
144
 
137
145
  isPasskeySupport = () =>
@@ -141,39 +149,39 @@ export class Passlock {
141
149
  effect => Runtime.runPromise(this.runtime)(effect),
142
150
  )
143
151
 
144
- isExistingPasskey = (email: Email) =>
152
+ isExistingPasskey = (email: Email, options?: Options) =>
145
153
  pipe(
146
154
  UserService,
147
155
  E.flatMap(service => service.isExistingUser(email)),
148
- effect => this.runPromise(effect),
156
+ effect => this.runPromise(effect, options),
149
157
  )
150
158
 
151
- registerPasskey = (request: RegistrationRequest) =>
159
+ registerPasskey = (request: RegistrationRequest, options?: Options) =>
152
160
  pipe(
153
161
  RegistrationService,
154
162
  E.flatMap(service => service.registerPasskey(request)),
155
- effect => this.runPromise(effect),
163
+ effect => this.runPromise(effect, options),
156
164
  )
157
165
 
158
- authenticatePasskey = (request: AuthenticationRequest) =>
166
+ authenticatePasskey = (request: AuthenticationRequest, options?: Options) =>
159
167
  pipe(
160
168
  AuthenticationService,
161
169
  E.flatMap(service => service.authenticatePasskey(request)),
162
- effect => this.runPromise(effect),
170
+ effect => this.runPromise(effect, options),
163
171
  )
164
172
 
165
- verifyEmailCode = (request: VerifyRequest) =>
173
+ verifyEmailCode = (request: VerifyRequest, options?: Options) =>
166
174
  pipe(
167
175
  EmailService,
168
176
  E.flatMap(service => service.verifyEmailCode(request)),
169
- effect => this.runPromise(effect),
177
+ effect => this.runPromise(effect, options),
170
178
  )
171
179
 
172
- verifyEmailLink = () =>
180
+ verifyEmailLink = (options?: Options) =>
173
181
  pipe(
174
182
  EmailService,
175
183
  E.flatMap(service => service.verifyEmailLink()),
176
- effect => this.runPromise(effect),
184
+ effect => this.runPromise(effect, options),
177
185
  )
178
186
 
179
187
  getSessionToken = (authType: AuthType) =>
@@ -181,21 +189,21 @@ export class Passlock {
181
189
  StorageService,
182
190
  E.flatMap(service => service.getToken(authType).pipe(effect => E.option(effect))),
183
191
  E.map(Option.getOrUndefined),
184
- effect => Runtime.runSync(this.runtime)(effect)
192
+ effect => Runtime.runSync(this.runtime)(effect),
185
193
  )
186
194
 
187
195
  clearExpiredTokens = () =>
188
196
  pipe(
189
197
  StorageService,
190
198
  E.flatMap(service => service.clearExpiredTokens),
191
- effect => Runtime.runPromise(this.runtime)(effect)
199
+ effect => Runtime.runPromise(this.runtime)(effect),
192
200
  )
193
201
  }
194
202
 
195
- export class PasslockSafe {
203
+ export class Passlock {
196
204
  private readonly runtime: Runtime.Runtime<Requirements>
197
205
 
198
- constructor(config: { tenancyId: string; clientId: string; endpoint: string }) {
206
+ constructor(config: { tenancyId: string; clientId: string; endpoint?: string }) {
199
207
  const rpcConfig = Layer.succeed(RpcConfig, RpcConfig.of(config))
200
208
  const storage = Layer.succeed(Storage, Storage.of(globalThis.localStorage))
201
209
  const allLayers = pipe(allRequirements, L.provide(rpcConfig), L.provide(storage))
@@ -205,10 +213,21 @@ export class PasslockSafe {
205
213
 
206
214
  private readonly runPromise = <A, R extends Requirements>(
207
215
  effect: E.Effect<A, PasslockErrors, R>,
216
+ options: Options | undefined = undefined
208
217
  ) => {
209
- return pipe(transformErrors(effect), effect => Runtime.runPromise(this.runtime)(effect))
218
+ return pipe(
219
+ transformErrors(effect),
220
+ effect => Runtime.runPromise(this.runtime)(effect, options)
221
+ )
210
222
  }
211
223
 
224
+ preConnect = (options?: Options) =>
225
+ pipe(
226
+ ConnectionService,
227
+ E.flatMap(service => service.preConnect()),
228
+ effect => this.runPromise(effect, options),
229
+ )
230
+
212
231
  isPasskeySupport = () =>
213
232
  pipe(
214
233
  Capabilities,
@@ -216,46 +235,39 @@ export class PasslockSafe {
216
235
  effect => Runtime.runPromise(this.runtime)(effect),
217
236
  )
218
237
 
219
- preConnect = () =>
220
- pipe(
221
- ConnectionService,
222
- E.flatMap(service => service.preConnect()),
223
- effect => this.runPromise(effect),
224
- )
225
-
226
- isExistingPasskey = (email: Email) =>
238
+ isExistingPasskey = (email: Email, options?: Options) =>
227
239
  pipe(
228
240
  UserService,
229
241
  E.flatMap(service => service.isExistingUser(email)),
230
- effect => this.runPromise(effect),
242
+ effect => this.runPromise(effect, options),
231
243
  )
232
244
 
233
- registerPasskey = (request: RegistrationRequest) =>
245
+ registerPasskey = (request: RegistrationRequest, options?: Options) =>
234
246
  pipe(
235
247
  RegistrationService,
236
248
  E.flatMap(service => service.registerPasskey(request)),
237
- effect => this.runPromise(effect),
249
+ effect => this.runPromise(effect, options),
238
250
  )
239
251
 
240
- authenticatePasskey = (request: AuthenticationRequest = {}) =>
252
+ authenticatePasskey = (request: AuthenticationRequest = {}, options?: Options) =>
241
253
  pipe(
242
254
  AuthenticationService,
243
255
  E.flatMap(service => service.authenticatePasskey(request)),
244
- effect => this.runPromise(effect),
256
+ effect => this.runPromise(effect, options),
245
257
  )
246
258
 
247
- verifyEmailCode = (request: VerifyRequest) =>
259
+ verifyEmailCode = (request: VerifyRequest, options?: Options) =>
248
260
  pipe(
249
261
  EmailService,
250
262
  E.flatMap(service => service.verifyEmailCode(request)),
251
- effect => this.runPromise(effect),
263
+ effect => this.runPromise(effect, options),
252
264
  )
253
265
 
254
- verifyEmailLink = () =>
266
+ verifyEmailLink = (options?: Options) =>
255
267
  pipe(
256
268
  EmailService,
257
269
  E.flatMap(service => service.verifyEmailLink()),
258
- effect => this.runPromise(effect),
270
+ effect => this.runPromise(effect, options),
259
271
  )
260
272
 
261
273
  getSessionToken = (authType: AuthType) =>
@@ -263,13 +275,13 @@ export class PasslockSafe {
263
275
  StorageService,
264
276
  E.flatMap(service => service.getToken(authType).pipe(effect => E.option(effect))),
265
277
  E.map(maybeToken => Option.getOrUndefined(maybeToken)),
266
- effect => Runtime.runSync(this.runtime)(effect)
278
+ effect => Runtime.runSync(this.runtime)(effect),
267
279
  )
268
280
 
269
281
  clearExpiredTokens = () =>
270
282
  pipe(
271
283
  StorageService,
272
284
  E.flatMap(service => service.clearExpiredTokens),
273
- effect => Runtime.runPromise(this.runtime)(effect)
285
+ effect => Runtime.runPromise(this.runtime)(effect),
274
286
  )
275
287
  }
@@ -12,7 +12,6 @@ import { CreateCredential, type RegistrationRequest } from './register'
12
12
  import * as Fixtures from '../test/fixtures'
13
13
  import { UserService } from '../user/user'
14
14
 
15
-
16
15
  export const session = 'session'
17
16
  export const token = 'token'
18
17
  export const code = 'code'
@@ -7,7 +7,6 @@ import { CreateCredential, RegistrationService, RegistrationServiceLive } from '
7
7
  import * as Fixture from './register.fixture'
8
8
  import { UserService } from '../user/user'
9
9
 
10
-
11
10
  describe('register should', () => {
12
11
  test('return a valid credential', async () => {
13
12
  const assertions = E.gen(function* (_) {
@@ -5,15 +5,10 @@ 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';
8
+ import type { NotSupported } from '@passlock/shared/dist/error/error'
9
9
  import { Duplicate, InternalBrowserError } from '@passlock/shared/dist/error/error'
10
- import type {
11
- OptionsErrors,
12
- VerificationErrors} from '@passlock/shared/dist/rpc/registration';
13
- import {
14
- OptionsReq,
15
- VerificationReq,
16
- } from '@passlock/shared/dist/rpc/registration'
10
+ import type { OptionsErrors, VerificationErrors } from '@passlock/shared/dist/rpc/registration'
11
+ import { OptionsReq, VerificationReq } from '@passlock/shared/dist/rpc/registration'
17
12
  import { RpcClient } from '@passlock/shared/dist/rpc/rpc'
18
13
  import type {
19
14
  Principal,
@@ -3,7 +3,6 @@ import { Effect as E, Layer as L } from 'effect'
3
3
  import { Capabilities } from '../capabilities/capabilities'
4
4
  import { StorageService, type StoredToken } from '../storage/storage'
5
5
 
6
-
7
6
  export const session = 'session'
8
7
  export const token = 'token'
9
8
  export const code = 'code'
@@ -3,7 +3,6 @@ import { RpcClient } from '@passlock/shared/dist/rpc/rpc'
3
3
  import { IsExistingUserReq, IsExistingUserRes } from '@passlock/shared/dist/rpc/user'
4
4
  import { Effect as E, Layer as L } from 'effect'
5
5
 
6
-
7
6
  export const email = 'jdoe@gmail.com'
8
7
 
9
8
  export const rpcClientTest = L.succeed(
@@ -5,7 +5,6 @@ import { mock } from 'vitest-mock-extended'
5
5
  import { UserService, UserServiceLive } from './user'
6
6
  import * as Fixture from './user.fixture'
7
7
 
8
-
9
8
  describe('isExistingUser should', () => {
10
9
  test('return true when the user already has a passkey', async () => {
11
10
  const assertions = E.gen(function* (_) {
package/src/user/user.ts CHANGED
@@ -6,7 +6,6 @@ import { RpcClient } from '@passlock/shared/dist/rpc/rpc'
6
6
  import { IsExistingUserReq } from '@passlock/shared/dist/rpc/user'
7
7
  import { Context, Effect as E, Layer, flow } from 'effect'
8
8
 
9
-
10
9
  /* Requests */
11
10
 
12
11
  export type Email = { email: string }