@notionhq/workers 0.1.0 → 0.3.0
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/ajv-formats.d.js +0 -0
- package/dist/capabilities/ai_connector.d.ts +97 -0
- package/dist/capabilities/ai_connector.d.ts.map +1 -0
- package/dist/capabilities/ai_connector.js +54 -0
- package/dist/capabilities/ai_connector.test.d.ts +2 -0
- package/dist/capabilities/ai_connector.test.d.ts.map +1 -0
- package/dist/capabilities/automation.d.ts.map +1 -1
- package/dist/capabilities/automation.js +10 -10
- package/dist/capabilities/output.d.ts +5 -0
- package/dist/capabilities/output.d.ts.map +1 -0
- package/dist/capabilities/output.js +10 -0
- package/dist/capabilities/stateful-capability.d.ts +30 -0
- package/dist/capabilities/stateful-capability.d.ts.map +1 -0
- package/dist/capabilities/stateful-capability.js +50 -0
- package/dist/capabilities/stateful-capability.test.d.ts +2 -0
- package/dist/capabilities/stateful-capability.test.d.ts.map +1 -0
- package/dist/capabilities/sync.d.ts +77 -30
- package/dist/capabilities/sync.d.ts.map +1 -1
- package/dist/capabilities/sync.js +26 -64
- package/dist/capabilities/tool.d.ts.map +1 -1
- package/dist/capabilities/tool.js +7 -14
- package/dist/capabilities/webhook.d.ts +101 -0
- package/dist/capabilities/webhook.d.ts.map +1 -0
- package/dist/capabilities/webhook.js +47 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/pacer.d.ts +24 -0
- package/dist/pacer.d.ts.map +1 -0
- package/dist/pacer.js +14 -0
- package/dist/pacer.test.d.ts +2 -0
- package/dist/pacer.test.d.ts.map +1 -0
- package/dist/pacer_internal.d.ts +13 -0
- package/dist/pacer_internal.d.ts.map +1 -0
- package/dist/pacer_internal.js +49 -0
- package/dist/schema.d.ts +28 -18
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +2 -2
- package/dist/types.d.ts +5 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/worker.d.ts +222 -7
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +184 -8
- package/dist/worker.test.d.ts +2 -0
- package/dist/worker.test.d.ts.map +1 -0
- package/package.json +7 -2
- package/src/ajv-formats.d.ts +7 -0
- package/src/capabilities/ai_connector.test.ts +341 -0
- package/src/capabilities/ai_connector.ts +194 -0
- package/src/capabilities/automation.test.ts +2 -2
- package/src/capabilities/automation.ts +10 -6
- package/src/capabilities/output.ts +8 -0
- package/src/capabilities/stateful-capability.test.ts +25 -0
- package/src/capabilities/stateful-capability.ts +87 -0
- package/src/capabilities/sync.test.ts +178 -35
- package/src/capabilities/sync.ts +63 -100
- package/src/capabilities/tool.test.ts +47 -3
- package/src/capabilities/tool.ts +7 -6
- package/src/capabilities/webhook.ts +148 -0
- package/src/index.ts +31 -0
- package/src/pacer.test.ts +110 -0
- package/src/pacer.ts +25 -0
- package/src/pacer_internal.ts +94 -0
- package/src/schema.ts +29 -19
- package/src/types.ts +4 -2
- package/src/worker.test.ts +167 -0
- package/src/worker.ts +335 -10
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Ajv } from "ajv";
|
|
2
|
+
import addFormats from "ajv-formats";
|
|
2
3
|
import { getSchema } from "../schema-builder.js";
|
|
3
4
|
import { createCapabilityContext } from "./context.js";
|
|
5
|
+
import { writeOutput } from "./output.js";
|
|
4
6
|
function validateRequiredProperties(schema, path = "") {
|
|
5
7
|
if ("type" in schema && schema.type === "object" && "properties" in schema) {
|
|
6
8
|
const propKeys = Object.keys(schema.properties).sort();
|
|
@@ -88,6 +90,7 @@ function createToolCapability(key, config) {
|
|
|
88
90
|
validateRequiredProperties(outputSchema);
|
|
89
91
|
}
|
|
90
92
|
const ajv = new Ajv();
|
|
93
|
+
addFormats(ajv);
|
|
91
94
|
const validateInput = ajv.compile(inputSchema);
|
|
92
95
|
const validateOutput = outputSchema ? ajv.compile(outputSchema) : null;
|
|
93
96
|
async function handler(input, options) {
|
|
@@ -107,9 +110,7 @@ function createToolCapability(key, config) {
|
|
|
107
110
|
_tag: "error",
|
|
108
111
|
error: { name: error.name, message: error.message, trace: error.stack }
|
|
109
112
|
};
|
|
110
|
-
|
|
111
|
-
<output>${JSON.stringify(result)}</output>
|
|
112
|
-
`);
|
|
113
|
+
writeOutput(result);
|
|
113
114
|
return result;
|
|
114
115
|
}
|
|
115
116
|
try {
|
|
@@ -130,19 +131,13 @@ function createToolCapability(key, config) {
|
|
|
130
131
|
trace: error.stack
|
|
131
132
|
}
|
|
132
133
|
};
|
|
133
|
-
|
|
134
|
-
<output>${JSON.stringify(result2)}</output>
|
|
135
|
-
`);
|
|
134
|
+
writeOutput(result2);
|
|
136
135
|
return result2;
|
|
137
136
|
}
|
|
138
137
|
if (options?.concreteOutput) {
|
|
139
138
|
return result;
|
|
140
139
|
}
|
|
141
|
-
|
|
142
|
-
`
|
|
143
|
-
<output>${JSON.stringify({ _tag: "success", value: result })}</output>
|
|
144
|
-
`
|
|
145
|
-
);
|
|
140
|
+
writeOutput({ _tag: "success", value: result });
|
|
146
141
|
return {
|
|
147
142
|
_tag: "success",
|
|
148
143
|
value: result
|
|
@@ -158,9 +153,7 @@ function createToolCapability(key, config) {
|
|
|
158
153
|
_tag: "error",
|
|
159
154
|
error: { name: error.name, message: error.message, trace: error.stack }
|
|
160
155
|
};
|
|
161
|
-
|
|
162
|
-
<output>${JSON.stringify(result)}</output>
|
|
163
|
-
`);
|
|
156
|
+
writeOutput(result);
|
|
164
157
|
return result;
|
|
165
158
|
}
|
|
166
159
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { ExecutionError } from "../error.js";
|
|
2
|
+
import type { HandlerOptions } from "../types.js";
|
|
3
|
+
import type { CapabilityContext } from "./context.js";
|
|
4
|
+
/**
|
|
5
|
+
* A single incoming webhook request.
|
|
6
|
+
*/
|
|
7
|
+
export interface WebhookEvent {
|
|
8
|
+
/**
|
|
9
|
+
* Unique ID for this webhook delivery, stable across retries.
|
|
10
|
+
* Best-effort idempotency key — prefer using the webhook provider's
|
|
11
|
+
* own delivery/event ID when available, since providers may redeliver
|
|
12
|
+
* the same event with a new deliveryId.
|
|
13
|
+
*/
|
|
14
|
+
deliveryId: string;
|
|
15
|
+
/**
|
|
16
|
+
* The parsed JSON body of the incoming request, or an empty object if
|
|
17
|
+
* the body is not valid JSON.
|
|
18
|
+
*/
|
|
19
|
+
body: Record<string, unknown>;
|
|
20
|
+
/**
|
|
21
|
+
* The raw request body as a string, useful for signature verification.
|
|
22
|
+
*/
|
|
23
|
+
rawBody: string;
|
|
24
|
+
/**
|
|
25
|
+
* The HTTP headers from the incoming request
|
|
26
|
+
*/
|
|
27
|
+
headers: Record<string, string>;
|
|
28
|
+
/**
|
|
29
|
+
* The HTTP method of the incoming request (e.g. "POST")
|
|
30
|
+
*/
|
|
31
|
+
method: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Throw this error from your webhook execute handler to signal that
|
|
35
|
+
* signature verification failed. After 5 consecutive verification
|
|
36
|
+
* failures, the platform will short-circuit and reject all incoming
|
|
37
|
+
* requests for this webhook without executing the handler.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* worker.webhook("onGithubPush", {
|
|
42
|
+
* title: "GitHub Push",
|
|
43
|
+
* description: "Handles GitHub push events",
|
|
44
|
+
* execute: async (events) => {
|
|
45
|
+
* const secret = process.env.GITHUB_WEBHOOK_SECRET;
|
|
46
|
+
* if (!secret) {
|
|
47
|
+
* throw new WebhookVerificationError("GITHUB_WEBHOOK_SECRET not set");
|
|
48
|
+
* }
|
|
49
|
+
* for (const event of events) {
|
|
50
|
+
* if (!verifyGitHubSignature(event.rawBody, event.headers, secret)) {
|
|
51
|
+
* throw new WebhookVerificationError("Invalid GitHub signature");
|
|
52
|
+
* }
|
|
53
|
+
* // ... handle verified event
|
|
54
|
+
* }
|
|
55
|
+
* },
|
|
56
|
+
* });
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare class WebhookVerificationError extends ExecutionError {
|
|
60
|
+
constructor(cause?: unknown);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Configuration for a webhook capability
|
|
64
|
+
*/
|
|
65
|
+
export interface WebhookConfiguration {
|
|
66
|
+
/**
|
|
67
|
+
* Title of the webhook - shown in the UI when viewing webhooks
|
|
68
|
+
*/
|
|
69
|
+
title: string;
|
|
70
|
+
/**
|
|
71
|
+
* Description of what this webhook does - shown in the UI
|
|
72
|
+
*/
|
|
73
|
+
description: string;
|
|
74
|
+
/**
|
|
75
|
+
* The function that executes when the webhook is triggered.
|
|
76
|
+
* Receives an array of events (currently always a single event,
|
|
77
|
+
* but may be batched in the future).
|
|
78
|
+
*
|
|
79
|
+
* To signal a verification failure, throw a `WebhookVerificationError`.
|
|
80
|
+
* After 5 consecutive verification failures, the platform will
|
|
81
|
+
* short-circuit and stop executing the handler.
|
|
82
|
+
*
|
|
83
|
+
* @param events - The incoming webhook events
|
|
84
|
+
* @param context - The capability execution context (Notion client, etc.)
|
|
85
|
+
* @returns A promise that resolves when the webhook processing completes
|
|
86
|
+
*/
|
|
87
|
+
execute: (events: WebhookEvent[], context: CapabilityContext) => Promise<void> | void;
|
|
88
|
+
}
|
|
89
|
+
export type WebhookCapability = ReturnType<typeof createWebhookCapability>;
|
|
90
|
+
export declare function createWebhookCapability(key: string, config: WebhookConfiguration): {
|
|
91
|
+
_tag: "webhook";
|
|
92
|
+
key: string;
|
|
93
|
+
config: {
|
|
94
|
+
title: string;
|
|
95
|
+
description: string;
|
|
96
|
+
};
|
|
97
|
+
handler(events: WebhookEvent[], options?: HandlerOptions): Promise<{
|
|
98
|
+
status: "success";
|
|
99
|
+
} | undefined>;
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=webhook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/capabilities/webhook.ts"],"names":[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.js";
|
|
3
|
+
import { writeOutput } from "./output.js";
|
|
4
|
+
class WebhookVerificationError extends ExecutionError {
|
|
5
|
+
constructor(cause) {
|
|
6
|
+
super(cause ?? "Webhook signature verification failed");
|
|
7
|
+
this.name = "WebhookVerificationError";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function createWebhookCapability(key, config) {
|
|
11
|
+
return {
|
|
12
|
+
_tag: "webhook",
|
|
13
|
+
key,
|
|
14
|
+
config: {
|
|
15
|
+
title: config.title,
|
|
16
|
+
description: config.description
|
|
17
|
+
},
|
|
18
|
+
async handler(events, options) {
|
|
19
|
+
try {
|
|
20
|
+
const capabilityContext = createCapabilityContext();
|
|
21
|
+
await config.execute(events, capabilityContext);
|
|
22
|
+
if (options?.concreteOutput) {
|
|
23
|
+
return { status: "success" };
|
|
24
|
+
} else {
|
|
25
|
+
writeOutput({ _tag: "success", value: { status: "success" } });
|
|
26
|
+
}
|
|
27
|
+
} catch (err) {
|
|
28
|
+
const error = err instanceof ExecutionError ? err : new ExecutionError(err);
|
|
29
|
+
if (!options?.concreteOutput) {
|
|
30
|
+
writeOutput({
|
|
31
|
+
_tag: "error",
|
|
32
|
+
error: {
|
|
33
|
+
name: error.name,
|
|
34
|
+
message: error.message,
|
|
35
|
+
trace: error.stack
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
throw error;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
WebhookVerificationError,
|
|
46
|
+
createWebhookCapability
|
|
47
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
export { emojiIcon, imageIcon, notionIcon, place } from "./builder.js";
|
|
2
|
+
export type { AiConnectorArchetype, AiConnectorCapability, AiConnectorChange, AiConnectorChangeUpsert, AiConnectorChatAuthor, AiConnectorChatChannel, AiConnectorChatMessage, AiConnectorChatRecord, AiConnectorConfiguration, AiConnectorExecutionResult, AiConnectorMode, AiConnectorProjectBlock, AiConnectorProjectRecord, AiConnectorRecordByArchetype, } from "./capabilities/ai_connector.js";
|
|
2
3
|
export type { AutomationCapability, AutomationConfiguration, AutomationEvent, PageObjectResponse, } from "./capabilities/automation.js";
|
|
3
4
|
export type { CapabilityContext } from "./capabilities/context.js";
|
|
4
5
|
export type { NotionManagedOAuthConfiguration, OAuthCapability, OAuthConfiguration, UserManagedOAuthConfiguration, } from "./capabilities/oauth.js";
|
|
5
6
|
export type { SyncCapability, SyncChange, SyncChangeDelete, SyncChangeUpsert, SyncConfiguration, SyncExecutionResult, SyncMode, } from "./capabilities/sync.js";
|
|
6
7
|
export type { ToolCapability, ToolConfiguration } from "./capabilities/tool.js";
|
|
8
|
+
export type { WebhookCapability, WebhookConfiguration, WebhookEvent, } from "./capabilities/webhook.js";
|
|
9
|
+
export { WebhookVerificationError } from "./capabilities/webhook.js";
|
|
7
10
|
export type { AnyJSONSchema, JSONSchema } from "./json-schema.js";
|
|
8
11
|
export type { Infer, SchemaBuilder } from "./schema-builder.js";
|
|
9
12
|
export { getSchema, j } from "./schema-builder.js";
|
|
10
13
|
export type { Icon, ImageIcon, NoticonColor, NoticonName, PlaceValue, Schedule, } from "./types.js";
|
|
14
|
+
export type { DatabaseConfig, DatabaseHandle, ManagedDatabaseConfig, PacerConfig, PacerDeclaration, PacerHandle, WorkerManifest, } from "./worker.js";
|
|
11
15
|
export { Worker } from "./worker.js";
|
|
12
16
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACvE,YAAY,EACX,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,kBAAkB,GAClB,MAAM,8B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;AACnE,YAAY,EACX,+BAA+B,EAC/B,eAAe,EACf,kBAAkB,EAClB,6BAA6B,GAC7B,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACX,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,QAAQ,GACR,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChF,YAAY,EACX,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,GACZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAClE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAC;AACnD,YAAY,EACX,IAAI,EACJ,SAAS,EACT,YAAY,EACZ,WAAW,EACX,UAAU,EACV,QAAQ,GACR,MAAM,YAAY,CAAC;AACpB,YAAY,EACX,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,cAAc,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { emojiIcon, imageIcon, notionIcon, place } from "./builder.js";
|
|
2
|
+
import { WebhookVerificationError } from "./capabilities/webhook.js";
|
|
2
3
|
import { getSchema, j } from "./schema-builder.js";
|
|
3
4
|
import { Worker } from "./worker.js";
|
|
4
5
|
export {
|
|
6
|
+
WebhookVerificationError,
|
|
5
7
|
Worker,
|
|
6
8
|
emojiIcon,
|
|
7
9
|
getSchema,
|
package/dist/pacer.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pacer module for rate limiting API requests.
|
|
3
|
+
*
|
|
4
|
+
* The preferred API is the handle returned by `worker.pacer()`:
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* const apiPacer = worker.pacer("myApi", { allowedRequests: 10, intervalMs: 1000 });
|
|
8
|
+
* await apiPacer.wait();
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
import { pacerWait } from "./pacer_internal.js";
|
|
14
|
+
export declare const Pacer: {
|
|
15
|
+
/**
|
|
16
|
+
* Wait until a request can proceed under the named pacer's rate limit.
|
|
17
|
+
*
|
|
18
|
+
* Prefer using the handle-based API instead: `await myPacer.wait()`.
|
|
19
|
+
*
|
|
20
|
+
* @param key - The pacer key, matching the key used in `worker.pacer()`.
|
|
21
|
+
*/
|
|
22
|
+
wait: typeof pacerWait;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=pacer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pacer.d.ts","sourceRoot":"","sources":["../src/pacer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,eAAO,MAAM,KAAK;IACjB;;;;;;OAMG;;CAEH,CAAC"}
|
package/dist/pacer.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { pacerWait } from "./pacer_internal.js";
|
|
2
|
+
const Pacer = {
|
|
3
|
+
/**
|
|
4
|
+
* Wait until a request can proceed under the named pacer's rate limit.
|
|
5
|
+
*
|
|
6
|
+
* Prefer using the handle-based API instead: `await myPacer.wait()`.
|
|
7
|
+
*
|
|
8
|
+
* @param key - The pacer key, matching the key used in `worker.pacer()`.
|
|
9
|
+
*/
|
|
10
|
+
wait: pacerWait
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
Pacer
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pacer.test.d.ts","sourceRoot":"","sources":["../src/pacer.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type PacerState = {
|
|
2
|
+
pacers: Record<string, PacerEntry>;
|
|
3
|
+
};
|
|
4
|
+
export type PacerDeclaration = {
|
|
5
|
+
readonly key: string;
|
|
6
|
+
readonly config: {
|
|
7
|
+
allowedRequests: number;
|
|
8
|
+
intervalMs: number;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare function setPacerState(state: PacerState): void;
|
|
12
|
+
export declare function getPacerState(): PacerState;
|
|
13
|
+
//# sourceMappingURL=pacer_internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pacer_internal.d.ts","sourceRoot":"","sources":["../src/pacer_internal.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,MAAM,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;CACjE,CAAC;AAIF,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAErD;AAED,wBAAgB,aAAa,IAAI,UAAU,CAE1C"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
let pacerState = { pacers: {} };
|
|
2
|
+
function setPacerState(state) {
|
|
3
|
+
pacerState = state;
|
|
4
|
+
}
|
|
5
|
+
function getPacerState() {
|
|
6
|
+
return pacerState;
|
|
7
|
+
}
|
|
8
|
+
function initPacerState(runtimePacers, declarations) {
|
|
9
|
+
const pacers = runtimePacers ?? {};
|
|
10
|
+
if (Object.keys(pacers).length === 0 && declarations && declarations.length > 0) {
|
|
11
|
+
const localPacers = {};
|
|
12
|
+
for (const decl of declarations) {
|
|
13
|
+
localPacers[decl.key] = {
|
|
14
|
+
lastScheduledAtMs: 0,
|
|
15
|
+
allowedRequests: decl.config.allowedRequests,
|
|
16
|
+
intervalMs: decl.config.intervalMs
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
setPacerState({ pacers: localPacers });
|
|
20
|
+
} else {
|
|
21
|
+
setPacerState({ pacers });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
async function pacerWait(key) {
|
|
25
|
+
const state = getPacerState();
|
|
26
|
+
const entry = state.pacers[key];
|
|
27
|
+
if (!entry) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`Pacer "${key}" not found. Make sure you declared it with worker.pacer("${key}", ...) and are running inside the worker runtime.`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
const { allowedRequests, intervalMs } = entry;
|
|
33
|
+
const paceMs = Math.ceil(intervalMs / allowedRequests);
|
|
34
|
+
const now = Date.now();
|
|
35
|
+
const lastScheduledAtMs = entry.lastScheduledAtMs;
|
|
36
|
+
const scheduledAtMs = Math.max(lastScheduledAtMs + paceMs, now);
|
|
37
|
+
const delayMs = scheduledAtMs - now;
|
|
38
|
+
state.pacers[key] = { ...entry, lastScheduledAtMs: scheduledAtMs };
|
|
39
|
+
setPacerState(state);
|
|
40
|
+
if (delayMs > 0) {
|
|
41
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
getPacerState,
|
|
46
|
+
initPacerState,
|
|
47
|
+
pacerWait,
|
|
48
|
+
setPacerState
|
|
49
|
+
};
|
package/dist/schema.d.ts
CHANGED
|
@@ -48,10 +48,10 @@ export type PropertyConfiguration = {
|
|
|
48
48
|
} | {
|
|
49
49
|
type: "relation";
|
|
50
50
|
/**
|
|
51
|
-
* The
|
|
52
|
-
* This must match the
|
|
51
|
+
* The key of the related database declaration.
|
|
52
|
+
* This must match the key passed to `worker.database()`.
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
relatedDatabaseKey: string;
|
|
55
55
|
config: {
|
|
56
56
|
twoWay: false;
|
|
57
57
|
} | {
|
|
@@ -60,13 +60,6 @@ export type PropertyConfiguration = {
|
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
62
|
export type Schema<PK extends string> = {
|
|
63
|
-
/**
|
|
64
|
-
* The default name for the database when it is first created.
|
|
65
|
-
*
|
|
66
|
-
* Updating this after the database has been created will not change the
|
|
67
|
-
* name of the database.
|
|
68
|
-
*/
|
|
69
|
-
defaultName: string;
|
|
70
63
|
/**
|
|
71
64
|
* Optional icon to use as the icon for the database page.
|
|
72
65
|
* If not provided, defaults to 📋.
|
|
@@ -150,26 +143,43 @@ export declare function people(): PropertyConfiguration;
|
|
|
150
143
|
*/
|
|
151
144
|
export declare function place(): PropertyConfiguration;
|
|
152
145
|
/**
|
|
153
|
-
* Creates a relation property definition that references another
|
|
154
|
-
* The related
|
|
146
|
+
* Creates a relation property definition that references another database.
|
|
147
|
+
* The related database must be declared in the same worker.
|
|
155
148
|
*
|
|
156
|
-
* @param
|
|
149
|
+
* @param relatedDatabaseKey - The key of the related database declaration.
|
|
157
150
|
* @example
|
|
158
151
|
* ```typescript
|
|
159
|
-
*
|
|
152
|
+
* const projects = worker.database("projects", {
|
|
153
|
+
* type: "managed",
|
|
154
|
+
* initialTitle: "Projects",
|
|
155
|
+
* primaryKeyProperty: "Project ID",
|
|
156
|
+
* schema: {
|
|
157
|
+
* properties: {
|
|
158
|
+
* "Project Name": Schema.title(),
|
|
159
|
+
* "Project ID": Schema.richText(),
|
|
160
|
+
* },
|
|
161
|
+
* },
|
|
162
|
+
* });
|
|
160
163
|
*
|
|
161
|
-
*
|
|
164
|
+
* const tasks = worker.database("tasks", {
|
|
165
|
+
* type: "managed",
|
|
166
|
+
* initialTitle: "Tasks",
|
|
167
|
+
* primaryKeyProperty: "Task ID",
|
|
162
168
|
* schema: {
|
|
163
169
|
* properties: {
|
|
164
170
|
* "Task Title": Schema.title(),
|
|
165
|
-
* "Project": Schema.relation("
|
|
171
|
+
* "Project": Schema.relation("projects"),
|
|
166
172
|
* },
|
|
167
173
|
* },
|
|
168
|
-
*
|
|
174
|
+
* });
|
|
175
|
+
*
|
|
176
|
+
* export const tasksSync = worker.sync("tasksSync", {
|
|
177
|
+
* database: tasks,
|
|
178
|
+
* execute: async () => ({ changes: [], hasMore: false }),
|
|
169
179
|
* });
|
|
170
180
|
* ```
|
|
171
181
|
*/
|
|
172
|
-
export declare function relation(
|
|
182
|
+
export declare function relation(relatedDatabaseKey: string, config?: {
|
|
173
183
|
twoWay: false;
|
|
174
184
|
} | {
|
|
175
185
|
twoWay: true;
|
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,UAAU,EACV,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,MAAM,YAAY,GACrB,OAAO,GACP,WAAW,GACX,KAAK,GACL,OAAO,GACP,cAAc,GACd,UAAU,GACV,MAAM,GACN,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,cAAc,GACd,QAAQ,GACR,QAAQ,GACR,OAAO,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,YAAY,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAC9B;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,GACjB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,GACf;IAAE,IAAI,EAAE,OAAO,CAAA;C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MAAM,EAAE,IAAI,CAAC;IAAC,mBAAmB,EAAE,MAAM,CAAA;CAAE,GACxE,qBAAqB,CAMvB"}
|
package/dist/schema.js
CHANGED
|
@@ -40,10 +40,10 @@ function people() {
|
|
|
40
40
|
function place() {
|
|
41
41
|
return { type: "place" };
|
|
42
42
|
}
|
|
43
|
-
function relation(
|
|
43
|
+
function relation(relatedDatabaseKey, config) {
|
|
44
44
|
return {
|
|
45
45
|
type: "relation",
|
|
46
|
-
|
|
46
|
+
relatedDatabaseKey,
|
|
47
47
|
config: config ?? { twoWay: false }
|
|
48
48
|
};
|
|
49
49
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -171,7 +171,7 @@ export type RelationReference = {
|
|
|
171
171
|
};
|
|
172
172
|
/**
|
|
173
173
|
* Relation value representing references to related records.
|
|
174
|
-
* Each reference identifies a record in the target
|
|
174
|
+
* Each reference identifies a record in the target database.
|
|
175
175
|
*/
|
|
176
176
|
export type RelationValue = RelationReference[];
|
|
177
177
|
/**
|
|
@@ -188,14 +188,17 @@ export type IntervalString = `${number}${TimeUnit}`;
|
|
|
188
188
|
/**
|
|
189
189
|
* Schedule configuration for sync capabilities.
|
|
190
190
|
* - "continuous": Run as frequently as the system allows
|
|
191
|
+
* - "manual": Only run when explicitly triggered
|
|
191
192
|
* - IntervalString: Run at specified intervals, e.g. "30m", "1h", "1d"
|
|
192
193
|
*/
|
|
193
|
-
export type Schedule = "continuous" | IntervalString;
|
|
194
|
+
export type Schedule = "continuous" | "manual" | IntervalString;
|
|
194
195
|
/**
|
|
195
196
|
* Normalized schedule representation stored in the backend.
|
|
196
197
|
*/
|
|
197
198
|
export type SyncSchedule = {
|
|
198
199
|
type: "continuous";
|
|
200
|
+
} | {
|
|
201
|
+
type: "manual";
|
|
199
202
|
} | {
|
|
200
203
|
type: "interval";
|
|
201
204
|
intervalMs: number;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceR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