@dxos/functions 0.8.4-main.937b3ca → 0.8.4-main.9735255
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/dist/lib/browser/index.mjs +17 -17
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +17 -17
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/services/event-logger.d.ts +2 -2
- package/dist/types/src/types/Trigger.d.ts +34 -34
- package/dist/types/src/types/Trigger.d.ts.map +1 -1
- package/dist/types/src/types/TriggerEvent.d.ts +16 -16
- package/dist/types/src/types/TriggerEvent.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -15
- package/src/types/Trigger.ts +7 -7
- package/src/types/TriggerEvent.ts +20 -26
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/functions",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.9735255",
|
|
4
4
|
"description": "Functions API.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -30,20 +30,20 @@
|
|
|
30
30
|
"@effect/ai-anthropic": "0.22.0",
|
|
31
31
|
"@effect/platform": "0.93.6",
|
|
32
32
|
"effect": "3.19.11",
|
|
33
|
-
"@dxos/ai": "0.8.4-main.
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/echo": "0.8.4-main.
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/invariant": "0.8.4-main.
|
|
40
|
-
"@dxos/keys": "0.8.4-main.
|
|
41
|
-
"@dxos/log": "0.8.4-main.
|
|
42
|
-
"@dxos/node-std": "0.8.4-main.
|
|
43
|
-
"@dxos/protocols": "0.8.4-main.
|
|
44
|
-
"@dxos/schema": "0.8.4-main.
|
|
45
|
-
"@dxos/operation": "0.8.4-main.
|
|
46
|
-
"@dxos/types": "0.8.4-main.
|
|
33
|
+
"@dxos/ai": "0.8.4-main.9735255",
|
|
34
|
+
"@dxos/context": "0.8.4-main.9735255",
|
|
35
|
+
"@dxos/effect": "0.8.4-main.9735255",
|
|
36
|
+
"@dxos/echo-db": "0.8.4-main.9735255",
|
|
37
|
+
"@dxos/errors": "0.8.4-main.9735255",
|
|
38
|
+
"@dxos/echo": "0.8.4-main.9735255",
|
|
39
|
+
"@dxos/invariant": "0.8.4-main.9735255",
|
|
40
|
+
"@dxos/keys": "0.8.4-main.9735255",
|
|
41
|
+
"@dxos/log": "0.8.4-main.9735255",
|
|
42
|
+
"@dxos/node-std": "0.8.4-main.9735255",
|
|
43
|
+
"@dxos/protocols": "0.8.4-main.9735255",
|
|
44
|
+
"@dxos/schema": "0.8.4-main.9735255",
|
|
45
|
+
"@dxos/operation": "0.8.4-main.9735255",
|
|
46
|
+
"@dxos/types": "0.8.4-main.9735255"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
package/src/types/Trigger.ts
CHANGED
|
@@ -22,7 +22,7 @@ const kindLiteralAnnotations = { title: 'Kind' };
|
|
|
22
22
|
|
|
23
23
|
export const EmailSpec = Schema.Struct({
|
|
24
24
|
kind: Schema.Literal('email').annotations(kindLiteralAnnotations),
|
|
25
|
-
})
|
|
25
|
+
});
|
|
26
26
|
export type EmailSpec = Schema.Schema.Type<typeof EmailSpec>;
|
|
27
27
|
|
|
28
28
|
export const QueueSpec = Schema.Struct({
|
|
@@ -30,7 +30,7 @@ export const QueueSpec = Schema.Struct({
|
|
|
30
30
|
|
|
31
31
|
// TODO(dmaretskyi): Change to a reference.
|
|
32
32
|
queue: DXN.Schema,
|
|
33
|
-
})
|
|
33
|
+
});
|
|
34
34
|
export type QueueSpec = Schema.Schema.Type<typeof QueueSpec>;
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -41,7 +41,7 @@ export const SubscriptionSpec = Schema.Struct({
|
|
|
41
41
|
query: Schema.Struct({
|
|
42
42
|
raw: Schema.optional(Schema.String.annotations({ title: 'Query' })),
|
|
43
43
|
ast: QueryAST.Query,
|
|
44
|
-
})
|
|
44
|
+
}),
|
|
45
45
|
options: Schema.optional(
|
|
46
46
|
Schema.Struct({
|
|
47
47
|
// Watch changes to object (not just creation).
|
|
@@ -50,7 +50,7 @@ export const SubscriptionSpec = Schema.Struct({
|
|
|
50
50
|
delay: Schema.optional(Schema.Number.annotations({ title: 'Delay' })),
|
|
51
51
|
}).annotations({ title: 'Options' }),
|
|
52
52
|
),
|
|
53
|
-
})
|
|
53
|
+
});
|
|
54
54
|
export type SubscriptionSpec = Schema.Schema.Type<typeof SubscriptionSpec>;
|
|
55
55
|
|
|
56
56
|
/**
|
|
@@ -62,7 +62,7 @@ export const TimerSpec = Schema.Struct({
|
|
|
62
62
|
title: 'Cron',
|
|
63
63
|
[SchemaAST.ExamplesAnnotationId]: ['0 0 * * *'],
|
|
64
64
|
}),
|
|
65
|
-
})
|
|
65
|
+
});
|
|
66
66
|
export type TimerSpec = Schema.Schema.Type<typeof TimerSpec>;
|
|
67
67
|
|
|
68
68
|
/**
|
|
@@ -81,7 +81,7 @@ export const WebhookSpec = Schema.Struct({
|
|
|
81
81
|
title: 'Port',
|
|
82
82
|
}),
|
|
83
83
|
),
|
|
84
|
-
})
|
|
84
|
+
});
|
|
85
85
|
export type WebhookSpec = Schema.Schema.Type<typeof WebhookSpec>;
|
|
86
86
|
|
|
87
87
|
/**
|
|
@@ -128,7 +128,7 @@ const TriggerSchema = Schema.Struct({
|
|
|
128
128
|
* mailbox: { '/': 'dxn:echo:AAA:ZZZ' }
|
|
129
129
|
* }
|
|
130
130
|
*/
|
|
131
|
-
input: Schema.optional(Schema.
|
|
131
|
+
input: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
|
|
132
132
|
}).pipe(
|
|
133
133
|
Type.object({
|
|
134
134
|
typename: 'dxos.org/type/Trigger',
|
|
@@ -12,24 +12,20 @@ import { DXN, Type } from '@dxos/echo';
|
|
|
12
12
|
// - Should re-use schemas if possible.
|
|
13
13
|
|
|
14
14
|
// TODO(burdon): Reuse trigger schema from @dxos/functions (TriggerType).
|
|
15
|
-
export const EmailEvent = Schema.
|
|
16
|
-
Schema.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}),
|
|
23
|
-
);
|
|
15
|
+
export const EmailEvent = Schema.Struct({
|
|
16
|
+
from: Schema.String,
|
|
17
|
+
to: Schema.String,
|
|
18
|
+
subject: Schema.String,
|
|
19
|
+
created: Schema.String,
|
|
20
|
+
body: Schema.String,
|
|
21
|
+
});
|
|
24
22
|
export type EmailEvent = Schema.Schema.Type<typeof EmailEvent>;
|
|
25
23
|
|
|
26
|
-
export const QueueEvent = Schema.
|
|
27
|
-
Schema
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}),
|
|
32
|
-
);
|
|
24
|
+
export const QueueEvent = Schema.Struct({
|
|
25
|
+
queue: DXN.Schema,
|
|
26
|
+
item: Schema.Any,
|
|
27
|
+
cursor: Schema.String,
|
|
28
|
+
});
|
|
33
29
|
export type QueueEvent = Schema.Schema.Type<typeof QueueEvent>;
|
|
34
30
|
|
|
35
31
|
export const SubscriptionEvent = Schema.Struct({
|
|
@@ -48,20 +44,18 @@ export const SubscriptionEvent = Schema.Struct({
|
|
|
48
44
|
* @deprecated
|
|
49
45
|
*/
|
|
50
46
|
changedObjectId: Schema.optional(Schema.String),
|
|
51
|
-
})
|
|
47
|
+
});
|
|
52
48
|
export type SubscriptionEvent = Schema.Schema.Type<typeof SubscriptionEvent>;
|
|
53
49
|
|
|
54
|
-
export const TimerEvent = Schema.
|
|
50
|
+
export const TimerEvent = Schema.Struct({ tick: Schema.Number });
|
|
55
51
|
export type TimerEvent = Schema.Schema.Type<typeof TimerEvent>;
|
|
56
52
|
|
|
57
|
-
export const WebhookEvent = Schema.
|
|
58
|
-
Schema.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}),
|
|
64
|
-
);
|
|
53
|
+
export const WebhookEvent = Schema.Struct({
|
|
54
|
+
url: Schema.String,
|
|
55
|
+
method: Schema.Literal('GET', 'POST'),
|
|
56
|
+
headers: Schema.Record({ key: Schema.String, value: Schema.String }),
|
|
57
|
+
bodyText: Schema.String,
|
|
58
|
+
});
|
|
65
59
|
export type WebhookEvent = Schema.Schema.Type<typeof WebhookEvent>;
|
|
66
60
|
|
|
67
61
|
export const TriggerEvent = Schema.Union(EmailEvent, QueueEvent, SubscriptionEvent, TimerEvent, WebhookEvent);
|