@notionhq/custom-blocks-host 0.4.2 → 0.5.0
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 +4 -0
- package/dist/browser.js +1 -1
- package/dist/compatibility/normalizeHostToSandboxMessage.js +4 -4
- package/dist/compatibility/normalizeSandboxToHostMessage.d.ts +232 -8
- package/dist/compatibility/normalizeSandboxToHostMessage.d.ts.map +1 -1
- package/dist/compatibility/{pageResult.d.ts → pages/pageResult.d.ts} +1 -1
- package/dist/compatibility/pages/pageResult.d.ts.map +1 -0
- package/dist/compatibility/{pageWithNullTextFallbackProperties.d.ts → pages/toPageWithNullTextFallbackProperties.d.ts} +2 -2
- package/dist/compatibility/pages/toPageWithNullTextFallbackProperties.d.ts.map +1 -0
- package/dist/compatibility/{pageWithNullTextFallbackProperties.js → pages/toPageWithNullTextFallbackProperties.js} +1 -1
- package/dist/compatibility/{addMetadataReadSchemasForProtocol3To4.d.ts → protocol3To4/addMetadataReadSchemasForProtocol3To4.d.ts} +96 -90
- package/dist/compatibility/{addMetadataReadSchemasForProtocol3To4.d.ts.map → protocol3To4/addMetadataReadSchemasForProtocol3To4.d.ts.map} +1 -1
- package/dist/compatibility/{addMetadataReadSchemasForProtocol3To4.js → protocol3To4/addMetadataReadSchemasForProtocol3To4.js} +1 -1
- package/dist/compatibility/{normalizePageResultsForProtocol3To5.d.ts → protocol3To5/normalizePageResultsForProtocol3To5.d.ts} +2 -2
- package/dist/compatibility/protocol3To5/normalizePageResultsForProtocol3To5.d.ts.map +1 -0
- package/dist/compatibility/{normalizePageResultsForProtocol3To5.js → protocol3To5/normalizePageResultsForProtocol3To5.js} +3 -2
- package/dist/compatibility/protocol3To5/toDateTimeValueForProtocol3To5.d.ts +9 -0
- package/dist/compatibility/protocol3To5/toDateTimeValueForProtocol3To5.d.ts.map +1 -0
- package/dist/compatibility/protocol3To5/toDateTimeValueForProtocol3To5.js +21 -0
- package/dist/compatibility/protocol3To5/toPageForProtocol3To5.d.ts +12 -0
- package/dist/compatibility/protocol3To5/toPageForProtocol3To5.d.ts.map +1 -0
- package/dist/compatibility/protocol3To5/toPageForProtocol3To5.js +20 -0
- package/dist/compatibility/protocol3To5/toPropertyValueForProtocol3To5.d.ts +10 -0
- package/dist/compatibility/protocol3To5/toPropertyValueForProtocol3To5.d.ts.map +1 -0
- package/dist/compatibility/{pageForProtocol3To5.js → protocol3To5/toPropertyValueForProtocol3To5.js} +25 -95
- package/dist/compatibility/{pageForProtocol3To5.d.ts → protocol3To5/toQueryPageForProtocol3To5.d.ts} +11 -21
- package/dist/compatibility/protocol3To5/toQueryPageForProtocol3To5.d.ts.map +1 -0
- package/dist/compatibility/protocol3To5/toQueryPageForProtocol3To5.js +32 -0
- package/dist/compatibility/{normalizePageResultsForProtocol6.d.ts → protocol6/normalizePageResultsForProtocol6.d.ts} +2 -2
- package/dist/compatibility/protocol6/normalizePageResultsForProtocol6.d.ts.map +1 -0
- package/dist/compatibility/{normalizePageResultsForProtocol6.js → protocol6/normalizePageResultsForProtocol6.js} +1 -1
- package/dist/context/initialState.d.ts +1801 -0
- package/dist/context/initialState.d.ts.map +1 -0
- package/dist/context/initialState.js +34 -0
- package/dist/context/resize.d.ts +4 -0
- package/dist/context/resize.d.ts.map +1 -0
- package/dist/createCustomBlockHost.d.ts +28 -13
- package/dist/createCustomBlockHost.d.ts.map +1 -1
- package/dist/createCustomBlockHost.js +46 -28
- package/dist/{autoBindProperties.d.ts → dataSources/bindings/getAutoBoundPropertyIdsByKey.d.ts} +2 -2
- package/dist/dataSources/bindings/getAutoBoundPropertyIdsByKey.d.ts.map +1 -0
- package/dist/{dateValue.d.ts → dataSources/properties/toNotionDateValue.d.ts} +3 -3
- package/dist/dataSources/properties/toNotionDateValue.d.ts.map +1 -0
- package/dist/{queries → dataSources/queries}/querySubscriptions.d.ts +2 -2
- package/dist/dataSources/queries/querySubscriptions.d.ts.map +1 -0
- package/dist/dataSources/types.d.ts +18 -0
- package/dist/dataSources/types.d.ts.map +1 -0
- package/dist/dataSources/validation/validateQueryDataSourceFilter.d.ts +5 -0
- package/dist/dataSources/validation/validateQueryDataSourceFilter.d.ts.map +1 -0
- package/dist/{queries → dataSources/validation}/validateQueryDataSourceFilter.js +2 -2
- package/dist/dataSources/validation/validateQueryDataSourceSorts.d.ts +8 -0
- package/dist/dataSources/validation/validateQueryDataSourceSorts.d.ts.map +1 -0
- package/dist/{queries → dataSources/validation}/validateQueryDataSourceSorts.js +2 -2
- package/dist/index.d.ts +16 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/lifecycle/{initializationController.d.ts → createInitializationController.d.ts} +7 -6
- package/dist/lifecycle/createInitializationController.d.ts.map +1 -0
- package/dist/lifecycle/{initializationController.js → createInitializationController.js} +9 -4
- package/dist/lifecycle/errors/contextUnavailableError.d.ts +3 -0
- package/dist/lifecycle/errors/contextUnavailableError.d.ts.map +1 -0
- package/dist/lifecycle/errors/contextUnavailableError.js +8 -0
- package/dist/lifecycle/errors/initialStateTimeoutError.d.ts +3 -0
- package/dist/lifecycle/errors/initialStateTimeoutError.d.ts.map +1 -0
- package/dist/lifecycle/errors/initialStateTimeoutError.js +8 -0
- package/dist/lifecycle/errors/invalidConnectPayloadError.d.ts +3 -0
- package/dist/lifecycle/errors/invalidConnectPayloadError.d.ts.map +1 -0
- package/dist/lifecycle/errors/invalidConnectPayloadError.js +8 -0
- package/dist/lifecycle/errors/invalidInitResultPayloadError.d.ts +3 -0
- package/dist/lifecycle/errors/invalidInitResultPayloadError.d.ts.map +1 -0
- package/dist/lifecycle/errors/invalidInitResultPayloadError.js +8 -0
- package/dist/lifecycle/errors/invalidLocalPreviewUrlError.d.ts +3 -0
- package/dist/lifecycle/errors/invalidLocalPreviewUrlError.d.ts.map +1 -0
- package/dist/lifecycle/errors/invalidLocalPreviewUrlError.js +7 -0
- package/dist/lifecycle/errors/invalidPropertyBindingError.d.ts +3 -0
- package/dist/lifecycle/errors/invalidPropertyBindingError.d.ts.map +1 -0
- package/dist/lifecycle/errors/invalidPropertyBindingError.js +9 -0
- package/dist/lifecycle/errors/invalidProtocolVersionError.d.ts +5 -0
- package/dist/lifecycle/errors/invalidProtocolVersionError.d.ts.map +1 -0
- package/dist/lifecycle/errors/invalidProtocolVersionError.js +9 -0
- package/dist/lifecycle/errors/missingDataSourceBindingError.d.ts +3 -0
- package/dist/lifecycle/errors/missingDataSourceBindingError.d.ts.map +1 -0
- package/dist/lifecycle/errors/missingDataSourceBindingError.js +8 -0
- package/dist/lifecycle/errors/missingPropertyBindingError.d.ts +3 -0
- package/dist/lifecycle/errors/missingPropertyBindingError.d.ts.map +1 -0
- package/dist/lifecycle/errors/missingPropertyBindingError.js +8 -0
- package/dist/lifecycle/errors/noConnectError.d.ts +8 -0
- package/dist/lifecycle/errors/noConnectError.d.ts.map +1 -0
- package/dist/lifecycle/errors/noConnectError.js +13 -0
- package/dist/lifecycle/errors/noInitResultError.d.ts +3 -0
- package/dist/lifecycle/errors/noInitResultError.d.ts.map +1 -0
- package/dist/lifecycle/errors/noInitResultError.js +8 -0
- package/dist/lifecycle/errors/unknownInitializationError.d.ts +3 -0
- package/dist/lifecycle/errors/unknownInitializationError.d.ts.map +1 -0
- package/dist/lifecycle/errors/unknownInitializationError.js +8 -0
- package/dist/lifecycle/errors/unsupportedProtocolVersionError.d.ts +6 -0
- package/dist/lifecycle/errors/unsupportedProtocolVersionError.d.ts.map +1 -0
- package/dist/lifecycle/errors/unsupportedProtocolVersionError.js +9 -0
- package/dist/lifecycle/isAllowedLocalPreviewUrl.d.ts.map +1 -0
- package/dist/{isAllowedLocalPreviewUrl.js → lifecycle/isAllowedLocalPreviewUrl.js} +1 -1
- package/dist/lifecycle/{protocolVersion.d.ts → isValidBridgeProtocolVersion.d.ts} +1 -1
- package/dist/lifecycle/isValidBridgeProtocolVersion.d.ts.map +1 -0
- package/dist/lifecycle/types.d.ts +16 -1849
- package/dist/lifecycle/types.d.ts.map +1 -1
- package/dist/lifecycle/types.js +1 -41
- package/dist/{lifecycle → manifest}/resolveManifest.d.ts +2 -2
- package/dist/manifest/resolveManifest.d.ts.map +1 -0
- package/dist/manifest/types.d.ts +55 -0
- package/dist/manifest/types.d.ts.map +1 -0
- package/dist/manifest/types.js +10 -0
- package/dist/messages/{sandboxMessageRouter.d.ts → createSandboxMessageRouter.d.ts} +15 -15
- package/dist/messages/createSandboxMessageRouter.d.ts.map +1 -0
- package/dist/messages/{sandboxMessageRouter.js → createSandboxMessageRouter.js} +5 -4
- package/dist/messages/{invalidSandboxMessage.d.ts → getInvalidSandboxMessageResponse.d.ts} +1 -1
- package/dist/messages/getInvalidSandboxMessageResponse.d.ts.map +1 -0
- package/dist/messages/handlers.d.ts +27 -0
- package/dist/messages/handlers.d.ts.map +1 -0
- package/dist/messages/handlers.js +1 -0
- package/dist/messages/logging.d.ts +2 -0
- package/dist/messages/logging.d.ts.map +1 -0
- package/dist/messages/logging.js +1 -0
- package/dist/messages/result.d.ts +12 -0
- package/dist/messages/result.d.ts.map +1 -0
- package/dist/messages/result.js +1 -0
- package/dist/navigation/parseExternalUrl.d.ts.map +1 -0
- package/dist/navigation/types.d.ts +7 -0
- package/dist/navigation/types.d.ts.map +1 -0
- package/dist/navigation/types.js +1 -0
- package/dist/pages/types.d.ts +18 -0
- package/dist/pages/types.d.ts.map +1 -0
- package/dist/pages/types.js +1 -0
- package/dist/protocol/{messages/updatePage.d.ts → compatibility/protocol3To5/bridgePage.d.ts} +32 -22
- package/dist/protocol/compatibility/protocol3To5/bridgePage.js +21 -0
- package/dist/protocol/{dataSources → compatibility/protocol3To5}/dataSourcePage.js +1 -1
- package/dist/protocol/{dataSources → compatibility/protocol3To5}/dataSourceValue.js +2 -2
- package/dist/protocol/context/containingPage.d.ts +31 -0
- package/dist/protocol/context/containingPage.js +18 -0
- package/dist/protocol/{messages → context/messages}/pageChanged.js +1 -1
- package/dist/protocol/{parent.d.ts → context/parent.d.ts} +11 -1
- package/dist/protocol/context/parent.js +31 -0
- package/dist/protocol/dataSources/bridgeDataSourceBinding.d.ts +164 -0
- package/dist/protocol/dataSources/bridgeDataSourceBinding.js +25 -0
- package/dist/protocol/dataSources/bridgeDataSourceBindings.d.ts +148 -0
- package/dist/protocol/dataSources/bridgeDataSourceBindings.js +3 -0
- package/dist/protocol/dataSources/collectionPointer.d.ts +7 -0
- package/dist/protocol/dataSources/collectionPointer.js +7 -0
- package/dist/protocol/dataSources/collectionSchema.d.ts +144 -0
- package/dist/protocol/dataSources/collectionSchema.js +12 -0
- package/dist/protocol/dataSources/errors.d.ts +2 -2
- package/dist/protocol/dataSources/filters/bridgeDataSourceFilter.d.ts +505 -0
- package/dist/protocol/dataSources/filters/bridgeDataSourceFilter.js +8 -0
- package/dist/protocol/dataSources/filters/bridgeDataSourceFilterCondition.d.ts +253 -0
- package/dist/protocol/dataSources/filters/bridgeDataSourceFilterCondition.js +69 -0
- package/dist/protocol/dataSources/filters/bridgeDataSourceSort.d.ts +11 -0
- package/dist/protocol/dataSources/filters/bridgeDataSourceSort.js +8 -0
- package/dist/protocol/dataSources/filters/checkboxFilterOperator.d.ts +7 -0
- package/dist/protocol/dataSources/filters/checkboxFilterOperator.js +5 -0
- package/dist/protocol/dataSources/filters/containsFilterOperator.d.ts +13 -0
- package/dist/protocol/dataSources/filters/containsFilterOperator.js +9 -0
- package/dist/protocol/dataSources/filters/createdByFilterOperator.d.ts +17 -0
- package/dist/protocol/dataSources/filters/createdByFilterOperator.js +11 -0
- package/dist/protocol/dataSources/filters/dateFilterOperator.d.ts +47 -0
- package/dist/protocol/dataSources/filters/dateFilterOperator.js +73 -0
- package/dist/protocol/dataSources/filters/emptyOperator.d.ts +6 -0
- package/dist/protocol/dataSources/filters/emptyOperator.js +5 -0
- package/dist/protocol/dataSources/filters/numberFilterOperator.d.ts +19 -0
- package/dist/protocol/dataSources/filters/numberFilterOperator.js +11 -0
- package/dist/protocol/dataSources/filters/optionFilterOperator.d.ts +11 -0
- package/dist/protocol/dataSources/filters/optionFilterOperator.js +8 -0
- package/dist/protocol/dataSources/filters/peopleFilterOperator.d.ts +23 -0
- package/dist/protocol/dataSources/filters/peopleFilterOperator.js +11 -0
- package/dist/protocol/dataSources/filters/relationFilterOperator.d.ts +11 -0
- package/dist/protocol/dataSources/filters/relationFilterOperator.js +12 -0
- package/dist/protocol/dataSources/filters/statusFilterOperator.d.ts +15 -0
- package/dist/protocol/dataSources/filters/statusFilterOperator.js +7 -0
- package/dist/protocol/dataSources/filters/statusGroupFilterOperator.d.ts +9 -0
- package/dist/protocol/dataSources/filters/statusGroupFilterOperator.js +18 -0
- package/dist/protocol/dataSources/filters/stringOrStringArray.d.ts +2 -0
- package/dist/protocol/dataSources/filters/stringOrStringArray.js +5 -0
- package/dist/protocol/dataSources/filters/textFilterOperator.d.ts +19 -0
- package/dist/protocol/dataSources/filters/textFilterOperator.js +11 -0
- package/dist/protocol/dataSources/makeBridgeDataSourceBinding.d.ts +6 -0
- package/dist/protocol/dataSources/makeBridgeDataSourceBinding.js +6 -0
- package/dist/protocol/{messages → dataSources/messages}/dataSourcesChanged.d.ts +1 -0
- package/dist/protocol/{messages → dataSources/messages}/dataSourcesChanged.js +2 -2
- package/dist/protocol/{messages/queryDataSourceResult.d.ts → dataSources/messages/queryDataSource.d.ts} +525 -2
- package/dist/protocol/{messages/queryDataSourceResult.js → dataSources/messages/queryDataSource.js} +22 -2
- package/dist/protocol/dataSources/notionDataSource.d.ts +309 -0
- package/dist/protocol/dataSources/notionDataSource.js +38 -0
- package/dist/protocol/dataSources/resolveDataSourceBinding.d.ts +32 -0
- package/dist/protocol/dataSources/resolveDataSourceBinding.js +33 -0
- package/dist/protocol/{messages → handshake}/connect.d.ts +4 -0
- package/dist/protocol/{messages → handshake}/connect.js +2 -2
- package/dist/protocol/{messages → handshake}/init.d.ts +6 -1
- package/dist/protocol/{messages → handshake}/init.js +10 -10
- package/dist/protocol/{messages → handshake}/initResult.d.ts +1 -1
- package/dist/protocol/{messages → handshake}/isInitHandshakeMessage.d.ts +2 -2
- package/dist/protocol/index.d.ts +150 -54
- package/dist/protocol/index.js +73 -54
- package/dist/protocol/manifest/capabilities.d.ts +37 -0
- package/dist/protocol/manifest/capabilities.js +13 -0
- package/dist/protocol/{manifest.d.ts → manifest/manifest.d.ts} +12 -2
- package/dist/protocol/{manifest.js → manifest/manifest.js} +8 -1
- package/dist/protocol/messages/hostToSandbox.d.ts +12 -0
- package/dist/protocol/messages/hostToSandbox.js +15 -15
- package/dist/protocol/messages/messagePayload.d.ts +1 -1
- package/dist/protocol/messages/sandboxToHost.d.ts +232 -8
- package/dist/protocol/messages/sandboxToHost.js +12 -12
- package/dist/protocol/{messages → navigation}/openExternalUrl.d.ts +1 -1
- package/dist/protocol/{messages/createPage.d.ts → pages/bridgePage.d.ts} +67 -65
- package/dist/protocol/pages/bridgePage.js +25 -0
- package/dist/protocol/pages/makeBridgePage.d.ts +6 -0
- package/dist/protocol/pages/makeBridgePage.js +12 -0
- package/dist/protocol/{messages/createPageResult.d.ts → pages/messages/createPage.d.ts} +500 -2
- package/dist/protocol/pages/messages/createPage.js +104 -0
- package/dist/protocol/{messages → pages/messages}/getPage.d.ts +2 -2
- package/dist/protocol/{messages → pages/messages}/getPage.js +4 -3
- package/dist/protocol/{messages → pages/messages}/openPage.d.ts +2 -2
- package/dist/protocol/{messages → pages/messages}/openPage.js +1 -1
- package/dist/protocol/{messages/updatePageResult.d.ts → pages/messages/updatePage.d.ts} +272 -2
- package/dist/protocol/{messages/updatePageResult.js → pages/messages/updatePage.js} +26 -2
- package/dist/protocol/pages/pageAppearance.d.ts +62 -0
- package/dist/protocol/pages/pageAppearance.js +34 -0
- package/dist/protocol/pages/properties/bridgePagePropertyMaps.d.ts +433 -0
- package/dist/protocol/pages/properties/bridgePagePropertyMaps.js +4 -0
- package/dist/protocol/pages/properties/bridgePagePropertyValue.d.ts +217 -0
- package/dist/protocol/pages/properties/bridgePagePropertyValue.js +144 -0
- package/dist/protocol/pages/properties/dateInput.d.ts +45 -0
- package/dist/protocol/pages/properties/dateInput.js +23 -0
- package/dist/protocol/pages/properties/fileInput.d.ts +16 -0
- package/dist/protocol/pages/properties/fileInput.js +16 -0
- package/dist/protocol/pages/properties/metadataActor.d.ts +6 -0
- package/dist/protocol/pages/properties/metadataActor.js +7 -0
- package/dist/protocol/pages/properties/placeInput.d.ts +10 -0
- package/dist/protocol/pages/properties/placeInput.js +10 -0
- package/dist/protocol/pages/properties/relationInput.d.ts +5 -0
- package/dist/protocol/pages/properties/relationInput.js +2 -0
- package/dist/protocol/pages/properties/richText.d.ts +3 -0
- package/dist/protocol/pages/properties/richText.js +2 -0
- package/dist/protocol/pages/properties/selectOption.d.ts +13 -0
- package/dist/protocol/pages/properties/selectOption.js +16 -0
- package/dist/protocol/pages/properties/userInput.d.ts +10 -0
- package/dist/protocol/pages/properties/userInput.js +13 -0
- package/dist/protocol/users/bridgeUser.d.ts +12 -0
- package/dist/protocol/users/bridgeUser.js +12 -0
- package/dist/protocol/users/{user.d.ts → bridgeUserList.d.ts} +2 -15
- package/dist/protocol/users/bridgeUserList.js +10 -0
- package/dist/protocol/users/makeBridgeUser.d.ts +6 -0
- package/dist/protocol/users/makeBridgeUser.js +11 -0
- package/dist/protocol/{messages → users/messages}/currentUserChanged.js +2 -2
- package/dist/protocol/{messages → users/messages}/getUser.d.ts +2 -2
- package/dist/protocol/{messages → users/messages}/getUser.js +3 -2
- package/dist/protocol/{messages → users/messages}/listUsers.d.ts +2 -2
- package/dist/protocol/{messages → users/messages}/listUsers.js +2 -2
- package/dist/protocol/users/userId.d.ts +3 -0
- package/dist/protocol/users/userId.js +2 -0
- package/dist/protocol/{errors.d.ts → utils/errors.d.ts} +6 -0
- package/dist/protocol/utils/errors.js +11 -0
- package/dist/protocol/utils/nullableStringSchema.d.ts +2 -0
- package/dist/protocol/utils/nullableStringSchema.js +2 -0
- package/dist/users/types.d.ts +15 -0
- package/dist/users/types.d.ts.map +1 -0
- package/dist/users/types.js +1 -0
- package/dist/utils/maybePromise.d.ts +2 -0
- package/dist/utils/maybePromise.d.ts.map +1 -0
- package/dist/utils/maybePromise.js +1 -0
- package/dist/utils/protocolVersion.d.ts.map +1 -0
- package/dist/utils/toNotionPageId.d.ts +3 -0
- package/dist/utils/toNotionPageId.d.ts.map +1 -0
- package/dist/{ids.js → utils/toNotionPageId.js} +1 -1
- package/dist/{utils.d.ts → utils/unreachable.d.ts} +1 -1
- package/dist/utils/unreachable.d.ts.map +1 -0
- package/docs/bridge/protocol.md +16 -1
- package/docs/bridge/versioning.md +2 -2
- package/docs/handlers.md +16 -8
- package/docs/lifecycle.md +14 -0
- package/package.json +1 -1
- package/src/compatibility/normalizeHostToSandboxMessage.ts +4 -4
- package/src/compatibility/{pageWithNullTextFallbackProperties.ts → pages/toPageWithNullTextFallbackProperties.ts} +2 -2
- package/src/compatibility/{addMetadataReadSchemasForProtocol3To4.ts → protocol3To4/addMetadataReadSchemasForProtocol3To4.ts} +1 -1
- package/src/compatibility/{normalizePageResultsForProtocol3To5.ts → protocol3To5/normalizePageResultsForProtocol3To5.ts} +4 -6
- package/src/compatibility/protocol3To5/toDateTimeValueForProtocol3To5.ts +25 -0
- package/src/compatibility/protocol3To5/toPageForProtocol3To5.ts +29 -0
- package/src/compatibility/protocol3To5/toPropertyValueForProtocol3To5.ts +102 -0
- package/src/compatibility/protocol3To5/toQueryPageForProtocol3To5.ts +35 -0
- package/src/compatibility/{normalizePageResultsForProtocol6.ts → protocol6/normalizePageResultsForProtocol6.ts} +2 -2
- package/src/context/initialState.ts +56 -0
- package/src/context/resize.ts +4 -0
- package/src/createCustomBlockHost.ts +108 -88
- package/src/{autoBindProperties.ts → dataSources/bindings/getAutoBoundPropertyIdsByKey.ts} +1 -1
- package/src/{dateValue.ts → dataSources/properties/toNotionDateValue.ts} +2 -2
- package/src/{queries → dataSources/queries}/querySubscriptions.ts +2 -2
- package/src/dataSources/types.ts +23 -0
- package/src/{queries → dataSources/validation}/validateQueryDataSourceFilter.ts +11 -13
- package/src/{queries → dataSources/validation}/validateQueryDataSourceSorts.ts +6 -8
- package/src/index.ts +39 -30
- package/src/lifecycle/{initializationController.ts → createInitializationController.ts} +15 -20
- package/src/lifecycle/errors/contextUnavailableError.ts +10 -0
- package/src/lifecycle/errors/initialStateTimeoutError.ts +10 -0
- package/src/lifecycle/errors/invalidConnectPayloadError.ts +10 -0
- package/src/lifecycle/errors/invalidInitResultPayloadError.ts +10 -0
- package/src/lifecycle/errors/invalidLocalPreviewUrlError.ts +10 -0
- package/src/lifecycle/errors/invalidPropertyBindingError.ts +11 -0
- package/src/lifecycle/errors/invalidProtocolVersionError.ts +13 -0
- package/src/lifecycle/errors/missingDataSourceBindingError.ts +10 -0
- package/src/lifecycle/errors/missingPropertyBindingError.ts +10 -0
- package/src/lifecycle/errors/noConnectError.ts +15 -0
- package/src/lifecycle/errors/noInitResultError.ts +10 -0
- package/src/lifecycle/errors/unknownInitializationError.ts +10 -0
- package/src/lifecycle/errors/unsupportedProtocolVersionError.ts +14 -0
- package/src/{isAllowedLocalPreviewUrl.ts → lifecycle/isAllowedLocalPreviewUrl.ts} +1 -1
- package/src/lifecycle/types.ts +17 -103
- package/src/{lifecycle → manifest}/resolveManifest.ts +2 -2
- package/src/manifest/types.ts +28 -0
- package/src/messages/{sandboxMessageRouter.ts → createSandboxMessageRouter.ts} +19 -21
- package/src/messages/handlers.ts +46 -0
- package/src/messages/logging.ts +1 -0
- package/src/messages/result.ts +11 -0
- package/src/navigation/types.ts +10 -0
- package/src/pages/types.ts +22 -0
- package/src/users/types.ts +17 -0
- package/src/utils/maybePromise.ts +1 -0
- package/src/utils/toNotionPageId.ts +7 -0
- package/dist/autoBindProperties.d.ts.map +0 -1
- package/dist/compatibility/normalizePageResultsForProtocol3To5.d.ts.map +0 -1
- package/dist/compatibility/normalizePageResultsForProtocol6.d.ts.map +0 -1
- package/dist/compatibility/pageForProtocol3To5.d.ts.map +0 -1
- package/dist/compatibility/pageResult.d.ts.map +0 -1
- package/dist/compatibility/pageWithNullTextFallbackProperties.d.ts.map +0 -1
- package/dist/dateValue.d.ts.map +0 -1
- package/dist/ids.d.ts +0 -3
- package/dist/ids.d.ts.map +0 -1
- package/dist/isAllowedLocalPreviewUrl.d.ts.map +0 -1
- package/dist/lifecycle/initErrors.d.ts +0 -25
- package/dist/lifecycle/initErrors.d.ts.map +0 -1
- package/dist/lifecycle/initErrors.js +0 -111
- package/dist/lifecycle/initializationController.d.ts.map +0 -1
- package/dist/lifecycle/protocolVersion.d.ts.map +0 -1
- package/dist/lifecycle/resolveManifest.d.ts.map +0 -1
- package/dist/messages/invalidSandboxMessage.d.ts.map +0 -1
- package/dist/messages/parseExternalUrl.d.ts.map +0 -1
- package/dist/messages/sandboxMessageRouter.d.ts.map +0 -1
- package/dist/messages/types.d.ts +0 -65
- package/dist/messages/types.d.ts.map +0 -1
- package/dist/protocol/dataSources/dataSource.d.ts +0 -786
- package/dist/protocol/dataSources/dataSource.js +0 -66
- package/dist/protocol/errors.js +0 -6
- package/dist/protocol/messages/createPage.js +0 -51
- package/dist/protocol/messages/createPageResult.js +0 -43
- package/dist/protocol/messages/queryDataSource.d.ts +0 -1470
- package/dist/protocol/messages/queryDataSource.js +0 -254
- package/dist/protocol/messages/updatePage.js +0 -23
- package/dist/protocol/pages/page.d.ts +0 -1422
- package/dist/protocol/pages/page.js +0 -318
- package/dist/protocol/parent.js +0 -13
- package/dist/protocol/users/user.js +0 -20
- package/dist/protocolVersion.d.ts.map +0 -1
- package/dist/queries/querySubscriptions.d.ts.map +0 -1
- package/dist/queries/types.d.ts +0 -5
- package/dist/queries/types.d.ts.map +0 -1
- package/dist/queries/validateQueryDataSourceFilter.d.ts +0 -5
- package/dist/queries/validateQueryDataSourceFilter.d.ts.map +0 -1
- package/dist/queries/validateQueryDataSourceSorts.d.ts +0 -8
- package/dist/queries/validateQueryDataSourceSorts.d.ts.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/src/compatibility/pageForProtocol3To5.ts +0 -190
- package/src/ids.ts +0 -9
- package/src/lifecycle/initErrors.ts +0 -131
- package/src/messages/types.ts +0 -171
- package/src/queries/types.ts +0 -11
- /package/dist/compatibility/{pageResult.js → pages/pageResult.js} +0 -0
- /package/dist/{messages/types.js → context/resize.js} +0 -0
- /package/dist/{autoBindProperties.js → dataSources/bindings/getAutoBoundPropertyIdsByKey.js} +0 -0
- /package/dist/{dateValue.js → dataSources/properties/toNotionDateValue.js} +0 -0
- /package/dist/{queries → dataSources/queries}/querySubscriptions.js +0 -0
- /package/dist/{queries → dataSources}/types.js +0 -0
- /package/dist/{isAllowedLocalPreviewUrl.d.ts → lifecycle/isAllowedLocalPreviewUrl.d.ts} +0 -0
- /package/dist/lifecycle/{protocolVersion.js → isValidBridgeProtocolVersion.js} +0 -0
- /package/dist/{lifecycle → manifest}/resolveManifest.js +0 -0
- /package/dist/messages/{invalidSandboxMessage.js → getInvalidSandboxMessageResponse.js} +0 -0
- /package/dist/{messages → navigation}/parseExternalUrl.d.ts +0 -0
- /package/dist/{messages → navigation}/parseExternalUrl.js +0 -0
- /package/dist/protocol/{dataSources → compatibility/protocol3To5}/dataSourcePage.d.ts +0 -0
- /package/dist/protocol/{dataSources → compatibility/protocol3To5}/dataSourceValue.d.ts +0 -0
- /package/dist/protocol/{contrast.d.ts → context/contrast.d.ts} +0 -0
- /package/dist/protocol/{contrast.js → context/contrast.js} +0 -0
- /package/dist/protocol/{messages → context/messages}/contrastModeChanged.d.ts +0 -0
- /package/dist/protocol/{messages → context/messages}/contrastModeChanged.js +0 -0
- /package/dist/protocol/{messages → context/messages}/pageChanged.d.ts +0 -0
- /package/dist/protocol/{messages → context/messages}/parentChanged.d.ts +0 -0
- /package/dist/protocol/{messages → context/messages}/parentChanged.js +0 -0
- /package/dist/protocol/{messages → context/messages}/resize.d.ts +0 -0
- /package/dist/protocol/{messages → context/messages}/resize.js +0 -0
- /package/dist/protocol/{messages → context/messages}/themeChanged.d.ts +0 -0
- /package/dist/protocol/{messages → context/messages}/themeChanged.js +0 -0
- /package/dist/protocol/{theme.d.ts → context/theme.d.ts} +0 -0
- /package/dist/protocol/{theme.js → context/theme.js} +0 -0
- /package/dist/protocol/{messages → dataSources/messages}/unsubscribeDataSourceQuery.d.ts +0 -0
- /package/dist/protocol/{messages → dataSources/messages}/unsubscribeDataSourceQuery.js +0 -0
- /package/dist/protocol/dataSources/{dateValue.d.ts → properties/dateValue.d.ts} +0 -0
- /package/dist/protocol/dataSources/{dateValue.js → properties/dateValue.js} +0 -0
- /package/dist/protocol/dataSources/{propertySchema.d.ts → properties/propertySchema.d.ts} +0 -0
- /package/dist/protocol/dataSources/{propertySchema.js → properties/propertySchema.js} +0 -0
- /package/dist/protocol/{messages → handshake}/initResult.js +0 -0
- /package/dist/protocol/{messages → handshake}/isInitHandshakeMessage.js +0 -0
- /package/dist/protocol/{messages → navigation}/openExternalUrl.js +0 -0
- /package/dist/protocol/{messages → users/messages}/currentUserChanged.d.ts +0 -0
- /package/dist/protocol/{ids.d.ts → utils/ids.d.ts} +0 -0
- /package/dist/protocol/{ids.js → utils/ids.js} +0 -0
- /package/dist/protocol/{isLocalBlockServerUrl.d.ts → utils/isLocalBlockServerUrl.d.ts} +0 -0
- /package/dist/protocol/{isLocalBlockServerUrl.js → utils/isLocalBlockServerUrl.js} +0 -0
- /package/dist/protocol/{protocolVersion.d.ts → utils/protocolVersion.d.ts} +0 -0
- /package/dist/protocol/{protocolVersion.js → utils/protocolVersion.js} +0 -0
- /package/dist/protocol/{dataSources → utils}/recordPointer.d.ts +0 -0
- /package/dist/protocol/{dataSources → utils}/recordPointer.js +0 -0
- /package/dist/{protocolVersion.d.ts → utils/protocolVersion.d.ts} +0 -0
- /package/dist/{protocolVersion.js → utils/protocolVersion.js} +0 -0
- /package/dist/{utils.js → utils/unreachable.js} +0 -0
- /package/src/compatibility/{pageResult.ts → pages/pageResult.ts} +0 -0
- /package/src/lifecycle/{protocolVersion.ts → isValidBridgeProtocolVersion.ts} +0 -0
- /package/src/messages/{invalidSandboxMessage.ts → getInvalidSandboxMessageResponse.ts} +0 -0
- /package/src/{messages → navigation}/parseExternalUrl.ts +0 -0
- /package/src/{protocolVersion.ts → utils/protocolVersion.ts} +0 -0
- /package/src/{utils.ts → utils/unreachable.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { bridgePageSchema } from "
|
|
1
|
+
import type { bridgePageSchema } from "../../protocol/pages/bridgePage.js";
|
|
2
2
|
import type { InferOutput } from "valibot";
|
|
3
3
|
/**
|
|
4
4
|
* Shared field conversion for receivers that cannot decode text fallback objects.
|
|
@@ -6,4 +6,4 @@ import type { InferOutput } from "valibot";
|
|
|
6
6
|
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 7.
|
|
7
7
|
*/
|
|
8
8
|
export declare function toPageWithNullTextFallbackProperties(page: InferOutput<typeof bridgePageSchema>): InferOutput<typeof bridgePageSchema>;
|
|
9
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=toPageWithNullTextFallbackProperties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toPageWithNullTextFallbackProperties.d.ts","sourceRoot":"","sources":["../../../src/compatibility/pages/toPageWithNullTextFallbackProperties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sDAAsD,CAAA;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C;;;;GAIG;AACH,wBAAgB,oCAAoC,CACnD,IAAI,EAAE,WAAW,CAAC,OAAO,gBAAgB,CAAC,GACxC,WAAW,CAAC,OAAO,gBAAgB,CAAC,CAyCtC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { HostToSandboxMessage } from "
|
|
1
|
+
import type { HostToSandboxMessage } from "../../protocol/messages/hostToSandbox.js";
|
|
2
2
|
/**
|
|
3
3
|
* Protocols 3–4 derive metadata read schemas from host bindings. Restore those
|
|
4
4
|
* schemas only in outgoing copies so host query validation keeps the actual schema.
|
|
@@ -11,7 +11,98 @@ export declare function addMetadataReadSchemasForProtocol3To4(message: Extract<H
|
|
|
11
11
|
} | {
|
|
12
12
|
type: "dataSourcesChanged";
|
|
13
13
|
}>): {
|
|
14
|
-
type: "
|
|
14
|
+
type: "init";
|
|
15
|
+
initializationId: string;
|
|
16
|
+
status: "success";
|
|
17
|
+
theme: "dark" | "light";
|
|
18
|
+
contrastMode: "high" | "standard";
|
|
19
|
+
blockId: string & import("valibot").Brand<"NotionBlockId">;
|
|
20
|
+
parent: {
|
|
21
|
+
type: "page_id";
|
|
22
|
+
page_id: string & import("valibot").Brand<"NotionPageId">;
|
|
23
|
+
} | {
|
|
24
|
+
type: "data_source_id";
|
|
25
|
+
data_source_id: string & import("valibot").Brand<"NotionDataSourceId">;
|
|
26
|
+
} | {
|
|
27
|
+
type: "workspace";
|
|
28
|
+
workspace: true;
|
|
29
|
+
} | {
|
|
30
|
+
type: "block_id";
|
|
31
|
+
block_id: string & import("valibot").Brand<"NotionBlockId">;
|
|
32
|
+
} | {
|
|
33
|
+
type: "agent_id";
|
|
34
|
+
agent_id: string & import("valibot").Brand<"NotionAgentId">;
|
|
35
|
+
} | {
|
|
36
|
+
type: "unavailable";
|
|
37
|
+
};
|
|
38
|
+
page: {
|
|
39
|
+
type: "unavailable";
|
|
40
|
+
} | {
|
|
41
|
+
type: "page";
|
|
42
|
+
id: string & import("valibot").Brand<"NotionPageId">;
|
|
43
|
+
parent: {
|
|
44
|
+
type: "page_id";
|
|
45
|
+
page_id: string & import("valibot").Brand<"NotionPageId">;
|
|
46
|
+
} | {
|
|
47
|
+
type: "data_source_id";
|
|
48
|
+
data_source_id: string & import("valibot").Brand<"NotionDataSourceId">;
|
|
49
|
+
} | {
|
|
50
|
+
type: "workspace";
|
|
51
|
+
workspace: true;
|
|
52
|
+
} | {
|
|
53
|
+
type: "block_id";
|
|
54
|
+
block_id: string & import("valibot").Brand<"NotionBlockId">;
|
|
55
|
+
} | {
|
|
56
|
+
type: "agent_id";
|
|
57
|
+
agent_id: string & import("valibot").Brand<"NotionAgentId">;
|
|
58
|
+
} | {
|
|
59
|
+
type: "unavailable";
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
manifest: {
|
|
63
|
+
version: 1;
|
|
64
|
+
name?: string | undefined;
|
|
65
|
+
description?: string | undefined;
|
|
66
|
+
slashCommand?: string | undefined;
|
|
67
|
+
icon?: {
|
|
68
|
+
type: "emoji";
|
|
69
|
+
emoji: string;
|
|
70
|
+
} | undefined;
|
|
71
|
+
dataSources: {
|
|
72
|
+
[x: string]: {
|
|
73
|
+
name: string;
|
|
74
|
+
description?: string | undefined;
|
|
75
|
+
icon?: {
|
|
76
|
+
type: "emoji";
|
|
77
|
+
emoji: string;
|
|
78
|
+
} | {
|
|
79
|
+
type: "external";
|
|
80
|
+
url: string;
|
|
81
|
+
} | undefined;
|
|
82
|
+
properties: {
|
|
83
|
+
[x: string]: {
|
|
84
|
+
name: string;
|
|
85
|
+
description?: string | undefined;
|
|
86
|
+
type: "button" | "checkbox" | "created_by" | "created_time" | "date" | "email" | "files" | "formula" | "last_edited_by" | "last_edited_time" | "last_visited_time" | "location" | "multi_select" | "number" | "people" | "phone_number" | "place" | "relation" | "rich_text" | "rollup" | "select" | "status" | "title" | "unique_id" | "url" | "verification";
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
capabilities?: {
|
|
92
|
+
capability: string;
|
|
93
|
+
resource: string;
|
|
94
|
+
}[] | undefined;
|
|
95
|
+
};
|
|
96
|
+
currentUser: {
|
|
97
|
+
object: "user";
|
|
98
|
+
id: string & import("valibot").Brand<"NotionUserId">;
|
|
99
|
+
name?: string | undefined;
|
|
100
|
+
avatar_url: string | null;
|
|
101
|
+
type: "person";
|
|
102
|
+
person: {
|
|
103
|
+
email: string;
|
|
104
|
+
};
|
|
105
|
+
};
|
|
15
106
|
dataSources: {
|
|
16
107
|
bindings: {
|
|
17
108
|
[k: string]: {
|
|
@@ -23,6 +114,7 @@ export declare function addMetadataReadSchemasForProtocol3To4(message: Extract<H
|
|
|
23
114
|
propertyIdsByKey?: {
|
|
24
115
|
[x: string]: string | undefined;
|
|
25
116
|
} | undefined;
|
|
117
|
+
inaccessible?: true | undefined;
|
|
26
118
|
collectionSchema: {
|
|
27
119
|
id?: (string & import("valibot").Brand<"NotionDataSourceId">) | undefined;
|
|
28
120
|
propertiesById: {
|
|
@@ -568,94 +660,7 @@ export declare function addMetadataReadSchemasForProtocol3To4(message: Extract<H
|
|
|
568
660
|
};
|
|
569
661
|
};
|
|
570
662
|
} | {
|
|
571
|
-
type: "
|
|
572
|
-
initializationId: string;
|
|
573
|
-
status: "success";
|
|
574
|
-
theme: "dark" | "light";
|
|
575
|
-
contrastMode: "high" | "standard";
|
|
576
|
-
blockId: string & import("valibot").Brand<"NotionBlockId">;
|
|
577
|
-
parent: {
|
|
578
|
-
type: "page_id";
|
|
579
|
-
page_id: string & import("valibot").Brand<"NotionPageId">;
|
|
580
|
-
} | {
|
|
581
|
-
type: "data_source_id";
|
|
582
|
-
data_source_id: string & import("valibot").Brand<"NotionDataSourceId">;
|
|
583
|
-
} | {
|
|
584
|
-
type: "workspace";
|
|
585
|
-
workspace: true;
|
|
586
|
-
} | {
|
|
587
|
-
type: "block_id";
|
|
588
|
-
block_id: string & import("valibot").Brand<"NotionBlockId">;
|
|
589
|
-
} | {
|
|
590
|
-
type: "agent_id";
|
|
591
|
-
agent_id: string & import("valibot").Brand<"NotionAgentId">;
|
|
592
|
-
} | {
|
|
593
|
-
type: "unavailable";
|
|
594
|
-
};
|
|
595
|
-
page: {
|
|
596
|
-
type: "unavailable";
|
|
597
|
-
} | {
|
|
598
|
-
type: "page";
|
|
599
|
-
id: string & import("valibot").Brand<"NotionPageId">;
|
|
600
|
-
parent: {
|
|
601
|
-
type: "page_id";
|
|
602
|
-
page_id: string & import("valibot").Brand<"NotionPageId">;
|
|
603
|
-
} | {
|
|
604
|
-
type: "data_source_id";
|
|
605
|
-
data_source_id: string & import("valibot").Brand<"NotionDataSourceId">;
|
|
606
|
-
} | {
|
|
607
|
-
type: "workspace";
|
|
608
|
-
workspace: true;
|
|
609
|
-
} | {
|
|
610
|
-
type: "block_id";
|
|
611
|
-
block_id: string & import("valibot").Brand<"NotionBlockId">;
|
|
612
|
-
} | {
|
|
613
|
-
type: "agent_id";
|
|
614
|
-
agent_id: string & import("valibot").Brand<"NotionAgentId">;
|
|
615
|
-
} | {
|
|
616
|
-
type: "unavailable";
|
|
617
|
-
};
|
|
618
|
-
};
|
|
619
|
-
manifest: {
|
|
620
|
-
version: 1;
|
|
621
|
-
name?: string | undefined;
|
|
622
|
-
description?: string | undefined;
|
|
623
|
-
slashCommand?: string | undefined;
|
|
624
|
-
icon?: {
|
|
625
|
-
type: "emoji";
|
|
626
|
-
emoji: string;
|
|
627
|
-
} | undefined;
|
|
628
|
-
dataSources: {
|
|
629
|
-
[x: string]: {
|
|
630
|
-
name: string;
|
|
631
|
-
description?: string | undefined;
|
|
632
|
-
icon?: {
|
|
633
|
-
type: "emoji";
|
|
634
|
-
emoji: string;
|
|
635
|
-
} | {
|
|
636
|
-
type: "external";
|
|
637
|
-
url: string;
|
|
638
|
-
} | undefined;
|
|
639
|
-
properties: {
|
|
640
|
-
[x: string]: {
|
|
641
|
-
name: string;
|
|
642
|
-
description?: string | undefined;
|
|
643
|
-
type: "button" | "checkbox" | "created_by" | "created_time" | "date" | "email" | "files" | "formula" | "last_edited_by" | "last_edited_time" | "last_visited_time" | "location" | "multi_select" | "number" | "people" | "phone_number" | "place" | "relation" | "rich_text" | "rollup" | "select" | "status" | "title" | "unique_id" | "url" | "verification";
|
|
644
|
-
};
|
|
645
|
-
};
|
|
646
|
-
};
|
|
647
|
-
};
|
|
648
|
-
};
|
|
649
|
-
currentUser: {
|
|
650
|
-
object: "user";
|
|
651
|
-
id: string & import("valibot").Brand<"NotionUserId">;
|
|
652
|
-
name?: string | undefined;
|
|
653
|
-
avatar_url: string | null;
|
|
654
|
-
type: "person";
|
|
655
|
-
person: {
|
|
656
|
-
email: string;
|
|
657
|
-
};
|
|
658
|
-
};
|
|
663
|
+
type: "dataSourcesChanged";
|
|
659
664
|
dataSources: {
|
|
660
665
|
bindings: {
|
|
661
666
|
[k: string]: {
|
|
@@ -667,6 +672,7 @@ export declare function addMetadataReadSchemasForProtocol3To4(message: Extract<H
|
|
|
667
672
|
propertyIdsByKey?: {
|
|
668
673
|
[x: string]: string | undefined;
|
|
669
674
|
} | undefined;
|
|
675
|
+
inaccessible?: true | undefined;
|
|
670
676
|
collectionSchema: {
|
|
671
677
|
id?: (string & import("valibot").Brand<"NotionDataSourceId">) | undefined;
|
|
672
678
|
propertiesById: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addMetadataReadSchemasForProtocol3To4.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"addMetadataReadSchemasForProtocol3To4.d.ts","sourceRoot":"","sources":["../../../src/compatibility/protocol3To4/addMetadataReadSchemasForProtocol3To4.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAA;AAEtG;;;;;GAKG;AACH,wBAAgB,qCAAqC,CACpD,OAAO,EAAE,OAAO,CACf,oBAAoB,EACpB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,CACpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAKC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAAR,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBV"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NOTION_BUILTIN_PROPERTY_SCHEMAS } from "
|
|
1
|
+
import { NOTION_BUILTIN_PROPERTY_SCHEMAS } from "../../protocol/dataSources/properties/propertySchema.js";
|
|
2
2
|
/**
|
|
3
3
|
* Protocols 3–4 derive metadata read schemas from host bindings. Restore those
|
|
4
4
|
* schemas only in outgoing copies so host query validation keeps the actual schema.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HostToSandboxMessageWithProtocol3To5Compatibility } from "
|
|
2
|
-
import type { SuccessfulPageResult } from "
|
|
1
|
+
import type { HostToSandboxMessageWithProtocol3To5Compatibility } from "../../protocol/messages/hostToSandbox.js";
|
|
2
|
+
import type { SuccessfulPageResult } from "../pages/pageResult.js";
|
|
3
3
|
/**
|
|
4
4
|
* Encodes current pages for protocols 3–5. Query values are flat and ID-keyed.
|
|
5
5
|
* Page operations omit unsupported property objects and use ID-keyed properties.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizePageResultsForProtocol3To5.d.ts","sourceRoot":"","sources":["../../../src/compatibility/protocol3To5/normalizePageResultsForProtocol3To5.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iDAAiD,EAAE,MAAM,4DAA4D,CAAA;AACnI,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAKlE;;;;;;GAMG;AACH,wBAAgB,mCAAmC,CAClD,OAAO,EAAE,oBAAoB,GAC3B,iDAAiD,CAUnD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { toPageWithNullTextFallbackProperties } from "../pages/toPageWithNullTextFallbackProperties.js";
|
|
2
|
+
import { toPageForProtocol3To5 } from "./toPageForProtocol3To5.js";
|
|
3
|
+
import { toQueryPageForProtocol3To5 } from "./toQueryPageForProtocol3To5.js";
|
|
3
4
|
/**
|
|
4
5
|
* Encodes current pages for protocols 3–5. Query values are flat and ID-keyed.
|
|
5
6
|
* Page operations omit unsupported property objects and use ID-keyed properties.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NotionDataSourceValue } from "../../protocol/compatibility/protocol3To5/dataSourceValue.js";
|
|
2
|
+
/**
|
|
3
|
+
* Converts a timestamp to the UTC date/time object used by protocol 3–5 queries.
|
|
4
|
+
* Missing or invalid timestamps produce undefined; time is stored to the minute.
|
|
5
|
+
*
|
|
6
|
+
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
7
|
+
*/
|
|
8
|
+
export declare function toDateTimeValueForProtocol3To5(value: string | number | null | undefined): NotionDataSourceValue | undefined;
|
|
9
|
+
//# sourceMappingURL=toDateTimeValueForProtocol3To5.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toDateTimeValueForProtocol3To5.d.ts","sourceRoot":"","sources":["../../../src/compatibility/protocol3To5/toDateTimeValueForProtocol3To5.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gFAAgF,CAAA;AAE3H;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC7C,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GACvC,qBAAqB,GAAG,SAAS,CAcnC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a timestamp to the UTC date/time object used by protocol 3–5 queries.
|
|
3
|
+
* Missing or invalid timestamps produce undefined; time is stored to the minute.
|
|
4
|
+
*
|
|
5
|
+
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
6
|
+
*/
|
|
7
|
+
export function toDateTimeValueForProtocol3To5(value) {
|
|
8
|
+
if (value === undefined || value === null || value === "") {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
const date = new Date(value);
|
|
12
|
+
if (!Number.isFinite(date.getTime())) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
type: "datetime",
|
|
17
|
+
start_date: date.toISOString().slice(0, 10),
|
|
18
|
+
start_time: date.toISOString().slice(11, 16),
|
|
19
|
+
time_zone: "UTC",
|
|
20
|
+
};
|
|
21
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BridgePageForProtocol3To5 } from "../../protocol/compatibility/protocol3To5/bridgePage.js";
|
|
2
|
+
import type { BridgePage } from "../../protocol/pages/bridgePage.js";
|
|
3
|
+
/**
|
|
4
|
+
* Converts current page data to the page-operation format used by protocols 3–5.
|
|
5
|
+
* Keys property objects by raw ID and omits null properties. Optional icons,
|
|
6
|
+
* covers, timestamps, and URLs use undefined instead of null in this format.
|
|
7
|
+
* Call after clearing property objects unsupported by these protocols.
|
|
8
|
+
*
|
|
9
|
+
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
10
|
+
*/
|
|
11
|
+
export declare function toPageForProtocol3To5(page: BridgePage): BridgePageForProtocol3To5;
|
|
12
|
+
//# sourceMappingURL=toPageForProtocol3To5.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toPageForProtocol3To5.d.ts","sourceRoot":"","sources":["../../../src/compatibility/protocol3To5/toPageForProtocol3To5.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2EAA2E,CAAA;AAC1H,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sDAAsD,CAAA;AAEtF;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACpC,IAAI,EAAE,UAAU,GACd,yBAAyB,CAe3B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts current page data to the page-operation format used by protocols 3–5.
|
|
3
|
+
* Keys property objects by raw ID and omits null properties. Optional icons,
|
|
4
|
+
* covers, timestamps, and URLs use undefined instead of null in this format.
|
|
5
|
+
* Call after clearing property objects unsupported by these protocols.
|
|
6
|
+
*
|
|
7
|
+
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
8
|
+
*/
|
|
9
|
+
export function toPageForProtocol3To5(page) {
|
|
10
|
+
return {
|
|
11
|
+
...page,
|
|
12
|
+
properties: Object.fromEntries(Object.values(page.properties).flatMap(property => property ? [[property.id, property]] : [])),
|
|
13
|
+
icon: page.icon ?? undefined,
|
|
14
|
+
cover: page.cover ?? undefined,
|
|
15
|
+
created_time: page.created_time ?? undefined,
|
|
16
|
+
last_edited_time: page.last_edited_time ?? undefined,
|
|
17
|
+
url: page.url ?? undefined,
|
|
18
|
+
public_url: page.public_url ?? undefined,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { NotionDataSourceValue } from "../../protocol/compatibility/protocol3To5/dataSourceValue.js";
|
|
2
|
+
import type { BridgePagePropertyValue } from "../../protocol/pages/properties/bridgePagePropertyValue.js";
|
|
3
|
+
/**
|
|
4
|
+
* Converts a typed page property to the scalar, list, record-reference, or
|
|
5
|
+
* date/time value used by protocol 3–5 query results.
|
|
6
|
+
*
|
|
7
|
+
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
8
|
+
*/
|
|
9
|
+
export declare function toPropertyValueForProtocol3To5(property: BridgePagePropertyValue): NotionDataSourceValue | undefined;
|
|
10
|
+
//# sourceMappingURL=toPropertyValueForProtocol3To5.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toPropertyValueForProtocol3To5.d.ts","sourceRoot":"","sources":["../../../src/compatibility/protocol3To5/toPropertyValueForProtocol3To5.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gFAAgF,CAAA;AAC3H,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8EAA8E,CAAA;AAK3H;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC7C,QAAQ,EAAE,uBAAuB,GAC/B,qBAAqB,GAAG,SAAS,CAiEnC"}
|
package/dist/compatibility/{pageForProtocol3To5.js → protocol3To5/toPropertyValueForProtocol3To5.js}
RENAMED
|
@@ -1,104 +1,13 @@
|
|
|
1
|
-
import { toNotionDateValue } from "
|
|
2
|
-
import { unreachable } from "
|
|
3
|
-
|
|
4
|
-
* Converts current page data to the page-operation format used by protocols 3–5.
|
|
5
|
-
* Keys property objects by raw ID and omits null properties. Optional icons,
|
|
6
|
-
* covers, timestamps, and URLs use undefined instead of null in this format.
|
|
7
|
-
* Call after clearing property objects unsupported by these protocols.
|
|
8
|
-
*
|
|
9
|
-
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
10
|
-
*/
|
|
11
|
-
export function toPageForProtocol3To5(page) {
|
|
12
|
-
return {
|
|
13
|
-
...page,
|
|
14
|
-
properties: Object.fromEntries(Object.values(page.properties).flatMap(property => property ? [[property.id, property]] : [])),
|
|
15
|
-
icon: page.icon ?? undefined,
|
|
16
|
-
cover: page.cover ?? undefined,
|
|
17
|
-
created_time: page.created_time ?? undefined,
|
|
18
|
-
last_edited_time: page.last_edited_time ?? undefined,
|
|
19
|
-
url: page.url ?? undefined,
|
|
20
|
-
public_url: page.public_url ?? undefined,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Converts a current page to a protocol 3–5 query row, keeping its ID and archive
|
|
25
|
-
* flags while flattening typed property objects into raw-ID-keyed values.
|
|
26
|
-
* Copies page creation and edit metadata into the reserved property IDs that
|
|
27
|
-
* these query readers expect.
|
|
28
|
-
*
|
|
29
|
-
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
30
|
-
*/
|
|
31
|
-
export function toQueryPageForProtocol3To5(page) {
|
|
32
|
-
const propertiesById = {};
|
|
33
|
-
for (const property of Object.values(page.properties)) {
|
|
34
|
-
if (property) {
|
|
35
|
-
propertiesById[property.id] = toPropertyValueForProtocol3To5(property);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
id: page.id,
|
|
40
|
-
is_archived: page.is_archived,
|
|
41
|
-
in_trash: page.in_trash,
|
|
42
|
-
// Reserved metadata IDs retain their historical meaning even if an actual
|
|
43
|
-
// property uses the same ID. Binding schemas use the same precedence.
|
|
44
|
-
propertiesById: {
|
|
45
|
-
...propertiesById,
|
|
46
|
-
created_time: toDateTimeValueForProtocol3To5(page.created_time),
|
|
47
|
-
last_edited_time: toDateTimeValueForProtocol3To5(page.last_edited_time),
|
|
48
|
-
created_by: page.created_by ? [page.created_by] : undefined,
|
|
49
|
-
last_edited_by: page.last_edited_by ? [page.last_edited_by] : undefined,
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Flattens rich-text items to the string used by protocol 3–5 query values.
|
|
55
|
-
*
|
|
56
|
-
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
57
|
-
*/
|
|
58
|
-
function plainText(items) {
|
|
59
|
-
return items
|
|
60
|
-
.map(item => {
|
|
61
|
-
if (typeof item.plain_text === "string") {
|
|
62
|
-
return item.plain_text;
|
|
63
|
-
}
|
|
64
|
-
const text = item.text;
|
|
65
|
-
return text &&
|
|
66
|
-
typeof text === "object" &&
|
|
67
|
-
"content" in text &&
|
|
68
|
-
typeof text.content === "string"
|
|
69
|
-
? text.content
|
|
70
|
-
: "";
|
|
71
|
-
})
|
|
72
|
-
.join("");
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Converts a timestamp to the UTC date/time object used by protocol 3–5 queries.
|
|
76
|
-
* Missing or invalid timestamps produce undefined; time is stored to the minute.
|
|
77
|
-
*
|
|
78
|
-
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
79
|
-
*/
|
|
80
|
-
function toDateTimeValueForProtocol3To5(value) {
|
|
81
|
-
if (value === undefined || value === null || value === "") {
|
|
82
|
-
return undefined;
|
|
83
|
-
}
|
|
84
|
-
const date = new Date(value);
|
|
85
|
-
if (!Number.isFinite(date.getTime())) {
|
|
86
|
-
return undefined;
|
|
87
|
-
}
|
|
88
|
-
return {
|
|
89
|
-
type: "datetime",
|
|
90
|
-
start_date: date.toISOString().slice(0, 10),
|
|
91
|
-
start_time: date.toISOString().slice(11, 16),
|
|
92
|
-
time_zone: "UTC",
|
|
93
|
-
};
|
|
94
|
-
}
|
|
1
|
+
import { toNotionDateValue } from "../../dataSources/properties/toNotionDateValue.js";
|
|
2
|
+
import { unreachable } from "../../utils/unreachable.js";
|
|
3
|
+
import { toDateTimeValueForProtocol3To5 } from "./toDateTimeValueForProtocol3To5.js";
|
|
95
4
|
/**
|
|
96
5
|
* Converts a typed page property to the scalar, list, record-reference, or
|
|
97
6
|
* date/time value used by protocol 3–5 query results.
|
|
98
7
|
*
|
|
99
8
|
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
100
9
|
*/
|
|
101
|
-
function toPropertyValueForProtocol3To5(property) {
|
|
10
|
+
export function toPropertyValueForProtocol3To5(property) {
|
|
102
11
|
switch (property.type) {
|
|
103
12
|
case "title":
|
|
104
13
|
return plainText(property.title);
|
|
@@ -162,3 +71,24 @@ function toPropertyValueForProtocol3To5(property) {
|
|
|
162
71
|
return unreachable(property);
|
|
163
72
|
}
|
|
164
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Flattens rich-text items to the string used by protocol 3–5 query values.
|
|
76
|
+
*
|
|
77
|
+
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
78
|
+
*/
|
|
79
|
+
function plainText(items) {
|
|
80
|
+
return items
|
|
81
|
+
.map(item => {
|
|
82
|
+
if (typeof item.plain_text === "string") {
|
|
83
|
+
return item.plain_text;
|
|
84
|
+
}
|
|
85
|
+
const text = item.text;
|
|
86
|
+
return text &&
|
|
87
|
+
typeof text === "object" &&
|
|
88
|
+
"content" in text &&
|
|
89
|
+
typeof text.content === "string"
|
|
90
|
+
? text.content
|
|
91
|
+
: "";
|
|
92
|
+
})
|
|
93
|
+
.join("");
|
|
94
|
+
}
|
package/dist/compatibility/{pageForProtocol3To5.d.ts → protocol3To5/toQueryPageForProtocol3To5.d.ts}
RENAMED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { InferOutput } from "valibot";
|
|
3
|
-
/**
|
|
4
|
-
* Converts current page data to the page-operation format used by protocols 3–5.
|
|
5
|
-
* Keys property objects by raw ID and omits null properties. Optional icons,
|
|
6
|
-
* covers, timestamps, and URLs use undefined instead of null in this format.
|
|
7
|
-
* Call after clearing property objects unsupported by these protocols.
|
|
8
|
-
*
|
|
9
|
-
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
10
|
-
*/
|
|
11
|
-
export declare function toPageForProtocol3To5(page: InferOutput<typeof bridgePageSchema>): NotionPageForProtocol3To5;
|
|
1
|
+
import type { BridgePage } from "../../protocol/pages/bridgePage.js";
|
|
12
2
|
/**
|
|
13
3
|
* Converts a current page to a protocol 3–5 query row, keeping its ID and archive
|
|
14
4
|
* flags while flattening typed property objects into raw-ID-keyed values.
|
|
@@ -17,7 +7,7 @@ export declare function toPageForProtocol3To5(page: InferOutput<typeof bridgePag
|
|
|
17
7
|
*
|
|
18
8
|
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
19
9
|
*/
|
|
20
|
-
export declare function toQueryPageForProtocol3To5(page:
|
|
10
|
+
export declare function toQueryPageForProtocol3To5(page: BridgePage): {
|
|
21
11
|
id: string & import("valibot").Brand<"NotionPageId">;
|
|
22
12
|
is_archived: boolean;
|
|
23
13
|
in_trash: boolean;
|
|
@@ -58,11 +48,11 @@ export declare function toQueryPageForProtocol3To5(page: InferOutput<typeof brid
|
|
|
58
48
|
value: number;
|
|
59
49
|
time: string;
|
|
60
50
|
defaultTimeZone?: string | undefined;
|
|
51
|
+
} | {
|
|
52
|
+
unit: "none";
|
|
61
53
|
} | {
|
|
62
54
|
unit: "hour" | "minute";
|
|
63
55
|
value: number;
|
|
64
|
-
} | {
|
|
65
|
-
unit: "none";
|
|
66
56
|
} | undefined;
|
|
67
57
|
} | {
|
|
68
58
|
type: "datetimerange";
|
|
@@ -76,11 +66,11 @@ export declare function toQueryPageForProtocol3To5(page: InferOutput<typeof brid
|
|
|
76
66
|
value: number;
|
|
77
67
|
time: string;
|
|
78
68
|
defaultTimeZone?: string | undefined;
|
|
69
|
+
} | {
|
|
70
|
+
unit: "none";
|
|
79
71
|
} | {
|
|
80
72
|
unit: "hour" | "minute";
|
|
81
73
|
value: number;
|
|
82
|
-
} | {
|
|
83
|
-
unit: "none";
|
|
84
74
|
} | undefined;
|
|
85
75
|
} | undefined;
|
|
86
76
|
last_edited_time: string | number | boolean | string[] | {
|
|
@@ -119,11 +109,11 @@ export declare function toQueryPageForProtocol3To5(page: InferOutput<typeof brid
|
|
|
119
109
|
value: number;
|
|
120
110
|
time: string;
|
|
121
111
|
defaultTimeZone?: string | undefined;
|
|
112
|
+
} | {
|
|
113
|
+
unit: "none";
|
|
122
114
|
} | {
|
|
123
115
|
unit: "hour" | "minute";
|
|
124
116
|
value: number;
|
|
125
|
-
} | {
|
|
126
|
-
unit: "none";
|
|
127
117
|
} | undefined;
|
|
128
118
|
} | {
|
|
129
119
|
type: "datetimerange";
|
|
@@ -137,11 +127,11 @@ export declare function toQueryPageForProtocol3To5(page: InferOutput<typeof brid
|
|
|
137
127
|
value: number;
|
|
138
128
|
time: string;
|
|
139
129
|
defaultTimeZone?: string | undefined;
|
|
130
|
+
} | {
|
|
131
|
+
unit: "none";
|
|
140
132
|
} | {
|
|
141
133
|
unit: "hour" | "minute";
|
|
142
134
|
value: number;
|
|
143
|
-
} | {
|
|
144
|
-
unit: "none";
|
|
145
135
|
} | undefined;
|
|
146
136
|
} | undefined;
|
|
147
137
|
created_by: {
|
|
@@ -156,4 +146,4 @@ export declare function toQueryPageForProtocol3To5(page: InferOutput<typeof brid
|
|
|
156
146
|
}[] | undefined;
|
|
157
147
|
};
|
|
158
148
|
};
|
|
159
|
-
//# sourceMappingURL=
|
|
149
|
+
//# sourceMappingURL=toQueryPageForProtocol3To5.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toQueryPageForProtocol3To5.d.ts","sourceRoot":"","sources":["../../../src/compatibility/protocol3To5/toQueryPageForProtocol3To5.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sDAAsD,CAAA;AAItF;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqB1D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { toDateTimeValueForProtocol3To5 } from "./toDateTimeValueForProtocol3To5.js";
|
|
2
|
+
import { toPropertyValueForProtocol3To5 } from "./toPropertyValueForProtocol3To5.js";
|
|
3
|
+
/**
|
|
4
|
+
* Converts a current page to a protocol 3–5 query row, keeping its ID and archive
|
|
5
|
+
* flags while flattening typed property objects into raw-ID-keyed values.
|
|
6
|
+
* Copies page creation and edit metadata into the reserved property IDs that
|
|
7
|
+
* these query readers expect.
|
|
8
|
+
*
|
|
9
|
+
* Delete when MIN_HOST_SUPPORTED_BRIDGE_PROTOCOL_VERSION >= 6.
|
|
10
|
+
*/
|
|
11
|
+
export function toQueryPageForProtocol3To5(page) {
|
|
12
|
+
const propertiesById = {};
|
|
13
|
+
for (const property of Object.values(page.properties)) {
|
|
14
|
+
if (property) {
|
|
15
|
+
propertiesById[property.id] = toPropertyValueForProtocol3To5(property);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
id: page.id,
|
|
20
|
+
is_archived: page.is_archived,
|
|
21
|
+
in_trash: page.in_trash,
|
|
22
|
+
// Reserved metadata IDs retain their historical meaning even if an actual
|
|
23
|
+
// property uses the same ID. Binding schemas use the same precedence.
|
|
24
|
+
propertiesById: {
|
|
25
|
+
...propertiesById,
|
|
26
|
+
created_time: toDateTimeValueForProtocol3To5(page.created_time),
|
|
27
|
+
last_edited_time: toDateTimeValueForProtocol3To5(page.last_edited_time),
|
|
28
|
+
created_by: page.created_by ? [page.created_by] : undefined,
|
|
29
|
+
last_edited_by: page.last_edited_by ? [page.last_edited_by] : undefined,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HostToSandboxMessage } from "
|
|
2
|
-
import type { SuccessfulPageResult } from "
|
|
1
|
+
import type { HostToSandboxMessage } from "../../protocol/messages/hostToSandbox.js";
|
|
2
|
+
import type { SuccessfulPageResult } from "../pages/pageResult.js";
|
|
3
3
|
/**
|
|
4
4
|
* Encodes protocol 6 pages, whose receivers require null for text fallback properties.
|
|
5
5
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalizePageResultsForProtocol6.d.ts","sourceRoot":"","sources":["../../../src/compatibility/protocol6/normalizePageResultsForProtocol6.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAA;AACtG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAGlE;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC/C,OAAO,EAAE,oBAAoB,GAC3B,oBAAoB,CAWtB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toPageWithNullTextFallbackProperties } from "
|
|
1
|
+
import { toPageWithNullTextFallbackProperties } from "../pages/toPageWithNullTextFallbackProperties.js";
|
|
2
2
|
/**
|
|
3
3
|
* Encodes protocol 6 pages, whose receivers require null for text fallback properties.
|
|
4
4
|
*
|