ncblock 0.0.1

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.
Files changed (113) hide show
  1. package/README.md +286 -0
  2. package/dist/bridge/context.d.ts +44 -0
  3. package/dist/bridge/context.d.ts.map +1 -0
  4. package/dist/bridge/context.js +42 -0
  5. package/dist/bridge/dataSources/dataSource.d.ts +732 -0
  6. package/dist/bridge/dataSources/dataSource.d.ts.map +1 -0
  7. package/dist/bridge/dataSources/dataSource.js +37 -0
  8. package/dist/bridge/dataSources/dataSourcePage.d.ts +117 -0
  9. package/dist/bridge/dataSources/dataSourcePage.d.ts.map +1 -0
  10. package/dist/bridge/dataSources/dataSourcePage.js +13 -0
  11. package/dist/bridge/dataSources/dataSourceValue.d.ts +67 -0
  12. package/dist/bridge/dataSources/dataSourceValue.d.ts.map +1 -0
  13. package/dist/bridge/dataSources/dataSourceValue.js +14 -0
  14. package/dist/bridge/dataSources/dateValue.d.ts +158 -0
  15. package/dist/bridge/dataSources/dateValue.d.ts.map +1 -0
  16. package/dist/bridge/dataSources/dateValue.js +59 -0
  17. package/dist/bridge/dataSources/propertySchema.d.ts +191 -0
  18. package/dist/bridge/dataSources/propertySchema.d.ts.map +1 -0
  19. package/dist/bridge/dataSources/propertySchema.js +148 -0
  20. package/dist/bridge/dataSources/recordPointer.d.ts +10 -0
  21. package/dist/bridge/dataSources/recordPointer.d.ts.map +1 -0
  22. package/dist/bridge/dataSources/recordPointer.js +8 -0
  23. package/dist/bridge/ids.d.ts +21 -0
  24. package/dist/bridge/ids.d.ts.map +1 -0
  25. package/dist/bridge/ids.js +3 -0
  26. package/dist/bridge/incomingType.d.ts +10 -0
  27. package/dist/bridge/incomingType.d.ts.map +1 -0
  28. package/dist/bridge/incomingType.js +17 -0
  29. package/dist/bridge/manifest.d.ts +66 -0
  30. package/dist/bridge/manifest.d.ts.map +1 -0
  31. package/dist/bridge/manifest.js +40 -0
  32. package/dist/bridge/messages/contextChanged.d.ts +20 -0
  33. package/dist/bridge/messages/contextChanged.d.ts.map +1 -0
  34. package/dist/bridge/messages/contextChanged.js +10 -0
  35. package/dist/bridge/messages/createPage.d.ts +233 -0
  36. package/dist/bridge/messages/createPage.d.ts.map +1 -0
  37. package/dist/bridge/messages/createPage.js +45 -0
  38. package/dist/bridge/messages/createPageResult.d.ts +198 -0
  39. package/dist/bridge/messages/createPageResult.d.ts.map +1 -0
  40. package/dist/bridge/messages/createPageResult.js +20 -0
  41. package/dist/bridge/messages/dataSourcesChanged.d.ts +158 -0
  42. package/dist/bridge/messages/dataSourcesChanged.d.ts.map +1 -0
  43. package/dist/bridge/messages/dataSourcesChanged.js +13 -0
  44. package/dist/bridge/messages/getPage.d.ts +203 -0
  45. package/dist/bridge/messages/getPage.d.ts.map +1 -0
  46. package/dist/bridge/messages/getPage.js +24 -0
  47. package/dist/bridge/messages/hostToSandbox.d.ts +974 -0
  48. package/dist/bridge/messages/hostToSandbox.d.ts.map +1 -0
  49. package/dist/bridge/messages/hostToSandbox.js +24 -0
  50. package/dist/bridge/messages/init.d.ts +169 -0
  51. package/dist/bridge/messages/init.d.ts.map +1 -0
  52. package/dist/bridge/messages/init.js +17 -0
  53. package/dist/bridge/messages/invalidHostMessage.d.ts +15 -0
  54. package/dist/bridge/messages/invalidHostMessage.d.ts.map +1 -0
  55. package/dist/bridge/messages/invalidHostMessage.js +13 -0
  56. package/dist/bridge/messages/invalidSandboxMessage.d.ts +15 -0
  57. package/dist/bridge/messages/invalidSandboxMessage.d.ts.map +1 -0
  58. package/dist/bridge/messages/invalidSandboxMessage.js +13 -0
  59. package/dist/bridge/messages/queryDataSource.d.ts +13 -0
  60. package/dist/bridge/messages/queryDataSource.d.ts.map +1 -0
  61. package/dist/bridge/messages/queryDataSource.js +11 -0
  62. package/dist/bridge/messages/queryDataSourceResult.d.ts +77 -0
  63. package/dist/bridge/messages/queryDataSourceResult.d.ts.map +1 -0
  64. package/dist/bridge/messages/queryDataSourceResult.js +13 -0
  65. package/dist/bridge/messages/ready.d.ts +41 -0
  66. package/dist/bridge/messages/ready.d.ts.map +1 -0
  67. package/dist/bridge/messages/ready.js +22 -0
  68. package/dist/bridge/messages/resize.d.ts +12 -0
  69. package/dist/bridge/messages/resize.d.ts.map +1 -0
  70. package/dist/bridge/messages/resize.js +10 -0
  71. package/dist/bridge/messages/sandboxToHost.d.ts +389 -0
  72. package/dist/bridge/messages/sandboxToHost.d.ts.map +1 -0
  73. package/dist/bridge/messages/sandboxToHost.js +21 -0
  74. package/dist/bridge/messages/themeChanged.d.ts +11 -0
  75. package/dist/bridge/messages/themeChanged.d.ts.map +1 -0
  76. package/dist/bridge/messages/themeChanged.js +10 -0
  77. package/dist/bridge/messages/updatePage.d.ts +171 -0
  78. package/dist/bridge/messages/updatePage.d.ts.map +1 -0
  79. package/dist/bridge/messages/updatePage.js +14 -0
  80. package/dist/bridge/messages/updatePageResult.d.ts +197 -0
  81. package/dist/bridge/messages/updatePageResult.d.ts.map +1 -0
  82. package/dist/bridge/messages/updatePageResult.js +19 -0
  83. package/dist/bridge/pages/page.d.ts +651 -0
  84. package/dist/bridge/pages/page.d.ts.map +1 -0
  85. package/dist/bridge/pages/page.js +229 -0
  86. package/dist/bridge/pendingRequests.d.ts +14 -0
  87. package/dist/bridge/pendingRequests.d.ts.map +1 -0
  88. package/dist/bridge/pendingRequests.js +27 -0
  89. package/dist/bridge/theme.d.ts +4 -0
  90. package/dist/bridge/theme.d.ts.map +1 -0
  91. package/dist/bridge/theme.js +2 -0
  92. package/dist/host.d.ts +52 -0
  93. package/dist/host.d.ts.map +1 -0
  94. package/dist/host.js +32 -0
  95. package/dist/index.d.ts +27 -0
  96. package/dist/index.d.ts.map +1 -0
  97. package/dist/index.js +14 -0
  98. package/dist/notion.d.ts +113 -0
  99. package/dist/notion.d.ts.map +1 -0
  100. package/dist/notion.js +773 -0
  101. package/dist/pages.d.ts +23 -0
  102. package/dist/pages.d.ts.map +1 -0
  103. package/dist/pages.js +30 -0
  104. package/dist/react.d.ts +171 -0
  105. package/dist/react.d.ts.map +1 -0
  106. package/dist/react.js +284 -0
  107. package/dist/types.d.ts +124 -0
  108. package/dist/types.d.ts.map +1 -0
  109. package/dist/types.js +1 -0
  110. package/dist/utils.d.ts +9 -0
  111. package/dist/utils.d.ts.map +1 -0
  112. package/dist/utils.js +10 -0
  113. package/package.json +48 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataSource.d.ts","sourceRoot":"","sources":["../../../bridge/dataSources/dataSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B,QAAA,MAAM,0BAA0B;;;;aAI9B,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAClD,OAAO,0BAA0B,CACjC,CAAA;AAED,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAG1C,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,WAAW,CACjD,OAAO,+BAA+B,CACtC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIlC;;;OAGG;;IAEH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAEF,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAIxC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAClD,OAAO,6BAA6B,CACpC,CAAA;AAED,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAG1C,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,WAAW,CACnD,OAAO,8BAA8B,CACrC,CAAA"}
