@spacefast/common 0.0.23 → 0.0.24
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/config/domains.d.ts +1 -1
- package/dist/config/domains.js +1 -0
- package/dist/config/index.d.ts +0 -1
- package/dist/config/index.js +0 -1
- package/dist/contracts/abuse.d.ts +2 -0
- package/dist/contracts/abuse.js +12 -0
- package/dist/contracts/access.d.ts +121 -9
- package/dist/contracts/access.js +73 -9
- package/dist/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +0 -9
- package/dist/contracts/api-keys.d.ts +21 -21
- package/dist/contracts/beta.js +1 -1
- package/dist/contracts/billing.d.ts +1 -34
- package/dist/contracts/billing.js +4 -53
- package/dist/contracts/builds.d.ts +8 -8
- package/dist/contracts/builds.js +10 -3
- package/dist/contracts/cli.d.ts +10 -0
- package/dist/contracts/cli.js +10 -0
- package/dist/contracts/collab-public.d.ts +63 -0
- package/dist/contracts/collab-public.js +46 -0
- package/dist/contracts/comments.d.ts +283 -54
- package/dist/contracts/comments.js +173 -52
- package/dist/contracts/common.d.ts +3 -3
- package/dist/contracts/device-auth.d.ts +6 -6
- package/dist/contracts/device-auth.js +1 -1
- package/dist/contracts/docs.d.ts +5 -5
- package/dist/contracts/domains.d.ts +36 -36
- package/dist/contracts/enums.d.ts +33 -30
- package/dist/contracts/enums.js +52 -38
- package/dist/contracts/error-code-meta.d.ts +37 -126
- package/dist/contracts/error-code-meta.js +12 -41
- package/dist/contracts/error-codes.d.ts +1 -1
- package/dist/contracts/error-codes.js +10 -32
- package/dist/contracts/execution.d.ts +35 -57
- package/dist/contracts/execution.js +41 -40
- package/dist/contracts/feature-lifecycle-core.d.ts +0 -6
- package/dist/contracts/feature-lifecycle-core.js +2 -31
- package/dist/contracts/feature-lifecycle.d.ts +8 -38
- package/dist/contracts/feature-lifecycle.js +16 -48
- package/dist/contracts/features.d.ts +15 -13
- package/dist/contracts/features.js +39 -38
- package/dist/contracts/functions.d.ts +97 -70
- package/dist/contracts/functions.js +101 -34
- package/dist/contracts/git.d.ts +1 -1
- package/dist/contracts/grants.d.ts +7 -3
- package/dist/contracts/grants.js +18 -9
- package/dist/contracts/internal.d.ts +14 -1
- package/dist/contracts/internal.js +17 -7
- package/dist/contracts/oauth-resources.d.ts +4 -3
- package/dist/contracts/oauth-resources.js +12 -3
- package/dist/contracts/operations.d.ts +90 -5
- package/dist/contracts/operations.js +75 -1
- package/dist/contracts/pages.d.ts +6 -1
- package/dist/contracts/pages.js +24 -1
- package/dist/contracts/plan-policy.d.ts +1 -3
- package/dist/contracts/plan-policy.js +1 -2
- package/dist/contracts/platform.d.ts +61 -148
- package/dist/contracts/platform.js +70 -126
- package/dist/contracts/publish-archive.d.ts +498 -0
- package/dist/contracts/publish-archive.js +25 -0
- package/dist/contracts/resources.d.ts +12 -24
- package/dist/contracts/resources.js +32 -12
- package/dist/contracts/runtime-api.d.ts +369 -175
- package/dist/contracts/runtime-api.js +372 -348
- package/dist/contracts/runtime-app.d.ts +127 -120
- package/dist/contracts/runtime-app.js +19 -10
- package/dist/contracts/runtime-db.d.ts +1 -1
- package/dist/contracts/runtime-services.d.ts +219 -0
- package/dist/contracts/runtime-services.js +437 -0
- package/dist/contracts/runtime-storage.d.ts +45 -32
- package/dist/contracts/runtime-storage.js +30 -8
- package/dist/contracts/space-config.d.ts +10 -16
- package/dist/contracts/space-config.js +14 -10
- package/dist/contracts/spaces.d.ts +241 -436
- package/dist/contracts/spaces.js +128 -145
- package/dist/contracts/superadmin-activity.d.ts +57 -4
- package/dist/contracts/superadmin-activity.js +48 -2
- package/dist/contracts/superadmin-search.d.ts +126 -0
- package/dist/contracts/superadmin-search.js +61 -0
- package/dist/contracts/superadmin-spaces.d.ts +358 -89
- package/dist/contracts/superadmin-spaces.js +97 -24
- package/dist/contracts/superadmin-teams.d.ts +28 -10
- package/dist/contracts/superadmin-teams.js +5 -8
- package/dist/contracts/superadmin.d.ts +0 -32
- package/dist/contracts/superadmin.js +3 -11
- package/dist/contracts/tags.d.ts +9 -9
- package/dist/contracts/teams.d.ts +38 -0
- package/dist/contracts/teams.js +34 -16
- package/dist/contracts/transfers.d.ts +0 -49
- package/dist/contracts/transfers.js +2 -6
- package/dist/contracts/usage.d.ts +61 -0
- package/dist/contracts/usage.js +64 -0
- package/dist/contracts/variables.d.ts +2 -7
- package/dist/contracts/variables.js +6 -5
- package/dist/contracts/webhooks.d.ts +2 -2
- package/dist/contracts/zero.d.ts +87 -56
- package/dist/contracts/zero.js +82 -20
- package/dist/dashboard-paths/index.d.ts +1 -1
- package/dist/dashboard-paths/index.js +1 -0
- package/dist/docs/agent-prose.d.ts +1 -1
- package/dist/docs/agent-prose.js +57 -61
- package/dist/docs/agent-setup.js +40 -13
- package/dist/docs/catalog.d.ts +19 -19
- package/dist/docs/catalog.js +30 -19
- package/dist/docs/error-docs.js +63 -151
- package/dist/test-helpers/fetch-stub.d.ts +16 -0
- package/dist/test-helpers/fetch-stub.js +24 -0
- package/dist/utils/build-settings.js +9 -3
- package/dist/utils/canonical-json.d.ts +10 -0
- package/dist/utils/canonical-json.js +21 -0
- package/dist/utils/cast-transport.d.ts +28 -0
- package/dist/utils/cast-transport.js +52 -0
- package/dist/utils/claim-token.d.ts +0 -8
- package/dist/utils/claim-token.js +3 -15
- package/dist/utils/credential-policy.d.ts +1 -1
- package/dist/utils/env-file.d.ts +17 -0
- package/dist/utils/env-file.js +96 -0
- package/dist/utils/error-code.d.ts +2 -0
- package/dist/utils/error-code.js +7 -0
- package/dist/utils/generate-space-name.d.ts +8 -10
- package/dist/utils/generate-space-name.js +206 -21
- package/dist/utils/grant-decision.fixtures.json +2938 -0
- package/dist/utils/grants.d.ts +2 -0
- package/dist/utils/grants.js +25 -2
- package/dist/utils/gravatar.d.ts +9 -0
- package/dist/utils/gravatar.js +31 -0
- package/dist/utils/idempotency.d.ts +6 -0
- package/dist/utils/idempotency.js +28 -0
- package/dist/utils/local-space-state.d.ts +1 -5
- package/dist/utils/local-space-state.js +7 -26
- package/dist/utils/page-fonts.d.ts +2 -2
- package/dist/utils/page-fonts.js +22 -4
- package/dist/utils/pages.d.ts +1 -2
- package/dist/utils/pages.js +21 -5
- package/dist/utils/publish-form-data.d.ts +12 -0
- package/dist/utils/publish-form-data.js +10 -0
- package/dist/utils/publish-policy.d.ts +20 -0
- package/dist/utils/publish-policy.fixtures.json +397 -0
- package/dist/utils/publish-policy.js +36 -19
- package/dist/utils/push-new.d.ts +7 -0
- package/dist/utils/push-new.js +7 -0
- package/dist/utils/query-keys.d.ts +0 -1
- package/dist/utils/query-keys.js +0 -1
- package/dist/utils/runtime-paths.d.ts +5 -0
- package/dist/utils/runtime-paths.js +5 -0
- package/dist/utils/runtime-upload-batch.d.ts +0 -5
- package/dist/utils/runtime-upload-batch.js +1 -27
- package/dist/utils/runtime-upload.d.ts +3 -13
- package/dist/utils/runtime-upload.js +4 -14
- package/dist/utils/space-config.d.ts +0 -33
- package/dist/utils/space-config.js +5 -326
- package/dist/utils/storage-policy.d.ts +1 -1
- package/dist/utils/storage-policy.js +3 -1
- package/dist/utils/structured-error.d.ts +14 -0
- package/dist/utils/structured-error.js +22 -0
- package/dist/utils/version-path.js +12 -3
- package/dist/vocabulary.d.ts +5 -3
- package/dist/vocabulary.js +13 -10
- package/package.json +10 -5
- package/dist/config/postgres-budget.d.ts +0 -129
- package/dist/config/postgres-budget.js +0 -140
- package/dist/config/postgres-budget.json +0 -51
- package/dist/contracts/archives.d.ts +0 -331
- package/dist/contracts/archives.js +0 -120
- package/dist/contracts/deployments.d.ts +0 -574
- package/dist/contracts/deployments.js +0 -97
- package/dist/contracts/sites.d.ts +0 -416
- package/dist/contracts/sites.js +0 -168
- package/dist/contracts/superadmin-queues.d.ts +0 -414
- package/dist/contracts/superadmin-queues.js +0 -202
- package/dist/contracts/superadmin-runtime.d.ts +0 -27
- package/dist/contracts/superadmin-runtime.js +0 -38
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/utils/api.d.ts +0 -4
- package/dist/utils/api.js +0 -13
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Resolutions the hosting provider keeps usage at. Hour is retained about a
|
|
4
|
+
* week, day about two months, month about two years.
|
|
5
|
+
*/
|
|
6
|
+
export declare const USAGE_RESOLUTIONS: readonly ["hour", "day", "month"];
|
|
7
|
+
export type UsageResolution = (typeof USAGE_RESOLUTIONS)[number];
|
|
8
|
+
export declare const usageResolutionSchema: z.ZodEnum<{
|
|
9
|
+
day: "day";
|
|
10
|
+
hour: "hour";
|
|
11
|
+
month: "month";
|
|
12
|
+
}>;
|
|
13
|
+
export declare const spaceUsageMeasurementSchema: z.ZodObject<{
|
|
14
|
+
period: z.ZodObject<{
|
|
15
|
+
start: z.ZodString;
|
|
16
|
+
end: z.ZodString;
|
|
17
|
+
resolution: z.ZodEnum<{
|
|
18
|
+
day: "day";
|
|
19
|
+
hour: "hour";
|
|
20
|
+
month: "month";
|
|
21
|
+
}>;
|
|
22
|
+
}, z.core.$strip>;
|
|
23
|
+
sampledAt: z.ZodString;
|
|
24
|
+
storageBytes: z.ZodNumber;
|
|
25
|
+
computeSeconds: z.ZodNumber;
|
|
26
|
+
bandwidthBytes: z.ZodNumber;
|
|
27
|
+
emailCount: z.ZodNumber;
|
|
28
|
+
functionInvocations: z.ZodNumber;
|
|
29
|
+
functionErrors: z.ZodNumber;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export declare const spaceUsageResponseSchema: z.ZodObject<{
|
|
32
|
+
spaceId: z.ZodString;
|
|
33
|
+
usage: z.ZodNullable<z.ZodObject<{
|
|
34
|
+
period: z.ZodObject<{
|
|
35
|
+
start: z.ZodString;
|
|
36
|
+
end: z.ZodString;
|
|
37
|
+
resolution: z.ZodEnum<{
|
|
38
|
+
day: "day";
|
|
39
|
+
hour: "hour";
|
|
40
|
+
month: "month";
|
|
41
|
+
}>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
sampledAt: z.ZodString;
|
|
44
|
+
storageBytes: z.ZodNumber;
|
|
45
|
+
computeSeconds: z.ZodNumber;
|
|
46
|
+
bandwidthBytes: z.ZodNumber;
|
|
47
|
+
emailCount: z.ZodNumber;
|
|
48
|
+
functionInvocations: z.ZodNumber;
|
|
49
|
+
functionErrors: z.ZodNumber;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
}, z.core.$strip>;
|
|
52
|
+
export type SpaceUsageMeasurement = z.infer<typeof spaceUsageMeasurementSchema>;
|
|
53
|
+
export type SpaceUsageResponse = z.infer<typeof spaceUsageResponseSchema>;
|
|
54
|
+
export declare const functionUsagePushSchema: z.ZodObject<{
|
|
55
|
+
spaceId: z.ZodString;
|
|
56
|
+
versionId: z.ZodString;
|
|
57
|
+
invocations: z.ZodNumber;
|
|
58
|
+
errors: z.ZodNumber;
|
|
59
|
+
observedAt: z.ZodString;
|
|
60
|
+
}, z.core.$strip>;
|
|
61
|
+
export type FunctionUsagePush = z.infer<typeof functionUsagePushSchema>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Resolutions the hosting provider keeps usage at. Hour is retained about a
|
|
4
|
+
* week, day about two months, month about two years.
|
|
5
|
+
*/
|
|
6
|
+
export const USAGE_RESOLUTIONS = ["hour", "day", "month"];
|
|
7
|
+
export const usageResolutionSchema = z.enum(USAGE_RESOLUTIONS);
|
|
8
|
+
// Served by `GET /v1/spaces/{spaceId}/usage`: what one Space actually consumed,
|
|
9
|
+
// measured by the infrastructure that served it rather than derived from what
|
|
10
|
+
// was published.
|
|
11
|
+
//
|
|
12
|
+
// Every number here is a MEASUREMENT OF A PAST PERIOD, not a live gauge, and the
|
|
13
|
+
// contract says so out loud: `period` is the window measured and `sampledAt` is
|
|
14
|
+
// when we last asked. Nothing in this response means "right now". The meter
|
|
15
|
+
// behind it is a time series with real ingestion delay, so a reading is only
|
|
16
|
+
// trusted once its period has settled — expect the period to end an hour or so
|
|
17
|
+
// before you read it.
|
|
18
|
+
export const spaceUsageMeasurementSchema = z.object({
|
|
19
|
+
period: z
|
|
20
|
+
.object({
|
|
21
|
+
start: z.string().describe("First instant of the measured period."),
|
|
22
|
+
end: z
|
|
23
|
+
.string()
|
|
24
|
+
.describe("Last instant of the measured period. The numbers are current as of here."),
|
|
25
|
+
resolution: usageResolutionSchema.describe("Length of the measured period."),
|
|
26
|
+
})
|
|
27
|
+
.describe("The window these numbers describe."),
|
|
28
|
+
sampledAt: z
|
|
29
|
+
.string()
|
|
30
|
+
.describe("When the platform last read this space's usage from the serving infrastructure."),
|
|
31
|
+
storageBytes: z
|
|
32
|
+
.number()
|
|
33
|
+
.describe("Average bytes of disk the space occupied during the period. This is what storage is billed on: bytes actually on disk, not the size of what was uploaded."),
|
|
34
|
+
computeSeconds: z.number().describe("Seconds of compute the space consumed during the period."),
|
|
35
|
+
bandwidthBytes: z.number().describe("Bytes the space served during the period."),
|
|
36
|
+
emailCount: z.number().int().describe("Emails the space sent during the period."),
|
|
37
|
+
functionInvocations: z
|
|
38
|
+
.number()
|
|
39
|
+
.int()
|
|
40
|
+
.describe("Function invocations during the period, counted where the space is known. Best-effort: counts are pushed after each request completes and may arrive late."),
|
|
41
|
+
functionErrors: z
|
|
42
|
+
.number()
|
|
43
|
+
.int()
|
|
44
|
+
.describe("Function invocations during the period that ended in an error."),
|
|
45
|
+
});
|
|
46
|
+
export const spaceUsageResponseSchema = z.object({
|
|
47
|
+
spaceId: z.string().describe("The space the usage was measured for."),
|
|
48
|
+
usage: spaceUsageMeasurementSchema
|
|
49
|
+
.nullable()
|
|
50
|
+
.describe("Null when this space has never been measured — a space that has not served yet, or one whose first measurement period has not settled."),
|
|
51
|
+
});
|
|
52
|
+
// Posted by the Functions host's tail Worker after an isolate finishes serving.
|
|
53
|
+
// Counts only — never messages. Function LOGS travel a different path, into the
|
|
54
|
+
// space's own log stream, and merging the two would quietly turn this into a
|
|
55
|
+
// second log pipeline.
|
|
56
|
+
export const functionUsagePushSchema = z.object({
|
|
57
|
+
spaceId: z.string().min(1).describe("The space whose functions ran."),
|
|
58
|
+
versionId: z.string().min(1).describe("The version whose bundle served the requests."),
|
|
59
|
+
invocations: z.number().int().nonnegative().describe("Requests the isolate served."),
|
|
60
|
+
errors: z.number().int().nonnegative().describe("Those requests that ended in an error."),
|
|
61
|
+
observedAt: z
|
|
62
|
+
.string()
|
|
63
|
+
.describe("The reporter's clock at delivery. The control plane buckets by hour on receipt."),
|
|
64
|
+
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const variableScope: z.ZodEnum<{
|
|
3
|
-
site: "site";
|
|
4
3
|
space: "space";
|
|
5
4
|
principal: "principal";
|
|
6
5
|
}>;
|
|
@@ -8,7 +7,6 @@ export declare const variableNameSchema: z.ZodString;
|
|
|
8
7
|
export declare const VariableSchema: z.ZodObject<{
|
|
9
8
|
name: z.ZodString;
|
|
10
9
|
scope: z.ZodEnum<{
|
|
11
|
-
site: "site";
|
|
12
10
|
space: "space";
|
|
13
11
|
principal: "principal";
|
|
14
12
|
}>;
|
|
@@ -47,7 +45,6 @@ export declare const variableListResponseSchema: z.ZodObject<{
|
|
|
47
45
|
data: z.ZodArray<z.ZodObject<{
|
|
48
46
|
name: z.ZodString;
|
|
49
47
|
scope: z.ZodEnum<{
|
|
50
|
-
site: "site";
|
|
51
48
|
space: "space";
|
|
52
49
|
principal: "principal";
|
|
53
50
|
}>;
|
|
@@ -66,7 +63,6 @@ export declare const spaceVariableListResponseSchema: z.ZodObject<{
|
|
|
66
63
|
data: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
67
64
|
name: z.ZodString;
|
|
68
65
|
scope: z.ZodEnum<{
|
|
69
|
-
site: "site";
|
|
70
66
|
space: "space";
|
|
71
67
|
principal: "principal";
|
|
72
68
|
}>;
|
|
@@ -89,7 +85,6 @@ export declare const variableMutationResponseSchema: z.ZodObject<{
|
|
|
89
85
|
data: z.ZodObject<{
|
|
90
86
|
name: z.ZodString;
|
|
91
87
|
scope: z.ZodEnum<{
|
|
92
|
-
site: "site";
|
|
93
88
|
space: "space";
|
|
94
89
|
principal: "principal";
|
|
95
90
|
}>;
|
|
@@ -122,8 +117,8 @@ export declare const variableMutationResponseSchema: z.ZodObject<{
|
|
|
122
117
|
code: z.ZodString;
|
|
123
118
|
severity: z.ZodEnum<{
|
|
124
119
|
info: "info";
|
|
125
|
-
error: "error";
|
|
126
120
|
warning: "warning";
|
|
121
|
+
error: "error";
|
|
127
122
|
}>;
|
|
128
123
|
message: z.ZodString;
|
|
129
124
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -166,8 +161,8 @@ export declare const variableDeleteResponseSchema: z.ZodObject<{
|
|
|
166
161
|
code: z.ZodString;
|
|
167
162
|
severity: z.ZodEnum<{
|
|
168
163
|
info: "info";
|
|
169
|
-
error: "error";
|
|
170
164
|
warning: "warning";
|
|
165
|
+
error: "error";
|
|
171
166
|
}>;
|
|
172
167
|
message: z.ZodString;
|
|
173
168
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { AsyncOperationSchema, CursorPaginationSchema, cursorListQuerySchema } from "./common.js";
|
|
3
3
|
// Variable (internal-docs/platform.md "Product Data Shapes"): one model for
|
|
4
|
-
// every scope. Resolution order at finalize is space -> principal
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
|
|
4
|
+
// every scope. Resolution order at finalize is space -> principal. A space IS
|
|
5
|
+
// a site, so a space variable is the site variable — there is no third scope
|
|
6
|
+
// underneath it. Secret values are write-only after creation: never returned
|
|
7
|
+
// by API, CLI, UI, diagnostics, logs, or activity.
|
|
8
|
+
export const variableScope = z.enum(["space", "principal"]);
|
|
8
9
|
export const variableNameSchema = z
|
|
9
10
|
.string()
|
|
10
11
|
.min(1)
|
|
@@ -17,7 +18,7 @@ export const variableNameSchema = z
|
|
|
17
18
|
});
|
|
18
19
|
export const VariableSchema = z.object({
|
|
19
20
|
name: variableNameSchema.describe("Variable name, referenced as {{ vars.NAME }} in templates."),
|
|
20
|
-
scope: variableScope.describe("Where the variable is defined; space wins over principal
|
|
21
|
+
scope: variableScope.describe("Where the variable is defined; space wins over principal."),
|
|
21
22
|
secret: z.boolean().describe("Secret values are write-only and never returned after creation."),
|
|
22
23
|
value: z.string().optional().describe("Variable value; omitted when secret=true."),
|
|
23
24
|
channelValues: z
|
|
@@ -94,8 +94,8 @@ export declare const webhookDeliverySchema: z.ZodObject<{
|
|
|
94
94
|
code: z.ZodString;
|
|
95
95
|
severity: z.ZodEnum<{
|
|
96
96
|
info: "info";
|
|
97
|
-
error: "error";
|
|
98
97
|
warning: "warning";
|
|
98
|
+
error: "error";
|
|
99
99
|
}>;
|
|
100
100
|
message: z.ZodString;
|
|
101
101
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -135,8 +135,8 @@ export declare const webhookDeliveryListResponseSchema: z.ZodObject<{
|
|
|
135
135
|
code: z.ZodString;
|
|
136
136
|
severity: z.ZodEnum<{
|
|
137
137
|
info: "info";
|
|
138
|
-
error: "error";
|
|
139
138
|
warning: "warning";
|
|
139
|
+
error: "error";
|
|
140
140
|
}>;
|
|
141
141
|
message: z.ZodString;
|
|
142
142
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
package/dist/contracts/zero.d.ts
CHANGED
|
@@ -12,6 +12,13 @@ import { type RuntimeRealtimeMode } from "./execution.js";
|
|
|
12
12
|
* for the narrow surface both products can host.
|
|
13
13
|
*/
|
|
14
14
|
export declare const ZERO_SOURCE_METADATA_KEY = "statticZero";
|
|
15
|
+
/**
|
|
16
|
+
* The tag a compiled capsule artifact carries — in the finalize payload, the
|
|
17
|
+
* runtime config, the install profile, the client config the browser reads, and
|
|
18
|
+
* every realtime event — so PHP and the Rust runner can tell what they were
|
|
19
|
+
* handed. It is a property of the artifact the tree produced, not a kind a
|
|
20
|
+
* space declares: a publish can carry this beside a worker.
|
|
21
|
+
*/
|
|
15
22
|
export declare const ZERO_RUNTIME_KIND = "zero";
|
|
16
23
|
export declare const ZERO_PLATFORM_ROUTE_PREFIX = "/__spacefast/zero";
|
|
17
24
|
/**
|
|
@@ -37,9 +44,55 @@ export declare const ZERO_RUNTIME_CONFIG_PATH = "__spacefast/zero/config.json";
|
|
|
37
44
|
export declare const ZERO_RUNTIME_BINARY_PATH = "__spacefast/zero/bin/stattic-runtime";
|
|
38
45
|
export declare const ZERO_RUNTIME_BINARY_COMPATIBILITY_TARGET = "wpcloud-linux-x86_64-gnu-v1";
|
|
39
46
|
export declare const ZERO_RUNTIME_BUNDLE_ROOT = "__spacefast/zero/bundles";
|
|
40
|
-
export declare const ZERO_RUNTIME_CLIENT_BUNDLE_PATH = "__spacefast/zero/bundles/client.js";
|
|
41
47
|
export declare const ZERO_RUNTIME_SERVER_BUNDLE_PATH = "__spacefast/zero/bundles/server.qjs.mjs";
|
|
42
|
-
|
|
48
|
+
/** The compiled capsule client, served at the app root. */
|
|
49
|
+
export declare const ZERO_PUBLIC_CLIENT_BUNDLE_PATH = "client.js";
|
|
50
|
+
/**
|
|
51
|
+
* Where platform-owned client bytes serve from: same origin as the space, one
|
|
52
|
+
* content-addressed directory per platform build.
|
|
53
|
+
*
|
|
54
|
+
* Same origin is the whole point. Browsers have partitioned the HTTP cache by
|
|
55
|
+
* top-level site since 2020, so a shared third-party CDN buys nothing a
|
|
56
|
+
* same-origin URL does not — and costs a `script-src` hole. What a stable,
|
|
57
|
+
* content-addressed URL does buy is real: the digest changes only when the
|
|
58
|
+
* platform bytes change, so publishing a capsule a hundred times re-downloads
|
|
59
|
+
* the capsule's own bundle a hundred times and the platform's exactly once.
|
|
60
|
+
*
|
|
61
|
+
* Underscore-prefixed by framework convention (`_next/static`, `_astro`), which
|
|
62
|
+
* is also how the runtime recognises it as immutable — see `immutable_path` in
|
|
63
|
+
* `crates/stattic-runtime-core/src/finalize.rs`.
|
|
64
|
+
*/
|
|
65
|
+
export declare const ZERO_PLATFORM_ASSET_NAMESPACE = "_spacefast";
|
|
66
|
+
export declare const ZERO_PLATFORM_ASSET_ROOT = "_spacefast/platform";
|
|
67
|
+
/** The serving path of one file in the platform build identified by `digest`. */
|
|
68
|
+
export declare function zeroPlatformAssetPath(digest: string, fileName: string): string;
|
|
69
|
+
/**
|
|
70
|
+
* The compiled capsule server, which the QuickJS runner instantiates whole.
|
|
71
|
+
*
|
|
72
|
+
* 768 KiB is inherited, not measured: nobody has yet established what the
|
|
73
|
+
* runner actually tolerates, and DS77 keeps the number only until someone does.
|
|
74
|
+
* It binds a real resource — the runner holds the module graph in the site's
|
|
75
|
+
* PHP-worker memory before executing anything — so it stays low deliberately;
|
|
76
|
+
* server code is handlers, not an application.
|
|
77
|
+
*/
|
|
78
|
+
export declare const ZERO_SERVER_BUNDLE_MAX_BYTES = 786432;
|
|
79
|
+
/**
|
|
80
|
+
* The tenant client bundle, and every other file the compile ships as content.
|
|
81
|
+
*
|
|
82
|
+
* This measures what the tenant publishes, and only that: the SDK, the kit, the
|
|
83
|
+
* chart layer, preact, recharts and lucide are externals resolved through the
|
|
84
|
+
* shell's import map to {@link ZERO_PLATFORM_ASSET_ROOT}, so platform bytes are
|
|
85
|
+
* never weighed here (DS42). What remains is author code plus whatever npm the
|
|
86
|
+
* author chose to bundle.
|
|
87
|
+
*
|
|
88
|
+
* 8 MiB matches the Functions per-entry cap (DS77) because the same reasoning
|
|
89
|
+
* applies: a client bundle is static bytes to a browser, so nothing on the
|
|
90
|
+
* serving side binds it, and the cap exists to fail an accidental
|
|
91
|
+
* hundred-megabyte dependency in our tooling — where the build can say which
|
|
92
|
+
* modules are large — rather than at upload. It is a guardrail, not a budget;
|
|
93
|
+
* the size report is what an author should be reading.
|
|
94
|
+
*/
|
|
95
|
+
export declare const ZERO_CLIENT_BUNDLE_MAX_BYTES: number;
|
|
43
96
|
/**
|
|
44
97
|
* A capsule's compiled server travels as version metadata, not as content, so a
|
|
45
98
|
* server-only change leaves the published app shell byte-identical — and the
|
|
@@ -58,7 +111,7 @@ export declare const ZERO_MANAGED_TABLE_COLUMNS: readonly ["id", "createdAt", "u
|
|
|
58
111
|
* router and auth flow already do.
|
|
59
112
|
*/
|
|
60
113
|
export declare const ZERO_RESERVED_APP_ROUTE_PATHS: readonly ["/", "/index.html", "/client.js", "/auth/callback"];
|
|
61
|
-
export declare const ZERO_RESERVED_APP_ROUTE_PREFIXES: readonly ["/auth/"];
|
|
114
|
+
export declare const ZERO_RESERVED_APP_ROUTE_PREFIXES: readonly ["/auth/", "/_spacefast/"];
|
|
62
115
|
export declare const zeroEndpointSchema: z.ZodObject<{
|
|
63
116
|
method: z.ZodEnum<{
|
|
64
117
|
POST: "POST";
|
|
@@ -129,10 +182,12 @@ export declare const zeroDatabaseSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
129
182
|
}, z.core.$strict>>;
|
|
130
183
|
export type ZeroDatabase = z.infer<typeof zeroDatabaseSchema>;
|
|
131
184
|
/**
|
|
132
|
-
*
|
|
133
|
-
* client and server fit comfortably under the ceiling, and inlining keeps the
|
|
185
|
+
* The compiled server travels inline in the finalize payload; inlining keeps the
|
|
134
186
|
* whole version one atomic write. Functions bundles do the opposite and land
|
|
135
187
|
* in the content store first; see `functionsBundleRefSchema`.
|
|
188
|
+
*
|
|
189
|
+
* The client never travels this way. It is content — the browser fetches it
|
|
190
|
+
* from the version tree like any other asset — so it ships as a static file.
|
|
136
191
|
*/
|
|
137
192
|
export declare const zeroRuntimeBundleSchema: z.ZodObject<{
|
|
138
193
|
path: z.ZodString;
|
|
@@ -160,6 +215,9 @@ export declare const zeroRuntimeRunSourceSchema: z.ZodObject<{
|
|
|
160
215
|
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
161
216
|
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
162
217
|
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
218
|
+
gravatar: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
219
|
+
spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
220
|
+
email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
163
221
|
}, z.core.$strip>>;
|
|
164
222
|
db: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
165
223
|
}, z.core.$strict>;
|
|
@@ -185,6 +243,9 @@ export declare const zeroRuntimeEndpointSourceSchema: z.ZodObject<{
|
|
|
185
243
|
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
186
244
|
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
187
245
|
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
246
|
+
gravatar: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
247
|
+
spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
248
|
+
email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
188
249
|
}, z.core.$strip>>;
|
|
189
250
|
db: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
190
251
|
}, z.core.$strict>;
|
|
@@ -754,6 +815,9 @@ export declare const zeroRuntimeFinalizePayloadSchema: z.ZodObject<{
|
|
|
754
815
|
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
755
816
|
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
756
817
|
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
818
|
+
gravatar: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
819
|
+
spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
820
|
+
email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
757
821
|
}, z.core.$strip>>;
|
|
758
822
|
db: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
759
823
|
}, z.core.$strict>>>;
|
|
@@ -768,6 +832,9 @@ export declare const zeroRuntimeFinalizePayloadSchema: z.ZodObject<{
|
|
|
768
832
|
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
769
833
|
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
770
834
|
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
835
|
+
gravatar: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
836
|
+
spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
837
|
+
email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
771
838
|
}, z.core.$strip>>;
|
|
772
839
|
db: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
773
840
|
}, z.core.$strict>>>;
|
|
@@ -872,6 +939,10 @@ export declare const zeroRuntimeConfigSchema: z.ZodObject<{
|
|
|
872
939
|
signOutUrl: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
873
940
|
returnToParam: z.ZodDefault<z.ZodString>;
|
|
874
941
|
}, z.core.$strict>>;
|
|
942
|
+
variables: z.ZodObject<{
|
|
943
|
+
source: z.ZodLiteral<"stattic-variables">;
|
|
944
|
+
names: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
945
|
+
}, z.core.$strict>;
|
|
875
946
|
realtime: z.ZodObject<{
|
|
876
947
|
mode: z.ZodEnum<{
|
|
877
948
|
local: "local";
|
|
@@ -886,10 +957,6 @@ export declare const zeroRuntimeConfigSchema: z.ZodObject<{
|
|
|
886
957
|
token: z.ZodString;
|
|
887
958
|
}, z.core.$strict>>;
|
|
888
959
|
}, z.core.$strict>;
|
|
889
|
-
variables: z.ZodObject<{
|
|
890
|
-
source: z.ZodLiteral<"stattic-variables">;
|
|
891
|
-
names: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
892
|
-
}, z.core.$strict>;
|
|
893
960
|
artifact: z.ZodObject<{
|
|
894
961
|
format: z.ZodLiteral<"stattic.zero.capsule.v1">;
|
|
895
962
|
appName: z.ZodString;
|
|
@@ -1318,6 +1385,9 @@ export declare const zeroDeployMetadataSchema: z.ZodObject<{
|
|
|
1318
1385
|
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1319
1386
|
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1320
1387
|
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1388
|
+
gravatar: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1389
|
+
spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1390
|
+
email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1321
1391
|
}, z.core.$strip>>;
|
|
1322
1392
|
db: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1323
1393
|
}, z.core.$strict>>>;
|
|
@@ -1332,6 +1402,9 @@ export declare const zeroDeployMetadataSchema: z.ZodObject<{
|
|
|
1332
1402
|
env: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1333
1403
|
realtime: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1334
1404
|
logging: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1405
|
+
gravatar: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1406
|
+
spam: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1407
|
+
email: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
1335
1408
|
}, z.core.$strip>>;
|
|
1336
1409
|
db: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1337
1410
|
}, z.core.$strict>>>;
|
|
@@ -1429,22 +1502,23 @@ export declare const zeroDeployMetadataSchema: z.ZodObject<{
|
|
|
1429
1502
|
}, z.core.$strict>;
|
|
1430
1503
|
export type ZeroDeployMetadata = z.infer<typeof zeroDeployMetadataSchema>;
|
|
1431
1504
|
/**
|
|
1432
|
-
* What a live Zero capsule is, as the `
|
|
1505
|
+
* What a live Zero capsule is, as the `capsule` member of a space's runtime
|
|
1506
|
+
* status.
|
|
1433
1507
|
*
|
|
1434
1508
|
* There is no `versionId` here: this only ever describes the version the status
|
|
1435
1509
|
* response already names as live, and repeating it would invite the two to
|
|
1436
1510
|
* disagree. `artifactId` stays because it identifies the built capsule rather
|
|
1437
|
-
* than the publish that carries it.
|
|
1511
|
+
* than the publish that carries it. There is no kind tag either — the member it
|
|
1512
|
+
* rides in already says which product answered.
|
|
1438
1513
|
*
|
|
1439
1514
|
* Every field is derived from the version's own finalize metadata, which is
|
|
1440
1515
|
* what makes this safe to answer for a space whose runtime is asleep,
|
|
1441
1516
|
* mid-move, or failing: nothing here costs a call to the space's origin. It is
|
|
1442
1517
|
* also why there are no counts of things listed here — a caller that wants
|
|
1443
1518
|
* `tables.length` can take it — and why the database is not a field: a capsule
|
|
1444
|
-
* always owns one, so
|
|
1519
|
+
* always owns one, so its presence already said so.
|
|
1445
1520
|
*/
|
|
1446
1521
|
export declare const zeroAppSchema: z.ZodObject<{
|
|
1447
|
-
runtimeKind: z.ZodLiteral<"zero">;
|
|
1448
1522
|
artifactId: z.ZodString;
|
|
1449
1523
|
appName: z.ZodString;
|
|
1450
1524
|
serverRuntime: z.ZodLiteral<"quickjs-rust">;
|
|
@@ -1525,49 +1599,6 @@ export declare const zeroAppSchema: z.ZodObject<{
|
|
|
1525
1599
|
}, z.core.$strict>;
|
|
1526
1600
|
}, z.core.$strict>;
|
|
1527
1601
|
export type ZeroApp = z.infer<typeof zeroAppSchema>;
|
|
1528
|
-
export declare const zeroLogListQuerySchema: z.ZodObject<{
|
|
1529
|
-
limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
|
|
1530
|
-
cursor: z.ZodOptional<z.ZodString>;
|
|
1531
|
-
requestId: z.ZodOptional<z.ZodString>;
|
|
1532
|
-
handlerName: z.ZodOptional<z.ZodString>;
|
|
1533
|
-
}, z.core.$strict>;
|
|
1534
|
-
export type ZeroLogListQuery = z.infer<typeof zeroLogListQuerySchema>;
|
|
1535
|
-
export declare const zeroLogEntrySchema: z.ZodObject<{
|
|
1536
|
-
id: z.ZodString;
|
|
1537
|
-
timestamp: z.ZodString;
|
|
1538
|
-
level: z.ZodEnum<{
|
|
1539
|
-
info: "info";
|
|
1540
|
-
error: "error";
|
|
1541
|
-
debug: "debug";
|
|
1542
|
-
warn: "warn";
|
|
1543
|
-
}>;
|
|
1544
|
-
requestId: z.ZodNullable<z.ZodString>;
|
|
1545
|
-
versionId: z.ZodNullable<z.ZodString>;
|
|
1546
|
-
handlerName: z.ZodNullable<z.ZodString>;
|
|
1547
|
-
message: z.ZodString;
|
|
1548
|
-
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1549
|
-
}, z.core.$strict>;
|
|
1550
|
-
export declare const zeroLogListResponseSchema: z.ZodObject<{
|
|
1551
|
-
data: z.ZodArray<z.ZodObject<{
|
|
1552
|
-
id: z.ZodString;
|
|
1553
|
-
timestamp: z.ZodString;
|
|
1554
|
-
level: z.ZodEnum<{
|
|
1555
|
-
info: "info";
|
|
1556
|
-
error: "error";
|
|
1557
|
-
debug: "debug";
|
|
1558
|
-
warn: "warn";
|
|
1559
|
-
}>;
|
|
1560
|
-
requestId: z.ZodNullable<z.ZodString>;
|
|
1561
|
-
versionId: z.ZodNullable<z.ZodString>;
|
|
1562
|
-
handlerName: z.ZodNullable<z.ZodString>;
|
|
1563
|
-
message: z.ZodString;
|
|
1564
|
-
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1565
|
-
}, z.core.$strict>>;
|
|
1566
|
-
pagination: z.ZodObject<{
|
|
1567
|
-
nextCursor: z.ZodNullable<z.ZodString>;
|
|
1568
|
-
}, z.core.$strict>;
|
|
1569
|
-
}, z.core.$strict>;
|
|
1570
|
-
export type ZeroLogListResponse = z.infer<typeof zeroLogListResponseSchema>;
|
|
1571
1602
|
export declare const zeroRealtimeEventIntakeResponseSchema: z.ZodObject<{
|
|
1572
1603
|
accepted: z.ZodLiteral<true>;
|
|
1573
1604
|
eventId: z.ZodString;
|