@passlock/client 2.0.1 → 2.0.3

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 (95) hide show
  1. package/README.md +2 -2
  2. package/README.template.md +2 -2
  3. package/dist/index.d.ts +235 -31
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +237 -36
  6. package/dist/index.js.map +1 -1
  7. package/dist/internal/index.d.ts +4 -0
  8. package/dist/internal/index.d.ts.map +1 -0
  9. package/dist/internal/index.js +4 -0
  10. package/dist/internal/index.js.map +1 -0
  11. package/dist/{shared → internal}/network.d.ts +19 -16
  12. package/dist/internal/network.d.ts.map +1 -0
  13. package/dist/{shared → internal}/network.js +41 -24
  14. package/dist/internal/network.js.map +1 -0
  15. package/dist/{shared → internal}/promise.d.ts +2 -2
  16. package/dist/internal/promise.d.ts.map +1 -0
  17. package/dist/{shared → internal}/promise.js +2 -2
  18. package/dist/internal/promise.js.map +1 -0
  19. package/dist/internal/tenancy.d.ts.map +1 -0
  20. package/dist/internal/tenancy.js.map +1 -0
  21. package/dist/{logger/index.d.ts → logger.d.ts} +19 -4
  22. package/dist/logger.d.ts.map +1 -0
  23. package/dist/{logger/index.js → logger.js} +23 -8
  24. package/dist/logger.js.map +1 -0
  25. package/dist/{shared/options.d.ts → options.d.ts} +4 -0
  26. package/dist/options.d.ts.map +1 -0
  27. package/dist/{shared/options.js.map → options.js.map} +1 -1
  28. package/dist/passkey/authentication/authentication.d.ts +145 -0
  29. package/dist/passkey/authentication/authentication.d.ts.map +1 -0
  30. package/dist/passkey/{authentication.js → authentication/authentication.js} +70 -52
  31. package/dist/passkey/authentication/authentication.js.map +1 -0
  32. package/dist/passkey/errors.d.ts +150 -15
  33. package/dist/passkey/errors.d.ts.map +1 -1
  34. package/dist/passkey/errors.js +209 -8
  35. package/dist/passkey/errors.js.map +1 -1
  36. package/dist/passkey/registration/registration.d.ts +149 -0
  37. package/dist/passkey/registration/registration.d.ts.map +1 -0
  38. package/dist/passkey/{registration.js → registration/registration.js} +46 -36
  39. package/dist/passkey/registration/registration.js.map +1 -0
  40. package/dist/passkey/shared.d.ts +10 -2
  41. package/dist/passkey/shared.d.ts.map +1 -1
  42. package/dist/passkey/signals/signals.d.ts +160 -0
  43. package/dist/passkey/signals/signals.d.ts.map +1 -0
  44. package/dist/passkey/{signals.js → signals/signals.js} +123 -84
  45. package/dist/passkey/signals/signals.js.map +1 -0
  46. package/dist/passkey/support.d.ts +15 -0
  47. package/dist/passkey/support.d.ts.map +1 -1
  48. package/dist/passkey/support.js +16 -1
  49. package/dist/passkey/support.js.map +1 -1
  50. package/dist/principal.d.ts +19 -0
  51. package/dist/principal.d.ts.map +1 -0
  52. package/dist/principal.js +2 -0
  53. package/dist/principal.js.map +1 -0
  54. package/dist/safe.d.ts +267 -0
  55. package/dist/safe.d.ts.map +1 -0
  56. package/dist/safe.js +275 -0
  57. package/dist/safe.js.map +1 -0
  58. package/package.json +22 -20
  59. package/dist/logger/index.d.ts.map +0 -1
  60. package/dist/logger/index.js.map +0 -1
  61. package/dist/passkey/authentication.d.ts +0 -118
  62. package/dist/passkey/authentication.d.ts.map +0 -1
  63. package/dist/passkey/authentication.js.map +0 -1
  64. package/dist/passkey/authentication.test.d.ts +0 -2
  65. package/dist/passkey/authentication.test.d.ts.map +0 -1
  66. package/dist/passkey/authentication.test.js +0 -157
  67. package/dist/passkey/authentication.test.js.map +0 -1
  68. package/dist/passkey/registration.d.ts +0 -136
  69. package/dist/passkey/registration.d.ts.map +0 -1
  70. package/dist/passkey/registration.js.map +0 -1
  71. package/dist/passkey/registration.test.d.ts +0 -2
  72. package/dist/passkey/registration.test.d.ts.map +0 -1
  73. package/dist/passkey/registration.test.js +0 -161
  74. package/dist/passkey/registration.test.js.map +0 -1
  75. package/dist/passkey/signals.d.ts +0 -113
  76. package/dist/passkey/signals.d.ts.map +0 -1
  77. package/dist/passkey/signals.js.map +0 -1
  78. package/dist/shared/network.d.ts.map +0 -1
  79. package/dist/shared/network.js.map +0 -1
  80. package/dist/shared/options.d.ts.map +0 -1
  81. package/dist/shared/promise.d.ts.map +0 -1
  82. package/dist/shared/promise.js.map +0 -1
  83. package/dist/shared/tenancy.d.ts.map +0 -1
  84. package/dist/shared/tenancy.js.map +0 -1
  85. package/dist/surface.test.d.ts +0 -2
  86. package/dist/surface.test.d.ts.map +0 -1
  87. package/dist/surface.test.js +0 -38
  88. package/dist/surface.test.js.map +0 -1
  89. package/dist/unsafe.d.ts +0 -41
  90. package/dist/unsafe.d.ts.map +0 -1
  91. package/dist/unsafe.js +0 -52
  92. package/dist/unsafe.js.map +0 -1
  93. /package/dist/{shared → internal}/tenancy.d.ts +0 -0
  94. /package/dist/{shared → internal}/tenancy.js +0 -0
  95. /package/dist/{shared/options.js → options.js} +0 -0
