@passlock/server 2.1.0
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/README.md +45 -0
- package/README.template.md +45 -0
- package/dist/effect.d.ts +7 -0
- package/dist/effect.d.ts.map +1 -0
- package/dist/effect.js +4 -0
- package/dist/effect.js.map +1 -0
- package/dist/errors.d.ts +71 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +30 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +115 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +109 -0
- package/dist/index.js.map +1 -0
- 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 +132 -0
- package/dist/passkey/passkey.d.ts.map +1 -0
- package/dist/passkey/passkey.js +158 -0
- package/dist/passkey/passkey.js.map +1 -0
- package/dist/principal/principal.d.ts +22 -0
- package/dist/principal/principal.d.ts.map +1 -0
- package/dist/principal/principal.js +65 -0
- package/dist/principal/principal.js.map +1 -0
- package/dist/safe.d.ts +154 -0
- package/dist/safe.d.ts.map +1 -0
- package/dist/safe.js +147 -0
- package/dist/safe.js.map +1 -0
- package/dist/schemas/errors.d.ts +2 -0
- package/dist/schemas/errors.d.ts.map +1 -0
- package/dist/schemas/errors.js +72 -0
- package/dist/schemas/errors.js.map +1 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +5 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/passkey.d.ts +85 -0
- package/dist/schemas/passkey.d.ts.map +1 -0
- package/dist/schemas/passkey.js +64 -0
- package/dist/schemas/passkey.js.map +1 -0
- package/dist/schemas/principal.d.ts +88 -0
- package/dist/schemas/principal.d.ts.map +1 -0
- package/dist/schemas/principal.js +46 -0
- package/dist/schemas/principal.js.map +1 -0
- package/dist/schemas/satisfy.d.ts +2 -0
- package/dist/schemas/satisfy.d.ts.map +1 -0
- package/dist/schemas/satisfy.js +2 -0
- package/dist/schemas/satisfy.js.map +1 -0
- package/dist/schemas/signup.d.ts +13 -0
- package/dist/schemas/signup.d.ts.map +1 -0
- package/dist/schemas/signup.js +11 -0
- package/dist/schemas/signup.js.map +1 -0
- package/dist/shared.d.ts +19 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +9 -0
- package/dist/shared.js.map +1 -0
- package/package.json +93 -0
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
The pnpm script build:readme replaces tokens
|
|
3
|
+
in README.template.md and outputs to README.md
|
|
4
|
+
-->
|
|
5
|
+
<div align="center">
|
|
6
|
+
<a href="https://github.com/passlock-dev/passlock">
|
|
7
|
+
<img src="https://passlock-assets.b-cdn.net/images/passlock-logo.svg" alt="Passlock logo" width="80" height="80">
|
|
8
|
+
</a>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div align="center">
|
|
12
|
+
<picture align="center">
|
|
13
|
+
<source srcset="https://passlock-assets.b-cdn.net/images/client-repo-banner.dark.svg" media="(prefers-color-scheme: dark)" />
|
|
14
|
+
<img align="center" width=550 height=50 src="https://passlock-assets.b-cdn.net/images/client-repo-banner.svg" />
|
|
15
|
+
</picture>
|
|
16
|
+
<p align="center">
|
|
17
|
+
Server-side library to accompany the <a href="https://www.npmjs.com/package/@passlock/client">@passlock/client</a> package
|
|
18
|
+
<br />
|
|
19
|
+
<a href="https://passlock.dev"><strong>Project website »</strong></a>
|
|
20
|
+
<br />
|
|
21
|
+
<a href="https://github.com/passlock-dev/passlock">GitHub</a>
|
|
22
|
+
·
|
|
23
|
+
<a href="https://passlock.dev">Documentation</a>
|
|
24
|
+
·
|
|
25
|
+
<a href="https://passlock.dev/getting-started/">Quick start</a>
|
|
26
|
+
·
|
|
27
|
+
<a href="https://passlock.dev/#demo">Demo</a>
|
|
28
|
+
</p>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<br />
|
|
32
|
+
|
|
33
|
+
## See also
|
|
34
|
+
|
|
35
|
+
For frontend usage please see the accompanying [@passlock/client][client] package
|
|
36
|
+
|
|
37
|
+
## Requirements
|
|
38
|
+
|
|
39
|
+
Node 20+ (If running Node)
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
Please see the [Quick start guide](https://passlock.dev/getting-started/)
|
|
44
|
+
|
|
45
|
+
[client]: https://www.npmjs.com/package/@passlock/client
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
The pnpm script build:readme replaces tokens
|
|
3
|
+
in README.template.md and outputs to README.md
|
|
4
|
+
-->
|
|
5
|
+
<div align="center">
|
|
6
|
+
<a href="#{GITHUB_REPO}#">
|
|
7
|
+
<img src="#{PASSLOCK_LOGO}#" alt="Passlock logo" width="80" height="80">
|
|
8
|
+
</a>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div align="center">
|
|
12
|
+
<picture align="center">
|
|
13
|
+
<source srcset="#{ASSETS}#/images/client-repo-banner.dark.svg" media="(prefers-color-scheme: dark)" />
|
|
14
|
+
<img align="center" width=550 height=50 src="#{ASSETS}#/images/client-repo-banner.svg" />
|
|
15
|
+
</picture>
|
|
16
|
+
<p align="center">
|
|
17
|
+
Server-side library to accompany the <a href="https://www.npmjs.com/package/@passlock/client">@passlock/client</a> package
|
|
18
|
+
<br />
|
|
19
|
+
<a href="#{PASSLOCK_SITE}#"><strong>Project website »</strong></a>
|
|
20
|
+
<br />
|
|
21
|
+
<a href="#{GITHUB_REPO}#">GitHub</a>
|
|
22
|
+
·
|
|
23
|
+
<a href="#{DOCS}#">Documentation</a>
|
|
24
|
+
·
|
|
25
|
+
<a href="#{TUTORIAL}#">Quick start</a>
|
|
26
|
+
·
|
|
27
|
+
<a href="#{DEMO}#">Demo</a>
|
|
28
|
+
</p>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<br />
|
|
32
|
+
|
|
33
|
+
## See also
|
|
34
|
+
|
|
35
|
+
For frontend usage please see the accompanying [@passlock/client][client] package
|
|
36
|
+
|
|
37
|
+
## Requirements
|
|
38
|
+
|
|
39
|
+
Node 20+ (If running Node)
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
Please see the [Quick start guide](#{TUTORIAL}#)
|
|
44
|
+
|
|
45
|
+
[client]: https://www.npmjs.com/package/@passlock/client
|
package/dist/effect.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { AssignUserOptions, ListPasskeyOptions, } from "./passkey/passkey.js";
|
|
2
|
+
export { assignUser, deletePasskey, getPasskey, listPasskeys, } from "./passkey/passkey.js";
|
|
3
|
+
export type {} from "./principal/principal.js";
|
|
4
|
+
export { exchangeCode, VerificationError, verifyIdToken, } from "./principal/principal.js";
|
|
5
|
+
export * from "./schemas/index.js";
|
|
6
|
+
export type { AuthenticatedOptions, PasslockOptions, } from "./shared.js";
|
|
7
|
+
//# sourceMappingURL=effect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effect.d.ts","sourceRoot":"","sources":["../src/effect.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,UAAU,EACV,aAAa,EACb,UAAU,EACV,YAAY,GACb,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC9C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,GACd,MAAM,0BAA0B,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,YAAY,EACV,oBAAoB,EACpB,eAAe,GAChB,MAAM,aAAa,CAAA"}
|
package/dist/effect.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"effect.js","sourceRoot":"","sources":["../src/effect.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,UAAU,EACV,aAAa,EACb,UAAU,EACV,YAAY,GACb,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,GACd,MAAM,0BAA0B,CAAA;AACjC,cAAc,oBAAoB,CAAA","sourcesContent":["export type {\n AssignUserOptions,\n ListPasskeyOptions,\n} from \"./passkey/passkey.js\"\nexport {\n assignUser,\n deletePasskey,\n getPasskey,\n listPasskeys,\n} from \"./passkey/passkey.js\"\nexport type {} from \"./principal/principal.js\"\nexport {\n exchangeCode,\n VerificationError,\n verifyIdToken,\n} from \"./principal/principal.js\"\nexport * from \"./schemas/index.js\"\nexport type {\n AuthenticatedOptions,\n PasslockOptions,\n} from \"./shared.js\"\n"]}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @category Authentication
|
|
3
|
+
*/
|
|
4
|
+
export type UnauthorizedError = {
|
|
5
|
+
_tag: "@error/Unauthorized";
|
|
6
|
+
message: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const isUnauthorizedError: (payload: unknown) => payload is UnauthorizedError;
|
|
9
|
+
/**
|
|
10
|
+
* @category Authentication
|
|
11
|
+
*/
|
|
12
|
+
export type ForbiddenError = {
|
|
13
|
+
_tag: "@error/Forbidden";
|
|
14
|
+
message: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const isForbiddenError: (payload: unknown) => payload is ForbiddenError;
|
|
17
|
+
/**
|
|
18
|
+
* @category Principal
|
|
19
|
+
*/
|
|
20
|
+
export type InvalidCodeError = {
|
|
21
|
+
_tag: "@error/InvalidCode";
|
|
22
|
+
message: string;
|
|
23
|
+
};
|
|
24
|
+
export declare const isInvalidCodeError: (payload: unknown) => payload is InvalidCodeError;
|
|
25
|
+
/**
|
|
26
|
+
* @category Principal
|
|
27
|
+
*/
|
|
28
|
+
export type VerificationError = {
|
|
29
|
+
_tag: "@error/Verification";
|
|
30
|
+
message: string;
|
|
31
|
+
};
|
|
32
|
+
export declare const isVerificationError: (payload: unknown) => payload is VerificationError;
|
|
33
|
+
export type InvalidTenancyError = {
|
|
34
|
+
_tag: "@error/InvalidTenancy";
|
|
35
|
+
message: string;
|
|
36
|
+
};
|
|
37
|
+
export declare const isInvalidTenancyError: (payload: unknown) => payload is InvalidTenancyError;
|
|
38
|
+
/**
|
|
39
|
+
* Error payload returned when a passkey cannot be found for a given
|
|
40
|
+
* authentication attempt.
|
|
41
|
+
*
|
|
42
|
+
* @category Passkeys
|
|
43
|
+
*/
|
|
44
|
+
export type PasskeyNotFoundError = {
|
|
45
|
+
_tag: "@error/PasskeyNotFound";
|
|
46
|
+
message: string;
|
|
47
|
+
credentialId: string;
|
|
48
|
+
rpId: string;
|
|
49
|
+
};
|
|
50
|
+
export declare const isPasskeyNotFoundError: (payload: unknown) => payload is PasskeyNotFoundError;
|
|
51
|
+
export type NotFoundError = {
|
|
52
|
+
_tag: "@error/NotFound";
|
|
53
|
+
message: string;
|
|
54
|
+
};
|
|
55
|
+
export declare const isNotFoundError: (payload: unknown) => payload is NotFoundError;
|
|
56
|
+
export type InvalidEmailError = {
|
|
57
|
+
_tag: "@error/InvalidEmail";
|
|
58
|
+
message: string;
|
|
59
|
+
};
|
|
60
|
+
export declare const isInvalidEmailError: (payload: unknown) => payload is InvalidEmailError;
|
|
61
|
+
export type DuplicateEmailError = {
|
|
62
|
+
_tag: "@error/DuplicateEmail";
|
|
63
|
+
message: string;
|
|
64
|
+
};
|
|
65
|
+
export declare const isDuplicateEmailError: (payload: unknown) => payload is DuplicateEmailError;
|
|
66
|
+
export type BadRequestError = {
|
|
67
|
+
_tag: "@error/BadRequest";
|
|
68
|
+
message: string;
|
|
69
|
+
};
|
|
70
|
+
export declare const isBadRequestError: (payload: unknown) => payload is BadRequestError;
|
|
71
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file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,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,iBAAiB,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,eAAe,YArGhB,OAAO,KAAG,OAAO,iBAqG4C,CAAA;AAIzE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,qBAAqB,CAAA;IAC3B,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,mBAAmB,YA9GpB,OAAO,KAAG,OAAO,qBAgH5B,CAAA;AAID,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,uBAAuB,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,qBAAqB,YAzHtB,OAAO,KAAG,OAAO,uBA2H5B,CAAA;AAID,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,mBAAmB,CAAA;IACzB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,iBAAiB,YApIlB,OAAO,KAAG,OAAO,mBAoIkD,CAAA"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Publicly exposed errors.
|
|
3
|
+
* The errors we receive from the API live in the schemas/errors.ts module.
|
|
4
|
+
* The errors here have the same shape but they are simple types
|
|
5
|
+
* so are easier for non Effect consumers to handle.
|
|
6
|
+
*/
|
|
7
|
+
const isTagged = (tag) => (payload) => {
|
|
8
|
+
if (typeof payload !== "object")
|
|
9
|
+
return false;
|
|
10
|
+
if (payload === null)
|
|
11
|
+
return false;
|
|
12
|
+
if (!("_tag" in payload))
|
|
13
|
+
return false;
|
|
14
|
+
if (typeof payload._tag !== "string")
|
|
15
|
+
return false;
|
|
16
|
+
if (payload._tag !== tag)
|
|
17
|
+
return false;
|
|
18
|
+
return true;
|
|
19
|
+
};
|
|
20
|
+
export const isUnauthorizedError = isTagged("@error/Unauthorized");
|
|
21
|
+
export const isForbiddenError = isTagged("@error/Forbidden");
|
|
22
|
+
export const isInvalidCodeError = isTagged("@error/InvalidCode");
|
|
23
|
+
export const isVerificationError = isTagged("@error/Verification");
|
|
24
|
+
export const isInvalidTenancyError = isTagged("@error/InvalidTenancy");
|
|
25
|
+
export const isPasskeyNotFoundError = isTagged("@error/PasskeyNotFound");
|
|
26
|
+
export const isNotFoundError = isTagged("@error/NotFound");
|
|
27
|
+
export const isInvalidEmailError = isTagged("@error/InvalidEmail");
|
|
28
|
+
export const isDuplicateEmailError = isTagged("@error/DuplicateEmail");
|
|
29
|
+
export const isBadRequestError = isTagged("@error/BadRequest");
|
|
30
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,QAAQ,GACZ,CAA6B,GAAc,EAAE,EAAE,CAC/C,CAAC,OAAgB,EAAgB,EAAE;IACjC,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAC7C,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,KAAK,CAAA;IAElC,IAAI,CAAC,CAAC,MAAM,IAAI,OAAO,CAAC;QAAE,OAAO,KAAK,CAAA;IACtC,IAAI,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IAClD,IAAI,OAAO,CAAC,IAAI,KAAK,GAAG;QAAE,OAAO,KAAK,CAAA;IAEtC,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAYH,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CACzC,qBAAqB,CACtB,CAAA;AAYD,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAiB,kBAAkB,CAAC,CAAA;AAY5E,MAAM,CAAC,MAAM,kBAAkB,GAC7B,QAAQ,CAAmB,oBAAoB,CAAC,CAAA;AAYlD,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CACzC,qBAAqB,CACtB,CAAA;AASD,MAAM,CAAC,MAAM,qBAAqB,GAAG,QAAQ,CAC3C,uBAAuB,CACxB,CAAA;AAiBD,MAAM,CAAC,MAAM,sBAAsB,GAAG,QAAQ,CAC5C,wBAAwB,CACzB,CAAA;AASD,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAgB,iBAAiB,CAAC,CAAA;AASzE,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CACzC,qBAAqB,CACtB,CAAA;AASD,MAAM,CAAC,MAAM,qBAAqB,GAAG,QAAQ,CAC3C,uBAAuB,CACxB,CAAA;AASD,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAkB,mBAAmB,CAAC,CAAA","sourcesContent":["/*\n * Publicly exposed errors.\n * The errors we receive from the API live in the schemas/errors.ts module.\n * The errors here have the same shape but they are simple types\n * so are easier for non Effect consumers to handle.\n */\n\nconst isTagged =\n <A extends { _tag: string }>(tag: A[\"_tag\"]) =>\n (payload: unknown): payload is A => {\n if (typeof payload !== \"object\") return false\n if (payload === null) return false\n\n if (!(\"_tag\" in payload)) return false\n if (typeof payload._tag !== \"string\") return false\n if (payload._tag !== tag) return false\n\n return true\n }\n\n/* Unauthorized */\n\n/**\n * @category Authentication\n */\nexport type UnauthorizedError = {\n _tag: \"@error/Unauthorized\"\n message: string\n}\n\nexport const isUnauthorizedError = isTagged<UnauthorizedError>(\n \"@error/Unauthorized\"\n)\n\n/* Forbidden */\n\n/**\n * @category Authentication\n */\nexport type ForbiddenError = {\n _tag: \"@error/Forbidden\"\n message: string\n}\n\nexport const isForbiddenError = isTagged<ForbiddenError>(\"@error/Forbidden\")\n\n/* InvalidCode */\n\n/**\n * @category Principal\n */\nexport type InvalidCodeError = {\n _tag: \"@error/InvalidCode\"\n message: string\n}\n\nexport const isInvalidCodeError =\n isTagged<InvalidCodeError>(\"@error/InvalidCode\")\n\n/* VerificationFailure */\n\n/**\n * @category Principal\n */\nexport type VerificationError = {\n _tag: \"@error/Verification\"\n message: string\n}\n\nexport const isVerificationError = isTagged<VerificationError>(\n \"@error/Verification\"\n)\n\n/* InvalidTenancy */\n\nexport type InvalidTenancyError = {\n _tag: \"@error/InvalidTenancy\"\n message: string\n}\n\nexport const isInvalidTenancyError = isTagged<InvalidTenancyError>(\n \"@error/InvalidTenancy\"\n)\n\n/* PasskeyNotFound */\n\n/**\n * Error payload returned when a passkey cannot be found for a given\n * authentication attempt.\n *\n * @category Passkeys\n */\nexport type PasskeyNotFoundError = {\n _tag: \"@error/PasskeyNotFound\"\n message: string\n credentialId: string\n rpId: string\n}\n\nexport const isPasskeyNotFoundError = isTagged<PasskeyNotFoundError>(\n \"@error/PasskeyNotFound\"\n)\n\n/* NotFound */\n\nexport type NotFoundError = {\n _tag: \"@error/NotFound\"\n message: string\n}\n\nexport const isNotFoundError = isTagged<NotFoundError>(\"@error/NotFound\")\n\n/* InvalidEmail */\n\nexport type InvalidEmailError = {\n _tag: \"@error/InvalidEmail\"\n message: string\n}\n\nexport const isInvalidEmailError = isTagged<InvalidEmailError>(\n \"@error/InvalidEmail\"\n)\n\n/* DuplicateEmail */\n\nexport type DuplicateEmailError = {\n _tag: \"@error/DuplicateEmail\"\n message: string\n}\n\nexport const isDuplicateEmailError = isTagged<DuplicateEmailError>(\n \"@error/DuplicateEmail\"\n)\n\n/* BadRequest */\n\nexport type BadRequestError = {\n _tag: \"@error/BadRequest\"\n message: string\n}\n\nexport const isBadRequestError = isTagged<BadRequestError>(\"@error/BadRequest\")\n"]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unsafe functions that could potentially throw errors.
|
|
3
|
+
*
|
|
4
|
+
* @categoryDescription Passkeys
|
|
5
|
+
* Functions and related types for managing passkeys
|
|
6
|
+
*
|
|
7
|
+
* @showCategories
|
|
8
|
+
*
|
|
9
|
+
* @module unsafe
|
|
10
|
+
*/
|
|
11
|
+
import type { AssignUserOptions, DeletePasskeyOptions, FindAllPasskeys, GetPasskeyOptions, ListPasskeyOptions, Passkey, UpdatedPasskeyUsernames, UpdatePasskeyOptions, UpdatePasskeyUsernamesOptions } from "./passkey/passkey.js";
|
|
12
|
+
import type { ExchangeCodeOptions, VerifyIdTokenOptions } from "./principal/principal.js";
|
|
13
|
+
import type { ExtendedPrincipal, Principal } from "./schemas/principal.js";
|
|
14
|
+
/**
|
|
15
|
+
* Call the Passlock backend API to assign a userId to an authenticator
|
|
16
|
+
*
|
|
17
|
+
* @param request
|
|
18
|
+
* @returns A promise resolving to the updated passkey.
|
|
19
|
+
* @throws {@link NotFoundError} if passkey does not exist
|
|
20
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
21
|
+
*
|
|
22
|
+
* @category Passkeys
|
|
23
|
+
*/
|
|
24
|
+
export declare const assignUser: (request: AssignUserOptions) => Promise<Passkey>;
|
|
25
|
+
/**
|
|
26
|
+
* Call the Passlock backend API to update passkey properties
|
|
27
|
+
*
|
|
28
|
+
* @param request
|
|
29
|
+
* @returns A promise resolving to the updated passkey.
|
|
30
|
+
* @throws {@link NotFoundError} if passkey does not exist
|
|
31
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
32
|
+
*
|
|
33
|
+
* @category Passkeys
|
|
34
|
+
*/
|
|
35
|
+
export declare const updatePasskey: (request: UpdatePasskeyOptions) => Promise<Passkey>;
|
|
36
|
+
/**
|
|
37
|
+
* Call the Passlock backend API to update all passkeys for a given user
|
|
38
|
+
*
|
|
39
|
+
* @param request
|
|
40
|
+
* @returns A promise resolving to updated usernames for matching passkeys.
|
|
41
|
+
* @throws {@link NotFoundError} if no passkeys are found for the given user
|
|
42
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
43
|
+
*
|
|
44
|
+
* @category Passkeys
|
|
45
|
+
*/
|
|
46
|
+
export declare const updatePasskeyUsernames: (request: UpdatePasskeyUsernamesOptions) => Promise<UpdatedPasskeyUsernames>;
|
|
47
|
+
/**
|
|
48
|
+
* Call the Passlock backend API to delete an authenticator
|
|
49
|
+
*
|
|
50
|
+
* @param options
|
|
51
|
+
* @returns A promise resolving to the deleted passkey.
|
|
52
|
+
* @throws {@link NotFoundError} if passkey does not exist
|
|
53
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
54
|
+
*
|
|
55
|
+
* @category Passkeys
|
|
56
|
+
*/
|
|
57
|
+
export declare const deletePasskey: (options: DeletePasskeyOptions) => Promise<Passkey>;
|
|
58
|
+
/**
|
|
59
|
+
* Call the Passlock backend API to fetch an authenticator
|
|
60
|
+
*
|
|
61
|
+
* @param options
|
|
62
|
+
* @returns A promise resolving to the passkey.
|
|
63
|
+
* @throws {@link NotFoundError} if passkey does not exist
|
|
64
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
65
|
+
*
|
|
66
|
+
* @category Passkeys
|
|
67
|
+
*/
|
|
68
|
+
export declare const getPasskey: (options: GetPasskeyOptions) => Promise<Passkey>;
|
|
69
|
+
/**
|
|
70
|
+
* List passkeys for the given tenancy. Note this could return a cursor,
|
|
71
|
+
* in which case the function should be called again with the given cursor.
|
|
72
|
+
*
|
|
73
|
+
* @param options
|
|
74
|
+
* @returns A promise resolving to a page of passkey summaries.
|
|
75
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
76
|
+
*
|
|
77
|
+
* @category Passkeys
|
|
78
|
+
*/
|
|
79
|
+
export declare const listPasskeys: (options: ListPasskeyOptions) => Promise<FindAllPasskeys>;
|
|
80
|
+
/**
|
|
81
|
+
* Call the Passlock backend API to exchange a code for an ExtendedPrincipal
|
|
82
|
+
*
|
|
83
|
+
* @param options
|
|
84
|
+
* @returns A promise resolving to an extended principal.
|
|
85
|
+
* @throws {@link InvalidCodeError} if the code is invalid or expired
|
|
86
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
87
|
+
*
|
|
88
|
+
* @category Principal
|
|
89
|
+
*/
|
|
90
|
+
export declare const exchangeCode: (options: ExchangeCodeOptions) => Promise<ExtendedPrincipal>;
|
|
91
|
+
/**
|
|
92
|
+
* Decode and verify a Passlock `id_token` (JWT).
|
|
93
|
+
* Note: This will make a network call to
|
|
94
|
+
* `https://api.passlock.dev/.well-known/jwks.json` (or your configured `endpoint`)
|
|
95
|
+
* to fetch the relevant public key. The response will be cached, however
|
|
96
|
+
* bear in mind that for something like AWS Lambda it will make the call on every
|
|
97
|
+
* cold start so might actually be slower than {@link exchangeCode}
|
|
98
|
+
*
|
|
99
|
+
* @param options
|
|
100
|
+
* @returns A promise resolving to the verified principal.
|
|
101
|
+
* @throws {@link VerificationError} if token verification fails
|
|
102
|
+
*
|
|
103
|
+
* @category Principal
|
|
104
|
+
*/
|
|
105
|
+
export declare const verifyIdToken: (options: VerifyIdTokenOptions) => Promise<Principal>;
|
|
106
|
+
export type { BadRequestError, DuplicateEmailError, ForbiddenError, InvalidCodeError, InvalidEmailError, InvalidTenancyError, NotFoundError, PasskeyNotFoundError, UnauthorizedError, VerificationError, } from "./errors.js";
|
|
107
|
+
export { isBadRequestError, isDuplicateEmailError, isForbiddenError, isInvalidCodeError, isInvalidEmailError, isInvalidTenancyError, isNotFoundError, isPasskeyNotFoundError, isUnauthorizedError, isVerificationError, } from "./errors.js";
|
|
108
|
+
export type { AssignUserOptions, Credential, DeletePasskeyOptions, FindAllPasskeys, GetPasskeyOptions, ListPasskeyOptions, Passkey, PasskeySummary, Platform, UpdatedPasskeys, UpdatedPasskeyUsernames, UpdatePasskeyOptions, UpdatePasskeyUsernamesOptions, } from "./passkey/passkey.js";
|
|
109
|
+
export { isPasskey, isPasskeySummary, isUpdatedPasskeys, isUpdatedPasskeyUsernames, } from "./passkey/passkey.js";
|
|
110
|
+
export type { ExchangeCodeOptions, VerifyIdTokenOptions, } from "./principal/principal.js";
|
|
111
|
+
export type { CredentialDeviceType, Transports, } from "./schemas/passkey.js";
|
|
112
|
+
export type { ExtendedPrincipal, Principal } from "./schemas/principal.js";
|
|
113
|
+
export { isExtendedPrincipal, isPrincipal } from "./schemas/principal.js";
|
|
114
|
+
export type { AuthenticatedOptions, PasslockOptions, } from "./shared.js";
|
|
115
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,OAAO,EACP,uBAAuB,EACvB,oBAAoB,EACpB,6BAA6B,EAC9B,MAAM,sBAAsB,CAAA;AAS7B,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,0BAA0B,CAAA;AAKjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAE1E;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,iBAAiB,KAAG,OAAO,CAAC,OAAO,CACxB,CAAA;AAE/C;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GACxB,SAAS,oBAAoB,KAC5B,OAAO,CAAC,OAAO,CAAqD,CAAA;AAEvE;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,6BAA6B,KACrC,OAAO,CAAC,uBAAuB,CACyB,CAAA;AAE3D;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GACxB,SAAS,oBAAoB,KAC5B,OAAO,CAAC,OAAO,CAAqD,CAAA;AAEvE;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,iBAAiB,KAAG,OAAO,CAAC,OAAO,CACxB,CAAA;AAE/C;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GACvB,SAAS,kBAAkB,KAC1B,OAA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
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unsafe functions that could potentially throw errors.
|
|
3
|
+
*
|
|
4
|
+
* @categoryDescription Passkeys
|
|
5
|
+
* Functions and related types for managing passkeys
|
|
6
|
+
*
|
|
7
|
+
* @showCategories
|
|
8
|
+
*
|
|
9
|
+
* @module unsafe
|
|
10
|
+
*/
|
|
11
|
+
import { Effect, pipe } from "effect";
|
|
12
|
+
import { assignUser as assignUserE, deletePasskey as deletePasskeyE, getPasskey as getPasskeyE, listPasskeys as listPasskeysE, updatePasskey as updatePasskeyE, updatePasskeyUsernames as updatePasskeyUsernamesE, } from "./passkey/passkey.js";
|
|
13
|
+
import { exchangeCode as exchangeCodeE, verifyIdToken as verifyIdTokenE, } from "./principal/principal.js";
|
|
14
|
+
/**
|
|
15
|
+
* Call the Passlock backend API to assign a userId to an authenticator
|
|
16
|
+
*
|
|
17
|
+
* @param request
|
|
18
|
+
* @returns A promise resolving to the updated passkey.
|
|
19
|
+
* @throws {@link NotFoundError} if passkey does not exist
|
|
20
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
21
|
+
*
|
|
22
|
+
* @category Passkeys
|
|
23
|
+
*/
|
|
24
|
+
export const assignUser = (request) => pipe(assignUserE(request), Effect.runPromise);
|
|
25
|
+
/**
|
|
26
|
+
* Call the Passlock backend API to update passkey properties
|
|
27
|
+
*
|
|
28
|
+
* @param request
|
|
29
|
+
* @returns A promise resolving to the updated passkey.
|
|
30
|
+
* @throws {@link NotFoundError} if passkey does not exist
|
|
31
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
32
|
+
*
|
|
33
|
+
* @category Passkeys
|
|
34
|
+
*/
|
|
35
|
+
export const updatePasskey = (request) => pipe(updatePasskeyE(request), Effect.runPromise);
|
|
36
|
+
/**
|
|
37
|
+
* Call the Passlock backend API to update all passkeys for a given user
|
|
38
|
+
*
|
|
39
|
+
* @param request
|
|
40
|
+
* @returns A promise resolving to updated usernames for matching passkeys.
|
|
41
|
+
* @throws {@link NotFoundError} if no passkeys are found for the given user
|
|
42
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
43
|
+
*
|
|
44
|
+
* @category Passkeys
|
|
45
|
+
*/
|
|
46
|
+
export const updatePasskeyUsernames = (request) => pipe(updatePasskeyUsernamesE(request), Effect.runPromise);
|
|
47
|
+
/**
|
|
48
|
+
* Call the Passlock backend API to delete an authenticator
|
|
49
|
+
*
|
|
50
|
+
* @param options
|
|
51
|
+
* @returns A promise resolving to the deleted passkey.
|
|
52
|
+
* @throws {@link NotFoundError} if passkey does not exist
|
|
53
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
54
|
+
*
|
|
55
|
+
* @category Passkeys
|
|
56
|
+
*/
|
|
57
|
+
export const deletePasskey = (options) => pipe(deletePasskeyE(options), Effect.runPromise);
|
|
58
|
+
/**
|
|
59
|
+
* Call the Passlock backend API to fetch an authenticator
|
|
60
|
+
*
|
|
61
|
+
* @param options
|
|
62
|
+
* @returns A promise resolving to the passkey.
|
|
63
|
+
* @throws {@link NotFoundError} if passkey does not exist
|
|
64
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
65
|
+
*
|
|
66
|
+
* @category Passkeys
|
|
67
|
+
*/
|
|
68
|
+
export const getPasskey = (options) => pipe(getPasskeyE(options), Effect.runPromise);
|
|
69
|
+
/**
|
|
70
|
+
* List passkeys for the given tenancy. Note this could return a cursor,
|
|
71
|
+
* in which case the function should be called again with the given cursor.
|
|
72
|
+
*
|
|
73
|
+
* @param options
|
|
74
|
+
* @returns A promise resolving to a page of passkey summaries.
|
|
75
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
76
|
+
*
|
|
77
|
+
* @category Passkeys
|
|
78
|
+
*/
|
|
79
|
+
export const listPasskeys = (options) => pipe(listPasskeysE(options), Effect.runPromise);
|
|
80
|
+
/**
|
|
81
|
+
* Call the Passlock backend API to exchange a code for an ExtendedPrincipal
|
|
82
|
+
*
|
|
83
|
+
* @param options
|
|
84
|
+
* @returns A promise resolving to an extended principal.
|
|
85
|
+
* @throws {@link InvalidCodeError} if the code is invalid or expired
|
|
86
|
+
* @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid
|
|
87
|
+
*
|
|
88
|
+
* @category Principal
|
|
89
|
+
*/
|
|
90
|
+
export const exchangeCode = (options) => pipe(exchangeCodeE(options), Effect.runPromise);
|
|
91
|
+
/**
|
|
92
|
+
* Decode and verify a Passlock `id_token` (JWT).
|
|
93
|
+
* Note: This will make a network call to
|
|
94
|
+
* `https://api.passlock.dev/.well-known/jwks.json` (or your configured `endpoint`)
|
|
95
|
+
* to fetch the relevant public key. The response will be cached, however
|
|
96
|
+
* bear in mind that for something like AWS Lambda it will make the call on every
|
|
97
|
+
* cold start so might actually be slower than {@link exchangeCode}
|
|
98
|
+
*
|
|
99
|
+
* @param options
|
|
100
|
+
* @returns A promise resolving to the verified principal.
|
|
101
|
+
* @throws {@link VerificationError} if token verification fails
|
|
102
|
+
*
|
|
103
|
+
* @category Principal
|
|
104
|
+
*/
|
|
105
|
+
export const verifyIdToken = (options) => pipe(verifyIdTokenE(options), Effect.runPromise);
|
|
106
|
+
export { isBadRequestError, isDuplicateEmailError, isForbiddenError, isInvalidCodeError, isInvalidEmailError, isInvalidTenancyError, isNotFoundError, isPasskeyNotFoundError, isUnauthorizedError, isVerificationError, } from "./errors.js";
|
|
107
|
+
export { isPasskey, isPasskeySummary, isUpdatedPasskeys, isUpdatedPasskeyUsernames, } from "./passkey/passkey.js";
|
|
108
|
+
export { isExtendedPrincipal, isPrincipal } from "./schemas/principal.js";
|
|
109
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAAE,IAAI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AAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;AAE9E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,OAA4B,EACA,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;AAEhF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,OAA6B,EACT,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,CAAA;AAgBzE,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,aAAa,CAAA;AAgBpB,OAAO,EACL,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAA;AAU7B,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA","sourcesContent":["/**\n * Unsafe functions that could potentially throw errors.\n *\n * @categoryDescription Passkeys\n * Functions and related types for managing passkeys\n *\n * @showCategories\n *\n * @module unsafe\n */\n\nimport { Effect, pipe } from \"effect\"\nimport type {\n AssignUserOptions,\n DeletePasskeyOptions,\n FindAllPasskeys,\n GetPasskeyOptions,\n ListPasskeyOptions,\n Passkey,\n UpdatedPasskeyUsernames,\n UpdatePasskeyOptions,\n UpdatePasskeyUsernamesOptions,\n} from \"./passkey/passkey.js\"\nimport {\n assignUser as assignUserE,\n deletePasskey as deletePasskeyE,\n getPasskey as getPasskeyE,\n listPasskeys as listPasskeysE,\n updatePasskey as updatePasskeyE,\n updatePasskeyUsernames as updatePasskeyUsernamesE,\n} from \"./passkey/passkey.js\"\nimport type {\n ExchangeCodeOptions,\n VerifyIdTokenOptions,\n} from \"./principal/principal.js\"\nimport {\n exchangeCode as exchangeCodeE,\n verifyIdToken as verifyIdTokenE,\n} from \"./principal/principal.js\"\nimport type { ExtendedPrincipal, Principal } from \"./schemas/principal.js\"\n\n/**\n * Call the Passlock backend API to assign a userId to an authenticator\n *\n * @param request\n * @returns A promise resolving to the updated passkey.\n * @throws {@link NotFoundError} if passkey does not exist\n * @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid\n *\n * @category Passkeys\n */\nexport const assignUser = (request: AssignUserOptions): Promise<Passkey> =>\n pipe(assignUserE(request), Effect.runPromise)\n\n/**\n * Call the Passlock backend API to update passkey properties\n *\n * @param request\n * @returns A promise resolving to the updated passkey.\n * @throws {@link NotFoundError} if passkey does not exist\n * @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid\n *\n * @category Passkeys\n */\nexport const updatePasskey = (\n request: UpdatePasskeyOptions\n): Promise<Passkey> => pipe(updatePasskeyE(request), Effect.runPromise)\n\n/**\n * Call the Passlock backend API to update all passkeys for a given user\n *\n * @param request\n * @returns A promise resolving to updated usernames for matching passkeys.\n * @throws {@link NotFoundError} if no passkeys are found for the given user\n * @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid\n *\n * @category Passkeys\n */\nexport const updatePasskeyUsernames = (\n request: UpdatePasskeyUsernamesOptions\n): Promise<UpdatedPasskeyUsernames> =>\n pipe(updatePasskeyUsernamesE(request), Effect.runPromise)\n\n/**\n * Call the Passlock backend API to delete an authenticator\n *\n * @param options\n * @returns A promise resolving to the deleted passkey.\n * @throws {@link NotFoundError} if passkey does not exist\n * @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid\n *\n * @category Passkeys\n */\nexport const deletePasskey = (\n options: DeletePasskeyOptions\n): Promise<Passkey> => pipe(deletePasskeyE(options), Effect.runPromise)\n\n/**\n * Call the Passlock backend API to fetch an authenticator\n *\n * @param options\n * @returns A promise resolving to the passkey.\n * @throws {@link NotFoundError} if passkey does not exist\n * @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid\n *\n * @category Passkeys\n */\nexport const getPasskey = (options: GetPasskeyOptions): Promise<Passkey> =>\n pipe(getPasskeyE(options), Effect.runPromise)\n\n/**\n * List passkeys for the given tenancy. Note this could return a cursor,\n * in which case the function should be called again with the given cursor.\n *\n * @param options\n * @returns A promise resolving to a page of passkey summaries.\n * @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid\n *\n * @category Passkeys\n */\nexport const listPasskeys = (\n options: ListPasskeyOptions\n): Promise<FindAllPasskeys> => pipe(listPasskeysE(options), Effect.runPromise)\n\n/**\n * Call the Passlock backend API to exchange a code for an ExtendedPrincipal\n *\n * @param options\n * @returns A promise resolving to an extended principal.\n * @throws {@link InvalidCodeError} if the code is invalid or expired\n * @throws {@link ForbiddenError} if the Tenancy ID or API key is invalid\n *\n * @category Principal\n */\nexport const exchangeCode = (\n options: ExchangeCodeOptions\n): Promise<ExtendedPrincipal> => pipe(exchangeCodeE(options), Effect.runPromise)\n\n/**\n * Decode and verify a Passlock `id_token` (JWT).\n * Note: This will make a network call to\n * `https://api.passlock.dev/.well-known/jwks.json` (or your configured `endpoint`)\n * to fetch the relevant public key. The response will be cached, however\n * bear in mind that for something like AWS Lambda it will make the call on every\n * cold start so might actually be slower than {@link exchangeCode}\n *\n * @param options\n * @returns A promise resolving to the verified principal.\n * @throws {@link VerificationError} if token verification fails\n *\n * @category Principal\n */\nexport const verifyIdToken = (\n options: VerifyIdTokenOptions\n): Promise<Principal> => pipe(verifyIdTokenE(options), Effect.runPromise)\n\n/* Re-exports */\n\nexport type {\n BadRequestError,\n DuplicateEmailError,\n ForbiddenError,\n InvalidCodeError,\n InvalidEmailError,\n InvalidTenancyError,\n NotFoundError,\n PasskeyNotFoundError,\n UnauthorizedError,\n VerificationError,\n} from \"./errors.js\"\nexport {\n isBadRequestError,\n isDuplicateEmailError,\n isForbiddenError,\n isInvalidCodeError,\n isInvalidEmailError,\n isInvalidTenancyError,\n isNotFoundError,\n isPasskeyNotFoundError,\n isUnauthorizedError,\n isVerificationError,\n} from \"./errors.js\"\nexport type {\n AssignUserOptions,\n Credential,\n DeletePasskeyOptions,\n FindAllPasskeys,\n GetPasskeyOptions,\n ListPasskeyOptions,\n Passkey,\n PasskeySummary,\n Platform,\n UpdatedPasskeys,\n UpdatedPasskeyUsernames,\n UpdatePasskeyOptions,\n UpdatePasskeyUsernamesOptions,\n} from \"./passkey/passkey.js\"\nexport {\n isPasskey,\n isPasskeySummary,\n isUpdatedPasskeys,\n isUpdatedPasskeyUsernames,\n} from \"./passkey/passkey.js\"\nexport type {\n ExchangeCodeOptions,\n VerifyIdTokenOptions,\n} from \"./principal/principal.js\"\nexport type {\n CredentialDeviceType,\n Transports,\n} from \"./schemas/passkey.js\"\nexport type { ExtendedPrincipal, Principal } from \"./schemas/principal.js\"\nexport { isExtendedPrincipal, isPrincipal } from \"./schemas/principal.js\"\nexport type {\n AuthenticatedOptions,\n PasslockOptions,\n} from \"./shared.js\"\n"]}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from "effect";
|
|
2
|
+
/**
|
|
3
|
+
* Supported HTTP methods accepted by {@link fetchNetwork}.
|
|
4
|
+
*/
|
|
5
|
+
export type NetworkMethod = "get" | "post" | "delete" | "patch";
|
|
6
|
+
/**
|
|
7
|
+
* Lightweight response model used by this package.
|
|
8
|
+
*
|
|
9
|
+
* Invariants:
|
|
10
|
+
* - `json` is lazy: parsing only happens when the effect is run.
|
|
11
|
+
* - `json` is memoized per response wrapper, so repeated evaluation does not
|
|
12
|
+
* parse the same payload multiple times.
|
|
13
|
+
*/
|
|
14
|
+
export interface NetworkResponse {
|
|
15
|
+
readonly status: number;
|
|
16
|
+
readonly statusText: string;
|
|
17
|
+
readonly statusMessage: string;
|
|
18
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
19
|
+
readonly json: Effect.Effect<unknown, NetworkResponseError>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Accepted request header input formats.
|
|
23
|
+
*/
|
|
24
|
+
export type NetworkHeaders = Headers | Readonly<Record<string, string>> | Array<[string, string]>;
|
|
25
|
+
/**
|
|
26
|
+
* Optional request options for {@link fetchNetwork}.
|
|
27
|
+
*/
|
|
28
|
+
export interface FetchNetworkOptions {
|
|
29
|
+
readonly headers?: NetworkHeaders;
|
|
30
|
+
}
|
|
31
|
+
declare const NetworkFetch_base: Context.TagClass<NetworkFetch, "NetworkFetch", typeof fetch>;
|
|
32
|
+
/**
|
|
33
|
+
* Effect service tag for the fetch implementation.
|
|
34
|
+
*
|
|
35
|
+
* Supply this service with `Effect.provide` / layers to swap fetch behavior
|
|
36
|
+
* in tests or alternate runtimes.
|
|
37
|
+
*/
|
|
38
|
+
export declare class NetworkFetch extends NetworkFetch_base {
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Default live fetch layer backed by `globalThis.fetch`.
|
|
42
|
+
*/
|
|
43
|
+
export declare const NetworkFetchLive: Layer.Layer<NetworkFetch>;
|
|
44
|
+
/**
|
|
45
|
+
* HTTP status buckets used by {@link matchStatus}.
|
|
46
|
+
*/
|
|
47
|
+
export type NetworkResponseStatusCase = "2xx" | "3xx" | "4xx" | "5xx";
|
|
48
|
+
type MatchStatusHandler<Resp extends NetworkResponse = NetworkResponse, A = unknown, E = unknown> = (response: Resp) => Effect.Effect<A, E, never>;
|
|
49
|
+
type HandlerEffect<Cases extends MatchStatusCases<Resp>, Resp extends NetworkResponse, Case extends NetworkResponseStatusCase | "orElse"> = Case extends keyof Cases ? NonNullable<Cases[Case]> extends MatchStatusHandler<Resp> ? ReturnType<NonNullable<Cases[Case]>> : never : never;
|
|
50
|
+
type MatchStatusEffectUnion<Cases extends MatchStatusCases<Resp>, Resp extends NetworkResponse> = HandlerEffect<Cases, Resp, "2xx"> | HandlerEffect<Cases, Resp, "3xx"> | HandlerEffect<Cases, Resp, "4xx"> | HandlerEffect<Cases, Resp, "5xx"> | HandlerEffect<Cases, Resp, "orElse">;
|
|
51
|
+
type EffectSuccess<T> = T extends Effect.Effect<infer A, unknown, unknown> ? A : never;
|
|
52
|
+
type EffectError<T> = T extends Effect.Effect<unknown, infer E, unknown> ? E : never;
|
|
53
|
+
type EffectContext<T> = T extends Effect.Effect<unknown, unknown, infer R> ? R : never;
|
|
54
|
+
/**
|
|
55
|
+
* Handlers used by {@link matchStatus}.
|
|
56
|
+
*
|
|
57
|
+
* Invariants:
|
|
58
|
+
* - `orElse` is always required.
|
|
59
|
+
* - Specific status family handlers are optional and fall back to `orElse`
|
|
60
|
+
* when missing.
|
|
61
|
+
*/
|
|
62
|
+
export interface MatchStatusCases<Resp extends NetworkResponse = NetworkResponse> {
|
|
63
|
+
readonly "2xx"?: MatchStatusHandler<Resp>;
|
|
64
|
+
readonly "3xx"?: MatchStatusHandler<Resp>;
|
|
65
|
+
readonly "4xx"?: MatchStatusHandler<Resp>;
|
|
66
|
+
readonly "5xx"?: MatchStatusHandler<Resp>;
|
|
67
|
+
readonly orElse: MatchStatusHandler<Resp>;
|
|
68
|
+
}
|
|
69
|
+
declare const NetworkRequestError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
70
|
+
readonly _tag: "@error/NetworkRequest";
|
|
71
|
+
} & Readonly<A>;
|
|
72
|
+
/**
|
|
73
|
+
* Raised when the underlying fetch call fails before a response is received.
|
|
74
|
+
*/
|
|
75
|
+
export declare class NetworkRequestError extends NetworkRequestError_base<{
|
|
76
|
+
readonly method: NetworkMethod;
|
|
77
|
+
readonly url: string;
|
|
78
|
+
readonly message: string;
|
|
79
|
+
}> {
|
|
80
|
+
}
|
|
81
|
+
declare const NetworkPayloadError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
82
|
+
readonly _tag: "@error/NetworkPayload";
|
|
83
|
+
} & Readonly<A>;
|
|
84
|
+
/**
|
|
85
|
+
* Raised when request payload serialization fails.
|
|
86
|
+
*/
|
|
87
|
+
export declare class NetworkPayloadError extends NetworkPayloadError_base<{
|
|
88
|
+
readonly method: NetworkMethod;
|
|
89
|
+
readonly message: string;
|
|
90
|
+
}> {
|
|
91
|
+
}
|
|
92
|
+
declare const NetworkResponseError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
93
|
+
readonly _tag: "@error/NetworkResponse";
|
|
94
|
+
} & Readonly<A>;
|
|
95
|
+
/**
|
|
96
|
+
* Raised when response body parsing fails.
|
|
97
|
+
*/
|
|
98
|
+
export declare class NetworkResponseError extends NetworkResponseError_base<{
|
|
99
|
+
readonly method: NetworkMethod;
|
|
100
|
+
readonly url: string;
|
|
101
|
+
readonly message: string;
|
|
102
|
+
}> {
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Convert an HTTP status code into its status family bucket.
|
|
106
|
+
*
|
|
107
|
+
* Returns `undefined` for codes outside the 2xx-5xx families.
|
|
108
|
+
*/
|
|
109
|
+
export declare const statusToCase: (status: number) => NetworkResponseStatusCase | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Route a {@link NetworkResponse} to the first matching status-family handler.
|
|
112
|
+
*
|
|
113
|
+
* Invariants:
|
|
114
|
+
* - `2xx`/`3xx`/`4xx`/`5xx` handlers are matched by status family.
|
|
115
|
+
* - `orElse` is always used as a fallback when no specific family handler exists.
|
|
116
|
+
* - The returned effect type is inferred as the union of all handler effects.
|
|
117
|
+
*/
|
|
118
|
+
export declare const matchStatus: <Resp extends NetworkResponse, Cases extends MatchStatusCases<Resp>>(response: Resp, cases: Cases) => Effect.Effect<EffectSuccess<MatchStatusEffectUnion<Cases, Resp>>, EffectError<MatchStatusEffectUnion<Cases, Resp>>, EffectContext<MatchStatusEffectUnion<Cases, Resp>>>;
|
|
119
|
+
/**
|
|
120
|
+
* Convert `Headers` into a readonly plain record.
|
|
121
|
+
*/
|
|
122
|
+
export declare const headersToRecord: (headers: Headers) => Readonly<Record<string, string>>;
|
|
123
|
+
/**
|
|
124
|
+
* Execute a fetch request using the injected {@link NetworkFetch} service.
|
|
125
|
+
*
|
|
126
|
+
* Invariants:
|
|
127
|
+
* - method is always normalized to upper-case before dispatch.
|
|
128
|
+
* - JSON payload (if present) is serialized before request execution.
|
|
129
|
+
* - caller headers override payload-derived headers when keys overlap.
|
|
130
|
+
* - the returned `NetworkResponse.json` remains lazy.
|
|
131
|
+
*/
|
|
132
|
+
export declare const fetchNetwork: (url: string | URL, method: NetworkMethod, payload?: unknown, options?: FetchNetworkOptions) => Effect.Effect<NetworkResponse, NetworkRequestError | NetworkPayloadError, NetworkFetch>;
|
|
133
|
+
export {};
|
|
134
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAQ,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAErD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;AAE/D;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAA;CAC5D;AAED;;GAEG;AACH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