@@ -0,0 +1,37 @@
1
+ import * as v from "valibot";
2
+ import { notionDataSourceIdSchema, notionSpaceIdSchema } from "../ids";
3
+ import { notionPropertySchemaSchema } from "./propertySchema";
4
+ const collectionPointerValidator = v.object({
5
+ id: notionDataSourceIdSchema,
6
+ table: v.string(),
7
+ spaceId: v.optional(notionSpaceIdSchema),
8
+ });
9
+ export const notionCollectionSchemaValidator = v.object({
10
+ id: v.optional(notionDataSourceIdSchema),
11
+ propertiesById: v.record(v.string(), notionPropertySchemaSchema),
12
+ });
13
+ /**
14
+ * Bridge shape for a single data source: a semantic key bound (optionally) to a collection,
15
+ * its property name → ID mapping, and its column schemas.
16
+ */
17
+ export const notionDataSourceSchema = v.object({
18
+ key: v.string(),
19
+ collectionPointer: v.optional(collectionPointerValidator),
20
+ collectionSchema: v.optional(notionCollectionSchemaValidator),
21
+ /**
22
+ * Keyed mapping of user-defined keys to a raw property ID. A key mapped to `undefined`
23
+ * is a declared-but-unbound slot.
24
+ */
25
+ propertyIdsByKey: v.record(v.string(), v.optional(v.string())),
26
+ /**
27
+ * Keyed mapping of raw property IDs to their schema. Always includes the four built-ins
28
+ * (`created_time`, `last_edited_time`, `created_by`, `last_edited_by`).
29
+ */
30
+ propertySchemasById: v.record(v.string(), notionPropertySchemaSchema),
31
+ });
32
+ export const notionDataSourceBindingSchema = v.object({
33
+ collectionPointer: v.optional(collectionPointerValidator),
34
+ collectionSchema: v.optional(notionCollectionSchemaValidator),
35
+ propertyIdsByKey: v.optional(v.record(v.string(), v.optional(v.string()))),
36
+ });
37
+ export const notionDataSourceBindingsSchema = v.record(v.string(), notionDataSourceBindingSchema);
@@ -0,0 +1,117 @@
1
+ import * as v from "valibot";
2
+ import type { NotionPage, NotionPageCover, NotionPageIcon, NotionPageId, NotionPagePropertyInputMap } from "../pages/page";
3
+ import { type NotionDataSourceValue } from "./dataSourceValue";
4
+ /**
5
+ * Bridge shape for a data source page, as parsed from inbound host messages. The host keys
6
+ * properties by raw property ID. The four built-ins (`created_time`, `last_edited_time`,
7
+ * `created_by`, `last_edited_by`) are normally present, possibly with `undefined` values.
8
+ *
9
+ * Internal to the SDK. The consumer-facing shape is {@link NotionDataSourcePage}.
10
+ */
11
+ export declare const notionDataSourcePageBridgeSchema: v.ObjectSchema<{
12
+ readonly id: v.StringSchema<undefined>;
13
+ 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<{
14
+ readonly type: v.LiteralSchema<"date", undefined>;
15
+ readonly start_date: v.StringSchema<undefined>;
16
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
17
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
18
+ readonly value: v.NumberSchema<undefined>;
19
+ readonly time: v.StringSchema<undefined>;
20
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
21
+ }, undefined>, v.ObjectSchema<{
22
+ readonly unit: v.LiteralSchema<"none", undefined>;
23
+ }, undefined>], undefined>, undefined>;
24
+ }, undefined>, v.ObjectSchema<{
25
+ readonly type: v.LiteralSchema<"daterange", undefined>;
26
+ readonly start_date: v.StringSchema<undefined>;
27
+ readonly end_date: v.StringSchema<undefined>;
28
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
29
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
30
+ readonly value: v.NumberSchema<undefined>;
31
+ readonly time: v.StringSchema<undefined>;
32
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
33
+ }, undefined>, v.ObjectSchema<{
34
+ readonly unit: v.LiteralSchema<"none", undefined>;
35
+ }, undefined>], undefined>, undefined>;
36
+ }, undefined>, v.ObjectSchema<{
37
+ readonly type: v.LiteralSchema<"datetime", undefined>;
38
+ readonly start_date: v.StringSchema<undefined>;
39
+ readonly start_time: v.StringSchema<undefined>;
40
+ readonly time_zone: v.StringSchema<undefined>;
41
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
42
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
43
+ readonly value: v.NumberSchema<undefined>;
44
+ readonly time: v.StringSchema<undefined>;
45
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
46
+ }, undefined>, v.ObjectSchema<{
47
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
48
+ readonly value: v.NumberSchema<undefined>;
49
+ }, undefined>], undefined>, v.ObjectSchema<{
50
+ readonly unit: v.LiteralSchema<"none", undefined>;
51
+ }, undefined>], undefined>, undefined>;
52
+ }, undefined>, v.ObjectSchema<{
53
+ readonly type: v.LiteralSchema<"datetimerange", undefined>;
54
+ readonly start_date: v.StringSchema<undefined>;
55
+ readonly start_time: v.StringSchema<undefined>;
56
+ readonly end_date: v.StringSchema<undefined>;
57
+ readonly end_time: v.StringSchema<undefined>;
58
+ readonly time_zone: v.StringSchema<undefined>;
59
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
60
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
61
+ readonly value: v.NumberSchema<undefined>;
62
+ readonly time: v.StringSchema<undefined>;
63
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
64
+ }, undefined>, v.ObjectSchema<{
65
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
66
+ readonly value: v.NumberSchema<undefined>;
67
+ }, undefined>], undefined>, v.ObjectSchema<{
68
+ readonly unit: v.LiteralSchema<"none", undefined>;
69
+ }, undefined>], undefined>, undefined>;
70
+ }, undefined>], undefined>, v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ArraySchema<v.ObjectSchema<{
71
+ readonly id: v.StringSchema<undefined>;
72
+ readonly table: v.StringSchema<undefined>;
73
+ }, undefined>, undefined>], undefined>, undefined>, undefined>;
74
+ }, undefined>;
75
+ /** Internal SDK type for a parsed bridge page. */
76
+ export type NotionDataSourcePageBridge = v.InferOutput<typeof notionDataSourcePageBridgeSchema>;
77
+ export type NotionDataSourcePageUpdateInput = {
78
+ properties?: NotionPagePropertyInputMap;
79
+ icon?: NotionPageIcon;
80
+ cover?: NotionPageCover;
81
+ archived?: boolean;
82
+ };
83
+ export type NotionDataSourcePageUpdateResult = {
84
+ status: "success";
85
+ page: NotionPage;
86
+ } | {
87
+ status: "error";
88
+ error: string;
89
+ };
90
+ /**
91
+ * Consumer-facing page shape returned from {@link useDataSource}. Derived from the bridge payload
92
+ * plus the data source's `propertyIdsByKey`.
93
+ */
94
+ export type NotionDataSourcePage = {
95
+ id: NotionPageId;
96
+ /**
97
+ * Keyed mapping of raw property IDs to their value. Includes all properties on the data source,
98
+ * including the four built-ins (`created_time`, `last_edited_time`, `created_by`,
99
+ * `last_edited_by`).
100
+ */
101
+ propertiesById: {
102
+ [propertyId: string]: NotionDataSourceValue | undefined;
103
+ };
104
+ /**
105
+ * Keyed mapping of user-defined keys to their value. Only includes properties that are mapped
106
+ * to a raw property ID in the data source's `propertyIdsByKey`.
107
+ */
108
+ propertiesByKey: {
109
+ [key: string]: NotionDataSourceValue | undefined;
110
+ };
111
+ /**
112
+ * Updates this page using the data source's property-key bindings. The SDK resolves property
113
+ * keys to raw property IDs before sending the bridge message to the host.
114
+ */
115
+ update: (input: NotionDataSourcePageUpdateInput) => Promise<NotionDataSourcePageUpdateResult>;
116
+ };
117
+ //# sourceMappingURL=dataSourcePage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataSourcePage.d.ts","sourceRoot":"","sources":["../../../bridge/dataSources/dataSourcePage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAC5B,OAAO,KAAK,EACX,UAAU,EACV,eAAe,EACf,cAAc,EACd,YAAY,EACZ,0BAA0B,EAC1B,MAAM,eAAe,CAAA;AACtB,OAAO,EACN,KAAK,qBAAqB,EAE1B,MAAM,mBAAmB,CAAA;AAE1B;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAG3C,CAAA;AAEF,kDAAkD;AAClD,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,WAAW,CACrD,OAAO,gCAAgC,CACvC,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG;IAC7C,UAAU,CAAC,EAAE,0BAA0B,CAAA;IACvC,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,gCAAgC,GACzC;IACA,MAAM,EAAE,SAAS,CAAA;IACjB,IAAI,EAAE,UAAU,CAAA;CACf,GACD;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAErC;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAClC,EAAE,EAAE,YAAY,CAAA;IAChB;;;;OAIG;IACH,cAAc,EAAE;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAAA;KAAE,CAAA;IAC3E;;;OAGG;IACH,eAAe,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,qBAAqB,GAAG,SAAS,CAAA;KAAE,CAAA;IACrE;;;OAGG;IACH,MAAM,EAAE,CACP,KAAK,EAAE,+BAA+B,KAClC,OAAO,CAAC,gCAAgC,CAAC,CAAA;CAC9C,CAAA"}
@@ -0,0 +1,13 @@
1
+ import * as v from "valibot";
2
+ import { notionDataSourceValueSchema, } from "./dataSourceValue";
3
+ /**
4
+ * Bridge shape for a data source page, as parsed from inbound host messages. The host keys
5
+ * properties by raw property ID. The four built-ins (`created_time`, `last_edited_time`,
6
+ * `created_by`, `last_edited_by`) are normally present, possibly with `undefined` values.
7
+ *
8
+ * Internal to the SDK. The consumer-facing shape is {@link NotionDataSourcePage}.
9
+ */
10
+ export const notionDataSourcePageBridgeSchema = v.object({
11
+ id: v.string(),
12
+ propertiesById: v.record(v.string(), v.optional(notionDataSourceValueSchema)),
13
+ });
@@ -0,0 +1,67 @@
1
+ import * as v from "valibot";
2
+ /**
3
+ * Possible types for a data source value.
4
+ */
5
+ export declare const notionDataSourceValueSchema: v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.BooleanSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
6
+ readonly type: v.LiteralSchema<"date", undefined>;
7
+ readonly start_date: v.StringSchema<undefined>;
8
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
9
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
10
+ readonly value: v.NumberSchema<undefined>;
11
+ readonly time: v.StringSchema<undefined>;
12
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
13
+ }, undefined>, v.ObjectSchema<{
14
+ readonly unit: v.LiteralSchema<"none", undefined>;
15
+ }, undefined>], undefined>, undefined>;
16
+ }, undefined>, v.ObjectSchema<{
17
+ readonly type: v.LiteralSchema<"daterange", undefined>;
18
+ readonly start_date: v.StringSchema<undefined>;
19
+ readonly end_date: v.StringSchema<undefined>;
20
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
21
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
22
+ readonly value: v.NumberSchema<undefined>;
23
+ readonly time: v.StringSchema<undefined>;
24
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
25
+ }, undefined>, v.ObjectSchema<{
26
+ readonly unit: v.LiteralSchema<"none", undefined>;
27
+ }, undefined>], undefined>, undefined>;
28
+ }, undefined>, v.ObjectSchema<{
29
+ readonly type: v.LiteralSchema<"datetime", undefined>;
30
+ readonly start_date: v.StringSchema<undefined>;
31
+ readonly start_time: v.StringSchema<undefined>;
32
+ readonly time_zone: v.StringSchema<undefined>;
33
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
34
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
35
+ readonly value: v.NumberSchema<undefined>;
36
+ readonly time: v.StringSchema<undefined>;
37
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
38
+ }, undefined>, v.ObjectSchema<{
39
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
40
+ readonly value: v.NumberSchema<undefined>;
41
+ }, undefined>], undefined>, v.ObjectSchema<{
42
+ readonly unit: v.LiteralSchema<"none", undefined>;
43
+ }, undefined>], undefined>, undefined>;
44
+ }, undefined>, v.ObjectSchema<{
45
+ readonly type: v.LiteralSchema<"datetimerange", undefined>;
46
+ readonly start_date: v.StringSchema<undefined>;
47
+ readonly start_time: v.StringSchema<undefined>;
48
+ readonly end_date: v.StringSchema<undefined>;
49
+ readonly end_time: v.StringSchema<undefined>;
50
+ readonly time_zone: v.StringSchema<undefined>;
51
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
52
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
53
+ readonly value: v.NumberSchema<undefined>;
54
+ readonly time: v.StringSchema<undefined>;
55
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
56
+ }, undefined>, v.ObjectSchema<{
57
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
58
+ readonly value: v.NumberSchema<undefined>;
59
+ }, undefined>], undefined>, v.ObjectSchema<{
60
+ readonly unit: v.LiteralSchema<"none", undefined>;
61
+ }, undefined>], undefined>, undefined>;
62
+ }, undefined>], undefined>, v.ArraySchema<v.StringSchema<undefined>, undefined>, v.ArraySchema<v.ObjectSchema<{
63
+ readonly id: v.StringSchema<undefined>;
64
+ readonly table: v.StringSchema<undefined>;
65
+ }, undefined>, undefined>], undefined>;
66
+ export type NotionDataSourceValue = v.InferOutput<typeof notionDataSourceValueSchema>;
67
+ //# sourceMappingURL=dataSourceValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dataSourceValue.d.ts","sourceRoot":"","sources":["../../../bridge/dataSources/dataSourceValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAI5B;;GAEG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAOtC,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,WAAW,CAChD,OAAO,2BAA2B,CAClC,CAAA"}
@@ -0,0 +1,14 @@
1
+ import * as v from "valibot";
2
+ import { notionDateValueSchema } from "./dateValue";
3
+ import { notionRecordPointerSchema } from "./recordPointer";
4
+ /**
5
+ * Possible types for a data source value.
6
+ */
7
+ export const notionDataSourceValueSchema = v.union([
8
+ v.string(),
9
+ v.number(),
10
+ v.boolean(),
11
+ notionDateValueSchema,
12
+ v.array(v.string()),
13
+ v.array(notionRecordPointerSchema),
14
+ ]);
@@ -0,0 +1,158 @@
1
+ import * as v from "valibot";
2
+ export declare const notionDateReminderSchema: v.ObjectSchema<{
3
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
4
+ readonly value: v.NumberSchema<undefined>;
5
+ readonly time: v.StringSchema<undefined>;
6
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
7
+ }, undefined>;
8
+ export type NotionDateReminder = v.InferOutput<typeof notionDateReminderSchema>;
9
+ export declare const notionTimeReminderSchema: v.ObjectSchema<{
10
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
11
+ readonly value: v.NumberSchema<undefined>;
12
+ }, undefined>;
13
+ export type NotionTimeReminder = v.InferOutput<typeof notionTimeReminderSchema>;
14
+ export declare const notionNoReminderSchema: v.ObjectSchema<{
15
+ readonly unit: v.LiteralSchema<"none", undefined>;
16
+ }, undefined>;
17
+ export type NotionNoReminder = v.InferOutput<typeof notionNoReminderSchema>;
18
+ /**
19
+ * Possible types for a Notion `datetime` reminder.
20
+ */
21
+ export declare const notionDateTimeReminderSchema: v.UnionSchema<[v.ObjectSchema<{
22
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
23
+ readonly value: v.NumberSchema<undefined>;
24
+ readonly time: v.StringSchema<undefined>;
25
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
26
+ }, undefined>, v.ObjectSchema<{
27
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
28
+ readonly value: v.NumberSchema<undefined>;
29
+ }, undefined>], undefined>;
30
+ export type NotionDateTimeReminder = v.InferOutput<typeof notionDateTimeReminderSchema>;
31
+ export declare const notionDateSchema: v.ObjectSchema<{
32
+ readonly type: v.LiteralSchema<"date", undefined>;
33
+ readonly start_date: v.StringSchema<undefined>;
34
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
35
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
36
+ readonly value: v.NumberSchema<undefined>;
37
+ readonly time: v.StringSchema<undefined>;
38
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
39
+ }, undefined>, v.ObjectSchema<{
40
+ readonly unit: v.LiteralSchema<"none", undefined>;
41
+ }, undefined>], undefined>, undefined>;
42
+ }, undefined>;
43
+ export type NotionDate = v.InferOutput<typeof notionDateSchema>;
44
+ export declare const notionDateRangeSchema: v.ObjectSchema<{
45
+ readonly type: v.LiteralSchema<"daterange", undefined>;
46
+ readonly start_date: v.StringSchema<undefined>;
47
+ readonly end_date: v.StringSchema<undefined>;
48
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
49
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
50
+ readonly value: v.NumberSchema<undefined>;
51
+ readonly time: v.StringSchema<undefined>;
52
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
53
+ }, undefined>, v.ObjectSchema<{
54
+ readonly unit: v.LiteralSchema<"none", undefined>;
55
+ }, undefined>], undefined>, undefined>;
56
+ }, undefined>;
57
+ export type NotionDateRange = v.InferOutput<typeof notionDateRangeSchema>;
58
+ export declare const notionDateTimeSchema: v.ObjectSchema<{
59
+ readonly type: v.LiteralSchema<"datetime", undefined>;
60
+ readonly start_date: v.StringSchema<undefined>;
61
+ readonly start_time: v.StringSchema<undefined>;
62
+ readonly time_zone: v.StringSchema<undefined>;
63
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
64
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
65
+ readonly value: v.NumberSchema<undefined>;
66
+ readonly time: v.StringSchema<undefined>;
67
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
68
+ }, undefined>, v.ObjectSchema<{
69
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
70
+ readonly value: v.NumberSchema<undefined>;
71
+ }, undefined>], undefined>, v.ObjectSchema<{
72
+ readonly unit: v.LiteralSchema<"none", undefined>;
73
+ }, undefined>], undefined>, undefined>;
74
+ }, undefined>;
75
+ export type NotionDateTime = v.InferOutput<typeof notionDateTimeSchema>;
76
+ export declare const notionDateTimeRangeSchema: v.ObjectSchema<{
77
+ readonly type: v.LiteralSchema<"datetimerange", undefined>;
78
+ readonly start_date: v.StringSchema<undefined>;
79
+ readonly start_time: v.StringSchema<undefined>;
80
+ readonly end_date: v.StringSchema<undefined>;
81
+ readonly end_time: v.StringSchema<undefined>;
82
+ readonly time_zone: v.StringSchema<undefined>;
83
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
84
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
85
+ readonly value: v.NumberSchema<undefined>;
86
+ readonly time: v.StringSchema<undefined>;
87
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
88
+ }, undefined>, v.ObjectSchema<{
89
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
90
+ readonly value: v.NumberSchema<undefined>;
91
+ }, undefined>], undefined>, v.ObjectSchema<{
92
+ readonly unit: v.LiteralSchema<"none", undefined>;
93
+ }, undefined>], undefined>, undefined>;
94
+ }, undefined>;
95
+ export type NotionDateTimeRange = v.InferOutput<typeof notionDateTimeRangeSchema>;
96
+ /**
97
+ * Possible types for a Notion `date` value.
98
+ */
99
+ export declare const notionDateValueSchema: v.VariantSchema<"type", [v.ObjectSchema<{
100
+ readonly type: v.LiteralSchema<"date", undefined>;
101
+ readonly start_date: v.StringSchema<undefined>;
102
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
103
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
104
+ readonly value: v.NumberSchema<undefined>;
105
+ readonly time: v.StringSchema<undefined>;
106
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
107
+ }, undefined>, v.ObjectSchema<{
108
+ readonly unit: v.LiteralSchema<"none", undefined>;
109
+ }, undefined>], undefined>, undefined>;
110
+ }, undefined>, v.ObjectSchema<{
111
+ readonly type: v.LiteralSchema<"daterange", undefined>;
112
+ readonly start_date: v.StringSchema<undefined>;
113
+ readonly end_date: v.StringSchema<undefined>;
114
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
115
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
116
+ readonly value: v.NumberSchema<undefined>;
117
+ readonly time: v.StringSchema<undefined>;
118
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
119
+ }, undefined>, v.ObjectSchema<{
120
+ readonly unit: v.LiteralSchema<"none", undefined>;
121
+ }, undefined>], undefined>, undefined>;
122
+ }, undefined>, v.ObjectSchema<{
123
+ readonly type: v.LiteralSchema<"datetime", undefined>;
124
+ readonly start_date: v.StringSchema<undefined>;
125
+ readonly start_time: v.StringSchema<undefined>;
126
+ readonly time_zone: v.StringSchema<undefined>;
127
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
128
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
129
+ readonly value: v.NumberSchema<undefined>;
130
+ readonly time: v.StringSchema<undefined>;
131
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
132
+ }, undefined>, v.ObjectSchema<{
133
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
134
+ readonly value: v.NumberSchema<undefined>;
135
+ }, undefined>], undefined>, v.ObjectSchema<{
136
+ readonly unit: v.LiteralSchema<"none", undefined>;
137
+ }, undefined>], undefined>, undefined>;
138
+ }, undefined>, v.ObjectSchema<{
139
+ readonly type: v.LiteralSchema<"datetimerange", undefined>;
140
+ readonly start_date: v.StringSchema<undefined>;
141
+ readonly start_time: v.StringSchema<undefined>;
142
+ readonly end_date: v.StringSchema<undefined>;
143
+ readonly end_time: v.StringSchema<undefined>;
144
+ readonly time_zone: v.StringSchema<undefined>;
145
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
146
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
147
+ readonly value: v.NumberSchema<undefined>;
148
+ readonly time: v.StringSchema<undefined>;
149
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
150
+ }, undefined>, v.ObjectSchema<{
151
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
152
+ readonly value: v.NumberSchema<undefined>;
153
+ }, undefined>], undefined>, v.ObjectSchema<{
154
+ readonly unit: v.LiteralSchema<"none", undefined>;
155
+ }, undefined>], undefined>, undefined>;
156
+ }, undefined>], undefined>;
157
+ export type NotionDateValue = Readonly<v.InferOutput<typeof notionDateValueSchema>>;
158
+ //# sourceMappingURL=dateValue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateValue.d.ts","sourceRoot":"","sources":["../../../bridge/dataSources/dateValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,eAAO,MAAM,wBAAwB;;;;;aAKnC,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E,eAAO,MAAM,wBAAwB;;;aAGnC,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E,eAAO,MAAM,sBAAsB;;aAEjC,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;0BAGvC,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,WAAW,CACjD,OAAO,4BAA4B,CACnC,CAAA;AAUD,eAAO,MAAM,gBAAgB;;;;;;;;;;;aAI3B,CAAA;AACF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAE/D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;aAKhC,CAAA;AACF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;aAM/B,CAAA;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;aAQpC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,WAAW,CAC9C,OAAO,yBAAyB,CAChC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAKhC,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,QAAQ,CACrC,CAAC,CAAC,WAAW,CAAC,OAAO,qBAAqB,CAAC,CAC3C,CAAA"}
@@ -0,0 +1,59 @@
1
+ import * as v from "valibot";
2
+ export const notionDateReminderSchema = v.object({
3
+ unit: v.picklist(["year", "month", "week", "day"]),
4
+ value: v.number(),
5
+ time: v.string(),
6
+ defaultTimeZone: v.optional(v.string()),
7
+ });
8
+ export const notionTimeReminderSchema = v.object({
9
+ unit: v.picklist(["hour", "minute"]),
10
+ value: v.number(),
11
+ });
12
+ export const notionNoReminderSchema = v.object({
13
+ unit: v.literal("none"),
14
+ });
15
+ /**
16
+ * Possible types for a Notion `datetime` reminder.
17
+ */
18
+ export const notionDateTimeReminderSchema = v.union([
19
+ notionDateReminderSchema,
20
+ notionTimeReminderSchema,
21
+ ]);
22
+ const dateOrNoReminder = v.optional(v.union([notionDateReminderSchema, notionNoReminderSchema]));
23
+ const dateTimeOrNoReminder = v.optional(v.union([notionDateTimeReminderSchema, notionNoReminderSchema]));
24
+ export const notionDateSchema = v.object({
25
+ type: v.literal("date"),
26
+ start_date: v.string(),
27
+ reminder: dateOrNoReminder,
28
+ });
29
+ export const notionDateRangeSchema = v.object({
30
+ type: v.literal("daterange"),
31
+ start_date: v.string(),
32
+ end_date: v.string(),
33
+ reminder: dateOrNoReminder,
34
+ });
35
+ export const notionDateTimeSchema = v.object({
36
+ type: v.literal("datetime"),
37
+ start_date: v.string(),
38
+ start_time: v.string(),
39
+ time_zone: v.string(),
40
+ reminder: dateTimeOrNoReminder,
41
+ });
42
+ export const notionDateTimeRangeSchema = v.object({
43
+ type: v.literal("datetimerange"),
44
+ start_date: v.string(),
45
+ start_time: v.string(),
46
+ end_date: v.string(),
47
+ end_time: v.string(),
48
+ time_zone: v.string(),
49
+ reminder: dateTimeOrNoReminder,
50
+ });
51
+ /**
52
+ * Possible types for a Notion `date` value.
53
+ */
54
+ export const notionDateValueSchema = v.variant("type", [
55
+ notionDateSchema,
56
+ notionDateRangeSchema,
57
+ notionDateTimeSchema,
58
+ notionDateTimeRangeSchema,
59
+ ]);