package/dist/safe.d.ts ADDED
@@ -0,0 +1,267 @@
1
+ /**
2
+ * _safe_ functions i.e. functions that return discriminated unions composed of either a
3
+ * success result or an error result for expected outcomes. Use one of the type guards to
4
+ * narrow the result to a given success or error type.
5
+ *
6
+ * Note: unexpected runtime failures may still throw.
7
+ *
8
+ * @categoryDescription Passkeys (core)
9
+ * Creating, authenticating, updating and deleting passkeys. {@link registerPasskey}
10
+ * and {@link authenticatePasskey} are the key functions.
11
+ *
12
+ * @categoryDescription Passkeys (other)
13
+ * Testing for browser capabilities related to passkeys, type guards and other utilities.
14
+ *
15
+ * @categoryDescription Passkeys (errors)
16
+ * Errors that could be returned by a function.
17
+ *
18
+ * @showCategories
19
+ * @module safe
20
+ */
21
+ import { Logger } from "./logger";
22
+ import type { AuthenticationError, AuthenticationOptions, AuthenticationSuccess } from "./passkey/authentication/authentication";
23
+ import type { DeleteError, OrphanedPasskeyError, PruningError, UpdateError } from "./passkey/errors";
24
+ import type { RegistrationError, RegistrationOptions, RegistrationSuccess } from "./passkey/registration/registration";
25
+ import type { DeleteCredentialOptions, DeletePasskeyOptions, DeleteSuccess, PrunePasskeyOptions, PruningSuccess, UpdateCredentialOptions, UpdatePasskeyOptions, UpdateSuccess } from "./passkey/signals/signals";
26
+ /**
27
+ * Registers a passkey on the user's device, then saves the server-side component in your vault.
28
+ * If successful, this function returns both a `code` and an `id_token` (JWT).
29
+ * Send either value to your backend for verification. See
30
+ * [register a passkey](https://passlock.dev/passkeys/registration/) in the documentation.
31
+ *
32
+ * @param options
33
+ *
34
+ * @returns Use {@link isRegistrationSuccess} to test for a successful result, {@link RegistrationError} is
35
+ * an alias to a union of potential errors. Use one of the appropriate isXXX type guards to narrow
36
+ * the error.
37
+ *
38
+ * Alternatively test the result's `_tag` property, which acts as a union discriminator.
39
+ *
40
+ * @see {@link isRegistrationSuccess}
41
+ * @see {@link isPasskeyUnsupportedError}
42
+ * @see {@link isDuplicatePasskeyError}
43
+ * @see {@link isOtherPasskeyError}
44
+ *
45
+ * @example
46
+ * // from your Passlock console settings
47
+ * const tenancyId = "myTenancyId";
48
+ * const username = "jdoe@gmail.com";
49
+ *
50
+ * const result = await registerPasskey({ tenancyId, username });
51
+ *
52
+ * if (isRegistrationSuccess(result)) {
53
+ * // send this to your backend for verification
54
+ * console.log(result.code);
55
+ * } else if (isPasskeyUnsupportedError(result)) {
56
+ * // ^^ using an error type guard
57
+ * console.log("Device does not support passkeys");
58
+ * } else if (result._tag === "@error/OtherPasskey") {
59
+ * // ^^ narrowing the result using the _tag
60
+ * console.log(result.message);
61
+ * } else {
62
+ * ...
63
+ * }
64
+ *
65
+ * @category Passkeys (core)
66
+ */
67
+ export declare const registerPasskey: (options: RegistrationOptions,
68
+ /** @hidden */
69
+ logger?: typeof Logger.Service) => Promise<RegistrationSuccess | RegistrationError>;
70
+ /**
71
+ * Asks the client to present a passkey, which is then verified against the server-side component in your vault.
72
+ * If successful, this function returns both a `code` and an `id_token` (JWT).
73
+ * Send either value to your backend for verification. See
74
+ * [authenticate a passkey](https://passlock.dev/passkeys/authentication/) in the documentation.
75
+ *
76
+ * @param options
77
+ *
78
+ * @returns Use {@link isAuthenticationSuccess} to test for a successful result, {@link AuthenticationError} is
79
+ * an alias to a union of potential errors. Use one of the appropriate isXXX type guards to narrow
80
+ * the error.
81
+ *
82
+ * Alternatively test the result's `_tag` property, which acts as a union discriminator.
83
+ *
84
+ * @see {@link isAuthenticationSuccess}
85
+ * @see {@link isPasskeyUnsupportedError}
86
+ * @see {@link isOrphanedPasskeyError}
87
+ * @see {@link isOtherPasskeyError}
88
+ *
89
+ * @example
90
+ * // from your Passlock console settings
91
+ * const tenancyId = "myTenancyId";
92
+ *
93
+ * const result = await authenticatePasskey({ tenancyId });
94
+ *
95
+ * if (isAuthenticationSuccess(result)) {
96
+ * // send this to your backend for verification
97
+ * console.log(result.code);
98
+ * } else if (isPasskeyUnsupportedError(result)) {
99
+ * // ^^ using an error type guard
100
+ * console.log("Device does not support passkeys");
101
+ * } else if (result._tag === "@error/OtherPasskey") {
102
+ * // ^^ narrowing the result using the _tag
103
+ * console.log(result.message);
104
+ * }
105
+ *
106
+ * @category Passkeys (core)
107
+ */
108
+ export declare const authenticatePasskey: (options: AuthenticationOptions,
109
+ /** @hidden */
110
+ logger?: typeof Logger.Service) => Promise<AuthenticationSuccess | AuthenticationError>;
111
+ /**
112
+ * Attempt to update the username or display name for a passkey (client-side only).
113
+ *
114
+ * Useful if the user has changed their account identifier. For example, they register
115
+ * using jdoe@gmail.com but later change their account username to jdoe@yahoo.com.
116
+ * Even after you update their account details in your backend, their local password
117
+ * manager will continue to display jdoe@gmail.com.
118
+ *
119
+ * By calling this function and supplying a new username/display name, their local
120
+ * password manager will align with their updated account identifier.
121
+ *
122
+ * @param options You will typically supply a target `passkeyId` via {@link UpdatePasskeyOptions}. {@link UpdateCredentialOptions} is for advanced use cases.
123
+ * @returns Use {@link isUpdateSuccess} and {@link isUpdateError} to test the update status.
124
+ *
125
+ * Alternatively, examine the result's `_tag` property, which acts as a discriminator.
126
+ *
127
+ * @see {@link isUpdateSuccess}
128
+ * @see {@link isUpdateError}
129
+ *
130
+ * @example
131
+ * // from your Passlock console settings
132
+ * const tenancyId = "myTenancyId";
133
+ * const passkeyId = "myPasskeyId";
134
+ * const username = "newUsername@gmail.com";
135
+ * const displayName = "New Account Name";
136
+ *
137
+ * const result = await updatePasskey({ tenancyId, passkeyId, username, displayName });
138
+ *
139
+ * if (result._tag === "UpdateSuccess") {
140
+ * // ^^ narrowing the result using the _tag
141
+ * console.log("passkey updated locally");
142
+ * } else if (isUpdateError(result)) {
143
+ * // narrowed to an UpdateError type
144
+ * console.log(result.code);
145
+ * } else {
146
+ * console.log("unable to update passkey");
147
+ * }
148
+ *
149
+ * @category Passkeys (core)
150
+ */
151
+ export declare const updatePasskey: (options: UpdatePasskeyOptions | UpdateCredentialOptions,
152
+ /** @hidden */
153
+ logger?: typeof Logger.Service) => Promise<UpdateSuccess | UpdateError>;
154
+ /**
155
+ * Attempts to delete a passkey from a local device. There are two scenarios in which this function is useful:
156
+ *
157
+ * 1. **Deleting a passkey** - Use the `@passlock/node` package or make vanilla REST calls from your
158
+ * backend to delete the server-side component, then use this function to delete the client-side component.
159
+ *
160
+ * 2. **Missing passkey** - When a user presented a passkey but the server-side component could not be found.
161
+ * Remove the passkey from the local device to prevent it happening again.
162
+ *
163
+ * See [deleting passkeys](https://passlock.dev/passkeys/passkey-removal/) and
164
+ * [handling missing passkeys](https://passlock.dev/handling-missing-passkeys/) in the documentation.
165
+ *
166
+ * @param options You will typically pass {@link DeletePasskeyOptions}, the other types are for advanced use cases/optimizations.
167
+ * @returns Use {@link isDeleteSuccess} to test for a successful deletion, or {@link isDeleteError} to test for an error.
168
+ * Alternatively, test the result's `_tag` property, which acts as a discriminator.
169
+ * @see {@link isDeleteSuccess}
170
+ * @see {@link isDeleteError}
171
+ *
172
+ * @example
173
+ * // from your Passlock console settings
174
+ * const tenancyId = "myTenancyId";
175
+ * const passkeyId = "myPasskeyId";
176
+ *
177
+ * const result = await deletePasskey({ tenancyId, passkeyId });
178
+ *
179
+ * if (result._tag === "DeleteSuccess") {
180
+ * // ^^ narrowing the result using the _tag
181
+ * console.log("passkey deleted locally");
182
+ * } else if (isDeleteError(result)) {
183
+ * // narrowed to a DeleteError type
184
+ * console.log(result.code);
185
+ * } else {
186
+ * console.log("unable to delete passkey");
187
+ * }
188
+ *
189
+ * @category Passkeys (core)
190
+ */
191
+ export declare const deletePasskey: (options: DeletePasskeyOptions | DeleteCredentialOptions | OrphanedPasskeyError,
192
+ /** @hidden */
193
+ logger?: typeof Logger.Service) => Promise<DeleteSuccess | DeleteError>;
194
+ /**
195
+ * Attempt to prune local passkeys by keeping only the passkey IDs you trust.
196
+ *
197
+ * This is useful when your backend is the source of truth for which passkeys
198
+ * should still exist for a given account on this device.
199
+ *
200
+ * @param options Pass the passkeys you **want to retain**.
201
+ * @returns Use {@link isPruningSuccess} and {@link isPruningError} to narrow the result.
202
+ * Alternatively test the result's `_tag` property, which acts as a discriminator.
203
+ *
204
+ * @see {@link isPruningSuccess}
205
+ * @see {@link isPruningError}
206
+ *
207
+ * @example
208
+ * // from your Passlock console settings
209
+ * const tenancyId = "myTenancyId";
210
+ * const allowablePasskeyIds = ["passkey-1", "passkey-2"];
211
+ *
212
+ * const result = await prunePasskeys({ tenancyId, allowablePasskeyIds });
213
+ *
214
+ * if (result._tag === "PruningSuccess") {
215
+ * // ^^ narrowing the result using the _tag
216
+ * console.log("local passkeys pruned");
217
+ * } else if (isPruningError(result)) {
218
+ * // narrowed to a PruningError type
219
+ * console.log(result.code);
220
+ * } else {
221
+ * console.log("unable to prune passkeys");
222
+ * }
223
+ *
224
+ * @category Passkeys (core)
225
+ */
226
+ export declare const prunePasskeys: (options: PrunePasskeyOptions,
227
+ /** @hidden */
228
+ logger?: typeof Logger.Service) => Promise<PruningSuccess | PruningError>;
229
+ /**
230
+ * Does the local device support programmatic passkey deletion
231
+ *
232
+ * @returns `true` if local passkey deletion is supported.
233
+ *
234
+ * @category Passkeys (other)
235
+ */
236
+ export declare const isPasskeyDeleteSupport: () => boolean;
237
+ /**
238
+ * Does the local device support programmatic passkey pruning
239
+ *
240
+ * @returns `true` if local passkey pruning is supported.
241
+ *
242
+ * @category Passkeys (other)
243
+ */
244
+ export declare const isPasskeyPruningSupport: () => boolean;
245
+ /**
246
+ * Does the local device support programmatic passkey updates
247
+ *
248
+ * @returns `true` if local passkey updates are supported.
249
+ *
250
+ * @category Passkeys (other)
251
+ */
252
+ export declare const isPasskeyUpdateSupport: () => boolean;
253
+ export { isNetworkError, NetworkError } from "./internal/network";
254
+ export { LogEvent, Logger, LogLevel, } from "./logger";
255
+ export type { PasslockOptions } from "./options";
256
+ export type { AuthenticationError, AuthenticationEvent, AuthenticationEvents, AuthenticationOptions, AuthenticationSuccess, OnAuthenticationEvent, } from "./passkey/authentication/authentication";
257
+ export { AuthenticationHelper, isAuthenticationSuccess, } from "./passkey/authentication/authentication";
258
+ export type { ErrorCode } from "./passkey/errors";
259
+ export { DeleteError, DuplicatePasskeyError, isDeleteError, isDuplicatePasskeyError, isOrphanedPasskeyError, isOtherPasskeyError, isPasskeyUnsupportedError, isPruningError, isUpdateError, OrphanedPasskeyError, OtherPasskeyError, PasskeyUnsupportedError, PruningError, UpdateError, } from "./passkey/errors";
260
+ export type { OnRegistrationEvent, RegistrationError, RegistrationEvent, RegistrationOptions, RegistrationSuccess, } from "./passkey/registration/registration";
261
+ export { isRegistrationSuccess, RegistrationHelper, } from "./passkey/registration/registration";
262
+ export type { UserVerification } from "./passkey/shared";
263
+ export type { CredentialMapping, DeleteCredentialOptions, DeletePasskeyOptions, DeleteSuccess, PrunePasskeyOptions, PruningSuccess, UpdateCredentialOptions, UpdatePasskeyOptions, UpdateSuccess, } from "./passkey/signals/signals";
264
+ export { isDeleteSuccess, isPruningSuccess, isUpdateSuccess, } from "./passkey/signals/signals";
265
+ export { isAutofillSupport, isPasskeySupport, } from "./passkey/support";
266
+ export type { Principal } from "./principal";
267
+ //# sourceMappingURL=safe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../src/safe.ts"],"names":[],"m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AAqC,CAAA;AAC5C,OAAO,EACL,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,qCAAqC,CAAA;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AACxD,YAAY,EACV,iBAAiB,EACjB,uBAAuB,EACvB,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,oBAAoB,EACpB,aAAa,GACd,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA;AAC1B,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA"}
package/dist/safe.js ADDED
@@ -0,0 +1,275 @@
1
+ /**
2
+ * _safe_ functions i.e. functions that return discriminated unions composed of either a
3
+ * success result or an error result for expected outcomes. Use one of the type guards to
4
+ * narrow the result to a given success or error type.
5
+ *
6
+ * Note: unexpected runtime failures may still throw.
7
+ *
8
+ * @categoryDescription Passkeys (core)
9
+ * Creating, authenticating, updating and deleting passkeys. {@link registerPasskey}
10
+ * and {@link authenticatePasskey} are the key functions.
11
+ *
12
+ * @categoryDescription Passkeys (other)
13
+ * Testing for browser capabilities related to passkeys, type guards and other utilities.
14
+ *
15
+ * @categoryDescription Passkeys (errors)
16
+ * Errors that could be returned by a function.
17
+ *
18
+ * @showCategories
19
+ * @module safe
20
+ */
21
+ import { Micro, pipe } from "effect";
22
+ import { runToPromise } from "./internal";
23
+ import { eventLogger, Logger } from "./logger";
24
+ import { AuthenticationHelper, authenticatePasskey as authenticatePasskeyM, } from "./passkey/authentication/authentication";
25
+ import { RegistrationHelper, registerPasskey as registerPasskeyM, } from "./passkey/registration/registration";
26
+ import { deletePasskey as deletePasskeyM, isDeleteSuccess, isPasskeyDeleteSupport as isPasskeyDeleteSupportM, isPasskeyPruningSupport as isPasskeyPruningSupportM, isPasskeyUpdateSupport as isPasskeyUpdateSupportM, isPruningSuccess, isUpdateSuccess, prunePasskeys as prunePasskeysM, updatePasskey as updatePasskeyM, } from "./passkey/signals/signals";
27
+ /* Registration */
28
+ /**
29
+ * Registers a passkey on the user's device, then saves the server-side component in your vault.
30
+ * If successful, this function returns both a `code` and an `id_token` (JWT).
31
+ * Send either value to your backend for verification. See
32
+ * [register a passkey](https://passlock.dev/passkeys/registration/) in the documentation.
33
+ *
34
+ * @param options
35
+ *
36
+ * @returns Use {@link isRegistrationSuccess} to test for a successful result, {@link RegistrationError} is
37
+ * an alias to a union of potential errors. Use one of the appropriate isXXX type guards to narrow
38
+ * the error.
39
+ *
40
+ * Alternatively test the result's `_tag` property, which acts as a union discriminator.
41
+ *
42
+ * @see {@link isRegistrationSuccess}
43
+ * @see {@link isPasskeyUnsupportedError}
44
+ * @see {@link isDuplicatePasskeyError}
45
+ * @see {@link isOtherPasskeyError}
46
+ *
47
+ * @example
48
+ * // from your Passlock console settings
49
+ * const tenancyId = "myTenancyId";
50
+ * const username = "jdoe@gmail.com";
51
+ *
52
+ * const result = await registerPasskey({ tenancyId, username });
53
+ *
54
+ * if (isRegistrationSuccess(result)) {
55
+ * // send this to your backend for verification
56
+ * console.log(result.code);
57
+ * } else if (isPasskeyUnsupportedError(result)) {
58
+ * // ^^ using an error type guard
59
+ * console.log("Device does not support passkeys");
60
+ * } else if (result._tag === "@error/OtherPasskey") {
61
+ * // ^^ narrowing the result using the _tag
62
+ * console.log(result.message);
63
+ * } else {
64
+ * ...
65
+ * }
66
+ *
67
+ * @category Passkeys (core)
68
+ */
69
+ export const registerPasskey = async (options,
70
+ /** @hidden */
71
+ logger = eventLogger) => pipe(registerPasskeyM(options), Micro.provideService(RegistrationHelper, RegistrationHelper.Default), Micro.provideService(Logger, logger), runToPromise);
72
+ /* Authentication */
73
+ /**
74
+ * Asks the client to present a passkey, which is then verified against the server-side component in your vault.
75
+ * If successful, this function returns both a `code` and an `id_token` (JWT).
76
+ * Send either value to your backend for verification. See
77
+ * [authenticate a passkey](https://passlock.dev/passkeys/authentication/) in the documentation.
78
+ *
79
+ * @param options
80
+ *
81
+ * @returns Use {@link isAuthenticationSuccess} to test for a successful result, {@link AuthenticationError} is
82
+ * an alias to a union of potential errors. Use one of the appropriate isXXX type guards to narrow
83
+ * the error.
84
+ *
85
+ * Alternatively test the result's `_tag` property, which acts as a union discriminator.
86
+ *
87
+ * @see {@link isAuthenticationSuccess}
88
+ * @see {@link isPasskeyUnsupportedError}
89
+ * @see {@link isOrphanedPasskeyError}
90
+ * @see {@link isOtherPasskeyError}
91
+ *
92
+ * @example
93
+ * // from your Passlock console settings
94
+ * const tenancyId = "myTenancyId";
95
+ *
96
+ * const result = await authenticatePasskey({ tenancyId });
97
+ *
98
+ * if (isAuthenticationSuccess(result)) {
99
+ * // send this to your backend for verification
100
+ * console.log(result.code);
101
+ * } else if (isPasskeyUnsupportedError(result)) {
102
+ * // ^^ using an error type guard
103
+ * console.log("Device does not support passkeys");
104
+ * } else if (result._tag === "@error/OtherPasskey") {
105
+ * // ^^ narrowing the result using the _tag
106
+ * console.log(result.message);
107
+ * }
108
+ *
109
+ * @category Passkeys (core)
110
+ */
111
+ export const authenticatePasskey = (options,
112
+ /** @hidden */
113
+ logger = eventLogger) => pipe(authenticatePasskeyM(options), Micro.provideService(AuthenticationHelper, AuthenticationHelper.Default), Micro.provideService(Logger, logger), runToPromise);
114
+ /* Signals */
115
+ /**
116
+ * Attempt to update the username or display name for a passkey (client-side only).
117
+ *
118
+ * Useful if the user has changed their account identifier. For example, they register
119
+ * using jdoe@gmail.com but later change their account username to jdoe@yahoo.com.
120
+ * Even after you update their account details in your backend, their local password
121
+ * manager will continue to display jdoe@gmail.com.
122
+ *
123
+ * By calling this function and supplying a new username/display name, their local
124
+ * password manager will align with their updated account identifier.
125
+ *
126
+ * @param options You will typically supply a target `passkeyId` via {@link UpdatePasskeyOptions}. {@link UpdateCredentialOptions} is for advanced use cases.
127
+ * @returns Use {@link isUpdateSuccess} and {@link isUpdateError} to test the update status.
128
+ *
129
+ * Alternatively, examine the result's `_tag` property, which acts as a discriminator.
130
+ *
131
+ * @see {@link isUpdateSuccess}
132
+ * @see {@link isUpdateError}
133
+ *
134
+ * @example
135
+ * // from your Passlock console settings
136
+ * const tenancyId = "myTenancyId";
137
+ * const passkeyId = "myPasskeyId";
138
+ * const username = "newUsername@gmail.com";
139
+ * const displayName = "New Account Name";
140
+ *
141
+ * const result = await updatePasskey({ tenancyId, passkeyId, username, displayName });
142
+ *
143
+ * if (result._tag === "UpdateSuccess") {
144
+ * // ^^ narrowing the result using the _tag
145
+ * console.log("passkey updated locally");
146
+ * } else if (isUpdateError(result)) {
147
+ * // narrowed to an UpdateError type
148
+ * console.log(result.code);
149
+ * } else {
150
+ * console.log("unable to update passkey");
151
+ * }
152
+ *
153
+ * @category Passkeys (core)
154
+ */
155
+ export const updatePasskey = (options,
156
+ /** @hidden */
157
+ logger = eventLogger) => {
158
+ const micro = updatePasskeyM(options);
159
+ return pipe(micro, Micro.provideService(Logger, logger), runToPromise);
160
+ };
161
+ /**
162
+ * Attempts to delete a passkey from a local device. There are two scenarios in which this function is useful:
163
+ *
164
+ * 1. **Deleting a passkey** - Use the `@passlock/node` package or make vanilla REST calls from your
165
+ * backend to delete the server-side component, then use this function to delete the client-side component.
166
+ *
167
+ * 2. **Missing passkey** - When a user presented a passkey but the server-side component could not be found.
168
+ * Remove the passkey from the local device to prevent it happening again.
169
+ *
170
+ * See [deleting passkeys](https://passlock.dev/passkeys/passkey-removal/) and
171
+ * [handling missing passkeys](https://passlock.dev/handling-missing-passkeys/) in the documentation.
172
+ *
173
+ * @param options You will typically pass {@link DeletePasskeyOptions}, the other types are for advanced use cases/optimizations.
174
+ * @returns Use {@link isDeleteSuccess} to test for a successful deletion, or {@link isDeleteError} to test for an error.
175
+ * Alternatively, test the result's `_tag` property, which acts as a discriminator.
176
+ * @see {@link isDeleteSuccess}
177
+ * @see {@link isDeleteError}
178
+ *
179
+ * @example
180
+ * // from your Passlock console settings
181
+ * const tenancyId = "myTenancyId";
182
+ * const passkeyId = "myPasskeyId";
183
+ *
184
+ * const result = await deletePasskey({ tenancyId, passkeyId });
185
+ *
186
+ * if (result._tag === "DeleteSuccess") {
187
+ * // ^^ narrowing the result using the _tag
188
+ * console.log("passkey deleted locally");
189
+ * } else if (isDeleteError(result)) {
190
+ * // narrowed to a DeleteError type
191
+ * console.log(result.code);
192
+ * } else {
193
+ * console.log("unable to delete passkey");
194
+ * }
195
+ *
196
+ * @category Passkeys (core)
197
+ */
198
+ export const deletePasskey = (options,
199
+ /** @hidden */
200
+ logger = eventLogger) => {
201
+ const micro = deletePasskeyM(options);
202
+ return pipe(micro, Micro.provideService(Logger, logger), runToPromise);
203
+ };
204
+ /**
205
+ * Attempt to prune local passkeys by keeping only the passkey IDs you trust.
206
+ *
207
+ * This is useful when your backend is the source of truth for which passkeys
208
+ * should still exist for a given account on this device.
209
+ *
210
+ * @param options Pass the passkeys you **want to retain**.
211
+ * @returns Use {@link isPruningSuccess} and {@link isPruningError} to narrow the result.
212
+ * Alternatively test the result's `_tag` property, which acts as a discriminator.
213
+ *
214
+ * @see {@link isPruningSuccess}
215
+ * @see {@link isPruningError}
216
+ *
217
+ * @example
218
+ * // from your Passlock console settings
219
+ * const tenancyId = "myTenancyId";
220
+ * const allowablePasskeyIds = ["passkey-1", "passkey-2"];
221
+ *
222
+ * const result = await prunePasskeys({ tenancyId, allowablePasskeyIds });
223
+ *
224
+ * if (result._tag === "PruningSuccess") {
225
+ * // ^^ narrowing the result using the _tag
226
+ * console.log("local passkeys pruned");
227
+ * } else if (isPruningError(result)) {
228
+ * // narrowed to a PruningError type
229
+ * console.log(result.code);
230
+ * } else {
231
+ * console.log("unable to prune passkeys");
232
+ * }
233
+ *
234
+ * @category Passkeys (core)
235
+ */
236
+ export const prunePasskeys = (options,
237
+ /** @hidden */
238
+ logger = eventLogger) => {
239
+ const micro = prunePasskeysM(options);
240
+ return pipe(micro, Micro.provideService(Logger, logger), runToPromise);
241
+ };
242
+ /* Support */
243
+ /**
244
+ * Does the local device support programmatic passkey deletion
245
+ *
246
+ * @returns `true` if local passkey deletion is supported.
247
+ *
248
+ * @category Passkeys (other)
249
+ */
250
+ export const isPasskeyDeleteSupport = () => pipe(isPasskeyDeleteSupportM, Micro.runSync);
251
+ /**
252
+ * Does the local device support programmatic passkey pruning
253
+ *
254
+ * @returns `true` if local passkey pruning is supported.
255
+ *
256
+ * @category Passkeys (other)
257
+ */
258
+ export const isPasskeyPruningSupport = () => pipe(isPasskeyPruningSupportM, Micro.runSync);
259
+ /**
260
+ * Does the local device support programmatic passkey updates
261
+ *
262
+ * @returns `true` if local passkey updates are supported.
263
+ *
264
+ * @category Passkeys (other)
265
+ */
266
+ export const isPasskeyUpdateSupport = () => pipe(isPasskeyUpdateSupportM, Micro.runSync);
267
+ /* Re-exports */
268
+ export { isNetworkError, NetworkError } from "./internal/network";
269
+ export { LogEvent, Logger, LogLevel, } from "./logger";
270
+ export { AuthenticationHelper, isAuthenticationSuccess, } from "./passkey/authentication/authentication";
271
+ export { DeleteError, DuplicatePasskeyError, isDeleteError, isDuplicatePasskeyError, isOrphanedPasskeyError, isOtherPasskeyError, isPasskeyUnsupportedError, isPruningError, isUpdateError, OrphanedPasskeyError, OtherPasskeyError, PasskeyUnsupportedError, PruningError, UpdateError, } from "./passkey/errors";
272
+ export { isRegistrationSuccess, RegistrationHelper, } from "./passkey/registration/registration";
273
+ export { isDeleteSuccess, isPruningSuccess, isUpdateSuccess, } from "./passkey/signals/signals";
274
+ export { isAutofillSupport, isPasskeySupport, } from "./passkey/support";
275
+ //# sourceMappingURL=safe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe.js","sourceRoot":"","sources":["../src/safe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,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AA;AAE/C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE,CACzC,IAAI,CAAC,uBAAuB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;AAE9C,gBAAgB;AAEhB,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,GACT,MAAM,UAAU,CAAA;AAUjB,OAAO,EACL,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,aAAa,EACb,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,EACd,aAAa,EACb,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,EACvB,YAAY,EACZ,WAAW,GACZ,MAAM,kBAAkB,CAAA;AAQzB,OAAO,EACL,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,qCAAqC,CAAA;AAa5C,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,eAAe,GAChB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@passlock/client",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "Flexible passkey authentication for Astro, SvelteKit, NextJS and other frameworks",
5
5
  "keywords": [
6
6
  "passkey",
@@ -35,10 +35,10 @@
35
35
  "import": "./dist/index.js",
36
36
  "default": "./dist/index.js"
37
37
  },
