@pikku/kysely 0.13.33 → 0.13.35
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/CHANGELOG.md +48 -0
- package/dist/bin/pikku-kysely-pure.js +4 -1
- package/dist/src/classification-crypto.js +16 -2
- package/dist/src/kysely-deployment-service.js +4 -1
- package/dist/src/kysely-virtual-user-run-store.js +1 -2
- package/dist/src/kysely-workflow-service.d.ts +5 -0
- package/dist/src/kysely-workflow-service.js +3 -0
- package/dist/src/schema/agent.schema.js +43 -36
- package/dist/src/schema/analytics.schema.js +17 -17
- package/dist/src/schema/audit.schema.js +22 -22
- package/dist/src/schema/channel.schema.js +13 -10
- package/dist/src/schema/credential.schema.js +6 -6
- package/dist/src/schema/deployment.schema.js +12 -12
- package/dist/src/schema/flag.schema.js +15 -12
- package/dist/src/schema/incoming-webhook.schema.js +7 -7
- package/dist/src/schema/index.js +30 -7
- package/dist/src/schema/lease.schema.js +3 -3
- package/dist/src/schema/pikku-schema.types.d.ts +42 -2
- package/dist/src/schema/pikku-schema.types.js +23 -7
- package/dist/src/schema/scope.schema.js +34 -22
- package/dist/src/schema/secret.schema.js +5 -5
- package/dist/src/schema/session.schema.js +3 -3
- package/dist/src/schema/trigger-source.schema.js +8 -8
- package/dist/src/schema/virtual-user-schedule.schema.js +4 -4
- package/dist/src/schema/virtual-user.schema.js +14 -14
- package/dist/src/schema/webhook.schema.js +17 -17
- package/dist/src/schema/workflow.schema.js +49 -49
- package/package.json +3 -2
|
@@ -18,40 +18,37 @@ export const workflowSchema = {
|
|
|
18
18
|
name: 'workflow',
|
|
19
19
|
ownedBy: ['workflowService', 'workflowRunService'],
|
|
20
20
|
statements: [
|
|
21
|
-
(db) => db.schema
|
|
21
|
+
(db, _types, ctx) => db.schema
|
|
22
22
|
.createTable('workflowRuns')
|
|
23
|
-
.addColumn('workflowRunId',
|
|
24
|
-
.addColumn('workflow',
|
|
25
|
-
.addColumn('status',
|
|
26
|
-
.addColumn('input',
|
|
27
|
-
.addColumn('output',
|
|
28
|
-
.addColumn('error',
|
|
29
|
-
.addColumn('state',
|
|
23
|
+
.addColumn('workflowRunId', ctx.key, (col) => col.primaryKey())
|
|
24
|
+
.addColumn('workflow', ctx.key, (col) => col.notNull())
|
|
25
|
+
.addColumn('status', ctx.key, (col) => col.notNull())
|
|
26
|
+
.addColumn('input', ctx.text, (col) => col.notNull())
|
|
27
|
+
.addColumn('output', ctx.text)
|
|
28
|
+
.addColumn('error', ctx.text)
|
|
29
|
+
.addColumn('state', ctx.text, (col) => col.defaultTo(ctx.defaultText('{}')))
|
|
30
30
|
.addColumn('inline', 'boolean', (col) => col.defaultTo(false))
|
|
31
|
-
.addColumn('graphHash',
|
|
31
|
+
.addColumn('graphHash', ctx.key)
|
|
32
32
|
.addColumn('deterministic', 'boolean', (col) => col.defaultTo(false))
|
|
33
|
-
.addColumn('plannedSteps',
|
|
34
|
-
.addColumn('wire',
|
|
33
|
+
.addColumn('plannedSteps', ctx.text)
|
|
34
|
+
.addColumn('wire', ctx.text)
|
|
35
35
|
.addColumn('createdAt', 'timestamp', (col) => col.defaultTo(sql `CURRENT_TIMESTAMP`).notNull())
|
|
36
36
|
.addColumn('updatedAt', 'timestamp', (col) => col.defaultTo(sql `CURRENT_TIMESTAMP`).notNull()),
|
|
37
|
-
(db) => db.schema
|
|
37
|
+
(db, _types, ctx) => db.schema
|
|
38
38
|
.createTable('workflowStep')
|
|
39
|
-
.addColumn('workflowStepId',
|
|
40
|
-
.addColumn('workflowRunId',
|
|
41
|
-
.notNull()
|
|
42
|
-
.
|
|
43
|
-
.
|
|
44
|
-
.addColumn('
|
|
45
|
-
.addColumn('
|
|
46
|
-
.addColumn('
|
|
47
|
-
.addColumn('
|
|
48
|
-
.addColumn('
|
|
49
|
-
.addColumn('error', 'text')
|
|
50
|
-
.addColumn('childRunId', 'text')
|
|
51
|
-
.addColumn('branchTaken', 'text')
|
|
39
|
+
.addColumn('workflowStepId', ctx.key, (col) => col.primaryKey())
|
|
40
|
+
.addColumn('workflowRunId', ctx.key, (col) => ctx.references(col.notNull(), 'workflowRuns.workflowRunId'))
|
|
41
|
+
.addColumn('stepName', ctx.key, (col) => col.notNull())
|
|
42
|
+
.addColumn('rpcName', ctx.text)
|
|
43
|
+
.addColumn('data', ctx.text)
|
|
44
|
+
.addColumn('status', ctx.key, (col) => col.notNull().defaultTo(ctx.defaultText('pending')))
|
|
45
|
+
.addColumn('result', ctx.text)
|
|
46
|
+
.addColumn('error', ctx.text)
|
|
47
|
+
.addColumn('childRunId', ctx.text)
|
|
48
|
+
.addColumn('branchTaken', ctx.text)
|
|
52
49
|
.addColumn('retries', 'integer')
|
|
53
|
-
.addColumn('retryDelay',
|
|
54
|
-
.addColumn('fromStepName',
|
|
50
|
+
.addColumn('retryDelay', ctx.text)
|
|
51
|
+
.addColumn('fromStepName', ctx.text)
|
|
55
52
|
.addColumn('currentAttempt', 'integer')
|
|
56
53
|
.addColumn('leaseExpiresAt', 'bigint')
|
|
57
54
|
.addColumn('createdAt', 'timestamp', (col) => col.defaultTo(sql `CURRENT_TIMESTAMP`).notNull())
|
|
@@ -59,30 +56,33 @@ export const workflowSchema = {
|
|
|
59
56
|
.addUniqueConstraint('workflow_step_run_name_unique', [
|
|
60
57
|
'workflowRunId',
|
|
61
58
|
'stepName',
|
|
62
|
-
])
|
|
63
|
-
|
|
59
|
+
])
|
|
60
|
+
.$call(ctx.foreignKeys('workflowStep', {
|
|
61
|
+
workflowRunId: 'workflowRuns.workflowRunId',
|
|
62
|
+
})),
|
|
63
|
+
(db, _types, ctx) => db.schema
|
|
64
64
|
.createTable('workflowStepHistory')
|
|
65
|
-
.addColumn('historyId',
|
|
66
|
-
.addColumn('workflowStepId',
|
|
67
|
-
.notNull()
|
|
68
|
-
.
|
|
69
|
-
.
|
|
70
|
-
.addColumn('status', 'text', (col) => col.notNull())
|
|
71
|
-
.addColumn('result', 'text')
|
|
72
|
-
.addColumn('error', 'text')
|
|
65
|
+
.addColumn('historyId', ctx.key, (col) => col.primaryKey())
|
|
66
|
+
.addColumn('workflowStepId', ctx.key, (col) => ctx.references(col.notNull(), 'workflowStep.workflowStepId'))
|
|
67
|
+
.addColumn('status', ctx.key, (col) => col.notNull())
|
|
68
|
+
.addColumn('result', ctx.text)
|
|
69
|
+
.addColumn('error', ctx.text)
|
|
73
70
|
.addColumn('attempt', 'integer')
|
|
74
71
|
.addColumn('createdAt', 'timestamp', (col) => col.defaultTo(sql `CURRENT_TIMESTAMP`).notNull())
|
|
75
72
|
.addColumn('runningAt', 'timestamp')
|
|
76
73
|
.addColumn('scheduledAt', 'timestamp')
|
|
77
74
|
.addColumn('succeededAt', 'timestamp')
|
|
78
|
-
.addColumn('failedAt', 'timestamp')
|
|
79
|
-
|
|
75
|
+
.addColumn('failedAt', 'timestamp')
|
|
76
|
+
.$call(ctx.foreignKeys('workflowStepHistory', {
|
|
77
|
+
workflowStepId: 'workflowStep.workflowStepId',
|
|
78
|
+
})),
|
|
79
|
+
(db, _types, ctx) => db.schema
|
|
80
80
|
.createTable('workflowVersions')
|
|
81
|
-
.addColumn('workflowName',
|
|
82
|
-
.addColumn('graphHash',
|
|
83
|
-
.addColumn('graph',
|
|
84
|
-
.addColumn('source',
|
|
85
|
-
.addColumn('status',
|
|
81
|
+
.addColumn('workflowName', ctx.key, (col) => col.notNull())
|
|
82
|
+
.addColumn('graphHash', ctx.key, (col) => col.notNull())
|
|
83
|
+
.addColumn('graph', ctx.text, (col) => col.notNull())
|
|
84
|
+
.addColumn('source', ctx.key, (col) => col.notNull())
|
|
85
|
+
.addColumn('status', ctx.key, (col) => col.notNull().defaultTo(ctx.defaultText('active')))
|
|
86
86
|
.addColumn('createdAt', 'timestamp', (col) => col.defaultTo(sql `CURRENT_TIMESTAMP`).notNull())
|
|
87
87
|
.addPrimaryKeyConstraint('workflow_versions_pk', [
|
|
88
88
|
'workflowName',
|
|
@@ -90,23 +90,23 @@ export const workflowSchema = {
|
|
|
90
90
|
]),
|
|
91
91
|
// The indexes trail the tables so that a table is never indexed before it
|
|
92
92
|
// exists, whatever order the declarations are read in.
|
|
93
|
-
(db) => db.schema
|
|
93
|
+
(db, _types, ctx) => db.schema
|
|
94
94
|
.createIndex('idx_workflow_runs_status_created')
|
|
95
95
|
.on('workflowRuns')
|
|
96
96
|
.columns(['status', 'createdAt']),
|
|
97
|
-
(db) => db.schema
|
|
97
|
+
(db, _types, ctx) => db.schema
|
|
98
98
|
.createIndex('idx_workflow_runs_workflow_created')
|
|
99
99
|
.on('workflowRuns')
|
|
100
100
|
.columns(['workflow', 'createdAt']),
|
|
101
|
-
(db) => db.schema
|
|
101
|
+
(db, _types, ctx) => db.schema
|
|
102
102
|
.createIndex('idx_workflow_step_run_status')
|
|
103
103
|
.on('workflowStep')
|
|
104
104
|
.columns(['workflowRunId', 'status']),
|
|
105
|
-
(db) => db.schema
|
|
105
|
+
(db, _types, ctx) => db.schema
|
|
106
106
|
.createIndex('idx_workflow_step_history_step')
|
|
107
107
|
.on('workflowStepHistory')
|
|
108
108
|
.columns(['workflowStepId', 'createdAt']),
|
|
109
|
-
(db) => db.schema
|
|
109
|
+
(db, _types, ctx) => db.schema
|
|
110
110
|
.createIndex('idx_workflow_versions_source_status')
|
|
111
111
|
.on('workflowVersions')
|
|
112
112
|
.columns(['source', 'status']),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/kysely",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.35",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/pikkujs/pikku.git",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"pikku-kysely-pure": "dist/bin/pikku-kysely-pure.js"
|
|
16
16
|
},
|
|
17
17
|
"type": "module",
|
|
18
|
+
"sideEffects": false,
|
|
18
19
|
"scripts": {
|
|
19
20
|
"tsc": "tsc",
|
|
20
21
|
"ncu": "npx npm-check-updates",
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
"prepublishOnly": "bun run build"
|
|
27
28
|
},
|
|
28
29
|
"peerDependencies": {
|
|
29
|
-
"@pikku/core": "^0.12.
|
|
30
|
+
"@pikku/core": "^0.12.138"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"kysely": "^0.29.5"
|