@notionhq/apps 0.0.14 → 0.0.16
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/AGENTS.md +13 -0
- package/README.md +126 -27
- package/dist/cli/emit-manifest.d.ts.map +1 -1
- package/dist/cli/emit-manifest.js +1 -4
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +3 -0
- package/dist/context.test.d.ts +2 -0
- package/dist/context.test.d.ts.map +1 -0
- package/dist/custom-block.d.ts +1 -1
- package/dist/custom-block.d.ts.map +1 -1
- package/dist/custom-block.js +3 -3
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/notion-as-code/database.d.ts +23 -1
- package/dist/notion-as-code/database.d.ts.map +1 -1
- package/dist/notion-as-code/database.js +27 -0
- package/dist/notion-as-code/index.d.ts +1 -1
- package/dist/notion-as-code/index.d.ts.map +1 -1
- package/dist/notion-as-code/page.d.ts +3 -3
- package/dist/notion-as-code/page.d.ts.map +1 -1
- package/dist/notion-as-code/page.js +2 -7
- package/dist/notion-as-code/teamspace.d.ts +3 -3
- package/dist/notion-as-code/teamspace.d.ts.map +1 -1
- package/dist/notion-as-code/teamspace.js +2 -7
- package/dist/sync.d.ts +2 -2
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +3 -3
- package/dist/workflow.d.ts +6 -6
- package/dist/workflow.d.ts.map +1 -1
- package/dist/workflow.js +2 -2
- package/docs/BUILD.md +5 -5
- package/docs/CONNECTIONS.md +5 -4
- package/package.json +7 -1
- package/skills/connections/SKILL.md +86 -0
- package/skills/custom-blocks/SKILL.md +45 -0
- package/skills/notion-as-code/SKILL.md +189 -0
- package/skills/sync/SKILL.md +98 -0
- package/skills/workflow/SKILL.md +123 -0
- package/src/cli/build.test.ts +97 -7
- package/src/cli/emit-manifest.ts +1 -5
- package/src/context.test.ts +26 -0
- package/src/context.ts +8 -0
- package/src/custom-block.test.ts +4 -4
- package/src/custom-block.ts +2 -2
- package/src/index.ts +7 -0
- package/src/notion-as-code/database.ts +72 -2
- package/src/notion-as-code/index.ts +4 -0
- package/src/notion-as-code/page.ts +3 -11
- package/src/notion-as-code/teamspace.ts +3 -11
- package/src/sync.ts +2 -2
- package/src/workflow-connections-types.test.ts +6 -6
- package/src/workflow-types.test.ts +2 -2
- package/src/workflow.test.ts +31 -31
- package/src/workflow.ts +7 -7
package/AGENTS.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Agent instructions
|
|
2
|
+
|
|
3
|
+
Before creating, modifying, or troubleshooting an App capability, read the
|
|
4
|
+
matching skill:
|
|
5
|
+
|
|
6
|
+
- [Workflows](./skills/workflow/SKILL.md)
|
|
7
|
+
- [Connections](./skills/connections/SKILL.md)
|
|
8
|
+
- [Database syncs](./skills/sync/SKILL.md)
|
|
9
|
+
- [Custom blocks](./skills/custom-blocks/SKILL.md)
|
|
10
|
+
- [Notion as Code](./skills/notion-as-code/SKILL.md)
|
|
11
|
+
|
|
12
|
+
Resolve these links relative to this package directory. Check the installed SDK
|
|
13
|
+
declarations for current API details.
|
package/README.md
CHANGED
|
@@ -3,6 +3,76 @@
|
|
|
3
3
|
[](https://github.com/makenotion/apps-sdk/actions/workflows/ci.yml?query=branch%3Amain)
|
|
4
4
|
[](https://github.com/makenotion/apps-sdk/actions/workflows/publish.yml?query=branch%3Amain)
|
|
5
5
|
|
|
6
|
+
## Imports
|
|
7
|
+
|
|
8
|
+
The package root exports only resource and capability creation helpers:
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import {
|
|
12
|
+
page,
|
|
13
|
+
database,
|
|
14
|
+
teamspace,
|
|
15
|
+
customAgent,
|
|
16
|
+
sync,
|
|
17
|
+
workflow,
|
|
18
|
+
customBlock,
|
|
19
|
+
} from "@notionhq/apps";
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Import the helpers your app uses:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import { page, workflow } from "@notionhq/apps";
|
|
26
|
+
|
|
27
|
+
const home = page({ resourceId: "home" });
|
|
28
|
+
|
|
29
|
+
export default workflow({
|
|
30
|
+
name: "Follow up",
|
|
31
|
+
description: "Runs when a page is created",
|
|
32
|
+
triggers: ({ triggers }) => [triggers.notionPageCreated()],
|
|
33
|
+
handler: async () => {},
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Namespace imports (`import * as Notion from "@notionhq/apps"`) are also supported
|
|
38
|
+
for autocomplete and API exploration.
|
|
39
|
+
|
|
40
|
+
`sync` accepts a Notion-as-Code data-source handle. `customBlock` creates a custom-block
|
|
41
|
+
capability; it is not the browser runtime object. The capability factories use these
|
|
42
|
+
short names on both the root and their subpaths. Their behavior is unchanged.
|
|
43
|
+
|
|
44
|
+
The old capability factory names are no longer exported. Update existing imports and calls:
|
|
45
|
+
|
|
46
|
+
| Removed name | Use instead | Subpath |
|
|
47
|
+
| ---------------------- | ------------- | ----------------------------- |
|
|
48
|
+
| `createWorkflow` | `workflow` | `@notionhq/apps/workflow` |
|
|
49
|
+
| `createDataSourceSync` | `sync` | `@notionhq/apps/sync` |
|
|
50
|
+
| `createCustomBlock` | `customBlock` | `@notionhq/apps/custom-block` |
|
|
51
|
+
|
|
52
|
+
Everything else keeps its subpath import, including builders, value helpers, types,
|
|
53
|
+
connections, triggers, pacers, and the custom-block browser runtime:
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import { Builder } from "@notionhq/apps/builder";
|
|
57
|
+
import { notion } from "@notionhq/apps/notion-as-code";
|
|
58
|
+
import type { DataSourceSyncConfiguration } from "@notionhq/apps/sync";
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Existing subpaths remain available, with the capability factory renames above. The root
|
|
62
|
+
uses explicit exports and does not re-export utility types or the custom-block browser runtime. Browser code should
|
|
63
|
+
keep using `@notionhq/apps/custom-blocks` and `@notionhq/apps/react`; the root includes
|
|
64
|
+
Node-only workflow code. Styles stay in `@notionhq/apps/nds.css`.
|
|
65
|
+
|
|
66
|
+
## Agent skills
|
|
67
|
+
|
|
68
|
+
The package includes skills for [workflows](./skills/workflow/SKILL.md),
|
|
69
|
+
[connections](./skills/connections/SKILL.md),
|
|
70
|
+
[database syncs](./skills/sync/SKILL.md),
|
|
71
|
+
[custom blocks](./skills/custom-blocks/SKILL.md), and
|
|
72
|
+
[Notion as Code](./skills/notion-as-code/SKILL.md). Read the matching skill
|
|
73
|
+
before creating, modifying, or troubleshooting an App capability. Shipping the
|
|
74
|
+
skills with the SDK keeps their instructions up to date with the installed API.
|
|
75
|
+
|
|
6
76
|
## Development
|
|
7
77
|
|
|
8
78
|
1. Install [mise](https://mise.jdx.dev/getting-started.html)
|
|
@@ -14,13 +84,14 @@ The SDK requires Node 26 or newer. It supports workflows and database syncs.
|
|
|
14
84
|
|
|
15
85
|
```ts
|
|
16
86
|
import { triggers } from "@notionhq/apps/triggers";
|
|
17
|
-
import {
|
|
87
|
+
import { workflow } from "@notionhq/apps";
|
|
88
|
+
import { connections } from "@notionhq/apps/workflow";
|
|
18
89
|
```
|
|
19
90
|
|
|
20
91
|
Add a connection requirement to a workflow when it needs Calendar:
|
|
21
92
|
|
|
22
93
|
```ts
|
|
23
|
-
export default
|
|
94
|
+
export default workflow({
|
|
24
95
|
name: "Schedule follow-up",
|
|
25
96
|
description: "Schedules a follow-up after a page is created",
|
|
26
97
|
triggers: [triggers.notionPageCreated()],
|
|
@@ -37,26 +108,30 @@ Use `context.notion` for Notion API calls. Deployed apps receive Notion API
|
|
|
37
108
|
credentials automatically, so do not configure or push `NOTION_API_TOKEN`.
|
|
38
109
|
Local execution needs the token in `.env` before making a Notion API request.
|
|
39
110
|
|
|
40
|
-
##
|
|
111
|
+
## Data-source syncs
|
|
41
112
|
|
|
42
|
-
|
|
43
|
-
databases are always attached; there is no managed-database option.
|
|
113
|
+
Declare a database with Notion as Code, then pass one of its data-source handles to `sync`:
|
|
44
114
|
|
|
45
115
|
```ts
|
|
116
|
+
import { database, sync } from "@notionhq/apps";
|
|
46
117
|
import { Builder } from "@notionhq/apps/builder";
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
118
|
+
|
|
119
|
+
const issues = database({
|
|
120
|
+
resourceId: "issues-db",
|
|
121
|
+
dataSources: [
|
|
122
|
+
{
|
|
123
|
+
resourceId: "issues-source",
|
|
124
|
+
name: "GitHub Issues",
|
|
125
|
+
properties: [
|
|
126
|
+
{ resourceId: "name", name: "Name", type: "title" },
|
|
127
|
+
{ resourceId: "github-id", name: "GitHub ID", type: "text" },
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
],
|
|
56
131
|
});
|
|
57
132
|
|
|
58
|
-
export default
|
|
59
|
-
|
|
133
|
+
export default sync({
|
|
134
|
+
dataSource: issues.dataSources["issues-source"],
|
|
60
135
|
primaryKey: "GitHub ID",
|
|
61
136
|
handler: async () => ({
|
|
62
137
|
changes: [
|
|
@@ -71,17 +146,49 @@ export default createSync({
|
|
|
71
146
|
```
|
|
72
147
|
|
|
73
148
|
Put each default-exported sync directly in `src/syncs/`. A primary key must be a title
|
|
74
|
-
or
|
|
149
|
+
or text property. Do not include that property in an upsert: the SDK fills it from
|
|
75
150
|
the change's `key`.
|
|
76
151
|
|
|
152
|
+
## Notion-as-Code databases
|
|
153
|
+
|
|
154
|
+
Use `properties` to declare a database with one data source:
|
|
155
|
+
|
|
156
|
+
```ts
|
|
157
|
+
import { notion } from "@notionhq/apps/notion-as-code";
|
|
158
|
+
|
|
159
|
+
const issues = notion.database({
|
|
160
|
+
resourceId: "branch-check-issues",
|
|
161
|
+
name: "Issues",
|
|
162
|
+
properties: [
|
|
163
|
+
{ resourceId: "issue-title", name: "Name", type: "title" },
|
|
164
|
+
{ resourceId: "issue-id", name: "ID", type: "text" },
|
|
165
|
+
],
|
|
166
|
+
});
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Pass `issues.dataSource` as the `dataSource` argument to `sync` from `@notionhq/apps`, or use
|
|
170
|
+
`issues.dataSource.addPage(...)` to declare a page in the source. The database still exposes
|
|
171
|
+
`dataSources` and `addView`.
|
|
172
|
+
|
|
173
|
+
For explicit sources, keep using `notion.database({ resourceId, dataSources: [...] })`
|
|
174
|
+
and access each source through `handle.dataSources[sourceResourceId]`.
|
|
175
|
+
`properties` and `dataSources` are mutually exclusive. Both forms also work with
|
|
176
|
+
page and teamspace `addDatabase` helpers.
|
|
177
|
+
|
|
178
|
+
The shorthand emits the existing database intent with one source named after the
|
|
179
|
+
database and identified by `${resourceId}-source`. That ID must be globally unique.
|
|
180
|
+
When converting an existing explicit declaration, use the shorthand only if its
|
|
181
|
+
source already has that ID; changing the source ID creates a different resource.
|
|
182
|
+
No top-level `properties` field is added to the database intent.
|
|
183
|
+
|
|
77
184
|
## Custom blocks
|
|
78
185
|
|
|
79
186
|
Declare browser blocks in `src/customBlocks/<key>.ts`:
|
|
80
187
|
|
|
81
188
|
```ts
|
|
82
|
-
import {
|
|
189
|
+
import { customBlock } from "@notionhq/apps";
|
|
83
190
|
|
|
84
|
-
export default
|
|
191
|
+
export default customBlock({
|
|
85
192
|
path: "./blocks/hello",
|
|
86
193
|
slashCommand: "hello",
|
|
87
194
|
dataSources: {},
|
|
@@ -94,14 +201,6 @@ export default createCustomBlock({
|
|
|
94
201
|
See [the build and deployment guide](docs/BUILD.md) for provisioning artifacts,
|
|
95
202
|
cloud builds with server coordination, and local builds with CLI coordination.
|
|
96
203
|
|
|
97
|
-
### Moving from the Workers alpha SDK
|
|
98
|
-
|
|
99
|
-
- Remove `type` and `primaryKey` from `createDatabase`.
|
|
100
|
-
- Move the property map from `schema.properties` directly into `schema`.
|
|
101
|
-
- Add `primaryKey` to each `createSync`.
|
|
102
|
-
- Remove the primary-key property from each upsert's `properties` object.
|
|
103
|
-
- Change imports from `@notionhq/workers/alpha/*` to `@notionhq/apps/*`.
|
|
104
|
-
|
|
105
204
|
## Local / Boxy end to end testing
|
|
106
205
|
|
|
107
206
|
To build and deploy the app template against a running local Notion server:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit-manifest.d.ts","sourceRoot":"","sources":["../../src/cli/emit-manifest.ts"],"names":[],"mappings":"AAMA,OAAO,EAEN,KAAK,oBAAoB,EACzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAA6C,MAAM,gBAAgB,CAAC;AAE7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AA0M1D,oDAAoD;AACpD,wBAAsB,eAAe,CACpC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,SAAS,oBAAoB,EAAE,EAC7C,YAAY,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACxC,OAAO,CAAC,WAAW,CAAC,CAiFtB;AAED,uFAAuF;AACvF,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAW3F;
|
|
1
|
+
{"version":3,"file":"emit-manifest.d.ts","sourceRoot":"","sources":["../../src/cli/emit-manifest.ts"],"names":[],"mappings":"AAMA,OAAO,EAEN,KAAK,oBAAoB,EACzB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAA6C,MAAM,gBAAgB,CAAC;AAE7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AA0M1D,oDAAoD;AACpD,wBAAsB,eAAe,CACpC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,SAAS,oBAAoB,EAAE,EAC7C,YAAY,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GACxC,OAAO,CAAC,WAAW,CAAC,CAiFtB;AAED,uFAAuF;AACvF,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAW3F;AA8BD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAoCjE;AAED,yFAAyF;AACzF,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAE9F"}
|
|
@@ -174,7 +174,7 @@ async function extractManifest(bundlePath, capabilities, blockConfigs = {}) {
|
|
|
174
174
|
);
|
|
175
175
|
if (!tagged || tagged._tag !== capability.tag) {
|
|
176
176
|
throw new Error(
|
|
177
|
-
`${capability.sourcePath}: default export is not a ${capability.type} \u2014 files under this directory must default-export
|
|
177
|
+
`${capability.sourcePath}: default export is not a ${capability.type} \u2014 files under this directory must default-export ${capability.type === "custom_block" ? "customBlock" : capability.type}(...)`
|
|
178
178
|
);
|
|
179
179
|
}
|
|
180
180
|
let config = { ...tagged.config };
|
|
@@ -249,9 +249,6 @@ function getCapabilityRegistry(bundle) {
|
|
|
249
249
|
}
|
|
250
250
|
return bundle.capabilities;
|
|
251
251
|
}
|
|
252
|
-
function capitalize(value) {
|
|
253
|
-
return `${value.slice(0, 1).toUpperCase()}${value.slice(1)}`;
|
|
254
|
-
}
|
|
255
252
|
function assertJsonSafe(value, path) {
|
|
256
253
|
const reject = (reason) => {
|
|
257
254
|
throw new Error(`${path}: not JSON-serializable (${reason})`);
|
package/dist/context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,MAAM,MAAM,iBAAiB,GAAG;IAC/B,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAG1C,MAAM,MAAM,iBAAiB,GAAG;IAC/B,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAmCF,wBAAgB,uBAAuB,IAAI,iBAAiB,CAe3D"}
|
package/dist/context.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Client } from "@notionhq/client";
|
|
2
2
|
const LOCAL_FIX_STEPS = "\n\nFor local execution:\n1. Create a personal access token at https://app.notion.com/developers/tokens\n2. Add NOTION_API_TOKEN=<your-token> to your .env file\n\nDeployed apps receive Notion API credentials automatically. Do not push NOTION_API_TOKEN.";
|
|
3
3
|
function missingTokenMessage() {
|
|
4
|
+
if (process.env.NOTION_WORKFLOW_STEP_DIRECTORY) {
|
|
5
|
+
return "Notion API access is not configured for this deployed workflow. In Notion, open Developer Tools \u2192 Workers, select this workflow, and grant access to the pages or databases it uses. The runtime provides NOTION_API_TOKEN automatically after access is configured; do not set or push it yourself.";
|
|
6
|
+
}
|
|
4
7
|
return "NOTION_API_TOKEN is not set. context.notion requires an API token when an app capability runs locally." + LOCAL_FIX_STEPS;
|
|
5
8
|
}
|
|
6
9
|
function createUnauthenticatedNotionProxy() {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.test.d.ts","sourceRoot":"","sources":["../src/context.test.ts"],"names":[],"mappings":""}
|
package/dist/custom-block.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type CustomBlockOptions = {
|
|
|
13
13
|
output?: string;
|
|
14
14
|
});
|
|
15
15
|
/** Declare a browser project. Its filename under src/customBlocks supplies its key. */
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function customBlock(options: CustomBlockOptions): {
|
|
17
17
|
_tag: "custom_block";
|
|
18
18
|
config: {
|
|
19
19
|
source: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-block.d.ts","sourceRoot":"","sources":["../src/custom-block.ts"],"names":[],"mappings":"AAAA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
|
|
1
|
-
function
|
|
1
|
+
function customBlock(options) {
|
|
2
2
|
if (typeof options.path !== "string" || options.path.trim() === "") {
|
|
3
|
-
throw new Error("
|
|
3
|
+
throw new Error("customBlock requires a non-empty path relative to the app root");
|
|
4
4
|
}
|
|
5
5
|
const slashCommand = options.slashCommand?.replace(/^\//, "");
|
|
6
6
|
if (slashCommand !== void 0 && !/^[a-z0-9][a-z0-9_-]{0,63}$/.test(slashCommand)) {
|
|
@@ -26,5 +26,5 @@ function createCustomBlock(options) {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
customBlock
|
|
30
30
|
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { customBlock } from "./custom-block.js";
|
|
2
|
+
export { customAgent } from "./notion-as-code/custom-agent.js";
|
|
3
|
+
export { database } from "./notion-as-code/database.js";
|
|
4
|
+
export { page } from "./notion-as-code/page.js";
|
|
5
|
+
export { teamspace } from "./notion-as-code/teamspace.js";
|
|
6
|
+
export { sync } from "./sync.js";
|
|
7
|
+
export { workflow } from "./workflow.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { customBlock } from "./custom-block.js";
|
|
2
|
+
import { customAgent } from "./notion-as-code/custom-agent.js";
|
|
3
|
+
import { database } from "./notion-as-code/database.js";
|
|
4
|
+
import { page } from "./notion-as-code/page.js";
|
|
5
|
+
import { teamspace } from "./notion-as-code/teamspace.js";
|
|
6
|
+
import { sync } from "./sync.js";
|
|
7
|
+
import { workflow } from "./workflow.js";
|
|
8
|
+
export {
|
|
9
|
+
customAgent,
|
|
10
|
+
customBlock,
|
|
11
|
+
database,
|
|
12
|
+
page,
|
|
13
|
+
sync,
|
|
14
|
+
teamspace,
|
|
15
|
+
workflow
|
|
16
|
+
};
|
|
@@ -18,6 +18,13 @@ export type DatabaseArgs<DataSources extends readonly DataSourceDefinition[] = r
|
|
|
18
18
|
};
|
|
19
19
|
/** Input for adding a database beneath an existing resource. */
|
|
20
20
|
export type ChildDatabaseArgs<DataSources extends readonly DataSourceDefinition[] = readonly DataSourceDefinition[]> = Omit<DatabaseArgs<DataSources>, "parent">;
|
|
21
|
+
/** Single-source shorthand; the source ID is `${resourceId}-source`. */
|
|
22
|
+
export type SingleSourceDatabaseArgs<Properties extends readonly NotionAsCodeProperty[] = readonly NotionAsCodeProperty[]> = Omit<DatabaseArgs, "dataSources" | "name"> & {
|
|
23
|
+
name: string;
|
|
24
|
+
properties: Properties;
|
|
25
|
+
dataSources?: never;
|
|
26
|
+
};
|
|
27
|
+
export type ChildSingleSourceDatabaseArgs<Properties extends readonly NotionAsCodeProperty[] = readonly NotionAsCodeProperty[]> = Omit<SingleSourceDatabaseArgs<Properties>, "parent">;
|
|
21
28
|
/** Resolves one data source ID to the properties declared for it. */
|
|
22
29
|
type DataSourcePropertiesForResourceId<DataSources extends readonly DataSourceDefinition[], ResourceId extends DataSources[number]["resourceId"]> = Extract<DataSources[number], {
|
|
23
30
|
resourceId: ResourceId;
|
|
@@ -37,8 +44,23 @@ export type DatabaseHandle<DataSources extends readonly DataSourceDefinition[] =
|
|
|
37
44
|
};
|
|
38
45
|
addView: (view: unknown) => void;
|
|
39
46
|
};
|
|
47
|
+
/** A database whose sole data source is available without an ID lookup. */
|
|
48
|
+
export type SingleSourceDatabaseHandle<Properties extends readonly NotionAsCodeProperty[] = readonly NotionAsCodeProperty[]> = DatabaseHandle<readonly DataSourceDefinition<Properties>[]> & {
|
|
49
|
+
readonly dataSource: DataSourceHandle<Properties>;
|
|
50
|
+
};
|
|
51
|
+
export type ChildDatabaseFactory = {
|
|
52
|
+
<const Properties extends readonly NotionAsCodeProperty[]>(args: ChildSingleSourceDatabaseArgs<Properties>): SingleSourceDatabaseHandle<Properties>;
|
|
53
|
+
<const DataSources extends readonly DataSourceDefinition[]>(args: ChildDatabaseArgs<DataSources> & {
|
|
54
|
+
properties?: never;
|
|
55
|
+
}): DatabaseHandle<DataSources>;
|
|
56
|
+
};
|
|
40
57
|
/** Declare a database, defaulting to a private top-level database in the Apps workspace. */
|
|
41
|
-
export declare function database<const
|
|
58
|
+
export declare function database<const Properties extends readonly NotionAsCodeProperty[]>(args: SingleSourceDatabaseArgs<Properties>): SingleSourceDatabaseHandle<Properties>;
|
|
59
|
+
export declare function database<const DataSources extends readonly DataSourceDefinition[]>(args: DatabaseArgs<DataSources> & {
|
|
60
|
+
properties?: never;
|
|
61
|
+
}): DatabaseHandle<DataSources>;
|
|
62
|
+
/** Bind both database declaration forms to an existing parent. */
|
|
63
|
+
export declare function createChildDatabase(parent: Parent): ChildDatabaseFactory;
|
|
42
64
|
/** Record a database declaration and create handles for each of its data sources. */
|
|
43
65
|
export declare function createDatabase(args: DatabaseArgs, parent: Parent): DatabaseHandle;
|
|
44
66
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/notion-as-code/database.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAEN,KAAK,oBAAoB,EAEzB,KAAK,gBAAg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EF,MAAM,MAAM,oBAAoB,GAAG;IAClC,CAAC,KAAK,CAAC,UAAU,SAAS,SAAS,oBAAoB,EAAE,EACxD,IAAI,EAAE,6BAA6B,CAAC,UAAU,CAAC,GAC7C,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC,KAAK,CAAC,WAAW,SAAS,SAAS,oBAAoB,EAAE,EACzD,IAAI,EAAE,iBAAiB,CAAC,WAAW,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,KAAK,CAAA;KAAE,GAC3D,cAAc,CAAC,WAAW,CAAC,CAAC;CAC/B,CAAC;AAEF,4FAA4F;AAC5F,wBAAgB,QAAQ,CAAC,KAAK,CAAC,UAAU,SAAS,SAAS,oBAAoB,EAAE,EAChF,IAAI,EAAE,wBAAwB,CAAC,UAAU,CAAC,GACxC,0BAA0B,CAAC,UAAU,CAAC,CAAC;AAC1C,wBAAgB,QAAQ,CAAC,KAAK,CAAC,WAAW,SAAS,SAAS,oBAAoB,EAAE,EACjF,IAAI,EAAE,YAAY,CAAC,WAAW,CAAC,GAAG;IAAE,UAAU,CAAC,EAAE,KAAK,CAAA;CAAE,GACtD,cAAc,CAAC,WAAW,CAAC,CAAC;AA+B/B,kEAAkE;AAClE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAgBxE;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,GAAG,cAAc,CA+BjF"}
|
|
@@ -13,8 +13,34 @@ function database(args) {
|
|
|
13
13
|
type: "resourceId",
|
|
14
14
|
resourceId: APPS_WORKSPACE_RESOURCE_ID
|
|
15
15
|
};
|
|
16
|
+
if ("properties" in args) {
|
|
17
|
+
if (args.dataSources !== void 0) {
|
|
18
|
+
throw new Error("Specify either properties or dataSources, not both");
|
|
19
|
+
}
|
|
20
|
+
const { properties, ...databaseArgs } = args;
|
|
21
|
+
const source = {
|
|
22
|
+
resourceId: `${args.resourceId}-source`,
|
|
23
|
+
name: args.name,
|
|
24
|
+
properties
|
|
25
|
+
};
|
|
26
|
+
const handle = createDatabase({ ...databaseArgs, dataSources: [source] }, parent);
|
|
27
|
+
const dataSource = handle.dataSources[source.resourceId];
|
|
28
|
+
if (!dataSource) {
|
|
29
|
+
throw new Error(`Missing data source "${source.resourceId}"`);
|
|
30
|
+
}
|
|
31
|
+
return { ...handle, dataSource };
|
|
32
|
+
}
|
|
16
33
|
return createDatabase(args, parent);
|
|
17
34
|
}
|
|
35
|
+
function createChildDatabase(parent) {
|
|
36
|
+
function addDatabase(args) {
|
|
37
|
+
if ("properties" in args) {
|
|
38
|
+
return database({ ...args, parent });
|
|
39
|
+
}
|
|
40
|
+
return database({ ...args, parent });
|
|
41
|
+
}
|
|
42
|
+
return addDatabase;
|
|
43
|
+
}
|
|
18
44
|
function createDatabase(args, parent) {
|
|
19
45
|
assertUserResourceId(args.resourceId);
|
|
20
46
|
const dataSources = args.dataSources ?? [];
|
|
@@ -72,6 +98,7 @@ function createDataSourceHandle(dataSource) {
|
|
|
72
98
|
};
|
|
73
99
|
}
|
|
74
100
|
export {
|
|
101
|
+
createChildDatabase,
|
|
75
102
|
createDatabase,
|
|
76
103
|
database
|
|
77
104
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { APPS_RESERVED_RESOURCE_ID_PREFIX, APPS_WORKSPACE_RESOURCE_ID } from "./intents.js";
|
|
2
2
|
export type { DataSourceDefinition, NotionAsCodeProperty, Parent } from "./intents.js";
|
|
3
3
|
export type { CustomAgentArgs, CustomAgentHandle } from "./custom-agent.js";
|
|
4
|
-
export type { ChildDatabaseArgs, DataSourceHandle, DatabaseArgs, DatabaseHandle, } from "./database.js";
|
|
4
|
+
export type { ChildDatabaseArgs, ChildDatabaseFactory, ChildSingleSourceDatabaseArgs, DataSourceHandle, DatabaseArgs, DatabaseHandle, SingleSourceDatabaseArgs, SingleSourceDatabaseHandle, } from "./database.js";
|
|
5
5
|
export type { ChildPageArgs, PageArgs, PageHandle } from "./page.js";
|
|
6
6
|
export type { TeamspaceArgs, TeamspaceHandle } from "./teamspace.js";
|
|
7
7
|
/** Experimental Notion-as-Code facade for Apps SDK project metadata. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notion-as-code/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gCAAgC,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC5F,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACvF,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,YAAY,EACX,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notion-as-code/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gCAAgC,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC5F,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACvF,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,YAAY,EACX,iBAAiB,EACjB,oBAAoB,EACpB,6BAA6B,EAC7B,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,wBAAwB,EACxB,0BAA0B,GAC1B,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACrE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAErE,wEAAwE;AACxE,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;CAAiB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
1
|
+
import { type Parent, type ResourceId } from "./intents.js";
|
|
2
|
+
import { type ChildDatabaseFactory } from "./database.js";
|
|
3
3
|
export type PageArgs = {
|
|
4
4
|
resourceId: ResourceId;
|
|
5
5
|
/** Omit to create a private top-level page in the Apps workspace. */
|
|
@@ -12,7 +12,7 @@ export type PageArgs = {
|
|
|
12
12
|
export type ChildPageArgs = Omit<PageArgs, "parent">;
|
|
13
13
|
export type PageHandle = {
|
|
14
14
|
readonly resourceId: string;
|
|
15
|
-
addDatabase:
|
|
15
|
+
addDatabase: ChildDatabaseFactory;
|
|
16
16
|
addPage: (args: ChildPageArgs) => PageHandle;
|
|
17
17
|
};
|
|
18
18
|
/** Declare a page, defaulting to a private top-level page in the Apps workspace. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/notion-as-code/page.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/notion-as-code/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,MAAM,EACX,KAAK,UAAU,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAuB,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAI/E,MAAM,MAAM,QAAQ,GAAG;IACtB,UAAU,EAAE,UAAU,CAAC;IACvB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG;IACxB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,oBAAoB,CAAC;IAClC,OAAO,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,UAAU,CAAC;CAC7C,CAAC;AAEF,oFAAoF;AACpF,wBAAgB,IAAI,CAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,CAS/C;AAED,6DAA6D;AAC7D,wBAAgB,UAAU,CAAC,IAAI,EAAE,aAAa,GAAG,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAerF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
APPS_WORKSPACE_RESOURCE_ID
|
|
3
3
|
} from "./intents.js";
|
|
4
|
-
import {
|
|
4
|
+
import { createChildDatabase } from "./database.js";
|
|
5
5
|
import { recordIntent } from "./recorder.js";
|
|
6
6
|
import { assertParent, assertUserResourceId } from "./resource.js";
|
|
7
7
|
function page(args) {
|
|
@@ -23,12 +23,7 @@ function createPage(args, parent) {
|
|
|
23
23
|
});
|
|
24
24
|
return {
|
|
25
25
|
resourceId: args.resourceId,
|
|
26
|
-
addDatabase(
|
|
27
|
-
return database({
|
|
28
|
-
...databaseArgs,
|
|
29
|
-
parent: { type: "resourceId", resourceId: args.resourceId }
|
|
30
|
-
});
|
|
31
|
-
},
|
|
26
|
+
addDatabase: createChildDatabase({ type: "resourceId", resourceId: args.resourceId }),
|
|
32
27
|
addPage(pageArgs) {
|
|
33
28
|
return createPage(pageArgs, { type: "resourceId", resourceId: args.resourceId });
|
|
34
29
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
1
|
+
import { type NotionAsCodeIcon, type ResourceId } from "./intents.js";
|
|
2
|
+
import { type ChildDatabaseFactory } from "./database.js";
|
|
3
3
|
import { type ChildPageArgs, type PageHandle } from "./page.js";
|
|
4
4
|
export type TeamspaceArgs = {
|
|
5
5
|
resourceId: ResourceId;
|
|
@@ -10,7 +10,7 @@ export type TeamspaceArgs = {
|
|
|
10
10
|
};
|
|
11
11
|
export type TeamspaceHandle = {
|
|
12
12
|
readonly resourceId: string;
|
|
13
|
-
addDatabase:
|
|
13
|
+
addDatabase: ChildDatabaseFactory;
|
|
14
14
|
addPage: (args: ChildPageArgs) => PageHandle;
|
|
15
15
|
};
|
|
16
16
|
/** Declare a teamspace that Apps automatically creates in its workspace. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"teamspace.d.ts","sourceRoot":"","sources":["../../src/notion-as-code/teamspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,
|
|
1
|
+
{"version":3,"file":"teamspace.d.ts","sourceRoot":"","sources":["../../src/notion-as-code/teamspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAEf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAuB,KAAK,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAc,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAI5E,MAAM,MAAM,aAAa,GAAG;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IACvD,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,WAAW,EAAE,oBAAoB,CAAC;IAClC,OAAO,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,UAAU,CAAC;CAC7C,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,GAAG,eAAe,CAe9D"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
APPS_WORKSPACE_RESOURCE_ID
|
|
3
3
|
} from "./intents.js";
|
|
4
|
-
import {
|
|
4
|
+
import { createChildDatabase } from "./database.js";
|
|
5
5
|
import { createPage } from "./page.js";
|
|
6
6
|
import { recordIntent } from "./recorder.js";
|
|
7
7
|
import { assertUserResourceId } from "./resource.js";
|
|
@@ -14,12 +14,7 @@ function teamspace(args) {
|
|
|
14
14
|
});
|
|
15
15
|
return {
|
|
16
16
|
resourceId: args.resourceId,
|
|
17
|
-
addDatabase(
|
|
18
|
-
return database({
|
|
19
|
-
...databaseArgs,
|
|
20
|
-
parent: { type: "resourceId", resourceId: args.resourceId }
|
|
21
|
-
});
|
|
22
|
-
},
|
|
17
|
+
addDatabase: createChildDatabase({ type: "resourceId", resourceId: args.resourceId }),
|
|
23
18
|
addPage(pageArgs) {
|
|
24
19
|
return createPage(pageArgs, { type: "resourceId", resourceId: args.resourceId });
|
|
25
20
|
}
|
package/dist/sync.d.ts
CHANGED
|
@@ -48,7 +48,7 @@ export type SyncConfiguration<S extends DatabaseSchema, PrimaryKey extends KeyPr
|
|
|
48
48
|
handler: (state: State | undefined, context: CapabilityContext) => Promise<SyncHandlerResult<NoInfer<S>, NoInfer<PrimaryKey>, State>>;
|
|
49
49
|
};
|
|
50
50
|
/** Configuration for a sync backed by a Notion-as-Code data source. */
|
|
51
|
-
type DataSourceSyncConfiguration<Properties extends readonly NotionAsCodeProperty[], PrimaryKey extends KeyPropertyName<AppsSchemaForProperties<Properties>>, State> = {
|
|
51
|
+
export type DataSourceSyncConfiguration<Properties extends readonly NotionAsCodeProperty[], PrimaryKey extends KeyPropertyName<AppsSchemaForProperties<Properties>>, State> = {
|
|
52
52
|
dataSource: DataSourceHandle<Properties>;
|
|
53
53
|
primaryKey: PrimaryKey;
|
|
54
54
|
mode?: SyncMode;
|
|
@@ -80,6 +80,6 @@ export type Sync = {
|
|
|
80
80
|
/** Create a database sync. Default-export it from a sync file. */
|
|
81
81
|
export declare function createSync<const S extends DatabaseSchema, const PrimaryKey extends KeyPropertyName<S>, State = unknown>(configuration: SyncConfiguration<S, PrimaryKey, State>): Sync;
|
|
82
82
|
/** Create a sync backed by a Notion-as-Code data source. */
|
|
83
|
-
export declare function
|
|
83
|
+
export declare function sync<const Properties extends readonly NotionAsCodeProperty[], const PrimaryKey extends KeyPropertyName<AppsSchemaForProperties<Properties>>, State = unknown>(configuration: DataSourceSyncConfiguration<Properties, PrimaryKey, State>): Sync;
|
|
84
84
|
export {};
|
|
85
85
|
//# sourceMappingURL=sync.d.ts.map
|
package/dist/sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EAA+B,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAG1E,OAAO,KAAK,EACX,cAAc,EACd,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACX,KAAK,EACL,cAAc,EACd,IAAI,EACJ,kBAAkB,EAClB,WAAW,EACX,UAAU,EACV,aAAa,EACb,QAAQ,EACR,SAAS,EACT,MAAM,YAAY,CAAC;AAEpB,KAAK,WAAW,GAAG,aAAa,GAAG,YAAY,CAAC;AAEhD,mEAAmE;AACnE,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,cAAc,IAAI,OAAO,CAC9D;KACE,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,WAAW,GAAG,CAAC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ED,4DAA4D;AAC5D,wBAAgB,IAAI,CACnB,KAAK,CAAC,UAAU,SAAS,SAAS,oBAAoB,EAAE,EACxD,KAAK,CAAC,UAAU,SAAS,eAAe,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC,EAC7E,KAAK,GAAG,OAAO,EACd,aAAa,EAAE,2BAA2B,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,GAAG,IAAI,CAEjF"}
|
package/dist/sync.js
CHANGED
|
@@ -10,7 +10,7 @@ function resolveSyncDatabase(configuration) {
|
|
|
10
10
|
function createSync(configuration) {
|
|
11
11
|
return createSyncDefinition(configuration);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function sync(configuration) {
|
|
14
14
|
return createSyncDefinition(configuration);
|
|
15
15
|
}
|
|
16
16
|
function createSyncDefinition(configuration) {
|
|
@@ -81,6 +81,6 @@ function createSyncDefinition(configuration) {
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
createSync,
|
|
85
|
+
sync
|
|
86
86
|
};
|