@plitzi/sdk-shared 0.39.1 → 0.39.2
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/CHANGELOG.md +7 -0
- package/dist/_virtual/_rolldown/runtime.mjs +1 -2
- package/dist/actions/access.mjs +1 -2
- package/dist/actions/cron.mjs +1 -2
- package/dist/actions/failureHandler.mjs +1 -2
- package/dist/actions/flowDelay.d.ts +6 -0
- package/dist/actions/flowDelay.mjs +3 -0
- package/dist/actions/functions.d.ts +6 -3
- package/dist/actions/functions.mjs +12 -8
- package/dist/actions/index.d.ts +2 -1
- package/dist/actions/index.mjs +10 -9
- package/dist/actions/jobs.mjs +1 -2
- package/dist/actions/smtp.mjs +1 -2
- package/dist/actions/triggerParams.mjs +1 -2
- package/dist/actions/triggers.mjs +1 -2
- package/dist/actions/validateDocument.mjs +133 -123
- package/dist/activity/describe.mjs +1 -2
- package/dist/activity/guard.mjs +1 -2
- package/dist/activity/types.mjs +1 -2
- package/dist/auth/failureChannel.mjs +1 -2
- package/dist/auth/visitorRoles.mjs +1 -2
- package/dist/authoring/builder.mjs +1 -2
- package/dist/authoring/declare.mjs +1 -2
- package/dist/authoring/elementCallbacks.mjs +1 -2
- package/dist/authoring/index.mjs +3 -3
- package/dist/authoring/paramSpec.mjs +1 -2
- package/dist/authoring/spaceCallbacks.mjs +1 -2
- package/dist/builder/contexts/BuilderContext.mjs +1 -2
- package/dist/builder/contexts/index.mjs +1 -2
- package/dist/conditions/dates.d.ts +2 -0
- package/dist/conditions/dates.mjs +12 -0
- package/dist/conditions/evaluateRuleGroup.d.ts +13 -0
- package/dist/conditions/evaluateRuleGroup.mjs +4 -0
- package/dist/conditions/evaluator.d.ts +39 -0
- package/dist/conditions/evaluator.mjs +75 -0
- package/dist/conditions/index.d.ts +10 -0
- package/dist/conditions/index.mjs +5 -0
- package/dist/conditions/rules.d.ts +3 -0
- package/dist/conditions/rules.mjs +3 -0
- package/dist/conditions/types.d.ts +44 -0
- package/dist/connectors/constants.mjs +1 -2
- package/dist/connectors/manifestTokens.mjs +1 -2
- package/dist/connectors/presets.mjs +1 -2
- package/dist/connectors/validateManifest.mjs +56 -57
- package/dist/dataSource/computed.mjs +16 -17
- package/dist/dataSource/getBindingsDetails.d.ts +5 -6
- package/dist/dataSource/getBindingsDetails.mjs +65 -40
- package/dist/dataSource/globalSources.d.ts +1 -1
- package/dist/dataSource/globalSources.mjs +1 -2
- package/dist/dataSource/helpers/getSourceName.mjs +1 -2
- package/dist/dataSource/index.mjs +5 -5
- package/dist/dataSource/utility/arrayMap.mjs +2 -2
- package/dist/dataSource/utility/capitalize.mjs +1 -2
- package/dist/dataSource/utility/checkboxParams.mjs +1 -2
- package/dist/dataSource/utility/dateConverter.mjs +0 -1
- package/dist/dataSource/utility/index.mjs +15 -16
- package/dist/dataSource/utility/not.mjs +1 -2
- package/dist/dataSource/utility/staticValue.mjs +0 -1
- package/dist/dataSource/utility/stringToArray.mjs +0 -1
- package/dist/dataSource/utility/styleSelector.mjs +1 -2
- package/dist/dataSource/utility/styleVariant.mjs +2 -3
- package/dist/dataSource/utility/truthiness.mjs +1 -2
- package/dist/dataSource/utility/twigTemplate.mjs +0 -1
- package/dist/dataSource/variables/resolveVariables.mjs +2 -3
- package/dist/dates/formatDate.mjs +29 -30
- package/dist/dates/isDate.mjs +1 -2
- package/dist/devTools/chrome.mjs +1 -2
- package/dist/devTools/debugCookie.mjs +1 -2
- package/dist/devTools/index.mjs +5 -5
- package/dist/devTools/interactionLog.mjs +1 -2
- package/dist/devTools/react/DevToolsContext.mjs +1 -2
- package/dist/devTools/sight/sight.mjs +1 -2
- package/dist/devTools/utils/PlitziConsole.mjs +1 -2
- package/dist/elements/ComponentContext.mjs +1 -2
- package/dist/flags/flagsCookie.mjs +5 -6
- package/dist/flags/index.d.ts +1 -0
- package/dist/flags/index.mjs +4 -3
- package/dist/flags/overrides.d.ts +36 -0
- package/dist/flags/overrides.mjs +13 -0
- package/dist/flags/react/useFlagResolution.mjs +5 -6
- package/dist/flags/resolveFlags.d.ts +1 -1
- package/dist/flags/resolveFlags.mjs +2 -3
- package/dist/flags/schemaFlag.mjs +1 -2
- package/dist/functions/contract.d.ts +326 -0
- package/dist/functions/contract.mjs +3 -0
- package/dist/functions/index.d.ts +15 -0
- package/dist/functions/index.mjs +9 -0
- package/dist/functions/kv.d.ts +80 -0
- package/dist/functions/kvChange.d.ts +67 -0
- package/dist/functions/kvChange.mjs +24 -0
- package/dist/functions/later.d.ts +18 -0
- package/dist/functions/messages.d.ts +4 -0
- package/dist/functions/messages.mjs +205 -0
- package/dist/functions/protocol.d.ts +416 -0
- package/dist/functions/protocol.mjs +37 -0
- package/dist/functions/rateLimit.d.ts +17 -0
- package/dist/functions/rateLimit.mjs +0 -0
- package/dist/functions/refusal.d.ts +26 -0
- package/dist/functions/refusal.mjs +11 -0
- package/dist/functions/runtime.d.ts +44 -0
- package/dist/functions/runtime.mjs +13 -0
- package/dist/functions/sizes.d.ts +27 -0
- package/dist/functions/sizes.mjs +7 -0
- package/dist/functions/wire.d.ts +11 -0
- package/dist/functions/wire.mjs +39 -0
- package/dist/helpers/canonicalJson.mjs +1 -2
- package/dist/helpers/clipboard.mjs +1 -2
- package/dist/helpers/cookies.mjs +1 -2
- package/dist/helpers/deepEqual/deepEqual.d.ts +5 -0
- package/dist/helpers/deepEqual/deepEqual.mjs +44 -0
- package/dist/helpers/deepEqual/index.d.ts +1 -0
- package/dist/helpers/deepEqual/index.mjs +1 -0
- package/dist/helpers/eventTarget.mjs +1 -2
- package/dist/helpers/fetchManifest.mjs +1 -2
- package/dist/helpers/images.mjs +1 -2
- package/dist/helpers/index.d.ts +4 -6
- package/dist/helpers/index.mjs +24 -20
- package/dist/helpers/interval.mjs +1 -2
- package/dist/helpers/isRecord.mjs +1 -2
- package/dist/helpers/keys.mjs +1 -2
- package/dist/helpers/lodash/camelCase.d.ts +1 -0
- package/dist/helpers/lodash/camelCase.mjs +7 -0
- package/dist/helpers/lodash/capitalize.d.ts +1 -0
- package/dist/helpers/lodash/capitalize.mjs +5 -0
- package/dist/helpers/lodash/cloneDeep.d.ts +8 -0
- package/dist/helpers/lodash/cloneDeep.mjs +53 -0
- package/dist/helpers/lodash/get.d.ts +11 -0
- package/dist/helpers/lodash/get.mjs +14 -0
- package/dist/helpers/lodash/has.d.ts +2 -0
- package/dist/helpers/lodash/has.mjs +12 -0
- package/dist/helpers/lodash/index.d.ts +11 -0
- package/dist/helpers/lodash/index.mjs +7 -0
- package/dist/helpers/lodash/omit.d.ts +4 -0
- package/dist/helpers/lodash/omit.mjs +35 -0
- package/dist/helpers/lodash/set.d.ts +2 -0
- package/dist/helpers/lodash/set.mjs +20 -0
- package/dist/helpers/lodash/shared.d.ts +2 -0
- package/dist/helpers/lodash/shared.mjs +37 -0
- package/dist/helpers/reducerOrigin.mjs +1 -2
- package/dist/helpers/replaceEqualDeep/index.d.ts +1 -0
- package/dist/helpers/replaceEqualDeep/index.mjs +1 -0
- package/dist/helpers/replaceEqualDeep/replaceEqualDeep.d.ts +12 -0
- package/dist/helpers/replaceEqualDeep/replaceEqualDeep.mjs +30 -0
- package/dist/helpers/resources.d.ts +21 -0
- package/dist/helpers/resources.mjs +40 -0
- package/dist/helpers/scroll.mjs +1 -2
- package/dist/helpers/security.d.ts +15 -0
- package/dist/helpers/security.mjs +8 -4
- package/dist/helpers/spaceRoot.mjs +1 -2
- package/dist/helpers/syntaxHighlight.mjs +1 -2
- package/dist/helpers/twigWrapper/Evaluator/Evaluator.mjs +75 -76
- package/dist/helpers/twigWrapper/Evaluator/helpers.mjs +1 -2
- package/dist/helpers/twigWrapper/Lexer/Lexer.mjs +1 -2
- package/dist/helpers/twigWrapper/Lexer/types.mjs +1 -2
- package/dist/helpers/twigWrapper/Parser/Cursor.mjs +1 -2
- package/dist/helpers/twigWrapper/Parser/ExpressionParser.mjs +1 -2
- package/dist/helpers/twigWrapper/Parser/Parser.mjs +1 -2
- package/dist/helpers/twigWrapper/Parser/helpers.mjs +1 -2
- package/dist/helpers/twigWrapper/TemplateCache/TemplateCache.mjs +1 -2
- package/dist/helpers/twigWrapper/charClass.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/arrays.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/catalog/index.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/dateParts.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/dates.mjs +13 -14
- package/dist/helpers/twigWrapper/filters/filters.mjs +21 -22
- package/dist/helpers/twigWrapper/filters/hashing.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/misc.mjs +27 -28
- package/dist/helpers/twigWrapper/filters/numbers.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/objects.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/raw.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/strings.mjs +23 -24
- package/dist/helpers/twigWrapper/filters/types.mjs +1 -2
- package/dist/helpers/twigWrapper/filters/values.mjs +1 -2
- package/dist/helpers/twigWrapper/index.mjs +8 -8
- package/dist/helpers/twigWrapper/inspectTemplate.mjs +12 -13
- package/dist/helpers/twigWrapper/processTwig/helpers.mjs +1 -2
- package/dist/helpers/twigWrapper/processTwig/processTwig.mjs +1 -2
- package/dist/helpers/twigWrapper/processTwig/resolveStepParam.mjs +1 -2
- package/dist/helpers/twigWrapper/templateRoots.d.ts +3 -9
- package/dist/helpers/twigWrapper/templateRoots.mjs +14 -9
- package/dist/helpers/twigWrapper/tokens/hasTemplateSyntax.mjs +1 -2
- package/dist/helpers/twigWrapper/tokens/hasValidToken.mjs +1 -2
- package/dist/helpers/twigWrapper/tokens/tokenPatterns.mjs +1 -2
- package/dist/helpers/utils.mjs +2 -3
- package/dist/history/describe.mjs +1 -2
- package/dist/history/diff.mjs +1 -2
- package/dist/hooks/index.mjs +5 -5
- package/dist/hooks/useFontHead.mjs +1 -2
- package/dist/hooks/useNetwork.mjs +1 -2
- package/dist/hooks/usePlitzi.d.ts +7 -6
- package/dist/hooks/usePlitzi.mjs +1 -2
- package/dist/hooks/useStableValue.mjs +5 -6
- package/dist/navigation/index.mjs +3 -3
- package/dist/navigation/matchPath.mjs +19 -11
- package/dist/navigation/routes.mjs +57 -38
- package/dist/navigation/sitemap.mjs +9 -10
- package/dist/network/entitlements.d.ts +21 -0
- package/dist/network/entitlements.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddPluginMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceAddSnippetMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceCloneElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceDeployMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceFixIssuesMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceMoveElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpacePublishMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemoveElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceRemovePluginMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceRenameElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceRunE2eTestsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceSetTestsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateElementsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdatePluginMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSchemaMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/SpaceUpdateSettingsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceAddActionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRemoveActionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceRunActionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/actions/SpaceUpdateActionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnBucketMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceAddCdnMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnBucketMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceRemoveCdnMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceSetCdnCredentialMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnBucketMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/cdns/SpaceUpdateCdnMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/components/SpaceAddComponentMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/components/SpaceDetachInstanceMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/components/SpaceRemoveComponentMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/components/SpaceUpdateComponentMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceAddConnectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceRemoveConnectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceUpdateConnectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceAddCredentialMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceRemoveCredentialMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/credentials/SpaceUpdateCredentialMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/data/SpaceSaveDataMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/flags/SpacePublishFlagsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/flags/SpaceRemoveFlagMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/flags/SpaceSetFlagMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceAddPageFolderMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceRemovePageFolderMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/folders/SpaceUpdatePageFolderMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceInstallTemplateFunctionsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceRemoveFunctionsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceSaveFunctionsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/functions/SpaceTryFunctionMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/jobs/SpaceControlJobMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceAddPageMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceHomePageMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceRemovePageMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/pages/SpaceUpdatePageMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceAddResourceMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceMoveResourceMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/resources/SpaceRemoveResourceMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceRemoveRuntimeVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeSizeMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceSetRuntimeVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStartRuntimeMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/runtime/SpaceStopRuntimeMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceAddVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceRemoveVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/variables/SpaceUpdateVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceAddVisitorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Space/visitors/SpaceRemoveVisitorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/StyleUpdateMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/StyleUpdateSettingsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleAddFontMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleRemoveFontMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/fonts/StyleUpdateFontMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleAddSelectorVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleRemoveSelectorVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectorVariables/StyleUpdateSelectorVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleAddSelectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleRemoveSelectorsMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/selectors/StyleUpdateSelectorMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleAddVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleRemoveVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/Style/variables/StyleUpdateVariableMutation.mjs +1 -2
- package/dist/network/graphql/builder/Mutations/index.mjs +155 -156
- package/dist/network/graphql/builder/Queries/InitQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceActionEventsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceActionTasksQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceActionsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceCdnsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceChangesQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceCheckActionQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceConnectorsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceCredentialsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceDataQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.d.ts +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceFunctionsQuery.mjs +2 -3
- package/dist/network/graphql/builder/Queries/Space/SpaceIssuesQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceJobsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceLatestRevisionQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceQuotaQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceResourcesQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.d.ts +1 -1
- package/dist/network/graphql/builder/Queries/Space/SpaceRuntimeQuery.mjs +2 -3
- package/dist/network/graphql/builder/Queries/Space/SpaceTestsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceVersionContentsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/Space/SpaceVisitorsQuery.mjs +1 -2
- package/dist/network/graphql/builder/Queries/index.mjs +37 -38
- package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.mjs +1 -2
- package/dist/network/graphql/builder/Subscriptions/index.mjs +1 -2
- package/dist/network/graphql/builder/fragments/cdnFields.mjs +1 -2
- package/dist/network/graphql/index.d.ts +0 -1
- package/dist/network/graphql/index.mjs +1 -3
- package/dist/network/index.d.ts +1 -5
- package/dist/network/index.mjs +7 -11
- package/dist/network/{NetworkContext.d.ts → react/NetworkContext.d.ts} +12 -11
- package/dist/network/{NetworkContext.mjs → react/NetworkContext.mjs} +1 -2
- package/dist/network/{NetworkInternalContext.d.ts → react/NetworkInternalContext.d.ts} +1 -1
- package/dist/network/react/NetworkInternalContext.mjs +4 -0
- package/dist/network/react/index.d.ts +5 -0
- package/dist/network/react/index.mjs +3 -0
- package/dist/network/spaceEvents.mjs +16 -17
- package/dist/plugins/bundle/bundle.mjs +1 -2
- package/dist/plugins/declaration.mjs +1 -2
- package/dist/plugins/react/ElementRegistryContext.d.ts +26 -0
- package/dist/plugins/react/ElementRegistryContext.mjs +17 -0
- package/dist/plugins/react/PluginAssetsContext.d.ts +11 -0
- package/dist/plugins/react/PluginAssetsContext.mjs +4 -0
- package/dist/plugins/react/PluginsContext.mjs +6 -3
- package/dist/plugins/react/index.d.ts +3 -0
- package/dist/plugins/react/index.mjs +4 -1
- package/dist/project/index.mjs +7 -7
- package/dist/project/layout/check.mjs +26 -27
- package/dist/project/layout/codes.mjs +1 -2
- package/dist/project/layout/contents.mjs +12 -13
- package/dist/project/layout/files.mjs +1 -2
- package/dist/project/layout/folders.mjs +43 -44
- package/dist/project/layout/index.mjs +3 -3
- package/dist/project/layout/plugins.mjs +56 -57
- package/dist/project/layout/vendor.mjs +14 -15
- package/dist/project/network.mjs +1 -2
- package/dist/project/pages/index.mjs +1 -2
- package/dist/project/paths/index.d.ts +8 -2
- package/dist/project/paths/index.mjs +3 -4
- package/dist/project/root.mjs +1 -2
- package/dist/queries/index.mjs +1 -2
- package/dist/queries/queryCache.mjs +1 -2
- package/dist/queries/serverQueries.mjs +1 -2
- package/dist/queries/useQuery.mjs +1 -2
- package/dist/queries/useServerQuery.mjs +1 -2
- package/dist/{helpers → react}/enclosingSpace.mjs +1 -2
- package/dist/react/generateFacade.d.ts +1 -0
- package/dist/{helpers → react}/generateFacade.mjs +4 -5
- package/dist/react/index.d.ts +8 -0
- package/dist/react/index.mjs +4 -0
- package/dist/{helpers → react}/sharedContext.mjs +0 -1
- package/dist/realtime/client.mjs +3 -4
- package/dist/realtime/index.mjs +4 -4
- package/dist/realtime/presence.mjs +1 -2
- package/dist/realtime/topics.mjs +1 -2
- package/dist/runs/index.mjs +1 -2
- package/dist/runs/report.mjs +1 -2
- package/dist/schema/anchor.mjs +1 -2
- package/dist/schema/index.mjs +18 -18
- package/dist/schema/layoutChain.mjs +1 -2
- package/dist/schema/markdownHeadings.mjs +1 -2
- package/dist/schema/motion.mjs +1 -2
- package/dist/schema/motionReveal.mjs +1 -2
- package/dist/schema/pageAccess.d.ts +9 -0
- package/dist/schema/pageAccess.mjs +42 -36
- package/dist/schema/pageElements.d.ts +3 -1
- package/dist/schema/pageElements.mjs +9 -3
- package/dist/schema/pageHead.d.ts +5 -2
- package/dist/schema/pageHead.mjs +3 -4
- package/dist/schema/providerAnswer.mjs +1 -2
- package/dist/schema/providerWhen.d.ts +1 -1
- package/dist/schema/providerWhen.mjs +6 -7
- package/dist/schema/react/SchemaContext.mjs +1 -2
- package/dist/schema/schemaConstants.mjs +1 -2
- package/dist/schema/schemaSettings.mjs +1 -2
- package/dist/schema/serverElements.d.ts +0 -24
- package/dist/schema/serverElements.mjs +60 -39
- package/dist/schema/serverInput.mjs +23 -24
- package/dist/schema/serverQuery.d.ts +15 -5
- package/dist/schema/serverQuery.mjs +47 -35
- package/dist/schema/snippet.mjs +1 -2
- package/dist/schema/wire.mjs +1 -2
- package/dist/security/index.d.ts +49 -0
- package/dist/security/index.mjs +44 -0
- package/dist/server/actions/useActionsSync.mjs +1 -2
- package/dist/server/actions/useImagesSync.mjs +1 -2
- package/dist/server/actions/useRealtimeSync.mjs +1 -2
- package/dist/server/index.mjs +7 -7
- package/dist/server/rsc/refreshRsc.mjs +23 -24
- package/dist/server/rsc/useRscRefresh.mjs +1 -2
- package/dist/server/rsc/useRscSync.mjs +1 -2
- package/dist/server/usePluginRoute.mjs +1 -2
- package/dist/source/export.d.ts +1 -1
- package/dist/source/export.mjs +1 -2
- package/dist/source/import.mjs +1 -2
- package/dist/source/index.mjs +4 -4
- package/dist/source/snapshot.mjs +1 -2
- package/dist/state/index.d.ts +0 -1
- package/dist/state/index.mjs +1 -3
- package/dist/state/paintedState.mjs +10 -11
- package/dist/store/actionRuns/actionRunsRecorder.mjs +1 -2
- package/dist/store/actionRuns/actionRunsStore.mjs +1 -2
- package/dist/store/actionRuns/index.mjs +3 -3
- package/dist/store/actionRuns/useActionRuns.mjs +5 -6
- package/dist/store/index.d.ts +1 -0
- package/dist/store/index.mjs +2 -1
- package/dist/store/renderSettings.d.ts +1 -1
- package/dist/store/renderSettings.mjs +1 -2
- package/dist/{state → store}/runtimeStatePersist.mjs +29 -30
- package/dist/store/storeHooks.d.ts +45 -45
- package/dist/store/storeHooks.mjs +1 -2
- package/dist/store/tracing/index.mjs +5 -5
- package/dist/store/tracing/preview.mjs +1 -2
- package/dist/store/tracing/tracingCollector.d.ts +2 -2
- package/dist/store/tracing/tracingCollector.mjs +79 -78
- package/dist/store/tracing/tracingMiddleware.mjs +1 -2
- package/dist/store/tracing/tracingStore.mjs +1 -2
- package/dist/store/tracing/useTracing.mjs +6 -7
- package/dist/style/breakpoints.mjs +1 -2
- package/dist/style/cssLayers.mjs +1 -2
- package/dist/style/displayModes.mjs +1 -2
- package/dist/style/fontAssets.mjs +1 -2
- package/dist/style/fontValidation.mjs +14 -15
- package/dist/style/fonts.d.ts +5 -3
- package/dist/style/fonts.mjs +23 -24
- package/dist/style/fontsFromCss.mjs +1 -2
- package/dist/style/index.mjs +18 -18
- package/dist/style/keyframes.mjs +1 -2
- package/dist/style/layoutGrid.mjs +1 -2
- package/dist/style/notifications.mjs +1 -2
- package/dist/style/react/useDisplayMode.mjs +1 -2
- package/dist/style/react/useElementSize.mjs +1 -2
- package/dist/style/runtimeStyle.d.ts +19 -21
- package/dist/style/runtimeStyle.mjs +4 -7
- package/dist/style/snippetStyle.mjs +5 -6
- package/dist/style/styleConditions.mjs +1 -2
- package/dist/style/styleConstants.mjs +1 -2
- package/dist/style/stylePseudos.mjs +1 -2
- package/dist/style/styleStates.mjs +1 -2
- package/dist/style/styleTarget.mjs +24 -25
- package/dist/theme/cookie/index.mjs +1 -1
- package/dist/theme/cookie/themeCookie.d.ts +21 -1
- package/dist/theme/cookie/themeCookie.mjs +19 -4
- package/dist/theme/index.d.ts +1 -9
- package/dist/theme/index.mjs +1 -6
- package/dist/theme/{ThemeProvider.d.ts → react/ThemeProvider.d.ts} +8 -2
- package/dist/theme/react/ThemeProvider.mjs +78 -0
- package/dist/theme/{ThemeScope.d.ts → react/ThemeScope.d.ts} +6 -2
- package/dist/theme/react/ThemeScope.mjs +9 -0
- package/dist/theme/react/index.d.ts +9 -0
- package/dist/theme/react/index.mjs +5 -0
- package/dist/theme/{themeStore.d.ts → react/themeStore.d.ts} +5 -5
- package/dist/theme/{themeStore.mjs → react/themeStore.mjs} +4 -4
- package/dist/theme/{useTheme.d.ts → react/useTheme.d.ts} +1 -1
- package/dist/theme/react/useTheme.mjs +19 -0
- package/dist/types/ActionTypes.d.ts +33 -0
- package/dist/types/AuthTypes.d.ts +6 -0
- package/dist/types/CommonTypes.d.ts +14 -3
- package/dist/types/DataSourceTypes.d.ts +1 -1
- package/dist/types/FunctionTypes.d.ts +16 -6
- package/dist/types/InteractionTypes.d.ts +1 -1
- package/dist/types/JobTypes.d.ts +56 -182
- package/dist/types/PluginTypes.d.ts +8 -1
- package/dist/types/SchemaTypes.d.ts +1 -1
- package/dist/types/SchemaTypes.mjs +1 -2
- package/dist/types/ServerAdapterTypes.d.ts +0 -326
- package/dist/types/ServerTypes.d.ts +0 -311
- package/dist/types/SpaceTypes.d.ts +5 -2
- package/dist/types/StoreTypes.d.ts +9 -3
- package/dist/types/StyleTypes.d.ts +6 -0
- package/dist/types/StyleTypes.mjs +1 -2
- package/dist/types/index.d.ts +0 -3
- package/dist/websockets/RTCodec.mjs +1 -2
- package/eslint.config.mjs +25 -0
- package/package.json +29 -18
- package/vite.config.ts +58 -0
- package/dist/helpers/generateFacade.d.ts +0 -2
- package/dist/helpers/ruleEvaluator.d.ts +0 -16
- package/dist/helpers/ruleEvaluator.mjs +0 -5
- package/dist/network/NetworkInternalContext.mjs +0 -5
- package/dist/network/graphql/sdk/Mutations/index.d.ts +0 -3
- package/dist/network/graphql/sdk/Mutations/index.mjs +0 -4
- package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +0 -16
- package/dist/network/graphql/sdk/Queries/InitQuery.mjs +0 -4
- package/dist/network/graphql/sdk/Queries/index.d.ts +0 -6
- package/dist/network/graphql/sdk/Queries/index.mjs +0 -5
- package/dist/network/graphql/sdk/index.d.ts +0 -5
- package/dist/network/graphql/sdk/index.mjs +0 -3
- package/dist/theme/ThemeProvider.mjs +0 -69
- package/dist/theme/ThemeScope.mjs +0 -10
- package/dist/theme/useTheme.mjs +0 -20
- package/dist/types/OAuthTypes.d.ts +0 -246
- package/dist/types/ServerConfigTypes.d.ts +0 -527
- package/dist/types/ServerLogTypes.d.ts +0 -119
- /package/dist/{types/OAuthTypes.mjs → conditions/types.mjs} +0 -0
- /package/dist/{types/ServerConfigTypes.mjs → functions/kv.mjs} +0 -0
- /package/dist/{types/ServerLogTypes.mjs → functions/later.mjs} +0 -0
- /package/dist/{helpers → react}/enclosingSpace.d.ts +0 -0
- /package/dist/{helpers → react}/sharedContext.d.ts +0 -0
- /package/dist/{state → store}/runtimeStatePersist.d.ts +0 -0
|
@@ -1,48 +1,69 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveLayoutChain as e } from "./layoutChain.mjs";
|
|
2
2
|
import { processTwigValue as t } from "../helpers/twigWrapper/processTwig/processTwig.mjs";
|
|
3
|
-
import n from "
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
var s = (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
...
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
n
|
|
22
|
-
|
|
23
|
-
i
|
|
3
|
+
import { pageWithheldOf as n, withheldPageOf as r } from "./pageAccess.mjs";
|
|
4
|
+
import i from "../dataSource/helpers/getSourceName.mjs";
|
|
5
|
+
import { passesFlagGate as a } from "../flags/resolveFlags.mjs";
|
|
6
|
+
import { isRecord as o } from "../helpers/isRecord.mjs";
|
|
7
|
+
// src/schema/serverElements.ts
|
|
8
|
+
var s = /* @__PURE__ */ new WeakMap(), c = (t, i) => {
|
|
9
|
+
let a = [], o = /* @__PURE__ */ new Set(), s = t.flat[i], c = (e) => typeof e == "string" ? e : "", l = s ? e((e) => t.flat[e], c(s.attributes.layout), c(s.attributes.layoutContainer)).map((e) => e.layout) : [], u = n(s?.attributes) ? r(t) : void 0, d = [
|
|
10
|
+
i,
|
|
11
|
+
...l,
|
|
12
|
+
...u === void 0 ? [] : [u]
|
|
13
|
+
].map((e) => ({
|
|
14
|
+
id: e,
|
|
15
|
+
gates: []
|
|
16
|
+
}));
|
|
17
|
+
for (; d.length > 0;) {
|
|
18
|
+
let e = d.pop();
|
|
19
|
+
if (e === void 0 || o.has(e.id)) continue;
|
|
20
|
+
o.add(e.id);
|
|
21
|
+
let n = t.flat[e.id];
|
|
22
|
+
if (!n) continue;
|
|
23
|
+
let { flag: r, items: i, runtime: s } = n.definition, c = r ? [...e.gates, r] : e.gates;
|
|
24
|
+
s === "server" && a.push({
|
|
25
|
+
element: n,
|
|
26
|
+
gates: c
|
|
27
|
+
}), i && d.push(...i.map((e) => ({
|
|
28
|
+
id: e,
|
|
29
|
+
gates: c
|
|
30
|
+
})));
|
|
24
31
|
}
|
|
25
|
-
return
|
|
26
|
-
},
|
|
32
|
+
return a;
|
|
33
|
+
}, l = (e, t) => {
|
|
34
|
+
let n = s.get(e.flat) ?? /* @__PURE__ */ new Map();
|
|
35
|
+
s.set(e.flat, n);
|
|
36
|
+
let r = n.get(t);
|
|
37
|
+
if (r && r.pages === e.pages && r.settings === e.settings) return r.found;
|
|
38
|
+
let i = c(e, t);
|
|
39
|
+
return n.set(t, {
|
|
40
|
+
pages: e.pages,
|
|
41
|
+
settings: e.settings,
|
|
42
|
+
found: i
|
|
43
|
+
}), i;
|
|
44
|
+
}, u = (e, t, n, r) => {
|
|
45
|
+
if (t === void 0) return [];
|
|
46
|
+
let i = n ? new Set(n) : void 0;
|
|
47
|
+
return l(e, t).filter(({ element: e }) => !i || i.has(e.id)).filter(({ gates: e }) => !r || e.every((e) => a(e, r))).map(({ element: e }) => e);
|
|
48
|
+
}, d = (e, t, n) => u(e, t, void 0, n).length > 0, f = (e, n, r) => e.find((e) => {
|
|
27
49
|
let i = e.attributes.notFound;
|
|
28
50
|
return typeof i == "string" && i !== "" && Object.hasOwn(n, e.id) && t(i, {
|
|
29
51
|
source: n[e.id],
|
|
30
52
|
navigation: r
|
|
31
53
|
}) === !0;
|
|
32
|
-
})?.id,
|
|
33
|
-
...Object.fromEntries(e.filter((e) => Object.hasOwn(t, e.id)).map((e) => [
|
|
34
|
-
navigation:
|
|
35
|
-
}),
|
|
54
|
+
})?.id, p = (e, t, n) => ({
|
|
55
|
+
...Object.fromEntries(e.filter((e) => Object.hasOwn(t, e.id)).map((e) => [i(e.definition.type, e.id), t[e.id]])),
|
|
56
|
+
navigation: n
|
|
57
|
+
}), m = /\{[{%]/, h = (e, n) => {
|
|
36
58
|
if (typeof e != "string") return;
|
|
37
|
-
let r =
|
|
38
|
-
return i === "" ||
|
|
39
|
-
},
|
|
40
|
-
if (typeof
|
|
41
|
-
if (!
|
|
42
|
-
let
|
|
43
|
-
return
|
|
59
|
+
let r = m.test(e) ? t(e, n) : e, i = typeof r == "string" || typeof r == "number" ? String(r).trim() : "";
|
|
60
|
+
return i === "" || m.test(i) ? void 0 : i;
|
|
61
|
+
}, g = (e, n) => typeof e == "string" && e !== "" && t(e, n) === !0, _ = (e, n) => {
|
|
62
|
+
if (typeof e == "string") {
|
|
63
|
+
if (!m.test(e)) return e;
|
|
64
|
+
let r = t(e, n);
|
|
65
|
+
return r === void 0 || typeof r == "string" && (r.trim() === "" || m.test(r)) ? void 0 : r;
|
|
44
66
|
}
|
|
45
|
-
return Array.isArray(
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
export { _ as RSC_FAILURE, s as collectServerElements, c as hasServerElements, g as jsonForScript, l as notFoundProvider, p as pageNotFound, f as pageSeoText, u as pageServerContext, h as pageStructuredData, v as rscFailureOf };
|
|
67
|
+
return Array.isArray(e) ? e.map((e) => _(e, n)).filter((e) => e !== void 0) : o(e) ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, _(t, n)]).filter(([, e]) => e !== void 0)) : e;
|
|
68
|
+
}, v = (e, t) => (Array.isArray(e) ? e : []).filter(o).map((e) => _(e, t)).filter(o), y = (e) => JSON.stringify(e).replace(/</g, "\\u003c"), b = "$failed", x = (e) => o(e) && typeof e.$failed == "string" ? e[b] : void 0;
|
|
69
|
+
export { b as RSC_FAILURE, u as collectServerElements, d as hasServerElements, y as jsonForScript, f as notFoundProvider, g as pageNotFound, h as pageSeoText, p as pageServerContext, v as pageStructuredData, x as rscFailureOf };
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { serverProviderSource as e } from "./providerWhen.mjs";
|
|
2
2
|
import { templatePaths as t } from "../helpers/twigWrapper/templateRoots.mjs";
|
|
3
|
-
import n from "../
|
|
4
|
-
import r from "../dataSource/
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
3
|
+
import { get as n } from "../helpers/lodash/get.mjs";
|
|
4
|
+
import r from "../dataSource/getBindingsDetails.mjs";
|
|
5
|
+
import i from "../dataSource/helpers/getSourceName.mjs";
|
|
6
|
+
import { isRecord as a } from "../helpers/isRecord.mjs";
|
|
7
|
+
// src/schema/serverInput.ts
|
|
8
8
|
var o = /^navigation\.(routeParams|queryParams)(\.|$)/, s = "apiContainer", c = (e) => e.split(/[.[]/)[0] ?? e, l = (e) => [e.source, ...(e.transformers ?? []).flatMap(({ action: e, params: n }) => e === "twigTemplate" && typeof n.template == "string" ? t(n.template).filter((e) => e !== "source" && !e.startsWith("source.")) : [])], u = (e) => e.to === "input" || e.to.startsWith("input."), d = (e, t) => (e.definition.bindings?.attributes ?? []).filter((e) => e.enabled !== !1 && u(e) && e.when === void 0 && l(e).every((e) => o.test(e) || t(c(e)))), f = (e, t) => {
|
|
9
9
|
let n = (e) => {
|
|
10
10
|
let n = e.startsWith(`${s}_`) ? e.slice(s.length + 1) : void 0;
|
|
11
|
-
return n !== void 0 && t.has(n) &&
|
|
11
|
+
return n !== void 0 && t.has(n) && i(s, n) === e ? n : void 0;
|
|
12
12
|
};
|
|
13
13
|
return [...new Set(d(e, (e) => n(e) !== void 0).flatMap((e) => l(e).flatMap((e) => n(c(e)) ?? [])))];
|
|
14
|
-
}, p = (e, t,
|
|
14
|
+
}, p = (e, t, n = {}) => {
|
|
15
15
|
if (e === void 0) return;
|
|
16
|
-
let i = d(e, (e) => Object.hasOwn(
|
|
17
|
-
return i.length === 0 ? e.attributes.input :
|
|
18
|
-
...
|
|
16
|
+
let i = d(e, (e) => Object.hasOwn(n, e));
|
|
17
|
+
return i.length === 0 ? e.attributes.input : r({
|
|
18
|
+
...n,
|
|
19
19
|
navigation: t
|
|
20
20
|
}, {
|
|
21
21
|
attributes: e.attributes,
|
|
@@ -28,13 +28,13 @@ var o = /^navigation\.(routeParams|queryParams)(\.|$)/, s = "apiContainer", c =
|
|
|
28
28
|
if (e == null || e === "") return "empty";
|
|
29
29
|
let t = JSON.stringify(e);
|
|
30
30
|
return t.length > 60 ? `${t.slice(0, 57)}…` : t;
|
|
31
|
-
}, h = (e, t,
|
|
32
|
-
let
|
|
31
|
+
}, h = (e, t, i = {}) => {
|
|
32
|
+
let a = new Set(d(e, (e) => Object.hasOwn(i, e)));
|
|
33
33
|
return (e.definition.bindings?.attributes ?? []).filter((e) => e.enabled !== !1 && u(e)).map((o) => {
|
|
34
34
|
let u = `${o.to} ← ${o.source}`;
|
|
35
|
-
if (
|
|
36
|
-
let
|
|
37
|
-
...
|
|
35
|
+
if (a.has(o)) {
|
|
36
|
+
let a = r({
|
|
37
|
+
...i,
|
|
38
38
|
navigation: t
|
|
39
39
|
}, {
|
|
40
40
|
attributes: e.attributes,
|
|
@@ -43,18 +43,17 @@ var o = /^navigation\.(routeParams|queryParams)(\.|$)/, s = "apiContainer", c =
|
|
|
43
43
|
bindings: { attributes: [o] }
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
return `${u}: ${m(a
|
|
46
|
+
return `${u}: ${m(n(a.attributes, o.to))}`;
|
|
47
47
|
}
|
|
48
|
-
let d = l(o).map(c).find((e) => e.startsWith(`${s}_`) && !Object.hasOwn(
|
|
48
|
+
let d = l(o).map(c).find((e) => e.startsWith(`${s}_`) && !Object.hasOwn(i, e));
|
|
49
49
|
return o.when === void 0 ? d === void 0 ? `${u}: not read on the server (the visitor's state), the input as saved` : `${u}: not read on the server — ${d} gave it no answer (not a server provider, or it failed)` : `${u}: not read on the server (it has a \`when\`), the input as saved`;
|
|
50
50
|
});
|
|
51
|
-
}, g = (t, n,
|
|
51
|
+
}, g = (t, n, r, o) => {
|
|
52
52
|
if (t === void 0) return;
|
|
53
|
-
let c =
|
|
54
|
-
let
|
|
55
|
-
return
|
|
53
|
+
let c = a(r) ? r : {}, l = (e) => {
|
|
54
|
+
let t = a(n) ? n[e] : void 0;
|
|
55
|
+
return a(t) && a(t.attributes) && t.attributes.singleRecord === !0;
|
|
56
56
|
};
|
|
57
|
-
return p(t, o, Object.fromEntries(f(t, new Set(Object.keys(c))).map((
|
|
57
|
+
return p(t, o, Object.fromEntries(f(t, new Set(Object.keys(c))).map((t) => [i(s, t), e(c[t], l(t))])));
|
|
58
58
|
};
|
|
59
|
-
//#endregion
|
|
60
59
|
export { g as browserServerInput, f as inputProviders, h as inputReadings, p as serverInputOf };
|
|
@@ -4,7 +4,8 @@ import { Element } from '../types';
|
|
|
4
4
|
* for authoring, which refuses what it cannot read.
|
|
5
5
|
*
|
|
6
6
|
* - `path`: a file of the server's own or the project's data (`/data/…`), read from where it is kept.
|
|
7
|
-
* - `url`: another site's address, asked with GET by the page server, with the headers the provider declares
|
|
7
|
+
* - `url`: another site's address, asked with GET by the page server, with the headers the provider declares —
|
|
8
|
+
* `asVisitor` when it says `credentials: 'include'`: with the visitor's cookies, where the deployment allows it.
|
|
8
9
|
* - `unresolved`: what only the browser can ask — said with why, never left to resolve to nothing.
|
|
9
10
|
*/
|
|
10
11
|
export type ServerQuery = {
|
|
@@ -14,31 +15,40 @@ export type ServerQuery = {
|
|
|
14
15
|
kind: 'url';
|
|
15
16
|
url: URL;
|
|
16
17
|
headers: Record<string, string>;
|
|
18
|
+
asVisitor: boolean;
|
|
17
19
|
} | {
|
|
18
20
|
kind: 'unresolved';
|
|
19
21
|
why: string;
|
|
20
22
|
};
|
|
21
23
|
/**
|
|
22
24
|
* What the page server knows of a visit, as a template reads it in the browser: the space's variables resolved for
|
|
23
|
-
* this host (`{{ apiUrl }}`),
|
|
25
|
+
* this host (`{{ apiUrl }}`), where the visit is (`{{ navigation.routeParams.id }}`, `navigation.origin`), and the
|
|
26
|
+
* state the page starts from — the keys the space paints (`settings.paintedState`), as the visitor's cookie holds them
|
|
27
|
+
* (`{{ state.workspace.id }}`).
|
|
24
28
|
*/
|
|
25
29
|
export type ServerTemplateData = {
|
|
26
30
|
variables: Readonly<Record<string, unknown>>;
|
|
27
31
|
routeParams: Readonly<Record<string, string | undefined>>;
|
|
28
32
|
queryParams: Readonly<Record<string, string>>;
|
|
29
33
|
origin: string;
|
|
34
|
+
/** The keys of `runtime.state` the server knows: the ones the space paints, with `keepState` on. */
|
|
35
|
+
paintedKeys: ReadonlySet<string>;
|
|
36
|
+
/** Their values on this visit — what the page's `runtime.state` starts from. */
|
|
37
|
+
state: Readonly<Record<string, unknown>>;
|
|
30
38
|
};
|
|
31
39
|
type Provider = Pick<Element, 'attributes' | 'definition'>;
|
|
32
40
|
/**
|
|
33
41
|
* Why the page server cannot ask a provider's `query` — from what is written alone, so authoring says it before a
|
|
34
|
-
* visit: bound, templated over what the browser alone holds,
|
|
35
|
-
*
|
|
42
|
+
* visit: bound, templated over what the browser alone holds, another method. `undefined` when it can; whether the
|
|
43
|
+
* address it comes to is one it reads is decided once the template is filled in (`serverQueryOf`) — and whether it may
|
|
44
|
+
* carry the visitor's cookies there (`credentials: 'include'`) by the deployment, which names the APIs and the spaces
|
|
45
|
+
* that may (`rsc.visitorCredentials`).
|
|
36
46
|
*
|
|
37
47
|
* A template may read the space's variables and `navigation` — what the page server knows of a visit. A route or
|
|
38
48
|
* query param is read as `navigation.routeParams.x`: written bare (`{{ x }}`) it cannot be told from a state or a
|
|
39
49
|
* provider's name before the visit.
|
|
40
50
|
*/
|
|
41
|
-
export declare const serverQueryProblem: (element: Provider, variableNames: ReadonlySet<string>) => string | undefined;
|
|
51
|
+
export declare const serverQueryProblem: (element: Provider, variableNames: ReadonlySet<string>, paintedKeys?: ReadonlySet<string>) => string | undefined;
|
|
42
52
|
/**
|
|
43
53
|
* A provider's `query` as the page server reads it on a visit — its template filled in with what the server knows of
|
|
44
54
|
* it, as the browser would have filled it in; `undefined` for a provider with no query at all.
|
|
@@ -1,25 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { isRecord as e } from "../helpers/isRecord.mjs";
|
|
2
|
+
import { processTwig as t } from "../helpers/twigWrapper/processTwig/processTwig.mjs";
|
|
3
|
+
import { TOKEN_REGEX as n } from "../helpers/twigWrapper/tokens/tokenPatterns.mjs";
|
|
4
|
+
import { templatePaths as r } from "../helpers/twigWrapper/templateRoots.mjs";
|
|
5
|
+
// src/schema/serverQuery.ts
|
|
6
|
+
var i = [
|
|
5
7
|
"query",
|
|
6
8
|
"headers",
|
|
7
9
|
"accessToken",
|
|
8
10
|
"method",
|
|
9
11
|
"credentials"
|
|
10
|
-
],
|
|
11
|
-
let { query:
|
|
12
|
-
if (typeof
|
|
13
|
-
let
|
|
14
|
-
if (
|
|
15
|
-
let
|
|
16
|
-
let
|
|
17
|
-
return typeof
|
|
12
|
+
], a = ["query", "accessToken"], o = (e) => typeof e == "object" && e ? Object.fromEntries(Object.entries(e).filter((e) => typeof e[1] == "string")) : {}, s = (e, t, n = /* @__PURE__ */ new Set()) => {
|
|
13
|
+
let { query: o, method: s } = e.attributes;
|
|
14
|
+
if (typeof o != "string" || o === "") return;
|
|
15
|
+
let u = (e.definition.bindings?.attributes ?? []).filter((e) => e.enabled !== !1 && i.includes(e.to)).map((e) => e.to);
|
|
16
|
+
if (u.length > 0) return `its ${[...new Set(u)].join(", ")} is bound, which the browser alone resolves`;
|
|
17
|
+
let d = a.flatMap((i) => {
|
|
18
|
+
let a = e.attributes[i];
|
|
19
|
+
return typeof a == "string" && a.includes("{{") ? r(a).filter((e) => !f(e, t, n)).map((e) => e.startsWith("state.") ? e.split(".").slice(0, 2).join(".") : e.split(".")[0]) : [];
|
|
18
20
|
});
|
|
19
|
-
if (
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
if (d.length > 0) return `its template reads ${[...new Set(d)].map((e) => `\`${e}\``).join(", ")}, which the browser alone holds — the page server knows the space's variables, \`navigation\` (a route param is \`navigation.routeParams.x\`) and the state the space paints (\`settings.paintedState\`, as \`state.<key>\`)`;
|
|
22
|
+
if (a.some((t) => {
|
|
23
|
+
let n = e.attributes[t];
|
|
24
|
+
return typeof n == "string" && l(n).length > 0 && !c(n);
|
|
25
|
+
})) return "its template reads `state` inside an expression, which the browser does not follow — write each value as a token of its own (`{{ apiUrl }}/workspaces/{{ state.workspace.id }}`)";
|
|
26
|
+
if (typeof s == "string" && s !== "" && s.toLowerCase() !== "get") return `it asks with ${s.toUpperCase()}, and the page server reads with GET alone`;
|
|
27
|
+
}, c = (e) => (e.match(/\{\{/g) ?? []).length === (e.match(n) ?? []).length, l = (e) => e.includes("{{") ? r(e).filter((e) => e.startsWith("state.")).map((e) => e.slice(6)) : [], u = (t, n) => n.split(".").reduce((t, n) => e(t) ? t[n] : void 0, t), d = (e) => e == null || e === "", f = (e, t, n) => {
|
|
28
|
+
let [r, ...i] = e.split(".");
|
|
29
|
+
return r === "navigation" || t.has(r) || r === "state" && i.length > 0 && n.has(i[0]);
|
|
30
|
+
}, p = (e, t, n) => {
|
|
23
31
|
if (e.startsWith("//")) return {
|
|
24
32
|
kind: "unresolved",
|
|
25
33
|
why: `"${e}" names no protocol — write https:`
|
|
@@ -28,43 +36,47 @@ var n = [
|
|
|
28
36
|
kind: "path",
|
|
29
37
|
path: e
|
|
30
38
|
};
|
|
31
|
-
let
|
|
39
|
+
let r;
|
|
32
40
|
try {
|
|
33
|
-
|
|
41
|
+
r = new URL(e);
|
|
34
42
|
} catch {
|
|
35
43
|
return {
|
|
36
44
|
kind: "unresolved",
|
|
37
45
|
why: `"${e}" is neither an address (https://…) nor a path of the space (/…)`
|
|
38
46
|
};
|
|
39
47
|
}
|
|
40
|
-
return
|
|
48
|
+
return r.protocol !== "https:" && r.protocol !== "http:" ? {
|
|
41
49
|
kind: "unresolved",
|
|
42
|
-
why: `"${e}" is read with ${
|
|
50
|
+
why: `"${e}" is read with ${r.protocol}, and the page server reads http(s) alone`
|
|
43
51
|
} : {
|
|
44
52
|
kind: "url",
|
|
45
|
-
url:
|
|
46
|
-
headers: t
|
|
53
|
+
url: r,
|
|
54
|
+
headers: t,
|
|
55
|
+
asVisitor: n
|
|
47
56
|
};
|
|
48
|
-
},
|
|
49
|
-
let { query: r, headers:
|
|
57
|
+
}, m = (e, n) => {
|
|
58
|
+
let { query: r, headers: i, accessToken: a, credentials: c } = e.attributes;
|
|
50
59
|
if (typeof r != "string" || r === "") return;
|
|
51
|
-
let
|
|
52
|
-
if (
|
|
60
|
+
let f = s(e, new Set(Object.keys(n.variables)), n.paintedKeys);
|
|
61
|
+
if (f !== void 0) return {
|
|
53
62
|
kind: "unresolved",
|
|
54
|
-
why:
|
|
63
|
+
why: f
|
|
55
64
|
};
|
|
56
|
-
|
|
65
|
+
if (l(r).some((e) => d(u(n.state, e)))) return;
|
|
66
|
+
let m = {
|
|
57
67
|
...n.variables,
|
|
58
68
|
navigation: {
|
|
59
69
|
routeParams: n.routeParams,
|
|
60
70
|
queryParams: n.queryParams,
|
|
61
71
|
origin: n.origin
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
72
|
+
},
|
|
73
|
+
state: n.state
|
|
74
|
+
}, h = (e) => {
|
|
75
|
+
let n = t(e, m);
|
|
65
76
|
return typeof n == "string" ? n : String(n);
|
|
66
|
-
},
|
|
67
|
-
|
|
77
|
+
}, g = o(i);
|
|
78
|
+
typeof a == "string" && a !== "" && (g.Authorization = `Bearer ${h(a)}`);
|
|
79
|
+
let _ = h(r).trim();
|
|
80
|
+
if (_ !== "") return p(_, g, c === "include");
|
|
68
81
|
};
|
|
69
|
-
|
|
70
|
-
export { s as serverQueryOf, a as serverQueryProblem };
|
|
82
|
+
export { m as serverQueryOf, s as serverQueryProblem };
|
package/dist/schema/snippet.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { isRecord as e } from "../helpers/isRecord.mjs";
|
|
2
|
-
|
|
2
|
+
// src/schema/snippet.ts
|
|
3
3
|
var t = (t) => {
|
|
4
4
|
if (!e(t) || !e(t.definition) || !e(t.schema) || !e(t.style)) return !1;
|
|
5
5
|
let { definition: n, schema: r, style: i } = t;
|
|
6
6
|
return typeof n.name != "string" || typeof n.baseElementId != "string" ? !1 : e(r.flat) && e(r.flat[n.baseElementId]) && Array.isArray(r.variables) && e(i.platform);
|
|
7
7
|
};
|
|
8
|
-
//#endregion
|
|
9
8
|
export { t as isSnippet };
|
package/dist/schema/wire.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/schema/wire.ts
|
|
2
2
|
var e = (e) => ({
|
|
3
3
|
...e,
|
|
4
4
|
flat: Object.values(e.flat)
|
|
@@ -32,5 +32,4 @@ var e = (e) => ({
|
|
|
32
32
|
...e,
|
|
33
33
|
flat: Object.fromEntries(e.flat.map((e) => [e.id, n(e)]))
|
|
34
34
|
});
|
|
35
|
-
//#endregion
|
|
36
35
|
export { n as elementFromWire, r as schemaFromWire, e as schemaToWire };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { TrustedTypesPolicyName } from '../helpers/security';
|
|
2
|
+
/** What of the browser's `trustedTypes` the SDK uses: TypeScript's DOM library does not declare it yet. */
|
|
3
|
+
export type TrustedTypesRules = {
|
|
4
|
+
createHTML?: (input: string) => string | null;
|
|
5
|
+
createScript?: (input: string) => string | null;
|
|
6
|
+
createScriptURL?: (input: string) => string | null;
|
|
7
|
+
};
|
|
8
|
+
export type TrustedTypesPolicy = {
|
|
9
|
+
createHTML: (input: string) => TrustedHTML;
|
|
10
|
+
};
|
|
11
|
+
type TrustedTypesFactory = {
|
|
12
|
+
createPolicy: (name: TrustedTypesPolicyName, rules: TrustedTypesRules) => TrustedTypesPolicy;
|
|
13
|
+
/** The page's `default` policy, once something made it. */
|
|
14
|
+
defaultPolicy?: TrustedTypesPolicy | null;
|
|
15
|
+
};
|
|
16
|
+
/** The browser's factory, where there is one: none on the server, nor in a browser without Trusted Types. */
|
|
17
|
+
export declare const trustedTypesFactory: () => TrustedTypesFactory | undefined;
|
|
18
|
+
export declare const scriptPolicyEnforced: () => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Markup the page made itself (`plitzi-html`), as a trusted value where the browser asks for one — the same object for
|
|
21
|
+
* the same markup, since React writes `innerHTML` again whenever the value is a different one. The markup as it is on
|
|
22
|
+
* the server and where there is no Trusted Types.
|
|
23
|
+
*/
|
|
24
|
+
export declare const ownHtml: (html: string) => string | TrustedHTML;
|
|
25
|
+
/**
|
|
26
|
+
* The page's script policy as its server said it on `<html data-plitzi-script-policy>`: what a copy of this module the
|
|
27
|
+
* SDK does not start — the builder's own, a plugin's that bundles its own — holds itself to. Nothing on the server, nor
|
|
28
|
+
* on a page with no policy.
|
|
29
|
+
*/
|
|
30
|
+
export declare const pageScriptPolicy: () => "report-only" | "enforce" | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* The page's policies, made as the SDK starts — before anything writes markup: the head's JSON-LD and React's first
|
|
33
|
+
* script go through `default` from the first commit — with the page's script policy as its server sent it
|
|
34
|
+
* (`Server.scriptPolicy`). What the policies clean depends on it: enforced, what an author wrote is cleaned; reported,
|
|
35
|
+
* it passes as it was, since cleaning it then would take away what still runs (an inline handler the policy does not
|
|
36
|
+
* refuse yet).
|
|
37
|
+
*
|
|
38
|
+
* A page held to a policy, reported or enforced, never asks for `eval`: the store writes without its compiled writers
|
|
39
|
+
* (nexus's `new Function`), and zod parses without compiling. Reported, their probes are reports on every page a visitor
|
|
40
|
+
* opens, which would bury the reports worth reading; enforced, they are refused anyway. It costs about 5 µs a store
|
|
41
|
+
* write, and loading the dashboard writes about a hundred times.
|
|
42
|
+
*
|
|
43
|
+
* Called with nothing, it reads the policy off the document (`pageScriptPolicy`): how a copy of this module the SDK did
|
|
44
|
+
* not start — the builder's — learns it.
|
|
45
|
+
*
|
|
46
|
+
* Nothing on the server: what is decided here is one page's, and a server renders many at once.
|
|
47
|
+
*/
|
|
48
|
+
export declare const startMarkupPolicies: (next?: "report-only" | "enforce" | undefined) => void;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { setCodegenEnabled as e } from "@plitzi/nexus";
|
|
2
|
+
import { z as t } from "zod";
|
|
3
|
+
// src/security/index.ts
|
|
4
|
+
var n = () => globalThis.trustedTypes, r, i = () => r === "enforce", a = (e) => {
|
|
5
|
+
try {
|
|
6
|
+
return JSON.parse(e), !0;
|
|
7
|
+
} catch {
|
|
8
|
+
return !1;
|
|
9
|
+
}
|
|
10
|
+
}, o = "<script><\/script>", s = (e) => !e.includes("<"), c = (e) => {
|
|
11
|
+
if (typeof location > "u") return !1;
|
|
12
|
+
if (e.startsWith(`blob:${location.origin}/`)) return !0;
|
|
13
|
+
try {
|
|
14
|
+
return new URL(e, location.href).origin === location.origin;
|
|
15
|
+
} catch {
|
|
16
|
+
return !1;
|
|
17
|
+
}
|
|
18
|
+
}, l, u = () => {
|
|
19
|
+
if (l !== void 0) return l;
|
|
20
|
+
let e = n();
|
|
21
|
+
if (!e) return l = null, l;
|
|
22
|
+
if (l = e.createPolicy("plitzi-html", { createHTML: (e) => e }), !e.defaultPolicy) try {
|
|
23
|
+
e.createPolicy("default", {
|
|
24
|
+
createHTML: (e) => e === o || s(e) ? e : null,
|
|
25
|
+
createScript: (e) => a(e) ? e : null,
|
|
26
|
+
createScriptURL: (e) => c(e) ? e : null
|
|
27
|
+
});
|
|
28
|
+
} catch {}
|
|
29
|
+
return l;
|
|
30
|
+
}, d = 500, f = /* @__PURE__ */ new Map(), p = (e) => {
|
|
31
|
+
let t = u();
|
|
32
|
+
if (!t) return e;
|
|
33
|
+
let n = f.get(e);
|
|
34
|
+
if (n) return n;
|
|
35
|
+
let r = t.createHTML(e);
|
|
36
|
+
return f.size < d && f.set(e, r), r;
|
|
37
|
+
}, m = () => {
|
|
38
|
+
if (typeof document > "u") return;
|
|
39
|
+
let e = document.documentElement.dataset.plitziScriptPolicy;
|
|
40
|
+
return e === "report-only" || e === "enforce" ? e : void 0;
|
|
41
|
+
}, h = (n = m()) => {
|
|
42
|
+
typeof window < "u" && (r = n, e(!n && void 0), n && t.config({ jitless: !0 }), u());
|
|
43
|
+
};
|
|
44
|
+
export { p as ownHtml, m as pageScriptPolicy, i as scriptPolicyEnforced, h as startMarkupPolicies, n as trustedTypesFactory };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useCommonStoreSync as e } from "../../store/storeHooks.mjs";
|
|
2
|
-
|
|
2
|
+
// src/server/actions/useActionsSync.ts
|
|
3
3
|
var t = (t) => {
|
|
4
4
|
e(["actions.endpoint"], [t?.actionPath]);
|
|
5
5
|
};
|
|
6
|
-
//#endregion
|
|
7
6
|
export { t as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useCommonStoreSync as e } from "../../store/storeHooks.mjs";
|
|
2
|
-
|
|
2
|
+
// src/server/actions/useImagesSync.ts
|
|
3
3
|
var t = (t) => {
|
|
4
4
|
e(["images.endpoint"], [t?.imagePath]);
|
|
5
5
|
};
|
|
6
|
-
//#endregion
|
|
7
6
|
export { t as default };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useCommonStoreSync as e } from "../../store/storeHooks.mjs";
|
|
2
|
-
|
|
2
|
+
// src/server/actions/useRealtimeSync.ts
|
|
3
3
|
var t = (t) => {
|
|
4
4
|
e(["realtime.endpoint", "realtime.transport"], [t?.realtimePath, t?.realtimeTransport]);
|
|
5
5
|
};
|
|
6
|
-
//#endregion
|
|
7
6
|
export { t as default };
|
package/dist/server/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import e from "./actions/useActionsSync.mjs";
|
|
2
|
-
import t from "./
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import u from "./
|
|
6
|
-
import d from "./
|
|
7
|
-
import f from "./
|
|
8
|
-
export {
|
|
2
|
+
import t, { cancelRsc as n, currentRscLocation as r, holdRscRoot as i, noteRscFailures as a, releaseRscRequests as o, rscDataPath as s } from "./rsc/refreshRsc.mjs";
|
|
3
|
+
import c from "./rsc/useRscRefresh.mjs";
|
|
4
|
+
import l from "./rsc/useRscSync.mjs";
|
|
5
|
+
import u from "./usePluginRoute.mjs";
|
|
6
|
+
import d from "./actions/useImagesSync.mjs";
|
|
7
|
+
import f from "./actions/useRealtimeSync.mjs";
|
|
8
|
+
export { n as cancelRsc, r as currentRscLocation, i as holdRscRoot, a as noteRscFailures, t as refreshRsc, o as releaseRscRequests, s as rscDataPath, e as useActionsSync, d as useImagesSync, u as usePluginRoute, f as useRealtimeSync, c as useRscRefresh, l as useRscSync };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { authFailureFromResponse as e, reportAuthFailure as t } from "../../auth/failureChannel.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { getPaths as
|
|
4
|
-
import {
|
|
5
|
-
|
|
2
|
+
import { collectServerElements as n, hasServerElements as r, rscFailureOf as i } from "../../schema/serverElements.mjs";
|
|
3
|
+
import { getPaths as a, matchRoutePath as o } from "../../navigation/routes.mjs";
|
|
4
|
+
import { recordRenderActionRuns as s } from "../../store/actionRuns/actionRunsRecorder.mjs";
|
|
5
|
+
// src/server/rsc/refreshRsc.ts
|
|
6
6
|
var c = (e, t, n) => {
|
|
7
7
|
if (!e) return;
|
|
8
|
-
let
|
|
9
|
-
return
|
|
10
|
-
}, l = (e, t,
|
|
11
|
-
let
|
|
12
|
-
return
|
|
8
|
+
let r = e.pages.reduce((t, n) => (n in e.flat && (t[n] = e.flat[n]), t), {});
|
|
9
|
+
return o(a(r, e.pageFolders, n), t.split("?")[0], n).pageId;
|
|
10
|
+
}, l = (e, t, r, i) => {
|
|
11
|
+
let a = new Set(n(e, t, [...r], i).map(({ id: e }) => e));
|
|
12
|
+
return r.filter((e) => a.has(e));
|
|
13
13
|
}, u = (e) => `rsc.data.${e}`, d = () => typeof window > "u" ? "" : `${window.location.pathname}${window.location.search}`, f = "*", p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new Map(), g = (e, t) => {
|
|
14
14
|
h.set(e, t);
|
|
15
15
|
}, _ = (e) => {
|
|
@@ -46,7 +46,7 @@ var c = (e, t, n) => {
|
|
|
46
46
|
p.get(e)?.inFlight.forEach((e) => e.controller.abort()), p.delete(e), h.delete(e);
|
|
47
47
|
}, w = (e, t) => {
|
|
48
48
|
let n = Object.entries(t).flatMap(([e, t]) => {
|
|
49
|
-
let n =
|
|
49
|
+
let n = i(t);
|
|
50
50
|
return n === void 0 ? [] : [[e, n]];
|
|
51
51
|
});
|
|
52
52
|
if (n.length === 0) return;
|
|
@@ -67,13 +67,13 @@ var c = (e, t, n) => {
|
|
|
67
67
|
}
|
|
68
68
|
e.set("rsc.loaded", !0), e.set("rsc.stale", !1), e.set("rsc.location", i);
|
|
69
69
|
});
|
|
70
|
-
}, E = async (
|
|
71
|
-
let p = _(
|
|
70
|
+
}, E = async (n, i, a, { location: o, fresh: u = !1 } = {}) => {
|
|
71
|
+
let p = _(n), { enabled: m, endpoint: h } = p.get("rsc") ?? {};
|
|
72
72
|
if (!m || !h || typeof window > "u") return;
|
|
73
|
-
let g =
|
|
73
|
+
let g = o ?? d(), v = p.get("schema"), S = p.get("runtime.sources.auth"), C = o ? c(v, o, !!S?.details) : p.get("navigation.currentPageId"), w = o ? void 0 : p.get("runtime.sources.flags");
|
|
74
74
|
if (!v) return;
|
|
75
75
|
let E = i?.length ? l(v, C, i, w) : void 0;
|
|
76
|
-
if (E ? !E.length : !
|
|
76
|
+
if (E ? !E.length : !r(v, C, w)) return;
|
|
77
77
|
let D = new URLSearchParams({ location: g });
|
|
78
78
|
E?.length && D.set("ids", E.join(",")), Object.entries(a ?? {}).forEach(([e, t]) => D.set(e, t));
|
|
79
79
|
let O = `${h}?${D.toString()}`, k = y(p), A = [...k.inFlight].find((e) => e.url === O && (e.fresh || !u));
|
|
@@ -91,8 +91,8 @@ var c = (e, t, n) => {
|
|
|
91
91
|
seq: j,
|
|
92
92
|
controller: M,
|
|
93
93
|
promise: Promise.resolve()
|
|
94
|
-
}, P = async (
|
|
95
|
-
let
|
|
94
|
+
}, P = async (n) => {
|
|
95
|
+
let r = await fetch(O, {
|
|
96
96
|
...u ? {
|
|
97
97
|
cache: "no-cache",
|
|
98
98
|
headers: {
|
|
@@ -102,17 +102,17 @@ var c = (e, t, n) => {
|
|
|
102
102
|
} : { headers: { Accept: "application/json" } },
|
|
103
103
|
signal: M.signal
|
|
104
104
|
});
|
|
105
|
-
if (!
|
|
106
|
-
let
|
|
107
|
-
if (
|
|
108
|
-
reason:
|
|
105
|
+
if (!r.ok) {
|
|
106
|
+
let i = e(r.status, await r.json().catch(() => void 0));
|
|
107
|
+
if (i && await t({
|
|
108
|
+
reason: i,
|
|
109
109
|
url: h
|
|
110
|
-
}) && !
|
|
110
|
+
}) && !n) return P(!0);
|
|
111
111
|
p.set("rsc.stale", !0);
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
|
-
let { serverData:
|
|
115
|
-
|
|
114
|
+
let { serverData: i, actionRuns: a } = await r.json();
|
|
115
|
+
a?.length && s(a), T(p, k, N, i ?? {}, g);
|
|
116
116
|
};
|
|
117
117
|
return N.promise = P(!1).catch(() => {
|
|
118
118
|
M.signal.aborted || p.set("rsc.stale", !0);
|
|
@@ -120,5 +120,4 @@ var c = (e, t, n) => {
|
|
|
120
120
|
k.inFlight.delete(N), b(p, k);
|
|
121
121
|
}), k.inFlight.add(N), b(p, k), N.promise;
|
|
122
122
|
};
|
|
123
|
-
//#endregion
|
|
124
123
|
export { S as cancelRsc, d as currentRscLocation, E as default, E as refreshRsc, g as holdRscRoot, w as noteRscFailures, C as releaseRscRequests, u as rscDataPath };
|