@notionhq/custom-blocks 0.2.21 → 0.2.22
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/README.md +2 -0
- package/dist/bridge/SandboxBridge.d.ts +14 -18
- package/dist/bridge/SandboxBridge.d.ts.map +1 -1
- package/dist/bridge/SandboxBridge.js +59 -201
- package/dist/bridge/SandboxInitialization.d.ts +52 -0
- package/dist/bridge/SandboxInitialization.d.ts.map +1 -0
- package/dist/bridge/SandboxInitialization.js +217 -0
- package/dist/bridge/dataSources/query.d.ts.map +1 -1
- package/dist/bridge/dataSources/query.js +30 -23
- package/dist/bridge/messageInterceptor.d.ts +4 -0
- package/dist/bridge/messageInterceptor.d.ts.map +1 -0
- package/dist/bridge/messageInterceptor.js +1 -0
- package/dist/bridge/sandboxClient.d.ts +3 -2
- package/dist/bridge/sandboxClient.d.ts.map +1 -1
- package/dist/bridge/sandboxClient.js +3 -5
- package/dist/bridge.d.ts +11 -0
- package/dist/bridge.d.ts.map +1 -0
- package/dist/bridge.js +11 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/init.d.ts +4 -38
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +4 -91
- package/dist/initTypes.d.ts +31 -0
- package/dist/initTypes.d.ts.map +1 -0
- package/dist/initTypes.js +18 -0
- package/dist/protocol/dataSources/propertySchema.d.ts +1 -1
- package/dist/protocol/dataSources/propertySchema.js +2 -0
- package/dist/protocol/dataSources/sortDirection.d.ts +3 -0
- package/dist/protocol/dataSources/sortDirection.js +2 -0
- package/dist/protocol/index.d.ts +1 -0
- package/dist/protocol/index.js +1 -0
- package/dist/protocol/messages/hostToSandbox.d.ts +0 -3
- package/dist/protocol/messages/init.d.ts +1 -1
- package/dist/protocol/messages/queryDataSource.d.ts +259 -47
- package/dist/protocol/messages/queryDataSource.js +94 -8
- package/dist/protocol/messages/sandboxToHost.d.ts +80 -16
- package/dist/styles/nds.css +1 -1
- package/dist/types.d.ts +5 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/docs/bridge-interceptors.md +27 -0
- package/docs/data-sources.md +80 -13
- package/docs/errors.md +2 -0
- package/docs/pages.md +22 -10
- package/package.json +4 -4
- package/src/bridge/SandboxBridge.ts +74 -239
- package/src/bridge/SandboxInitialization.ts +295 -0
- package/src/bridge/dataSources/query.ts +38 -25
- package/src/bridge/messageInterceptor.ts +6 -0
- package/src/bridge/sandboxClient.ts +6 -5
- package/src/bridge.ts +17 -0
- package/src/index.ts +1 -0
- package/src/init.ts +8 -119
- package/src/initTypes.ts +43 -0
- package/src/styles/nds.css +1 -1
- package/src/styles/nds.css.metadata.json +3 -3
- package/src/types.ts +6 -2
- package/dist/bridge/primedResponses.d.ts +0 -8
- package/dist/bridge/primedResponses.d.ts.map +0 -1
- package/dist/bridge/primedResponses.js +0 -5
- package/dist/testing.d.ts +0 -12
- package/dist/testing.d.ts.map +0 -1
- package/dist/testing.js +0 -9
- package/src/bridge/primedResponses.ts +0 -11
- package/src/testing.ts +0 -19
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { NotionCollectionSchema } from "./protocol/dataSources/dataSource.js";
|
|
2
2
|
import type { NotionDataSourceValue } from "./protocol/dataSources/dataSourceValue.js";
|
|
3
3
|
import type { NotionPropertySchema } from "./protocol/dataSources/propertySchema.js";
|
|
4
|
+
import type { NotionSortDirection } from "./protocol/dataSources/sortDirection.js";
|
|
4
5
|
import type { NotionDataSourceId, NotionPageId } from "./protocol/ids.js";
|
|
5
6
|
import type { NotionCreatePagePosition } from "./protocol/messages/createPage.js";
|
|
6
7
|
import type { CreatePageResultMessage, CustomBlockCreatePageErrorInfo } from "./protocol/messages/createPageResult.js";
|
|
@@ -9,7 +10,7 @@ import type { CustomBlockGetUserErrorInfo, GetUserResultMessage } from "./protoc
|
|
|
9
10
|
import type { CustomBlockListUsersErrorInfo, ListUsersMessage, ListUsersResultMessage } from "./protocol/messages/listUsers.js";
|
|
10
11
|
import type { BridgeMessagePayload } from "./protocol/messages/messagePayload.js";
|
|
11
12
|
import type { CustomBlockOpenPageErrorInfo, OpenPageMode, OpenPageResultMessage } from "./protocol/messages/openPage.js";
|
|
12
|
-
import type { CustomBlockCheckboxFilterOperator, CustomBlockContainsFilterOperator, CustomBlockCreatedByFilterOperator, CustomBlockDateFilterOperator, CustomBlockNumberFilterOperator, CustomBlockOptionFilterOperator, CustomBlockPeopleFilterOperator, CustomBlockPersonFilterValue, CustomBlockTextFilterOperator } from "./protocol/messages/queryDataSource.js";
|
|
13
|
+
import type { CustomBlockCheckboxFilterOperator, CustomBlockContainsFilterOperator, CustomBlockCreatedByFilterOperator, CustomBlockDateFilterOperator, CustomBlockNumberFilterOperator, CustomBlockOptionFilterOperator, CustomBlockPeopleFilterOperator, CustomBlockPersonFilterValue, CustomBlockStatusFilterOperator, CustomBlockTextFilterOperator } from "./protocol/messages/queryDataSource.js";
|
|
13
14
|
import type { CustomBlockQueryDataSourceErrorInfo } from "./protocol/messages/queryDataSourceResult.js";
|
|
14
15
|
import type { UpdatePageMessage } from "./protocol/messages/updatePage.js";
|
|
15
16
|
import type { CustomBlockUpdatePageErrorInfo, UpdatePageResultMessage } from "./protocol/messages/updatePageResult.js";
|
|
@@ -78,6 +79,7 @@ export type NotionDataSourceTextFilterOperator = ExclusiveUnion<CustomBlockTextF
|
|
|
78
79
|
export type NotionDataSourceNumberFilterOperator = ExclusiveUnion<CustomBlockNumberFilterOperator>;
|
|
79
80
|
export type NotionDataSourceCheckboxFilterOperator = ExclusiveUnion<CustomBlockCheckboxFilterOperator>;
|
|
80
81
|
export type NotionDataSourceOptionFilterOperator = ExclusiveUnion<CustomBlockOptionFilterOperator>;
|
|
82
|
+
export type NotionDataSourceStatusFilterOperator = ExclusiveUnion<CustomBlockStatusFilterOperator>;
|
|
81
83
|
export type NotionDataSourceContainsFilterOperator = ExclusiveUnion<CustomBlockContainsFilterOperator>;
|
|
82
84
|
export type NotionDataSourceDateFilterOperator = ExclusiveUnion<CustomBlockDateFilterOperator>;
|
|
83
85
|
export type NotionDataSourceCreatedByFilterOperator = ExclusiveUnion<CustomBlockCreatedByFilterOperator>;
|
|
@@ -109,7 +111,7 @@ export type NotionDataSourcePropertyFilter = NotionDataSourcePropertyAddress & E
|
|
|
109
111
|
} | {
|
|
110
112
|
multi_select: NotionDataSourceContainsFilterOperator;
|
|
111
113
|
} | {
|
|
112
|
-
status:
|
|
114
|
+
status: NotionDataSourceStatusFilterOperator;
|
|
113
115
|
} | {
|
|
114
116
|
date: NotionDataSourceDateFilterOperator;
|
|
115
117
|
} | {
|
|
@@ -118,7 +120,7 @@ export type NotionDataSourcePropertyFilter = NotionDataSourcePropertyAddress & E
|
|
|
118
120
|
created_by: NotionDataSourceCreatedByFilterOperator;
|
|
119
121
|
}>;
|
|
120
122
|
export type NotionDataSourceSort = NotionDataSourcePropertyAddress & {
|
|
121
|
-
direction:
|
|
123
|
+
direction: NotionSortDirection;
|
|
122
124
|
};
|
|
123
125
|
export type NotionDataSourceFilter = ExclusiveUnion<NotionDataSourcePropertyFilter | {
|
|
124
126
|
and: NotionDataSourcePropertyFilter[];
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAA;AACxG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iEAAiE,CAAA;AAC5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAC1G,OAAO,KAAK,EACX,kBAAkB,EAClB,YAAY,EACZ,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yDAAyD,CAAA;AACvG,OAAO,KAAK,EACX,uBAAuB,EACvB,8BAA8B,EAC9B,MAAM,+D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cAAc,GAAG;IAC5B,MAAM,EAAE,gBAAgB,CAAA;IACxB,UAAU,EAAE,0BAA0B,CAAA;IACtC,QAAQ,CAAC,EAAE,wBAAwB,CAAA;CACnC,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAClD,uBAAuB,EACvB,8BAA8B,CAC9B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,CAChC,iBAAiB,EACjB,MAAM,GAAG,WAAW,GAAG,UAAU,CACjC,GAAG;IACH,oCAAoC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,oBAAoB,CAC/C,oBAAoB,EACpB,2BAA2B,CAC3B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,YAAY,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,oBAAoB,CAChD,qBAAqB,EACrB,4BAA4B,CAC5B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAClD,uBAAuB,EACvB,8BAA8B,CAC9B,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,WAAW,CAAC,CAAA;AAExE,MAAM,MAAM,eAAe,GAAG,oBAAoB,CACjD,sBAAsB,EACtB,6BAA6B,CAC7B,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,oBAAoB,CAC/C,oBAAoB,EACpB,2BAA2B,CAC3B,CAAA"}
|
package/dist/version.js
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Bridge message interceptors
|
|
2
|
+
|
|
3
|
+
Import `registerMessageInterceptor` from `@notionhq/custom-blocks/bridge` to inspect or replace SDK
|
|
4
|
+
messages sent to the host. The function accepts a `MessageInterceptor` and returns a function that
|
|
5
|
+
removes it.
|
|
6
|
+
|
|
7
|
+
An interceptor receives a sandbox-to-host message. Return `undefined` to let the next interceptor
|
|
8
|
+
inspect it. Return a host-to-sandbox message to replace it. The SDK validates and processes the
|
|
9
|
+
replacement through its normal response path. The first interceptor that returns a response wins.
|
|
10
|
+
Later interceptors do not receive that message. The SDK sends the request to the host if no
|
|
11
|
+
interceptor returns a response.
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { registerMessageInterceptor } from "@notionhq/custom-blocks/bridge"
|
|
15
|
+
|
|
16
|
+
const remove = registerMessageInterceptor(message => {
|
|
17
|
+
console.log(message.type)
|
|
18
|
+
return undefined
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
// Remove the interceptor when it is no longer needed.
|
|
22
|
+
remove()
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Register the interceptor before the SDK call that it must handle. A replacement response must use
|
|
26
|
+
the correct message type and request ID or subscription ID. The SDK does not send an intercepted
|
|
27
|
+
request to the host.
|
package/docs/data-sources.md
CHANGED
|
@@ -192,6 +192,19 @@ are unsupported. An empty `and` group applies no conditions. Both APIs accept th
|
|
|
192
192
|
|
|
193
193
|
The SDK reports invalid keys, types, operators, and values through the snapshot's `error` field.
|
|
194
194
|
|
|
195
|
+
Use stored Status group names with either subscription API:
|
|
196
|
+
|
|
197
|
+
```tsx
|
|
198
|
+
const snapshot = useDataSource("records", {
|
|
199
|
+
filter: {
|
|
200
|
+
key: "status",
|
|
201
|
+
status: { group_equals: ["To-do", "In progress"] },
|
|
202
|
+
},
|
|
203
|
+
})
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Use `group_does_not_equal` to exclude every listed group. A raw `propertyId` can replace the key.
|
|
207
|
+
|
|
195
208
|
Creator filters require an actual **Created by** column in the bound database. The column can have
|
|
196
209
|
any name. In this example, `creator` is a declared property key mapped to that column:
|
|
197
210
|
|
|
@@ -217,13 +230,16 @@ address a Created by column.
|
|
|
217
230
|
| `title`, `rich_text`, `url`, `email`, `phone_number` | `equals`, `does_not_equal`, `contains`, `does_not_contain`, `starts_with`, `ends_with`, `is_empty`, `is_not_empty` |
|
|
218
231
|
| `number` | `equals`, `does_not_equal`, `greater_than`, `less_than`, `greater_than_or_equal_to`, `less_than_or_equal_to`, `is_empty`, `is_not_empty` |
|
|
219
232
|
| `checkbox` | `equals`, `does_not_equal` |
|
|
220
|
-
| `select
|
|
233
|
+
| `select` | `equals`, `does_not_equal`, `is_empty`, `is_not_empty` |
|
|
234
|
+
| `status` | `equals`, `does_not_equal`, `group_equals`, `group_does_not_equal`, `is_empty`, `is_not_empty` |
|
|
221
235
|
| `multi_select` | `contains`, `contains_all`, `does_not_contain`, `is_empty`, `is_not_empty` |
|
|
222
|
-
| `date` | `equals`, `before`, `after`, `on_or_before`, `on_or_after`, `is_empty`, `is_not_empty`
|
|
236
|
+
| `date` | `equals`, `before`, `after`, `on_or_before`, `on_or_after`, relative ranges, `is_empty`, `is_not_empty` |
|
|
223
237
|
| `people` | `contains`, `does_not_contain`, `is_empty`, `is_not_empty` |
|
|
224
238
|
| `created_by` | `contains`, `does_not_contain`, `is_empty`, `is_not_empty` |
|
|
225
239
|
|
|
226
240
|
- Select, multi-select, and status filters accept one option name or an array of option names.
|
|
241
|
+
- Status group filters accept one stored group name or an array of 1–5 names. Inclusion matches any
|
|
242
|
+
listed group. Exclusion rejects every listed group and keeps empty Status values.
|
|
227
243
|
- For multi-select filters, `contains` matches **any** supplied option. `contains_all` requires
|
|
228
244
|
**every** supplied option.
|
|
229
245
|
- People filters accept one explicit reference to a human user or a group. Use
|
|
@@ -236,9 +252,53 @@ address a Created by column.
|
|
|
236
252
|
- Empty checks use `{ is_empty: true }` or `{ is_not_empty: true }`.
|
|
237
253
|
- Date comparisons accept ISO date strings or timestamps. Notion evaluates timestamps at minute
|
|
238
254
|
precision.
|
|
255
|
+
- Date comparisons accept `target: "start_date" | "end_date"` beside the operator. The default is
|
|
256
|
+
`start_date`.
|
|
257
|
+
- For ranges, `end_date` compares the range end. For individual dates, it compares the date.
|
|
258
|
+
- An `end_date` comparison does not test range overlap.
|
|
259
|
+
- Date empty checks accept either target, but they test the whole property.
|
|
260
|
+
- Date comparisons accept ISO values and `today`, `tomorrow`, `yesterday`, `one_week_ago`,
|
|
261
|
+
`one_week_from_now`, `one_month_ago`, or `one_month_from_now`.
|
|
262
|
+
- Date ranges use an empty object. They support `past` and `next` for weeks, months, and years, plus
|
|
263
|
+
`this_week`.
|
|
264
|
+
- `this_week` includes the full calendar week. The host applies its time zone and week start.
|
|
265
|
+
- Relative filters use the current date when the host evaluates the query.
|
|
266
|
+
|
|
267
|
+
| Period | Week | Month | Year |
|
|
268
|
+
| ------ | ----------- | ------------ | ----------- |
|
|
269
|
+
| Past | `past_week` | `past_month` | `past_year` |
|
|
270
|
+
| This | `this_week` | — | — |
|
|
271
|
+
| Next | `next_week` | `next_month` | `next_year` |
|
|
272
|
+
|
|
273
|
+
Use `temporal-polyfill` to calculate an ISO 8601 date when no relative value or range operator
|
|
274
|
+
matches your query.
|
|
239
275
|
|
|
240
276
|
</details>
|
|
241
277
|
|
|
278
|
+
Both subscription APIs support the same date target:
|
|
279
|
+
|
|
280
|
+
```ts
|
|
281
|
+
const unsubscribe = customBlock.subscribeToDataSource({
|
|
282
|
+
key: "tasks",
|
|
283
|
+
onSnapshot: snapshot => render(snapshot),
|
|
284
|
+
options: {
|
|
285
|
+
filter: {
|
|
286
|
+
key: "schedule",
|
|
287
|
+
date: { target: "end_date", after: "2026-10-08" },
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
})
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
```tsx
|
|
294
|
+
const query = useDataSource("tasks", {
|
|
295
|
+
filter: {
|
|
296
|
+
key: "schedule",
|
|
297
|
+
date: { target: "end_date", after: "2026-10-08" },
|
|
298
|
+
},
|
|
299
|
+
})
|
|
300
|
+
```
|
|
301
|
+
|
|
242
302
|
### Sorts
|
|
243
303
|
|
|
244
304
|
Use `sorts` to order matching rows. Sorts do not support every property type yet, including some
|
|
@@ -264,6 +324,11 @@ taking priority. Empty values sort last in both directions.
|
|
|
264
324
|
You can sort by up to 10 unique properties. Both APIs accept the same sort shape, and you can
|
|
265
325
|
combine `sorts` with `filter`.
|
|
266
326
|
|
|
327
|
+
Every sort uses one property address and an `ascending` or `descending` direction.
|
|
328
|
+
`NotionSortDirection` defines these directions for `NotionDataSourceSort`. People and Created by
|
|
329
|
+
properties use native name ordering. No person attribute target is required. Created by sorts
|
|
330
|
+
require an actual Created by column in the database schema.
|
|
331
|
+
|
|
267
332
|
## Pages within a data source
|
|
268
333
|
|
|
269
334
|
Each row returned by either API is a `NotionDataSourcePage` —
|
|
@@ -438,9 +503,9 @@ This table shows property support for custom blocks running in Notion.
|
|
|
438
503
|
| `phone_number` | 🟢 String | 🟢 Supported | 🟢 Supported | 🟢 Supported |
|
|
439
504
|
| `select` | 🟢 Option name | 🟡 Set value only | 🟢 Supported | 🔴 Unavailable |
|
|
440
505
|
| `multi_select` | 🟢 Array of option names | 🟡 Set values only | 🟢 Supported | 🔴 Unavailable |
|
|
441
|
-
| `status` | 🟢 Option name | 🟡 Set value only |
|
|
442
|
-
| `date` | 🟢 `NotionDateValue` | 🟡 Minute precision |
|
|
443
|
-
| `people` | 🟢 Array of record pointers | 🟢 Supported | 🟢 Supported |
|
|
506
|
+
| `status` | 🟢 Option name | 🟡 Set value only | 🟢 Option names, group names, or empty checks | 🔴 Unavailable |
|
|
507
|
+
| `date` | 🟢 `NotionDateValue` | 🟡 Minute precision | 🟢 Supported | 🟢 Supported |
|
|
508
|
+
| `people` | 🟢 Array of record pointers | 🟢 Supported | 🟢 Supported | 🟢 Native name ordering |
|
|
444
509
|
| `files` | 🟡 Text fallback | 🟡 File URLs only | 🔴 Unavailable | 🔴 Unavailable |
|
|
445
510
|
| `unique_id` | 🟡 Text fallback | 🔴 Unavailable | 🔴 Unavailable | 🔴 Unavailable |
|
|
446
511
|
| `relation` | 🟢 Array of record pointers | 🟡 Replaces value. Rejects `has_more: true`. | 🔴 Unavailable | 🔴 Unavailable for standard relations. ⚫ Notion cannot sort XLDB targets. |
|
|
@@ -453,7 +518,7 @@ This table shows property support for custom blocks running in Notion.
|
|
|
453
518
|
| `location` | 🟡 Text fallback | 🔴 Unavailable | 🔴 Unavailable elsewhere. ⚫ Notion disables filters in My Meetings and Library system databases. | 🔴 Unavailable elsewhere. ⚫ Notion disables sorts in Library system databases. |
|
|
454
519
|
| `created_time` | 🟢 `NotionDateTime` in UTC | 🔴 Unavailable | 🔴 Unavailable | 🟡 Schema property only |
|
|
455
520
|
| `last_edited_time` | 🟢 `NotionDateTime` in UTC | 🔴 Unavailable | 🔴 Unavailable | 🟡 Schema property only |
|
|
456
|
-
| `created_by` | 🟢 Array of record pointers | 🔴 Unavailable | 🟡 Schema-backed creator filters |
|
|
521
|
+
| `created_by` | 🟢 Array of record pointers | 🔴 Unavailable | 🟡 Schema-backed creator filters | 🟡 Schema property only |
|
|
457
522
|
| `last_edited_by` | 🟢 Array of record pointers | 🔴 Unavailable | 🔴 Unavailable | 🔴 Unavailable |
|
|
458
523
|
|
|
459
524
|
### Notes
|
|
@@ -471,10 +536,11 @@ This table shows property support for custom blocks running in Notion.
|
|
|
471
536
|
reference that property's ID. The synthetic `created_time` field returned with every row is
|
|
472
537
|
read-only metadata and cannot be used when querying.
|
|
473
538
|
- You can sort by up to 10 unique properties.
|
|
474
|
-
- Date-time filter values may include seconds or milliseconds
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
-
|
|
539
|
+
- Date-time filter values may include seconds or milliseconds. The Notion host evaluates them at
|
|
540
|
+
minute precision. Date filters do not expose end-date targeting.
|
|
541
|
+
- Status group filters use stored English group names. The SDK does not normalize localized names.
|
|
542
|
+
- `group_equals` matches any listed group. `group_does_not_equal` excludes all listed groups.
|
|
543
|
+
- Empty group arrays and unknown group names return a nonretryable query error.
|
|
478
544
|
- People properties return record pointers with table values of `notion_user`,
|
|
479
545
|
`space_permission_group`, `bot`, or `organization_bot`. Group IDs use the composite form
|
|
480
546
|
`groupId|workspaceId`. People filters support users and groups. Bot and organization bot filtering
|
|
@@ -537,11 +603,12 @@ See [Pages property support](./pages.md#property-support) for the page-property
|
|
|
537
603
|
- `NotionDataSourcePropertyFilter` — one property address combined with a type-specific operator.
|
|
538
604
|
- `NotionDataSourcePropertyAddress` — either a semantic property `key` or a raw `propertyId`.
|
|
539
605
|
- `NotionDataSourceSort` — a property address with an `ascending` or `descending` direction.
|
|
606
|
+
- `NotionSortDirection` — the shared `"ascending" | "descending"` direction type.
|
|
540
607
|
- `NotionDataSourceTextFilterOperator`, `NotionDataSourceNumberFilterOperator`,
|
|
541
608
|
`NotionDataSourceCheckboxFilterOperator`, `NotionDataSourceOptionFilterOperator`,
|
|
542
|
-
`
|
|
543
|
-
`NotionDataSourcePeopleFilterOperator`, and
|
|
544
|
-
operators accepted for each property type.
|
|
609
|
+
`NotionDataSourceStatusFilterOperator`, `NotionDataSourceContainsFilterOperator`,
|
|
610
|
+
`NotionDataSourceDateFilterOperator`, `NotionDataSourcePeopleFilterOperator`, and
|
|
611
|
+
`NotionDataSourceCreatedByFilterOperator` — the operators accepted for each property type.
|
|
545
612
|
- `NotionDataSourcePersonFilterValue` — an explicit `{ object: "user" | "group", id }` reference
|
|
546
613
|
used by a people filter.
|
|
547
614
|
- `DataSourceSnapshot` — current rows, schema, and status for one live data-source query.
|
package/docs/errors.md
CHANGED
|
@@ -74,6 +74,8 @@ Initialization errors have direction-specific meanings:
|
|
|
74
74
|
valid `init` message. The SDK sends this code in `initResult.error`.
|
|
75
75
|
- `invalid_init_result_payload` means that the host could not parse the SDK's `initResult`. This is
|
|
76
76
|
a host-local error. The SDK does not send this code.
|
|
77
|
+
- `initial_state_timeout` means that the host could not prepare the initial state before its
|
|
78
|
+
timeout.
|
|
77
79
|
- `no_init_result` means that the host did not receive a valid `initResult` before its timeout.
|
|
78
80
|
|
|
79
81
|
See [Lifecycle and initialization](./lifecycle.md) for initialization-specific error codes.
|
package/docs/pages.md
CHANGED
|
@@ -215,12 +215,12 @@ and a property in its schema.
|
|
|
215
215
|
| `url` | 🟢 String or `null` | 🟢 Supported | 🟢 Supported |
|
|
216
216
|
| `email` | 🟢 String or `null` | 🟢 Supported | 🟢 Supported |
|
|
217
217
|
| `phone_number` | 🟢 String or `null` | 🟢 Supported | 🟢 Supported |
|
|
218
|
-
| `select` | 🟡
|
|
219
|
-
| `multi_select` | 🟡
|
|
220
|
-
| `status` | 🟡
|
|
218
|
+
| `select` | 🟡 Does not return available options | 🟡 Set value only | 🟡 Set value only |
|
|
219
|
+
| `multi_select` | 🟡 Does not return available options | 🟡 Set value only | 🟡 Set value only |
|
|
220
|
+
| `status` | 🟡 Does not return available options | 🟡 Set value only | 🟡 Set value only |
|
|
221
221
|
| `date` | 🟢 `start` and optional `end` strings, or `null` | 🟡 Minute precision | 🟡 Minute precision |
|
|
222
222
|
| `people` | 🟢 Array of user/group ID objects | 🟢 Supported | 🟢 Supported |
|
|
223
|
-
| `files` |
|
|
223
|
+
| `files` | 🟢 External links and hosted files | 🟡 File URLs only | 🟡 File URLs only |
|
|
224
224
|
| `unique_id` | 🔴 Unavailable | 🔴 Unavailable | 🔴 Unavailable |
|
|
225
225
|
| `relation` | 🟢 Array of page ID objects | 🟡 Replaces value. Rejects `has_more: true`. | 🟡 Replaces value. Rejects `has_more: true`. |
|
|
226
226
|
| `place` | 🟢 Coordinates and optional place details, or `null` | 🟢 Supported | 🟢 Supported |
|
|
@@ -237,15 +237,16 @@ and a property in its schema.
|
|
|
237
237
|
|
|
238
238
|
### Notes
|
|
239
239
|
|
|
240
|
-
- Select, multi-select, and status reads return option names
|
|
241
|
-
|
|
242
|
-
selected value. They do not edit option definitions
|
|
243
|
-
|
|
240
|
+
- Select, multi-select, and status reads return option names and colors when available. They also
|
|
241
|
+
return IDs when the options match the schema. Writes accept an existing option ID or a name and
|
|
242
|
+
set the selected value. They do not edit option definitions. If you supply both an ID and a name,
|
|
243
|
+
the host uses the ID. The host rejects unknown IDs.
|
|
244
244
|
- Date-time writes preserve hours and minutes but discard seconds and milliseconds.
|
|
245
245
|
- Title and rich text use text arrays, but reads and writes preserve only plain text. Reads and
|
|
246
246
|
writes do not preserve formatting, links, mentions, or equations as structured rich text.
|
|
247
|
-
-
|
|
248
|
-
|
|
247
|
+
- `pages.get` resolves Files links and readable file/image/pdf/audio/video references that have a
|
|
248
|
+
source. Create/update responses include link items only. File writes accept `external` URLs and
|
|
249
|
+
existing `file` URLs and store them as links. Upload references (`file_upload`) are unsupported.
|
|
249
250
|
- Relation writes replace the value and reject `has_more: true`.
|
|
250
251
|
- `created_time` and `last_edited_time` are read-only top-level fields on `page`, when available.
|
|
251
252
|
The host omits them from `page.properties`. The host does not return `created_by` or
|
|
@@ -296,3 +297,14 @@ navigation; it does not wait for route-leave confirmation or for the page to fin
|
|
|
296
297
|
surface that cannot host the requested peek may fall back to full-page navigation. The success
|
|
297
298
|
result contains `{ pageId }` only — call `pages.get(pageId)` separately when you need readable page
|
|
298
299
|
metadata.
|
|
300
|
+
|
|
301
|
+
### Files reads
|
|
302
|
+
|
|
303
|
+
Each Files entry is either an external link (`type: "external"`) or a Notion-hosted file
|
|
304
|
+
(`type: "file"`), in the order shown in Notion. A hosted file's `file.url` is a signed URL that
|
|
305
|
+
expires at `file.expiry_time`. Call `pages.get` again when you need a fresh URL. `expiry_time` can
|
|
306
|
+
be missing on older hosts.
|
|
307
|
+
|
|
308
|
+
An empty Files value returns `[]`. If the host can't resolve an entry (for example, you can't read
|
|
309
|
+
the referenced file, or it points to a folder), `pages.get` fails with an error instead of returning
|
|
310
|
+
a partial list.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@notionhq/custom-blocks",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"import": "./dist/react/index.js",
|
|
19
19
|
"types": "./dist/react/index.d.ts"
|
|
20
20
|
},
|
|
21
|
-
"./
|
|
22
|
-
"import": "./dist/
|
|
23
|
-
"types": "./dist/
|
|
21
|
+
"./bridge": {
|
|
22
|
+
"import": "./dist/bridge.js",
|
|
23
|
+
"types": "./dist/bridge.d.ts"
|
|
24
24
|
},
|
|
25
25
|
"./bundle": {
|
|
26
26
|
"types": "./bin/notion-custom-blocks/bundle.d.ts",
|