@sonamu-kit/tasks 0.1.3 → 0.3.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/.oxlintrc.json +3 -0
- package/AGENTS.md +21 -0
- package/dist/backend.d.ts +126 -103
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +4 -1
- package/dist/backend.js.map +1 -1
- package/dist/client.d.ts +145 -132
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +220 -212
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +15 -8
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +22 -17
- package/dist/config.js.map +1 -1
- package/dist/core/duration.d.ts +5 -4
- package/dist/core/duration.d.ts.map +1 -1
- package/dist/core/duration.js +54 -59
- package/dist/core/duration.js.map +1 -1
- package/dist/core/error.d.ts +10 -7
- package/dist/core/error.d.ts.map +1 -1
- package/dist/core/error.js +21 -21
- package/dist/core/error.js.map +1 -1
- package/dist/core/json.d.ts +8 -3
- package/dist/core/json.d.ts.map +1 -1
- package/dist/core/result.d.ts +10 -14
- package/dist/core/result.d.ts.map +1 -1
- package/dist/core/result.js +21 -16
- package/dist/core/result.js.map +1 -1
- package/dist/core/retry.d.ts +42 -20
- package/dist/core/retry.d.ts.map +1 -1
- package/dist/core/retry.js +49 -20
- package/dist/core/retry.js.map +1 -1
- package/dist/core/schema.d.ts +57 -53
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/step.d.ts +28 -78
- package/dist/core/step.d.ts.map +1 -1
- package/dist/core/step.js +53 -63
- package/dist/core/step.js.map +1 -1
- package/dist/core/workflow.d.ts +33 -61
- package/dist/core/workflow.d.ts.map +1 -1
- package/dist/core/workflow.js +31 -41
- package/dist/core/workflow.js.map +1 -1
- package/dist/database/backend.d.ts +53 -46
- package/dist/database/backend.d.ts.map +1 -1
- package/dist/database/backend.js +544 -545
- package/dist/database/backend.js.map +1 -1
- package/dist/database/base.js +48 -25
- package/dist/database/base.js.map +1 -1
- package/dist/database/migrations/20251212000000_0_init.d.ts +10 -0
- package/dist/database/migrations/20251212000000_0_init.d.ts.map +1 -0
- package/dist/database/migrations/20251212000000_0_init.js +8 -4
- package/dist/database/migrations/20251212000000_0_init.js.map +1 -1
- package/dist/database/migrations/20251212000000_1_tables.d.ts +10 -0
- package/dist/database/migrations/20251212000000_1_tables.d.ts.map +1 -0
- package/dist/database/migrations/20251212000000_1_tables.js +81 -83
- package/dist/database/migrations/20251212000000_1_tables.js.map +1 -1
- package/dist/database/migrations/20251212000000_2_fk.d.ts +10 -0
- package/dist/database/migrations/20251212000000_2_fk.d.ts.map +1 -0
- package/dist/database/migrations/20251212000000_2_fk.js +20 -43
- package/dist/database/migrations/20251212000000_2_fk.js.map +1 -1
- package/dist/database/migrations/20251212000000_3_indexes.d.ts +10 -0
- package/dist/database/migrations/20251212000000_3_indexes.d.ts.map +1 -0
- package/dist/database/migrations/20251212000000_3_indexes.js +88 -102
- package/dist/database/migrations/20251212000000_3_indexes.js.map +1 -1
- package/dist/database/pubsub.d.ts +7 -16
- package/dist/database/pubsub.d.ts.map +1 -1
- package/dist/database/pubsub.js +75 -73
- package/dist/database/pubsub.js.map +1 -1
- package/dist/execution.d.ts +20 -57
- package/dist/execution.d.ts.map +1 -1
- package/dist/execution.js +175 -174
- package/dist/execution.js.map +1 -1
- package/dist/index.d.ts +5 -8
- package/dist/index.js +5 -5
- package/dist/internal.d.ts +12 -12
- package/dist/internal.js +4 -4
- package/dist/registry.d.ts +33 -27
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +58 -49
- package/dist/registry.js.map +1 -1
- package/dist/worker.d.ts +57 -50
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +194 -198
- package/dist/worker.js.map +1 -1
- package/dist/workflow.d.ts +26 -27
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +20 -15
- package/dist/workflow.js.map +1 -1
- package/nodemon.json +1 -1
- package/package.json +18 -20
- package/src/backend.ts +28 -8
- package/src/chaos.test.ts +3 -1
- package/src/client.test.ts +2 -0
- package/src/client.ts +32 -8
- package/src/config.test.ts +1 -0
- package/src/config.ts +3 -2
- package/src/core/duration.test.ts +2 -1
- package/src/core/duration.ts +1 -1
- package/src/core/error.test.ts +1 -0
- package/src/core/error.ts +1 -1
- package/src/core/result.test.ts +1 -0
- package/src/core/retry.test.ts +181 -11
- package/src/core/retry.ts +95 -19
- package/src/core/schema.ts +2 -2
- package/src/core/step.test.ts +2 -1
- package/src/core/step.ts +4 -3
- package/src/core/workflow.test.ts +2 -1
- package/src/core/workflow.ts +4 -3
- package/src/database/backend.test.ts +1 -0
- package/src/database/backend.testsuite.ts +162 -39
- package/src/database/backend.ts +271 -35
- package/src/database/base.test.ts +41 -0
- package/src/database/base.ts +51 -2
- package/src/database/migrations/20251212000000_0_init.ts +2 -1
- package/src/database/migrations/20251212000000_1_tables.ts +2 -1
- package/src/database/migrations/20251212000000_2_fk.ts +2 -1
- package/src/database/migrations/20251212000000_3_indexes.ts +2 -1
- package/src/database/pubsub.test.ts +6 -3
- package/src/database/pubsub.ts +55 -33
- package/src/execution.test.ts +117 -0
- package/src/execution.ts +65 -10
- package/src/internal.ts +21 -1
- package/src/practices/01-remote-workflow.ts +1 -0
- package/src/registry.test.ts +1 -0
- package/src/registry.ts +1 -1
- package/src/testing/connection.ts +3 -1
- package/src/worker.test.ts +2 -0
- package/src/worker.ts +31 -9
- package/src/workflow.test.ts +1 -0
- package/src/workflow.ts +5 -2
- package/templates/openworkflow.config.ts +2 -1
- package/tsdown.config.ts +31 -0
- package/.swcrc +0 -17
- package/dist/chaos.test.d.ts +0 -2
- package/dist/chaos.test.d.ts.map +0 -1
- package/dist/chaos.test.js +0 -92
- package/dist/chaos.test.js.map +0 -1
- package/dist/client.test.d.ts +0 -2
- package/dist/client.test.d.ts.map +0 -1
- package/dist/client.test.js +0 -340
- package/dist/client.test.js.map +0 -1
- package/dist/config.test.d.ts +0 -2
- package/dist/config.test.d.ts.map +0 -1
- package/dist/config.test.js +0 -24
- package/dist/config.test.js.map +0 -1
- package/dist/core/duration.test.d.ts +0 -2
- package/dist/core/duration.test.d.ts.map +0 -1
- package/dist/core/duration.test.js +0 -265
- package/dist/core/duration.test.js.map +0 -1
- package/dist/core/error.test.d.ts +0 -2
- package/dist/core/error.test.d.ts.map +0 -1
- package/dist/core/error.test.js +0 -63
- package/dist/core/error.test.js.map +0 -1
- package/dist/core/json.js +0 -3
- package/dist/core/json.js.map +0 -1
- package/dist/core/result.test.d.ts +0 -2
- package/dist/core/result.test.d.ts.map +0 -1
- package/dist/core/result.test.js +0 -19
- package/dist/core/result.test.js.map +0 -1
- package/dist/core/retry.test.d.ts +0 -2
- package/dist/core/retry.test.d.ts.map +0 -1
- package/dist/core/retry.test.js +0 -37
- package/dist/core/retry.test.js.map +0 -1
- package/dist/core/schema.js +0 -4
- package/dist/core/schema.js.map +0 -1
- package/dist/core/step.test.d.ts +0 -2
- package/dist/core/step.test.d.ts.map +0 -1
- package/dist/core/step.test.js +0 -356
- package/dist/core/step.test.js.map +0 -1
- package/dist/core/workflow.test.d.ts +0 -2
- package/dist/core/workflow.test.d.ts.map +0 -1
- package/dist/core/workflow.test.js +0 -172
- package/dist/core/workflow.test.js.map +0 -1
- package/dist/database/backend.test.d.ts +0 -2
- package/dist/database/backend.test.d.ts.map +0 -1
- package/dist/database/backend.test.js +0 -19
- package/dist/database/backend.test.js.map +0 -1
- package/dist/database/backend.testsuite.d.ts +0 -20
- package/dist/database/backend.testsuite.d.ts.map +0 -1
- package/dist/database/backend.testsuite.js +0 -1174
- package/dist/database/backend.testsuite.js.map +0 -1
- package/dist/database/base.d.ts +0 -12
- package/dist/database/base.d.ts.map +0 -1
- package/dist/database/pubsub.test.d.ts +0 -2
- package/dist/database/pubsub.test.d.ts.map +0 -1
- package/dist/database/pubsub.test.js +0 -86
- package/dist/database/pubsub.test.js.map +0 -1
- package/dist/execution.test.d.ts +0 -2
- package/dist/execution.test.d.ts.map +0 -1
- package/dist/execution.test.js +0 -558
- package/dist/execution.test.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal.d.ts.map +0 -1
- package/dist/internal.js.map +0 -1
- package/dist/practices/01-remote-workflow.d.ts +0 -2
- package/dist/practices/01-remote-workflow.d.ts.map +0 -1
- package/dist/practices/01-remote-workflow.js +0 -70
- package/dist/practices/01-remote-workflow.js.map +0 -1
- package/dist/registry.test.d.ts +0 -2
- package/dist/registry.test.d.ts.map +0 -1
- package/dist/registry.test.js +0 -95
- package/dist/registry.test.js.map +0 -1
- package/dist/testing/connection.d.ts +0 -7
- package/dist/testing/connection.d.ts.map +0 -1
- package/dist/testing/connection.js +0 -39
- package/dist/testing/connection.js.map +0 -1
- package/dist/worker.test.d.ts +0 -2
- package/dist/worker.test.d.ts.map +0 -1
- package/dist/worker.test.js +0 -1164
- package/dist/worker.test.js.map +0 -1
- package/dist/workflow.test.d.ts +0 -2
- package/dist/workflow.test.d.ts.map +0 -1
- package/dist/workflow.test.js +0 -73
- package/dist/workflow.test.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Knex } from "knex";
|
|
2
|
+
|
|
3
|
+
//#region src/database/migrations/20251212000000_2_fk.d.ts
|
|
4
|
+
declare function up(knex: Knex): Promise<void>;
|
|
5
|
+
declare function down(knex: Knex): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=20251212000000_2_fk.d.ts.map
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { down, up };
|
|
10
|
+
//# sourceMappingURL=20251212000000_2_fk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20251212000000_2_fk.d.ts","names":[],"sources":["../../../src/database/migrations/20251212000000_2_fk.ts"],"sourcesContent":[],"mappings":";;;iBAIsB,EAAA,OAAS,OAAO;iBA4BhB,IAAA,OAAW,OAAO;AA5BxC"}
|
|
@@ -1,48 +1,25 @@
|
|
|
1
1
|
import { DEFAULT_SCHEMA } from "../base.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"child_workflow_run_namespace_id",
|
|
13
|
-
"child_workflow_run_id"
|
|
14
|
-
], "step_attempts_child_workflow_run_fk").references([
|
|
15
|
-
"namespace_id",
|
|
16
|
-
"id"
|
|
17
|
-
]).inTable(`${DEFAULT_SCHEMA}.workflow_runs`).onDelete("set null");
|
|
18
|
-
});
|
|
19
|
-
await knex.schema.withSchema(DEFAULT_SCHEMA).alterTable("workflow_runs", (table)=>{
|
|
20
|
-
table.foreign([
|
|
21
|
-
"parent_step_attempt_namespace_id",
|
|
22
|
-
"parent_step_attempt_id"
|
|
23
|
-
], "workflow_runs_parent_step_attempt_fk").references([
|
|
24
|
-
"namespace_id",
|
|
25
|
-
"id"
|
|
26
|
-
]).inTable(`${DEFAULT_SCHEMA}.step_attempts`).onDelete("set null");
|
|
27
|
-
});
|
|
2
|
+
|
|
3
|
+
//#region src/database/migrations/20251212000000_2_fk.ts
|
|
4
|
+
async function up(knex) {
|
|
5
|
+
await knex.schema.withSchema(DEFAULT_SCHEMA).alterTable("step_attempts", (table) => {
|
|
6
|
+
table.foreign(["namespace_id", "workflow_run_id"], "step_attempts_workflow_run_fk").references(["namespace_id", "id"]).inTable(`${DEFAULT_SCHEMA}.workflow_runs`).onDelete("cascade");
|
|
7
|
+
table.foreign(["child_workflow_run_namespace_id", "child_workflow_run_id"], "step_attempts_child_workflow_run_fk").references(["namespace_id", "id"]).inTable(`${DEFAULT_SCHEMA}.workflow_runs`).onDelete("set null");
|
|
8
|
+
});
|
|
9
|
+
await knex.schema.withSchema(DEFAULT_SCHEMA).alterTable("workflow_runs", (table) => {
|
|
10
|
+
table.foreign(["parent_step_attempt_namespace_id", "parent_step_attempt_id"], "workflow_runs_parent_step_attempt_fk").references(["namespace_id", "id"]).inTable(`${DEFAULT_SCHEMA}.step_attempts`).onDelete("set null");
|
|
11
|
+
});
|
|
28
12
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"child_workflow_run_id"
|
|
38
|
-
], "step_attempts_child_workflow_run_fk");
|
|
39
|
-
});
|
|
40
|
-
await knex.schema.withSchema(DEFAULT_SCHEMA).alterTable("workflow_runs", (table)=>{
|
|
41
|
-
table.dropForeign([
|
|
42
|
-
"parent_step_attempt_namespace_id",
|
|
43
|
-
"parent_step_attempt_id"
|
|
44
|
-
], "workflow_runs_parent_step_attempt_fk");
|
|
45
|
-
});
|
|
13
|
+
async function down(knex) {
|
|
14
|
+
await knex.schema.withSchema(DEFAULT_SCHEMA).alterTable("step_attempts", (table) => {
|
|
15
|
+
table.dropForeign(["namespace_id", "workflow_run_id"], "step_attempts_workflow_run_fk");
|
|
16
|
+
table.dropForeign(["child_workflow_run_namespace_id", "child_workflow_run_id"], "step_attempts_child_workflow_run_fk");
|
|
17
|
+
});
|
|
18
|
+
await knex.schema.withSchema(DEFAULT_SCHEMA).alterTable("workflow_runs", (table) => {
|
|
19
|
+
table.dropForeign(["parent_step_attempt_namespace_id", "parent_step_attempt_id"], "workflow_runs_parent_step_attempt_fk");
|
|
20
|
+
});
|
|
46
21
|
}
|
|
47
22
|
|
|
23
|
+
//#endregion
|
|
24
|
+
export { down, up };
|
|
48
25
|
//# sourceMappingURL=20251212000000_2_fk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/database/migrations/20251212000000_2_fk.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"20251212000000_2_fk.js","names":[],"sources":["../../../src/database/migrations/20251212000000_2_fk.ts"],"sourcesContent":["import { type Knex } from \"knex\";\n\nimport { DEFAULT_SCHEMA } from \"../base\";\n\nexport async function up(knex: Knex): Promise<void> {\n await knex.schema.withSchema(DEFAULT_SCHEMA).alterTable(\"step_attempts\", (table) => {\n table\n .foreign([\"namespace_id\", \"workflow_run_id\"], \"step_attempts_workflow_run_fk\")\n .references([\"namespace_id\", \"id\"])\n .inTable(`${DEFAULT_SCHEMA}.workflow_runs`)\n .onDelete(\"cascade\");\n table\n .foreign(\n [\"child_workflow_run_namespace_id\", \"child_workflow_run_id\"],\n \"step_attempts_child_workflow_run_fk\",\n )\n .references([\"namespace_id\", \"id\"])\n .inTable(`${DEFAULT_SCHEMA}.workflow_runs`)\n .onDelete(\"set null\");\n });\n await knex.schema.withSchema(DEFAULT_SCHEMA).alterTable(\"workflow_runs\", (table) => {\n table\n .foreign(\n [\"parent_step_attempt_namespace_id\", \"parent_step_attempt_id\"],\n \"workflow_runs_parent_step_attempt_fk\",\n )\n .references([\"namespace_id\", \"id\"])\n .inTable(`${DEFAULT_SCHEMA}.step_attempts`)\n .onDelete(\"set null\");\n });\n}\n\nexport async function down(knex: Knex): Promise<void> {\n await knex.schema.withSchema(DEFAULT_SCHEMA).alterTable(\"step_attempts\", (table) => {\n table.dropForeign([\"namespace_id\", \"workflow_run_id\"], \"step_attempts_workflow_run_fk\");\n table.dropForeign(\n [\"child_workflow_run_namespace_id\", \"child_workflow_run_id\"],\n \"step_attempts_child_workflow_run_fk\",\n );\n });\n await knex.schema.withSchema(DEFAULT_SCHEMA).alterTable(\"workflow_runs\", (table) => {\n table.dropForeign(\n [\"parent_step_attempt_namespace_id\", \"parent_step_attempt_id\"],\n \"workflow_runs_parent_step_attempt_fk\",\n );\n });\n}\n"],"mappings":";;;AAIA,eAAsB,GAAG,MAA2B;AAClD,OAAM,KAAK,OAAO,WAAW,eAAe,CAAC,WAAW,kBAAkB,UAAU;AAClF,QACG,QAAQ,CAAC,gBAAgB,kBAAkB,EAAE,gCAAgC,CAC7E,WAAW,CAAC,gBAAgB,KAAK,CAAC,CAClC,QAAQ,GAAG,eAAe,gBAAgB,CAC1C,SAAS,UAAU;AACtB,QACG,QACC,CAAC,mCAAmC,wBAAwB,EAC5D,sCACD,CACA,WAAW,CAAC,gBAAgB,KAAK,CAAC,CAClC,QAAQ,GAAG,eAAe,gBAAgB,CAC1C,SAAS,WAAW;GACvB;AACF,OAAM,KAAK,OAAO,WAAW,eAAe,CAAC,WAAW,kBAAkB,UAAU;AAClF,QACG,QACC,CAAC,oCAAoC,yBAAyB,EAC9D,uCACD,CACA,WAAW,CAAC,gBAAgB,KAAK,CAAC,CAClC,QAAQ,GAAG,eAAe,gBAAgB,CAC1C,SAAS,WAAW;GACvB;;AAGJ,eAAsB,KAAK,MAA2B;AACpD,OAAM,KAAK,OAAO,WAAW,eAAe,CAAC,WAAW,kBAAkB,UAAU;AAClF,QAAM,YAAY,CAAC,gBAAgB,kBAAkB,EAAE,gCAAgC;AACvF,QAAM,YACJ,CAAC,mCAAmC,wBAAwB,EAC5D,sCACD;GACD;AACF,OAAM,KAAK,OAAO,WAAW,eAAe,CAAC,WAAW,kBAAkB,UAAU;AAClF,QAAM,YACJ,CAAC,oCAAoC,yBAAyB,EAC9D,uCACD;GACD"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Knex } from "knex";
|
|
2
|
+
|
|
3
|
+
//#region src/database/migrations/20251212000000_3_indexes.d.ts
|
|
4
|
+
declare function up(knex: Knex): Promise<void>;
|
|
5
|
+
declare function down(knex: Knex): Promise<void>;
|
|
6
|
+
//# sourceMappingURL=20251212000000_3_indexes.d.ts.map
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { down, up };
|
|
10
|
+
//# sourceMappingURL=20251212000000_3_indexes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"20251212000000_3_indexes.d.ts","names":[],"sources":["../../../src/database/migrations/20251212000000_3_indexes.ts"],"sourcesContent":[],"mappings":";;;iBAIsB,EAAA,OAAS,OAAO;iBAwChB,IAAA,OAAW,OAAO;AAxCxC"}
|
|
@@ -1,107 +1,93 @@
|
|
|
1
1
|
import { DEFAULT_SCHEMA } from "../base.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"created_at"
|
|
47
|
-
], "step_attempts_workflow_run_step_name_created_at_idx");
|
|
48
|
-
table.index([
|
|
49
|
-
"child_workflow_run_namespace_id",
|
|
50
|
-
"child_workflow_run_id"
|
|
51
|
-
], "step_attempts_child_workflow_run_idx");
|
|
52
|
-
});
|
|
2
|
+
|
|
3
|
+
//#region src/database/migrations/20251212000000_3_indexes.ts
|
|
4
|
+
async function up(knex) {
|
|
5
|
+
await knex.schema.withSchema(DEFAULT_SCHEMA).table("workflow_runs", (table) => {
|
|
6
|
+
table.index([
|
|
7
|
+
"namespace_id",
|
|
8
|
+
"status",
|
|
9
|
+
"available_at",
|
|
10
|
+
"created_at"
|
|
11
|
+
], "workflow_runs_status_available_at_created_at_idx");
|
|
12
|
+
table.index([
|
|
13
|
+
"namespace_id",
|
|
14
|
+
"workflow_name",
|
|
15
|
+
"idempotency_key",
|
|
16
|
+
"created_at"
|
|
17
|
+
], "workflow_runs_workflow_name_idempotency_key_created_at_idx");
|
|
18
|
+
table.index(["parent_step_attempt_namespace_id", "parent_step_attempt_id"], "workflow_runs_parent_step_idx");
|
|
19
|
+
table.index(["namespace_id", "created_at"], "workflow_runs_created_at_desc_idx");
|
|
20
|
+
table.index([
|
|
21
|
+
"namespace_id",
|
|
22
|
+
"status",
|
|
23
|
+
"created_at"
|
|
24
|
+
], "workflow_runs_status_created_at_desc_idx");
|
|
25
|
+
table.index([
|
|
26
|
+
"namespace_id",
|
|
27
|
+
"workflow_name",
|
|
28
|
+
"status",
|
|
29
|
+
"created_at"
|
|
30
|
+
], "workflow_runs_workflow_name_status_created_at_desc_idx");
|
|
31
|
+
});
|
|
32
|
+
await knex.schema.withSchema(DEFAULT_SCHEMA).table("step_attempts", (table) => {
|
|
33
|
+
table.index([
|
|
34
|
+
"namespace_id",
|
|
35
|
+
"workflow_run_id",
|
|
36
|
+
"created_at"
|
|
37
|
+
], "step_attempts_workflow_run_created_at_idx");
|
|
38
|
+
table.index([
|
|
39
|
+
"namespace_id",
|
|
40
|
+
"workflow_run_id",
|
|
41
|
+
"step_name",
|
|
42
|
+
"created_at"
|
|
43
|
+
], "step_attempts_workflow_run_step_name_created_at_idx");
|
|
44
|
+
table.index(["child_workflow_run_namespace_id", "child_workflow_run_id"], "step_attempts_child_workflow_run_idx");
|
|
45
|
+
});
|
|
53
46
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"workflow_run_id",
|
|
97
|
-
"step_name",
|
|
98
|
-
"created_at"
|
|
99
|
-
], "step_attempts_workflow_run_step_name_created_at_idx");
|
|
100
|
-
table.dropIndex([
|
|
101
|
-
"child_workflow_run_namespace_id",
|
|
102
|
-
"child_workflow_run_id"
|
|
103
|
-
], "step_attempts_child_workflow_run_idx");
|
|
104
|
-
});
|
|
47
|
+
async function down(knex) {
|
|
48
|
+
await knex.schema.withSchema(DEFAULT_SCHEMA).table("workflow_runs", (table) => {
|
|
49
|
+
table.dropIndex([
|
|
50
|
+
"namespace_id",
|
|
51
|
+
"status",
|
|
52
|
+
"available_at",
|
|
53
|
+
"created_at"
|
|
54
|
+
], "workflow_runs_status_available_at_created_at_idx");
|
|
55
|
+
table.dropIndex([
|
|
56
|
+
"namespace_id",
|
|
57
|
+
"workflow_name",
|
|
58
|
+
"idempotency_key",
|
|
59
|
+
"created_at"
|
|
60
|
+
], "workflow_runs_workflow_name_idempotency_key_created_at_idx");
|
|
61
|
+
table.dropIndex(["parent_step_attempt_namespace_id", "parent_step_attempt_id"], "workflow_runs_parent_step_idx");
|
|
62
|
+
table.dropIndex(["namespace_id", "created_at"], "workflow_runs_created_at_desc_idx");
|
|
63
|
+
table.dropIndex([
|
|
64
|
+
"namespace_id",
|
|
65
|
+
"status",
|
|
66
|
+
"created_at"
|
|
67
|
+
], "workflow_runs_status_created_at_desc_idx");
|
|
68
|
+
table.dropIndex([
|
|
69
|
+
"namespace_id",
|
|
70
|
+
"workflow_name",
|
|
71
|
+
"status",
|
|
72
|
+
"created_at"
|
|
73
|
+
], "workflow_runs_workflow_name_status_created_at_desc_idx");
|
|
74
|
+
});
|
|
75
|
+
await knex.schema.withSchema(DEFAULT_SCHEMA).table("step_attempts", (table) => {
|
|
76
|
+
table.dropIndex([
|
|
77
|
+
"namespace_id",
|
|
78
|
+
"workflow_run_id",
|
|
79
|
+
"created_at"
|
|
80
|
+
], "step_attempts_workflow_run_created_at_idx");
|
|
81
|
+
table.dropIndex([
|
|
82
|
+
"namespace_id",
|
|
83
|
+
"workflow_run_id",
|
|
84
|
+
"step_name",
|
|
85
|
+
"created_at"
|
|
86
|
+
], "step_attempts_workflow_run_step_name_created_at_idx");
|
|
87
|
+
table.dropIndex(["child_workflow_run_namespace_id", "child_workflow_run_id"], "step_attempts_child_workflow_run_idx");
|
|
88
|
+
});
|
|
105
89
|
}
|
|
106
90
|
|
|
91
|
+
//#endregion
|
|
92
|
+
export { down, up };
|
|
107
93
|
//# sourceMappingURL=20251212000000_3_indexes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/database/migrations/20251212000000_3_indexes.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"20251212000000_3_indexes.js","names":[],"sources":["../../../src/database/migrations/20251212000000_3_indexes.ts"],"sourcesContent":["import { type Knex } from \"knex\";\n\nimport { DEFAULT_SCHEMA } from \"../base\";\n\nexport async function up(knex: Knex): Promise<void> {\n await knex.schema.withSchema(DEFAULT_SCHEMA).table(\"workflow_runs\", (table) => {\n table.index(\n [\"namespace_id\", \"status\", \"available_at\", \"created_at\"],\n \"workflow_runs_status_available_at_created_at_idx\",\n );\n table.index(\n [\"namespace_id\", \"workflow_name\", \"idempotency_key\", \"created_at\"],\n \"workflow_runs_workflow_name_idempotency_key_created_at_idx\",\n );\n table.index(\n [\"parent_step_attempt_namespace_id\", \"parent_step_attempt_id\"],\n \"workflow_runs_parent_step_idx\",\n );\n table.index([\"namespace_id\", \"created_at\"], \"workflow_runs_created_at_desc_idx\");\n table.index(\n [\"namespace_id\", \"status\", \"created_at\"],\n \"workflow_runs_status_created_at_desc_idx\",\n );\n table.index(\n [\"namespace_id\", \"workflow_name\", \"status\", \"created_at\"],\n \"workflow_runs_workflow_name_status_created_at_desc_idx\",\n );\n });\n await knex.schema.withSchema(DEFAULT_SCHEMA).table(\"step_attempts\", (table) => {\n table.index(\n [\"namespace_id\", \"workflow_run_id\", \"created_at\"],\n \"step_attempts_workflow_run_created_at_idx\",\n );\n table.index(\n [\"namespace_id\", \"workflow_run_id\", \"step_name\", \"created_at\"],\n \"step_attempts_workflow_run_step_name_created_at_idx\",\n );\n table.index(\n [\"child_workflow_run_namespace_id\", \"child_workflow_run_id\"],\n \"step_attempts_child_workflow_run_idx\",\n );\n });\n}\n\nexport async function down(knex: Knex): Promise<void> {\n await knex.schema.withSchema(DEFAULT_SCHEMA).table(\"workflow_runs\", (table) => {\n table.dropIndex(\n [\"namespace_id\", \"status\", \"available_at\", \"created_at\"],\n \"workflow_runs_status_available_at_created_at_idx\",\n );\n table.dropIndex(\n [\"namespace_id\", \"workflow_name\", \"idempotency_key\", \"created_at\"],\n \"workflow_runs_workflow_name_idempotency_key_created_at_idx\",\n );\n table.dropIndex(\n [\"parent_step_attempt_namespace_id\", \"parent_step_attempt_id\"],\n \"workflow_runs_parent_step_idx\",\n );\n table.dropIndex([\"namespace_id\", \"created_at\"], \"workflow_runs_created_at_desc_idx\");\n table.dropIndex(\n [\"namespace_id\", \"status\", \"created_at\"],\n \"workflow_runs_status_created_at_desc_idx\",\n );\n table.dropIndex(\n [\"namespace_id\", \"workflow_name\", \"status\", \"created_at\"],\n \"workflow_runs_workflow_name_status_created_at_desc_idx\",\n );\n });\n await knex.schema.withSchema(DEFAULT_SCHEMA).table(\"step_attempts\", (table) => {\n table.dropIndex(\n [\"namespace_id\", \"workflow_run_id\", \"created_at\"],\n \"step_attempts_workflow_run_created_at_idx\",\n );\n table.dropIndex(\n [\"namespace_id\", \"workflow_run_id\", \"step_name\", \"created_at\"],\n \"step_attempts_workflow_run_step_name_created_at_idx\",\n );\n table.dropIndex(\n [\"child_workflow_run_namespace_id\", \"child_workflow_run_id\"],\n \"step_attempts_child_workflow_run_idx\",\n );\n });\n}\n"],"mappings":";;;AAIA,eAAsB,GAAG,MAA2B;AAClD,OAAM,KAAK,OAAO,WAAW,e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Aa,EAC9D,sDACD;AACD,QAAM,UACJ,CAAC,mCAAmC,wBAAwB,EAC5D,uCACD;GACD"}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
private _listeners;
|
|
9
|
-
private _connection;
|
|
10
|
-
private constructor();
|
|
11
|
-
get destroyed(): boolean;
|
|
12
|
-
connect(): Promise<void>;
|
|
13
|
-
destroy(): Promise<void>;
|
|
14
|
-
static create(knex: Knex): Promise<PostgresPubSub>;
|
|
15
|
-
listenEvent(channel: string, callback: OnSubscribed): void;
|
|
16
|
-
}
|
|
1
|
+
import { Result } from "../core/result.js";
|
|
2
|
+
import { Knex } from "knex";
|
|
3
|
+
|
|
4
|
+
//#region src/database/pubsub.d.ts
|
|
5
|
+
type OnSubscribed = (result: Result<string | null>) => void | Promise<void>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { OnSubscribed };
|
|
17
8
|
//# sourceMappingURL=pubsub.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pubsub.d.ts","
|
|
1
|
+
{"version":3,"file":"pubsub.d.ts","names":[],"sources":["../../src/database/pubsub.ts"],"sourcesContent":[],"mappings":";;;;KAOY,YAAA,YAAwB,iCAAiC"}
|
package/dist/database/pubsub.js
CHANGED
|
@@ -1,76 +1,78 @@
|
|
|
1
|
-
import assert from "assert";
|
|
2
1
|
import { err, ok } from "../core/result.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
2
|
+
import assert from "assert";
|
|
3
|
+
|
|
4
|
+
//#region src/database/pubsub.ts
|
|
5
|
+
var PostgresPubSub = class PostgresPubSub {
|
|
6
|
+
_destroyed = false;
|
|
7
|
+
_connecting = false;
|
|
8
|
+
_onClosed;
|
|
9
|
+
_onNotification;
|
|
10
|
+
_onError;
|
|
11
|
+
_listeners = /* @__PURE__ */ new Map();
|
|
12
|
+
_connection = null;
|
|
13
|
+
constructor(knex) {
|
|
14
|
+
this.knex = knex;
|
|
15
|
+
this._onClosed = (async () => {
|
|
16
|
+
if (this._destroyed) return;
|
|
17
|
+
await this.connect();
|
|
18
|
+
}).bind(this);
|
|
19
|
+
this._onNotification = (async ({ channel, payload: rawPayload }) => {
|
|
20
|
+
const payload = typeof rawPayload === "string" && rawPayload.length !== 0 ? rawPayload : null;
|
|
21
|
+
const listeners = this._listeners.get(channel);
|
|
22
|
+
if (!listeners) return;
|
|
23
|
+
const result = ok(payload);
|
|
24
|
+
await Promise.allSettled(Array.from(listeners.values()).map((listener) => Promise.resolve(listener(result))));
|
|
25
|
+
}).bind(this);
|
|
26
|
+
this._onError = (async (error) => {
|
|
27
|
+
const result = err(error);
|
|
28
|
+
await Promise.allSettled(Array.from(this._listeners.values()).flatMap((listeners) => Array.from(listeners)).map((listener) => Promise.resolve(listener(result))));
|
|
29
|
+
}).bind(this);
|
|
30
|
+
}
|
|
31
|
+
get destroyed() {
|
|
32
|
+
return this._destroyed;
|
|
33
|
+
}
|
|
34
|
+
async connect() {
|
|
35
|
+
if (this._connecting) return;
|
|
36
|
+
this._connecting = true;
|
|
37
|
+
try {
|
|
38
|
+
const connection = await this.knex.client.acquireRawConnection();
|
|
39
|
+
connection.on("close", this._onClosed);
|
|
40
|
+
connection.on("notification", this._onNotification);
|
|
41
|
+
connection.on("error", this._onError);
|
|
42
|
+
for (const channel of this._listeners.keys()) connection.query(`LISTEN ${channel}`);
|
|
43
|
+
this._connection = connection;
|
|
44
|
+
} finally {
|
|
45
|
+
this._connecting = false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async destroy() {
|
|
49
|
+
if (this._destroyed) return;
|
|
50
|
+
try {
|
|
51
|
+
this._connection.off("close", this._onClosed);
|
|
52
|
+
this._connection.off("notification", this._onNotification);
|
|
53
|
+
this._connection.off("error", this._onError);
|
|
54
|
+
await this.knex.client.destroyRawConnection(this._connection);
|
|
55
|
+
} finally {
|
|
56
|
+
this._destroyed = true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
static async create(knex) {
|
|
60
|
+
const listener = new PostgresPubSub(knex);
|
|
61
|
+
await listener.connect();
|
|
62
|
+
return listener;
|
|
63
|
+
}
|
|
64
|
+
listenEvent(channel, callback) {
|
|
65
|
+
if (!this._listeners.has(channel)) {
|
|
66
|
+
this._connection?.query(`LISTEN ${channel}`);
|
|
67
|
+
this._listeners.set(channel, (/* @__PURE__ */ new Set()).add(callback));
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const listeners = this._listeners.get(channel);
|
|
71
|
+
assert(listeners, "Listener channel not found");
|
|
72
|
+
listeners.add(callback);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
75
|
|
|
76
|
+
//#endregion
|
|
77
|
+
export { PostgresPubSub };
|
|
76
78
|
//# sourceMappingURL=pubsub.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/database/pubsub.ts"],"sourcesContent":["import assert from \"assert\";\nimport type
|
|
1
|
+
{"version":3,"file":"pubsub.js","names":["knex: Knex"],"sources":["../../src/database/pubsub.ts"],"sourcesContent":["import assert from \"assert\";\n\nimport { type Knex } from \"knex\";\n\nimport { err, ok } from \"../core/result\";\nimport { type Result } from \"../core/result\";\n\nexport type OnSubscribed = (result: Result<string | null>) => void | Promise<void>;\n\nexport class PostgresPubSub {\n private _destroyed = false;\n private _connecting = false;\n private _onClosed: () => Promise<void>;\n private _onNotification: (msg: { channel: string; payload: unknown }) => Promise<void>;\n private _onError: (error: Error) => Promise<void>;\n private _listeners = new Map<string, Set<OnSubscribed>>();\n\n // oxlint-disable-next-line @typescript-eslint/no-explicit-any -- Knex exposes a connection as any\n private _connection: any | null = null;\n\n private constructor(private readonly knex: Knex) {\n // Re-connect to the database when the connection is closed and not destroyed manually\n this._onClosed = (async () => {\n if (this._destroyed) {\n return;\n }\n\n await this.connect();\n }).bind(this);\n\n this._onNotification = (async ({\n channel,\n payload: rawPayload,\n }: {\n channel: string;\n payload: unknown;\n }) => {\n const payload = typeof rawPayload === \"string\" && rawPayload.length !== 0 ? rawPayload : null;\n const listeners = this._listeners.get(channel);\n if (!listeners) {\n return;\n }\n\n const result = ok(payload);\n await Promise.allSettled(\n Array.from(listeners.values()).map((listener) => Promise.resolve(listener(result))),\n );\n }).bind(this);\n\n this._onError = (async (error: Error) => {\n const result = err(error);\n await Promise.allSettled(\n Array.from(this._listeners.values())\n .flatMap((listeners) => Array.from(listeners))\n .map((listener) => Promise.resolve(listener(result))),\n );\n }).bind(this);\n }\n\n get destroyed() {\n return this._destroyed;\n }\n\n // acquire new raw connection and set up listeners\n async connect() {\n // 동시 재연결 시도로 인한 연결 누수를 방지합니다.\n if (this._connecting) return;\n this._connecting = true;\n\n try {\n const connection = await this.knex.client.acquireRawConnection();\n connection.on(\"close\", this._onClosed);\n connection.on(\"notification\", this._onNotification);\n connection.on(\"error\", this._onError);\n\n for (const channel of this._listeners.keys()) {\n connection.query(`LISTEN ${channel}`);\n }\n\n this._connection = connection;\n } finally {\n this._connecting = false;\n }\n }\n\n // destroy the listener and close the connection, do not destroy the knex connection\n async destroy() {\n if (this._destroyed) {\n return;\n }\n try {\n this._connection.off(\"close\", this._onClosed);\n this._connection.off(\"notification\", this._onNotification);\n this._connection.off(\"error\", this._onError);\n await this.knex.client.destroyRawConnection(this._connection);\n } finally {\n this._destroyed = true;\n }\n }\n\n // create a new listener and connect to the database\n static async create(knex: Knex) {\n const listener = new PostgresPubSub(knex);\n await listener.connect();\n return listener;\n }\n\n // add a new listener to the channel\n listenEvent(channel: string, callback: OnSubscribed) {\n if (!this._listeners.has(channel)) {\n this._connection?.query(`LISTEN ${channel}`);\n this._listeners.set(channel, new Set<OnSubscribed>().add(callback));\n return;\n }\n\n const listeners = this._listeners.get(channel);\n assert(listeners, \"Listener channel not found\");\n listeners.add(callback);\n }\n}\n"],"mappings":";;;;AASA,IAAa,iBAAb,MAAa,eAAe;CAC1B,AAAQ,aAAa;CACrB,AAAQ,cAAc;CACtB,AAAQ;CACR,AAAQ;CACR,AAAQ;CACR,AAAQ,6BAAa,IAAI,KAAgC;CAGzD,AAAQ,cAA0B;CAElC,AAAQ,YAAY,AAAiBA,MAAY;EAAZ;AAEnC,OAAK,aAAa,YAAY;AAC5B,OAAI,KAAK,WACP;AAGF,SAAM,KAAK,SAAS;KACnB,KAAK,KAAK;AAEb,OAAK,mBAAmB,OAAO,EAC7B,SACA,SAAS,iBAIL;GACJ,MAAM,UAAU,OAAO,eAAe,YAAY,WAAW,WAAW,IAAI,aAAa;GACzF,MAAM,YAAY,KAA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