@notionhq/custom-blocks 0.0.59 → 0.0.61
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/HOST.md +1 -1
- package/dist/bridge/SandboxBridge.d.ts.map +1 -1
- package/dist/bridge/SandboxBridge.js +21 -3
- package/dist/bridge/ids.d.ts +9 -0
- package/dist/bridge/ids.d.ts.map +1 -1
- package/dist/bridge/ids.js +1 -0
- package/dist/bridge/messages/createPageResult.d.ts +3 -0
- package/dist/bridge/messages/createPageResult.d.ts.map +1 -1
- package/dist/bridge/messages/getPage.d.ts +3 -0
- package/dist/bridge/messages/getPage.d.ts.map +1 -1
- package/dist/bridge/messages/hostToSandbox.d.ts +95 -0
- package/dist/bridge/messages/hostToSandbox.d.ts.map +1 -1
- package/dist/bridge/messages/hostToSandbox.js +3 -2
- package/dist/bridge/messages/init.d.ts +3 -0
- package/dist/bridge/messages/init.d.ts.map +1 -1
- package/dist/bridge/messages/parentChanged.d.ts +3 -0
- package/dist/bridge/messages/parentChanged.d.ts.map +1 -1
- package/dist/bridge/messages/queryDataSourceResult.d.ts +241 -1
- package/dist/bridge/messages/queryDataSourceResult.d.ts.map +1 -1
- package/dist/bridge/messages/queryDataSourceResult.js +26 -1
- package/dist/bridge/messages/updatePageResult.d.ts +3 -0
- package/dist/bridge/messages/updatePageResult.d.ts.map +1 -1
- package/dist/bridge/pages/page.d.ts +3 -0
- package/dist/bridge/pages/page.d.ts.map +1 -1
- package/dist/bridge/parent.d.ts +4 -0
- package/dist/bridge/parent.d.ts.map +1 -1
- package/dist/bridge/parent.js +2 -1
- package/dist/host/createCustomBlockHost.d.ts.map +1 -1
- package/dist/host/createCustomBlockHost.js +2 -0
- package/dist/host/queries/types.d.ts +3 -2
- package/dist/host/queries/types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/docs/block-location.md +18 -1
- package/package.json +1 -1
- package/src/bridge/SandboxBridge.ts +22 -3
- package/src/bridge/ids.ts +14 -0
- package/src/bridge/messages/hostToSandbox.ts +6 -2
- package/src/bridge/messages/queryDataSourceResult.ts +28 -1
- package/src/bridge/parent.ts +3 -0
- package/src/host/createCustomBlockHost.ts +2 -0
- package/src/host/queries/types.ts +3 -5
- package/src/index.ts +1 -0
package/HOST.md
CHANGED
|
@@ -158,7 +158,7 @@ Messages sent from the host to the sandbox. Same `{ wire type, type / schema, be
|
|
|
158
158
|
| `pageChanged` | `PageChangedMessage` / `pageChangedMessageSchema` | Replaces the nearest page ancestor without disturbing theme, block ID, parent, user, or query state. |
|
|
159
159
|
| `currentUserChanged` | `CurrentUserChangedMessage` / `currentUserChangedMessageSchema` | Replaces the current viewer record. Send when any viewer field changes (name, avatar, email). |
|
|
160
160
|
| `dataSourcesChanged` | `DataSourcesChangedMessage` / `dataSourcesChangedMessageSchema` | Replaces data-source bindings; the sandbox preserves cached query state for keys that still exist and drops removed keys. |
|
|
161
|
-
| `queryDataSourceResult` | `QueryDataSourceResultMessage` / `queryDataSourceResultMessageSchema` | `requestId` / `snapshotId`-keyed response with `items`, `hasMore`,
|
|
161
|
+
| `queryDataSourceResult` | `QueryDataSourceResultMessage` / `queryDataSourceResultMessageSchema` | `requestId` / `snapshotId`-keyed response with `status: "success"`, `items`, and `hasMore`, or `status: "error"` and `error`. |
|
|
162
162
|
| `createPageResult` | `CreatePageResultMessage` / `createPageResultMessageSchema` | `requestId`-keyed page response with `status: "success"` or `status: "error"`. |
|
|
163
163
|
| `getPageResult` | `GetPageResultMessage` / `getPageResultMessageSchema` | Same success/error shape as `createPageResult`. |
|
|
164
164
|
| `updatePageResult` | `UpdatePageResultMessage` / `updatePageResultMessageSchema` | Same success/error shape as `createPageResult`. |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxBridge.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/SandboxBridge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,aAAa,CAAA;AAGpB,OAAO,KAAK,EACX,gBAAgB,EAEhB,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EACX,+BAA+B,EAC/B,gCAAgC,EAChC,MAAM,iCAAiC,CAAA;AAGxC,OAAO,EACN,KAAK,oBAAoB,EAGzB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAQxD,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAW3E;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"SandboxBridge.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/SandboxBridge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,aAAa,CAAA;AAGpB,OAAO,KAAK,EACX,gBAAgB,EAEhB,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EACX,+BAA+B,EAC/B,gCAAgC,EAChC,MAAM,iCAAiC,CAAA;AAGxC,OAAO,EACN,KAAK,oBAAoB,EAGzB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAQxD,OAAO,EAAwB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAA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,IAAI,oBAAoB;IAIpC;;;;;OAKG;IACH,WAAW,IAAI,mBAAmB,GAAG,IAAI;IAIzC;;;;;OAKG;IACH,YAAY,CAAC,OAAO,EAAE,WAAW;IAIjC,OAAO,CAAC,SAAS;IA+CjB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB;IAqE/D,OAAO,CAAC,uBAAuB;IAyB/B,UAAU,CAAC,MAAM,EAAE,MAAM;IAazB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAoC7D,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;IAYrD,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;IAYrD,SAAS,CAAC,KAAK,GAAE,cAAmB,GAAG,OAAO,CAAC,eAAe,CAAC;IAa/D,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA2C7D;;;;OAIG;IACH,oBAAoB,CAAC,IAAI,EAAE;QAC1B,UAAU,EAAE,gBAAgB,CAAA;QAC5B,MAAM,EAAE,YAAY,CAAA;QACpB,KAAK,EAAE,+BAA+B,CAAA;KACtC,GAAG,OAAO,CAAC,gCAAgC,CAAC;IAuB7C;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;CAkE/B"}
|
|
@@ -13,6 +13,7 @@ import { PendingRequests } from "./pendingRequests.js";
|
|
|
13
13
|
* single host needs to support multiple custom blocks built with different versions of the bridge
|
|
14
14
|
* protocol. Increment this number any time a breaking change is made to the bridge protocol.
|
|
15
15
|
*/
|
|
16
|
+
// TODO(custom-blocks): Update when bumping bridge protocol version to 3.
|
|
16
17
|
export const CUSTOM_BLOCK_BRIDGE_PROTOCOL_VERSION = 2;
|
|
17
18
|
export class SandboxBridge {
|
|
18
19
|
constructor() {
|
|
@@ -205,15 +206,32 @@ export class SandboxBridge {
|
|
|
205
206
|
if (currentState.latestRequestId !== message.requestId) {
|
|
206
207
|
return;
|
|
207
208
|
}
|
|
209
|
+
const queryResult = "status" in message
|
|
210
|
+
? message.status === "error"
|
|
211
|
+
? {
|
|
212
|
+
items: [],
|
|
213
|
+
hasMore: false,
|
|
214
|
+
error: message.error,
|
|
215
|
+
}
|
|
216
|
+
: {
|
|
217
|
+
items: message.items,
|
|
218
|
+
hasMore: message.hasMore,
|
|
219
|
+
error: undefined,
|
|
220
|
+
}
|
|
221
|
+
: {
|
|
222
|
+
items: message.items,
|
|
223
|
+
hasMore: message.hasMore,
|
|
224
|
+
error: message.error,
|
|
225
|
+
};
|
|
208
226
|
this.hostState = {
|
|
209
227
|
...hostState,
|
|
210
228
|
dataSourceState: {
|
|
211
229
|
...hostState.dataSourceState,
|
|
212
230
|
[key]: {
|
|
213
|
-
items:
|
|
231
|
+
items: queryResult.items,
|
|
214
232
|
isLoading: false,
|
|
215
|
-
hasMore:
|
|
216
|
-
error:
|
|
233
|
+
hasMore: queryResult.hasMore,
|
|
234
|
+
error: queryResult.error,
|
|
217
235
|
// Keep the request ID so later host-pushed refreshes for the
|
|
218
236
|
// same subscription still match.
|
|
219
237
|
latestRequestId: message.requestId,
|
package/dist/bridge/ids.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as v from "valibot";
|
|
|
2
2
|
declare const notionDataSourceIdBrand: unique symbol;
|
|
3
3
|
declare const notionBlockIdBrand: unique symbol;
|
|
4
4
|
declare const notionPageIdBrand: unique symbol;
|
|
5
|
+
declare const notionAgentIdBrand: unique symbol;
|
|
5
6
|
declare const notionSpaceIdBrand: unique symbol;
|
|
6
7
|
/**
|
|
7
8
|
* Branded Notion block ID. Host payloads and SDK APIs use plain strings at runtime,
|
|
@@ -27,6 +28,14 @@ export type NotionPageId = string & {
|
|
|
27
28
|
readonly [notionPageIdBrand]: "NotionPageId";
|
|
28
29
|
};
|
|
29
30
|
export declare const notionPageIdSchema: v.CustomSchema<NotionPageId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
31
|
+
/**
|
|
32
|
+
* Branded Notion agent ID. Agent parents identify the workflow that owns an
|
|
33
|
+
* instruction page or one of its blocks.
|
|
34
|
+
*/
|
|
35
|
+
export type NotionAgentId = string & {
|
|
36
|
+
readonly [notionAgentIdBrand]: "NotionAgentId";
|
|
37
|
+
};
|
|
38
|
+
export declare const notionAgentIdSchema: v.CustomSchema<NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
30
39
|
/**
|
|
31
40
|
* Branded Notion workspace/space ID. Host payloads and SDK APIs use plain strings at runtime,
|
|
32
41
|
* but the brand keeps space IDs from being accidentally mixed with other IDs in TypeScript.
|
package/dist/bridge/ids.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/ids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,OAAO,CAAC,MAAM,uBAAuB,EAAE,OAAO,MAAM,CAAA;AACpD,OAAO,CAAC,MAAM,kBAAkB,EAAE,OAAO,MAAM,CAAA;AAC/C,OAAO,CAAC,MAAM,iBAAiB,EAAE,OAAO,MAAM,CAAA;AAC9C,OAAO,CAAC,MAAM,kBAAkB,EAAE,OAAO,MAAM,CAAA;AAE/C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG;IACpC,QAAQ,CAAC,CAAC,kBAAkB,CAAC,EAAE,eAAe,CAAA;CAC9C,CAAA;AAED,eAAO,MAAM,mBAAmB,0EAG/B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG;IACzC,QAAQ,CAAC,CAAC,uBAAuB,CAAC,EAAE,oBAAoB,CAAA;CACxD,CAAA;AAED,eAAO,MAAM,wBAAwB,+EAGpC,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,G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;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG;IACpC,QAAQ,CAAC,CAAC,kBAAkB,CAAC,EAAE,eAAe,CAAA;CAC9C,CAAA;AAED,eAAO,MAAM,mBAAmB,0EAG/B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG;IACpC,QAAQ,CAAC,CAAC,kBAAkB,CAAC,EAAE,eAAe,CAAA;CAC9C,CAAA;AAED,eAAO,MAAM,mBAAmB,0EAG/B,CAAA"}
|
package/dist/bridge/ids.js
CHANGED
|
@@ -2,4 +2,5 @@ import * as v from "valibot";
|
|
|
2
2
|
export const notionBlockIdSchema = v.custom(value => typeof value === "string", "Expected a Notion block ID");
|
|
3
3
|
export const notionDataSourceIdSchema = v.custom(value => typeof value === "string", "Expected a Notion data source ID");
|
|
4
4
|
export const notionPageIdSchema = v.custom(value => typeof value === "string", "Expected a Notion page ID");
|
|
5
|
+
export const notionAgentIdSchema = v.custom(value => typeof value === "string", "Expected a Notion agent ID");
|
|
5
6
|
export const notionSpaceIdSchema = v.custom(value => typeof value === "string", "Expected a Notion space ID");
|
|
@@ -31,6 +31,9 @@ export declare const createPageResultMessageSchema: v.VariantSchema<"status", [v
|
|
|
31
31
|
}, undefined>, v.ObjectSchema<{
|
|
32
32
|
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
33
33
|
readonly block_id: v.CustomSchema<import("../ids.js").NotionBlockId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
34
|
+
}, undefined>, v.ObjectSchema<{
|
|
35
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
36
|
+
readonly agent_id: v.CustomSchema<import("../ids.js").NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
34
37
|
}, undefined>], undefined>;
|
|
35
38
|
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
36
39
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPageResult.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/createPageResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAKxD,eAAO,MAAM,oCAAoC,2BAAa,CAAA;AAE9D,MAAM,MAAM,8BAA8B,GACvC,oBAAoB,GACpB,qBAAqB,GACrB,oBAAoB,GACpB,0BAA0B,GAC1B,yBAAyB,GACzB,sBAAsB,GACtB,mBAAmB,GACnB,sBAAsB,GACtB,oBAAoB,GACpB,wBAAwB,GACxB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEhB,MAAM,MAAM,8BAA8B,GACzC,oBAAoB,CAAC,8BAA8B,CAAC,CAAA;AAErD,eAAO,MAAM,oCAAoC;;;;aAI/C,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;IAKxC,8BAA8B
|
|
1
|
+
{"version":3,"file":"createPageResult.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/createPageResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAKxD,eAAO,MAAM,oCAAoC,2BAAa,CAAA;AAE9D,MAAM,MAAM,8BAA8B,GACvC,oBAAoB,GACpB,qBAAqB,GACrB,oBAAoB,GACpB,0BAA0B,GAC1B,yBAAyB,GACzB,sBAAsB,GACtB,mBAAmB,GACnB,sBAAsB,GACtB,oBAAoB,GACpB,wBAAwB,GACxB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEhB,MAAM,MAAM,8BAA8B,GACzC,oBAAoB,CAAC,8BAA8B,CAAC,CAAA;AAErD,eAAO,MAAM,oCAAoC;;;;aAI/C,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;IAKxC,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAS9B,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAClD,OAAO,6BAA6B,CACpC,CAAA"}
|
|
@@ -36,6 +36,9 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
|
|
|
36
36
|
}, undefined>, v.ObjectSchema<{
|
|
37
37
|
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
38
38
|
readonly block_id: v.CustomSchema<import("../ids.js").NotionBlockId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
39
|
+
}, undefined>, v.ObjectSchema<{
|
|
40
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
41
|
+
readonly agent_id: v.CustomSchema<import("../ids.js").NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
39
42
|
}, undefined>], undefined>;
|
|
40
43
|
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
41
44
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPage.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/getPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAMxD,eAAO,MAAM,iCAAiC,2BAAa,CAAA;AAE3D,MAAM,MAAM,2BAA2B,GACpC,iBAAiB,GACjB,oBAAoB,GACpB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEhB,MAAM,MAAM,2BAA2B,GACtC,oBAAoB,CAAC,2BAA2B,CAAC,CAAA;AAElD,eAAO,MAAM,iCAAiC;;;;aAI5C,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;aAI/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE,eAAO,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"getPage.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/getPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAMxD,eAAO,MAAM,iCAAiC,2BAAa,CAAA;AAE3D,MAAM,MAAM,2BAA2B,GACpC,iBAAiB,GACjB,oBAAoB,GACpB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEhB,MAAM,MAAM,2BAA2B,GACtC,oBAAoB,CAAC,2BAA2B,CAAC,CAAA;AAElD,eAAO,MAAM,iCAAiC;;;;aAI5C,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;aAI/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAarC,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAC/C,OAAO,0BAA0B,CACjC,CAAA"}
|
|
@@ -19,6 +19,9 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
19
19
|
}, undefined>, v.ObjectSchema<{
|
|
20
20
|
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
21
21
|
readonly block_id: v.CustomSchema<import("../ids.js").NotionBlockId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
22
|
+
}, undefined>, v.ObjectSchema<{
|
|
23
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
24
|
+
readonly agent_id: v.CustomSchema<import("../ids.js").NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
22
25
|
}, undefined>], undefined>;
|
|
23
26
|
readonly page: v.ObjectSchema<{
|
|
24
27
|
readonly id: v.CustomSchema<import("../ids.js").NotionPageId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
@@ -205,6 +208,9 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
205
208
|
}, undefined>, v.ObjectSchema<{
|
|
206
209
|
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
207
210
|
readonly block_id: v.CustomSchema<import("../ids.js").NotionBlockId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
211
|
+
}, undefined>, v.ObjectSchema<{
|
|
212
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
213
|
+
readonly agent_id: v.CustomSchema<import("../ids.js").NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
208
214
|
}, undefined>], undefined>;
|
|
209
215
|
}, undefined>, v.ObjectSchema<{
|
|
210
216
|
readonly type: v.LiteralSchema<"pageChanged", undefined>;
|
|
@@ -372,7 +378,87 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
372
378
|
readonly propertyIdsByKey: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>;
|
|
373
379
|
}, undefined>, undefined>;
|
|
374
380
|
}, undefined>;
|
|
381
|
+
}, undefined>, v.VariantSchema<"status", [v.ObjectSchema<{
|
|
382
|
+
readonly type: v.LiteralSchema<"queryDataSourceResult", undefined>;
|
|
383
|
+
readonly requestId: v.StringSchema<undefined>;
|
|
384
|
+
readonly snapshotId: v.StringSchema<undefined>;
|
|
385
|
+
readonly status: v.LiteralSchema<"success", undefined>;
|
|
386
|
+
readonly items: v.ArraySchema<v.ObjectSchema<{
|
|
387
|
+
readonly id: v.CustomSchema<import("../ids.js").NotionPageId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
388
|
+
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.BooleanSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
389
|
+
readonly type: v.LiteralSchema<"date", undefined>;
|
|
390
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
391
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
392
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
393
|
+
readonly value: v.NumberSchema<undefined>;
|
|
394
|
+
readonly time: v.StringSchema<undefined>;
|
|
395
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
396
|
+
}, undefined>, v.ObjectSchema<{
|
|
397
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
398
|
+
}, undefined>], undefined>, undefined>;
|
|
399
|
+
}, undefined>, v.ObjectSchema<{
|
|
400
|
+
readonly type: v.LiteralSchema<"daterange", undefined>;
|
|
401
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
402
|
+
readonly end_date: v.StringSchema<undefined>;
|
|
403
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
404
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
405
|
+
readonly value: v.NumberSchema<undefined>;
|
|
406
|
+
readonly time: v.StringSchema<undefined>;
|
|
407
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
408
|
+
}, undefined>, v.ObjectSchema<{
|
|
409
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
410
|
+
}, undefined>], undefined>, undefined>;
|
|
411
|
+
}, undefined>, v.ObjectSchema<{
|
|
412
|
+
readonly type: v.LiteralSchema<"datetime", undefined>;
|
|
413
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
414
|
+
readonly start_time: v.StringSchema<undefined>;
|
|
415
|
+
readonly time_zone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
416
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
|
|
417
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
418
|
+
readonly value: v.NumberSchema<undefined>;
|
|
419
|
+
readonly time: v.StringSchema<undefined>;
|
|
420
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
421
|
+
}, undefined>, v.ObjectSchema<{
|
|
422
|
+
readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
|
|
423
|
+
readonly value: v.NumberSchema<undefined>;
|
|
424
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
425
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
426
|
+
}, undefined>], undefined>, undefined>;
|
|
427
|
+
}, undefined>, v.ObjectSchema<{
|
|
428
|
+
readonly type: v.LiteralSchema<"datetimerange", undefined>;
|
|
429
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
430
|
+
readonly start_time: v.StringSchema<undefined>;
|
|
431
|
+
readonly end_date: v.StringSchema<undefined>;
|
|
432
|
+
readonly end_time: v.StringSchema<undefined>;
|
|
433
|
+
readonly time_zone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
434
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
|
|
435
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
436
|
+
readonly value: v.NumberSchema<undefined>;
|
|
437
|
+
readonly time: v.StringSchema<undefined>;
|
|
438
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
439
|
+
}, undefined>, v.ObjectSchema<{
|
|
440
|
+
readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
|
|
441
|
+
readonly value: v.NumberSchema<undefined>;
|
|
442
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
443
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
444
|
+
}, undefined>], undefined>, undefined>;
|
|
445
|
+
}, undefined>], undefined>, v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ArraySchema<v.ObjectSchema<{
|
|
446
|
+
readonly id: v.StringSchema<undefined>;
|
|
447
|
+
readonly table: v.StringSchema<undefined>;
|
|
448
|
+
}, undefined>, undefined>], undefined>, undefined>, undefined>;
|
|
449
|
+
}, undefined>, undefined>;
|
|
450
|
+
readonly hasMore: v.BooleanSchema<undefined>;
|
|
375
451
|
}, undefined>, v.ObjectSchema<{
|
|
452
|
+
readonly type: v.LiteralSchema<"queryDataSourceResult", undefined>;
|
|
453
|
+
readonly requestId: v.StringSchema<undefined>;
|
|
454
|
+
readonly snapshotId: v.StringSchema<undefined>;
|
|
455
|
+
readonly status: v.LiteralSchema<"error", undefined>;
|
|
456
|
+
readonly error: v.ObjectSchema<{
|
|
457
|
+
readonly code: v.StringSchema<undefined>;
|
|
458
|
+
readonly message: v.StringSchema<undefined>;
|
|
459
|
+
readonly isRetryable: v.BooleanSchema<undefined>;
|
|
460
|
+
}, undefined>;
|
|
461
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
376
462
|
readonly type: v.LiteralSchema<"queryDataSourceResult", undefined>;
|
|
377
463
|
readonly requestId: v.StringSchema<undefined>;
|
|
378
464
|
readonly snapshotId: v.StringSchema<undefined>;
|
|
@@ -465,6 +551,9 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
465
551
|
}, undefined>, v.ObjectSchema<{
|
|
466
552
|
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
467
553
|
readonly block_id: v.CustomSchema<import("../ids.js").NotionBlockId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
554
|
+
}, undefined>, v.ObjectSchema<{
|
|
555
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
556
|
+
readonly agent_id: v.CustomSchema<import("../ids.js").NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
468
557
|
}, undefined>], undefined>;
|
|
469
558
|
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
470
559
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
@@ -659,6 +748,9 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
659
748
|
}, undefined>, v.ObjectSchema<{
|
|
660
749
|
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
661
750
|
readonly block_id: v.CustomSchema<import("../ids.js").NotionBlockId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
751
|
+
}, undefined>, v.ObjectSchema<{
|
|
752
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
753
|
+
readonly agent_id: v.CustomSchema<import("../ids.js").NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
662
754
|
}, undefined>], undefined>;
|
|
663
755
|
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
664
756
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
@@ -906,6 +998,9 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
906
998
|
}, undefined>, v.ObjectSchema<{
|
|
907
999
|
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
908
1000
|
readonly block_id: v.CustomSchema<import("../ids.js").NotionBlockId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
1001
|
+
}, undefined>, v.ObjectSchema<{
|
|
1002
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
1003
|
+
readonly agent_id: v.CustomSchema<import("../ids.js").NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
909
1004
|
}, undefined>], undefined>;
|
|
910
1005
|
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
911
1006
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hostToSandbox.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/hostToSandbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"hostToSandbox.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/hostToSandbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAkB5B;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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W,CAC/C,OAAO,0BAA0B,CACjC,CAAA"}
|
|
@@ -9,7 +9,7 @@ import { invalidSandboxMessageSchema } from "./invalidSandboxMessage.js";
|
|
|
9
9
|
import { listUsersResultMessageSchema } from "./listUsers.js";
|
|
10
10
|
import { pageChangedMessageSchema } from "./pageChanged.js";
|
|
11
11
|
import { parentChangedMessageSchema } from "./parentChanged.js";
|
|
12
|
-
import {
|
|
12
|
+
import { legacyQueryDataSourceResultMessageSchema, statusQueryDataSourceResultMessageSchema, } from "./queryDataSourceResult.js";
|
|
13
13
|
import { themeChangedMessageSchema } from "./themeChanged.js";
|
|
14
14
|
import { updatePageResultMessageSchema } from "./updatePageResult.js";
|
|
15
15
|
/**
|
|
@@ -22,7 +22,8 @@ export const hostToSandboxMessageSchema = v.variant("type", [
|
|
|
22
22
|
pageChangedMessageSchema,
|
|
23
23
|
currentUserChangedMessageSchema,
|
|
24
24
|
dataSourcesChangedMessageSchema,
|
|
25
|
-
|
|
25
|
+
statusQueryDataSourceResultMessageSchema,
|
|
26
|
+
legacyQueryDataSourceResultMessageSchema,
|
|
26
27
|
createPageResultMessageSchema,
|
|
27
28
|
getPageResultMessageSchema,
|
|
28
29
|
getUserResultMessageSchema,
|
|
@@ -35,6 +35,9 @@ export declare const initMessageSchema: v.VariantSchema<"status", [v.ObjectSchem
|
|
|
35
35
|
}, undefined>, v.ObjectSchema<{
|
|
36
36
|
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
37
37
|
readonly block_id: v.CustomSchema<import("../ids.js").NotionBlockId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
38
|
+
}, undefined>, v.ObjectSchema<{
|
|
39
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
40
|
+
readonly agent_id: v.CustomSchema<import("../ids.js").NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
38
41
|
}, undefined>], undefined>;
|
|
39
42
|
readonly page: v.ObjectSchema<{
|
|
40
43
|
readonly id: v.CustomSchema<import("../ids.js").NotionPageId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AASxD,eAAO,MAAM,8BAA8B,2BAAa,CAAA;AAExD,MAAM,MAAM,wBAAwB,GACjC,UAAU,GACV,eAAe,GACf,sBAAsB,GACtB,kBAAkB,GAClB,0BAA0B,GAC1B,8BAA8B,GAC9B,qBAAqB,GACrB,0BAA0B,GAC1B,6BAA6B,GAC7B,yBAAyB,GACzB,0BAA0B,GAC1B,0BAA0B,GAC1B,eAAe,GACf,cAAc,GACd,eAAe,GACf,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEhB,MAAM,MAAM,wBAAwB,GACnC,oBAAoB,CAAC,wBAAwB,CAAC,CAAA;AAE/C,eAAO,MAAM,8BAA8B;;;;aAIzC,CAAA;AAEF,qBAAa,oBACZ,SAAQ,KACR,YAAW,oBAAoB;gBAEnB,KAAK,EAAE,wBAAwB;IAO3C,IAAI,EAAE,wBAAwB,CAAA;IAC9B,WAAW,EAAE,OAAO,CAAA;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AASxD,eAAO,MAAM,8BAA8B,2BAAa,CAAA;AAExD,MAAM,MAAM,wBAAwB,GACjC,UAAU,GACV,eAAe,GACf,sBAAsB,GACtB,kBAAkB,GAClB,0BAA0B,GAC1B,8BAA8B,GAC9B,qBAAqB,GACrB,0BAA0B,GAC1B,6BAA6B,GAC7B,yBAAyB,GACzB,0BAA0B,GAC1B,0BAA0B,GAC1B,eAAe,GACf,cAAc,GACd,eAAe,GACf,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEhB,MAAM,MAAM,wBAAwB,GACnC,oBAAoB,CAAC,wBAAwB,CAAC,CAAA;AAE/C,eAAO,MAAM,8BAA8B;;;;aAIzC,CAAA;AAEF,qBAAa,oBACZ,SAAQ,KACR,YAAW,oBAAoB;gBAEnB,KAAK,EAAE,wBAAwB;IAO3C,IAAI,EAAE,wBAAwB,CAAA;IAC9B,WAAW,EAAE,OAAO,CAAA;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAkB5B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
|
|
@@ -16,6 +16,9 @@ export declare const parentChangedMessageSchema: v.ObjectSchema<{
|
|
|
16
16
|
}, undefined>, v.ObjectSchema<{
|
|
17
17
|
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
18
18
|
readonly block_id: v.CustomSchema<import("../ids.js").NotionBlockId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
19
|
+
}, undefined>, v.ObjectSchema<{
|
|
20
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
21
|
+
readonly agent_id: v.CustomSchema<import("../ids.js").NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
19
22
|
}, undefined>], undefined>;
|
|
20
23
|
}, undefined>;
|
|
21
24
|
export type ParentChangedMessage = v.InferOutput<typeof parentChangedMessageSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parentChanged.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/parentChanged.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAG5B;;GAEG;AACH,eAAO,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"parentChanged.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/parentChanged.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAG5B;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;aAGrC,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAC/C,OAAO,0BAA0B,CACjC,CAAA"}
|
|
@@ -11,7 +11,7 @@ export declare const customBlockQueryDataSourceErrorInfoSchema: v.ObjectSchema<{
|
|
|
11
11
|
/**
|
|
12
12
|
* Message sent by the host to the sandbox in response to a `queryDataSource` request.
|
|
13
13
|
*/
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const legacyQueryDataSourceResultMessageSchema: v.ObjectSchema<{
|
|
15
15
|
readonly type: v.LiteralSchema<"queryDataSourceResult", undefined>;
|
|
16
16
|
readonly requestId: v.StringSchema<undefined>;
|
|
17
17
|
readonly snapshotId: v.StringSchema<undefined>;
|
|
@@ -86,5 +86,245 @@ export declare const queryDataSourceResultMessageSchema: v.ObjectSchema<{
|
|
|
86
86
|
readonly isRetryable: v.BooleanSchema<undefined>;
|
|
87
87
|
}, undefined>, undefined>;
|
|
88
88
|
}, undefined>;
|
|
89
|
+
export declare const statusQueryDataSourceResultMessageSchema: v.VariantSchema<"status", [v.ObjectSchema<{
|
|
90
|
+
readonly type: v.LiteralSchema<"queryDataSourceResult", undefined>;
|
|
91
|
+
readonly requestId: v.StringSchema<undefined>;
|
|
92
|
+
readonly snapshotId: v.StringSchema<undefined>;
|
|
93
|
+
readonly status: v.LiteralSchema<"success", undefined>;
|
|
94
|
+
readonly items: v.ArraySchema<v.ObjectSchema<{
|
|
95
|
+
readonly id: v.CustomSchema<import("../ids.js").NotionPageId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
96
|
+
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.BooleanSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
97
|
+
readonly type: v.LiteralSchema<"date", undefined>;
|
|
98
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
99
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
100
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
101
|
+
readonly value: v.NumberSchema<undefined>;
|
|
102
|
+
readonly time: v.StringSchema<undefined>;
|
|
103
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
104
|
+
}, undefined>, v.ObjectSchema<{
|
|
105
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
106
|
+
}, undefined>], undefined>, undefined>;
|
|
107
|
+
}, undefined>, v.ObjectSchema<{
|
|
108
|
+
readonly type: v.LiteralSchema<"daterange", undefined>;
|
|
109
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
110
|
+
readonly end_date: v.StringSchema<undefined>;
|
|
111
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
112
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
113
|
+
readonly value: v.NumberSchema<undefined>;
|
|
114
|
+
readonly time: v.StringSchema<undefined>;
|
|
115
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
116
|
+
}, undefined>, v.ObjectSchema<{
|
|
117
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
118
|
+
}, undefined>], undefined>, undefined>;
|
|
119
|
+
}, undefined>, v.ObjectSchema<{
|
|
120
|
+
readonly type: v.LiteralSchema<"datetime", undefined>;
|
|
121
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
122
|
+
readonly start_time: v.StringSchema<undefined>;
|
|
123
|
+
readonly time_zone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
124
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
|
|
125
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
126
|
+
readonly value: v.NumberSchema<undefined>;
|
|
127
|
+
readonly time: v.StringSchema<undefined>;
|
|
128
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
129
|
+
}, undefined>, v.ObjectSchema<{
|
|
130
|
+
readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
|
|
131
|
+
readonly value: v.NumberSchema<undefined>;
|
|
132
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
133
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
134
|
+
}, undefined>], undefined>, undefined>;
|
|
135
|
+
}, undefined>, v.ObjectSchema<{
|
|
136
|
+
readonly type: v.LiteralSchema<"datetimerange", undefined>;
|
|
137
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
138
|
+
readonly start_time: v.StringSchema<undefined>;
|
|
139
|
+
readonly end_date: v.StringSchema<undefined>;
|
|
140
|
+
readonly end_time: v.StringSchema<undefined>;
|
|
141
|
+
readonly time_zone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
142
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
|
|
143
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
144
|
+
readonly value: v.NumberSchema<undefined>;
|
|
145
|
+
readonly time: v.StringSchema<undefined>;
|
|
146
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
147
|
+
}, undefined>, v.ObjectSchema<{
|
|
148
|
+
readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
|
|
149
|
+
readonly value: v.NumberSchema<undefined>;
|
|
150
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
151
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
152
|
+
}, undefined>], undefined>, undefined>;
|
|
153
|
+
}, undefined>], undefined>, v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ArraySchema<v.ObjectSchema<{
|
|
154
|
+
readonly id: v.StringSchema<undefined>;
|
|
155
|
+
readonly table: v.StringSchema<undefined>;
|
|
156
|
+
}, undefined>, undefined>], undefined>, undefined>, undefined>;
|
|
157
|
+
}, undefined>, undefined>;
|
|
158
|
+
readonly hasMore: v.BooleanSchema<undefined>;
|
|
159
|
+
}, undefined>, v.ObjectSchema<{
|
|
160
|
+
readonly type: v.LiteralSchema<"queryDataSourceResult", undefined>;
|
|
161
|
+
readonly requestId: v.StringSchema<undefined>;
|
|
162
|
+
readonly snapshotId: v.StringSchema<undefined>;
|
|
163
|
+
readonly status: v.LiteralSchema<"error", undefined>;
|
|
164
|
+
readonly error: v.ObjectSchema<{
|
|
165
|
+
readonly code: v.StringSchema<undefined>;
|
|
166
|
+
readonly message: v.StringSchema<undefined>;
|
|
167
|
+
readonly isRetryable: v.BooleanSchema<undefined>;
|
|
168
|
+
}, undefined>;
|
|
169
|
+
}, undefined>], undefined>;
|
|
170
|
+
/**
|
|
171
|
+
* TODO(custom-blocks): Update when bumping bridge protocol version to 3.
|
|
172
|
+
* Protocol version 2 hosts and sandboxes use the legacy optional-error shape.
|
|
173
|
+
*/
|
|
174
|
+
export declare const queryDataSourceResultMessageSchema: v.UnionSchema<[v.ObjectSchema<{
|
|
175
|
+
readonly type: v.LiteralSchema<"queryDataSourceResult", undefined>;
|
|
176
|
+
readonly requestId: v.StringSchema<undefined>;
|
|
177
|
+
readonly snapshotId: v.StringSchema<undefined>;
|
|
178
|
+
readonly items: v.ArraySchema<v.ObjectSchema<{
|
|
179
|
+
readonly id: v.CustomSchema<import("../ids.js").NotionPageId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
180
|
+
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.BooleanSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
181
|
+
readonly type: v.LiteralSchema<"date", undefined>;
|
|
182
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
183
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
184
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
185
|
+
readonly value: v.NumberSchema<undefined>;
|
|
186
|
+
readonly time: v.StringSchema<undefined>;
|
|
187
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
188
|
+
}, undefined>, v.ObjectSchema<{
|
|
189
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
190
|
+
}, undefined>], undefined>, undefined>;
|
|
191
|
+
}, undefined>, v.ObjectSchema<{
|
|
192
|
+
readonly type: v.LiteralSchema<"daterange", undefined>;
|
|
193
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
194
|
+
readonly end_date: v.StringSchema<undefined>;
|
|
195
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
196
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
197
|
+
readonly value: v.NumberSchema<undefined>;
|
|
198
|
+
readonly time: v.StringSchema<undefined>;
|
|
199
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
200
|
+
}, undefined>, v.ObjectSchema<{
|
|
201
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
202
|
+
}, undefined>], undefined>, undefined>;
|
|
203
|
+
}, undefined>, v.ObjectSchema<{
|
|
204
|
+
readonly type: v.LiteralSchema<"datetime", undefined>;
|
|
205
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
206
|
+
readonly start_time: v.StringSchema<undefined>;
|
|
207
|
+
readonly time_zone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
208
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
|
|
209
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
210
|
+
readonly value: v.NumberSchema<undefined>;
|
|
211
|
+
readonly time: v.StringSchema<undefined>;
|
|
212
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
213
|
+
}, undefined>, v.ObjectSchema<{
|
|
214
|
+
readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
|
|
215
|
+
readonly value: v.NumberSchema<undefined>;
|
|
216
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
217
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
218
|
+
}, undefined>], undefined>, undefined>;
|
|
219
|
+
}, undefined>, v.ObjectSchema<{
|
|
220
|
+
readonly type: v.LiteralSchema<"datetimerange", undefined>;
|
|
221
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
222
|
+
readonly start_time: v.StringSchema<undefined>;
|
|
223
|
+
readonly end_date: v.StringSchema<undefined>;
|
|
224
|
+
readonly end_time: v.StringSchema<undefined>;
|
|
225
|
+
readonly time_zone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
226
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
|
|
227
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
228
|
+
readonly value: v.NumberSchema<undefined>;
|
|
229
|
+
readonly time: v.StringSchema<undefined>;
|
|
230
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
231
|
+
}, undefined>, v.ObjectSchema<{
|
|
232
|
+
readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
|
|
233
|
+
readonly value: v.NumberSchema<undefined>;
|
|
234
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
235
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
236
|
+
}, undefined>], undefined>, undefined>;
|
|
237
|
+
}, undefined>], undefined>, v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ArraySchema<v.ObjectSchema<{
|
|
238
|
+
readonly id: v.StringSchema<undefined>;
|
|
239
|
+
readonly table: v.StringSchema<undefined>;
|
|
240
|
+
}, undefined>, undefined>], undefined>, undefined>, undefined>;
|
|
241
|
+
}, undefined>, undefined>;
|
|
242
|
+
readonly hasMore: v.BooleanSchema<undefined>;
|
|
243
|
+
readonly error: v.OptionalSchema<v.ObjectSchema<{
|
|
244
|
+
readonly code: v.StringSchema<undefined>;
|
|
245
|
+
readonly message: v.StringSchema<undefined>;
|
|
246
|
+
readonly isRetryable: v.BooleanSchema<undefined>;
|
|
247
|
+
}, undefined>, undefined>;
|
|
248
|
+
}, undefined>, v.VariantSchema<"status", [v.ObjectSchema<{
|
|
249
|
+
readonly type: v.LiteralSchema<"queryDataSourceResult", undefined>;
|
|
250
|
+
readonly requestId: v.StringSchema<undefined>;
|
|
251
|
+
readonly snapshotId: v.StringSchema<undefined>;
|
|
252
|
+
readonly status: v.LiteralSchema<"success", undefined>;
|
|
253
|
+
readonly items: v.ArraySchema<v.ObjectSchema<{
|
|
254
|
+
readonly id: v.CustomSchema<import("../ids.js").NotionPageId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
255
|
+
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.BooleanSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
256
|
+
readonly type: v.LiteralSchema<"date", undefined>;
|
|
257
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
258
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
259
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
260
|
+
readonly value: v.NumberSchema<undefined>;
|
|
261
|
+
readonly time: v.StringSchema<undefined>;
|
|
262
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
263
|
+
}, undefined>, v.ObjectSchema<{
|
|
264
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
265
|
+
}, undefined>], undefined>, undefined>;
|
|
266
|
+
}, undefined>, v.ObjectSchema<{
|
|
267
|
+
readonly type: v.LiteralSchema<"daterange", undefined>;
|
|
268
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
269
|
+
readonly end_date: v.StringSchema<undefined>;
|
|
270
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
271
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
272
|
+
readonly value: v.NumberSchema<undefined>;
|
|
273
|
+
readonly time: v.StringSchema<undefined>;
|
|
274
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
275
|
+
}, undefined>, v.ObjectSchema<{
|
|
276
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
277
|
+
}, undefined>], undefined>, undefined>;
|
|
278
|
+
}, undefined>, v.ObjectSchema<{
|
|
279
|
+
readonly type: v.LiteralSchema<"datetime", undefined>;
|
|
280
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
281
|
+
readonly start_time: v.StringSchema<undefined>;
|
|
282
|
+
readonly time_zone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
283
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
|
|
284
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
285
|
+
readonly value: v.NumberSchema<undefined>;
|
|
286
|
+
readonly time: v.StringSchema<undefined>;
|
|
287
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
288
|
+
}, undefined>, v.ObjectSchema<{
|
|
289
|
+
readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
|
|
290
|
+
readonly value: v.NumberSchema<undefined>;
|
|
291
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
292
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
293
|
+
}, undefined>], undefined>, undefined>;
|
|
294
|
+
}, undefined>, v.ObjectSchema<{
|
|
295
|
+
readonly type: v.LiteralSchema<"datetimerange", undefined>;
|
|
296
|
+
readonly start_date: v.StringSchema<undefined>;
|
|
297
|
+
readonly start_time: v.StringSchema<undefined>;
|
|
298
|
+
readonly end_date: v.StringSchema<undefined>;
|
|
299
|
+
readonly end_time: v.StringSchema<undefined>;
|
|
300
|
+
readonly time_zone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
301
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
|
|
302
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
303
|
+
readonly value: v.NumberSchema<undefined>;
|
|
304
|
+
readonly time: v.StringSchema<undefined>;
|
|
305
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
306
|
+
}, undefined>, v.ObjectSchema<{
|
|
307
|
+
readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
|
|
308
|
+
readonly value: v.NumberSchema<undefined>;
|
|
309
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
310
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
311
|
+
}, undefined>], undefined>, undefined>;
|
|
312
|
+
}, undefined>], undefined>, v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ArraySchema<v.ObjectSchema<{
|
|
313
|
+
readonly id: v.StringSchema<undefined>;
|
|
314
|
+
readonly table: v.StringSchema<undefined>;
|
|
315
|
+
}, undefined>, undefined>], undefined>, undefined>, undefined>;
|
|
316
|
+
}, undefined>, undefined>;
|
|
317
|
+
readonly hasMore: v.BooleanSchema<undefined>;
|
|
318
|
+
}, undefined>, v.ObjectSchema<{
|
|
319
|
+
readonly type: v.LiteralSchema<"queryDataSourceResult", undefined>;
|
|
320
|
+
readonly requestId: v.StringSchema<undefined>;
|
|
321
|
+
readonly snapshotId: v.StringSchema<undefined>;
|
|
322
|
+
readonly status: v.LiteralSchema<"error", undefined>;
|
|
323
|
+
readonly error: v.ObjectSchema<{
|
|
324
|
+
readonly code: v.StringSchema<undefined>;
|
|
325
|
+
readonly message: v.StringSchema<undefined>;
|
|
326
|
+
readonly isRetryable: v.BooleanSchema<undefined>;
|
|
327
|
+
}, undefined>;
|
|
328
|
+
}, undefined>], undefined>], undefined>;
|
|
89
329
|
export type QueryDataSourceResultMessage = v.InferOutput<typeof queryDataSourceResultMessageSchema>;
|
|
90
330
|
//# sourceMappingURL=queryDataSourceResult.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryDataSourceResult.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/queryDataSourceResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAIxD,eAAO,MAAM,yCAAyC,2BAAa,CAAA;AAEnE,MAAM,MAAM,mCAAmC,GAC5C,0BAA0B,GAC1B,yBAAyB,GACzB,sBAAsB,GACtB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEhB,MAAM,MAAM,mCAAmC,GAC9C,oBAAoB,CAAC,mCAAmC,CAAC,CAAA;AAE1D,eAAO,MAAM,yCAAyC;;;;aAIpD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"queryDataSourceResult.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/queryDataSourceResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAIxD,eAAO,MAAM,yCAAyC,2BAAa,CAAA;AAEnE,MAAM,MAAM,mCAAmC,GAC5C,0BAA0B,GAC1B,yBAAyB,GACzB,sBAAsB,GACtB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEhB,MAAM,MAAM,mCAAmC,GAC9C,oBAAoB,CAAC,mCAAmC,CAAC,CAAA;AAE1D,eAAO,MAAM,yCAAyC;;;;aAIpD,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAOnD,CAAA;AAEF,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAgBnD,CAAA;AAEF;;;GAGG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAG7C,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,WAAW,CACvD,OAAO,kCAAkC,CACzC,CAAA"}
|
|
@@ -11,7 +11,7 @@ export const customBlockQueryDataSourceErrorInfoSchema = v.object({
|
|
|
11
11
|
/**
|
|
12
12
|
* Message sent by the host to the sandbox in response to a `queryDataSource` request.
|
|
13
13
|
*/
|
|
14
|
-
export const
|
|
14
|
+
export const legacyQueryDataSourceResultMessageSchema = v.object({
|
|
15
15
|
type: v.literal("queryDataSourceResult"),
|
|
16
16
|
requestId: v.string(),
|
|
17
17
|
snapshotId: v.string(),
|
|
@@ -19,3 +19,28 @@ export const queryDataSourceResultMessageSchema = v.object({
|
|
|
19
19
|
hasMore: v.boolean(),
|
|
20
20
|
error: v.optional(customBlockQueryDataSourceErrorInfoSchema),
|
|
21
21
|
});
|
|
22
|
+
export const statusQueryDataSourceResultMessageSchema = v.variant("status", [
|
|
23
|
+
v.object({
|
|
24
|
+
type: v.literal("queryDataSourceResult"),
|
|
25
|
+
requestId: v.string(),
|
|
26
|
+
snapshotId: v.string(),
|
|
27
|
+
status: v.literal("success"),
|
|
28
|
+
items: v.array(notionDataSourcePageBridgeSchema),
|
|
29
|
+
hasMore: v.boolean(),
|
|
30
|
+
}),
|
|
31
|
+
v.object({
|
|
32
|
+
type: v.literal("queryDataSourceResult"),
|
|
33
|
+
requestId: v.string(),
|
|
34
|
+
snapshotId: v.string(),
|
|
35
|
+
status: v.literal("error"),
|
|
36
|
+
error: customBlockQueryDataSourceErrorInfoSchema,
|
|
37
|
+
}),
|
|
38
|
+
]);
|
|
39
|
+
/**
|
|
40
|
+
* TODO(custom-blocks): Update when bumping bridge protocol version to 3.
|
|
41
|
+
* Protocol version 2 hosts and sandboxes use the legacy optional-error shape.
|
|
42
|
+
*/
|
|
43
|
+
export const queryDataSourceResultMessageSchema = v.union([
|
|
44
|
+
legacyQueryDataSourceResultMessageSchema,
|
|
45
|
+
statusQueryDataSourceResultMessageSchema,
|
|
46
|
+
]);
|
|
@@ -30,6 +30,9 @@ export declare const updatePageResultMessageSchema: v.VariantSchema<"status", [v
|
|
|
30
30
|
}, undefined>, v.ObjectSchema<{
|
|
31
31
|
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
32
32
|
readonly block_id: v.CustomSchema<import("../ids.js").NotionBlockId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
33
|
+
}, undefined>, v.ObjectSchema<{
|
|
34
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
35
|
+
readonly agent_id: v.CustomSchema<import("../ids.js").NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
33
36
|
}, undefined>], undefined>;
|
|
34
37
|
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
35
38
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updatePageResult.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/updatePageResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAKxD,eAAO,MAAM,oCAAoC,2BAAa,CAAA;AAE9D,MAAM,MAAM,8BAA8B,GACvC,oBAAoB,GACpB,qBAAqB,GACrB,oBAAoB,GACpB,0BAA0B,GAC1B,mBAAmB,GACnB,sBAAsB,GACtB,oBAAoB,GACpB,wBAAwB,GACxB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEhB,MAAM,MAAM,8BAA8B,GACzC,oBAAoB,CAAC,8BAA8B,CAAC,CAAA;AAErD,eAAO,MAAM,oCAAoC;;;;aAI/C,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B
|
|
1
|
+
{"version":3,"file":"updatePageResult.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/messages/updatePageResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAKxD,eAAO,MAAM,oCAAoC,2BAAa,CAAA;AAE9D,MAAM,MAAM,8BAA8B,GACvC,oBAAoB,GACpB,qBAAqB,GACrB,oBAAoB,GACpB,0BAA0B,GAC1B,mBAAmB,GACnB,sBAAsB,GACtB,oBAAoB,GACpB,wBAAwB,GACxB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEhB,MAAM,MAAM,8BAA8B,GACzC,oBAAoB,CAAC,8BAA8B,CAAC,CAAA;AAErD,eAAO,MAAM,oCAAoC;;;;aAI/C,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAaxC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAClD,OAAO,6BAA6B,CACpC,CAAA"}
|
|
@@ -430,6 +430,9 @@ export declare const notionPageSchema: v.ObjectSchema<{
|
|
|
430
430
|
}, undefined>, v.ObjectSchema<{
|
|
431
431
|
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
432
432
|
readonly block_id: v.CustomSchema<import("../ids.js").NotionBlockId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
433
|
+
}, undefined>, v.ObjectSchema<{
|
|
434
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
435
|
+
readonly agent_id: v.CustomSchema<import("../ids.js").NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
433
436
|
}, undefined>], undefined>;
|
|
434
437
|
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
435
438
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/pages/page.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,eAAO,MAAM,qBAAqB;;aAEhC,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B;;;;;;0BAMtC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,WAAW,CAChD,OAAO,2BAA2B,CAClC,CAAA;AAED,eAAO,MAAM,qBAAqB;;;aAGhC,CAAA;AACF,eAAO,MAAM,2BAA2B;;;;;;;aAOtC,CAAA;AACF,eAAO,MAAM,wBAAwB;;;;;aAGnC,CAAA;AACF,eAAO,MAAM,sBAAsB;;;;;;aAMjC,CAAA;AAGF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;0BAK/B,CAAA;AACF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE,eAAO,MAAM,qBAAqB;;;;;;;;;;;0BAGhC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAIzE,QAAA,MAAM,wBAAwB,uEAAoC,CAAA;AAClE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E,QAAA,MAAM,6BA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AER;;;;GAIG;AACH,MAAM,MAAM,4BAA4B,GACvC,sBAAsB,CAAC,uBAAuB,CAAC,CAAA;AAEhD,MAAM,MAAM,0BAA0B,GAAG;IACxC,CAAC,eAAe,EAAE,MAAM,GAAG,4BAA4B,CAAA;CACvD,CAAA;AAED,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAG5C,CAAA;AACD,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,WAAW,CACrD,OAAO,gCAAgC,CACvC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/pages/page.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,eAAO,MAAM,qBAAqB;;aAEhC,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B;;;;;;0BAMtC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,WAAW,CAChD,OAAO,2BAA2B,CAClC,CAAA;AAED,eAAO,MAAM,qBAAqB;;;aAGhC,CAAA;AACF,eAAO,MAAM,2BAA2B;;;;;;;aAOtC,CAAA;AACF,eAAO,MAAM,wBAAwB;;;;;aAGnC,CAAA;AACF,eAAO,MAAM,sBAAsB;;;;;;aAMjC,CAAA;AAGF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;0BAK/B,CAAA;AACF,MAAM,MAAM,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ema
|
|
|
11
11
|
}, undefined>, v.ObjectSchema<{
|
|
12
12
|
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
13
13
|
readonly block_id: v.CustomSchema<import("./ids.js").NotionBlockId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
14
|
+
}, undefined>, v.ObjectSchema<{
|
|
15
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
16
|
+
readonly agent_id: v.CustomSchema<import("./ids.js").NotionAgentId, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
14
17
|
}, undefined>], undefined>;
|
|
15
18
|
/**
|
|
16
19
|
* A record's parent reference.
|
|
@@ -20,6 +23,7 @@ export declare const notionParentSchema: v.VariantSchema<"type", [v.ObjectSchema
|
|
|
20
23
|
* - `block_id` — parented under a non-page container block (toggle, column, callout, ...).
|
|
21
24
|
* - `data_source_id` — parented under a collection (data source).
|
|
22
25
|
* - `workspace` — top-level / team-rooted.
|
|
26
|
+
* - `agent_id` — owned by an agent, such as an agent instruction page or its blocks.
|
|
23
27
|
*/
|
|
24
28
|
export type NotionParent = v.InferOutput<typeof notionParentSchema>;
|
|
25
29
|
//# sourceMappingURL=parent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parent.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/parent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"parent.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/parent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAQ5B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;0BAS7B,CAAA;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
|
package/dist/bridge/parent.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import { notionBlockIdSchema, notionDataSourceIdSchema, notionPageIdSchema, } from "./ids.js";
|
|
2
|
+
import { notionAgentIdSchema, notionBlockIdSchema, notionDataSourceIdSchema, notionPageIdSchema, } from "./ids.js";
|
|
3
3
|
export const notionParentSchema = v.variant("type", [
|
|
4
4
|
v.object({ type: v.literal("page_id"), page_id: notionPageIdSchema }),
|
|
5
5
|
v.object({
|
|
@@ -8,4 +8,5 @@ export const notionParentSchema = v.variant("type", [
|
|
|
8
8
|
}),
|
|
9
9
|
v.object({ type: v.literal("workspace"), workspace: v.literal(true) }),
|
|
10
10
|
v.object({ type: v.literal("block_id"), block_id: notionBlockIdSchema }),
|
|
11
|
+
v.object({ type: v.literal("agent_id"), agent_id: notionAgentIdSchema }),
|
|
11
12
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCustomBlockHost.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/host/createCustomBlockHost.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAY1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAkB/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAIzD,OAAO,KAAK,EACX,iCAAiC,EACjC,2BAA2B,EAE3B,mBAAmB,EACnB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EACX,uBAAuB,EACvB,2BAA2B,EAC3B,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,oBAAoB,CAAA;AAE9E,MAAM,MAAM,sBAAsB,GAAG;IACpC,MAAM,EAAE,iBAAiB,CAAA;IACzB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,YAAY,EAAE,2BAA2B,CAAA;IACzC,QAAQ,EAAE,uBAAuB,CAAA;IACjC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAA;IAChD,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,2BAA2B,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;CAC1E,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,IAAI,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC7C,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAA;IACtC,SAAS,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;IACzC,OAAO,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAA;IACxC,cAAc,EAAE,CAAC,WAAW,EAAE,iCAAiC,KAAK,IAAI,CAAA;IACxE,cAAc,EAAE,CAAC,WAAW,EAAE,UAAU,KAAK,IAAI,CAAA;IACjD,YAAY,EAAE,CAAC,IAAI,EAAE;QACpB,YAAY,EAAE,kBAAkB,CAAA;QAChC,QAAQ,EAAE,oCAAoC,CAAA;KAC9C,KAAK,IAAI,CAAA;CACV,CAAA;AAKD,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,sBAAsB,GAC7B,qBAAqB,
|
|
1
|
+
{"version":3,"file":"createCustomBlockHost.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/host/createCustomBlockHost.ts"],"names":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AY,KAAK,IAAI,CAAA;IACzC,OAAO,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAA;IACxC,cAAc,EAAE,CAAC,WAAW,EAAE,iCAAiC,KAAK,IAAI,CAAA;IACxE,cAAc,EAAE,CAAC,WAAW,EAAE,UAAU,KAAK,IAAI,CAAA;IACjD,YAAY,EAAE,CAAC,IAAI,EAAE;QACpB,YAAY,EAAE,kBAAkB,CAAA;QAChC,QAAQ,EAAE,oCAAoC,CAAA;KAC9C,KAAK,IAAI,CAAA;CACV,CAAA;AAKD,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,sBAAsB,GAC7B,qBAAqB,CAuTvB"}
|
|
@@ -25,6 +25,8 @@ export function createCustomBlockHost(options) {
|
|
|
25
25
|
iframe.contentWindow?.postMessage(message, targetOrigin);
|
|
26
26
|
}
|
|
27
27
|
function postQueryDataSourceResult(args) {
|
|
28
|
+
// TODO(custom-blocks): Update when bumping bridge protocol version to 3.
|
|
29
|
+
// Protocol v2 sandboxes require the legacy optional-error result shape.
|
|
28
30
|
const message = {
|
|
29
31
|
type: "queryDataSourceResult",
|
|
30
32
|
requestId: args.requestId,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { NotionDataSourcePageBridge } from "../../bridge/dataSources/dataSourcePage.js";
|
|
1
2
|
import type { QueryDataSourceMessage } from "../../bridge/messages/queryDataSource.js";
|
|
2
|
-
import type { CustomBlockQueryDataSourceErrorInfo
|
|
3
|
+
import type { CustomBlockQueryDataSourceErrorInfo } from "../../bridge/messages/queryDataSourceResult.js";
|
|
3
4
|
export type CustomBlockHostQueryDataSourceResult = {
|
|
4
|
-
items:
|
|
5
|
+
items: NotionDataSourcePageBridge[];
|
|
5
6
|
hasMore?: boolean;
|
|
6
7
|
error?: CustomBlockQueryDataSourceErrorInfo;
|
|
7
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/host/queries/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAA;AACtF,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/host/queries/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAA;AAC5F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAA;AACtF,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,gDAAgD,CAAA;AAEzG,MAAM,MAAM,oCAAoC,GAAG;IAClD,KAAK,EAAE,0BAA0B,EAAE,CAAA;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,mCAAmC,CAAA;CAC3C,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CACxC,sBAAsB,EACtB,WAAW,GAAG,YAAY,GAAG,OAAO,CACpC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export { NOTION_BUILTIN_PROPERTY_IDS, NOTION_PROPERTY_TYPES, } from "./bridge/da
|
|
|
16
16
|
export type { NotionRecordPointer } from "./bridge/dataSources/recordPointer.js";
|
|
17
17
|
export type { CustomBlockPropertyErrorCode, CustomBlockPropertyErrorInfo, } from "./bridge/dataSources/resolveProperty.js";
|
|
18
18
|
export type { CustomBlockErrorInfo } from "./bridge/errors.js";
|
|
19
|
-
export type { NotionBlockId, NotionDataSourceId, NotionSpaceId, } from "./bridge/ids.js";
|
|
19
|
+
export type { NotionAgentId, NotionBlockId, NotionDataSourceId, NotionSpaceId, } from "./bridge/ids.js";
|
|
20
20
|
export type { CustomBlockManifest, ManifestDataSource, ManifestIcon, ManifestProperty, } from "./bridge/manifest.js";
|
|
21
21
|
export type { NotionCreatePagePosition } from "./bridge/messages/createPage.js";
|
|
22
22
|
export type { CustomBlockCreatePageErrorCode, CustomBlockCreatePageErrorInfo, } from "./bridge/messages/createPageResult.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EACX,sBAAsB,EACtB,gBAAgB,GAChB,MAAM,oCAAoC,CAAA;AAC3C,YAAY,EACX,oBAAoB,EACpB,+BAA+B,EAC/B,gCAAgC,GAChC,MAAM,wCAAwC,CAAA;AAC/C,YAAY,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAA;AACpF,YAAY,EACX,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,GAClB,MAAM,mCAAmC,CAAA;AAC1C,YAAY,EACX,wCAAwC,EACxC,wCAAwC,GACxC,MAAM,gCAAgC,CAAA;AACvC,YAAY,EACX,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,GACjB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,EACN,2BAA2B,EAC3B,qBAAqB,GACrB,MAAM,wCAAwC,CAAA;AAC/C,YAAY,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAA;AAChF,YAAY,EACX,4BAA4B,EAC5B,4BAA4B,GAC5B,MAAM,yCAAyC,CAAA;AAChD,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,YAAY,EACX,aAAa,EACb,kBAAkB,EAClB,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,YAAY,EACX,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,GAChB,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAA;AAC/E,YAAY,EACX,8BAA8B,EAC9B,8BAA8B,GAC9B,MAAM,uCAAuC,CAAA;AAC9C,YAAY,EACX,2BAA2B,EAC3B,2BAA2B,GAC3B,MAAM,8BAA8B,CAAA;AACrC,YAAY,EACX,2BAA2B,EAC3B,2BAA2B,GAC3B,MAAM,8BAA8B,CAAA;AACrC,YAAY,EACX,wBAAwB,EACxB,wBAAwB,GACxB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,YAAY,EACX,6BAA6B,EAC7B,6BAA6B,GAC7B,MAAM,gCAAgC,CAAA;AACvC,YAAY,EACX,mCAAmC,EACnC,mCAAmC,GACnC,MAAM,4CAA4C,CAAA;AACnD,YAAY,EACX,8BAA8B,EAC9B,8BAA8B,GAC9B,MAAM,uCAAuC,CAAA;AAC9C,YAAY,EACX,UAAU,EACV,eAAe,EACf,cAAc,EACd,YAAY,EACZ,0BAA0B,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,GAC1B,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACxD,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,eAAe,EACf,gBAAgB,GAChB,MAAM,WAAW,CAAA;AAClB,cAAc,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,YAAY,EACX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ACrC,YAAY,EACX,wBAAwB,EACxB,wBAAwB,GACxB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,YAAY,EACX,6BAA6B,EAC7B,6BAA6B,GAC7B,MAAM,gCAAgC,CAAA;AACvC,YAAY,EACX,mCAAmC,EACnC,mCAAmC,GACnC,MAAM,4CAA4C,CAAA;AACnD,YAAY,EACX,8BAA8B,EAC9B,8BAA8B,GAC9B,MAAM,uCAAuC,CAAA;AAC9C,YAAY,EACX,UAAU,EACV,eAAe,EACf,cAAc,EACd,YAAY,EACZ,0BAA0B,EAC1B,4BAA4B,EAC5B,uBAAuB,EACvB,0BAA0B,GAC1B,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACxD,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,eAAe,EACf,gBAAgB,GAChB,MAAM,WAAW,CAAA;AAClB,cAAc,YAAY,CAAA"}
|
package/dist/version.js
CHANGED
package/docs/block-location.md
CHANGED
|
@@ -37,11 +37,28 @@ type NotionParent =
|
|
|
37
37
|
| { type: "page_id"; page_id: string } // inline custom block under a page
|
|
38
38
|
| { type: "block_id"; block_id: NotionBlockId } // inline custom block under a toggle/column/callout/...
|
|
39
39
|
| { type: "data_source_id"; data_source_id: string } // custom block backing a custom collection view
|
|
40
|
-
| { type: "workspace"; workspace: true }
|
|
40
|
+
| { type: "workspace"; workspace: true } // top-level block parented by a team / workspace
|
|
41
|
+
| { type: "agent_id"; agent_id: NotionAgentId }; // agent-owned instruction content
|
|
41
42
|
```
|
|
42
43
|
|
|
43
44
|
For non-React renderers, use `customBlock.getParent()` after `initCustomBlock()` resolves.
|
|
44
45
|
|
|
46
|
+
To identify custom blocks in agent-owned instruction content:
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
import { useParent } from "ncblock"
|
|
50
|
+
|
|
51
|
+
export function AgentInstructionBadge() {
|
|
52
|
+
const parent = useParent()
|
|
53
|
+
|
|
54
|
+
if (parent.type !== "agent_id") {
|
|
55
|
+
return null
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return <span>Agent: {parent.agent_id}</span>
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
45
62
|
### `usePage()`
|
|
46
63
|
|
|
47
64
|
Returns the nearest enclosing `page` / `collection_view_page` ancestor.
|
package/package.json
CHANGED
|
@@ -55,6 +55,7 @@ import type { NotionUser } from "./users/user.js"
|
|
|
55
55
|
* single host needs to support multiple custom blocks built with different versions of the bridge
|
|
56
56
|
* protocol. Increment this number any time a breaking change is made to the bridge protocol.
|
|
57
57
|
*/
|
|
58
|
+
// TODO(custom-blocks): Update when bumping bridge protocol version to 3.
|
|
58
59
|
export const CUSTOM_BLOCK_BRIDGE_PROTOCOL_VERSION = 2
|
|
59
60
|
|
|
60
61
|
/**
|
|
@@ -408,15 +409,33 @@ export class SandboxBridge {
|
|
|
408
409
|
if (currentState.latestRequestId !== message.requestId) {
|
|
409
410
|
return
|
|
410
411
|
}
|
|
412
|
+
const queryResult =
|
|
413
|
+
"status" in message
|
|
414
|
+
? message.status === "error"
|
|
415
|
+
? {
|
|
416
|
+
items: [],
|
|
417
|
+
hasMore: false,
|
|
418
|
+
error: message.error,
|
|
419
|
+
}
|
|
420
|
+
: {
|
|
421
|
+
items: message.items,
|
|
422
|
+
hasMore: message.hasMore,
|
|
423
|
+
error: undefined,
|
|
424
|
+
}
|
|
425
|
+
: {
|
|
426
|
+
items: message.items,
|
|
427
|
+
hasMore: message.hasMore,
|
|
428
|
+
error: message.error,
|
|
429
|
+
}
|
|
411
430
|
this.hostState = {
|
|
412
431
|
...hostState,
|
|
413
432
|
dataSourceState: {
|
|
414
433
|
...hostState.dataSourceState,
|
|
415
434
|
[key]: {
|
|
416
|
-
items:
|
|
435
|
+
items: queryResult.items,
|
|
417
436
|
isLoading: false,
|
|
418
|
-
hasMore:
|
|
419
|
-
error:
|
|
437
|
+
hasMore: queryResult.hasMore,
|
|
438
|
+
error: queryResult.error,
|
|
420
439
|
// Keep the request ID so later host-pushed refreshes for the
|
|
421
440
|
// same subscription still match.
|
|
422
441
|
latestRequestId: message.requestId,
|
package/src/bridge/ids.ts
CHANGED
|
@@ -3,6 +3,7 @@ import * as v from "valibot"
|
|
|
3
3
|
declare const notionDataSourceIdBrand: unique symbol
|
|
4
4
|
declare const notionBlockIdBrand: unique symbol
|
|
5
5
|
declare const notionPageIdBrand: unique symbol
|
|
6
|
+
declare const notionAgentIdBrand: unique symbol
|
|
6
7
|
declare const notionSpaceIdBrand: unique symbol
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -44,6 +45,19 @@ export const notionPageIdSchema = v.custom<NotionPageId>(
|
|
|
44
45
|
"Expected a Notion page ID",
|
|
45
46
|
)
|
|
46
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Branded Notion agent ID. Agent parents identify the workflow that owns an
|
|
50
|
+
* instruction page or one of its blocks.
|
|
51
|
+
*/
|
|
52
|
+
export type NotionAgentId = string & {
|
|
53
|
+
readonly [notionAgentIdBrand]: "NotionAgentId"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const notionAgentIdSchema = v.custom<NotionAgentId>(
|
|
57
|
+
value => typeof value === "string",
|
|
58
|
+
"Expected a Notion agent ID",
|
|
59
|
+
)
|
|
60
|
+
|
|
47
61
|
/**
|
|
48
62
|
* Branded Notion workspace/space ID. Host payloads and SDK APIs use plain strings at runtime,
|
|
49
63
|
* but the brand keeps space IDs from being accidentally mixed with other IDs in TypeScript.
|
|
@@ -9,7 +9,10 @@ import { invalidSandboxMessageSchema } from "./invalidSandboxMessage.js"
|
|
|
9
9
|
import { listUsersResultMessageSchema } from "./listUsers.js"
|
|
10
10
|
import { pageChangedMessageSchema } from "./pageChanged.js"
|
|
11
11
|
import { parentChangedMessageSchema } from "./parentChanged.js"
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
legacyQueryDataSourceResultMessageSchema,
|
|
14
|
+
statusQueryDataSourceResultMessageSchema,
|
|
15
|
+
} from "./queryDataSourceResult.js"
|
|
13
16
|
import { themeChangedMessageSchema } from "./themeChanged.js"
|
|
14
17
|
import { updatePageResultMessageSchema } from "./updatePageResult.js"
|
|
15
18
|
|
|
@@ -23,7 +26,8 @@ export const hostToSandboxMessageSchema = v.variant("type", [
|
|
|
23
26
|
pageChangedMessageSchema,
|
|
24
27
|
currentUserChangedMessageSchema,
|
|
25
28
|
dataSourcesChangedMessageSchema,
|
|
26
|
-
|
|
29
|
+
statusQueryDataSourceResultMessageSchema,
|
|
30
|
+
legacyQueryDataSourceResultMessageSchema,
|
|
27
31
|
createPageResultMessageSchema,
|
|
28
32
|
getPageResultMessageSchema,
|
|
29
33
|
getUserResultMessageSchema,
|
|
@@ -24,7 +24,7 @@ export const customBlockQueryDataSourceErrorInfoSchema = v.object({
|
|
|
24
24
|
/**
|
|
25
25
|
* Message sent by the host to the sandbox in response to a `queryDataSource` request.
|
|
26
26
|
*/
|
|
27
|
-
export const
|
|
27
|
+
export const legacyQueryDataSourceResultMessageSchema = v.object({
|
|
28
28
|
type: v.literal("queryDataSourceResult"),
|
|
29
29
|
requestId: v.string(),
|
|
30
30
|
snapshotId: v.string(),
|
|
@@ -33,6 +33,33 @@ export const queryDataSourceResultMessageSchema = v.object({
|
|
|
33
33
|
error: v.optional(customBlockQueryDataSourceErrorInfoSchema),
|
|
34
34
|
})
|
|
35
35
|
|
|
36
|
+
export const statusQueryDataSourceResultMessageSchema = v.variant("status", [
|
|
37
|
+
v.object({
|
|
38
|
+
type: v.literal("queryDataSourceResult"),
|
|
39
|
+
requestId: v.string(),
|
|
40
|
+
snapshotId: v.string(),
|
|
41
|
+
status: v.literal("success"),
|
|
42
|
+
items: v.array(notionDataSourcePageBridgeSchema),
|
|
43
|
+
hasMore: v.boolean(),
|
|
44
|
+
}),
|
|
45
|
+
v.object({
|
|
46
|
+
type: v.literal("queryDataSourceResult"),
|
|
47
|
+
requestId: v.string(),
|
|
48
|
+
snapshotId: v.string(),
|
|
49
|
+
status: v.literal("error"),
|
|
50
|
+
error: customBlockQueryDataSourceErrorInfoSchema,
|
|
51
|
+
}),
|
|
52
|
+
])
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* TODO(custom-blocks): Update when bumping bridge protocol version to 3.
|
|
56
|
+
* Protocol version 2 hosts and sandboxes use the legacy optional-error shape.
|
|
57
|
+
*/
|
|
58
|
+
export const queryDataSourceResultMessageSchema = v.union([
|
|
59
|
+
legacyQueryDataSourceResultMessageSchema,
|
|
60
|
+
statusQueryDataSourceResultMessageSchema,
|
|
61
|
+
])
|
|
62
|
+
|
|
36
63
|
export type QueryDataSourceResultMessage = v.InferOutput<
|
|
37
64
|
typeof queryDataSourceResultMessageSchema
|
|
38
65
|
>
|
package/src/bridge/parent.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as v from "valibot"
|
|
2
2
|
import {
|
|
3
|
+
notionAgentIdSchema,
|
|
3
4
|
notionBlockIdSchema,
|
|
4
5
|
notionDataSourceIdSchema,
|
|
5
6
|
notionPageIdSchema,
|
|
@@ -13,6 +14,7 @@ export const notionParentSchema = v.variant("type", [
|
|
|
13
14
|
}),
|
|
14
15
|
v.object({ type: v.literal("workspace"), workspace: v.literal(true) }),
|
|
15
16
|
v.object({ type: v.literal("block_id"), block_id: notionBlockIdSchema }),
|
|
17
|
+
v.object({ type: v.literal("agent_id"), agent_id: notionAgentIdSchema }),
|
|
16
18
|
])
|
|
17
19
|
|
|
18
20
|
/**
|
|
@@ -23,5 +25,6 @@ export const notionParentSchema = v.variant("type", [
|
|
|
23
25
|
* - `block_id` — parented under a non-page container block (toggle, column, callout, ...).
|
|
24
26
|
* - `data_source_id` — parented under a collection (data source).
|
|
25
27
|
* - `workspace` — top-level / team-rooted.
|
|
28
|
+
* - `agent_id` — owned by an agent, such as an agent instruction page or its blocks.
|
|
26
29
|
*/
|
|
27
30
|
export type NotionParent = v.InferOutput<typeof notionParentSchema>
|
|
@@ -115,6 +115,8 @@ export function createCustomBlockHost(
|
|
|
115
115
|
snapshotId: string
|
|
116
116
|
response: CustomBlockHostQueryDataSourceResult
|
|
117
117
|
}) {
|
|
118
|
+
// TODO(custom-blocks): Update when bumping bridge protocol version to 3.
|
|
119
|
+
// Protocol v2 sandboxes require the legacy optional-error result shape.
|
|
118
120
|
const message: QueryDataSourceResultMessage = {
|
|
119
121
|
type: "queryDataSourceResult",
|
|
120
122
|
requestId: args.requestId,
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import type { NotionDataSourcePageBridge } from "../../bridge/dataSources/dataSourcePage.js"
|
|
1
2
|
import type { QueryDataSourceMessage } from "../../bridge/messages/queryDataSource.js"
|
|
2
|
-
import type {
|
|
3
|
-
CustomBlockQueryDataSourceErrorInfo,
|
|
4
|
-
QueryDataSourceResultMessage,
|
|
5
|
-
} from "../../bridge/messages/queryDataSourceResult.js"
|
|
3
|
+
import type { CustomBlockQueryDataSourceErrorInfo } from "../../bridge/messages/queryDataSourceResult.js"
|
|
6
4
|
|
|
7
5
|
export type CustomBlockHostQueryDataSourceResult = {
|
|
8
|
-
items:
|
|
6
|
+
items: NotionDataSourcePageBridge[]
|
|
9
7
|
hasMore?: boolean
|
|
10
8
|
error?: CustomBlockQueryDataSourceErrorInfo
|
|
11
9
|
}
|