38
- "./unsafe": {
39
- "types": "./dist/unsafe.d.ts",
40
- "import": "./dist/unsafe.js",
41
- "default": "./dist/unsafe.js"
38
+ "./safe": {
39
+ "types": "./dist/safe.d.ts",
40
+ "import": "./dist/safe.js",
41
+ "default": "./dist/safe.js"
42
42
  }
43
43
  },
44
44
  "module": "./dist/index.js",
@@ -48,37 +48,39 @@
48
48
  ],
49
49
  "dependencies": {
50
50
  "@simplewebauthn/browser": "^13.2.2",
51
- "effect": "3.19.15"
51
+ "effect": "3.19.19"
52
52
  },
53
53
  "devDependencies": {
54
- "@biomejs/biome": "^2.3.13",
55
- "@effect/language-service": "^0.72.0",
54
+ "@biomejs/biome": "^2.4.4",
55
+ "@effect/language-service": "^0.77.0",
56
56
  "@fetch-mock/vitest": "^0.2.18",
57
- "@typescript/lib-dom": "npm:@types/web@^0.0.323",
58
- "globals": "^17.2.0",
59
- "npm-check-updates": "^19.3.2",
60
- "publint": "0.3.17",
61
- "rimraf": "^6.1.2",
57
+ "@typescript/lib-dom": "npm:@types/web@^0.0.339",
58
+ "globals": "^17.4.0",
59
+ "npm-check-updates": "^19.6.3",
60
+ "publint": "0.3.18",
61
+ "rimraf": "^6.1.3",
62
62
  "tsx": "4.21.0",
63
+ "typedoc": "^0.28.17",
63
64
  "typescript": "^5.9.3",
64
65
  "vitest": "^4.0.16"
65
66
  },
