@pisti-paypiller/backend 0.0.0-stage → 0.7.1
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/LICENSE +21 -0
- package/README.md +133 -2
- package/dist/errors.d.ts +6 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +11 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/keys.d.ts +12 -0
- package/dist/keys.d.ts.map +1 -0
- package/dist/keys.js +45 -0
- package/dist/keys.js.map +1 -0
- package/dist/management-types.d.ts +311 -0
- package/dist/management-types.d.ts.map +1 -0
- package/dist/management-types.js +2 -0
- package/dist/management-types.js.map +1 -0
- package/dist/management.d.ts +162 -0
- package/dist/management.d.ts.map +1 -0
- package/dist/management.js +432 -0
- package/dist/management.js.map +1 -0
- package/dist/tokens.d.ts +43 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +458 -0
- package/dist/tokens.js.map +1 -0
- package/dist/types.d.ts +170 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/webhooks.d.ts +94 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +117 -0
- package/dist/webhooks.js.map +1 -0
- package/package.json +43 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pisti
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,134 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @pisti-paypiller/backend
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The framework-free Pisti server SDK, shaped like `@clerk/backend`: authenticate any Fetch API
|
|
4
|
+
`Request` (session cookies with the handshake, session tokens, API keys, M2M and OAuth tokens),
|
|
5
|
+
call the backend API and verify webhooks. Express apps should use
|
|
6
|
+
[`@pisti-paypiller/express`](../express/README.md), which is built on this package.
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { createPistiClient } from "@pisti-paypiller/backend";
|
|
10
|
+
|
|
11
|
+
const pisti = createPistiClient({
|
|
12
|
+
secretKey: process.env.PISTI_SECRET_KEY,
|
|
13
|
+
publishableKey: process.env.PISTI_PUBLISHABLE_KEY,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// Next.js route handler, Hono, Bun.serve, Deno, Cloudflare Workers…
|
|
17
|
+
export async function GET(request: Request) {
|
|
18
|
+
const state = await pisti.authenticateRequest(request, {
|
|
19
|
+
authorizedParties: ["https://app.example.com"],
|
|
20
|
+
});
|
|
21
|
+
if (state.status === "handshake") return new Response(null, { status: 307, headers: state.headers });
|
|
22
|
+
if (!state.isAuthenticated) return new Response("Unauthorized", { status: 401 });
|
|
23
|
+
const { userId } = state.toAuth();
|
|
24
|
+
return Response.json(await pisti.users.getUser(userId));
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
| Export | What it does | Clerk equivalent |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| `createPistiClient(options?)` | A `PistiClient` with `authenticateRequest()`, `verifyToken()` and the backend API resources | `createClerkClient()` |
|
|
31
|
+
| `authenticateRequest(request, options?)` | Returns a `RequestState`: `status` (`signed-in`, `signed-out`, `handshake`), `isAuthenticated`, `reason`, `headers`, `toAuth()`. Never throws for a bad token. | `authenticateRequest()` |
|
|
32
|
+
| `verifyToken(token, options?)` | Verifies a session token and returns its claims, or throws `PistiError` (401, `token_expired` or `invalid_token`) | `verifyToken()` |
|
|
33
|
+
| `verifyWebhook(request, options?)` | Verifies a webhook from a Fetch `Request` (or `{ body, headers }`) and returns a typed event | `verifyWebhook()` |
|
|
34
|
+
| `parsePublishableKey(key)` | Decodes the Frontend API URL from a publishable key | — |
|
|
35
|
+
|
|
36
|
+
Requires Node.js 22.12 or later, or any runtime with `fetch` and Web Crypto.
|
|
37
|
+
|
|
38
|
+
## Configuration
|
|
39
|
+
|
|
40
|
+
Every option falls back to an environment variable:
|
|
41
|
+
|
|
42
|
+
| Option | Variable | Used for |
|
|
43
|
+
| --- | --- | --- |
|
|
44
|
+
| `publishableKey` | `PISTI_PUBLISHABLE_KEY` | Finding the issuer and checking the token's environment. Required. |
|
|
45
|
+
| `secretKey` | `PISTI_SECRET_KEY` | The backend API and verifying API keys |
|
|
46
|
+
| `jwtKey` | `PISTI_JWT_KEY` | Networkless verification with the PEM public key from the console (API keys → JWT public key). Without it, signing keys are fetched once and cached. |
|
|
47
|
+
| `authorizedParties` | `PISTI_AUTHORIZED_PARTIES` (comma-separated) | Origins allowed to have requested session tokens. Recommended in production. |
|
|
48
|
+
| `signingSecret` (webhooks) | `PISTI_WEBHOOK_SIGNING_SECRET` | Webhook signatures |
|
|
49
|
+
|
|
50
|
+
## Authenticating requests
|
|
51
|
+
|
|
52
|
+
`authenticateRequest` reads `Authorization: Bearer` first, then the `__session` cookie.
|
|
53
|
+
|
|
54
|
+
**Session cookies and the handshake.** `@pisti-paypiller/react` keeps `__session` (a 60-second session
|
|
55
|
+
token) and `__client_uat` (the last sign-in time) on your origin. When a page request arrives
|
|
56
|
+
with an expired or missing session cookie but `__client_uat` says the visitor is signed in, the
|
|
57
|
+
state is `status: "handshake"`: respond with a `307` and `state.headers`. The browser goes through
|
|
58
|
+
your environment's Frontend API, which refreshes the cookie and returns to the same URL, so
|
|
59
|
+
server-rendered pages never show a signed-in visitor as signed out. API requests are never
|
|
60
|
+
redirected; they are signed out until the browser SDK refreshes the cookie.
|
|
61
|
+
|
|
62
|
+
**Token types.** `acceptsToken` chooses what a route accepts, like Clerk:
|
|
63
|
+
|
|
64
|
+
| `acceptsToken` | Token | `toAuth()` |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| `"session_token"` (default) | Session token from `@pisti-paypiller/react` | `userId`, `sessionId`, `orgId`, `orgRole`, `orgSlug`, `orgPermissions`, `sessionClaims`, `factorVerificationAge`, `has()`, `getToken()` |
|
|
67
|
+
| `"api_key"` | An end user's `ak_…` key, created with `<APIKeys />`; verified with the backend API, and a successful verification is reused for up to 10 seconds per process | `id`, `name`, `subject`, `userId`, `scopes`, `claims` |
|
|
68
|
+
| `"m2m_token"` | Client-credentials token from a confidential OAuth application | `id`, `subject`, `machineId`, `scopes`, `claims` |
|
|
69
|
+
| `"oauth_token"` | Access token Pisti issued to an OAuth application for a user | `id`, `userId`, `clientId`, `scopes`, `claims` |
|
|
70
|
+
| an array or `"any"` | Any of those | Narrow with `tokenType` |
|
|
71
|
+
|
|
72
|
+
A token of a type the route doesn't accept is signed out with `reason: "token-type-mismatch"`.
|
|
73
|
+
|
|
74
|
+
`has({ permission, role, reverification })` on session auth objects matches Clerk's, including
|
|
75
|
+
the reverification presets `"strict_mfa"`, `"strict"`, `"moderate"` and `"lax"` or
|
|
76
|
+
`{ level, afterMinutes }`.
|
|
77
|
+
|
|
78
|
+
## Backend API
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
import { createPistiClient, PistiManagementError } from "@pisti-paypiller/backend";
|
|
82
|
+
|
|
83
|
+
const pisti = createPistiClient();
|
|
84
|
+
const user = await pisti.users.getUser(userId);
|
|
85
|
+
const { items, nextCursor } = await pisti.users.getUserList({ limit: 50, search: "alex" });
|
|
86
|
+
const total = await pisti.users.getCount({ status: "active" });
|
|
87
|
+
const { items: sessions } = await pisti.sessions.getSessionList({ userId, status: "active" });
|
|
88
|
+
await pisti.apiKeys.revokeApiKey(keyId, { revocationReason: "Leaked in a log" });
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
| Resource | Methods |
|
|
92
|
+
| --- | --- |
|
|
93
|
+
| `users` | `getUserList`, `getUserListAll`, `getCount`, `getUser`, `createUser`, `updateUser`, `deleteUser`, `banUser`, `unbanUser`, `lockUser`, `unlockUser`, `getUserEmailAddressList`, `addEmailAddress`, `setEmailVerification`, `setPrimaryEmail`, `removeEmailAddress`, `getUserExternalAccountList` |
|
|
94
|
+
| `sessions` | `getSessionList({ userId, status })`, `getSession`, `revokeSession` |
|
|
95
|
+
| `apiKeys` | `getApiKeyList({ userId, includeRevoked })`, `getApiKey`, `updateApiKey(id, { scopes, claims })`, `revokeApiKey`, `verifySecret` |
|
|
96
|
+
| `organizations` | `getOrganizationList`, `getOrganization`, `createOrganization`, `updateOrganization`, `deleteOrganization`, `getOrganizationMembershipList`, `updateOrganizationMembership`, `deleteOrganizationMembership`, `getOrganizationInvitationList`, `createOrganizationInvitation`, `reissueOrganizationInvitation`, `revokeOrganizationInvitation`, `getRoleList`, `createRole`, `updateRole`, `deleteRole`, `getPermissionList` |
|
|
97
|
+
| `webhooks` | `catalog`, `endpoints`, `createEndpoint`, `updateEndpoint`, `archiveEndpoint`, `rotateSecret`, `sendTest`, `deliveries`, `delivery`, `replay` |
|
|
98
|
+
| `externalProviders` | `list`, `create`, `update`, `delete` |
|
|
99
|
+
|
|
100
|
+
`getUser`, `getUserList` and `createUser` return the same `User`: `id`, `firstName`, `lastName`,
|
|
101
|
+
`fullName`, `imageUrl`, `hasImage`, `primaryEmailAddressId`, `emailAddresses`, `status`,
|
|
102
|
+
`banned`, `locked`, the metadata objects and timestamps. `getInstance()` returns the
|
|
103
|
+
environment, including its `jwtKey`.
|
|
104
|
+
|
|
105
|
+
Pass `{ signal }` to cancel; `timeoutMs` defaults to 10 seconds; mutations are never retried
|
|
106
|
+
automatically. Errors are `PistiManagementError` with `status`, `requestId`, `code`,
|
|
107
|
+
`fieldErrors`, `blockers` and `retryAfterSeconds`. The client refuses to run in a browser.
|
|
108
|
+
Secret keys cannot create API keys, confidential OAuth applications or client secrets; those
|
|
109
|
+
need a signed-in user or console member.
|
|
110
|
+
|
|
111
|
+
## Webhooks
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
import { verifyWebhook } from "@pisti-paypiller/backend/webhooks";
|
|
115
|
+
|
|
116
|
+
export async function POST(request: Request) {
|
|
117
|
+
try {
|
|
118
|
+
const event = await verifyWebhook(request);
|
|
119
|
+
if (event.type === "organizationMembership.created") await addMember(event.data.organization_id, event.data.user_id);
|
|
120
|
+
return new Response(null, { status: 204 });
|
|
121
|
+
} catch {
|
|
122
|
+
return new Response("Invalid signature", { status: 400 });
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`PistiWebhookEvent` is a union keyed by `type`, so checking `event.type` narrows `event.data`.
|
|
128
|
+
Events are thin: `data` holds the resource's ID and references; read the current state with
|
|
129
|
+
the backend API. Verification checks the HMAC-SHA256 signature and timestamp (five minutes'
|
|
130
|
+
tolerance) on the raw body. Pass `{ signingSecret: [current, previous] }` while rotating and
|
|
131
|
+
`{ expectedInstanceId }` to pin events to one environment. Store `event.id` to ignore
|
|
132
|
+
duplicates.
|
|
133
|
+
|
|
134
|
+
See `sdk.md` in the pisti-docs repository for how the pieces fit.
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,qBAAa,UAAW,SAAQ,KAAK;aAEb,MAAM,EAAE,MAAM;aAEd,IAAI,EAAE,MAAM,GAAG,IAAI;IAHvC,YACoB,MAAM,EAAE,MAAM,EAC9B,OAAO,EAAE,MAAM,EACC,IAAI,GAAE,MAAM,GAAG,IAAW,EAI7C;CACJ"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,MAAM,OAAO,UAAW,SAAQ,KAAK;IAEb,MAAM;IAEN,IAAI;IAHxB,YACoB,MAAc,EAC9B,OAAe,EACC,IAAI,GAAkB,IAAI;QAE1C,KAAK,CAAC,OAAO,CAAC,CAAC;sBAJC,MAAM;oBAEN,IAAI;QAGpB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC7B,CAAC;CACJ"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { createPistiClient, PistiClient, PistiManagementError } from "./management.js";
|
|
2
|
+
export { verifyToken, authenticateRequest, authObject, signedOutAuthObject, unauthenticatedObject, acceptedTokenTypes, tokenFrom, readCookie, SESSION_COOKIE, CLIENT_UAT_COOKIE, HANDSHAKE_PARAMETER, } from "./tokens.js";
|
|
3
|
+
export { verifyWebhook, verifyWebhookPayload, PistiWebhookError } from "./webhooks.js";
|
|
4
|
+
export type { PistiWebhookEvent, VerifyWebhookOptions, UserEventData, SessionEventData, OrganizationEventData, OrganizationMembershipEventData, OrganizationInvitationEventData, } from "./webhooks.js";
|
|
5
|
+
export { parsePublishableKey } from "./keys.js";
|
|
6
|
+
export type { PublishableKeyInfo } from "./keys.js";
|
|
7
|
+
export { PistiError } from "./errors.js";
|
|
8
|
+
export type * from "./management-types.js";
|
|
9
|
+
export type { AuthObject, SignedInAuthObject, SignedOutAuthObject, SessionClaims, CheckAuthorizationParams, ReverificationLevel, RequestState, VerifyTokenOptions, AuthenticateRequestOptions, TokenType, AcceptsToken, AnyAuthObject, AuthObjectFor, ApiKeyAuthObject, M2MAuthObject, OAuthAuthObject, AuthenticatedApiKey, AuthenticatedM2MToken, AuthenticatedOAuthToken, UnauthenticatedMachineObject, } from "./types.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EACH,WAAW,EACX,mBAAmB,EACnB,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,mBAAmB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvF,YAAY,EACR,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EACrB,+BAA+B,EAC/B,+BAA+B,GAClC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,mBAAmB,uBAAuB,CAAC;AAC3C,YAAY,EACR,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,wBAAwB,EACxB,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,0BAA0B,EAC1B,SAAS,EACT,YAAY,EACZ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,GAC/B,MAAM,YAAY,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { createPistiClient, PistiClient, PistiManagementError } from "./management.js";
|
|
2
|
+
export { verifyToken, authenticateRequest, authObject, signedOutAuthObject, unauthenticatedObject, acceptedTokenTypes, tokenFrom, readCookie, SESSION_COOKIE, CLIENT_UAT_COOKIE, HANDSHAKE_PARAMETER, } from "./tokens.js";
|
|
3
|
+
export { verifyWebhook, verifyWebhookPayload, PistiWebhookError } from "./webhooks.js";
|
|
4
|
+
export { parsePublishableKey } from "./keys.js";
|
|
5
|
+
export { PistiError } from "./errors.js";
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EACH,WAAW,EACX,mBAAmB,EACnB,UAAU,EACV,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,mBAAmB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAUvF,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/keys.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface PublishableKeyInfo {
|
|
2
|
+
environment: "test" | "live";
|
|
3
|
+
/** The environment's Frontend API, for example https://api.pisti.com/v1/fapi/fa_123. */
|
|
4
|
+
frontendApi: URL;
|
|
5
|
+
frontendApiId: string;
|
|
6
|
+
/** The token issuer whose published keys sign session tokens. */
|
|
7
|
+
issuer: URL;
|
|
8
|
+
}
|
|
9
|
+
/** Publishable keys are `pk_test_` or `pk_live_` followed by the base64url Frontend API URL and a `$`. */
|
|
10
|
+
export declare function parsePublishableKey(key: string): PublishableKeyInfo;
|
|
11
|
+
export declare function trustedUrl(value: string, development: boolean): URL;
|
|
12
|
+
//# sourceMappingURL=keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../src/keys.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IAC/B,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,wFAAwF;IACxF,WAAW,EAAE,GAAG,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,MAAM,EAAE,GAAG,CAAC;CACf;AAED,0GAA0G;AAC1G,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAqCnE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,GAAG,CAmBnE"}
|
package/dist/keys.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** Publishable keys are `pk_test_` or `pk_live_` followed by the base64url Frontend API URL and a `$`. */
|
|
2
|
+
export function parsePublishableKey(key) {
|
|
3
|
+
const match = typeof key === "string"
|
|
4
|
+
? /^pk_(test|live)_([A-Za-z0-9_-]+)$/.exec(key.trim())
|
|
5
|
+
: null;
|
|
6
|
+
if (!match)
|
|
7
|
+
throw new Error("Provide a Pisti publishable key that starts with pk_test_ or pk_live_.");
|
|
8
|
+
let decoded;
|
|
9
|
+
try {
|
|
10
|
+
decoded = Buffer.from(match[2], "base64url").toString("utf8");
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
throw new Error("The publishable key is malformed.");
|
|
14
|
+
}
|
|
15
|
+
if (!decoded.endsWith("$"))
|
|
16
|
+
throw new Error("The publishable key is malformed.");
|
|
17
|
+
const frontendApi = new URL(decoded.slice(0, -1));
|
|
18
|
+
const segments = frontendApi.pathname.split("/").filter(Boolean);
|
|
19
|
+
const frontendApiId = segments.at(-1) ?? "";
|
|
20
|
+
if (segments.length < 3 ||
|
|
21
|
+
segments.at(-2) !== "fapi" ||
|
|
22
|
+
segments.at(-3) !== "v1" ||
|
|
23
|
+
!/^[A-Za-z0-9_-]{3,64}$/.test(frontendApiId))
|
|
24
|
+
throw new Error("The publishable key is malformed.");
|
|
25
|
+
const environment = match[1];
|
|
26
|
+
trustedUrl(frontendApi.origin, environment === "test");
|
|
27
|
+
const issuer = new URL(frontendApi.pathname.slice(0, frontendApi.pathname.length - `v1/fapi/${frontendApiId}`.length), frontendApi.origin);
|
|
28
|
+
return { environment, frontendApi, frontendApiId, issuer };
|
|
29
|
+
}
|
|
30
|
+
export function trustedUrl(value, development) {
|
|
31
|
+
if (typeof value !== "string" || value.length > 2048)
|
|
32
|
+
throw new Error("Provide a URL of at most 2048 characters.");
|
|
33
|
+
const url = new URL(value);
|
|
34
|
+
const loopback = ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname) ||
|
|
35
|
+
url.hostname.endsWith(".localhost");
|
|
36
|
+
if (url.username ||
|
|
37
|
+
url.password ||
|
|
38
|
+
url.search ||
|
|
39
|
+
url.hash ||
|
|
40
|
+
(url.protocol !== "https:" &&
|
|
41
|
+
!(development && loopback && url.protocol === "http:")))
|
|
42
|
+
throw new Error("Pisti URLs must use HTTPS; development keys also allow http://localhost.");
|
|
43
|
+
return url;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=keys.js.map
|
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
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
export interface ManagementClientOptions {
|
|
2
|
+
/** Defaults to `PISTI_SECRET_KEY`. Needed only for the management API. Never expose it in browser code. */
|
|
3
|
+
secretKey?: string | undefined;
|
|
4
|
+
/** Defaults to `PISTI_PUBLISHABLE_KEY`; it tells the client where Pisti is. */
|
|
5
|
+
publishableKey?: string | undefined;
|
|
6
|
+
/** Origins allowed to have requested session tokens. Defaults to `PISTI_AUTHORIZED_PARTIES`. */
|
|
7
|
+
authorizedParties?: string[] | undefined;
|
|
8
|
+
timeoutMs?: number | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface ManagedInstance {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
environment: "development" | "staging" | "production";
|
|
14
|
+
audience: string;
|
|
15
|
+
publishableKey: string;
|
|
16
|
+
/** PEM public key for networkless session token verification (`jwtKey`). */
|
|
17
|
+
jwtKey: string;
|
|
18
|
+
signupEnabled: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** An end user's API key. Users create their own with `<APIKeys />`; your backend lists them, grants scopes and
|
|
21
|
+
* claims, revokes and verifies them. A key created before its owner's last credential change reads as revoked. */
|
|
22
|
+
export interface ApiKey {
|
|
23
|
+
id: string;
|
|
24
|
+
object: "api_key";
|
|
25
|
+
type: "api_key";
|
|
26
|
+
name: string;
|
|
27
|
+
description: string | null;
|
|
28
|
+
/** The user who owns the key. */
|
|
29
|
+
subject: string;
|
|
30
|
+
userId: string;
|
|
31
|
+
/** The first characters of the secret, to help users recognise a key. */
|
|
32
|
+
keyPrefix: string;
|
|
33
|
+
scopes: string[];
|
|
34
|
+
claims: Record<string, unknown> | null;
|
|
35
|
+
revoked: boolean;
|
|
36
|
+
revocationReason: string | null;
|
|
37
|
+
expired: boolean;
|
|
38
|
+
expiresAt: string | null;
|
|
39
|
+
lastUsedAt: string | null;
|
|
40
|
+
createdAt: string;
|
|
41
|
+
}
|
|
42
|
+
/** Replaces a key's scopes and claims. */
|
|
43
|
+
export interface UpdateApiKeyInput {
|
|
44
|
+
scopes: string[];
|
|
45
|
+
/** A JSON object of at most 4096 bytes. */
|
|
46
|
+
claims?: Record<string, unknown> | null;
|
|
47
|
+
}
|
|
48
|
+
export interface ApiKeyListOptions extends ManagementRequestOptions {
|
|
49
|
+
userId?: string;
|
|
50
|
+
includeRevoked?: boolean;
|
|
51
|
+
limit?: number;
|
|
52
|
+
cursor?: string;
|
|
53
|
+
}
|
|
54
|
+
export interface ManagementRequestOptions {
|
|
55
|
+
signal?: AbortSignal;
|
|
56
|
+
}
|
|
57
|
+
export interface ManagementListOptions extends ManagementRequestOptions {
|
|
58
|
+
limit?: number;
|
|
59
|
+
cursor?: string;
|
|
60
|
+
search?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface ManagementPage<T> {
|
|
63
|
+
items: T[];
|
|
64
|
+
nextCursor: string | null;
|
|
65
|
+
hasMore: boolean;
|
|
66
|
+
}
|
|
67
|
+
export type UserStatus = "active" | "disabled" | "locked";
|
|
68
|
+
export type Metadata = Record<string, unknown>;
|
|
69
|
+
export interface EmailAddress {
|
|
70
|
+
id: string;
|
|
71
|
+
object: "email_address";
|
|
72
|
+
emailAddress: string;
|
|
73
|
+
verification: {
|
|
74
|
+
status: "verified" | "unverified";
|
|
75
|
+
verifiedAt: string | null;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/** The same shape from getUser(), getUserList() and createUser(), like Clerk's User. */
|
|
79
|
+
export interface User {
|
|
80
|
+
id: string;
|
|
81
|
+
object: "user";
|
|
82
|
+
instanceId: string;
|
|
83
|
+
firstName: string;
|
|
84
|
+
lastName: string;
|
|
85
|
+
fullName: string | null;
|
|
86
|
+
imageUrl: string | null;
|
|
87
|
+
hasImage: boolean;
|
|
88
|
+
primaryEmailAddressId: string | null;
|
|
89
|
+
emailAddresses: EmailAddress[];
|
|
90
|
+
status: UserStatus;
|
|
91
|
+
banned: boolean;
|
|
92
|
+
locked: boolean;
|
|
93
|
+
publicMetadata: Metadata;
|
|
94
|
+
privateMetadata: Metadata;
|
|
95
|
+
unsafeMetadata: Metadata;
|
|
96
|
+
lastSignInAt: string | null;
|
|
97
|
+
tokensValidAfter: string;
|
|
98
|
+
createdAt: string;
|
|
99
|
+
updatedAt: string;
|
|
100
|
+
}
|
|
101
|
+
export interface CreateUserInput {
|
|
102
|
+
email: string;
|
|
103
|
+
/** Set true only when your trusted source has already verified ownership. Defaults to false. */
|
|
104
|
+
emailVerified?: boolean;
|
|
105
|
+
/** Required for verified creation. Describe the trusted verification source (10–500 characters). */
|
|
106
|
+
verificationReason?: string;
|
|
107
|
+
firstName?: string;
|
|
108
|
+
lastName?: string;
|
|
109
|
+
password?: string;
|
|
110
|
+
imageUrl?: string | null;
|
|
111
|
+
publicMetadata?: Metadata;
|
|
112
|
+
privateMetadata?: Metadata;
|
|
113
|
+
unsafeMetadata?: Metadata;
|
|
114
|
+
}
|
|
115
|
+
export interface UpdateUserInput {
|
|
116
|
+
expectedUpdatedAt: string;
|
|
117
|
+
firstName: string;
|
|
118
|
+
lastName: string;
|
|
119
|
+
imageUrl?: string | null;
|
|
120
|
+
publicMetadata: Metadata;
|
|
121
|
+
privateMetadata: Metadata;
|
|
122
|
+
unsafeMetadata: Metadata;
|
|
123
|
+
}
|
|
124
|
+
export interface DirectoryExternalAccount {
|
|
125
|
+
id: string;
|
|
126
|
+
provider: string;
|
|
127
|
+
providerAccountId: string;
|
|
128
|
+
email: string | null;
|
|
129
|
+
createdAt: string;
|
|
130
|
+
}
|
|
131
|
+
export type SessionStatus = "active" | "revoked" | "expired";
|
|
132
|
+
export interface Session {
|
|
133
|
+
id: string;
|
|
134
|
+
object: "session";
|
|
135
|
+
userId: string;
|
|
136
|
+
status: SessionStatus;
|
|
137
|
+
lastActiveAt: string;
|
|
138
|
+
/** When the session ends if it stays idle. */
|
|
139
|
+
expireAt: string;
|
|
140
|
+
/** When the session ends regardless of activity. */
|
|
141
|
+
abandonAt: string;
|
|
142
|
+
authenticatedAt: string;
|
|
143
|
+
mfaAuthenticatedAt: string | null;
|
|
144
|
+
revokedAt: string | null;
|
|
145
|
+
createdAt: string;
|
|
146
|
+
}
|
|
147
|
+
export interface SessionListOptions extends ManagementRequestOptions {
|
|
148
|
+
userId?: string;
|
|
149
|
+
status?: SessionStatus;
|
|
150
|
+
limit?: number;
|
|
151
|
+
cursor?: string;
|
|
152
|
+
}
|
|
153
|
+
export interface ManagedOrganization {
|
|
154
|
+
id: string;
|
|
155
|
+
instanceId: string;
|
|
156
|
+
name: string;
|
|
157
|
+
slug: string;
|
|
158
|
+
imageUrl: string | null;
|
|
159
|
+
maxMemberships: number | null;
|
|
160
|
+
publicMetadata: Metadata;
|
|
161
|
+
createdAt: string;
|
|
162
|
+
updatedAt: string;
|
|
163
|
+
}
|
|
164
|
+
export interface CreateOrganizationInput {
|
|
165
|
+
name: string;
|
|
166
|
+
slug: string;
|
|
167
|
+
imageUrl?: string | null;
|
|
168
|
+
maxMemberships?: number | null;
|
|
169
|
+
publicMetadata?: Metadata;
|
|
170
|
+
privateMetadata?: Metadata;
|
|
171
|
+
}
|
|
172
|
+
export interface UpdateOrganizationInput extends CreateOrganizationInput {
|
|
173
|
+
expectedUpdatedAt: string;
|
|
174
|
+
}
|
|
175
|
+
export interface ManagedOrganizationMember {
|
|
176
|
+
id: string;
|
|
177
|
+
userId: string;
|
|
178
|
+
email: string;
|
|
179
|
+
roleId: string;
|
|
180
|
+
roleKey: string;
|
|
181
|
+
createdAt: string;
|
|
182
|
+
}
|
|
183
|
+
export interface ManagedInvitation {
|
|
184
|
+
id: string;
|
|
185
|
+
email: string;
|
|
186
|
+
roleId: string;
|
|
187
|
+
status: "pending" | "accepted" | "expired" | "revoked";
|
|
188
|
+
expiresAt: string;
|
|
189
|
+
createdAt: string;
|
|
190
|
+
acceptedAt: string | null;
|
|
191
|
+
}
|
|
192
|
+
export interface InvitationResult {
|
|
193
|
+
id: string;
|
|
194
|
+
token: string;
|
|
195
|
+
expiresAt: string;
|
|
196
|
+
deliveryStatus: "queued";
|
|
197
|
+
queuedAt: string;
|
|
198
|
+
}
|
|
199
|
+
export interface ManagedRole {
|
|
200
|
+
id: string;
|
|
201
|
+
key: string;
|
|
202
|
+
name: string;
|
|
203
|
+
description: string | null;
|
|
204
|
+
isSystem: boolean;
|
|
205
|
+
permissions: string[];
|
|
206
|
+
}
|
|
207
|
+
export interface RoleInput {
|
|
208
|
+
key: string;
|
|
209
|
+
name: string;
|
|
210
|
+
description?: string | null;
|
|
211
|
+
permissionIds: string[];
|
|
212
|
+
}
|
|
213
|
+
export interface ManagedPermission {
|
|
214
|
+
id: string;
|
|
215
|
+
key: string;
|
|
216
|
+
name: string;
|
|
217
|
+
description: string | null;
|
|
218
|
+
isSystem: boolean;
|
|
219
|
+
}
|
|
220
|
+
export interface DeletionBlocker {
|
|
221
|
+
resource: string;
|
|
222
|
+
count: number;
|
|
223
|
+
resolution: string;
|
|
224
|
+
}
|
|
225
|
+
export interface ManagedExternalProvider {
|
|
226
|
+
id: string;
|
|
227
|
+
name: string;
|
|
228
|
+
displayName: string;
|
|
229
|
+
issuerUrl: string;
|
|
230
|
+
clientId: string;
|
|
231
|
+
secretConfigured: boolean;
|
|
232
|
+
enabled: boolean;
|
|
233
|
+
allowSignup: boolean;
|
|
234
|
+
connectedAccounts: number;
|
|
235
|
+
callbackUrl: string;
|
|
236
|
+
updatedAt: string;
|
|
237
|
+
}
|
|
238
|
+
export interface ExternalProviderInput {
|
|
239
|
+
name: string;
|
|
240
|
+
displayName: string;
|
|
241
|
+
issuerUrl: string;
|
|
242
|
+
clientId: string;
|
|
243
|
+
enabled: boolean;
|
|
244
|
+
allowSignup: boolean;
|
|
245
|
+
clientSecret?: string;
|
|
246
|
+
}
|
|
247
|
+
export interface CreateExternalProviderInput extends ExternalProviderInput {
|
|
248
|
+
clientSecret: string;
|
|
249
|
+
}
|
|
250
|
+
export interface UpdateExternalProviderInput extends ExternalProviderInput {
|
|
251
|
+
expectedUpdatedAt: string;
|
|
252
|
+
}
|
|
253
|
+
export type WebhookEventType = "user.created" | "user.updated" | "user.deleted" | "session.created" | "session.ended" | "organization.created" | "organization.updated" | "organization.deleted" | "organizationMembership.created" | "organizationMembership.updated" | "organizationMembership.deleted" | "organizationInvitation.created" | "organizationInvitation.updated" | "organizationInvitation.accepted" | "organizationInvitation.revoked" | "organizationInvitation.expired";
|
|
254
|
+
export interface WebhookEndpointInput {
|
|
255
|
+
name: string;
|
|
256
|
+
url: string;
|
|
257
|
+
eventTypes: WebhookEventType[];
|
|
258
|
+
enabled: boolean;
|
|
259
|
+
}
|
|
260
|
+
export interface UpdateWebhookEndpointInput extends WebhookEndpointInput {
|
|
261
|
+
expectedUpdatedAt: string;
|
|
262
|
+
}
|
|
263
|
+
export interface ManagedWebhookEndpoint extends WebhookEndpointInput {
|
|
264
|
+
id: string;
|
|
265
|
+
createdAt: string;
|
|
266
|
+
updatedAt: string;
|
|
267
|
+
}
|
|
268
|
+
export interface WebhookSecretResult {
|
|
269
|
+
endpoint: ManagedWebhookEndpoint;
|
|
270
|
+
signingSecret: string;
|
|
271
|
+
}
|
|
272
|
+
export type WebhookDeliveryStatus = "pending" | "sending" | "retrying" | "delivered" | "failed" | "cancelled";
|
|
273
|
+
export interface WebhookDeliveryListOptions extends ManagementRequestOptions {
|
|
274
|
+
limit?: number;
|
|
275
|
+
cursor?: string;
|
|
276
|
+
endpointId?: string;
|
|
277
|
+
status?: WebhookDeliveryStatus;
|
|
278
|
+
}
|
|
279
|
+
export interface ManagedWebhookDelivery {
|
|
280
|
+
id: string;
|
|
281
|
+
eventId: string;
|
|
282
|
+
eventType: string;
|
|
283
|
+
endpointId: string;
|
|
284
|
+
endpointName: string;
|
|
285
|
+
status: WebhookDeliveryStatus;
|
|
286
|
+
attempts: number;
|
|
287
|
+
replayCount: number;
|
|
288
|
+
createdAt: string;
|
|
289
|
+
lastAttemptAt: string | null;
|
|
290
|
+
nextAttemptAt: string;
|
|
291
|
+
deadlineAt: string;
|
|
292
|
+
lastStatusCode: number | null;
|
|
293
|
+
lastErrorCode: string | null;
|
|
294
|
+
deliveredAt: string | null;
|
|
295
|
+
}
|
|
296
|
+
export interface WebhookDeliveryDetails {
|
|
297
|
+
payload: import("./webhooks.js").PistiWebhookEvent;
|
|
298
|
+
status: WebhookDeliveryStatus;
|
|
299
|
+
attemptCount: number;
|
|
300
|
+
/** The most recent 100 attempts, including interrupted attempts without a result. */
|
|
301
|
+
attempts: WebhookDeliveryAttempt[];
|
|
302
|
+
}
|
|
303
|
+
export interface WebhookDeliveryAttempt {
|
|
304
|
+
number: number;
|
|
305
|
+
startedAt: string;
|
|
306
|
+
completedAt: string | null;
|
|
307
|
+
statusCode: number | null;
|
|
308
|
+
errorCode: string | null;
|
|
309
|
+
durationMilliseconds: number | null;
|
|
310
|
+
}
|
|
311
|
+
//# sourceMappingURL=management-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"management-types.d.ts","sourceRoot":"","sources":["../src/management-types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACpC,2GAA2G;IAC3G,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,gGAAgG;IAChG,iBAAiB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,aAAa,GAAG,SAAS,GAAG,YAAY,CAAC;IACtD,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;CAC1B;AAED;kHACkH;AAClH,MAAM,WA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