@notionhq/custom-blocks 0.1.22 → 0.1.24
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/bin/notion-custom-blocks/build.js +2 -2
- package/bin/notion-custom-blocks/tar.js +1 -1
- package/dist/bridge/dataSources/resolveProperty.d.ts +0 -1
- package/dist/bridge/dataSources/resolveProperty.d.ts.map +1 -1
- package/dist/bridge/sandboxClient.d.ts +0 -1
- package/dist/bridge/sandboxClient.d.ts.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/bridge/dataSources/resolveProperty.ts +0 -5
- package/src/bridge/sandboxClient.ts +0 -2
- package/src/types.ts +2 -2
|
@@ -3,8 +3,8 @@ import * as fs from "node:fs";
|
|
|
3
3
|
import * as path from "node:path";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import { packDirToTarGz } from "./tar.js";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const BUILD_OUTPUT_SENTINEL = "<__notion_custom_block__>";
|
|
7
|
+
const BUILD_OUTPUT_SENTINEL_CLOSE = "</__notion_custom_block__>";
|
|
8
8
|
const WORKER_ENTRY = "dist/index.js";
|
|
9
9
|
/**
|
|
10
10
|
* Build every `_tag: "custom_block"` view declared by the worker.
|
|
@@ -26,7 +26,7 @@ export function packDirToTarGz(dir) {
|
|
|
26
26
|
return { tarGz, checksumCrc32: crc32Base64(tarGz) };
|
|
27
27
|
}
|
|
28
28
|
/** Base64-encoded big-endian crc32, matching the server's `CRC32_BASE64_REGEX`. */
|
|
29
|
-
|
|
29
|
+
function crc32Base64(data) {
|
|
30
30
|
const checksum = zlib.crc32(data) >>> 0;
|
|
31
31
|
const buf = Buffer.alloc(4);
|
|
32
32
|
buf.writeUInt32BE(checksum);
|
|
@@ -2,7 +2,6 @@ import type { NotionDataSource } from "../../protocol/dataSources/dataSource.js"
|
|
|
2
2
|
import type { CustomBlockPropertyErrorInfo } from "../../protocol/dataSources/errors.js";
|
|
3
3
|
import type { NotionPagePropertyWriteMap } from "../../protocol/pages/page.js";
|
|
4
4
|
import type { NotionPagePropertyInputMap } from "../../types.js";
|
|
5
|
-
export type { CustomBlockPropertyErrorCode, CustomBlockPropertyErrorInfo, } from "../../protocol/dataSources/errors.js";
|
|
6
5
|
export type PropertyWriteMapResolutionResult = {
|
|
7
6
|
status: "success";
|
|
8
7
|
properties: NotionPagePropertyWriteMap;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveProperty.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/dataSources/resolveProperty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAA;AAClG,OAAO,KAAK,EAEX,4BAA4B,EAC5B,MAAM,wDAAwD,CAAA;AAC/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAA;AAGhG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAEhE,
|
|
1
|
+
{"version":3,"file":"resolveProperty.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/dataSources/resolveProperty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAA;AAClG,OAAO,KAAK,EAEX,4BAA4B,EAC5B,MAAM,wDAAwD,CAAA;AAC/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAA;AAGhG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAEhE,MAAM,MAAM,gCAAgC,GACzC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,0BAA0B,CAAA;CAAE,GAC7D;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,4BAA4B,CAAA;CAAE,CAAA;AAS3D;;;;;;GAMG;AACH,wBAAgB,oCAAoC,CAAC,IAAI,EAAE;IAC1D,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACxC,UAAU,EAAE,0BAA0B,CAAA;IACtC,aAAa,EAAE,MAAM,CAAA;CACrB,GAAG,gCAAgC,CAwDnC;AAED;;;GAGG;AACH,wBAAgB,sCAAsC,CAAC,IAAI,EAAE;IAC5D,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACxC,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;CACrB,GACE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,4BAA4B,CAAA;CAAE,CAsB1D"}
|
|
@@ -3,7 +3,6 @@ import type { CreatePageArgs, CreatePageResult, GetPageResult, GetUserResult, Li
|
|
|
3
3
|
import { type CustomBlockHostState, type DataSourceQueryView } from "./hostState.js";
|
|
4
4
|
import type { ManifestLoadResult } from "./loadManifest.js";
|
|
5
5
|
import { type MessageLogEntry } from "./SandboxBridge.js";
|
|
6
|
-
export type { MessageLogEntry };
|
|
7
6
|
export declare const customBlockHost: {
|
|
8
7
|
start: () => void;
|
|
9
8
|
sendConnect: (manifestResult: ManifestLoadResult) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandboxClient.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/sandboxClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAA;AACpF,OAAO,KAAK,EACX,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,aAAa,CAAA;AACpB,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAExB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"sandboxClient.d.ts","sourceRoot":"","sources":["../../../../home/runner/work/custom-blocks/custom-blocks/sdk/src/bridge/sandboxClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAA;AACpF,OAAO,KAAK,EACX,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,aAAa,CAAA;AACpB,OAAO,EACN,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EAExB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,KAAK,eAAe,EAAiB,MAAM,oBAAoB,CAAA;AAWxE,eAAO,MAAM,eAAe;;kCAKG,kBAAkB;yBAI3B,WAAW,KAAG,OAAO,CAAC,IAAI,CAAC;0BAI1B,MAAM,IAAI;oBAIlB,oBAAoB;IAIlC;;;OAGG;4BACqB,WAAW;;yBAQd,MAAM;CAG3B,CAAA;AAED,eAAO,MAAM,sBAAsB;iBACrB,MAAM,YAAY,oBAAoB;yBAKvC,oBAAoB,OAC1B,MAAM,KACT,mBAAmB;CAKtB,CAAA;AAED,eAAO,MAAM,UAAU;uBACL,SAAS,eAAe,EAAE;0BAIrB,MAAM,IAAI;CAGhC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,KAAK;IACjB;;OAEG;oBACa,cAAc,KAAG,OAAO,CAAC,gBAAgB,CAAC;IAI1D;;OAEG;kBACW,YAAY,KAAG,OAAO,CAAC,aAAa,CAAC;IAInD;;OAEG;oBACa,cAAc,KAAG,OAAO,CAAC,gBAAgB,CAAC;IAI1D;;OAEG;qBACc,YAAY,KAAG,OAAO,CAAC,gBAAgB,CAAC;CAGzD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,KAAK;IACjB;;OAEG;mBACY,aAAa,KAAG,OAAO,CAAC,eAAe,CAAC;IAIvD;;OAEG;kBACW,YAAY,KAAG,OAAO,CAAC,aAAa,CAAC;CAGnD,CAAA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -86,8 +86,8 @@ export type NotionDataSourcePageUpdateResult = UpdatePageResult;
|
|
|
86
86
|
export type UseDataSourceResult = {
|
|
87
87
|
items: NotionDataSourcePage[];
|
|
88
88
|
/**
|
|
89
|
-
* Collection/data
|
|
90
|
-
* schemas. Undefined when the semantic data
|
|
89
|
+
* Collection/data source schema for the bound Notion data source, including raw property
|
|
90
|
+
* schemas. Undefined when the semantic data source key has not been bound.
|
|
91
91
|
*/
|
|
92
92
|
collectionSchema?: NotionCollectionSchema;
|
|
93
93
|
/**
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -8,11 +8,6 @@ import { notionPagePropertyValueSchema } from "@notionhq/custom-blocks-protocol/
|
|
|
8
8
|
import * as v from "valibot"
|
|
9
9
|
import type { NotionPagePropertyInputMap } from "../../types.js"
|
|
10
10
|
|
|
11
|
-
export type {
|
|
12
|
-
CustomBlockPropertyErrorCode,
|
|
13
|
-
CustomBlockPropertyErrorInfo,
|
|
14
|
-
} from "@notionhq/custom-blocks-protocol/dataSources/errors.js"
|
|
15
|
-
|
|
16
11
|
export type PropertyWriteMapResolutionResult =
|
|
17
12
|
| { status: "success"; properties: NotionPagePropertyWriteMap }
|
|
18
13
|
| { status: "error"; error: CustomBlockPropertyErrorInfo }
|
|
@@ -20,8 +20,6 @@ import {
|
|
|
20
20
|
import type { ManifestLoadResult } from "./loadManifest.js"
|
|
21
21
|
import { type MessageLogEntry, SandboxBridge } from "./SandboxBridge.js"
|
|
22
22
|
|
|
23
|
-
export type { MessageLogEntry }
|
|
24
|
-
|
|
25
23
|
let bridge: SandboxBridge | undefined
|
|
26
24
|
|
|
27
25
|
function getBridge(): SandboxBridge {
|
package/src/types.ts
CHANGED
|
@@ -128,8 +128,8 @@ export type NotionDataSourcePageUpdateResult = UpdatePageResult
|
|
|
128
128
|
export type UseDataSourceResult = {
|
|
129
129
|
items: NotionDataSourcePage[]
|
|
130
130
|
/**
|
|
131
|
-
* Collection/data
|
|
132
|
-
* schemas. Undefined when the semantic data
|
|
131
|
+
* Collection/data source schema for the bound Notion data source, including raw property
|
|
132
|
+
* schemas. Undefined when the semantic data source key has not been bound.
|
|
133
133
|
*/
|
|
134
134
|
collectionSchema?: NotionCollectionSchema
|
|
135
135
|
/**
|