@spacefast/common 0.0.11 → 0.0.12
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/agents/connect-targets.d.ts +4 -4
- package/dist/agents/connect-targets.js +3 -3
- package/dist/agents/private-key-oauth.d.ts +37 -0
- package/dist/agents/private-key-oauth.js +158 -0
- package/dist/config/domains.js +1 -1
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/postgres-budget.d.ts +126 -0
- package/dist/config/postgres-budget.js +135 -0
- package/dist/config/postgres-budget.json +50 -0
- package/dist/contracts/access.d.ts +42 -24
- package/dist/contracts/access.js +73 -34
- package/dist/contracts/activity.d.ts +1 -1
- package/dist/contracts/activity.js +5 -5
- package/dist/contracts/api-keys.d.ts +53 -45
- package/dist/contracts/api-keys.js +1 -0
- package/dist/contracts/archives.d.ts +8 -8
- package/dist/contracts/builds.d.ts +8 -8
- package/dist/contracts/builds.js +28 -48
- package/dist/contracts/channels.js +1 -2
- package/dist/contracts/comments.d.ts +55 -19
- package/dist/contracts/comments.js +56 -17
- package/dist/contracts/common.d.ts +4 -3
- package/dist/contracts/common.js +2 -0
- package/dist/contracts/deployments.d.ts +3 -3
- package/dist/contracts/device-auth.d.ts +14 -12
- package/dist/contracts/docs.d.ts +5 -5
- package/dist/contracts/domains.d.ts +261 -1330
- package/dist/contracts/domains.js +39 -301
- package/dist/contracts/email-preferences.d.ts +50 -0
- package/dist/contracts/email-preferences.js +44 -0
- package/dist/contracts/enums.d.ts +1 -1
- package/dist/contracts/error-code-meta.d.ts +84 -15
- package/dist/contracts/error-code-meta.js +28 -4
- package/dist/contracts/error-codes.d.ts +1 -1
- package/dist/contracts/error-codes.js +24 -6
- package/dist/contracts/events.d.ts +13 -13
- package/dist/contracts/feature-lifecycle.d.ts +644 -2
- package/dist/contracts/feature-lifecycle.js +685 -2
- package/dist/contracts/features.d.ts +236 -24
- package/dist/contracts/features.js +3 -272
- package/dist/contracts/ids.d.ts +1 -2
- package/dist/contracts/ids.js +1 -2
- package/dist/contracts/internal.d.ts +3 -3
- package/dist/contracts/mcp.d.ts +6 -6
- package/dist/contracts/me.js +1 -1
- package/dist/contracts/mounts.d.ts +142 -0
- package/dist/contracts/mounts.js +56 -0
- package/dist/contracts/oauth-resources.d.ts +5 -5
- package/dist/contracts/oauth-resources.js +1 -0
- package/dist/contracts/operations.d.ts +2 -2
- package/dist/contracts/pages.d.ts +2 -2
- package/dist/contracts/pages.js +8 -3
- package/dist/contracts/plan-policy.d.ts +1 -1
- package/dist/contracts/platform.d.ts +3 -3
- package/dist/contracts/resources.d.ts +12 -20
- package/dist/contracts/resources.js +13 -37
- package/dist/contracts/runtime-api.d.ts +330 -16
- package/dist/contracts/runtime-api.js +58 -14
- package/dist/contracts/sf-config-v1.js +1 -1
- package/dist/contracts/sites.d.ts +12 -12
- package/dist/contracts/sites.js +18 -11
- package/dist/contracts/space-config.d.ts +2 -3
- package/dist/contracts/space-config.js +3 -1
- package/dist/contracts/spaces.d.ts +143 -102
- package/dist/contracts/spaces.js +109 -43
- package/dist/contracts/superadmin-emails.d.ts +25 -1
- package/dist/contracts/superadmin-emails.js +10 -15
- package/dist/contracts/superadmin-runtime.d.ts +2 -2
- package/dist/contracts/superadmin-spaces.d.ts +6 -14
- package/dist/contracts/tags.d.ts +43 -13
- package/dist/contracts/tags.js +195 -11
- package/dist/contracts/transfers.d.ts +1 -1
- package/dist/contracts/variables.d.ts +4 -4
- package/dist/contracts/variables.js +4 -3
- package/dist/contracts/webhooks.d.ts +2 -2
- package/dist/contracts/zero.d.ts +329 -7
- package/dist/contracts/zero.js +121 -2
- package/dist/dashboard-paths/index.d.ts +1 -1
- package/dist/docs/agent-setup.d.ts +4 -2
- package/dist/docs/agent-setup.js +15 -7
- package/dist/docs/agent-solutions.js +1 -1
- package/dist/docs/catalog.d.ts +8 -10
- package/dist/docs/catalog.js +8 -10
- package/dist/docs/error-docs.js +86 -18
- package/dist/utils/access-grant.d.ts +14 -0
- package/dist/utils/access-grant.js +88 -0
- package/dist/utils/access-match.d.ts +7 -0
- package/dist/utils/access-match.fixtures.json +513 -0
- package/dist/utils/access-match.js +32 -16
- package/dist/utils/access-verdict.fixtures.json +421 -0
- package/dist/utils/credential-policy.d.ts +1 -1
- package/dist/utils/dns-instructions.d.ts +29 -0
- package/dist/utils/dns-instructions.js +78 -0
- package/dist/utils/domain-diagnostics.d.ts +29 -0
- package/dist/utils/domain-diagnostics.js +63 -0
- package/dist/utils/egress-policy.fixtures.json +51 -0
- package/dist/utils/id-hints.d.ts +1 -0
- package/dist/utils/id-hints.js +55 -13
- package/dist/utils/page-colors.d.ts +50 -0
- package/dist/utils/page-colors.js +167 -0
- package/dist/utils/page-fonts.d.ts +2 -0
- package/dist/utils/page-fonts.js +4 -0
- package/dist/utils/pages.d.ts +8 -1
- package/dist/utils/pages.js +123 -37
- package/dist/utils/production-runtime.d.ts +18 -0
- package/dist/utils/production-runtime.js +28 -0
- package/dist/utils/query-keys.d.ts +6 -7
- package/dist/utils/query-keys.js +11 -12
- package/dist/utils/sf-config-v1.fixtures.json +9 -0
- package/dist/utils/sf-config-v1.js +28 -19
- package/dist/utils/source-archive-policy.d.ts +2 -0
- package/dist/utils/source-archive-policy.js +2 -0
- package/dist/utils/static-runtime-policy.fixtures.json +57 -0
- package/dist/utils/static-runtime-policy.js +1 -1
- package/package.json +5 -4
- package/dist/contracts/annotations.d.ts +0 -327
- package/dist/contracts/annotations.js +0 -235
- package/dist/contracts/generated-feature-launch-entries.d.ts +0 -2
- package/dist/contracts/generated-feature-launch-entries.js +0 -518
- package/dist/contracts/publishes.d.ts +0 -135
- package/dist/contracts/publishes.js +0 -162
|
@@ -14,6 +14,7 @@ export declare const SitePressureSchema: z.ZodObject<{
|
|
|
14
14
|
lastSampleAt: z.ZodOptional<z.ZodString>;
|
|
15
15
|
consecutivePressured: z.ZodOptional<z.ZodNumber>;
|
|
16
16
|
consecutiveClean: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
placementHoldRevision: z.ZodOptional<z.ZodNumber>;
|
|
17
18
|
pressureHoldUntil: z.ZodOptional<z.ZodString>;
|
|
18
19
|
lastBulkLaneActivityAt: z.ZodOptional<z.ZodString>;
|
|
19
20
|
}, z.core.$loose>;
|
|
@@ -76,8 +77,8 @@ export declare const SiteSchema: z.ZodObject<{
|
|
|
76
77
|
code: z.ZodString;
|
|
77
78
|
severity: z.ZodEnum<{
|
|
78
79
|
info: "info";
|
|
79
|
-
warning: "warning";
|
|
80
80
|
error: "error";
|
|
81
|
+
warning: "warning";
|
|
81
82
|
}>;
|
|
82
83
|
message: z.ZodString;
|
|
83
84
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -98,9 +99,10 @@ export declare const SiteSchema: z.ZodObject<{
|
|
|
98
99
|
updatedAt: z.ZodString;
|
|
99
100
|
}, z.core.$strip>;
|
|
100
101
|
export type Site = z.infer<typeof SiteSchema>;
|
|
101
|
-
export declare const
|
|
102
|
+
export declare const operatorSiteProvisioningSchema: z.ZodOptional<z.ZodObject<{
|
|
102
103
|
importProviderSiteId: z.ZodOptional<z.ZodString>;
|
|
103
104
|
}, z.core.$strip>>;
|
|
105
|
+
export declare const tenantSiteProvisioningSchema: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
|
|
104
106
|
export declare const siteCreateSchema: z.ZodObject<{
|
|
105
107
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
106
108
|
static_runtime: "static_runtime";
|
|
@@ -110,10 +112,8 @@ export declare const siteCreateSchema: z.ZodObject<{
|
|
|
110
112
|
space: "space";
|
|
111
113
|
}>>;
|
|
112
114
|
region: z.ZodOptional<z.ZodString>;
|
|
113
|
-
provisioning: z.ZodOptional<z.ZodObject<{
|
|
114
|
-
|
|
115
|
-
}, z.core.$strip>>;
|
|
116
|
-
}, z.core.$strip>;
|
|
115
|
+
provisioning: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
|
|
116
|
+
}, z.core.$strict>;
|
|
117
117
|
export declare const siteListSchema: z.ZodObject<{
|
|
118
118
|
data: z.ZodArray<z.ZodObject<{
|
|
119
119
|
id: z.ZodString;
|
|
@@ -173,8 +173,8 @@ export declare const siteListSchema: z.ZodObject<{
|
|
|
173
173
|
code: z.ZodString;
|
|
174
174
|
severity: z.ZodEnum<{
|
|
175
175
|
info: "info";
|
|
176
|
-
warning: "warning";
|
|
177
176
|
error: "error";
|
|
177
|
+
warning: "warning";
|
|
178
178
|
}>;
|
|
179
179
|
message: z.ZodString;
|
|
180
180
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -264,8 +264,8 @@ export declare const SuperadminSiteSchema: z.ZodObject<{
|
|
|
264
264
|
code: z.ZodString;
|
|
265
265
|
severity: z.ZodEnum<{
|
|
266
266
|
info: "info";
|
|
267
|
-
warning: "warning";
|
|
268
267
|
error: "error";
|
|
268
|
+
warning: "warning";
|
|
269
269
|
}>;
|
|
270
270
|
message: z.ZodString;
|
|
271
271
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -353,8 +353,8 @@ export declare const SuperadminSiteListSchema: z.ZodObject<{
|
|
|
353
353
|
code: z.ZodString;
|
|
354
354
|
severity: z.ZodEnum<{
|
|
355
355
|
info: "info";
|
|
356
|
-
warning: "warning";
|
|
357
356
|
error: "error";
|
|
357
|
+
warning: "warning";
|
|
358
358
|
}>;
|
|
359
359
|
message: z.ZodString;
|
|
360
360
|
path: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -388,16 +388,16 @@ export declare const superadminSiteCreateSchema: z.ZodObject<{
|
|
|
388
388
|
kind: z.ZodDefault<z.ZodEnum<{
|
|
389
389
|
static_runtime: "static_runtime";
|
|
390
390
|
}>>;
|
|
391
|
+
region: z.ZodOptional<z.ZodString>;
|
|
391
392
|
isolation: z.ZodDefault<z.ZodEnum<{
|
|
392
393
|
site: "site";
|
|
393
394
|
space: "space";
|
|
394
395
|
}>>;
|
|
395
|
-
|
|
396
|
+
tenantId: z.ZodString;
|
|
396
397
|
provisioning: z.ZodOptional<z.ZodObject<{
|
|
397
398
|
importProviderSiteId: z.ZodOptional<z.ZodString>;
|
|
398
399
|
}, z.core.$strip>>;
|
|
399
|
-
|
|
400
|
-
}, z.core.$strip>;
|
|
400
|
+
}, z.core.$strict>;
|
|
401
401
|
export declare const siteRebalanceRequestSchema: z.ZodObject<{
|
|
402
402
|
spaceIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
403
403
|
}, z.core.$strip>;
|
package/dist/contracts/sites.js
CHANGED
|
@@ -36,6 +36,10 @@ export const SitePressureSchema = z
|
|
|
36
36
|
lastSampleAt: z.string().datetime().optional(),
|
|
37
37
|
consecutivePressured: z.number().int().nonnegative().optional(),
|
|
38
38
|
consecutiveClean: z.number().int().nonnegative().optional(),
|
|
39
|
+
// Monotonic CAS token shared by explicit operator hold actions and the
|
|
40
|
+
// pressure sampler. Every durable hold transition advances it, including
|
|
41
|
+
// transitions that restore a prior timestamp.
|
|
42
|
+
placementHoldRevision: z.number().int().nonnegative().optional(),
|
|
39
43
|
// Provenance stamp for the sampler's automatic hold: set on trip to the
|
|
40
44
|
// exact hold instant it wrote, so release only clears holds the pressure
|
|
41
45
|
// pipeline itself set — never an operator-set placement hold.
|
|
@@ -70,13 +74,10 @@ export const SiteSchema = z.object({
|
|
|
70
74
|
createdAt: z.string().datetime(),
|
|
71
75
|
updatedAt: z.string().datetime(),
|
|
72
76
|
});
|
|
73
|
-
//
|
|
74
|
-
//
|
|
75
|
-
//
|
|
76
|
-
|
|
77
|
-
// workers, and alias canonicalization are intentionally not exposed here; the
|
|
78
|
-
// control plane sets them from Spacefast runtime invariants.
|
|
79
|
-
export const siteProvisioningSchema = z
|
|
77
|
+
// Operator-only WP.Cloud provisioning controls. Tenant site creation never
|
|
78
|
+
// accepts provider object identifiers: authority to create a Spacefast site
|
|
79
|
+
// must not imply authority to adopt existing provider infrastructure.
|
|
80
|
+
export const operatorSiteProvisioningSchema = z
|
|
80
81
|
.object({
|
|
81
82
|
importProviderSiteId: z
|
|
82
83
|
.string()
|
|
@@ -86,12 +87,17 @@ export const siteProvisioningSchema = z
|
|
|
86
87
|
.describe("Import an existing WP.Cloud site by its atomic_site_id (operator flows)."),
|
|
87
88
|
})
|
|
88
89
|
.optional();
|
|
89
|
-
|
|
90
|
+
// An explicit empty object requests fresh provider provisioning while keeping
|
|
91
|
+
// every provider identity and runtime knob outside tenant control.
|
|
92
|
+
export const tenantSiteProvisioningSchema = z.object({}).strict().optional();
|
|
93
|
+
export const siteCreateSchema = z
|
|
94
|
+
.object({
|
|
90
95
|
kind: siteKind.default("static_runtime"),
|
|
91
96
|
isolation: siteIsolation.default("site"),
|
|
92
97
|
region: z.string().trim().min(1).optional().describe('Placement region; defaults to `"auto"`.'),
|
|
93
|
-
provisioning:
|
|
94
|
-
})
|
|
98
|
+
provisioning: tenantSiteProvisioningSchema,
|
|
99
|
+
})
|
|
100
|
+
.strict();
|
|
95
101
|
export const siteListSchema = z.object({
|
|
96
102
|
data: z.array(SiteSchema),
|
|
97
103
|
pagination: CursorPaginationSchema,
|
|
@@ -114,8 +120,9 @@ export const SuperadminSiteListSchema = z.object({
|
|
|
114
120
|
});
|
|
115
121
|
// Superadmin site create targets an explicit tenant (the tenant-facing
|
|
116
122
|
// `siteCreateSchema` derives the tenant from the principal).
|
|
117
|
-
export const superadminSiteCreateSchema = siteCreateSchema.extend({
|
|
123
|
+
export const superadminSiteCreateSchema = siteCreateSchema.omit({ provisioning: true }).extend({
|
|
118
124
|
tenantId: z.string().trim().min(1),
|
|
125
|
+
provisioning: operatorSiteProvisioningSchema,
|
|
119
126
|
});
|
|
120
127
|
// Operator rebalance trigger (internal-docs/platform.md "Space placement and
|
|
121
128
|
// moves": operator rebalancing is a move trigger). Queues `space_move`
|
|
@@ -56,7 +56,6 @@ export declare const spacePlacementModeSchema: z.ZodEnum<{
|
|
|
56
56
|
dedicated: "dedicated";
|
|
57
57
|
}>;
|
|
58
58
|
export declare const spacePlacementConfigSchema: z.ZodObject<{
|
|
59
|
-
region: z.ZodOptional<z.ZodString>;
|
|
60
59
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
61
60
|
shared: "shared";
|
|
62
61
|
dedicated: "dedicated";
|
|
@@ -128,7 +127,6 @@ export declare const spaceConfigSchema: z.ZodObject<{
|
|
|
128
127
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
129
128
|
}, z.core.$strict>>;
|
|
130
129
|
placement: z.ZodOptional<z.ZodObject<{
|
|
131
|
-
region: z.ZodOptional<z.ZodString>;
|
|
132
130
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
133
131
|
shared: "shared";
|
|
134
132
|
dedicated: "dedicated";
|
|
@@ -158,6 +156,7 @@ export declare const spaceAccessConfigSchema: z.ZodObject<{
|
|
|
158
156
|
ipCidrs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
159
157
|
agent: z.ZodOptional<z.ZodString>;
|
|
160
158
|
country: z.ZodOptional<z.ZodString>;
|
|
159
|
+
countryNotIn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
161
160
|
header: z.ZodOptional<z.ZodObject<{
|
|
162
161
|
name: z.ZodString;
|
|
163
162
|
value: z.ZodString;
|
|
@@ -270,7 +269,6 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
|
|
|
270
269
|
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
271
270
|
}, z.core.$strict>>;
|
|
272
271
|
placement: z.ZodOptional<z.ZodObject<{
|
|
273
|
-
region: z.ZodOptional<z.ZodString>;
|
|
274
272
|
mode: z.ZodOptional<z.ZodEnum<{
|
|
275
273
|
shared: "shared";
|
|
276
274
|
dedicated: "dedicated";
|
|
@@ -299,6 +297,7 @@ export declare const spaceConfigFileSchema: z.ZodObject<{
|
|
|
299
297
|
ipCidrs: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
300
298
|
agent: z.ZodOptional<z.ZodString>;
|
|
301
299
|
country: z.ZodOptional<z.ZodString>;
|
|
300
|
+
countryNotIn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
302
301
|
header: z.ZodOptional<z.ZodObject<{
|
|
303
302
|
name: z.ZodString;
|
|
304
303
|
value: z.ZodString;
|
|
@@ -128,9 +128,11 @@ export const spaceBuildSettingsSchema = z
|
|
|
128
128
|
// (enums.ts) rather than declaring a second "shared"/"dedicated" enum —
|
|
129
129
|
// space placement mode and normalized site class are the same axis.
|
|
130
130
|
export const spacePlacementModeSchema = normalizedSiteClass;
|
|
131
|
+
// No region knob: a space binds to the site it was placed on at creation and
|
|
132
|
+
// the only placement change that relocates it is shared -> dedicated. Data
|
|
133
|
+
// location is chosen once, at creation, and never changes.
|
|
131
134
|
export const spacePlacementConfigSchema = z
|
|
132
135
|
.object({
|
|
133
|
-
region: z.string().trim().min(1).optional(),
|
|
134
136
|
mode: spacePlacementModeSchema.optional(),
|
|
135
137
|
burstable: z.boolean().optional(),
|
|
136
138
|
})
|