@pikku/kysely 0.12.3 → 0.12.5

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 CHANGED
@@ -1,5 +1,40 @@
1
1
  ## 0.12.0
2
2
 
3
+ ## 0.12.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 87433f0: Remove secret key names from error messages to prevent information disclosure.
8
+ - Updated dependencies [e412b4d]
9
+ - Updated dependencies [53dc8c8]
10
+ - Updated dependencies [0a1cc51]
11
+ - Updated dependencies [0a1cc51]
12
+ - Updated dependencies [0a1cc51]
13
+ - Updated dependencies [0a1cc51]
14
+ - Updated dependencies [0a1cc51]
15
+ - Updated dependencies [0a1cc51]
16
+ - Updated dependencies [0a1cc51]
17
+ - Updated dependencies [0a1cc51]
18
+ - Updated dependencies [0a1cc51]
19
+ - Updated dependencies [8b9b2e9]
20
+ - Updated dependencies [8b9b2e9]
21
+ - Updated dependencies [b973d44]
22
+ - Updated dependencies [8b9b2e9]
23
+ - Updated dependencies [8b9b2e9]
24
+ - @pikku/core@0.12.9
25
+
26
+ ## 0.12.4
27
+
28
+ ### Patch Changes
29
+
30
+ - 3e79248: Add setStepChildRunId to workflow service implementations and auto-bootstrap in pikku all
31
+ - Updated dependencies [bb27710]
32
+ - Updated dependencies [a31bc63]
33
+ - Updated dependencies [3e79248]
34
+ - Updated dependencies [b0a81cc]
35
+ - Updated dependencies [6413df7]
36
+ - @pikku/core@0.12.6
37
+
3
38
  ## 0.12.3
4
39
 
5
40
  ### Patch Changes
