@passlock/node 2.0.2 → 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.
- package/dist/effect.d.ts +2 -2
- package/dist/effect.d.ts.map +1 -1
- package/dist/effect.js +1 -1
- package/dist/effect.js.map +1 -1
- package/dist/errors.d.ts +21 -21
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +16 -11
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +39 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +38 -14
- package/dist/index.js.map +1 -1
- package/dist/network.d.ts +134 -0
- package/dist/network.d.ts.map +1 -0
- package/dist/network.js +172 -0
- package/dist/network.js.map +1 -0
- package/dist/passkey/passkey.d.ts +33 -17
- package/dist/passkey/passkey.d.ts.map +1 -1
- package/dist/passkey/passkey.js +113 -66
- package/dist/passkey/passkey.js.map +1 -1
- package/dist/principal/principal.d.ts +7 -7
- package/dist/principal/principal.d.ts.map +1 -1
- package/dist/principal/principal.js +23 -22
- package/dist/principal/principal.js.map +1 -1
- package/dist/safe.d.ts +39 -21
- package/dist/safe.d.ts.map +1 -1
- package/dist/safe.js +30 -13
- package/dist/safe.js.map +1 -1
- package/dist/schemas/errors.d.ts +1 -24
- package/dist/schemas/errors.d.ts.map +1 -1
- package/dist/schemas/errors.js +28 -40
- package/dist/schemas/errors.js.map +1 -1
- package/dist/schemas/passkey.d.ts +33 -9
- package/dist/schemas/passkey.d.ts.map +1 -1
- package/dist/schemas/passkey.js +8 -9
- package/dist/schemas/passkey.js.map +1 -1
- package/package.json +6 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/schemas/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/schemas/errors.ts"],"names":[],"mappings":""}
|
package/dist/schemas/errors.js
CHANGED
|
@@ -1,84 +1,72 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
/* Unauthorized */
|
|
3
3
|
/** @internal */
|
|
4
|
-
export class
|
|
4
|
+
export class UnauthorizedError extends Schema.TaggedError()("@error/Unauthorized", {}) {
|
|
5
5
|
}
|
|
6
|
-
/**
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
export const isUnauthorized = (payload) => Schema.is(Unauthorized)(payload);
|
|
6
|
+
/** @internal */
|
|
7
|
+
export const isUnauthorizedError = (payload) => Schema.is(UnauthorizedError)(payload);
|
|
10
8
|
/* Forbidden */
|
|
11
9
|
/** @internal */
|
|
12
|
-
export class
|
|
10
|
+
export class ForbiddenError extends Schema.TaggedError()("@error/Forbidden", {}) {
|
|
13
11
|
}
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
*/
|
|
17
|
-
export const isForbidden = (payload) => Schema.is(Forbidden)(payload);
|
|
12
|
+
/** @internal */
|
|
13
|
+
export const isForbiddenError = (payload) => Schema.is(ForbiddenError)(payload);
|
|
18
14
|
/* InvalidCode */
|
|
19
15
|
/** @internal */
|
|
20
|
-
export class
|
|
16
|
+
export class InvalidCodeError extends Schema.TaggedError()("@error/InvalidCode", {
|
|
21
17
|
message: Schema.String,
|
|
22
18
|
}) {
|
|
23
19
|
}
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
*/
|
|
27
|
-
export const isInvalidCode = (payload) => Schema.is(InvalidCode)(payload);
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const isInvalidCodeError = (payload) => Schema.is(InvalidCodeError)(payload);
|
|
28
22
|
/* InvalidTenancy */
|
|
29
23
|
/** @internal */
|
|
30
|
-
export class
|
|
24
|
+
export class InvalidTenancyError extends Schema.TaggedError()("@error/InvalidTenancy", {
|
|
31
25
|
message: Schema.String,
|
|
32
26
|
}) {
|
|
33
27
|
}
|
|
34
|
-
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const isInvalidTenancyError = (payload) => Schema.is(InvalidTenancyError)(payload);
|
|
35
30
|
/* PasskeyNotFound */
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
* client's signalCredentialRemoval function
|
|
39
|
-
*
|
|
40
|
-
* @category Passkeys
|
|
41
|
-
*/
|
|
42
|
-
/** @internal */
|
|
43
|
-
export class PasskeyNotFound extends Schema.TaggedError()("@error/PasskeyNotFound", {
|
|
31
|
+
/** @internal */
|
|
32
|
+
export class PasskeyNotFoundError extends Schema.TaggedError()("@error/PasskeyNotFound", {
|
|
44
33
|
credentialId: Schema.String,
|
|
45
34
|
message: Schema.String,
|
|
46
35
|
rpId: Schema.String,
|
|
47
36
|
}) {
|
|
48
37
|
}
|
|
49
|
-
/**
|
|
50
|
-
|
|
51
|
-
* @returns `true` if the payload is a {@link PasskeyNotFound} error.
|
|
52
|
-
*
|
|
53
|
-
* @category Passkeys
|
|
54
|
-
*/
|
|
55
|
-
export const isPasskeyNotFound = (payload) => Schema.is(PasskeyNotFound)(payload);
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const isPasskeyNotFoundError = (payload) => Schema.is(PasskeyNotFoundError)(payload);
|
|
56
40
|
/* NotFound */
|
|
57
41
|
/** @internal */
|
|
58
|
-
export class
|
|
42
|
+
export class NotFoundError extends Schema.TaggedError()("@error/NotFound", {
|
|
59
43
|
message: Schema.String,
|
|
60
44
|
}) {
|
|
61
45
|
}
|
|
62
|
-
|
|
46
|
+
/** @internal */
|
|
47
|
+
export const isNotFoundError = (payload) => Schema.is(NotFoundError)(payload);
|
|
63
48
|
/* InvalidEmail */
|
|
64
49
|
/** @internal */
|
|
65
|
-
export class
|
|
50
|
+
export class InvalidEmailError extends Schema.TaggedError()("@error/InvalidEmail", {
|
|
66
51
|
message: Schema.String,
|
|
67
52
|
}) {
|
|
68
53
|
}
|
|
69
|
-
|
|
54
|
+
/** @internal */
|
|
55
|
+
export const isInvalidEmailError = (payload) => Schema.is(InvalidEmailError)(payload);
|
|
70
56
|
/* DuplicateEmail */
|
|
71
57
|
/** @internal */
|
|
72
|
-
export class
|
|
58
|
+
export class DuplicateEmailError extends Schema.TaggedError()("@error/DuplicateEmail", {
|
|
73
59
|
message: Schema.String,
|
|
74
60
|
}) {
|
|
75
61
|
}
|
|
76
|
-
|
|
62
|
+
/** @internal */
|
|
63
|
+
export const isDuplicateEmailError = (payload) => Schema.is(DuplicateEmailError)(payload);
|
|
77
64
|
/* BadRequest */
|
|
78
65
|
/** @internal */
|
|
79
|
-
export class
|
|
66
|
+
export class BadRequestError extends Schema.TaggedError()("@error/BadRequest", {
|
|
80
67
|
message: Schema.String,
|
|
81
68
|
}) {
|
|
82
69
|
}
|
|
83
|
-
|
|
70
|
+
/** @internal */
|
|
71
|
+
export const isBadRequestError = (payload) => Schema.is(BadRequestError)(payload);
|
|
84
72
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/schemas/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,kBAAkB;AAElB,gBAAgB;AAChB,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/schemas/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,kBAAkB;AAElB,gBAAgB;AAChB,MAAM,OAAO,iBAAkB,SAAQ,MAAM,CAAC,WAAW,EAAqB,CAC5E,qBAAqB,EACrB,EAAE,CACH;CAAG;AAEJ,gBAAgB;AAChB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,OAAgB,EACc,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAA;AAExE,eAAe;AAEf,gBAAgB;AAChB,MAAM,OAAO,cAAe,SAAQ,MAAM,CAAC,WAAW,EAAkB,CACtE,kBAAkB,EAClB,EAAE,CACH;CAAG;AAEJ,gBAAgB;AACh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ACjB;IACE,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CACF;CAAG;AAEJ,gBAAgB;AAChB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAgB,EAA4B,EAAE,CAC5E,MAAM,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAA;AAEnC,kBAAkB;AAElB,gBAAgB;AAChB,MAAM,OAAO,iBAAkB,SAAQ,MAAM,CAAC,WAAW,EAAqB,CAC5E,qBAAqB,EACrB;IACE,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CACF;CAAG;AAEJ,gBAAgB;AAChB,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,OAAgB,EACc,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAA;AAExE,oBAAoB;AAEpB,gBAAgB;AAChB,MAAM,OAAO,mBAAoB,SAAQ,MAAM,CAAC,WAAW,EAAuB,CAChF,uBAAuB,EACvB;IACE,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CACF;CAAG;AAEJ,gBAAgB;AAChB,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,OAAgB,EACgB,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAA;AAE5E,gBAAgB;AAEhB,gBAAgB;AAChB,MAAM,OAAO,eAAgB,SAAQ,MAAM,CAAC,WAAW,EAAmB,CACxE,mBAAmB,EACnB;IACE,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CACF;CAAG;AAEJ,gBAAgB;AAChB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,OAAgB,EACY,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAA","sourcesContent":["import { Schema } from \"effect\"\n\n/* Unauthorized */\n\n/** @internal */\nexport class UnauthorizedError extends Schema.TaggedError<UnauthorizedError>()(\n \"@error/Unauthorized\",\n {}\n) {}\n\n/** @internal */\nexport const isUnauthorizedError = (\n payload: unknown\n): payload is UnauthorizedError => Schema.is(UnauthorizedError)(payload)\n\n/* Forbidden */\n\n/** @internal */\nexport class ForbiddenError extends Schema.TaggedError<ForbiddenError>()(\n \"@error/Forbidden\",\n {}\n) {}\n\n/** @internal */\nexport const isForbiddenError = (payload: unknown): payload is ForbiddenError =>\n Schema.is(ForbiddenError)(payload)\n\n/* InvalidCode */\n\n/** @internal */\nexport class InvalidCodeError extends Schema.TaggedError<InvalidCodeError>()(\n \"@error/InvalidCode\",\n {\n message: Schema.String,\n }\n) {}\n\n/** @internal */\nexport const isInvalidCodeError = (\n payload: unknown\n): payload is InvalidCodeError => Schema.is(InvalidCodeError)(payload)\n\n/* InvalidTenancy */\n\n/** @internal */\nexport class InvalidTenancyError extends Schema.TaggedError<InvalidTenancyError>()(\n \"@error/InvalidTenancy\",\n {\n message: Schema.String,\n }\n) {}\n\n/** @internal */\nexport const isInvalidTenancyError = (\n payload: unknown\n): payload is InvalidTenancyError => Schema.is(InvalidTenancyError)(payload)\n\n/* PasskeyNotFound */\n\n/** @internal */\nexport class PasskeyNotFoundError extends Schema.TaggedError<PasskeyNotFoundError>()(\n \"@error/PasskeyNotFound\",\n {\n credentialId: Schema.String,\n message: Schema.String,\n rpId: Schema.String,\n }\n) {}\n\n/** @internal */\nexport const isPasskeyNotFoundError = (\n payload: unknown\n): payload is PasskeyNotFoundError => Schema.is(PasskeyNotFoundError)(payload)\n\n/* NotFound */\n\n/** @internal */\nexport class NotFoundError extends Schema.TaggedError<NotFoundError>()(\n \"@error/NotFound\",\n {\n message: Schema.String,\n }\n) {}\n\n/** @internal */\nexport const isNotFoundError = (payload: unknown): payload is NotFoundError =>\n Schema.is(NotFoundError)(payload)\n\n/* InvalidEmail */\n\n/** @internal */\nexport class InvalidEmailError extends Schema.TaggedError<InvalidEmailError>()(\n \"@error/InvalidEmail\",\n {\n message: Schema.String,\n }\n) {}\n\n/** @internal */\nexport const isInvalidEmailError = (\n payload: unknown\n): payload is InvalidEmailError => Schema.is(InvalidEmailError)(payload)\n\n/* DuplicateEmail */\n\n/** @internal */\nexport class DuplicateEmailError extends Schema.TaggedError<DuplicateEmailError>()(\n \"@error/DuplicateEmail\",\n {\n message: Schema.String,\n }\n) {}\n\n/** @internal */\nexport const isDuplicateEmailError = (\n payload: unknown\n): payload is DuplicateEmailError => Schema.is(DuplicateEmailError)(payload)\n\n/* BadRequest */\n\n/** @internal */\nexport class BadRequestError extends Schema.TaggedError<BadRequestError>()(\n \"@error/BadRequest\",\n {\n message: Schema.String,\n }\n) {}\n\n/** @internal */\nexport const isBadRequestError = (\n payload: unknown\n): payload is BadRequestError => Schema.is(BadRequestError)(payload)\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const UserVerification: Schema.Literal<["required", "preferred", "discouraged"]>;
|
|
3
3
|
export declare const CredentialDeviceType: readonly ["singleDevice", "multiDevice"];
|
|
4
4
|
export type CredentialDeviceType = (typeof CredentialDeviceType)[number];
|
|
5
5
|
export declare const Transports: readonly ["ble", "hybrid", "internal", "nfc", "usb", "cable", "smart-card"];
|
|
6
6
|
export type Transports = (typeof Transports)[number];
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const Passkey: Schema.TaggedStruct<"Passkey", {
|
|
8
8
|
id: typeof Schema.String;
|
|
9
9
|
userId: Schema.optional<typeof Schema.String>;
|
|
10
10
|
enabled: typeof Schema.Boolean;
|
|
@@ -18,6 +18,7 @@ export declare const PasskeySchema: Schema.TaggedStruct<"Passkey", {
|
|
|
18
18
|
deviceType: Schema.Literal<["singleDevice", "multiDevice"]>;
|
|
19
19
|
transports: Schema.Array$<Schema.Literal<["ble", "hybrid", "internal", "nfc", "usb", "cable", "smart-card"]>>;
|
|
20
20
|
publicKey: Schema.Schema<Uint8Array<ArrayBufferLike>, string, never>;
|
|
21
|
+
rpId: typeof Schema.String;
|
|
21
22
|
}>;
|
|
22
23
|
platform: Schema.optional<Schema.Struct<{
|
|
23
24
|
icon: Schema.optional<typeof Schema.String>;
|
|
@@ -27,8 +28,9 @@ export declare const PasskeySchema: Schema.TaggedStruct<"Passkey", {
|
|
|
27
28
|
createdAt: typeof Schema.Number;
|
|
28
29
|
updatedAt: typeof Schema.Number;
|
|
29
30
|
}>;
|
|
30
|
-
export type
|
|
31
|
-
export
|
|
31
|
+
export type Passkey = typeof Passkey.Type;
|
|
32
|
+
export type PasskeyEncoded = typeof Passkey.Encoded;
|
|
33
|
+
export declare const PasskeySummary: Schema.TaggedStruct<"PasskeySummary", {
|
|
32
34
|
id: typeof Schema.String;
|
|
33
35
|
userId: typeof Schema.String;
|
|
34
36
|
credential: Schema.Struct<{
|
|
@@ -39,7 +41,8 @@ export declare const PasskeySummarySchema: Schema.TaggedStruct<"PasskeySummary",
|
|
|
39
41
|
createdAt: typeof Schema.Number;
|
|
40
42
|
lastUsed: Schema.optional<typeof Schema.Number>;
|
|
41
43
|
}>;
|
|
42
|
-
export
|
|
44
|
+
export type PasskeySummary = typeof PasskeySummary.Type;
|
|
45
|
+
export declare const FindAllPasskeys: Schema.TaggedStruct<"FindAllPasskeys", {
|
|
43
46
|
cursor: Schema.NullOr<typeof Schema.String>;
|
|
44
47
|
records: Schema.Array$<Schema.TaggedStruct<"PasskeySummary", {
|
|
45
48
|
id: typeof Schema.String;
|
|
@@ -53,9 +56,30 @@ export declare const FindAllPasskeysSchema: Schema.TaggedStruct<"FindAllPasskeys
|
|
|
53
56
|
lastUsed: Schema.optional<typeof Schema.Number>;
|
|
54
57
|
}>>;
|
|
55
58
|
}>;
|
|
56
|
-
export declare const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
export declare const UpdatedPasskeys: Schema.TaggedStruct<"UpdatedPasskeys", {
|
|
60
|
+
updated: Schema.Array$<Schema.TaggedStruct<"Passkey", {
|
|
61
|
+
id: typeof Schema.String;
|
|
62
|
+
userId: Schema.optional<typeof Schema.String>;
|
|
63
|
+
enabled: typeof Schema.Boolean;
|
|
64
|
+
credential: Schema.Struct<{
|
|
65
|
+
id: typeof Schema.String;
|
|
66
|
+
userId: typeof Schema.String;
|
|
67
|
+
username: typeof Schema.String;
|
|
68
|
+
aaguid: typeof Schema.String;
|
|
69
|
+
backedUp: typeof Schema.Boolean;
|
|
70
|
+
counter: typeof Schema.Number;
|
|
71
|
+
deviceType: Schema.Literal<["singleDevice", "multiDevice"]>;
|
|
72
|
+
transports: Schema.Array$<Schema.Literal<["ble", "hybrid", "internal", "nfc", "usb", "cable", "smart-card"]>>;
|
|
73
|
+
publicKey: Schema.Schema<Uint8Array<ArrayBufferLike>, string, never>;
|
|
74
|
+
rpId: typeof Schema.String;
|
|
75
|
+
}>;
|
|
76
|
+
platform: Schema.optional<Schema.Struct<{
|
|
77
|
+
icon: Schema.optional<typeof Schema.String>;
|
|
78
|
+
name: Schema.optional<typeof Schema.String>;
|
|
79
|
+
}>>;
|
|
80
|
+
lastUsed: Schema.optional<typeof Schema.Number>;
|
|
81
|
+
createdAt: typeof Schema.Number;
|
|
82
|
+
updatedAt: typeof Schema.Number;
|
|
83
|
+
}>>;
|
|
60
84
|
}>;
|
|
61
85
|
//# sourceMappingURL=passkey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passkey.d.ts","sourceRoot":"","sources":["../../src/schemas/passkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAW/B,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"passkey.d.ts","sourceRoot":"","sources":["../../src/schemas/passkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAW/B,eAAO,MAAM,gBAAgB,0DAI5B,CAAA;AAID,eAAO,MAAM,oBAAoB,0CAA2C,CAAA;AAC5E,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAA;AAExE,eAAO,MAAM,UAAU,6EAQb,CAAA;AACV,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAA;AAIpD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;EAyBlB,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAA;AAEzC,MAAM,MAAM,cAAc,GAAG,OAAO,OAAO,CAAC,OAAO,CAAA;AAEnD,eAAO,MAAM,cAAc;;;;;;;;;;EAUzB,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC,IAAI,CAAA;AAEvD,eAAO,MAAM,eAAe;;;;;;;;;;;;;EAG1B,CAAA;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;EAE1B,CAAA"}
|
package/dist/schemas/passkey.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Schema } from "effect";
|
|
|
6
6
|
* kind of a type level satisfies
|
|
7
7
|
*/
|
|
8
8
|
/* Registration Options */
|
|
9
|
-
export const
|
|
9
|
+
export const UserVerification = Schema.Literal("required", "preferred", "discouraged");
|
|
10
10
|
/* Passkey */
|
|
11
11
|
export const CredentialDeviceType = ["singleDevice", "multiDevice"];
|
|
12
12
|
export const Transports = [
|
|
@@ -19,7 +19,7 @@ export const Transports = [
|
|
|
19
19
|
"smart-card",
|
|
20
20
|
];
|
|
21
21
|
/* Passkey */
|
|
22
|
-
export const
|
|
22
|
+
export const Passkey = Schema.TaggedStruct("Passkey", {
|
|
23
23
|
id: Schema.String,
|
|
24
24
|
userId: Schema.optional(Schema.String),
|
|
25
25
|
enabled: Schema.Boolean,
|
|
@@ -33,6 +33,7 @@ export const PasskeySchema = Schema.TaggedStruct("Passkey", {
|
|
|
33
33
|
deviceType: Schema.Literal(...CredentialDeviceType),
|
|
34
34
|
transports: Schema.Array(Schema.Literal(...Transports)),
|
|
35
35
|
publicKey: Schema.Uint8ArrayFromBase64Url,
|
|
36
|
+
rpId: Schema.String,
|
|
36
37
|
}),
|
|
37
38
|
platform: Schema.optional(Schema.Struct({
|
|
38
39
|
icon: Schema.optional(Schema.String),
|
|
@@ -42,7 +43,7 @@ export const PasskeySchema = Schema.TaggedStruct("Passkey", {
|
|
|
42
43
|
createdAt: Schema.Number,
|
|
43
44
|
updatedAt: Schema.Number,
|
|
44
45
|
});
|
|
45
|
-
export const
|
|
46
|
+
export const PasskeySummary = Schema.TaggedStruct("PasskeySummary", {
|
|
46
47
|
id: Schema.String,
|
|
47
48
|
userId: Schema.String,
|
|
48
49
|
credential: Schema.Struct({
|
|
@@ -53,13 +54,11 @@ export const PasskeySummarySchema = Schema.TaggedStruct("PasskeySummary", {
|
|
|
53
54
|
createdAt: Schema.Number,
|
|
54
55
|
lastUsed: Schema.optional(Schema.Number),
|
|
55
56
|
});
|
|
56
|
-
export const
|
|
57
|
+
export const FindAllPasskeys = Schema.TaggedStruct("FindAllPasskeys", {
|
|
57
58
|
cursor: Schema.NullOr(Schema.String),
|
|
58
|
-
records: Schema.Array(
|
|
59
|
+
records: Schema.Array(PasskeySummary),
|
|
59
60
|
});
|
|
60
|
-
export const
|
|
61
|
-
|
|
62
|
-
credentialId: Schema.String,
|
|
63
|
-
rpId: Schema.String,
|
|
61
|
+
export const UpdatedPasskeys = Schema.TaggedStruct("UpdatedPasskeys", {
|
|
62
|
+
updated: Schema.Array(Passkey),
|
|
64
63
|
});
|
|
65
64
|
//# sourceMappingURL=passkey.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"passkey.js","sourceRoot":"","sources":["../../src/schemas/passkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B;;;;;GAKG;AAEH,0BAA0B;AAE1B,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"passkey.js","sourceRoot":"","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,MAAM,CAAC,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;QACpC,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;KACrC,CAAC,CACH;IACD,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC,MAAM;IACxB,SAAS,EAAE,MAAM,CAAC,MAAM;CACzB,CAAC,CAAA;AAMF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,YAAY,CAAC,gBAAgB,EAAE;IAClE,EAAE,EAAE,MAAM,CAAC,MAAM;IACjB,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC;QACxB,EAAE,EAAE,MAAM,CAAC,MAAM;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC,OAAO;IACvB,SAAS,EAAE,MAAM,CAAC,MAAM;IACxB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;CACzC,CAAC,CAAA;AAIF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,CAAC,iBAAiB,EAAE;IACpE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC;CACtC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,YAAY,CAAC,iBAAiB,EAAE;IACpE,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC;CAC/B,CAAC,CAAA","sourcesContent":["import { Schema } from \"effect\"\n\n/*\n * Important. We don't use `type X = typeof X.Type` because it won't generate\n * the Typedoc docs, so instead we mirror the types and use a dummy\n * `type _x = satisfy<typeof X.Type, X>`\n * kind of a type level satisfies\n */\n\n/* Registration Options */\n\nexport const UserVerification = Schema.Literal(\n \"required\",\n \"preferred\",\n \"discouraged\"\n)\n\n/* Passkey */\n\nexport const CredentialDeviceType = [\"singleDevice\", \"multiDevice\"] as const\nexport type CredentialDeviceType = (typeof CredentialDeviceType)[number]\n\nexport const Transports = [\n \"ble\",\n \"hybrid\",\n \"internal\",\n \"nfc\",\n \"usb\",\n \"cable\",\n \"smart-card\",\n] as const\nexport type Transports = (typeof Transports)[number]\n\n/* Passkey */\n\nexport const Passkey = Schema.TaggedStruct(\"Passkey\", {\n id: Schema.String,\n userId: Schema.optional(Schema.String),\n enabled: Schema.Boolean,\n credential: Schema.Struct({\n id: Schema.String, // webAuthnId (Base64Url)\n userId: Schema.String, // webAuthnUserId (Base64Url)\n username: Schema.String,\n aaguid: Schema.String,\n backedUp: Schema.Boolean,\n counter: Schema.Number,\n deviceType: Schema.Literal(...CredentialDeviceType),\n transports: Schema.Array(Schema.Literal(...Transports)),\n publicKey: Schema.Uint8ArrayFromBase64Url,\n rpId: Schema.String,\n }),\n platform: Schema.optional(\n Schema.Struct({\n icon: Schema.optional(Schema.String),\n name: Schema.optional(Schema.String),\n })\n ),\n lastUsed: Schema.optional(Schema.Number),\n createdAt: Schema.Number,\n updatedAt: Schema.Number,\n})\n\nexport type Passkey = typeof Passkey.Type\n\nexport type PasskeyEncoded = typeof Passkey.Encoded\n\nexport const PasskeySummary = Schema.TaggedStruct(\"PasskeySummary\", {\n id: Schema.String,\n userId: Schema.String,\n credential: Schema.Struct({\n id: Schema.String,\n userId: Schema.String,\n }),\n enabled: Schema.Boolean,\n createdAt: Schema.Number,\n lastUsed: Schema.optional(Schema.Number),\n})\n\nexport type PasskeySummary = typeof PasskeySummary.Type\n\nexport const FindAllPasskeys = Schema.TaggedStruct(\"FindAllPasskeys\", {\n cursor: Schema.NullOr(Schema.String),\n records: Schema.Array(PasskeySummary),\n})\n\nexport const UpdatedPasskeys = Schema.TaggedStruct(\"UpdatedPasskeys\", {\n updated: Schema.Array(Passkey),\n})\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@passlock/node",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Passkey authentication for NodeJS backends",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"passkey",
|
|
@@ -48,17 +48,16 @@
|
|
|
48
48
|
"!dist/**/*.spec.*"
|
|
49
49
|
],
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"
|
|
52
|
-
"@effect/platform-node": "^0.104.1",
|
|
51
|
+
"effect": "3.19.19",
|
|
53
52
|
"jose": "^6.1.3"
|
|
54
53
|
},
|
|
55
54
|
"devDependencies": {
|
|
56
55
|
"@biomejs/biome": "^2.4.4",
|
|
57
56
|
"@effect/vitest": "^0.27.0",
|
|
58
|
-
"@types/node": "25.3.
|
|
59
|
-
"globals": "^17.
|
|
60
|
-
"npm-check-updates": "^19.
|
|
61
|
-
"publint": "0.3.
|
|
57
|
+
"@types/node": "25.3.3",
|
|
58
|
+
"globals": "^17.4.0",
|
|
59
|
+
"npm-check-updates": "^19.6.3",
|
|
60
|
+
"publint": "0.3.18",
|
|
62
61
|
"rimraf": "^6.1.3",
|
|
63
62
|
"tsx": "4.21.0",
|
|
64
63
|
"typedoc": "^0.28.17",
|
|
@@ -66,9 +65,6 @@
|
|
|
66
65
|
"vite-tsconfig-paths": "^6.1.1",
|
|
67
66
|
"vitest": "^3.2.4"
|
|
68
67
|
},
|
|
69
|
-
"peerDependencies": {
|
|
70
|
-
"effect": "3.19.19"
|
|
71
|
-
},
|
|
72
68
|
"engines": {
|
|
73
69
|
"node": ">=22"
|
|
74
70
|
},
|