@runa-ai/runa-cli 0.5.58 → 0.5.61
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/commands/ci/commands/ci-supabase-local.d.ts +5 -0
- package/dist/commands/ci/commands/ci-supabase-local.d.ts.map +1 -1
- package/dist/commands/ci/machine/actors/db/sync-schema.d.ts.map +1 -1
- package/dist/commands/db/apply/actors.d.ts +4 -0
- package/dist/commands/db/apply/actors.d.ts.map +1 -1
- package/dist/commands/db/apply/contract.d.ts +1 -0
- package/dist/commands/db/apply/contract.d.ts.map +1 -1
- package/dist/commands/db/apply/helpers/index.d.ts +4 -2
- package/dist/commands/db/apply/helpers/index.d.ts.map +1 -1
- package/dist/commands/db/apply/helpers/plan-validator.d.ts +61 -0
- package/dist/commands/db/apply/helpers/plan-validator.d.ts.map +1 -0
- package/dist/commands/db/apply/helpers/retry-logic.d.ts +25 -0
- package/dist/commands/db/apply/helpers/retry-logic.d.ts.map +1 -1
- package/dist/commands/db/apply/machine.d.ts +5 -0
- package/dist/commands/db/apply/machine.d.ts.map +1 -1
- package/dist/commands/db/commands/db-lifecycle.d.ts.map +1 -1
- package/dist/commands/db/utils/db-target.d.ts +5 -3
- package/dist/commands/db/utils/db-target.d.ts.map +1 -1
- package/dist/commands/dev/commands/dev.d.ts.map +1 -1
- package/dist/constants/versions.d.ts +1 -1
- package/dist/index.js +799 -450
- package/dist/utils/env-local-bridge.d.ts +58 -0
- package/dist/utils/env-local-bridge.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
* Note:
|
|
7
7
|
* - This module used to be named `ci-pr-supabase-local.ts`. It is now shared across CI commands.
|
|
8
8
|
*/
|
|
9
|
+
/**
|
|
10
|
+
* Pre-flight check for port conflicts before starting Supabase.
|
|
11
|
+
* Warns if DB port is already occupied by another Supabase instance.
|
|
12
|
+
*/
|
|
13
|
+
export declare function checkSupabasePortConflicts(repoRoot: string): Promise<void>;
|
|
9
14
|
export declare function startSupabaseLocal(params: {
|
|
10
15
|
repoRoot: string;
|
|
11
16
|
tmpDir: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ci-supabase-local.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/commands/ci-supabase-local.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"ci-supabase-local.d.ts","sourceRoot":"","sources":["../../../../src/commands/ci/commands/ci-supabase-local.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA6CH;;;GAGG;AACH,wBAAsB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2ChF;AAED,wBAAsB,kBAAkB,CAAC,MAAM,EAAE;IAC/C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CAehB;AAED,wBAAsB,iBAAiB,CAAC,MAAM,EAAE;IAC9C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CAShB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAGpE;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CASpE;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,8JAC0H,CAAC;AAE9J,wBAAsB,uBAAuB,CAAC,MAAM,EAAE;IACpD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAqDpD;AAED,wBAAsB,0BAA0B,CAAC,MAAM,EAAE;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,MAAM,CAAC;CAC5B,GAAG,OAAO,CAAC;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC,CA0DtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-schema.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/ci/machine/actors/db/sync-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AASH,OAAO,KAAK,EAAE,MAAM,EAAqB,mBAAmB,EAAiB,MAAM,gBAAgB,CAAC;AAEpG,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC;AAmQD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"sync-schema.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/ci/machine/actors/db/sync-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AASH,OAAO,KAAK,EAAE,MAAM,EAAqB,mBAAmB,EAAiB,MAAM,gBAAgB,CAAC;AAEpG,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,mBAAmB,CAAC;CACnC;AAmQD;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,qGA0G3B,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DbApplyInput } from './contract.js';
|
|
2
2
|
export interface ApplyResult {
|
|
3
3
|
filesApplied: number;
|
|
4
|
+
filesSkipped: number;
|
|
4
5
|
rolePasswordsSet: number;
|
|
5
6
|
}
|
|
6
7
|
export interface PgSchemaDiffResult {
|
|
@@ -18,10 +19,13 @@ export interface PgSchemaDiffResult {
|
|
|
18
19
|
* Flow:
|
|
19
20
|
* 1. Apply idempotent/*.sql files (includes 15_rbac_roles.sql for ROLE creation)
|
|
20
21
|
* 2. Set passwords for drizzle_app/drizzle_service if env vars present
|
|
22
|
+
*
|
|
23
|
+
* @param pass - 'pre' = 1st pass (graceful skip on error), 'post' = 2nd pass (strict)
|
|
21
24
|
*/
|
|
22
25
|
export declare const applyIdempotentSchemas: import("xstate").PromiseActorLogic<ApplyResult, {
|
|
23
26
|
input: DbApplyInput;
|
|
24
27
|
targetDir: string;
|
|
28
|
+
pass: "pre" | "post";
|
|
25
29
|
}, import("xstate").EventObject>;
|
|
26
30
|
/**
|
|
27
31
|
* Apply schema changes using pg-schema-diff (or direct psql for fresh DB).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/apply/actors.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA4ElD,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"actors.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/apply/actors.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA4ElD,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA2yBD;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB;WAExB,YAAY;eAAa,MAAM;UAAQ,KAAK,GAAG,MAAM;gCA+C9D,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iBAAiB;WAEnB,YAAY;eAAa,MAAM;gCAmHxC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,UAAU;aACV,OAAO;;WACT,YAAY;eAAa,MAAM;gCAqDxC,CAAC"}
|
|
@@ -43,6 +43,7 @@ export type DbApplyMetrics = z.infer<typeof DbApplyMetricsSchema>;
|
|
|
43
43
|
export declare const DbApplyOutputSchema: z.ZodObject<{
|
|
44
44
|
success: z.ZodBoolean;
|
|
45
45
|
idempotentSchemasApplied: z.ZodNumber;
|
|
46
|
+
idempotentSchemasSkipped: z.ZodOptional<z.ZodNumber>;
|
|
46
47
|
rolePasswordsSet: z.ZodOptional<z.ZodNumber>;
|
|
47
48
|
schemaChangesApplied: z.ZodBoolean;
|
|
48
49
|
hazards: z.ZodArray<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/apply/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;kBAoCpB,CAAC;AAEZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;iBAe/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,mBAAmB
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/apply/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;kBAoCpB,CAAC;AAEZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;iBAe/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;iBA6B9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* Purpose: Export all helper functions for db apply actors
|
|
5
5
|
*/
|
|
6
6
|
export { acquireAdvisoryLock, MIGRATION_LOCK_ID, releaseAdvisoryLock, } from './advisory-lock.js';
|
|
7
|
+
export type { PlanHazard, PlanStatement, ValidatedPlan } from './plan-validator.js';
|
|
8
|
+
export { parsePlanOutput, validatePlanForExecution } from './plan-validator.js';
|
|
7
9
|
export type { ParsedHazard, PgSchemaDiffPlanOptions } from './pg-schema-diff-helpers.js';
|
|
8
10
|
export type { ShadowDbConfig, ShadowDbResult } from './shadow-db-manager.js';
|
|
9
11
|
export { buildAllowedHazards, displayCheckModeResults, displayHazards, displayHazardsWithContext, executePgSchemaDiffPlan, filterFalsePositiveHazards, getIdempotentRoles, handleHazards, handleHazardsWithContext, handleProductionAuthzProtection, handleProductionDataProtection, isIdempotentRoleHazard, parseHazardsFromOutput, parseHazardsWithContext, resetIdempotentRolesCache, verifyDatabaseConnection, verifyPgSchemaDiffBinary, } from './pg-schema-diff-helpers.js';
|
|
10
|
-
export type { RetryConfig, RetryResult } from './retry-logic.js';
|
|
11
|
-
export { BASE_DELAY_MS, calculateBackoffDelay, DEFAULT_MAX_DELAY_MS, executeApplyWithRetry, isLockTimeoutError, MAX_RETRIES, sleep, } from './retry-logic.js';
|
|
12
|
+
export type { PlanSqlRetryConfig, RetryConfig, RetryResult } from './retry-logic.js';
|
|
13
|
+
export { BASE_DELAY_MS, calculateBackoffDelay, DEFAULT_MAX_DELAY_MS, executeApplyWithRetry, executePlanSqlWithRetry, isLockTimeoutError, MAX_RETRIES, sleep, } from './retry-logic.js';
|
|
12
14
|
export { createShadowDbWithExtensions, needsShadowDb } from './shadow-db-manager.js';
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACzF,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,aAAa,EACb,wBAAwB,EACxB,+BAA+B,EAC/B,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAE5B,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAEhF,YAAY,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACzF,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE7E,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,aAAa,EACb,wBAAwB,EACxB,+BAA+B,EAC/B,8BAA8B,EAC9B,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAErF,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,WAAW,EACX,KAAK,GACN,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,4BAA4B,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI HINT: pg-schema-diff Plan Output Validator
|
|
3
|
+
*
|
|
4
|
+
* Purpose: Parse pg-schema-diff plan output into structured statements and
|
|
5
|
+
* validate with Zod before psql execution (safety gate).
|
|
6
|
+
*
|
|
7
|
+
* Pattern: plan → Zod validation → psql execution
|
|
8
|
+
*
|
|
9
|
+
* Safety layers:
|
|
10
|
+
* 1. handleHazards() in actors.ts → blocks unapproved hazards (primary)
|
|
11
|
+
* 2. validatePlanForExecution() → defense-in-depth hazard check
|
|
12
|
+
* 3. Zod structural validation → ensures plan is well-formed
|
|
13
|
+
*/
|
|
14
|
+
import { z } from 'zod';
|
|
15
|
+
export declare const PlanHazardSchema: z.ZodObject<{
|
|
16
|
+
type: z.ZodString;
|
|
17
|
+
message: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const PlanStatementSchema: z.ZodObject<{
|
|
20
|
+
index: z.ZodNumber;
|
|
21
|
+
sql: z.ZodString;
|
|
22
|
+
hazards: z.ZodArray<z.ZodObject<{
|
|
23
|
+
type: z.ZodString;
|
|
24
|
+
message: z.ZodString;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export declare const ValidatedPlanSchema: z.ZodObject<{
|
|
28
|
+
statements: z.ZodArray<z.ZodObject<{
|
|
29
|
+
index: z.ZodNumber;
|
|
30
|
+
sql: z.ZodString;
|
|
31
|
+
hazards: z.ZodArray<z.ZodObject<{
|
|
32
|
+
type: z.ZodString;
|
|
33
|
+
message: z.ZodString;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
totalStatements: z.ZodNumber;
|
|
37
|
+
rawSql: z.ZodString;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export type PlanHazard = z.infer<typeof PlanHazardSchema>;
|
|
40
|
+
export type PlanStatement = z.infer<typeof PlanStatementSchema>;
|
|
41
|
+
export type ValidatedPlan = z.infer<typeof ValidatedPlanSchema>;
|
|
42
|
+
/**
|
|
43
|
+
* Parse pg-schema-diff plan output into structured statements.
|
|
44
|
+
*
|
|
45
|
+
* Handles two formats:
|
|
46
|
+
* 1. With `-- Statement Idx. N` markers → split into individual statements
|
|
47
|
+
* 2. Without markers → treat as single statement
|
|
48
|
+
*
|
|
49
|
+
* @throws ZodError if parsed result fails structural validation
|
|
50
|
+
*/
|
|
51
|
+
export declare function parsePlanOutput(planOutput: string): ValidatedPlan;
|
|
52
|
+
/**
|
|
53
|
+
* Validate that all hazards in the plan are in the allowed list.
|
|
54
|
+
*
|
|
55
|
+
* Defense-in-depth: handleHazards() in actors.ts is the primary check.
|
|
56
|
+
* This is a secondary safety gate right before psql execution.
|
|
57
|
+
*
|
|
58
|
+
* @throws Error if unresolved hazards are found
|
|
59
|
+
*/
|
|
60
|
+
export declare function validatePlanForExecution(plan: ValidatedPlan, allowedHazardTypes: string[]): void;
|
|
61
|
+
//# sourceMappingURL=plan-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-validator.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/plan-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,gBAAgB;;;iBAG3B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;iBAI9B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;iBAI9B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC1D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAiFhE;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,CAgBjE;AAMD;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,EAAE,GAAG,IAAI,CAehG"}
|
|
@@ -48,4 +48,29 @@ export declare function isLockTimeoutError(errorOutput: string): boolean;
|
|
|
48
48
|
* Enhanced with configurable options and metrics.
|
|
49
49
|
*/
|
|
50
50
|
export declare function executeApplyWithRetry(applyArgs: string[], verbose: boolean, config?: RetryConfig): Promise<RetryResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Options for plan+psql execution with retry.
|
|
53
|
+
*/
|
|
54
|
+
export interface PlanSqlRetryConfig extends RetryConfig {
|
|
55
|
+
/**
|
|
56
|
+
* Re-generate plan SQL on retry to handle partial execution safely.
|
|
57
|
+
* Returns fresh plan SQL, or null if all changes are already applied.
|
|
58
|
+
*/
|
|
59
|
+
rePlanFn?: () => string | null;
|
|
60
|
+
/**
|
|
61
|
+
* Allowed hazard types for defense-in-depth validation.
|
|
62
|
+
* Plan SQL is validated against this list before each psql execution.
|
|
63
|
+
* If omitted, hazard validation is skipped (primary check in actors.ts handles it).
|
|
64
|
+
*/
|
|
65
|
+
allowedHazardTypes?: string[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Execute plan SQL via psql with retry logic.
|
|
69
|
+
*
|
|
70
|
+
* Replaces pg-schema-diff apply to avoid creating temp DB on the production server,
|
|
71
|
+
* which exhausts connections on Supabase (max_connections=60).
|
|
72
|
+
*
|
|
73
|
+
* On retry: calls rePlanFn() to regenerate plan (handles partial execution safely).
|
|
74
|
+
*/
|
|
75
|
+
export declare function executePlanSqlWithRetry(dbUrl: string, initialPlanSql: string, verbose: boolean, config?: PlanSqlRetryConfig): Promise<RetryResult>;
|
|
51
76
|
//# sourceMappingURL=retry-logic.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retry-logic.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/retry-logic.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"retry-logic.d.ts","sourceRoot":"","sources":["../../../../../src/commands/db/apply/helpers/retry-logic.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,OAAO,CAAC;AAClC,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAE1C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,SAAuB,GAAG,MAAM,CAIhG;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAM/D;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CACzC,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,WAAW,CAAC,CAqEtB;AAMD;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAC/B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,kBAAkB,GAC1B,OAAO,CAAC,WAAW,CAAC,CA0FtB"}
|
|
@@ -35,7 +35,9 @@ interface DbApplyContext {
|
|
|
35
35
|
input: DbApplyInput;
|
|
36
36
|
targetDir: string;
|
|
37
37
|
idempotentPreApplied: number;
|
|
38
|
+
idempotentPreSkipped: number;
|
|
38
39
|
idempotentPostApplied: number;
|
|
40
|
+
idempotentPostSkipped: number;
|
|
39
41
|
rolePasswordsSet: number;
|
|
40
42
|
schemaChangesApplied: boolean;
|
|
41
43
|
hazards: string[];
|
|
@@ -67,6 +69,7 @@ export declare const dbApplyMachine: import("xstate").StateMachine<DbApplyContex
|
|
|
67
69
|
}, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<actors.ApplyResult, {
|
|
68
70
|
input: DbApplyInput;
|
|
69
71
|
targetDir: string;
|
|
72
|
+
pass: "pre" | "post";
|
|
70
73
|
}, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<actors.PgSchemaDiffResult, {
|
|
71
74
|
input: DbApplyInput;
|
|
72
75
|
targetDir: string;
|
|
@@ -85,6 +88,7 @@ export declare const dbApplyMachine: import("xstate").StateMachine<DbApplyContex
|
|
|
85
88
|
logic: import("xstate").PromiseActorLogic<actors.ApplyResult, {
|
|
86
89
|
input: DbApplyInput;
|
|
87
90
|
targetDir: string;
|
|
91
|
+
pass: "pre" | "post";
|
|
88
92
|
}, import("xstate").EventObject>;
|
|
89
93
|
id: string | undefined;
|
|
90
94
|
} | {
|
|
@@ -103,6 +107,7 @@ export declare const dbApplyMachine: import("xstate").StateMachine<DbApplyContex
|
|
|
103
107
|
schemaChangesApplied: boolean;
|
|
104
108
|
hazards: string[];
|
|
105
109
|
seedsApplied: boolean;
|
|
110
|
+
idempotentSchemasSkipped?: number | undefined;
|
|
106
111
|
rolePasswordsSet?: number | undefined;
|
|
107
112
|
error?: string | undefined;
|
|
108
113
|
planSql?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/apply/machine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAU,KAAK,YAAY,EAAS,MAAM,QAAQ,CAAC;AAE1D,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAiC,MAAM,eAAe,CAAC;AA6FjF,UAAU,cAAc;IACtB,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAElB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;CACvB;AAID,eAAO,MAAM,cAAc;UAFC,OAAO;;UAAa,gBAAgB;WAAS,KAAK
|
|
1
|
+
{"version":3,"file":"machine.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/apply/machine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,EAAU,KAAK,YAAY,EAAS,MAAM,QAAQ,CAAC;AAE1D,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAiC,MAAM,eAAe,CAAC;AA6FjF,UAAU,cAAc;IACtB,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAElB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;CACvB;AAID,eAAO,MAAM,cAAc;UAFC,OAAO;;UAAa,gBAAgB;WAAS,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAI1D,YAAY;eAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2OjD,CAAC;AAGH,MAAM,MAAM,cAAc,GAAG,OAAO,cAAc,CAAC;AACnD,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;AAGlE,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAErE;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAEpE;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAExE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAeH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"db-lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/commands/db-lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAeH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+HpC;;GAEG;AACH,eAAO,MAAM,YAAY,SAmHtB,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,WAAW,SAiCpB,CAAC;AAkDL;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,SAqGrB,CAAC"}
|
|
@@ -32,9 +32,11 @@ export type RunaDbEnv = 'local' | 'preview' | 'main' | 'production';
|
|
|
32
32
|
* 1. DATABASE_URL_ADMIN (postgres role, DDL capable)
|
|
33
33
|
* 2. DATABASE_URL (fallback)
|
|
34
34
|
*
|
|
35
|
-
* ### Production/Main environment
|
|
36
|
-
* 1. GH_DATABASE_URL_ADMIN (postgres role, DDL capable)
|
|
37
|
-
* 2.
|
|
35
|
+
* ### Production/Main environment:
|
|
36
|
+
* 1. GH_DATABASE_URL_ADMIN (CI: postgres role, DDL capable)
|
|
37
|
+
* 2. DATABASE_URL_ADMIN (non-CI: postgres role, DDL capable)
|
|
38
|
+
* 3. GH_DATABASE_URL (CI fallback)
|
|
39
|
+
* 4. DATABASE_URL (last resort fallback)
|
|
38
40
|
*
|
|
39
41
|
* @param environment - Target environment
|
|
40
42
|
* @returns Database URL string
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db-target.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/utils/db-target.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,CAAC;AAkCpE
|
|
1
|
+
{"version":3,"file":"db-target.d.ts","sourceRoot":"","sources":["../../../../src/commands/db/utils/db-target.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,YAAY,CAAC;AAkCpE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,CAuDjE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAUhF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../../src/commands/dev/commands/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../../src/commands/dev/commands/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqOpC,eAAO,MAAM,UAAU,SAuBnB,CAAC"}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
*
|
|
21
21
|
* Sync strategy: Keep this in sync with packages/runa-templates/package.json version.
|
|
22
22
|
*/
|
|
23
|
-
export declare const COMPATIBLE_TEMPLATES_VERSION = "0.5.
|
|
23
|
+
export declare const COMPATIBLE_TEMPLATES_VERSION = "0.5.61";
|
|
24
24
|
/**
|
|
25
25
|
* Templates package name on GitHub Packages.
|
|
26
26
|
* Published to npm.pkg.github.com (requires NODE_AUTH_TOKEN).
|