create-protobase 0.49.0 → 0.49.2

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.
@@ -1,4 +1,8 @@
1
- import { enqueueJob, type PipelineHook, type WriteEvent } from '@protobase/server'
1
+ import { enqueueJob, type EnqueueJob, type PipelineHook, type WriteEvent } from '@protobase/server'
2
+ import type config from '../protobase.config'
3
+
4
+ // Checks the job's name and arguments against the config's jobs at compile time.
5
+ const enqueue: EnqueueJob<typeof config> = enqueueJob
2
6
 
3
7
  const day = 86_400_000
4
8
 
@@ -12,5 +16,5 @@ export const overdueCheck = (event: WriteEvent) => {
12
16
  // In the write's own transaction: the invoice and the check of its payment commit together or not at all.
13
17
  export default (async (event, trx) => {
14
18
  const check = overdueCheck(event)
15
- if (check) await enqueueJob(trx, 'mark-invoice-overdue', { invoiceId: check.invoiceId }, { runAt: check.runAt, key: check.key, mode: 'replace' })
19
+ if (check) await enqueue(trx, 'mark-invoice-overdue', { invoiceId: check.invoiceId }, { runAt: check.runAt, key: check.key, mode: 'replace' })
16
20
  }) satisfies PipelineHook
@@ -1,7 +1,8 @@
1
1
  import { sql } from 'kysely'
2
- import type { JobRun } from '@protobase/server'
2
+ import type { JobPayload, JobRun } from '@protobase/server'
3
+ import type config from '../protobase.config'
3
4
 
4
5
  // Declared in protobase.config.ts: an invoice still sent and unpaid once its due date has passed becomes overdue.
5
6
  export default (async ({ invoiceId }, { db }) => {
6
7
  await sql`update sales.invoices set status = 'overdue' where id = ${invoiceId} and status = 'sent' and due_at < current_date`.execute(db)
7
- }) satisfies JobRun<{ invoiceId: string }>
8
+ }) satisfies JobRun<JobPayload<typeof config, 'mark-invoice-overdue'>>
@@ -16,12 +16,12 @@
16
16
  "dev": "protobase dev"
17
17
  },
18
18
  "dependencies": {
19
- "@protobase/cli": "^0.49.0",
20
- "@protobase/config": "^0.49.0",
21
- "@protobase/layout": "^0.49.0",
22
- "@protobase/schema": "^0.49.0",
23
- "@protobase/server": "^0.49.0",
24
- "@protobase/ui": "^0.49.0",
19
+ "@protobase/cli": "^0.49.2",
20
+ "@protobase/config": "^0.49.2",
21
+ "@protobase/layout": "^0.49.2",
22
+ "@protobase/schema": "^0.49.2",
23
+ "@protobase/server": "^0.49.2",
24
+ "@protobase/ui": "^0.49.2",
25
25
  "better-auth": "^1.7.12",
26
26
  "jose": "^6.2.12",
27
27
  "kysely": "^0.29.6",
@@ -16,12 +16,12 @@
16
16
  "dev": "protobase dev"
17
17
  },
18
18
  "dependencies": {
19
- "@protobase/cli": "^0.49.0",
20
- "@protobase/config": "^0.49.0",
21
- "@protobase/layout": "^0.49.0",
22
- "@protobase/schema": "^0.49.0",
23
- "@protobase/server": "^0.49.0",
24
- "@protobase/ui": "^0.49.0",
19
+ "@protobase/cli": "^0.49.2",
20
+ "@protobase/config": "^0.49.2",
21
+ "@protobase/layout": "^0.49.2",
22
+ "@protobase/schema": "^0.49.2",
23
+ "@protobase/server": "^0.49.2",
24
+ "@protobase/ui": "^0.49.2",
25
25
  "better-auth": "^1.7.12",
26
26
  "jose": "^6.2.12",
27
27
  "kysely": "^0.29.6",
@@ -13,12 +13,12 @@
13
13
  "dev": "protobase dev"
14
14
  },
15
15
  "dependencies": {
16
- "@protobase/cli": "^0.49.0",
17
- "@protobase/config": "^0.49.0",
18
- "@protobase/layout": "^0.49.0",
19
- "@protobase/schema": "^0.49.0",
20
- "@protobase/server": "^0.49.0",
21
- "@protobase/ui": "^0.49.0",
16
+ "@protobase/cli": "^0.49.2",
17
+ "@protobase/config": "^0.49.2",
18
+ "@protobase/layout": "^0.49.2",
19
+ "@protobase/schema": "^0.49.2",
20
+ "@protobase/server": "^0.49.2",
21
+ "@protobase/ui": "^0.49.2",
22
22
  "better-auth": "^1.7.12",
23
23
  "jose": "^6.2.12",
24
24
  "kysely": "^0.29.6",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-protobase",
3
- "version": "0.49.0",
3
+ "version": "0.49.2",
4
4
  "description": "npm create protobase: starts a new Protobase project from one of its presets.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {