void 0.7.6 → 0.7.8
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/{auth-DrfOTMmr.d.mts → auth-DmuALf16.d.mts} +4 -4
- package/dist/{auth-cmd-Dk0acCT5.mjs → auth-cmd-CKKnwjJr.mjs} +2 -2
- package/dist/{better-auth-shared-CZsIpjey.d.mts → better-auth-shared-HXlHRw02.d.mts} +15 -15
- package/dist/{cache-DGSZ5Bh6.mjs → cache-GQaCgNU_.mjs} +1 -1
- package/dist/{cancel-deploy-CrY3kt93.mjs → cancel-deploy-Lm-s-VNM.mjs} +1 -1
- package/dist/cli/cli.mjs +22 -22
- package/dist/{client-DCqnMpDt.mjs → client-BCHb449S.mjs} +13 -3
- package/dist/{config-BIa9HwVX.mjs → config-DqkeX_Fa.mjs} +5 -5
- package/dist/{create-project-Bg88Kq_I.mjs → create-project-B4_81uPO.mjs} +1 -1
- package/dist/{db-DvBg7Oc5.mjs → db-DEgoBwm1.mjs} +26 -22
- package/dist/{delete-DXcX1yQZ.mjs → delete-B3XRid-6.mjs} +1 -1
- package/dist/{deploy-B5rTuzXw.mjs → deploy-BVhinNvN.mjs} +35 -12
- package/dist/{domain-CDQhvYNZ.mjs → domain-CwjrEwk9.mjs} +25 -2
- package/dist/{dotenv-DwO4ti0Z.mjs → dotenv-zdFCCgFU.mjs} +26 -26
- package/dist/{env-helpers-CbeM_7-k.d.mts → env-helpers-Dw95CU8e.d.mts} +4 -4
- package/dist/{env-CnrQY2b6.mjs → env-kXobUKhc.mjs} +2 -2
- package/dist/{env-validation-DJKjR_8q.mjs → env-validation-Bc_aiBUm.mjs} +1 -1
- package/dist/{fetch-error-DflegrF3.d.mts → fetch-error-DZ868Xq4.d.mts} +4 -4
- package/dist/{gen-C0EY2k27.mjs → gen-CpeKIqlM.mjs} +2 -2
- package/dist/{handler-dKQWyF-G.d.mts → handler-DJTuxB10.d.mts} +24 -27
- package/dist/{head-CZGAunBV.d.mts → head-C7QW7UY1.d.mts} +5 -6
- package/dist/{headers-YVkHjOyq.mjs → headers-C7Yf6_CN.mjs} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +42 -33
- package/dist/{init-BiXWyKEf.mjs → init-CfdGhcG_.mjs} +5 -5
- package/dist/{link-eZ0aiHFK.mjs → link-sYAGQEVa.mjs} +2 -2
- package/dist/{list-ztyEz4TW.mjs → list-B_cMVlKj.mjs} +1 -1
- package/dist/{login-B5HHT32i.mjs → login-B-hYch9Z.mjs} +1 -1
- package/dist/{logs-J4BN0LXd.mjs → logs-JrG0_AxV.mjs} +1 -1
- package/dist/{mcp-Bdu9bnjR.mjs → mcp-BcssKxth.mjs} +1 -1
- package/dist/{node-DFqMcZR1.mjs → node-DHVCtkgt.mjs} +1 -1
- package/dist/pages/client.d.mts +35 -41
- package/dist/pages/head-client.d.mts +1 -1
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/head.mjs +4 -4
- package/dist/pages/index.d.mts +6 -6
- package/dist/pages/index.mjs +6 -6
- package/dist/pages/islands-plugin.d.mts +3 -3
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/pages/prefetch.d.mts +5 -5
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -2
- package/dist/{prepare-BrfiJBju.mjs → prepare-CKzO06-Z.mjs} +3 -3
- package/dist/{project-cmd-DKiQYdSd.mjs → project-cmd-DDDakkqn.mjs} +8 -8
- package/dist/{protocol-COz1NHxc.d.mts → protocol-D7r_deVZ.d.mts} +5 -5
- package/dist/{rollback-ZNvT8T54.mjs → rollback-_11JdPsF.mjs} +1 -1
- package/dist/{route-types-DReF1gUY.mjs → route-types-Cnqj_8a7.mjs} +2 -2
- package/dist/runtime/ai.d.mts +33 -40
- package/dist/runtime/auth.d.mts +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/client.d.mts +2 -2
- package/dist/runtime/env-helpers.d.mts +1 -1
- package/dist/runtime/env-helpers.mjs +3 -3
- package/dist/runtime/env-public-client.d.mts +3 -3
- package/dist/runtime/env-public.d.mts +7 -7
- package/dist/runtime/fetch-stream.d.mts +1 -1
- package/dist/runtime/fetch.d.mts +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +3 -3
- package/dist/runtime/isr.d.mts +2 -2
- package/dist/runtime/kv.d.mts +12 -12
- package/dist/runtime/live-server.d.mts +4 -4
- package/dist/runtime/live.d.mts +2 -2
- package/dist/runtime/migration-handler.d.mts +6 -6
- package/dist/runtime/seed.d.mts +4 -4
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +8 -8
- package/dist/runtime/ws.d.mts +21 -21
- package/dist/{scan-vv5u7rHu.mjs → scan-B8iEm8xn.mjs} +5 -5
- package/dist/{scan-Ba4hFwlH.mjs → scan-CWfLxtOe.mjs} +8 -8
- package/dist/{secret-BXHx515u.mjs → secret-DwG7uDho.mjs} +1 -1
- package/dist/{standard-schema-BfGDWXff.d.mts → standard-schema-D2qvCEYV.d.mts} +14 -14
- package/dist/sveltekit.d.mts +3 -5
- package/dist/types-DG_Ynnyd.d.mts +42 -0
- package/package.json +2 -2
- package/dist/types-D6AuY5Bf.d.mts +0 -65
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as getSecretOverride, c as oneOf, i as email, l as string, n as SECRET_OVERRIDE_SYMBOL, o as json, r as boolean, s as number, t as EnvSchema, u as url } from "../env-helpers-
|
|
1
|
+
import { a as getSecretOverride, c as oneOf, i as email, l as string, n as SECRET_OVERRIDE_SYMBOL, o as json, r as boolean, s as number, t as EnvSchema, u as url } from "../env-helpers-Dw95CU8e.mjs";
|
|
2
2
|
export { EnvSchema, SECRET_OVERRIDE_SYMBOL, boolean, email, getSecretOverride, json, number, oneOf, string, url };
|
|
@@ -94,12 +94,12 @@ function number() {
|
|
|
94
94
|
/** Boolean env value. Accepts "true"/"false"/"1"/"0" (case-insensitive). */
|
|
95
95
|
function boolean() {
|
|
96
96
|
return build((raw) => {
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
97
|
+
const lowercased = raw.toLowerCase();
|
|
98
|
+
if (lowercased === "true" || lowercased === "1") return {
|
|
99
99
|
ok: true,
|
|
100
100
|
value: true
|
|
101
101
|
};
|
|
102
|
-
if (
|
|
102
|
+
if (lowercased === "false" || lowercased === "0") return {
|
|
103
103
|
ok: true,
|
|
104
104
|
value: false
|
|
105
105
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as oneOf, i as email, l as string, o as json, r as boolean, s as number, t as EnvSchema, u as url } from "../env-helpers-
|
|
1
|
+
import { c as oneOf, i as email, l as string, o as json, r as boolean, s as number, t as EnvSchema, u as url } from "../env-helpers-Dw95CU8e.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/runtime/env-public-client.d.ts
|
|
4
4
|
declare const env: Record<string, unknown>;
|
|
@@ -11,10 +11,10 @@ declare const env: Record<string, unknown>;
|
|
|
11
11
|
declare function defineEnv<S>(_schema: S): typeof env;
|
|
12
12
|
declare class EnvValidationError extends Error {
|
|
13
13
|
readonly key: string;
|
|
14
|
-
readonly issues:
|
|
14
|
+
readonly issues: Array<{
|
|
15
15
|
message: string;
|
|
16
16
|
}>;
|
|
17
|
-
constructor(key: string, issues:
|
|
17
|
+
constructor(key: string, issues: Array<{
|
|
18
18
|
message: string;
|
|
19
19
|
}>);
|
|
20
20
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="@cloudflare/workers-types" />
|
|
2
|
-
import { t as StandardSchemaV1 } from "../standard-schema-
|
|
3
|
-
import { c as oneOf, i as email, l as string, o as json, r as boolean, s as number, t as EnvSchema, u as url } from "../env-helpers-
|
|
2
|
+
import { t as StandardSchemaV1 } from "../standard-schema-D2qvCEYV.mjs";
|
|
3
|
+
import { c as oneOf, i as email, l as string, o as json, r as boolean, s as number, t as EnvSchema, u as url } from "../env-helpers-Dw95CU8e.mjs";
|
|
4
4
|
import * as _$_cloudflare_sandbox0 from "@cloudflare/sandbox";
|
|
5
5
|
|
|
6
6
|
//#region src/runtime/env-public.d.ts
|
|
7
|
-
|
|
7
|
+
type AnyValidator = StandardSchemaV1<unknown, unknown>;
|
|
8
8
|
type AnySchema = Record<string, AnyValidator>;
|
|
9
9
|
/**
|
|
10
10
|
* Type-only stub for the validated env shape. Augmented by the generated
|
|
@@ -74,8 +74,8 @@ declare function _hasRegisteredSchema(): boolean;
|
|
|
74
74
|
declare function _getSchemaDefaults(): Record<string, string>;
|
|
75
75
|
declare class EnvValidationError extends Error {
|
|
76
76
|
readonly key: string;
|
|
77
|
-
readonly issues:
|
|
78
|
-
constructor(key: string, issues:
|
|
77
|
+
readonly issues: Array<StandardSchemaV1.Issue>;
|
|
78
|
+
constructor(key: string, issues: Array<StandardSchemaV1.Issue>);
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* Typed env proxy. Reads from the runtime env, validating declared keys
|
|
@@ -90,7 +90,7 @@ declare class EnvValidationError extends Error {
|
|
|
90
90
|
*/
|
|
91
91
|
declare const env: ValidatedEnv;
|
|
92
92
|
/** Aggregate report from validating an entire env object against the schema. */
|
|
93
|
-
|
|
93
|
+
type EnvValidationReport = {
|
|
94
94
|
valid: boolean;
|
|
95
95
|
missing: Array<string>;
|
|
96
96
|
invalid: Array<{
|
|
@@ -103,7 +103,7 @@ interface EnvValidationReport {
|
|
|
103
103
|
* cache.
|
|
104
104
|
*/
|
|
105
105
|
values: Map<string, unknown>;
|
|
106
|
-
}
|
|
106
|
+
};
|
|
107
107
|
/**
|
|
108
108
|
* Validate an env record (e.g. merged `.env*` + remote secret list) against
|
|
109
109
|
* the registered schema. Used by the dev plugin (warnings), the deploy CLI
|
package/dist/runtime/fetch.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="@cloudflare/workers-types" />
|
|
2
|
-
import { C as HandlerInput, S as ValidationError, _ as defineScheduled, a as QueueBatch, b as InferProps, c as RenderAssetTags, d as VoidAssetRewriteError, f as defineHandler, g as defineRender, h as defineQueue, i as CloudEnv, l as TypedHandler, m as defineMiddleware, n as CloudContext, o as QueueMessage, p as defineHead, r as CloudContextVariables, s as QueueRetryOptions, t as CloudBindings, u as TypedQueueHandler, v as Deferred, w as ValidatorSlots, x as defer } from "../handler-
|
|
2
|
+
import { C as HandlerInput, S as ValidationError, _ as defineScheduled, a as QueueBatch, b as InferProps, c as RenderAssetTags, d as VoidAssetRewriteError, f as defineHandler, g as defineRender, h as defineQueue, i as CloudEnv, l as TypedHandler, m as defineMiddleware, n as CloudContext, o as QueueMessage, p as defineHead, r as CloudContextVariables, s as QueueRetryOptions, t as CloudBindings, u as TypedQueueHandler, v as Deferred, w as ValidatorSlots, x as defer } from "../handler-DJTuxB10.mjs";
|
|
3
3
|
export { CloudBindings, CloudContext, CloudContextVariables, CloudEnv, Deferred, HandlerInput, InferProps, QueueBatch, QueueMessage, QueueRetryOptions, RenderAssetTags, TypedHandler, TypedQueueHandler, ValidationError, ValidatorSlots, VoidAssetRewriteError, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled };
|
package/dist/runtime/handler.mjs
CHANGED
|
@@ -25,9 +25,9 @@ function defineHandler(...args) {
|
|
|
25
25
|
let index = 0;
|
|
26
26
|
const dispatch = async () => {
|
|
27
27
|
if (index < middlewares.length) {
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
28
|
+
const middleware = middlewares[index++];
|
|
29
|
+
const middlewareResponse = await middleware(c, dispatch);
|
|
30
|
+
if (middlewareResponse instanceof Response) c.res = middlewareResponse;
|
|
31
31
|
} else c.res = convertReturnValue(await handler(c));
|
|
32
32
|
};
|
|
33
33
|
await dispatch();
|
package/dist/runtime/isr.d.mts
CHANGED
package/dist/runtime/kv.d.mts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
//#region src/runtime/kv.d.ts
|
|
2
|
-
|
|
2
|
+
type PutOptions = {
|
|
3
3
|
ttl?: number;
|
|
4
4
|
expiration?: number;
|
|
5
5
|
metadata?: Record<string, unknown>;
|
|
6
|
-
}
|
|
7
|
-
|
|
6
|
+
};
|
|
7
|
+
type ListOptions = {
|
|
8
8
|
prefix?: string;
|
|
9
9
|
limit?: number;
|
|
10
10
|
cursor?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
11
|
+
};
|
|
12
|
+
type ListKey<M = unknown> = {
|
|
13
13
|
name: string;
|
|
14
14
|
expiration?: number;
|
|
15
15
|
metadata?: M;
|
|
16
|
-
}
|
|
17
|
-
|
|
16
|
+
};
|
|
17
|
+
type ListResult<M = unknown> = {
|
|
18
18
|
keys: Array<ListKey<M>>;
|
|
19
19
|
list_complete: boolean;
|
|
20
20
|
cursor?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
21
|
+
};
|
|
22
|
+
type KVMap<T> = {
|
|
23
23
|
get(key: string): Promise<T | null>;
|
|
24
24
|
put(key: string, value: T, options?: PutOptions): Promise<void>;
|
|
25
25
|
delete(key: string): Promise<void>;
|
|
@@ -28,8 +28,8 @@ interface KVMap<T> {
|
|
|
28
28
|
value: T | null;
|
|
29
29
|
metadata: M | null;
|
|
30
30
|
}>;
|
|
31
|
-
}
|
|
32
|
-
|
|
31
|
+
};
|
|
32
|
+
type KVClient = {
|
|
33
33
|
get<T = string>(key: string): Promise<T | null>;
|
|
34
34
|
put(key: string, value: unknown, options?: PutOptions): Promise<void>;
|
|
35
35
|
delete(key: string): Promise<void>;
|
|
@@ -39,7 +39,7 @@ interface KVClient {
|
|
|
39
39
|
metadata: M | null;
|
|
40
40
|
}>;
|
|
41
41
|
map<T = unknown>(prefix: string): KVMap<T>;
|
|
42
|
-
}
|
|
42
|
+
};
|
|
43
43
|
/** Create a KV client for a specific KVNamespace instance. */
|
|
44
44
|
declare function createKV(namespace: KVNamespace): KVClient;
|
|
45
45
|
/** Default KV client — resolves `KV` from the active runtime environment. */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/// <reference types="@cloudflare/workers-types" />
|
|
2
2
|
//#region src/runtime/live-server.d.ts
|
|
3
3
|
type LiveDurableObjectEnv = Record<string, unknown>;
|
|
4
|
-
|
|
4
|
+
type LiveDurableObjectInstance = {
|
|
5
5
|
fetch(request: Request): Promise<Response>;
|
|
6
6
|
alarm?(): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
|
|
7
|
+
};
|
|
8
|
+
type LiveDurableObjectClass = {
|
|
9
9
|
new (state: DurableObjectState, env: LiveDurableObjectEnv): LiveDurableObjectInstance;
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
declare function createLiveDurableObject(): LiveDurableObjectClass;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { LiveDurableObjectClass, LiveDurableObjectInstance, createLiveDurableObject };
|
package/dist/runtime/live.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="@cloudflare/workers-types" />
|
|
2
|
-
import { r as AuthUser } from "../auth-
|
|
3
|
-
import { i as CloudEnv, n as CloudContext } from "../handler-
|
|
2
|
+
import { r as AuthUser } from "../auth-DmuALf16.mjs";
|
|
3
|
+
import { i as CloudEnv, n as CloudContext } from "../handler-DJTuxB10.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/runtime/live.d.ts
|
|
6
6
|
type MaybePromise<T> = T | Promise<T>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
//#region src/runtime/migration-handler.d.ts
|
|
2
|
-
|
|
2
|
+
type MigrationEntry = {
|
|
3
3
|
name: string;
|
|
4
4
|
sql: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
5
|
+
};
|
|
6
|
+
type MigrationResult = {
|
|
7
7
|
name: string;
|
|
8
8
|
applied: boolean;
|
|
9
9
|
durationMs: number;
|
|
10
10
|
error?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
11
|
+
};
|
|
12
|
+
type MigrationResponse = {
|
|
13
13
|
ok: boolean;
|
|
14
14
|
migrations: Array<MigrationResult>;
|
|
15
15
|
error?: string;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
17
|
declare function createMigrationHandler(env: Record<string, unknown>, migrations: Array<MigrationEntry> | undefined, _dialect: "sqlite" | "postgresql", runAuthMigrations?: () => Promise<void>): (request: Request) => Promise<Response>;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { MigrationEntry, MigrationResponse, MigrationResult, createMigrationHandler };
|
package/dist/runtime/seed.d.mts
CHANGED
|
@@ -2,16 +2,16 @@ import { NodePgDatabase } from "drizzle-orm/node-postgres";
|
|
|
2
2
|
import { BetterSQLite3Database } from "drizzle-orm/better-sqlite3";
|
|
3
3
|
|
|
4
4
|
//#region src/runtime/seed.d.ts
|
|
5
|
-
|
|
5
|
+
type SqliteSeedContext<TSchema extends Record<string, unknown> = Record<string, never>> = {
|
|
6
6
|
dialect: "sqlite";
|
|
7
7
|
db: BetterSQLite3Database<TSchema>;
|
|
8
8
|
schema: TSchema;
|
|
9
|
-
}
|
|
10
|
-
|
|
9
|
+
};
|
|
10
|
+
type PostgresSeedContext<TSchema extends Record<string, unknown> = Record<string, never>> = {
|
|
11
11
|
dialect: "postgresql";
|
|
12
12
|
db: NodePgDatabase<TSchema>;
|
|
13
13
|
schema: TSchema;
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
15
|
type DrizzleTableForDialect<TDialect extends string> = {
|
|
16
16
|
readonly _: {
|
|
17
17
|
readonly config: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as HandlerInput, T as runValidation, w as ValidatorSlots } from "../handler-
|
|
1
|
+
import { C as HandlerInput, T as runValidation, w as ValidatorSlots } from "../handler-DJTuxB10.mjs";
|
|
2
2
|
export { HandlerInput, ValidatorSlots, runValidation };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { n as AuthState } from "../auth-
|
|
2
|
-
import { i as VoidAuthRuntimeOptions, n as VoidAuthEnv } from "../better-auth-shared-
|
|
1
|
+
import { n as AuthState } from "../auth-DmuALf16.mjs";
|
|
2
|
+
import { i as VoidAuthRuntimeOptions, n as VoidAuthEnv } from "../better-auth-shared-HXlHRw02.mjs";
|
|
3
3
|
import { AnyWebSocketDefinition } from "./ws.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/runtime/ws-server.d.ts
|
|
6
|
-
|
|
6
|
+
type WebSocketRouteMeta = {
|
|
7
7
|
pattern: string;
|
|
8
8
|
params: Array<string>;
|
|
9
9
|
className: string;
|
|
10
10
|
bindingName: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
11
|
+
};
|
|
12
|
+
type WebSocketDurableObjectInstance = {
|
|
13
13
|
fetch(request: Request): Promise<Response>;
|
|
14
14
|
webSocketMessage(webSocket: WebSocket, message: string | ArrayBuffer | ArrayBufferView): Promise<void>;
|
|
15
15
|
webSocketClose(webSocket: WebSocket, code: number, reason: string, wasClean: boolean): Promise<void>;
|
|
16
|
-
}
|
|
17
|
-
|
|
16
|
+
};
|
|
17
|
+
type WebSocketDurableObjectClass = {
|
|
18
18
|
new (state: DurableObjectState, env: Record<string, unknown>): WebSocketDurableObjectInstance;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
type ResolveVoidAuthState = (request: Request, env: VoidAuthEnv, runtime: VoidAuthRuntimeOptions) => Promise<AuthState | null>;
|
|
21
21
|
declare function buildWebSocketInstanceId(route: Pick<WebSocketRouteMeta, "params">, params: Record<string, string>): string;
|
|
22
22
|
declare function createWebSocketDurableObject(definition: AnyWebSocketDefinition, route: WebSocketRouteMeta, authRuntime?: VoidAuthRuntimeOptions, resolveAuthState?: ResolveVoidAuthState): WebSocketDurableObjectClass;
|
package/dist/runtime/ws.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as AuthUser } from "../auth-
|
|
2
|
-
import { t as StandardSchemaV1 } from "../standard-schema-
|
|
3
|
-
import { i as CloudEnv } from "../handler-
|
|
1
|
+
import { r as AuthUser } from "../auth-DmuALf16.mjs";
|
|
2
|
+
import { t as StandardSchemaV1 } from "../standard-schema-D2qvCEYV.mjs";
|
|
3
|
+
import { i as CloudEnv } from "../handler-DJTuxB10.mjs";
|
|
4
4
|
import { WebSocketRouteMap } from "void/routes";
|
|
5
5
|
|
|
6
6
|
//#region src/runtime/ws.d.ts
|
|
@@ -17,34 +17,34 @@ type ServerEventOf<P extends keyof WebSocketRouteMap> = WsEntry<P> extends {
|
|
|
17
17
|
server: infer T;
|
|
18
18
|
} ? T : never;
|
|
19
19
|
type HasParams<P extends keyof WebSocketRouteMap> = ParamsOf<P> extends Record<string, never> ? false : [keyof ParamsOf<P>] extends [never] ? false : true;
|
|
20
|
-
|
|
20
|
+
type WebSocketConnection<ServerEvent = unknown> = {
|
|
21
21
|
readonly id: string;
|
|
22
22
|
readonly state: unknown;
|
|
23
23
|
send(event: ServerEvent): Promise<void>;
|
|
24
24
|
close(code?: number, reason?: string): void;
|
|
25
25
|
setState(data: unknown): void;
|
|
26
|
-
}
|
|
27
|
-
|
|
26
|
+
};
|
|
27
|
+
type RoomController<ServerEvent = unknown> = {
|
|
28
28
|
broadcast(event: ServerEvent, excludeIds?: Array<string>): Promise<void>;
|
|
29
29
|
getConnections(): Iterable<WebSocketConnection<ServerEvent>>;
|
|
30
30
|
getConnection(id: string): WebSocketConnection<ServerEvent> | undefined;
|
|
31
|
-
}
|
|
32
|
-
|
|
31
|
+
};
|
|
32
|
+
type WebSocketBaseContext = {
|
|
33
33
|
readonly id: string;
|
|
34
34
|
readonly params: ParamsRecord;
|
|
35
35
|
readonly user: AuthUser | null;
|
|
36
36
|
readonly request: Request;
|
|
37
37
|
readonly env: CloudEnv["Bindings"];
|
|
38
38
|
readonly storage: DurableObjectStorage;
|
|
39
|
-
}
|
|
40
|
-
|
|
39
|
+
};
|
|
40
|
+
type RoomContext<ServerEvent = unknown> = WebSocketBaseContext & {
|
|
41
41
|
readonly room: RoomController<ServerEvent>;
|
|
42
42
|
readonly connection: WebSocketConnection<ServerEvent>;
|
|
43
|
-
}
|
|
44
|
-
|
|
43
|
+
};
|
|
44
|
+
type SocketContext<ServerEvent = unknown> = WebSocketBaseContext & {
|
|
45
45
|
readonly socket: WebSocketConnection<ServerEvent>;
|
|
46
|
-
}
|
|
47
|
-
|
|
46
|
+
};
|
|
47
|
+
type RoomDefinition<ClientSchema extends StandardSchemaV1 = StandardSchemaV1, ServerSchema extends StandardSchemaV1 = StandardSchemaV1> = {
|
|
48
48
|
readonly __kind: "room";
|
|
49
49
|
readonly messages: {
|
|
50
50
|
client: ClientSchema;
|
|
@@ -59,8 +59,8 @@ interface RoomDefinition<ClientSchema extends StandardSchemaV1 = StandardSchemaV
|
|
|
59
59
|
wasClean: boolean;
|
|
60
60
|
}) => MaybePromise<void>;
|
|
61
61
|
onRequest?: (ctx: RoomContext<StandardSchemaV1.InferInput<ServerSchema>>) => MaybePromise<Response>;
|
|
62
|
-
}
|
|
63
|
-
|
|
62
|
+
};
|
|
63
|
+
type SocketDefinition<ClientSchema extends StandardSchemaV1 = StandardSchemaV1, ServerSchema extends StandardSchemaV1 = StandardSchemaV1> = {
|
|
64
64
|
readonly __kind: "socket";
|
|
65
65
|
readonly messages: {
|
|
66
66
|
client: ClientSchema;
|
|
@@ -75,22 +75,22 @@ interface SocketDefinition<ClientSchema extends StandardSchemaV1 = StandardSchem
|
|
|
75
75
|
wasClean: boolean;
|
|
76
76
|
}) => MaybePromise<void>;
|
|
77
77
|
onRequest?: (ctx: SocketContext<StandardSchemaV1.InferInput<ServerSchema>>) => MaybePromise<Response>;
|
|
78
|
-
}
|
|
78
|
+
};
|
|
79
79
|
type AnyWebSocketDefinition = RoomDefinition | SocketDefinition;
|
|
80
80
|
declare function defineRoom<ClientSchema extends StandardSchemaV1, ServerSchema extends StandardSchemaV1>(definition: Omit<RoomDefinition<ClientSchema, ServerSchema>, "__kind">): RoomDefinition<ClientSchema, ServerSchema>;
|
|
81
81
|
declare function defineWebSocket<ClientSchema extends StandardSchemaV1, ServerSchema extends StandardSchemaV1>(definition: Omit<SocketDefinition<ClientSchema, ServerSchema>, "__kind">): SocketDefinition<ClientSchema, ServerSchema>;
|
|
82
|
-
|
|
82
|
+
type VoidSocketCloseEvent = {
|
|
83
83
|
code?: number;
|
|
84
84
|
reason?: string;
|
|
85
85
|
wasClean?: boolean;
|
|
86
|
-
}
|
|
87
|
-
|
|
86
|
+
};
|
|
87
|
+
type ConnectCommonOptions = {
|
|
88
88
|
baseURL?: string;
|
|
89
89
|
reconnect?: boolean;
|
|
90
90
|
reconnectDelayMs?: number;
|
|
91
91
|
maxReconnectAttempts?: number;
|
|
92
92
|
protocols?: string | Array<string>;
|
|
93
|
-
}
|
|
93
|
+
};
|
|
94
94
|
type ConnectOptions<P extends keyof WebSocketRouteMap> = ConnectCommonOptions & (HasParams<P> extends true ? {
|
|
95
95
|
params: ParamsOf<P>;
|
|
96
96
|
} : {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as join, t as basename } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
|
|
2
2
|
import { n as globSync, t as glob } from "./dist-DUyXJLkq.mjs";
|
|
3
3
|
import { d as isCallExpression, f as isIdentifier, h as isObjectExpression, p as isLiteral } from "./plugin-inference-CXUuq0aC.mjs";
|
|
4
|
-
import { o as parseRouteFilename, s as parseWebSocketFilename, t as scanPages } from "./scan-
|
|
4
|
+
import { o as parseRouteFilename, s as parseWebSocketFilename, t as scanPages } from "./scan-CWfLxtOe.mjs";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
import { parseSync } from "vite";
|
|
7
7
|
//#region src/crons/scan.ts
|
|
@@ -32,7 +32,7 @@ function extractCronExpressions(source, filePath) {
|
|
|
32
32
|
throw new Error(`cron: Invalid job file '${filePath}'. Add \`export const cron = "<schedule>"\`.`);
|
|
33
33
|
}
|
|
34
34
|
function parseJobFiles(root, jobsDir, files) {
|
|
35
|
-
return files.filter((
|
|
35
|
+
return files.filter((filePath) => !filePath.split("/").some((segment) => segment.startsWith("_"))).sort((leftFilePath, rightFilePath) => leftFilePath.localeCompare(rightFilePath)).map((filePath) => {
|
|
36
36
|
const source = readFileSync(join(root, jobsDir, filePath), "utf-8");
|
|
37
37
|
return {
|
|
38
38
|
filePath,
|
|
@@ -75,12 +75,12 @@ function deriveBindingName(name) {
|
|
|
75
75
|
return "QUEUE_" + name.toUpperCase().replace(/[^A-Z0-9]/g, "_");
|
|
76
76
|
}
|
|
77
77
|
function extractConsumerOption(source, name) {
|
|
78
|
-
const
|
|
79
|
-
const match = source.match(
|
|
78
|
+
const optionRe = new RegExp(`export\\s+const\\s+${name}\\s*=\\s*(\\d+)`);
|
|
79
|
+
const match = source.match(optionRe);
|
|
80
80
|
return match ? Number(match[1]) : void 0;
|
|
81
81
|
}
|
|
82
82
|
function parseQueueFiles(root, queuesDir, files) {
|
|
83
|
-
return files.filter((
|
|
83
|
+
return files.filter((filePath) => !filePath.split("/").some((segment) => segment.startsWith("_"))).sort((leftFilePath, rightFilePath) => leftFilePath.localeCompare(rightFilePath)).map((filePath) => {
|
|
84
84
|
const source = readFileSync(join(root, queuesDir, filePath), "utf-8");
|
|
85
85
|
const name = extractName(filePath);
|
|
86
86
|
return {
|
|
@@ -86,12 +86,12 @@ function toLayoutId(layout) {
|
|
|
86
86
|
function resolveLayoutChain(componentId, layouts) {
|
|
87
87
|
const parts = componentId.split("/");
|
|
88
88
|
const chain = [];
|
|
89
|
-
const root = layouts.find((
|
|
89
|
+
const root = layouts.find((layout) => layout.directory === "");
|
|
90
90
|
if (root) chain.push(root);
|
|
91
91
|
let dir = "";
|
|
92
|
-
for (let
|
|
93
|
-
dir = dir ? `${dir}/${parts[
|
|
94
|
-
const layout = layouts.find((
|
|
92
|
+
for (let partIndex = 0; partIndex < parts.length - 1; partIndex++) {
|
|
93
|
+
dir = dir ? `${dir}/${parts[partIndex]}` : parts[partIndex];
|
|
94
|
+
const layout = layouts.find((candidate) => candidate.directory === dir);
|
|
95
95
|
if (layout) chain.push(layout);
|
|
96
96
|
}
|
|
97
97
|
return chain;
|
|
@@ -101,14 +101,14 @@ function resolveNamedLayout(name, componentId, namedLayouts) {
|
|
|
101
101
|
const parts = componentId.split("/");
|
|
102
102
|
const dirs = [];
|
|
103
103
|
let dir = "";
|
|
104
|
-
for (let
|
|
105
|
-
dir = dir ? `${dir}/${parts[
|
|
104
|
+
for (let partIndex = 0; partIndex < parts.length - 1; partIndex++) {
|
|
105
|
+
dir = dir ? `${dir}/${parts[partIndex]}` : parts[partIndex];
|
|
106
106
|
dirs.push(dir);
|
|
107
107
|
}
|
|
108
108
|
dirs.reverse();
|
|
109
109
|
dirs.push("");
|
|
110
|
-
for (const
|
|
111
|
-
const found = namedLayouts.find((
|
|
110
|
+
for (const directory of dirs) {
|
|
111
|
+
const found = namedLayouts.find((namedLayout) => namedLayout.name === name && namedLayout.directory === directory);
|
|
112
112
|
if (found) return found;
|
|
113
113
|
}
|
|
114
114
|
return null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as cliTitle } from "./output-BwlcIYSR.mjs";
|
|
2
2
|
import { _ as me, c as R, g as ge, n as Ce, u as Se, v as ue, x as q, y as ye } from "./dist-Dayj3gCK.mjs";
|
|
3
3
|
import { r as readProjectConfig } from "./project-TqORyHn8.mjs";
|
|
4
|
-
import { c as getToken, n as PlatformClient } from "./client-
|
|
4
|
+
import { c as getToken, n as PlatformClient } from "./client-BCHb449S.mjs";
|
|
5
5
|
import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-DdjLQ2tB.mjs";
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
7
|
//#region src/cli/secret.ts
|
|
@@ -6,35 +6,35 @@
|
|
|
6
6
|
* Per the spec's design, libraries may copy these types directly
|
|
7
7
|
* to avoid requiring `@standard-schema/spec` as a dependency.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
type StandardSchemaV1<Input = unknown, Output = Input> = {
|
|
10
10
|
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
12
|
declare namespace StandardSchemaV1 {
|
|
13
|
-
|
|
13
|
+
type Props<Input = unknown, Output = Input> = {
|
|
14
14
|
readonly version: 1;
|
|
15
15
|
readonly vendor: string;
|
|
16
16
|
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
|
17
17
|
readonly types?: Types<Input, Output> | undefined;
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
19
|
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
20
|
-
|
|
20
|
+
type SuccessResult<Output> = {
|
|
21
21
|
readonly value: Output;
|
|
22
22
|
readonly issues?: undefined;
|
|
23
|
-
}
|
|
24
|
-
|
|
23
|
+
};
|
|
24
|
+
type FailureResult = {
|
|
25
25
|
readonly issues: ReadonlyArray<Issue>;
|
|
26
|
-
}
|
|
27
|
-
|
|
26
|
+
};
|
|
27
|
+
type Issue = {
|
|
28
28
|
readonly message: string;
|
|
29
29
|
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
30
|
-
}
|
|
31
|
-
|
|
30
|
+
};
|
|
31
|
+
type PathSegment = {
|
|
32
32
|
readonly key: PropertyKey;
|
|
33
|
-
}
|
|
34
|
-
|
|
33
|
+
};
|
|
34
|
+
type Types<Input = unknown, Output = Input> = {
|
|
35
35
|
readonly input: Input;
|
|
36
36
|
readonly output: Output;
|
|
37
|
-
}
|
|
37
|
+
};
|
|
38
38
|
type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
39
39
|
type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
40
40
|
}
|
package/dist/sveltekit.d.mts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
//#region src/sveltekit.d.ts
|
|
2
2
|
type Tsconfig = Record<string, unknown>;
|
|
3
3
|
type TsconfigHook = (config: Tsconfig) => Tsconfig | void;
|
|
4
|
-
|
|
5
|
-
/** Project root. Defaults to process.cwd(). */
|
|
6
|
-
root?: string;
|
|
7
|
-
/** SvelteKit output directory. Defaults to ".svelte-kit". */
|
|
4
|
+
type VoidSvelteKitTsconfigOptions = {
|
|
5
|
+
/** Project root. Defaults to process.cwd(). */root?: string; /** SvelteKit output directory. Defaults to ".svelte-kit". */
|
|
8
6
|
outDir?: string;
|
|
9
|
-
}
|
|
7
|
+
};
|
|
10
8
|
/**
|
|
11
9
|
* Merge Void's generated tsconfig fragment into SvelteKit's generated
|
|
12
10
|
* tsconfig. Use from `kit.typescript.config` in `svelte.config.js`.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//#region src/pages/types.d.ts
|
|
2
|
+
type PageDefinition = {
|
|
3
|
+
/** URL pattern, e.g. "/users/:id" */pattern: string; /** Route params, e.g. ["id"] */
|
|
4
|
+
params: Array<string>; /** Whether this is a catch-all route */
|
|
5
|
+
catchAll: boolean; /** Component file relative path, e.g. "users/[id].vue" */
|
|
6
|
+
componentPath: string; /** Server handler file relative path, e.g. "users/[id].server.ts" */
|
|
7
|
+
serverPath: string | null; /** HTTP methods exported by server handler */
|
|
8
|
+
methods: Array<string>; /** Component ID used in page object, e.g. "users/[id]" */
|
|
9
|
+
componentId: string; /** Edge caching revalidate TTL in seconds, from .server.ts export */
|
|
10
|
+
revalidate?: number; /** Whether `export const prerender = true` is set in server handler */
|
|
11
|
+
prerender?: boolean; /** Whether `export function getPrerenderPaths` is defined in server handler */
|
|
12
|
+
hasGetPrerenderPaths?: boolean; /** Whether this is an island page (.island.tsx/.island.vue) */
|
|
13
|
+
island?: boolean; /** Frontmatter metadata extracted from .md files (title, description) */
|
|
14
|
+
metadata?: {
|
|
15
|
+
title?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
}; /** Named layout selection: "name", "!name", false, or relative path */
|
|
18
|
+
layout?: string | false;
|
|
19
|
+
};
|
|
20
|
+
type LayoutDefinition = {
|
|
21
|
+
/** Directory path relative to pages/, e.g. "" (root) or "users" */directory: string; /** Layout file relative path, e.g. "layout.vue" or "users/layout.vue" */
|
|
22
|
+
filePath: string; /** Whether this is an island layout (layout.island.tsx/.island.vue) */
|
|
23
|
+
island?: boolean;
|
|
24
|
+
};
|
|
25
|
+
type NamedLayoutDefinition = {
|
|
26
|
+
/** Layout name, e.g. "home", "post" */name: string; /** Directory containing _layouts/, e.g. "" (root) or "guide" */
|
|
27
|
+
directory: string; /** File path relative to pages/, e.g. "_layouts/home.vue" */
|
|
28
|
+
filePath: string; /** Whether this is an island layout */
|
|
29
|
+
island?: boolean;
|
|
30
|
+
};
|
|
31
|
+
type PageScanResult = {
|
|
32
|
+
pages: Array<PageDefinition>;
|
|
33
|
+
layouts: Array<LayoutDefinition>;
|
|
34
|
+
namedLayouts: Array<NamedLayoutDefinition>;
|
|
35
|
+
};
|
|
36
|
+
type DevCssAsset = {
|
|
37
|
+
/** Vite client URL used to request the CSS module. */url: string; /** Vite dev style id used by the client to adopt/update SSR-inlined styles. */
|
|
38
|
+
id?: string; /** CSS bytes returned by Vite's client environment transform with ?inline. */
|
|
39
|
+
css: string;
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { PageScanResult as a, PageDefinition as i, LayoutDefinition as n, NamedLayoutDefinition as r, DevCssAsset as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "void",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.8",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/voidzero-dev/void.git",
|
|
@@ -332,7 +332,7 @@
|
|
|
332
332
|
"valibot": ">=1.0.0-beta.7",
|
|
333
333
|
"vite": "^8.0.0",
|
|
334
334
|
"zod": "^3.25.0 || ^4.0.0",
|
|
335
|
-
"@void/md": "0.7.
|
|
335
|
+
"@void/md": "0.7.8"
|
|
336
336
|
},
|
|
337
337
|
"peerDependenciesMeta": {
|
|
338
338
|
"@void/md": {
|