66
67
  "peerDependencies": {
67
- "effect": "3.19.15"
68
+ "effect": "3.19.19"
68
69
  },
69
70
  "scripts": {
70
- "build": "tsc --build",
71
+ "build": "tsc -p tsconfig.build.json",
71
72
  "build:clean": "$npm_execpath run clean:full && $npm_execpath run build",
72
73
  "build:production": "$npm_execpath run build:clean && $npm_execpath run build:readme && $npm_execpath run replaceTokens && echo '' && publint",
73
- "build:readme": "LATEST=${npm_package_version} tsx ../../scripts/replace-readme-tokens.ts ./packages/client",
74
- "clean": "tsc --build --clean",
75
- "clean:full": "rimraf dist tsconfig.tsbuildinfo",
76
- "replaceTokens": "LATEST=${npm_package_version} tsx ../../scripts/replace-tokens.ts ./packages/client",
74
+ "build:readme": "VERSION=${npm_package_version} tsx ../../scripts/replace-readme-tokens.ts ./packages/client",
75
+ "typedoc": "typedoc",
76
+ "clean": "tsc -p tsconfig.build.json --clean",
77
+ "clean:full": "rimraf dist tsconfig.build.tsbuildinfo",
78
+ "replaceTokens": "VERSION=${npm_package_version} tsx ../../scripts/replace-tokens.ts ./packages/client",
77
79
  "test:unit": "vitest --project unit run",
78
80
  "test:unit:watch": "vitest --project unit",
79
81
  "test:integration": "vitest --project integration run",
80
82
  "test:all": "vitest --project unit --project integration run",
81
- "typecheck": "tsc --noEmit",
83
+ "typecheck": "tsc -p tsconfig.test.json --noEmit",
82
84
  "lint": "biome check .",
83
85
  "lint:fix": "biome check --fix .",
84
86
  "lint:ci": "biome ci .",
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/logger/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;;uBAKhB,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;sBACvC,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;sBACtC,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;uBACrC,CAAC,OAAO,EAAE,MAAM,KAAK,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;;AAN7D,qBAAa,MAAO,SAAQ,WAQzB;CAAG;AAEN,eAAO,MAAM,aAAa,EAAE,OAAO,MAAM,CAAC,OAoBzC,CAAA;AAED,oBAAY,QAAQ;IAClB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,qBAAa,QAAS,SAAQ,KAAK;;IAIjC,MAAM,CAAC,IAAI,SAAqB;gBAEpB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ;IAM5C,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,KAAK,IAAI,QAAQ,CAEpB;CACF;AASD,eAAO,MAAM,WAAW,EAAE,OAAO,MAAM,CAAC,OAKvC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index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