@plitzi/sdk-shared 0.39.0 → 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 +14 -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.d.ts +1 -1
- package/dist/schema/schemaSettings.mjs +2 -3
- 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.d.ts +20 -4
- package/dist/state/paintedState.mjs +21 -21
- 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/store/runtimeStatePersist.mjs +171 -0
- 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 +8 -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/state/runtimeStatePersist.mjs +0 -119
- 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,334 +1,8 @@
|
|
|
1
|
-
import { ActionEntry, ActionRunReport, ActionTaskDescriptor } from './ActionTypes';
|
|
2
|
-
import { SessionScope } from './AuthTypes';
|
|
3
1
|
import { Environment } from './CommonTypes';
|
|
4
|
-
import { ConnectorEntry } from './ConnectorTypes';
|
|
5
|
-
import { DataDraft, DataSaveResult } from './DataTypes';
|
|
6
|
-
import { FunctionsDraft, FunctionsSaveResult } from './FunctionTypes';
|
|
7
|
-
import { Schema } from './SchemaTypes';
|
|
8
|
-
import { AnalyticsConfig, OfflineDataRaw } from './SdkTypes';
|
|
9
|
-
import { PluginSource, SSRChangePage, SSRChangeQuery, SSRCredential, SSRGrant, SSRRequest, SSRSession, SSRTemplateProps, SSRUser, SSRWriteContext } from './ServerTypes';
|
|
10
|
-
import { Style } from './StyleTypes';
|
|
11
|
-
import { ActivityReader, SpaceActivityPage, SpaceActivityQuery } from '../activity/types';
|
|
12
|
-
import { FlagOverrides } from '../flags/resolveFlags';
|
|
13
|
-
import { TSpaceEntitlements } from '../network/entitlements';
|
|
14
|
-
export type SSRSpaceDeployment = {
|
|
15
|
-
/** Who may put this space in an iframe, as CSP `frame-ancestors` sources (e.g. `'self'`, `https://acme.com`,
|
|
16
|
-
* or `*`). Resolved per space by the consumer, because only it knows the domains that space declares — a
|
|
17
|
-
* published space must not be framable from a site its owner never allowed. Omitted → the server's own
|
|
18
|
-
* `frameOptions` default stands. */
|
|
19
|
-
frameAncestors?: string[];
|
|
20
|
-
environment?: Environment;
|
|
21
|
-
credential?: SSRCredential;
|
|
22
|
-
spaceId?: number | null;
|
|
23
|
-
revision?: number;
|
|
24
|
-
/**
|
|
25
|
-
* What this space's feature flags are at, for a deployment that keeps them apart from its revisions — a hash that
|
|
26
|
-
* changes exactly when they do. Part of every cache key a render is kept under (the page, its server data, the space
|
|
27
|
-
* read for it), so a flag turned in production reaches the next request while the revision stays the same. Absent,
|
|
28
|
-
* the flags change only with the revision, and the revision alone keys the caches.
|
|
29
|
-
*/
|
|
30
|
-
flagsVersion?: string;
|
|
31
|
-
/**
|
|
32
|
-
* This render is an author looking at their own work — the builder's preview — rather than a visitor being
|
|
33
|
-
* served. Metering skips it: nobody should be billed for editing.
|
|
34
|
-
*
|
|
35
|
-
* It is a property of HOW the request resolved, not of the environment it renders. Those two look the same
|
|
36
|
-
* from the render's side and are not: a space's free preview sub-domain serves the live editing environment
|
|
37
|
-
* to the public, so "which environment" cannot tell an author apart from a visitor. Only the resolver knows,
|
|
38
|
-
* which is why it says so here.
|
|
39
|
-
*/
|
|
40
|
-
authoring?: boolean;
|
|
41
|
-
templateProps?: SSRTemplateProps;
|
|
42
|
-
pluginNames?: string[];
|
|
43
|
-
pluginSources?: Record<string, PluginSource>;
|
|
44
|
-
error?: {
|
|
45
|
-
code: number;
|
|
46
|
-
message: string;
|
|
47
|
-
};
|
|
48
|
-
};
|
|
49
2
|
export type SSRRscData = {
|
|
50
3
|
/** Per-element server data keyed by schema element ID. Each element reads its own slice via its id prop. */
|
|
51
4
|
serverData?: Record<string, unknown>;
|
|
52
5
|
};
|
|
53
|
-
/** Semantic + machine-readable metadata for one element type, so the MCP can tell an agent what the type DOES
|
|
54
|
-
* (not just that it exists) AND validate against it. `category` groups it (e.g. provider, structure, media);
|
|
55
|
-
* `custom` marks a plugin-provided type. The MCP keys strict-vs-lenient validation off `custom`: a `custom:false`
|
|
56
|
-
* (default sdk-elements) type is authoritative — an unknown attribute/setState key on it is an error — while a
|
|
57
|
-
* `custom:true` (plugin) type is best-effort (warnings only), since its metadata is a manifest snapshot. */
|
|
58
|
-
export type ComponentCatalogEntry = {
|
|
59
|
-
label?: string;
|
|
60
|
-
description?: string;
|
|
61
|
-
category?: string;
|
|
62
|
-
custom?: boolean;
|
|
63
|
-
/** The type's attribute/prop keys — the authoritative set for a default type (setState `key` when
|
|
64
|
-
* category="attribute", and type-prop validation). Absent when unknown (e.g. a plugin with no manifest). */
|
|
65
|
-
attributes?: string[];
|
|
66
|
-
/** The type's `definition.styleSelectors` keys (slots) — setState `key` when category="state" is
|
|
67
|
-
* `visibility` or `styleSelectors.<selector>`. */
|
|
68
|
-
styleSelectors?: string[];
|
|
69
|
-
/** The type's intrinsic base default CSS (its `defaultStyle.style.base.default`) — the declarations the element
|
|
70
|
-
* renders with before any class is attached, e.g. `text` defaults to `{ display: 'inline' }`. The MCP surfaces
|
|
71
|
-
* it so an agent styles against the real starting point instead of assuming `display: block`. */
|
|
72
|
-
defaultStyle?: Record<string, string>;
|
|
73
|
-
/** Binding targets the type exposes, from the plugin manifest's `defaultStyle.bindingsAllowed`. */
|
|
74
|
-
bindingsAllowed?: {
|
|
75
|
-
attributes?: string[];
|
|
76
|
-
initialState?: string[];
|
|
77
|
-
};
|
|
78
|
-
/** The attributes a role that edits the content and not the design may change: its words, a link, a
|
|
79
|
-
* picture. Absent, none — an element of the type is the design's alone. */
|
|
80
|
-
contentAttributes?: string[];
|
|
81
|
-
};
|
|
82
|
-
/** Element type → its semantic metadata, keyed by the `type` string used in the schema. Covers BOTH the default
|
|
83
|
-
* sdk-elements types (custom:false, authoritative) and the plugin (custom:true) element types installed on a
|
|
84
|
-
* space, so the MCP can validate types/attributes dynamically per space instead of against a hand-mirror. */
|
|
85
|
-
export type ComponentCatalog = Record<string, ComponentCatalogEntry>;
|
|
86
|
-
export type SSRAdapters = {
|
|
87
|
-
/** The space's render payload. Optional HERE and required by a page server (see {@link SSRPageAdapters}): a
|
|
88
|
-
* dedicated MCP server renders nothing, reads schema and style through its own adapters, and had to hand this
|
|
89
|
-
* one over anyway for the type to be satisfied — an adapter it never called. */
|
|
90
|
-
getOfflineData?: (spaceId: number, environment: string, revision?: number) => Promise<OfflineDataRaw | undefined>;
|
|
91
|
-
/**
|
|
92
|
-
* Which space, environment and revision a request resolves to. Optional here for the same reason as
|
|
93
|
-
* `getOfflineData`: MCP resolves its space from the request token (`getGrant`), never from the host.
|
|
94
|
-
*
|
|
95
|
-
* Asked on EVERY request, not only a page's: what the page fetches after it — `/_plitzi/space/<hash>.json`, `/_action`,
|
|
96
|
-
* `/fn/…`, `/_realtime` — is resolved again, and carries nothing of the page's address but its host (and the
|
|
97
|
-
* visitor's credentials). So a space is chosen by the host — a domain, a sub-domain (`wildcardSubdomain`) — or by a
|
|
98
|
-
* credential (`authoringPreview`): one chosen by the page's path or query is lost on the requests that follow it.
|
|
99
|
-
*/
|
|
100
|
-
getSpaceDeployment?: (req: SSRRequest) => Promise<SSRSpaceDeployment>;
|
|
101
|
-
/** Resolve the grant the MCP request operates under, from the verified `Authorization` bearer. The consumer
|
|
102
|
-
* owns the JWT secret and the authorization model, so it decides here; the MCP service stays stateless.
|
|
103
|
-
* Returns undefined when the token is missing or invalid. Required for the `mcp` service to serve any
|
|
104
|
-
* request. `canWrite` is what separates a read-only bearer from one that may change the space — the MCP
|
|
105
|
-
* refuses every write tool without it, and never infers the answer from the token itself. */
|
|
106
|
-
getGrant?: (req: SSRRequest) => Promise<SSRGrant | undefined>;
|
|
107
|
-
/**
|
|
108
|
-
* Whether the tool calls a request carries may run — asked once per request that makes any, with how many it makes.
|
|
109
|
-
* A refusal's `error` is what the agent reads as each call's result, so it says why and the way past it (a plan's
|
|
110
|
-
* daily ceiling, say). Omitted, every call runs.
|
|
111
|
-
*/
|
|
112
|
-
admitToolCalls?: (req: SSRRequest, calls: number) => Promise<{
|
|
113
|
-
error: string;
|
|
114
|
-
} | undefined>;
|
|
115
|
-
/** Read the element schema for the MCP tools. Separate from `getOfflineData` (which is SSR/RSC shaped and
|
|
116
|
-
* strips `style.platform`); the MCP style resource needs the full documents, so schema and style split. */
|
|
117
|
-
getSchema?: (spaceId: number, environment: Environment) => Promise<Schema | undefined>;
|
|
118
|
-
/** Read the full style document (with `platform`/`mode`, which the MCP definitions resource requires). */
|
|
119
|
-
getStyle?: (spaceId: number, environment: Environment) => Promise<Style | undefined>;
|
|
120
|
-
/** Read the semantic catalog of the space's PLUGIN (custom) element types — label/description/category from
|
|
121
|
-
* each installed plugin's manifest — so the MCP `plitzi://types` resource can explain what custom elements do.
|
|
122
|
-
* The MCP already knows the built-in types. When omitted, custom types surface with their observed label only. */
|
|
123
|
-
getComponentCatalog?: (spaceId: number, environment: Environment) => Promise<ComponentCatalog | undefined>;
|
|
124
|
-
/** Read every connector configured for the space, so the MCP can list them and author provider elements against
|
|
125
|
-
* them. Connectors are space-level (not per environment) server-side state: the manifests name endpoints and an
|
|
126
|
-
* auth scheme, so this must never feed a browser payload. When omitted, the MCP's connector resource is empty
|
|
127
|
-
* and a provider element cannot be checked against the connector it names. */
|
|
128
|
-
getConnectors?: (spaceId: number) => Promise<ConnectorEntry[] | undefined>;
|
|
129
|
-
/** Create or replace one connector, keyed by `entry.id`. When omitted, connector ops apply in memory only and
|
|
130
|
-
* `apply` reports `persisted: false`. */
|
|
131
|
-
saveConnector?: (spaceId: number, entry: ConnectorEntry) => Promise<void>;
|
|
132
|
-
/** Remove one connector by its identifier. Omitted alongside `saveConnector` for a read-only deployment. */
|
|
133
|
-
deleteConnector?: (spaceId: number, connectorId: string) => Promise<void>;
|
|
134
|
-
/** Read every server action configured for the space, so the MCP can list them and author flows against them.
|
|
135
|
-
* Space-level server-side state like connectors: the documents name credentials, connectors and steps, so this
|
|
136
|
-
* must never feed a browser payload. When omitted, the MCP's action resource is empty. */
|
|
137
|
-
getActions?: (spaceId: number) => Promise<ActionEntry[] | undefined>;
|
|
138
|
-
/** The server tasks a flow can be built from — what THIS deployment can run, which is the SDK's built-ins plus
|
|
139
|
-
* whatever tasks it registered. Shaped as `ActionTaskDescriptor` in `@plitzi/sdk-server/actions`. Without it an
|
|
140
|
-
* agent authoring an action is guessing at the step vocabulary. */
|
|
141
|
-
getActionTasks?: (spaceId: number) => Promise<ActionTaskDescriptor[] | undefined>;
|
|
142
|
-
/** What the space's plan includes (`TSpaceEntitlements`), for the primer to say before an agent plans work the space
|
|
143
|
-
* cannot ship. Omitted — a self-hosted deployment — everything is included and the primer says nothing of a plan. */
|
|
144
|
-
getEntitlements?: (spaceId: number) => Promise<TSpaceEntitlements | undefined>;
|
|
145
|
-
/** Create or replace one action, keyed by `entry.id`. When omitted, action ops apply in memory only and `apply`
|
|
146
|
-
* reports `persisted: false`. */
|
|
147
|
-
saveAction?: (spaceId: number, entry: ActionEntry) => Promise<void>;
|
|
148
|
-
/** Remove one action by its identifier. Omitted alongside `saveAction` for a read-only deployment. */
|
|
149
|
-
deleteAction?: (spaceId: number, actionId: string) => Promise<void>;
|
|
150
|
-
/** The space's own functions: the draft's source files, which copy of them it is and what they declare.
|
|
151
|
-
* Server-side code like the actions it serves — never a browser payload. When omitted, the MCP offers no functions
|
|
152
|
-
* resource and refuses the function ops. */
|
|
153
|
-
getFunctions?: (spaceId: number) => Promise<FunctionsDraft | undefined>;
|
|
154
|
-
/** Save the draft's functions, whole. The deployment builds and checks them and answers what is wrong where it is;
|
|
155
|
-
* `base` is the version the agent read, and a draft that moved on since is refused rather than overwritten. */
|
|
156
|
-
saveFunctions?: (spaceId: number, files: Record<string, string>, base: string, write: SSRWriteContext) => Promise<FunctionsSaveResult>;
|
|
157
|
-
/** Run one task of the draft's functions in the sandbox for the person behind the agent — the builder's Try. */
|
|
158
|
-
tryFunction?: (spaceId: number, task: string, params: Record<string, unknown>, write: SSRWriteContext) => Promise<ActionRunReport>;
|
|
159
|
-
/**
|
|
160
|
-
* Play the space's e2e tests on its draft, in a browser of the deployment's — those named, or all: each
|
|
161
|
-
* test's result, or why none was run there. When omitted, an agent's e2e tests are said as not run.
|
|
162
|
-
*/
|
|
163
|
-
runE2eTests?: (spaceId: number, ids: readonly string[]) => Promise<{
|
|
164
|
-
results: unknown[];
|
|
165
|
-
} | {
|
|
166
|
-
notRun: string;
|
|
167
|
-
}>;
|
|
168
|
-
/** The space's own data: the draft's JSON files its server providers read (`/data/<file>`), and which copy they are.
|
|
169
|
-
* When omitted, the MCP offers no data resource and refuses the data ops. */
|
|
170
|
-
getData?: (spaceId: number) => Promise<DataDraft | undefined>;
|
|
171
|
-
/** Save the draft's data, whole: every file JSON at a plain path. `base` is the version the agent read, and data that
|
|
172
|
-
* moved on since is refused rather than overwritten. */
|
|
173
|
-
saveData?: (spaceId: number, files: Record<string, string>, base: string, write: SSRWriteContext) => Promise<DataSaveResult>;
|
|
174
|
-
/** Persist the element schema mutated by the MCP `apply` tool. When omitted, `apply` reports `persisted: false`. */
|
|
175
|
-
saveSchema?: (spaceId: number, environment: Environment, schema: Schema, write: SSRWriteContext) => Promise<void>;
|
|
176
|
-
/** Persist the style document mutated by the MCP `apply` tool — store it as given. `style.cache` arrives already
|
|
177
|
-
* compiled: the renderer serves that string and nothing else, so recomputing it is not a detail to delegate, and
|
|
178
|
-
* asking every deployment to remember it was one bug each of them could write alone. When omitted, `apply`
|
|
179
|
-
* reports `persisted: false`. */
|
|
180
|
-
saveStyle?: (spaceId: number, environment: Environment, style: Style, write: SSRWriteContext) => Promise<void>;
|
|
181
|
-
/** The space's change history, read-only: what every writer saved, and for whom. When omitted, the MCP offers no
|
|
182
|
-
* history resource. */
|
|
183
|
-
getChanges?: (spaceId: number, environment: Environment, query: SSRChangeQuery) => Promise<SSRChangePage>;
|
|
184
|
-
/** What happened on the space after a cursor — the draft changed, a version went out, an action failed — waiting up
|
|
185
|
-
* to `query.wait` seconds when nothing has yet. `reader` is who asks, so their own writes can be left out; `signal`
|
|
186
|
-
* ends the wait when the client goes. When omitted, the MCP offers no `plitzi_activity`. */
|
|
187
|
-
getActivity?: (spaceId: number, query: SpaceActivityQuery, reader: ActivityReader, signal?: AbortSignal) => Promise<SpaceActivityPage>;
|
|
188
|
-
/** Who this request carries, if anyone. The adapter reads the credential and resolves it; the cookie it arrived
|
|
189
|
-
* in was written by the server, from {@link SSRAuthCookie}. */
|
|
190
|
-
getUser?: (req: SSRRequest) => Promise<SSRUser | undefined>;
|
|
191
|
-
/**
|
|
192
|
-
* Verify credentials and mint a session — identity, and nothing else. The server writes the cookies, clears them,
|
|
193
|
-
* and keeps the readable hint in step, because those are properties of how sessions travel rather than of who
|
|
194
|
-
* anyone is. A deployment bringing its own user database implements this and gets the rest for free.
|
|
195
|
-
*
|
|
196
|
-
* Return undefined to refuse. Never throw for a wrong password.
|
|
197
|
-
*/
|
|
198
|
-
authenticate?: (credentials: Record<string, string>, req: SSRRequest) => Promise<SSRSession | undefined>;
|
|
199
|
-
/** Revoke whatever session this request carries, at the source. The cookies are the server's to clear. */
|
|
200
|
-
endSession?: (req: SSRRequest) => Promise<void>;
|
|
201
|
-
/**
|
|
202
|
-
* Sign the person this request carries out on every device: `site`, of the sessions signed in on this request's host
|
|
203
|
-
* (a space's own — its visitors' sign-out everywhere); `all`, of every session of the account. Answers whether one was
|
|
204
|
-
* carried: nobody signed in has nothing to end. The cookies are the server's to clear.
|
|
205
|
-
*/
|
|
206
|
-
endSessions?: (req: SSRRequest, scope: SessionScope) => Promise<boolean>;
|
|
207
|
-
/**
|
|
208
|
-
* Turn a credential the browser obtained from an identity provider into a session here — see the exchange stage.
|
|
209
|
-
* Everything that decides whether it is any good lives in this adapter, because only the deployment knows:
|
|
210
|
-
*
|
|
211
|
-
* - which providers it trusts, and which one the space in question actually signs people in with;
|
|
212
|
-
* - that the token was minted for **this** application. Anyone who has signed into any other site with the same
|
|
213
|
-
* provider holds a valid token for that user, so accepting one merely because the provider recognises it lets
|
|
214
|
-
* that site sign in here as them. A provider that cannot prove it must be refused outright.
|
|
215
|
-
*/
|
|
216
|
-
exchangeCredential?: (provider: string, token: string, req: SSRRequest) => Promise<{
|
|
217
|
-
ok: true;
|
|
218
|
-
session: SSRSession;
|
|
219
|
-
user?: SSRUser;
|
|
220
|
-
} | {
|
|
221
|
-
ok: false;
|
|
222
|
-
error: string;
|
|
223
|
-
status?: number;
|
|
224
|
-
reason?: string;
|
|
225
|
-
}>;
|
|
226
|
-
/** Called by the RSC endpoint, and once per page render, to fetch server-side data for server components.
|
|
227
|
-
* See {@link SSRRscContext} for what it is given. */
|
|
228
|
-
getRscData?: (context: SSRRscContext) => Promise<SSRRscData>;
|
|
229
|
-
/**
|
|
230
|
-
* One billable server request. This is where a deployment meters usage, because these are the moments it
|
|
231
|
-
* actually spends bandwidth on a visitor and the ones a visitor cannot reach around: the browser is told
|
|
232
|
-
* what happened, never asked. Each runs before its cache is consulted, so a cached response still counts.
|
|
233
|
-
*
|
|
234
|
-
* What comes back shapes the response — degrade the free tier, hand the browser its reporting channel — and
|
|
235
|
-
* a deployment that meters nothing simply omits the adapter. Never throw from here: a metering outage must
|
|
236
|
-
* not take a site down, so failures should degrade to "served, uncounted".
|
|
237
|
-
*/
|
|
238
|
-
meter?: (event: SSRMeterEvent) => Promise<SSRMeterDecision | undefined>;
|
|
239
|
-
};
|
|
240
|
-
/**
|
|
241
|
-
* Which area of server work is being metered. One name per area, because that is the unit a deployment prices
|
|
242
|
-
* — a full page render does not cost what a partial data refresh costs, and both are cheaper when a cache
|
|
243
|
-
* answered them than when the origin did.
|
|
244
|
-
*/
|
|
245
|
-
export type MeteredKind = 'page_view' | 'rsc_query'
|
|
246
|
-
/** Reserved: nothing emits this yet. Server actions are not implemented — the area exists so wiring them
|
|
247
|
-
* later is a call site, not a schema change. */
|
|
248
|
-
| 'server_action';
|
|
249
|
-
/** The request being metered, for {@link SSRAdapters.meter}. */
|
|
250
|
-
export interface SSRMeterEvent {
|
|
251
|
-
kind: MeteredKind;
|
|
252
|
-
/**
|
|
253
|
-
* Whether a cache answered this instead of the origin. Reported rather than inferred: only the handler knows,
|
|
254
|
-
* it is the same fact the response puts on the wire as `X-Cache: HIT`, and what it is worth is the
|
|
255
|
-
* deployment's to decide — an area may price a hit lower, or not distinguish one at all.
|
|
256
|
-
*/
|
|
257
|
-
cached: boolean;
|
|
258
|
-
req: SSRRequest;
|
|
259
|
-
spaceId: number;
|
|
260
|
-
environment: Environment;
|
|
261
|
-
revision: number;
|
|
262
|
-
}
|
|
263
|
-
/** What the deployment decided about this request. */
|
|
264
|
-
export type SSRMeterDecision = {
|
|
265
|
-
/** This space is over the quota its plan allows and the render should say so — the "Made with Plitzi" badge
|
|
266
|
-
* on the free tier. Paid plans accrue overage instead and never set this. */
|
|
267
|
-
degrade?: boolean;
|
|
268
|
-
/** The deployment's "Made with Plitzi" badge on this render — its attribution, on a plan that does not remove it. */
|
|
269
|
-
badge?: boolean;
|
|
270
|
-
/**
|
|
271
|
-
* This space has nearly spent its plan's allowance and the render should say so, calmly — before `degrade` would. The
|
|
272
|
-
* deployment decides where: Plitzi says it on the shared domain, where the visitor is the one who might tell the owner.
|
|
273
|
-
*/
|
|
274
|
-
quotaNear?: boolean;
|
|
275
|
-
/**
|
|
276
|
-
* This page is sent `X-Robots-Tag: noindex`: an address the deployment does not mean to host a site on — a free
|
|
277
|
-
* sub-domain — kept out of search results, where an abused one would do the most harm.
|
|
278
|
-
*/
|
|
279
|
-
noindex?: boolean;
|
|
280
|
-
/**
|
|
281
|
-
* The deployment does not serve this page right now, and these are the words its visitor reads instead: the page is
|
|
282
|
-
* answered 503, never rendered, cached or indexed — an address the deployment holds back, as a free site whose
|
|
283
|
-
* owner has not confirmed their email.
|
|
284
|
-
*/
|
|
285
|
-
unavailable?: string;
|
|
286
|
-
/** Client reporting channel, injected into the page bootstrap. Omitted → the page reports nothing. Only a
|
|
287
|
-
* page render has anywhere to put it; the other kinds answer data, not a document. */
|
|
288
|
-
analytics?: AnalyticsConfig;
|
|
289
|
-
};
|
|
290
|
-
/** What a server that RENDERS PAGES must answer: the two adapters every page request goes through, on top of the
|
|
291
|
-
* optional rest. Stated as its own type rather than by making them required for everyone, because "required" is
|
|
292
|
-
* a property of the surface being served and not of the adapter set — a dedicated MCP server has no page request
|
|
293
|
-
* to resolve, and the old shape made it hand over two adapters nothing would ever call. */
|
|
294
|
-
export type SSRPageAdapters = SSRAdapters & Required<Pick<SSRAdapters, 'getOfflineData' | 'getSpaceDeployment'>>;
|
|
295
|
-
/**
|
|
296
|
-
* Everything an RSC read is given: which space and revision, who is asking, and which elements want data.
|
|
297
|
-
*
|
|
298
|
-
* One object rather than six positional parameters, because the reason to add to it is exactly the reason the
|
|
299
|
-
* positional form failed — `loadOfflineData` is a seventh thing to know, and nobody should have to count commas to
|
|
300
|
-
* reach it, nor rewrite their adapter when an eighth arrives.
|
|
301
|
-
*/
|
|
302
|
-
export interface SSRRscContext {
|
|
303
|
-
req: SSRRequest;
|
|
304
|
-
spaceId: number;
|
|
305
|
-
environment: Environment;
|
|
306
|
-
revision: number;
|
|
307
|
-
/** Whoever the request carries, already resolved. */
|
|
308
|
-
user?: SSRUser;
|
|
309
|
-
/** On a partial refresh, the only element ids that want data. Absent means every one — the initial render. */
|
|
310
|
-
ids?: string[];
|
|
311
|
-
/**
|
|
312
|
-
* The space itself, read at most once per request however many times this is called.
|
|
313
|
-
*
|
|
314
|
-
* It is here because an adapter almost always needs the schema (to know which elements are server-rendered, or
|
|
315
|
-
* whether RSC is on at all) and the server is already loading it for the page — in parallel with this very call.
|
|
316
|
-
* Without a shared handle every deployment fetched it a second time, or wrote its own in-flight dedup to avoid
|
|
317
|
-
* doing so. Awaiting this joins the read already under way; it never starts a second one.
|
|
318
|
-
*/
|
|
319
|
-
loadOfflineData: () => Promise<OfflineDataRaw | undefined>;
|
|
320
|
-
/**
|
|
321
|
-
* What the layers above the space decide about its flags for this request: the server's own and, on a page allowed
|
|
322
|
-
* to debug, a tester's. An element gated off by a flag is not resolved — `resolveRscData` resolves the flags
|
|
323
|
-
* against the page it matched and skips it — so a feature that is off puts nothing in the payload.
|
|
324
|
-
*/
|
|
325
|
-
flagOverrides?: FlagOverrides;
|
|
326
|
-
/**
|
|
327
|
-
* Aborted when whoever asked stops waiting — a browser that hung up, a refresh superseded by a newer one, a STOP — so
|
|
328
|
-
* what it asked for stops being worked on, here and in the runs it started.
|
|
329
|
-
*/
|
|
330
|
-
signal?: AbortSignal;
|
|
331
|
-
}
|
|
332
6
|
/**
|
|
333
7
|
* Which published version of a space is asking.
|
|
334
8
|
*
|