@supacloud/cli 0.64.3 → 0.65.0
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/index.js +422 -40
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -206650,7 +206650,7 @@ function resolveSupaCloudContext(env = process.env, cwd = process.cwd(), selecti
|
|
|
206650
206650
|
var ACTION_POLICY = {
|
|
206651
206651
|
deploy: { write: ["deploy"] },
|
|
206652
206652
|
applications: {
|
|
206653
|
-
read: ["list_releases", "get_release", "get_runtime", "get_configuration"],
|
|
206653
|
+
read: ["list_releases", "get_release", "get_runtime", "get_deployment_evidence", "get_configuration"],
|
|
206654
206654
|
write: ["upload_release", "put_configuration", "activate_release", "reconcile_activation", "retire_activation"]
|
|
206655
206655
|
},
|
|
206656
206656
|
project: {
|
|
@@ -213443,7 +213443,9 @@ var DeliveryObjectSchema = _Object_2({
|
|
|
213443
213443
|
entryKind: Union3([
|
|
213444
213444
|
Literal2("compiled-module-factory"),
|
|
213445
213445
|
Literal2("bun-http-application"),
|
|
213446
|
-
Literal2("bun-worker-application")
|
|
213446
|
+
Literal2("bun-worker-application"),
|
|
213447
|
+
Literal2("go-worker-application"),
|
|
213448
|
+
Literal2("scriptc-worker-application")
|
|
213447
213449
|
]),
|
|
213448
213450
|
runtimeImports: _Array_(String3()),
|
|
213449
213451
|
files: _Array_(_Object_2({
|
|
@@ -213497,6 +213499,9 @@ function parseDeliveryBuildManifest(value) {
|
|
|
213497
213499
|
if (!Check3(DeliveryBuildManifestSchema, value))
|
|
213498
213500
|
throw new Error("Invalid delivery build manifest.");
|
|
213499
213501
|
validateWorkerExecution(value.plan.targets.flatMap((target) => target.execution ? [target.execution] : []));
|
|
213502
|
+
if (value.plan.targets.reduce((count, target) => count + (target.execution?.replicas ?? 1), 0) > 32) {
|
|
213503
|
+
throw new Error("Invalid delivery replica count.");
|
|
213504
|
+
}
|
|
213500
213505
|
for (const target of value.plan.targets) {
|
|
213501
213506
|
if (target.execution && (target.kind !== "jobs" || target.isolation !== "process" || target.execution.target !== target.name || target.jobs.length !== 1 || target.jobs[0]?.name !== target.execution.taskKey || value.objects.find((object) => object.name === target.name)?.entryKind !== "bun-worker-application")) {
|
|
213502
213507
|
throw new Error("Invalid delivery execution binding.");
|
|
@@ -213510,7 +213515,7 @@ function parseDeliveryBuildManifest(value) {
|
|
|
213510
213515
|
}
|
|
213511
213516
|
for (const object of value.objects) {
|
|
213512
213517
|
const target = value.plan.targets.find((target) => target.name === object.name);
|
|
213513
|
-
if (
|
|
213518
|
+
if (["bun-worker-application", "go-worker-application", "scriptc-worker-application"].includes(object.entryKind) && target?.kind !== "jobs" || object.entryKind === "bun-http-application" && target?.kind === "jobs") {
|
|
213514
213519
|
throw new Error("Delivery executable kind does not match its target.");
|
|
213515
213520
|
}
|
|
213516
213521
|
if (new Set(object.files.map((file) => file.path)).size !== object.files.length || !object.files.some((file) => file.path === object.entrypoint) || deliveryObjectDigest(object) !== object.objectId) {
|
|
@@ -213610,6 +213615,9 @@ function parseApplicationReleaseRecord(candidate) {
|
|
|
213610
213615
|
throw new Error("Invalid application release record.");
|
|
213611
213616
|
}
|
|
213612
213617
|
validateWorkerExecution(candidate.targets.flatMap((target) => target.execution ? [target.execution] : []));
|
|
213618
|
+
if (candidate.targets.reduce((count, target) => count + (target.execution?.replicas ?? 1), 0) > 32) {
|
|
213619
|
+
throw new Error("Invalid application replica count.");
|
|
213620
|
+
}
|
|
213613
213621
|
if (candidate.targets.some((target) => target.execution && (target.kind !== "worker" || target.execution.target !== target.name))) {
|
|
213614
213622
|
throw new Error("Invalid application execution binding.");
|
|
213615
213623
|
}
|
|
@@ -213733,6 +213741,131 @@ var ApplicationActivationRetirementResultSchema = _Object_2({
|
|
|
213733
213741
|
activation_id: ApplicationActivationIdSchema,
|
|
213734
213742
|
retired_at: String3()
|
|
213735
213743
|
}, { additionalProperties: false });
|
|
213744
|
+
// node_modules/@supacloud/delivery/src/deployment-evidence.ts
|
|
213745
|
+
var closed3 = { additionalProperties: false };
|
|
213746
|
+
var sha256 = String3({ pattern: "^[a-f0-9]{64}$" });
|
|
213747
|
+
var isoDate = String3({ minLength: 20, maxLength: 40 });
|
|
213748
|
+
var status = Union3([
|
|
213749
|
+
Literal2("confirmed"),
|
|
213750
|
+
Literal2("failed"),
|
|
213751
|
+
Literal2("unknown")
|
|
213752
|
+
]);
|
|
213753
|
+
var evidenceStatus = Union3([
|
|
213754
|
+
Literal2("confirmed"),
|
|
213755
|
+
Literal2("failed"),
|
|
213756
|
+
Literal2("unknown"),
|
|
213757
|
+
Literal2("incomplete")
|
|
213758
|
+
]);
|
|
213759
|
+
var DEPLOYMENT_EVIDENCE_SCHEMA = "supacloud.deployment-evidence.v1";
|
|
213760
|
+
var DatabaseProviderSchema = _Object_2({
|
|
213761
|
+
provider: String3({ minLength: 1, maxLength: 64, pattern: "^[a-z][a-z0-9_.-]*$" }),
|
|
213762
|
+
version: String3({ minLength: 1, maxLength: 64 }),
|
|
213763
|
+
topology: Union3([Literal2("single-node"), Literal2("distributed")]),
|
|
213764
|
+
migration: _Object_2({
|
|
213765
|
+
status,
|
|
213766
|
+
inventory_sha256: Union3([sha256, Null2()]),
|
|
213767
|
+
compatibility: Union3([
|
|
213768
|
+
Literal2("verified"),
|
|
213769
|
+
Literal2("not-proven"),
|
|
213770
|
+
Literal2("failed")
|
|
213771
|
+
])
|
|
213772
|
+
}, closed3),
|
|
213773
|
+
backup: _Object_2({
|
|
213774
|
+
status,
|
|
213775
|
+
latest_success_at: Union3([isoDate, Null2()]),
|
|
213776
|
+
freshness_seconds: Union3([Integer2({ minimum: 0 }), Null2()])
|
|
213777
|
+
}, closed3),
|
|
213778
|
+
recovery: _Object_2({
|
|
213779
|
+
status,
|
|
213780
|
+
drill_id: Union3([String3({ minLength: 1, maxLength: 128 }), Null2()]),
|
|
213781
|
+
rpo_seconds: Union3([Integer2({ minimum: 0 }), Null2()]),
|
|
213782
|
+
rto_seconds: Union3([Integer2({ minimum: 0 }), Null2()])
|
|
213783
|
+
}, closed3)
|
|
213784
|
+
}, closed3);
|
|
213785
|
+
var componentName = Union3([
|
|
213786
|
+
Literal2("management-api"),
|
|
213787
|
+
Literal2("web-console"),
|
|
213788
|
+
Literal2("edge-runtime"),
|
|
213789
|
+
Literal2("worker"),
|
|
213790
|
+
Literal2("postgres"),
|
|
213791
|
+
Literal2("postgrest"),
|
|
213792
|
+
Literal2("gotrue"),
|
|
213793
|
+
Literal2("storage"),
|
|
213794
|
+
Literal2("realtime")
|
|
213795
|
+
]);
|
|
213796
|
+
var DeploymentComponentEvidenceSchema = _Object_2({
|
|
213797
|
+
name: componentName,
|
|
213798
|
+
version: Union3([String3({ minLength: 1, maxLength: 128 }), Null2()]),
|
|
213799
|
+
status,
|
|
213800
|
+
health_check: Union3([String3({ minLength: 1, maxLength: 256 }), Null2()]),
|
|
213801
|
+
checked_at: Union3([isoDate, Null2()])
|
|
213802
|
+
}, closed3);
|
|
213803
|
+
var DeploymentEvidenceSchema = _Object_2({
|
|
213804
|
+
schema: Literal2(DEPLOYMENT_EVIDENCE_SCHEMA),
|
|
213805
|
+
status: evidenceStatus,
|
|
213806
|
+
recorded_at: isoDate,
|
|
213807
|
+
scope: _Object_2({
|
|
213808
|
+
project_ref: String3({ pattern: "^[a-z0-9-]{1,20}$" }),
|
|
213809
|
+
application_id: ApplicationIdSchema,
|
|
213810
|
+
environment_id: ApplicationIdSchema
|
|
213811
|
+
}, closed3),
|
|
213812
|
+
source: _Object_2({
|
|
213813
|
+
commit_sha: Union3([String3({ pattern: "^[0-9a-f]{7,64}$" }), Null2()]),
|
|
213814
|
+
manifest_sha256: sha256,
|
|
213815
|
+
contract_schema: Union3([String3({ minLength: 1, maxLength: 128 }), Null2()]),
|
|
213816
|
+
environment_binding_version: Union3([sha256, Null2()])
|
|
213817
|
+
}, closed3),
|
|
213818
|
+
database: DatabaseProviderSchema,
|
|
213819
|
+
components: _Array_(DeploymentComponentEvidenceSchema, { minItems: 1, maxItems: 32 }),
|
|
213820
|
+
activation: _Object_2({
|
|
213821
|
+
release_id: ApplicationReleaseIdSchema,
|
|
213822
|
+
configuration_id: ApplicationConfigurationIdSchema,
|
|
213823
|
+
activation_id: ApplicationConfigurationIdSchema
|
|
213824
|
+
}, closed3),
|
|
213825
|
+
health: _Object_2({
|
|
213826
|
+
status,
|
|
213827
|
+
checked_at: Union3([isoDate, Null2()]),
|
|
213828
|
+
authenticated_smoke: status
|
|
213829
|
+
}, closed3),
|
|
213830
|
+
rollback: _Object_2({
|
|
213831
|
+
release_id: Union3([ApplicationReleaseIdSchema, Null2()]),
|
|
213832
|
+
configuration_id: Union3([ApplicationConfigurationIdSchema, Null2()]),
|
|
213833
|
+
status: Union3([Literal2("ready"), Literal2("not-ready"), Literal2("unknown")]),
|
|
213834
|
+
result: Union3([status, Null2()])
|
|
213835
|
+
}, closed3),
|
|
213836
|
+
notes: _Array_(String3({ minLength: 1, maxLength: 512 }), { maxItems: 32 })
|
|
213837
|
+
}, closed3);
|
|
213838
|
+
function isIsoDate(value) {
|
|
213839
|
+
return Number.isFinite(Date.parse(value)) && new Date(value).toISOString() === value;
|
|
213840
|
+
}
|
|
213841
|
+
function statusValues(evidence) {
|
|
213842
|
+
return [
|
|
213843
|
+
evidence.database.migration.status,
|
|
213844
|
+
evidence.database.backup.status,
|
|
213845
|
+
evidence.database.recovery.status,
|
|
213846
|
+
...evidence.components.map((component) => component.status),
|
|
213847
|
+
evidence.health.status,
|
|
213848
|
+
evidence.health.authenticated_smoke,
|
|
213849
|
+
...evidence.rollback.result === null ? [] : [evidence.rollback.result]
|
|
213850
|
+
];
|
|
213851
|
+
}
|
|
213852
|
+
function deriveDeploymentEvidenceStatus(evidence) {
|
|
213853
|
+
const values = statusValues({ ...evidence, status: "incomplete" });
|
|
213854
|
+
if (values.includes("failed"))
|
|
213855
|
+
return "failed";
|
|
213856
|
+
if (values.includes("unknown"))
|
|
213857
|
+
return "unknown";
|
|
213858
|
+
if (evidence.database.migration.compatibility !== "verified" || evidence.rollback.status !== "ready" || evidence.components.some((component) => component.health_check === null || component.checked_at === null) || evidence.health.checked_at === null || evidence.health.authenticated_smoke !== "confirmed" || evidence.database.recovery.status !== "confirmed" || evidence.database.recovery.drill_id === null || evidence.database.recovery.rpo_seconds === null || evidence.database.recovery.rto_seconds === null) {
|
|
213859
|
+
return "incomplete";
|
|
213860
|
+
}
|
|
213861
|
+
return "confirmed";
|
|
213862
|
+
}
|
|
213863
|
+
function parseDeploymentEvidence(value) {
|
|
213864
|
+
if (!Check3(DeploymentEvidenceSchema, value) || !isIsoDate(value.recorded_at) || value.health.checked_at !== null && !isIsoDate(value.health.checked_at) || value.database.backup.latest_success_at !== null && !isIsoDate(value.database.backup.latest_success_at) || value.components.some((component) => component.checked_at !== null && !isIsoDate(component.checked_at)) || new Set(value.components.map((component) => component.name)).size !== value.components.length || deriveDeploymentEvidenceStatus(value) !== value.status) {
|
|
213865
|
+
throw new Error("Invalid deployment evidence.");
|
|
213866
|
+
}
|
|
213867
|
+
return structuredClone(value);
|
|
213868
|
+
}
|
|
213736
213869
|
// node_modules/@supacloud/delivery/src/application-runtime-identity.ts
|
|
213737
213870
|
var ApplicationRuntimeIdentitySchema = _Object_2({
|
|
213738
213871
|
schema: Literal2("supacloud.application-runtime.v1"),
|
|
@@ -219166,6 +219299,7 @@ var APPLICATION_TOOL_SCHEMA = {
|
|
|
219166
219299
|
"get_release",
|
|
219167
219300
|
"upload_release",
|
|
219168
219301
|
"get_runtime",
|
|
219302
|
+
"get_deployment_evidence",
|
|
219169
219303
|
"get_configuration",
|
|
219170
219304
|
"put_configuration",
|
|
219171
219305
|
"activate_release",
|
|
@@ -219339,6 +219473,30 @@ function registerApplicationTools(server2, http) {
|
|
|
219339
219473
|
return releaseControlFailure(operation, "INVALID_RESPONSE", result.status);
|
|
219340
219474
|
}
|
|
219341
219475
|
}
|
|
219476
|
+
if (action === "get_deployment_evidence") {
|
|
219477
|
+
const environmentId = text(args, "environment_id");
|
|
219478
|
+
if (!Check(ApplicationIdSchema2, environmentId))
|
|
219479
|
+
throw new Error("Invalid environment ID");
|
|
219480
|
+
const result = await http.get(`/v1/projects/${project}/applications/${encodeURIComponent(id)}/environments/${encodeURIComponent(environmentId)}/deployment-evidence`, { maxJsonBytes: 262144, responseTimeoutMs: 30000 });
|
|
219481
|
+
if (!result.ok)
|
|
219482
|
+
return releaseControlFailure(operation, "HTTP_ERROR", result.status);
|
|
219483
|
+
try {
|
|
219484
|
+
const data = result.data;
|
|
219485
|
+
if (!data || typeof data !== "object" || !("project_ref" in data) || data.project_ref !== ref || !("application_id" in data) || data.application_id !== id || !("environment_id" in data) || data.environment_id !== environmentId || !("evidence" in data))
|
|
219486
|
+
throw new Error;
|
|
219487
|
+
const evidence = data.evidence === null ? null : parseDeploymentEvidence(data.evidence);
|
|
219488
|
+
if (evidence && (evidence.scope.project_ref !== ref || evidence.scope.application_id !== id || evidence.scope.environment_id !== environmentId))
|
|
219489
|
+
throw new Error;
|
|
219490
|
+
return releaseControlSuccess(operation, {
|
|
219491
|
+
project_ref: ref,
|
|
219492
|
+
application_id: id,
|
|
219493
|
+
environment_id: environmentId,
|
|
219494
|
+
evidence
|
|
219495
|
+
});
|
|
219496
|
+
} catch {
|
|
219497
|
+
return releaseControlFailure(operation, "INVALID_RESPONSE", result.status);
|
|
219498
|
+
}
|
|
219499
|
+
}
|
|
219342
219500
|
if (action === "list_releases") {
|
|
219343
219501
|
const limit = args.limit ?? 50;
|
|
219344
219502
|
if (typeof limit !== "number" || !Number.isInteger(limit) || limit < 1 || limit > 100 || args.cursor !== undefined && !Check(ApplicationReleaseIdSchema2, args.cursor)) {
|
|
@@ -229204,6 +229362,8 @@ function renderClient(graph, options) {
|
|
|
229204
229362
|
const schemaLocals = new Map;
|
|
229205
229363
|
const usedTypeNames = new Set;
|
|
229206
229364
|
const allRoutes = [];
|
|
229365
|
+
const allProcedures = [];
|
|
229366
|
+
const commandByClassName = new Map(graph.modules.flatMap((module) => module.commands.map((command) => [command.className, command])));
|
|
229207
229367
|
let usesStatic = false;
|
|
229208
229368
|
let usesValue = false;
|
|
229209
229369
|
const uniqueTypeName = (candidate) => {
|
|
@@ -229334,8 +229494,21 @@ function renderClient(graph, options) {
|
|
|
229334
229494
|
const responseSchemaEntries = hasResponseMap ? Object.entries(responseSchemas).map(([status, ref]) => [status, ref.local]) : responseSchema ? [["200", responseSchema.local]] : [];
|
|
229335
229495
|
const responseSchemaArgument = responseSchemaEntries.length > 0 ? `{ ${responseSchemaEntries.map(([status, local]) => `${JSON.stringify(status)}: ${local}`).join(", ")} }` : "undefined";
|
|
229336
229496
|
const responseKindArgument = responseKind === undefined ? "undefined" : JSON.stringify(responseKind);
|
|
229497
|
+
const command = route.command === undefined ? undefined : commandByClassName.get(route.command);
|
|
229498
|
+
const procedureKind = route.method === "GET" || route.method === "HEAD" ? "query" : "mutation";
|
|
229499
|
+
const idempotencyMode = command?.idempotency ?? "none";
|
|
229500
|
+
allProcedures.push({
|
|
229501
|
+
method: route.method,
|
|
229502
|
+
path: fullPath,
|
|
229503
|
+
controller: controller.className,
|
|
229504
|
+
handler: route.handler,
|
|
229505
|
+
kind: procedureKind,
|
|
229506
|
+
...command?.name === undefined ? {} : { command: command.name },
|
|
229507
|
+
...command?.permission === undefined ? {} : { permission: command.permission },
|
|
229508
|
+
idempotency: idempotencyMode
|
|
229509
|
+
});
|
|
229337
229510
|
routeMethods.push(`
|
|
229338
|
-
${route.handler}: makeRoute<${requestTypeName}, ${responseType === "never" ? "never" : responseTypeName}>(${JSON.stringify(route.method)}, ${JSON.stringify(fullPath)}, ${responseSchemaArgument}, ${responseKindArgument}, ${route.parse === "none"}),`);
|
|
229511
|
+
${route.handler}: makeRoute<${requestTypeName}, ${responseType === "never" ? "never" : responseTypeName}, ${JSON.stringify(procedureKind)}, ${JSON.stringify(idempotencyMode)}>(${JSON.stringify(route.method)}, ${JSON.stringify(fullPath)}, ${responseSchemaArgument}, ${responseKindArgument}, ${route.parse === "none"}, ${JSON.stringify(procedureKind)}, ${JSON.stringify(idempotencyMode)}),`);
|
|
229339
229512
|
}
|
|
229340
229513
|
controllerEntries.push(`
|
|
229341
229514
|
${controllerKey}: {${routeMethods.join("")}
|
|
@@ -229366,6 +229539,43 @@ function renderClient(graph, options) {
|
|
|
229366
229539
|
"",
|
|
229367
229540
|
"export type ResponseDecoder<T> = (value: unknown) => T;",
|
|
229368
229541
|
"",
|
|
229542
|
+
'export type ProcedureKind = "query" | "mutation";',
|
|
229543
|
+
'export type IdempotencyMode = "required" | "none";',
|
|
229544
|
+
"",
|
|
229545
|
+
"export interface ProcedureExecutionOptions {",
|
|
229546
|
+
" /** Reuse the same key when retrying an uncertain mutation. */",
|
|
229547
|
+
" idempotencyKey?: string;",
|
|
229548
|
+
" signal?: AbortSignal;",
|
|
229549
|
+
"}",
|
|
229550
|
+
"",
|
|
229551
|
+
"export type RequiredProcedureExecutionOptions = ProcedureExecutionOptions & { idempotencyKey: string };",
|
|
229552
|
+
"",
|
|
229553
|
+
"type ProcedureResult<Result> = [Result] extends [never] ? unknown : Result;",
|
|
229554
|
+
"",
|
|
229555
|
+
"type ProcedureArgs<Options extends ClientRequestOptions, Idempotency extends IdempotencyMode> =",
|
|
229556
|
+
' Idempotency extends "required"',
|
|
229557
|
+
" ? {} extends Options",
|
|
229558
|
+
" ? [execution: RequiredProcedureExecutionOptions] | [input: Options, execution: RequiredProcedureExecutionOptions]",
|
|
229559
|
+
" : [input: Options, execution: RequiredProcedureExecutionOptions]",
|
|
229560
|
+
" : {} extends Options",
|
|
229561
|
+
" ? [input?: Options, execution?: ProcedureExecutionOptions]",
|
|
229562
|
+
" : [input: Options, execution?: ProcedureExecutionOptions];",
|
|
229563
|
+
"",
|
|
229564
|
+
"export type ProcedureCall<",
|
|
229565
|
+
" Options extends ClientRequestOptions = ClientRequestOptions,",
|
|
229566
|
+
" Result = never,",
|
|
229567
|
+
' Idempotency extends IdempotencyMode = "none",',
|
|
229568
|
+
"> = (...args: ProcedureArgs<Options, Idempotency>) => Promise<ProcedureResult<Result>>;",
|
|
229569
|
+
"",
|
|
229570
|
+
"export type ProcedureMember<",
|
|
229571
|
+
" Options extends ClientRequestOptions,",
|
|
229572
|
+
" Result,",
|
|
229573
|
+
" Kind extends ProcedureKind,",
|
|
229574
|
+
" Idempotency extends IdempotencyMode,",
|
|
229575
|
+
'> = Kind extends "query"',
|
|
229576
|
+
" ? { query: ProcedureCall<Options, Result, Idempotency> }",
|
|
229577
|
+
" : { mutate: ProcedureCall<Options, Result, Idempotency> };",
|
|
229578
|
+
"",
|
|
229369
229579
|
'export type ApiClientErrorCode = "API_HTTP_ERROR" | "API_RESPONSE_INVALID" | "API_RESPONSE_UNDECLARED";',
|
|
229370
229580
|
"",
|
|
229371
229581
|
"export interface ApiClientErrorDetails {",
|
|
@@ -229409,6 +229619,17 @@ function renderClient(graph, options) {
|
|
|
229409
229619
|
" : { (options: Options): Promise<Result>; <T>(options: Options, decode: ResponseDecoder<T>): Promise<T> }",
|
|
229410
229620
|
") & ((...args: {} extends Options ? [options?: Options] : [options: Options]) => Promise<[Result] extends [never] ? unknown : Result>);",
|
|
229411
229621
|
"",
|
|
229622
|
+
"export interface ApiProcedureDefinition {",
|
|
229623
|
+
" method: string;",
|
|
229624
|
+
" path: string;",
|
|
229625
|
+
" controller: string;",
|
|
229626
|
+
" handler: string;",
|
|
229627
|
+
" kind: ProcedureKind;",
|
|
229628
|
+
" command?: string;",
|
|
229629
|
+
" permission?: string;",
|
|
229630
|
+
" idempotency: IdempotencyMode;",
|
|
229631
|
+
"}",
|
|
229632
|
+
"",
|
|
229412
229633
|
...routeTypes,
|
|
229413
229634
|
...routeTypes.length > 0 ? [""] : [],
|
|
229414
229635
|
"export interface HttpInterceptorRequest {",
|
|
@@ -229416,6 +229637,7 @@ function renderClient(graph, options) {
|
|
|
229416
229637
|
" url: string;",
|
|
229417
229638
|
" headers: Record<string, string>;",
|
|
229418
229639
|
" body?: unknown;",
|
|
229640
|
+
" signal?: AbortSignal;",
|
|
229419
229641
|
"}",
|
|
229420
229642
|
"",
|
|
229421
229643
|
"export type HttpInterceptorFn = (",
|
|
@@ -229434,6 +229656,8 @@ function renderClient(graph, options) {
|
|
|
229434
229656
|
"",
|
|
229435
229657
|
"export const API_ROUTES = " + JSON.stringify(allRoutes, null, 2) + " as const;",
|
|
229436
229658
|
"",
|
|
229659
|
+
"export const API_PROCEDURES: readonly ApiProcedureDefinition[] = " + JSON.stringify(allProcedures, null, 2) + ";",
|
|
229660
|
+
"",
|
|
229437
229661
|
"export type AppRoutePath = typeof API_ROUTES[number]['path'];",
|
|
229438
229662
|
"",
|
|
229439
229663
|
"export const API_SCHEMAS = [",
|
|
@@ -229659,6 +229883,7 @@ function renderClient(graph, options) {
|
|
|
229659
229883
|
` responseSchemas?: Readonly<Record<string, ${responseSchemaType}>>,`,
|
|
229660
229884
|
" responseKind?: string,",
|
|
229661
229885
|
" raw?: boolean,",
|
|
229886
|
+
" execution?: ProcedureExecutionOptions,",
|
|
229662
229887
|
" ): Promise<T>;",
|
|
229663
229888
|
" async function request<T>(",
|
|
229664
229889
|
" method: string,",
|
|
@@ -229668,6 +229893,7 @@ function renderClient(graph, options) {
|
|
|
229668
229893
|
` responseSchemas?: Readonly<Record<string, ${responseSchemaType}>>,`,
|
|
229669
229894
|
" responseKind?: string,",
|
|
229670
229895
|
" raw?: boolean,",
|
|
229896
|
+
" execution?: ProcedureExecutionOptions,",
|
|
229671
229897
|
" ): Promise<T | unknown>;",
|
|
229672
229898
|
" async function request(",
|
|
229673
229899
|
" method: string,",
|
|
@@ -229682,6 +229908,7 @@ function renderClient(graph, options) {
|
|
|
229682
229908
|
` responseSchemas?: Readonly<Record<string, ${responseSchemaType}>>,`,
|
|
229683
229909
|
" responseKind?: string,",
|
|
229684
229910
|
" raw = false,",
|
|
229911
|
+
" execution?: ProcedureExecutionOptions,",
|
|
229685
229912
|
" ): Promise<T | unknown> {",
|
|
229686
229913
|
" const url = `${baseUrl}${buildRouteUrl(path, options.params, options.query)}`;",
|
|
229687
229914
|
' const customHeaders = typeof config.headers === "function" ? await config.headers() : config.headers;',
|
|
@@ -229707,9 +229934,10 @@ function renderClient(graph, options) {
|
|
|
229707
229934
|
" headers: reqPayload.headers,",
|
|
229708
229935
|
" ...(reqPayload.body === undefined ? {} : { body: raw ? rawBody(reqPayload.body) : JSON.stringify(reqPayload.body) }),",
|
|
229709
229936
|
' ...(raw && reqPayload.body instanceof ReadableStream ? { duplex: "half" } : {}),',
|
|
229937
|
+
" ...(reqPayload.signal === undefined ? {} : { signal: reqPayload.signal }),",
|
|
229710
229938
|
" });",
|
|
229711
229939
|
" };",
|
|
229712
|
-
" const response = await executeChain(0, { method, url, headers, body: options.body });",
|
|
229940
|
+
" const response = await executeChain(0, { method, url, headers, body: options.body, ...(execution?.signal === undefined ? {} : { signal: execution.signal }) });",
|
|
229713
229941
|
" const declaredSchema = responseSchemas ? selectResponseSchema(response.status, responseSchemas) : undefined;",
|
|
229714
229942
|
" const failure = (code: ApiClientErrorCode, message: string) => new ApiClientError(message, {",
|
|
229715
229943
|
' code, method, path, status: response.status, requestId: response.headers.get("x-request-id"),',
|
|
@@ -229747,7 +229975,44 @@ function renderClient(graph, options) {
|
|
|
229747
229975
|
" return decode ? decode(checked) : checked;",
|
|
229748
229976
|
" }",
|
|
229749
229977
|
"",
|
|
229750
|
-
|
|
229978
|
+
" function hasHeader(headers: Record<string, string>, name: string): boolean {",
|
|
229979
|
+
" return Object.keys(headers).some((key) => key.toLowerCase() === name.toLowerCase());",
|
|
229980
|
+
" }",
|
|
229981
|
+
"",
|
|
229982
|
+
" function withProcedureExecution(",
|
|
229983
|
+
" options: ClientRequestOptions,",
|
|
229984
|
+
" execution: ProcedureExecutionOptions | undefined,",
|
|
229985
|
+
" idempotency: IdempotencyMode,",
|
|
229986
|
+
" ): ClientRequestOptions {",
|
|
229987
|
+
" const headers = { ...(options.headers as Record<string, string> | undefined) };",
|
|
229988
|
+
" if (execution?.idempotencyKey !== undefined) {",
|
|
229989
|
+
" if (!/^[A-Za-z0-9._:-]{1,512}$/.test(execution.idempotencyKey)) {",
|
|
229990
|
+
' throw new TypeError("idempotencyKey must contain only safe header characters and be at most 512 characters");',
|
|
229991
|
+
" }",
|
|
229992
|
+
' headers["idempotency-key"] = execution.idempotencyKey;',
|
|
229993
|
+
" }",
|
|
229994
|
+
' if (idempotency === "required" && !hasHeader(headers, "idempotency-key")) {',
|
|
229995
|
+
' throw new TypeError("This mutation requires an idempotencyKey");',
|
|
229996
|
+
" }",
|
|
229997
|
+
" return Object.keys(headers).length === 0 ? options : { ...options, headers };",
|
|
229998
|
+
" }",
|
|
229999
|
+
"",
|
|
230000
|
+
" function isProcedureExecution(value: unknown): value is ProcedureExecutionOptions {",
|
|
230001
|
+
' if (value === null || typeof value !== "object" || Array.isArray(value)) return false;',
|
|
230002
|
+
' return Object.hasOwn(value, "idempotencyKey") || Object.hasOwn(value, "signal");',
|
|
230003
|
+
" }",
|
|
230004
|
+
"",
|
|
230005
|
+
` function makeProcedure<Options extends ClientRequestOptions, Result = never, Idempotency extends IdempotencyMode = "none">(method: string, path: string, responseSchemas?: Readonly<Record<string, ${responseSchemaType}>>, responseKind?: string, raw = false, idempotency: Idempotency = "none" as Idempotency): ProcedureCall<Options, Result, Idempotency> {`,
|
|
230006
|
+
" const procedure = async (first?: Options | ProcedureExecutionOptions, second?: ProcedureExecutionOptions): Promise<unknown> => {",
|
|
230007
|
+
" const execution = second ?? (isProcedureExecution(first) ? first : undefined);",
|
|
230008
|
+
" const input = (execution === first ? undefined : first) ?? {};",
|
|
230009
|
+
" const requestOptions = withProcedureExecution(input as ClientRequestOptions, execution, idempotency);",
|
|
230010
|
+
" return request(method, path, requestOptions, undefined, responseSchemas, responseKind, raw, execution);",
|
|
230011
|
+
" };",
|
|
230012
|
+
" return procedure as ProcedureCall<Options, Result, Idempotency>;",
|
|
230013
|
+
" }",
|
|
230014
|
+
"",
|
|
230015
|
+
` function makeRoute<Options extends ClientRequestOptions, Result = never, Kind extends ProcedureKind = never, Idempotency extends IdempotencyMode = "none">(method: string, path: string, responseSchemas?: Readonly<Record<string, ${responseSchemaType}>>, responseKind?: string, raw = false, kind?: Kind, idempotency: Idempotency = "none" as Idempotency): RouteMethod<Options, Result> & ProcedureMember<Options, Result, Kind, Idempotency> {`,
|
|
229751
230016
|
" function route<T>(options: Options, decode: ResponseDecoder<T>): Promise<T>;",
|
|
229752
230017
|
" function route(options: Options): Promise<Result>;",
|
|
229753
230018
|
" function route(options?: Options): Promise<unknown>;",
|
|
@@ -229755,13 +230020,16 @@ function renderClient(graph, options) {
|
|
|
229755
230020
|
" const requestOptions = options ?? {};",
|
|
229756
230021
|
" return request(method, path, requestOptions, decode, responseSchemas, responseKind, raw);",
|
|
229757
230022
|
" }",
|
|
229758
|
-
|
|
230023
|
+
' if (kind === "query") Object.assign(route, { query: makeProcedure<Options, Result, Idempotency>(method, path, responseSchemas, responseKind, raw, idempotency) });',
|
|
230024
|
+
' if (kind === "mutation") Object.assign(route, { mutate: makeProcedure<Options, Result, Idempotency>(method, path, responseSchemas, responseKind, raw, idempotency) });',
|
|
230025
|
+
" return route as RouteMethod<Options, Result> & ProcedureMember<Options, Result, Kind, Idempotency>;",
|
|
229759
230026
|
" }",
|
|
229760
230027
|
"",
|
|
229761
230028
|
" return {",
|
|
229762
230029
|
" request,",
|
|
229763
230030
|
" buildRouteUrl,",
|
|
229764
230031
|
" routes: API_ROUTES,",
|
|
230032
|
+
" procedures: API_PROCEDURES,",
|
|
229765
230033
|
...controllerEntries,
|
|
229766
230034
|
" };",
|
|
229767
230035
|
"}",
|
|
@@ -239941,14 +240209,14 @@ function validateWorkerExecution2(groups) {
|
|
|
239941
240209
|
routes.add(route);
|
|
239942
240210
|
}
|
|
239943
240211
|
}
|
|
239944
|
-
var
|
|
240212
|
+
var closed4;
|
|
239945
240213
|
var positive2 = (maximum) => Integer4({ minimum: 1, maximum });
|
|
239946
240214
|
var WorkerExecutionGroupSchema2;
|
|
239947
240215
|
var WorkerExecutionSchema2;
|
|
239948
240216
|
var init_worker_execution = __esm2(() => {
|
|
239949
240217
|
init_build();
|
|
239950
240218
|
init_value2();
|
|
239951
|
-
|
|
240219
|
+
closed4 = { additionalProperties: false };
|
|
239952
240220
|
WorkerExecutionGroupSchema2 = _Object_3({
|
|
239953
240221
|
name: String22({ pattern: "^[a-z][a-z0-9-]{0,47}$" }),
|
|
239954
240222
|
target: String22({ pattern: "^[a-z][a-z0-9-]{0,53}$" }),
|
|
@@ -239964,22 +240232,22 @@ var init_worker_execution = __esm2(() => {
|
|
|
239964
240232
|
resources: _Object_3({
|
|
239965
240233
|
cpuLimit: Number22({ minimum: 0.1, maximum: 64, multipleOf: 0.1 }),
|
|
239966
240234
|
memoryLimitMiB: Integer4({ minimum: 64, maximum: 262144 })
|
|
239967
|
-
},
|
|
240235
|
+
}, closed4),
|
|
239968
240236
|
database: _Object_3({
|
|
239969
240237
|
engineConnectionsPerReplica: positive2(16),
|
|
239970
240238
|
handlerConnectionsPerReplica: positive2(16)
|
|
239971
|
-
},
|
|
240239
|
+
}, closed4),
|
|
239972
240240
|
lifecycle: _Object_3({
|
|
239973
240241
|
executionTimeoutSeconds: positive2(3500),
|
|
239974
240242
|
visibilityTimeoutSeconds: Integer4({ minimum: 15, maximum: 3600 }),
|
|
239975
240243
|
shutdownGraceSeconds: positive2(300)
|
|
239976
|
-
},
|
|
239977
|
-
retry: _Object_3({ maxAttempts: Integer4({ minimum: 1, maximum: 10 }) },
|
|
239978
|
-
admission: _Object_3({ maxOutstandingOperations: positive2(1e6) },
|
|
239979
|
-
},
|
|
240244
|
+
}, closed4),
|
|
240245
|
+
retry: _Object_3({ maxAttempts: Integer4({ minimum: 1, maximum: 10 }) }, closed4),
|
|
240246
|
+
admission: _Object_3({ maxOutstandingOperations: positive2(1e6) }, closed4)
|
|
240247
|
+
}, closed4);
|
|
239980
240248
|
WorkerExecutionSchema2 = _Object_3({
|
|
239981
240249
|
groups: _Array_2(WorkerExecutionGroupSchema2, { minItems: 1, maxItems: 32 })
|
|
239982
|
-
},
|
|
240250
|
+
}, closed4);
|
|
239983
240251
|
});
|
|
239984
240252
|
function parseDeliveryOptions(value) {
|
|
239985
240253
|
if (value === undefined)
|
|
@@ -240313,6 +240581,9 @@ function parseDeliveryBuildManifest2(value) {
|
|
|
240313
240581
|
if (!Check22(DeliveryBuildManifestSchema2, value))
|
|
240314
240582
|
throw new Error("Invalid delivery build manifest.");
|
|
240315
240583
|
validateWorkerExecution2(value.plan.targets.flatMap((target) => target.execution ? [target.execution] : []));
|
|
240584
|
+
if (value.plan.targets.reduce((count, target) => count + (target.execution?.replicas ?? 1), 0) > 32) {
|
|
240585
|
+
throw new Error("Invalid delivery replica count.");
|
|
240586
|
+
}
|
|
240316
240587
|
for (const target of value.plan.targets) {
|
|
240317
240588
|
if (target.execution && (target.kind !== "jobs" || target.isolation !== "process" || target.execution.target !== target.name || target.jobs.length !== 1 || target.jobs[0]?.name !== target.execution.taskKey || value.objects.find((object) => object.name === target.name)?.entryKind !== "bun-worker-application")) {
|
|
240318
240589
|
throw new Error("Invalid delivery execution binding.");
|
|
@@ -240326,7 +240597,7 @@ function parseDeliveryBuildManifest2(value) {
|
|
|
240326
240597
|
}
|
|
240327
240598
|
for (const object of value.objects) {
|
|
240328
240599
|
const target = value.plan.targets.find((target) => target.name === object.name);
|
|
240329
|
-
if (
|
|
240600
|
+
if (["bun-worker-application", "go-worker-application", "scriptc-worker-application"].includes(object.entryKind) && target?.kind !== "jobs" || object.entryKind === "bun-http-application" && target?.kind === "jobs") {
|
|
240330
240601
|
throw new Error("Delivery executable kind does not match its target.");
|
|
240331
240602
|
}
|
|
240332
240603
|
if (new Set(object.files.map((file) => file.path)).size !== object.files.length || !object.files.some((file) => file.path === object.entrypoint) || deliveryObjectDigest2(object) !== object.objectId) {
|
|
@@ -240369,7 +240640,9 @@ var init_delivery_build_schema = __esm2(() => {
|
|
|
240369
240640
|
entryKind: Union4([
|
|
240370
240641
|
Literal3("compiled-module-factory"),
|
|
240371
240642
|
Literal3("bun-http-application"),
|
|
240372
|
-
Literal3("bun-worker-application")
|
|
240643
|
+
Literal3("bun-worker-application"),
|
|
240644
|
+
Literal3("go-worker-application"),
|
|
240645
|
+
Literal3("scriptc-worker-application")
|
|
240373
240646
|
]),
|
|
240374
240647
|
runtimeImports: _Array_2(String22()),
|
|
240375
240648
|
files: _Array_2(_Object_3({
|
|
@@ -240857,7 +241130,7 @@ var APPLICATION_DEVELOPMENT_SCHEMA = "supacloud.application-development.v1";
|
|
|
240857
241130
|
var APPLICATION_DEVELOPMENT_ARCHIVE_MAX_BYTES = 524288;
|
|
240858
241131
|
var APPLICATION_DEVELOPMENT_LIMITS;
|
|
240859
241132
|
var DevelopmentContractError;
|
|
240860
|
-
var
|
|
241133
|
+
var closed42;
|
|
240861
241134
|
var text22;
|
|
240862
241135
|
var texts;
|
|
240863
241136
|
var count;
|
|
@@ -240890,13 +241163,13 @@ var init_application_development = __esm2(() => {
|
|
|
240890
241163
|
this.name = "DevelopmentContractError";
|
|
240891
241164
|
}
|
|
240892
241165
|
};
|
|
240893
|
-
|
|
241166
|
+
closed42 = { additionalProperties: false };
|
|
240894
241167
|
text22 = String22({ minLength: 1, maxLength: 512, pattern: "^[^\\u0000-\\u001f\\u007f]+$" });
|
|
240895
241168
|
texts = _Array_2(text22);
|
|
240896
241169
|
count = Integer4({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER });
|
|
240897
241170
|
mode = Union4([Literal3("required"), Literal3("none")]);
|
|
240898
241171
|
operations2 = _Array_2(Union4([Literal3("read"), Literal3("write"), Literal3("publish"), Literal3("consume")]));
|
|
240899
|
-
resourceUse = _Object_3({ resource: text22, operations: operations2 },
|
|
241172
|
+
resourceUse = _Object_3({ resource: text22, operations: operations2 }, closed42);
|
|
240900
241173
|
schemaKind = Optional4(Union4([Literal3("opaque"), Literal3("declared")]));
|
|
240901
241174
|
stage = Union4([
|
|
240902
241175
|
Union4([Literal3("commandExecutor"), Literal3("jobExecutor"), Literal3("authorize"), Literal3("idempotency"), Literal3("transaction"), Literal3("handler"), Literal3("audit")]),
|
|
@@ -240921,7 +241194,7 @@ var init_application_development = __esm2(() => {
|
|
|
240921
241194
|
jobs: texts,
|
|
240922
241195
|
queries: texts,
|
|
240923
241196
|
resources: texts
|
|
240924
|
-
},
|
|
241197
|
+
}, closed42), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.modules }),
|
|
240925
241198
|
routes: _Array_2(_Object_3({
|
|
240926
241199
|
module: text22,
|
|
240927
241200
|
method: Union4([Literal3("GET"), Literal3("POST"), Literal3("PUT"), Literal3("PATCH"), Literal3("DELETE"), Literal3("HEAD"), Literal3("OPTIONS")]),
|
|
@@ -240937,8 +241210,8 @@ var init_application_development = __esm2(() => {
|
|
|
240937
241210
|
headers: schemaKind,
|
|
240938
241211
|
cookie: schemaKind,
|
|
240939
241212
|
response: schemaKind
|
|
240940
|
-
},
|
|
240941
|
-
},
|
|
241213
|
+
}, closed42))
|
|
241214
|
+
}, closed42), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.routes }),
|
|
240942
241215
|
commands: _Array_2(_Object_3({
|
|
240943
241216
|
module: text22,
|
|
240944
241217
|
name: text22,
|
|
@@ -240947,28 +241220,28 @@ var init_application_development = __esm2(() => {
|
|
|
240947
241220
|
idempotency: mode,
|
|
240948
241221
|
audit: Optional4(text22),
|
|
240949
241222
|
resources: _Array_2(resourceUse)
|
|
240950
|
-
},
|
|
241223
|
+
}, closed42), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.commands }),
|
|
240951
241224
|
jobs: _Array_2(_Object_3({
|
|
240952
241225
|
module: text22,
|
|
240953
241226
|
name: text22,
|
|
240954
241227
|
mode: Optional4(Union4([Literal3("task"), Literal3("workflow")])),
|
|
240955
241228
|
resources: _Array_2(resourceUse)
|
|
240956
|
-
},
|
|
240957
|
-
resources: _Array_2(_Object_3({ name: text22, kind: Union4([Literal3("database"), Literal3("bucket"), Literal3("queue"), Literal3("config"), Literal3("secret")]) },
|
|
241229
|
+
}, closed42), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.jobs }),
|
|
241230
|
+
resources: _Array_2(_Object_3({ name: text22, kind: Union4([Literal3("database"), Literal3("bucket"), Literal3("queue"), Literal3("config"), Literal3("secret")]) }, closed42), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.resources }),
|
|
240958
241231
|
resourceUses: _Array_2(_Object_3({
|
|
240959
241232
|
module: text22,
|
|
240960
241233
|
owner: text22,
|
|
240961
241234
|
ownerKind: Union4([Literal3("command"), Literal3("job")]),
|
|
240962
241235
|
resource: text22,
|
|
240963
241236
|
operations: operations2
|
|
240964
|
-
},
|
|
241237
|
+
}, closed42), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.resourceUses }),
|
|
240965
241238
|
executionPlans: _Array_2(_Object_3({
|
|
240966
241239
|
module: text22,
|
|
240967
241240
|
kind: Union4([Literal3("route"), Literal3("command"), Literal3("job")]),
|
|
240968
241241
|
name: text22,
|
|
240969
241242
|
command: Optional4(text22),
|
|
240970
241243
|
stages: _Array_2(stage)
|
|
240971
|
-
},
|
|
241244
|
+
}, closed42), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.plans }),
|
|
240972
241245
|
diagnostics: _Array_2(_Object_3({
|
|
240973
241246
|
code: text22,
|
|
240974
241247
|
severity: Union4([Literal3("error"), Literal3("warn")]),
|
|
@@ -240977,8 +241250,8 @@ var init_application_development = __esm2(() => {
|
|
|
240977
241250
|
repair: Optional4(_Object_3({
|
|
240978
241251
|
type: Union4([Literal3("set_command_mode"), Literal3("add_module_import"), Literal3("add_provider"), Literal3("mark_optional_dependency"), Literal3("change_provider_scope"), Literal3("add_command_permission"), Literal3("add_route_parameter_binding"), Literal3("remove_route_body_binding")]),
|
|
240979
241252
|
readiness: Union4([Literal3("preview"), Literal3("input-required"), Literal3("manual")])
|
|
240980
|
-
},
|
|
240981
|
-
},
|
|
241253
|
+
}, closed42))
|
|
241254
|
+
}, closed42), { maxItems: APPLICATION_DEVELOPMENT_LIMITS.diagnostics }),
|
|
240982
241255
|
omitted: _Object_3({
|
|
240983
241256
|
modules: count,
|
|
240984
241257
|
providers: count,
|
|
@@ -240989,7 +241262,7 @@ var init_application_development = __esm2(() => {
|
|
|
240989
241262
|
resourceUses: count,
|
|
240990
241263
|
plans: count,
|
|
240991
241264
|
diagnostics: count
|
|
240992
|
-
},
|
|
241265
|
+
}, closed42),
|
|
240993
241266
|
limits: _Object_3({
|
|
240994
241267
|
outputBytes: Literal3(APPLICATION_DEVELOPMENT_LIMITS.outputBytes),
|
|
240995
241268
|
modules: Literal3(APPLICATION_DEVELOPMENT_LIMITS.modules),
|
|
@@ -241001,8 +241274,8 @@ var init_application_development = __esm2(() => {
|
|
|
241001
241274
|
resourceUses: Literal3(APPLICATION_DEVELOPMENT_LIMITS.resourceUses),
|
|
241002
241275
|
plans: Literal3(APPLICATION_DEVELOPMENT_LIMITS.plans),
|
|
241003
241276
|
diagnostics: Literal3(APPLICATION_DEVELOPMENT_LIMITS.diagnostics)
|
|
241004
|
-
},
|
|
241005
|
-
},
|
|
241277
|
+
}, closed42)
|
|
241278
|
+
}, closed42);
|
|
241006
241279
|
});
|
|
241007
241280
|
function parseApplicationDevelopmentContext(input) {
|
|
241008
241281
|
try {
|
|
@@ -241304,6 +241577,114 @@ var init_application_activation = __esm2(() => {
|
|
|
241304
241577
|
retired_at: String22()
|
|
241305
241578
|
}, { additionalProperties: false });
|
|
241306
241579
|
});
|
|
241580
|
+
var closed6;
|
|
241581
|
+
var sha2562;
|
|
241582
|
+
var isoDate2;
|
|
241583
|
+
var status2;
|
|
241584
|
+
var evidenceStatus2;
|
|
241585
|
+
var DEPLOYMENT_EVIDENCE_SCHEMA2 = "supacloud.deployment-evidence.v1";
|
|
241586
|
+
var DatabaseProviderSchema2;
|
|
241587
|
+
var componentName2;
|
|
241588
|
+
var DeploymentComponentEvidenceSchema2;
|
|
241589
|
+
var DeploymentEvidenceSchema2;
|
|
241590
|
+
var init_deployment_evidence = __esm2(() => {
|
|
241591
|
+
init_build();
|
|
241592
|
+
init_value2();
|
|
241593
|
+
init_application_configuration();
|
|
241594
|
+
init_application_release();
|
|
241595
|
+
closed6 = { additionalProperties: false };
|
|
241596
|
+
sha2562 = String22({ pattern: "^[a-f0-9]{64}$" });
|
|
241597
|
+
isoDate2 = String22({ minLength: 20, maxLength: 40 });
|
|
241598
|
+
status2 = Union4([
|
|
241599
|
+
Literal3("confirmed"),
|
|
241600
|
+
Literal3("failed"),
|
|
241601
|
+
Literal3("unknown")
|
|
241602
|
+
]);
|
|
241603
|
+
evidenceStatus2 = Union4([
|
|
241604
|
+
Literal3("confirmed"),
|
|
241605
|
+
Literal3("failed"),
|
|
241606
|
+
Literal3("unknown"),
|
|
241607
|
+
Literal3("incomplete")
|
|
241608
|
+
]);
|
|
241609
|
+
DatabaseProviderSchema2 = _Object_3({
|
|
241610
|
+
provider: String22({ minLength: 1, maxLength: 64, pattern: "^[a-z][a-z0-9_.-]*$" }),
|
|
241611
|
+
version: String22({ minLength: 1, maxLength: 64 }),
|
|
241612
|
+
topology: Union4([Literal3("single-node"), Literal3("distributed")]),
|
|
241613
|
+
migration: _Object_3({
|
|
241614
|
+
status: status2,
|
|
241615
|
+
inventory_sha256: Union4([sha2562, Null3()]),
|
|
241616
|
+
compatibility: Union4([
|
|
241617
|
+
Literal3("verified"),
|
|
241618
|
+
Literal3("not-proven"),
|
|
241619
|
+
Literal3("failed")
|
|
241620
|
+
])
|
|
241621
|
+
}, closed6),
|
|
241622
|
+
backup: _Object_3({
|
|
241623
|
+
status: status2,
|
|
241624
|
+
latest_success_at: Union4([isoDate2, Null3()]),
|
|
241625
|
+
freshness_seconds: Union4([Integer4({ minimum: 0 }), Null3()])
|
|
241626
|
+
}, closed6),
|
|
241627
|
+
recovery: _Object_3({
|
|
241628
|
+
status: status2,
|
|
241629
|
+
drill_id: Union4([String22({ minLength: 1, maxLength: 128 }), Null3()]),
|
|
241630
|
+
rpo_seconds: Union4([Integer4({ minimum: 0 }), Null3()]),
|
|
241631
|
+
rto_seconds: Union4([Integer4({ minimum: 0 }), Null3()])
|
|
241632
|
+
}, closed6)
|
|
241633
|
+
}, closed6);
|
|
241634
|
+
componentName2 = Union4([
|
|
241635
|
+
Literal3("management-api"),
|
|
241636
|
+
Literal3("web-console"),
|
|
241637
|
+
Literal3("edge-runtime"),
|
|
241638
|
+
Literal3("worker"),
|
|
241639
|
+
Literal3("postgres"),
|
|
241640
|
+
Literal3("postgrest"),
|
|
241641
|
+
Literal3("gotrue"),
|
|
241642
|
+
Literal3("storage"),
|
|
241643
|
+
Literal3("realtime")
|
|
241644
|
+
]);
|
|
241645
|
+
DeploymentComponentEvidenceSchema2 = _Object_3({
|
|
241646
|
+
name: componentName2,
|
|
241647
|
+
version: Union4([String22({ minLength: 1, maxLength: 128 }), Null3()]),
|
|
241648
|
+
status: status2,
|
|
241649
|
+
health_check: Union4([String22({ minLength: 1, maxLength: 256 }), Null3()]),
|
|
241650
|
+
checked_at: Union4([isoDate2, Null3()])
|
|
241651
|
+
}, closed6);
|
|
241652
|
+
DeploymentEvidenceSchema2 = _Object_3({
|
|
241653
|
+
schema: Literal3(DEPLOYMENT_EVIDENCE_SCHEMA2),
|
|
241654
|
+
status: evidenceStatus2,
|
|
241655
|
+
recorded_at: isoDate2,
|
|
241656
|
+
scope: _Object_3({
|
|
241657
|
+
project_ref: String22({ pattern: "^[a-z0-9-]{1,20}$" }),
|
|
241658
|
+
application_id: ApplicationIdSchema3,
|
|
241659
|
+
environment_id: ApplicationIdSchema3
|
|
241660
|
+
}, closed6),
|
|
241661
|
+
source: _Object_3({
|
|
241662
|
+
commit_sha: Union4([String22({ pattern: "^[0-9a-f]{7,64}$" }), Null3()]),
|
|
241663
|
+
manifest_sha256: sha2562,
|
|
241664
|
+
contract_schema: Union4([String22({ minLength: 1, maxLength: 128 }), Null3()]),
|
|
241665
|
+
environment_binding_version: Union4([sha2562, Null3()])
|
|
241666
|
+
}, closed6),
|
|
241667
|
+
database: DatabaseProviderSchema2,
|
|
241668
|
+
components: _Array_2(DeploymentComponentEvidenceSchema2, { minItems: 1, maxItems: 32 }),
|
|
241669
|
+
activation: _Object_3({
|
|
241670
|
+
release_id: ApplicationReleaseIdSchema3,
|
|
241671
|
+
configuration_id: ApplicationConfigurationIdSchema3,
|
|
241672
|
+
activation_id: ApplicationConfigurationIdSchema3
|
|
241673
|
+
}, closed6),
|
|
241674
|
+
health: _Object_3({
|
|
241675
|
+
status: status2,
|
|
241676
|
+
checked_at: Union4([isoDate2, Null3()]),
|
|
241677
|
+
authenticated_smoke: status2
|
|
241678
|
+
}, closed6),
|
|
241679
|
+
rollback: _Object_3({
|
|
241680
|
+
release_id: Union4([ApplicationReleaseIdSchema3, Null3()]),
|
|
241681
|
+
configuration_id: Union4([ApplicationConfigurationIdSchema3, Null3()]),
|
|
241682
|
+
status: Union4([Literal3("ready"), Literal3("not-ready"), Literal3("unknown")]),
|
|
241683
|
+
result: Union4([status2, Null3()])
|
|
241684
|
+
}, closed6),
|
|
241685
|
+
notes: _Array_2(String22({ minLength: 1, maxLength: 512 }), { maxItems: 32 })
|
|
241686
|
+
}, closed6);
|
|
241687
|
+
});
|
|
241307
241688
|
var APPLICATION_RUNTIME_PROBE_PATH2 = "/.well-known/supacloud/runtime";
|
|
241308
241689
|
var ApplicationRuntimeIdentitySchema2;
|
|
241309
241690
|
var ApplicationReadinessReportSchema2;
|
|
@@ -241381,6 +241762,7 @@ var init_src = __esm2(() => {
|
|
|
241381
241762
|
init_application_activation();
|
|
241382
241763
|
init_application_release();
|
|
241383
241764
|
init_application_configuration();
|
|
241765
|
+
init_deployment_evidence();
|
|
241384
241766
|
init_application_runtime_identity();
|
|
241385
241767
|
init_delivery_build_schema();
|
|
241386
241768
|
init_delivery_migration_archive();
|
|
@@ -246848,7 +247230,7 @@ var starter_metadata_default = {
|
|
|
246848
247230
|
generatedBy: "supacloud/starter-metadata-v1",
|
|
246849
247231
|
packages: {
|
|
246850
247232
|
compiler: {
|
|
246851
|
-
version: "0.
|
|
247233
|
+
version: "0.33.0"
|
|
246852
247234
|
},
|
|
246853
247235
|
app: {
|
|
246854
247236
|
version: "0.22.0",
|
|
@@ -246875,7 +247257,7 @@ var starter_metadata_default = {
|
|
|
246875
247257
|
}
|
|
246876
247258
|
},
|
|
246877
247259
|
sdk: {
|
|
246878
|
-
version: "0.
|
|
247260
|
+
version: "0.37.0",
|
|
246879
247261
|
peerDependencies: {
|
|
246880
247262
|
"@supabase/supabase-js": "^2.115.0"
|
|
246881
247263
|
}
|
|
@@ -254579,7 +254961,7 @@ function registerRemoteDevTools(server2, options = {}) {
|
|
|
254579
254961
|
// package.json
|
|
254580
254962
|
var package_default = {
|
|
254581
254963
|
name: "@supacloud/cli",
|
|
254582
|
-
version: "0.
|
|
254964
|
+
version: "0.65.0",
|
|
254583
254965
|
description: "Project-scoped CLI for SupaCloud users",
|
|
254584
254966
|
type: "module",
|
|
254585
254967
|
main: "./dist/index.js",
|
|
@@ -254614,14 +254996,14 @@ var package_default = {
|
|
|
254614
254996
|
},
|
|
254615
254997
|
dependencies: {
|
|
254616
254998
|
"@sinclair/typebox": "^0.34.52",
|
|
254617
|
-
"@supacloud/compiler": "^0.
|
|
254618
|
-
"@supacloud/delivery": "0.
|
|
254999
|
+
"@supacloud/compiler": "^0.33.0",
|
|
255000
|
+
"@supacloud/delivery": "0.7.0",
|
|
254619
255001
|
"@supacloud/db": "^0.2.0",
|
|
254620
255002
|
fflate: "^0.8.3",
|
|
254621
255003
|
typebox: "1.3.34"
|
|
254622
255004
|
},
|
|
254623
255005
|
overrides: {
|
|
254624
|
-
"@supacloud/delivery": "0.
|
|
255006
|
+
"@supacloud/delivery": "0.7.0"
|
|
254625
255007
|
},
|
|
254626
255008
|
devDependencies: {
|
|
254627
255009
|
"@supacloud/elysia": "^0.23.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.65.0",
|
|
4
4
|
"description": "Project-scoped CLI for SupaCloud users",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@sinclair/typebox": "^0.34.52",
|
|
38
|
-
"@supacloud/compiler": "^0.
|
|
39
|
-
"@supacloud/delivery": "0.
|
|
38
|
+
"@supacloud/compiler": "^0.33.0",
|
|
39
|
+
"@supacloud/delivery": "0.7.0",
|
|
40
40
|
"@supacloud/db": "^0.2.0",
|
|
41
41
|
"fflate": "^0.8.3",
|
|
42
42
|
"typebox": "1.3.34"
|
|
43
43
|
},
|
|
44
44
|
"overrides": {
|
|
45
|
-
"@supacloud/delivery": "0.
|
|
45
|
+
"@supacloud/delivery": "0.7.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@supacloud/elysia": "^0.23.1",
|