@protobase/server 0.68.6 → 0.69.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/dist/better-auth/auth-settings.d.ts +155 -28
- package/dist/better-auth/auth-settings.js +3 -2
- package/dist/better-auth/connections/connection-account-hooks.js +62 -0
- package/dist/better-auth/connections/connection-events.d.ts +11 -0
- package/dist/better-auth/connections/connection-events.js +16 -0
- package/dist/better-auth/connections/connection-oauth-provider.js +129 -0
- package/dist/better-auth/connections/connections-plugin.js +98 -0
- package/dist/better-auth/connections/declared-connections.d.ts +21 -0
- package/dist/better-auth/connections/declared-connections.js +54 -0
- package/dist/better-auth/connections/revoke-token.js +34 -0
- package/dist/better-auth/create-auth.d.ts +162 -17
- package/dist/better-auth/create-auth.js +59 -5
- package/dist/better-auth/refresh-refusals.js +43 -0
- package/dist/better-auth/staff-checks.js +1 -0
- package/dist/notifications/history-routes.js +1 -1
- package/dist/package.js +1 -1
- package/dist/personal-mail/linked-accounts.js +17 -13
- package/dist/types.d.ts +2 -0
- package/dist/view-access.js +2 -1
- package/dist/webhooks/attempt.js +2 -2
- package/dist/webhooks/table/webhook-table.js +1 -1
- package/dist/workflows/connections/connection-accounts.js +18 -0
- package/dist/workflows/connections/connection-consent.js +49 -0
- package/dist/workflows/connections/connection-provider.js +10 -0
- package/dist/workflows/connections/connection-tokens.js +54 -0
- package/dist/workflows/connections/connection-triggers.js +37 -0
- package/dist/workflows/connections/connection-wiring.js +73 -0
- package/dist/workflows/connections/enabler-authority.js +35 -0
- package/dist/workflows/connections/enabler-mailbox.js +15 -0
- package/dist/workflows/connections/single-flight.js +17 -0
- package/dist/workflows/hooks/issue-webhook.js +3 -20
- package/dist/workflows/may-update-workflow.js +26 -0
- package/dist/workflows/mcp/webhook-tools.js +10 -3
- package/dist/workflows/save-hook.js +7 -2
- package/dist/workflows/schema-sql.js +3 -1
- package/dist/workflows/schema.js +1 -1
- package/dist/workflows/triggers/plugin-call.js +19 -9
- package/dist/workflows/triggers/poll-job.js +7 -7
- package/dist/workflows/triggers/trigger-jobs.js +23 -7
- package/dist/workflows/triggers/trigger-start.js +16 -5
- package/dist/workflows/triggers/trigger-sync.js +15 -10
- package/dist/workflows/workflow-engine.js +20 -5
- package/dist/workflows/workflow-types.d.ts +7 -3
- package/dist/workflows/workflow-types.js +12 -12
- package/dist/write-shared.js +1 -0
- package/package.json +6 -6
- package/dist/better-auth/end-replaced-session.d.ts +0 -17
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { callPlugin, redactAlso,
|
|
1
|
+
import { callPlugin, redactAlso, triggerCall } from "./plugin-call.js";
|
|
2
2
|
import { stateProblem } from "./poll-result.js";
|
|
3
3
|
import { hookMode } from "../hooks/hook-secrets.js";
|
|
4
4
|
import { hookPath } from "../hooks/hook-paths.js";
|
|
@@ -47,7 +47,8 @@ const triggerStarts = (input, jobs) => {
|
|
|
47
47
|
const due = first.value;
|
|
48
48
|
let cursor = state.cursor;
|
|
49
49
|
if (!state.has_cursor) {
|
|
50
|
-
const
|
|
50
|
+
const call = triggerCall(input, trigger, signal, redact);
|
|
51
|
+
const outcome = await callPlugin(() => type.start(call.context), call.redact);
|
|
51
52
|
if (!("value" in outcome)) return startFailed(db, schema, trigger, outcome, state.consecutive_failures, restart);
|
|
52
53
|
const problem = stateProblem(outcome.value);
|
|
53
54
|
if (problem) return startFailed(db, schema, trigger, { failed: `The start ${problem}` }, state.consecutive_failures, restart);
|
|
@@ -63,7 +64,16 @@ const triggerStarts = (input, jobs) => {
|
|
|
63
64
|
const type = input.webhooks(trigger.type);
|
|
64
65
|
const state = type?.subscribe && await stateOf(db, schema, trigger);
|
|
65
66
|
const mode = hookMode(trigger.input);
|
|
66
|
-
if (!type?.subscribe || !state
|
|
67
|
+
if (!type?.subscribe || !state) return;
|
|
68
|
+
if (state.has_store) {
|
|
69
|
+
if (!type.renew) return;
|
|
70
|
+
const now = /* @__PURE__ */ new Date();
|
|
71
|
+
return saveStart(db, schema, trigger, "store", null, now, (trx) => jobs.renew.enqueue(trx, {
|
|
72
|
+
trigger: trigger.id,
|
|
73
|
+
generation: trigger.generation,
|
|
74
|
+
due: now.toISOString()
|
|
75
|
+
}, { runAt: now }));
|
|
76
|
+
}
|
|
67
77
|
const origin = input.origin();
|
|
68
78
|
if (!origin || !mode) return startFailed(db, schema, trigger, { failed: origin ? "The trigger names an auth mode the app does not know" : "The app has no public address to subscribe with: give its auth a baseURL" }, state.consecutive_failures, restart);
|
|
69
79
|
const { key, secret } = await saveHook(db, schema, {
|
|
@@ -77,11 +87,12 @@ const triggerStarts = (input, jobs) => {
|
|
|
77
87
|
secret,
|
|
78
88
|
secret.replace(/^whsec_/, "")
|
|
79
89
|
], redact);
|
|
90
|
+
const call = triggerCall(input, trigger, signal, hidden);
|
|
80
91
|
const outcome = await callPlugin(() => subscribe({
|
|
81
|
-
...
|
|
92
|
+
...call.context,
|
|
82
93
|
url: `${origin}${hookPath(input.systemPath(), key)}`,
|
|
83
94
|
secret
|
|
84
|
-
}),
|
|
95
|
+
}), call.redact);
|
|
85
96
|
if (!("value" in outcome)) return startFailed(db, schema, trigger, outcome, state.consecutive_failures, restart);
|
|
86
97
|
const problem = stateProblem(outcome.value);
|
|
87
98
|
if (problem) return startFailed(db, schema, trigger, { failed: `The subscription ${problem}` }, state.consecutive_failures, restart);
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
import { badRequest } from "../../problem.js";
|
|
2
2
|
import { sql } from "kysely";
|
|
3
3
|
//#region src/workflows/triggers/trigger-sync.ts
|
|
4
|
-
const triggerOf = (definition) => {
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const triggerOf = (definition, connectionOf) => {
|
|
5
|
+
const document = definition;
|
|
6
|
+
const [type, input] = Object.entries(document.trigger)[0];
|
|
7
|
+
if (type === "manual") return;
|
|
8
|
+
const key = connectionOf[type];
|
|
9
|
+
return {
|
|
7
10
|
type,
|
|
8
|
-
input
|
|
11
|
+
input,
|
|
12
|
+
connection: key !== void 0 && document.connections?.[key] || null
|
|
9
13
|
};
|
|
10
14
|
};
|
|
11
15
|
/**
|
|
12
16
|
* Keeps a workflow's trigger row in step with its enabled version, in the write's transaction, queueing its jobs in that
|
|
13
17
|
* same write: turning it on inserts a running trigger and queues its start; a new version with the same type and input
|
|
14
18
|
* keeps the row, so its state carries over, and passes over the records again; any other change, or turning it off, stops the old row and starts a new one.
|
|
15
|
-
*
|
|
19
|
+
* The row keeps the account the trigger's connection binds (`connectionOf` names each type's connection), so an
|
|
20
|
+
* expired sign-in stops every trigger on it, and connecting it again resumes them. Only the current version can be turned on.
|
|
16
21
|
*/
|
|
17
|
-
const syncTrigger = async (trx, schema, jobs, workflow) => {
|
|
22
|
+
const syncTrigger = async (trx, schema, jobs, workflow, connectionOf = {}) => {
|
|
18
23
|
const enabled = workflow.enabled_version;
|
|
19
24
|
if (enabled !== null && enabled !== workflow.version) throw badRequest("invalid-workflow", `Only the current version can be enabled: set enabled_version to ${String(workflow.version)}, or clear it to turn the workflow off`);
|
|
20
|
-
const wanted = enabled === null ? void 0 : triggerOf(workflow.definition);
|
|
25
|
+
const wanted = enabled === null ? void 0 : triggerOf(workflow.definition, connectionOf);
|
|
21
26
|
const triggers = sql.id(schema, "triggers");
|
|
22
27
|
const id = String(workflow.id);
|
|
23
|
-
const { rows } = await sql`select id, generation, version, (type = ${wanted?.type ?? null} and input = ${JSON.stringify(wanted?.input ?? null)}::jsonb and connection_id is null) as same
|
|
28
|
+
const { rows } = await sql`select id, generation, version, (type = ${wanted?.type ?? null} and input = ${JSON.stringify(wanted?.input ?? null)}::jsonb and connection_id is not distinct from ${wanted?.connection ?? null}::text) as same
|
|
24
29
|
from ${triggers} where workflow_id = ${id} and status <> 'stopping'`.execute(trx);
|
|
25
30
|
const existing = rows[0];
|
|
26
31
|
if (existing?.same) {
|
|
@@ -37,8 +42,8 @@ const syncTrigger = async (trx, schema, jobs, workflow) => {
|
|
|
37
42
|
await jobs.stop.enqueue(trx, { trigger: existing.id });
|
|
38
43
|
}
|
|
39
44
|
if (!wanted) return;
|
|
40
|
-
const trigger = (await sql`insert into ${triggers} (workflow_id, version, tenant_id, type, input, status, generation, consecutive_failures)
|
|
41
|
-
values (${id}, ${enabled}, ${workflow.tenant_id ?? null}, ${wanted.type}, ${JSON.stringify(wanted.input)}::jsonb, 'active', 1, 0) returning id`.execute(trx)).rows[0].id;
|
|
45
|
+
const trigger = (await sql`insert into ${triggers} (workflow_id, version, tenant_id, type, input, connection_id, status, generation, consecutive_failures)
|
|
46
|
+
values (${id}, ${enabled}, ${workflow.tenant_id ?? null}, ${wanted.type}, ${JSON.stringify(wanted.input)}::jsonb, ${wanted.connection}, 'active', 1, 0) returning id`.execute(trx)).rows[0].id;
|
|
42
47
|
await jobs.start.enqueue(trx, {
|
|
43
48
|
trigger,
|
|
44
49
|
generation: 1
|
|
@@ -9,6 +9,9 @@ import { issueRoute } from "./hooks/issue-route.js";
|
|
|
9
9
|
import { workflowDeleteHook } from "./triggers/delete-hook.js";
|
|
10
10
|
import { triggerJobs } from "./triggers/trigger-jobs.js";
|
|
11
11
|
import { workflowTypes } from "./workflow-types.js";
|
|
12
|
+
import { betterAuthConnectionAccounts } from "./connections/connection-accounts.js";
|
|
13
|
+
import { connectionWiring } from "./connections/connection-wiring.js";
|
|
14
|
+
import { connectionTriggers } from "./connections/connection-triggers.js";
|
|
12
15
|
import { secretRedactor } from "@protobase/workflows";
|
|
13
16
|
//#region src/workflows/workflow-engine.ts
|
|
14
17
|
/**
|
|
@@ -21,17 +24,28 @@ const workflowEngine = (options, deps, auth) => {
|
|
|
21
24
|
const schema = workflowsSchema(options);
|
|
22
25
|
const roles = options.savedByRoles ?? (auth && betterAuthOwnerRoles(auth));
|
|
23
26
|
if (!roles) throw new Error("workflows act on records as each workflow's last editor, with their current roles: give the config `auth` (Better Auth), or `workflows.savedByRoles`");
|
|
27
|
+
const secrets = workflowSecrets(options, globalThis.process?.env ?? {});
|
|
28
|
+
const types = workflowTypes(options.plugins, (name) => deps().registry.find(name)?.model, auth?.connectionSupport);
|
|
29
|
+
const accounts = auth && betterAuthConnectionAccounts(auth);
|
|
30
|
+
const connections = connectionWiring({
|
|
31
|
+
deps,
|
|
32
|
+
schema,
|
|
33
|
+
roles,
|
|
34
|
+
accounts,
|
|
35
|
+
plugins: types.plugins,
|
|
36
|
+
connectionOf: types.connections,
|
|
37
|
+
...auth && auth.personalMail.length > 0 && { personalMailer: auth.personalMailer }
|
|
38
|
+
});
|
|
24
39
|
const input = {
|
|
25
40
|
deps,
|
|
26
41
|
schema,
|
|
27
42
|
roles,
|
|
28
|
-
allowPrivateAddresses: Boolean(options.allowPrivateAddresses)
|
|
43
|
+
allowPrivateAddresses: Boolean(options.allowPrivateAddresses),
|
|
44
|
+
connect: connections.trigger
|
|
29
45
|
};
|
|
30
|
-
const secrets = workflowSecrets(options, globalThis.process?.env ?? {});
|
|
31
|
-
const types = workflowTypes(options.plugins, (name) => deps().registry.find(name)?.model);
|
|
32
46
|
const { runner, job } = workflowsRunner({
|
|
33
47
|
schema,
|
|
34
|
-
tasks: (context) => types.tasks(input, context.mail),
|
|
48
|
+
tasks: (context) => types.tasks(input, context.mail, connections.step, connections.mailbox),
|
|
35
49
|
secrets
|
|
36
50
|
});
|
|
37
51
|
const redactor = secretRedactor(Object.values(secrets));
|
|
@@ -46,6 +60,7 @@ const workflowEngine = (options, deps, auth) => {
|
|
|
46
60
|
origin: () => auth?.origins[0],
|
|
47
61
|
systemPath: () => deps().systemPath
|
|
48
62
|
});
|
|
63
|
+
auth?.connections.events.set(connectionTriggers(() => deps().db, schema, triggers));
|
|
49
64
|
const webhooks = usable(types.webhooks);
|
|
50
65
|
const issue = {
|
|
51
66
|
deps,
|
|
@@ -68,7 +83,7 @@ const workflowEngine = (options, deps, auth) => {
|
|
|
68
83
|
},
|
|
69
84
|
issue,
|
|
70
85
|
hooks: [
|
|
71
|
-
workflowSaveHook(schema, types.check, triggers),
|
|
86
|
+
workflowSaveHook(schema, types.check, triggers, connections.consent),
|
|
72
87
|
workflowDeleteHook(schema, triggers),
|
|
73
88
|
runStartHook(runner, deps, schema)
|
|
74
89
|
],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Mailer } from "../mail/mail-message.js";
|
|
2
2
|
import { ServicesInput } from "./plugin-services.js";
|
|
3
3
|
import { ResourceModel } from "@protobase/schema";
|
|
4
|
-
import { CheckOptions, LoadedPlugin, TaskHandlers } from "@protobase/workflows";
|
|
4
|
+
import { CheckOptions, ConnectionSupport, LoadedPlugin, StepWiring, TaskHandlers } from "@protobase/workflows";
|
|
5
5
|
import { Plugin, PollingTrigger, ReadyTrigger, WebhookTrigger } from "@protobase/workflows/plugin";
|
|
6
6
|
//#region src/workflows/workflow-types.d.ts
|
|
7
7
|
type Models = (name: string) => ResourceModel | undefined;
|
|
@@ -9,16 +9,20 @@ type Models = (name: string) => ResourceModel | undefined;
|
|
|
9
9
|
* The trigger and step types of an app: the built-in plugin, `app`, then the app's own, all through the same loader and
|
|
10
10
|
* interface. `types` is the list the MCP tools and the editor read; `check` is what a save checks a definition against,
|
|
11
11
|
* the available types only, and `checkWith` the same check against other resources, such as those a caller may read.
|
|
12
|
+
* A type that signs in is available once the app can make its connection, as `support` says.
|
|
12
13
|
*/
|
|
13
|
-
export declare const workflowTypes: (loaded?: readonly LoadedPlugin[], models?: Models) => {
|
|
14
|
+
export declare const workflowTypes: (loaded?: readonly LoadedPlugin[], models?: Models, support?: ConnectionSupport) => {
|
|
14
15
|
plugins: Plugin[];
|
|
15
16
|
types: import("@protobase/workflows").TypeEntry[];
|
|
16
17
|
check: CheckOptions;
|
|
17
18
|
checkWith: (against: Models) => CheckOptions;
|
|
18
|
-
tasks: (input: ServicesInput, mail: Mailer | undefined) => TaskHandlers;
|
|
19
|
+
tasks: (input: ServicesInput, mail: Mailer | undefined, connection: StepWiring["connection"], mailbox?: StepWiring["mailbox"]) => TaskHandlers;
|
|
19
20
|
ready: Map<string, ReadyTrigger>;
|
|
20
21
|
polling: Map<string, PollingTrigger>;
|
|
21
22
|
webhooks: Map<string, WebhookTrigger>;
|
|
23
|
+
connections: {
|
|
24
|
+
[k: string]: string;
|
|
25
|
+
};
|
|
22
26
|
available: (id: string) => boolean;
|
|
23
27
|
};
|
|
24
28
|
export type WorkflowTypes = ReturnType<typeof workflowTypes>;
|
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { pluginServices } from "./plugin-services.js";
|
|
2
2
|
import { readyProblems } from "./ready/ready-check.js";
|
|
3
|
-
import { loadPlugins, stepHandlers, triggerChecks, typeList } from "@protobase/workflows";
|
|
4
|
-
import { ConnectionError } from "@protobase/workflows/plugin";
|
|
3
|
+
import { connectionUnavailable, loadPlugins, stepHandlers, triggerChecks, typeList } from "@protobase/workflows";
|
|
5
4
|
import { appPlugin } from "@protobase/workflow-plugins";
|
|
6
5
|
//#region src/workflows/workflow-types.ts
|
|
7
|
-
const unavailable = (type) => {
|
|
8
|
-
if (type.connection) return "It signs in through a connection, which this app cannot make yet";
|
|
9
|
-
};
|
|
10
|
-
const noConnection = (stepId, name) => ({ accessToken: () => Promise.reject(new ConnectionError("not_connected", `${stepId} signs in through "${name}", and this workflow has no sign-in for it`)) });
|
|
11
6
|
const requiredInputs = (input) => Array.isArray(input.required) ? input.required : [];
|
|
12
7
|
/** The triggers of `plugins` of one kind, by id. */
|
|
13
8
|
const triggersOfKind = (plugins, kind) => new Map(plugins.flatMap((plugin) => Object.entries(plugin.triggers ?? {}).flatMap(([key, type]) => type.kind === kind ? [[`${plugin.name}:${key}`, type]] : [])));
|
|
@@ -17,13 +12,15 @@ const readyTriggers = (plugins) => triggersOfKind(plugins, "ready");
|
|
|
17
12
|
* The trigger and step types of an app: the built-in plugin, `app`, then the app's own, all through the same loader and
|
|
18
13
|
* interface. `types` is the list the MCP tools and the editor read; `check` is what a save checks a definition against,
|
|
19
14
|
* the available types only, and `checkWith` the same check against other resources, such as those a caller may read.
|
|
15
|
+
* A type that signs in is available once the app can make its connection, as `support` says.
|
|
20
16
|
*/
|
|
21
|
-
const workflowTypes = (loaded = [], models = () => void 0) => {
|
|
17
|
+
const workflowTypes = (loaded = [], models = () => void 0, support) => {
|
|
22
18
|
const plugins = loadPlugins([{
|
|
23
19
|
plugin: appPlugin,
|
|
24
20
|
source: "@protobase/workflow-plugins"
|
|
25
21
|
}, ...loaded]);
|
|
26
|
-
const types = typeList(plugins,
|
|
22
|
+
const types = typeList(plugins, connectionUnavailable(support));
|
|
23
|
+
const connections = Object.fromEntries(types.flatMap((type) => type.connection ? [[type.id, `${type.plugin}:${type.connection.name}`]] : []));
|
|
27
24
|
const available = new Set(types.filter((type) => type.kind !== "step" && type.available).map((type) => type.id));
|
|
28
25
|
const ready = readyTriggers(plugins);
|
|
29
26
|
const polling = triggersOfKind(plugins, "polling");
|
|
@@ -44,14 +41,16 @@ const workflowTypes = (loaded = [], models = () => void 0) => {
|
|
|
44
41
|
resources: steps.map((type) => type.id),
|
|
45
42
|
required: Object.fromEntries(steps.map((type) => [type.id, requiredInputs(type.input)])),
|
|
46
43
|
triggers: Object.fromEntries(checks.filter(([id]) => available.has(id))),
|
|
47
|
-
unavailable: reasons
|
|
44
|
+
unavailable: reasons,
|
|
45
|
+
connections
|
|
48
46
|
};
|
|
49
47
|
};
|
|
50
48
|
const check = checkWith(models);
|
|
51
|
-
/** The step types of one segment, which sends mail with the mailer of the job that runs it
|
|
52
|
-
const tasks = (input, mail) => stepHandlers(plugins, {
|
|
49
|
+
/** The step types of one segment, which sends mail with the mailer of the job that runs it, signs in through `connection`, and sends from the enabler's `mailbox`. */
|
|
50
|
+
const tasks = (input, mail, connection, mailbox) => stepHandlers(plugins, {
|
|
53
51
|
services: pluginServices(input, mail),
|
|
54
|
-
connection
|
|
52
|
+
connection,
|
|
53
|
+
...mailbox && { mailbox }
|
|
55
54
|
});
|
|
56
55
|
return {
|
|
57
56
|
plugins,
|
|
@@ -62,6 +61,7 @@ const workflowTypes = (loaded = [], models = () => void 0) => {
|
|
|
62
61
|
ready,
|
|
63
62
|
polling,
|
|
64
63
|
webhooks,
|
|
64
|
+
connections,
|
|
65
65
|
available: (id) => available.has(id)
|
|
66
66
|
};
|
|
67
67
|
};
|
package/dist/write-shared.js
CHANGED
|
@@ -65,6 +65,7 @@ const notifier = (deps, access, removed) => async (trx, kind, before, after) =>
|
|
|
65
65
|
user: session.user,
|
|
66
66
|
...session.tenant !== void 0 && { tenant: session.tenant },
|
|
67
67
|
...session.anonymous && { anonymous: true },
|
|
68
|
+
session,
|
|
68
69
|
...before && { before: maskEncrypted(access.full, before) },
|
|
69
70
|
...after && { after: maskEncrypted(access.full, after) }
|
|
70
71
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.69.1",
|
|
4
4
|
"description": "The Protobase REST API as a Hono app, with Better Auth sign-in.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@better-auth/sso": "^1.7.12",
|
|
45
45
|
"@livekit/protocol": "1.53.1",
|
|
46
46
|
"@modelcontextprotocol/server": "^2.3.1",
|
|
47
|
-
"@protobase/layout": "0.
|
|
48
|
-
"@protobase/query": "0.
|
|
49
|
-
"@protobase/schema": "0.
|
|
50
|
-
"@protobase/workflow-plugins": "0.
|
|
51
|
-
"@protobase/workflows": "0.
|
|
47
|
+
"@protobase/layout": "0.69.1",
|
|
48
|
+
"@protobase/query": "0.69.1",
|
|
49
|
+
"@protobase/schema": "0.69.1",
|
|
50
|
+
"@protobase/workflow-plugins": "0.69.1",
|
|
51
|
+
"@protobase/workflows": "0.69.1",
|
|
52
52
|
"@react-email/render": "^2.1.0",
|
|
53
53
|
"@react-pdf/primitives": "^4.4.0",
|
|
54
54
|
"@react-pdf/renderer": "^4.9.0",
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//#region src/better-auth/end-replaced-session.d.ts
|
|
2
|
-
/** The part of Better Auth's endpoint context that ending a replaced session reads. */
|
|
3
|
-
export type ReplacingContext = {
|
|
4
|
-
getSignedCookie: (name: string, secret: string) => Promise<string | null | false>;
|
|
5
|
-
context: {
|
|
6
|
-
authCookies: {
|
|
7
|
-
sessionToken: {
|
|
8
|
-
name: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
secret: string;
|
|
12
|
-
internalAdapter: {
|
|
13
|
-
deleteSession: (token: string) => Promise<void>;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|