@empyria/restate 0.1.0 → 0.1.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.
- package/.oxlintrc.json +3 -0
- package/AGENTS.md +1 -1
- package/README.md +1 -1
- package/lib/Cron.js +1 -1
- package/package.json +11 -11
- package/test/Cron.test.js +3 -3
- package/test/Validation.test.js +3 -3
package/.oxlintrc.json
ADDED
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AGENTS.md
|
|
2
2
|
|
|
3
|
-
Restate.dev helpers for **
|
|
3
|
+
Restate.dev helpers for **Empyria**, a nanoservice framework built primarily on Bun:
|
|
4
4
|
an Admin API client, a dynamic-dispatch service, cron-driven workflow scheduling, and
|
|
5
5
|
schema validation for workflow handlers.
|
|
6
6
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @empyria/restate
|
|
2
2
|
|
|
3
|
-
[Restate.dev](https://restate.dev) helpers for **
|
|
3
|
+
[Restate.dev](https://restate.dev) helpers for **Empyria**, a nanoservice framework built
|
|
4
4
|
primarily on Bun: an Admin API client, a generic dynamic-dispatch service, cron-driven
|
|
5
5
|
workflow scheduling, and Restate-aware input/output schema validation.
|
|
6
6
|
|
package/lib/Cron.js
CHANGED
|
@@ -2,7 +2,7 @@ import * as restate from '@restatedev/restate-sdk'
|
|
|
2
2
|
import { TerminalError, serde } from '@restatedev/restate-sdk'
|
|
3
3
|
import { Cron } from 'croner'
|
|
4
4
|
|
|
5
|
-
let JOB_STATE_NAME = '
|
|
5
|
+
let JOB_STATE_NAME = 'empyria-job-state'
|
|
6
6
|
|
|
7
7
|
export const setJobStateName = (jobStateName) => {
|
|
8
8
|
JOB_STATE_NAME = jobStateName
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empyria/restate",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Restate.dev helpers for the
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Restate.dev helpers for the Empyria nanoservice framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Imre Fazekas <imre.fazekas@icloud.com>",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/
|
|
9
|
+
"url": "git+https://github.com/empyria-nano/guard-restate.git"
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
12
12
|
"main": "./index.js",
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
"test:watch": "bun test --watch"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@empyria/classification": "0.1.
|
|
28
|
-
"@empyria/common": "0.1.
|
|
29
|
-
"@restatedev/restate-sdk": "1.16.
|
|
30
|
-
"@restatedev/restate-sdk-clients": "1.16.
|
|
31
|
-
"@restatedev/restate-sdk-core": "1.16.
|
|
27
|
+
"@empyria/classification": "0.1.2",
|
|
28
|
+
"@empyria/common": "0.1.2",
|
|
29
|
+
"@restatedev/restate-sdk": "1.16.7",
|
|
30
|
+
"@restatedev/restate-sdk-clients": "1.16.7",
|
|
31
|
+
"@restatedev/restate-sdk-core": "1.16.7",
|
|
32
32
|
"croner": "10.0.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@restatedev/restate-server": "1.7.
|
|
36
|
-
"oxfmt": "0.
|
|
37
|
-
"oxlint": "1.
|
|
35
|
+
"@restatedev/restate-server": "1.7.4",
|
|
36
|
+
"oxfmt": "0.64.0",
|
|
37
|
+
"oxlint": "1.79.0"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|
|
40
40
|
"bun": ">=1.4.0",
|
package/test/Cron.test.js
CHANGED
|
@@ -4,11 +4,11 @@ import { TerminalError } from '@restatedev/restate-sdk'
|
|
|
4
4
|
|
|
5
5
|
describe('setJobStateName', () => {
|
|
6
6
|
test('returns the name it was given', () => {
|
|
7
|
-
expect(setJobStateName('
|
|
7
|
+
expect(setJobStateName('empyria-job-state')).toBe('empyria-job-state')
|
|
8
8
|
})
|
|
9
9
|
|
|
10
|
-
test('defaults to "
|
|
11
|
-
expect(JOB_STATE_NAME).toBe('
|
|
10
|
+
test('defaults to "empyria-job-state"', () => {
|
|
11
|
+
expect(JOB_STATE_NAME).toBe('empyria-job-state')
|
|
12
12
|
})
|
|
13
13
|
})
|
|
14
14
|
|
package/test/Validation.test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, test, expect } from 'bun:test'
|
|
2
2
|
import { withValidation } from '../lib/Validation.js'
|
|
3
|
-
import {
|
|
3
|
+
import { EmpyriaError } from '@empyria/common'
|
|
4
4
|
|
|
5
5
|
const inputSchema = {
|
|
6
6
|
type: 'object',
|
|
@@ -24,11 +24,11 @@ describe('withValidation', () => {
|
|
|
24
24
|
|
|
25
25
|
test('throws when the input does not match the schema', async () => {
|
|
26
26
|
const handler = withValidation(inputSchema, outputSchema, async () => ({ greeting: 'hi' }))
|
|
27
|
-
await expect(handler({}, {})).rejects.toThrow(
|
|
27
|
+
await expect(handler({}, {})).rejects.toThrow(EmpyriaError)
|
|
28
28
|
})
|
|
29
29
|
|
|
30
30
|
test('throws when the handler output does not match the schema', async () => {
|
|
31
31
|
const handler = withValidation(inputSchema, outputSchema, async () => ({ wrong: true }))
|
|
32
|
-
await expect(handler({}, { name: 'Bob' })).rejects.toThrow(
|
|
32
|
+
await expect(handler({}, { name: 'Bob' })).rejects.toThrow(EmpyriaError)
|
|
33
33
|
})
|
|
34
34
|
})
|