File without changes
@@ -70,7 +70,7 @@ export class KyselySecretService {
70
70
  .where('key', '=', key)
71
71
  .executeTakeFirst();
72
72
  if (!row)
73
- throw new Error(`Secret not found: ${key}`);
73
+ throw new Error('Requested secret not found');
74
74
  const kek = this.getKEK(row.key_version);
75
75
  const result = await envelopeDecrypt(kek, row.ciphertext, row.wrapped_dek);
76
76
  await this.logAudit(key, 'read');
@@ -35,6 +35,7 @@ export interface WorkflowStepTable {
35
35
  status: Generated<StepStatus>;
36
36
  result: string | null;
37
37
  error: string | null;
38
+ child_run_id: string | null;
38
39
  branch_taken: string | null;
39
40
  retries: number | null;
40
41
  retry_delay: string | null;
@@ -67,6 +67,7 @@ export class KyselyWorkflowRunService {
67
67
  's.status',
68
68
  's.result',
69
69
  's.error',
70
+ 's.child_run_id',
70
71
  's.retries',
71
72
  's.retry_delay',
72
73
  's.created_at',
@@ -88,6 +89,7 @@ export class KyselyWorkflowRunService {
88
89
  status: row.status,
89
90
  result: parseJson(row.result),
90
91
  error: parseJson(row.error),
92
+ childRunId: row.child_run_id ?? undefined,
91
93
  attemptCount: Number(row.attempt_count || 1),
92
94
  retries: row.retries != null ? Number(row.retries) : undefined,
93
95
  retryDelay: row.retry_delay ?? undefined,
@@ -23,6 +23,7 @@ export declare class KyselyWorkflowService extends PikkuWorkflowService {
23
23
  setStepScheduled(stepId: string): Promise<void>;
24
24
  private insertHistoryRecord;
25
25
  private getTimestampFieldForStatus;
26
+ setStepChildRunId(stepId: string, childRunId: string): Promise<void>;
26
27
  setStepResult(stepId: string, result: any): Promise<void>;
27
28
  setStepError(stepId: string, error: Error): Promise<void>;
28
29
  createRetryAttempt(stepId: string, status: 'pending' | 'running'): Promise<StepState>;
@@ -49,6 +49,7 @@ export class KyselyWorkflowService extends PikkuWorkflowService {
49
49
  .addColumn('status', 'text', (col) => col.notNull().defaultTo('pending'))
50
50
  .addColumn('result', 'text')
51
51
  .addColumn('error', 'text')
52
+ .addColumn('child_run_id', 'text')
52
53
  .addColumn('branch_taken', 'text')
53
54
  .addColumn('retries', 'integer')
54
55
  .addColumn('retry_delay', 'text')
@@ -256,6 +257,16 @@ export class KyselyWorkflowService extends PikkuWorkflowService {
256
257
  return 'created_at';
257
258
  }
258
259
  }
260
+ async setStepChildRunId(stepId, childRunId) {
261
+ await this.db
262
+ .updateTable('workflow_step')
263
+ .set({
264
+ child_run_id: childRunId,
265
+ updated_at: new Date(),
266
+ })
267
+ .where('workflow_step_id', '=', stepId)
268
+ .execute();
269
+ }
259
270
  async setStepResult(stepId, result) {
260
271
  const resultJson = JSON.stringify(result);
261
272
  await this.db
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/kysely",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "author": "yasser.fadl@gmail.com",
5
5
  "license": "MIT",
6
6
  "module": "dist/src/index.js",
@@ -16,18 +16,18 @@
16
16
  "test": "bash run-tests.sh",
17
17
  "test:watch": "bash run-tests.sh --watch",
18
18
  "test:coverage": "bash run-tests.sh --coverage",
19
- "release": "npm run build && npm test"
19
+ "release": "npm run build && npm test",
20
+ "prepublishOnly": "yarn build"
20
21
  },
21
22
  "peerDependencies": {
22
- "@pikku/core": "^0.12.3"
23
+ "@pikku/core": "^0.12.9"
23
24
  },
24
25
  "dependencies": {
25
- "kysely": "^0.28.11"
26
+ "kysely": "^0.28.12"
26
27
  },
27
28
  "devDependencies": {
28
29
  "@types/better-sqlite3": "^7.6.13",
29
30
  "better-sqlite3": "^12.6.2",
30
- "kysely": "^0.28.11",
31
31
  "kysely-codegen": "^0.20.0",
32
32
  "kysely-plugin-serialize": "^0.8.2",
33
33
  "kysely-postgres-js": "^3.0.0",
@@ -100,7 +100,7 @@ export class KyselySecretService implements SecretService {
100
100
  .where('key', '=', key)
101
101
  .executeTakeFirst()
102
102
 
103
- if (!row) throw new Error(`Secret not found: ${key}`)
103
+ if (!row) throw new Error('Requested secret not found')
104
104
 
105
105
  const kek = this.getKEK(row.key_version)
106
106
  const result = await envelopeDecrypt<string>(
@@ -43,6 +43,7 @@ export interface WorkflowStepTable {
43
43
  status: Generated<StepStatus>
44
44
  result: string | null
45
45
  error: string | null
46
+ child_run_id: string | null
46
47
  branch_taken: string | null
47
48
  retries: number | null
48
49
  retry_delay: string | null
@@ -90,6 +90,7 @@ export class KyselyWorkflowRunService implements WorkflowRunService {
90
90
  's.status',
91
91
  's.result',
92
92
  's.error',
93
+ 's.child_run_id',
93
94
  's.retries',
94
95
  's.retry_delay',
95
96
  's.created_at',
@@ -118,6 +119,7 @@ export class KyselyWorkflowRunService implements WorkflowRunService {
118
119
  status: row.status as StepState['status'],
119
120
  result: parseJson(row.result),
120
121
  error: parseJson(row.error),
122
+ childRunId: row.child_run_id ?? undefined,
121
123
  attemptCount: Number(row.attempt_count || 1),
122
124
  retries: row.retries != null ? Number(row.retries) : undefined,
123
125
  retryDelay: row.retry_delay ?? undefined,
@@ -72,6 +72,7 @@ export class KyselyWorkflowService extends PikkuWorkflowService {
72
72
  .addColumn('status', 'text', (col) => col.notNull().defaultTo('pending'))
73
73
  .addColumn('result', 'text')
74
74
  .addColumn('error', 'text')
75
+ .addColumn('child_run_id', 'text')
75
76
  .addColumn('branch_taken', 'text')
76
77
  .addColumn('retries', 'integer')
77
78
  .addColumn('retry_delay', 'text')
@@ -347,6 +348,17 @@ export class KyselyWorkflowService extends PikkuWorkflowService {
347
348
  }
348
349
  }
349
350
 
351
+ async setStepChildRunId(stepId: string, childRunId: string): Promise<void> {
352
+ await this.db
353
+ .updateTable('workflow_step')
354
+ .set({
355
+ child_run_id: childRunId,
356
+ updated_at: new Date(),
357
+ })
358
+ .where('workflow_step_id', '=', stepId)
359
+ .execute()
360
+ }
361
+
350
362
  async setStepResult(stepId: string, result: any): Promise<void> {
351
363
  const resultJson = JSON.stringify(result)
352
364