@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
|
@@ -97,6 +97,12 @@ export type AuthContextValue = {
|
|
|
97
97
|
provider: string;
|
|
98
98
|
state: AuthState;
|
|
99
99
|
authenticated: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* The visitor ended their session on this page themselves (`logout`, `logoutEverywhere`), and has not signed in since.
|
|
102
|
+
* A page for signed-in visitors sends them to sign in with nothing to come back to: the page they left is the one they
|
|
103
|
+
* chose to leave, and sent back to it they were only ever sent to sign in again.
|
|
104
|
+
*/
|
|
105
|
+
signedOutHere?: boolean;
|
|
100
106
|
user?: {
|
|
101
107
|
details?: {
|
|
102
108
|
id: number;
|
|
@@ -21,6 +21,16 @@ export type Server<T extends Record<string, unknown> = Record<string, unknown>>
|
|
|
21
21
|
* on the wrong origin. Absent means `/fonts` on whatever origin is rendering.
|
|
22
22
|
*/
|
|
23
23
|
fontsBaseUrl?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Where this deployment serves the space's Google families from, in Google's own layout (`<url>/css2?family=…`):
|
|
26
|
+
* the page server's mirror. Absent means Google itself — a page the SDK renders with no page server behind it.
|
|
27
|
+
*/
|
|
28
|
+
googleFontsUrl?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The page's script policy as its server sent it (`SSRServerConfig.scriptPolicy`): `'enforce'`, and the SDK's Trusted
|
|
31
|
+
* Types policies clean what an author or the data wrote before it is put in the page; anything else, they pass it on.
|
|
32
|
+
*/
|
|
33
|
+
scriptPolicy?: 'report-only' | 'enforce';
|
|
24
34
|
websocketServer: string;
|
|
25
35
|
subscriptionServer: string;
|
|
26
36
|
location?: Location;
|
|
@@ -54,9 +64,10 @@ export type ServerSSR = {
|
|
|
54
64
|
rscPath?: string;
|
|
55
65
|
/** The payload that server already resolved for this page, so the first render costs no request. */
|
|
56
66
|
rscData?: SSRRscData;
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
67
|
+
/** Where this page runs server actions and a provider's writes: a path on its own origin, or an address on another
|
|
68
|
+
* (`action.origin`), called with the visitor's cookies either way. Published only by a server that mounts the
|
|
69
|
+
* endpoint: its absence is what tells a client flow that a `serverAction` step has nowhere to run, rather than
|
|
70
|
+
* letting it fail per click. A static export publishes nothing here and the step reports itself inert. */
|
|
60
71
|
actionPath?: string;
|
|
61
72
|
/** Path where this origin's realtime channels answer. Published only by a server that mounts them: its absence is
|
|
62
73
|
* what keeps a `channel` element closed in the builder, an embed or a static export. */
|
|
@@ -3,16 +3,24 @@ import { InteractionCallbackParam } from './InteractionTypes';
|
|
|
3
3
|
import { JobStatus } from './JobTypes';
|
|
4
4
|
/**
|
|
5
5
|
* A space's own functions, as everything outside the runner sees them: the builder, the CLI, the MCP and the
|
|
6
|
-
* platform that stores them. The contract the code itself is written against is `@plitzi/sdk-
|
|
6
|
+
* platform that stores them. The contract the code itself is written against is `@plitzi/sdk-runtime`.
|
|
7
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* How much memory a task runs with, by name (`FUNCTION_SIZES` in `@plitzi/sdk-shared/actions`): small unless it asks
|
|
10
|
+
* for more. The runner keeps a task's memory for it whole while it runs, so a small one leaves room for many beside it;
|
|
11
|
+
* a space's plan says which sizes its tasks may ask for.
|
|
12
|
+
*/
|
|
13
|
+
export type FunctionSize = 'small' | 'medium' | 'large';
|
|
8
14
|
/**
|
|
9
15
|
* What a task — or every task and route, declared once for all of them — asks to be given beyond an invocation's
|
|
10
|
-
* default: CPU time, awaits not counted
|
|
11
|
-
* asking for more is a problem when the
|
|
16
|
+
* default: CPU time, awaits not counted; wall time, from the moment it starts; and its size, the memory it runs with.
|
|
17
|
+
* Never more than the space's plan or the server allows; asking for more than the server does is a problem when the
|
|
18
|
+
* functions are saved, and a size the plan does not include is refused when the task runs, naming the plan.
|
|
12
19
|
*/
|
|
13
|
-
export type
|
|
20
|
+
export type FunctionAskedLimits = {
|
|
14
21
|
cpuMs?: number;
|
|
15
22
|
wallMs?: number;
|
|
23
|
+
size?: FunctionSize;
|
|
16
24
|
};
|
|
17
25
|
/** One task the functions declare: everything but its code — what the catalog shows and a step is drawn from. */
|
|
18
26
|
export type FunctionTaskManifest = {
|
|
@@ -22,7 +30,7 @@ export type FunctionTaskManifest = {
|
|
|
22
30
|
description?: string;
|
|
23
31
|
params: Record<string, InteractionCallbackParam<Record<string, unknown>>>;
|
|
24
32
|
/** What it asks for beyond the default — over what the functions ask for all of their tasks. */
|
|
25
|
-
limits?:
|
|
33
|
+
limits?: FunctionAskedLimits;
|
|
26
34
|
};
|
|
27
35
|
/** One job the functions declare (`defineFunctions({ jobs })`): everything but its code. */
|
|
28
36
|
export type FunctionJobManifest = {
|
|
@@ -91,7 +99,7 @@ export type FunctionsManifest = {
|
|
|
91
99
|
/** The route keys, `'GET /board-assets/:board/:asset'`, as declared. */
|
|
92
100
|
routes: string[];
|
|
93
101
|
/** What every task and route asks for beyond the default, unless a task asks for its own. */
|
|
94
|
-
limits?:
|
|
102
|
+
limits?: FunctionAskedLimits;
|
|
95
103
|
/** The OAuth connections its code makes (`ctx.oauth`), by the name the code calls them. */
|
|
96
104
|
oauth?: Record<string, FunctionOAuthConnection>;
|
|
97
105
|
/** The jobs it runs (`ctx.jobs.start`), by name. */
|
|
@@ -119,6 +127,8 @@ export type FunctionsDraft = {
|
|
|
119
127
|
offer: {
|
|
120
128
|
template: string;
|
|
121
129
|
} | null;
|
|
130
|
+
/** The sizes the space's plan lets a task ask for, smallest first: what the builder offers, the rest locked. */
|
|
131
|
+
sizes: FunctionSize[];
|
|
122
132
|
};
|
|
123
133
|
/**
|
|
124
134
|
* Why nothing was saved: `version`, the draft moved on since the copy this save started from; `storage`, the space has
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementInteraction } from './SchemaTypes';
|
|
2
2
|
import { SpaceCredentialProvider } from './SpaceTypes';
|
|
3
|
-
import { RuleValue } from '
|
|
3
|
+
import { RuleValue } from '../conditions/types';
|
|
4
4
|
export type InteractionCallbackType = 'trigger' | 'globalCallback' | 'callback' | 'utility' | 'task';
|
|
5
5
|
export type InteractionStatus = 'completed' | 'skipped' | 'failed';
|
|
6
6
|
export type InteractionNodeStatus = 'success' | 'failed' | 'skipped' | 'disabled';
|
package/dist/types/JobTypes.d.ts
CHANGED
|
@@ -9,21 +9,54 @@ import { RunUser } from './ServerTypes';
|
|
|
9
9
|
/**
|
|
10
10
|
* Where a job is, as the only durable answer to "did it happen".
|
|
11
11
|
*
|
|
12
|
-
* `pending` is waiting to be taken, `running` is held by a worker under a lease, `paused` is
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* `pending` is waiting to be taken, `running` is held by a worker under a lease, `paused` is set aside until somebody
|
|
13
|
+
* resumes it — a job of a space's functions with what it saved, one that failed every attempt it was given (for somebody
|
|
14
|
+
* to read its runs and resume it once fixed, every attempt again, or cancel it), one no worker may hold — and the other
|
|
15
|
+
* four are terminal, except that an operator may put a `failed`, `dead` or `cancelled` one back to `pending`. `dead` is
|
|
16
|
+
* a job that can never run: its action is gone or switched off, or a visitor's call was kept past a day.
|
|
16
17
|
*/
|
|
17
18
|
export type JobStatus = 'pending' | 'running' | 'paused' | 'succeeded' | 'failed' | 'dead' | 'cancelled';
|
|
18
|
-
/**
|
|
19
|
-
export type JobStop = 'cancel' | 'pause';
|
|
20
|
-
/** A run of one of the space's actions: a schedule's fire, a run set for later. */
|
|
19
|
+
/** A run of one of the space's actions: a schedule's fire, a run set for later, a call kept until it could run. */
|
|
21
20
|
export type ActionJobTarget = {
|
|
22
21
|
kind: 'action';
|
|
23
22
|
/** The action, by its identifier. */
|
|
24
23
|
name: string;
|
|
25
24
|
/** The trigger it is run through — what the action's document lets start it this way. */
|
|
26
25
|
trigger: ActionTriggerType;
|
|
26
|
+
/**
|
|
27
|
+
* For a call kept in the queue because nothing could run it then (no worker, no runner): who made it, as the
|
|
28
|
+
* session said when it was accepted — the run is theirs, with their permissions, however long after — and how the
|
|
29
|
+
* transport named them (`user:<id>`, `ip:<address>`).
|
|
30
|
+
*/
|
|
31
|
+
user?: RunUser;
|
|
32
|
+
/**
|
|
33
|
+
* Its action runs the space's own code — a step of its functions: what a worker leaves in the queue while its runs
|
|
34
|
+
* wait for a functions runner with room (`claim({ takes })`), taking the jobs that need none meanwhile. Set as
|
|
35
|
+
* the job is queued, from the action's document; absent, it runs none.
|
|
36
|
+
*/
|
|
37
|
+
code?: true;
|
|
38
|
+
callerId?: string;
|
|
39
|
+
/** The key the caller named the call by: a call that did run before it was kept answers with that run instead. */
|
|
40
|
+
idempotencyKey?: string;
|
|
41
|
+
/** The page's origin, and the version of the space it was published at: what the call would have run with then. */
|
|
42
|
+
origin?: string;
|
|
43
|
+
at?: SpaceRevision;
|
|
44
|
+
/** The secret the caller reads the call's answer with (`QueuedCallStatus`): the job's id alone is not enough. */
|
|
45
|
+
ticket?: string;
|
|
46
|
+
};
|
|
47
|
+
/** A call kept in the queue, as its caller reads it: where it is, and once it ran, what it answered. */
|
|
48
|
+
export type QueuedCallStatus = {
|
|
49
|
+
status: 'queued' | 'running';
|
|
50
|
+
jobId: string;
|
|
51
|
+
attempts: number;
|
|
52
|
+
} | {
|
|
53
|
+
status: 'completed' | 'failed';
|
|
54
|
+
jobId: string;
|
|
55
|
+
runId: string;
|
|
56
|
+
output: Record<string, unknown>;
|
|
57
|
+
error?: string;
|
|
58
|
+
code?: string;
|
|
59
|
+
reason?: string;
|
|
27
60
|
};
|
|
28
61
|
/**
|
|
29
62
|
* One of the space's functions' jobs (`defineFunctions({ jobs })`), run slice by slice — kept as it was when it started:
|
|
@@ -71,6 +104,10 @@ export type JobAttempt = {
|
|
|
71
104
|
error?: string;
|
|
72
105
|
/** The error is the code's own refusal (`ActionRefusal`), written for whoever asked — what a job's watcher may read. */
|
|
73
106
|
refused?: true;
|
|
107
|
+
/** What the worker that held it may hold, in MiB, when it said. */
|
|
108
|
+
memoryMb?: number;
|
|
109
|
+
/** That worker said it neared its memory while it held the job: a `lost` one then needs a larger worker. */
|
|
110
|
+
nearMemoryLimit?: true;
|
|
74
111
|
};
|
|
75
112
|
/** What starting a job needs. Everything else is the queue's to fill in. */
|
|
76
113
|
export type JobInput = {
|
|
@@ -92,6 +129,14 @@ export type JobInput = {
|
|
|
92
129
|
maxAttempts: number;
|
|
93
130
|
/** Fires that went by unclaimed before this one. Shown to an operator; never acted on. */
|
|
94
131
|
missed?: number;
|
|
132
|
+
/**
|
|
133
|
+
* The least a worker must be able to hold to take it, in MiB: set once a worker died running it near its memory — or
|
|
134
|
+
* a second worker in a row died running it — more than that one could, so it runs next on a larger one, whatever
|
|
135
|
+
* spaces that one is kept for, and is set aside (`paused`) when no worker of the deployment may hold that much.
|
|
136
|
+
* Absent, any worker that takes its space takes it. Given on enqueue, the job starts there: a schedule's next fire
|
|
137
|
+
* after one that needed a larger worker.
|
|
138
|
+
*/
|
|
139
|
+
needsMemoryMb?: number;
|
|
95
140
|
/**
|
|
96
141
|
* What a run set to run later (`trigger: 'later'`) was named by: setting it again under the same name replaces the
|
|
97
142
|
* one still waiting, and cancelling it by name drops it.
|
|
@@ -124,6 +169,10 @@ export type Job = JobInput & {
|
|
|
124
169
|
result?: unknown;
|
|
125
170
|
/** How long it has run, every slice together, in ms — what its total duration is held to. */
|
|
126
171
|
activeMs?: number;
|
|
172
|
+
/** What the worker that last claimed it may hold, in MiB, when its claim said (`claim`'s `memory`). */
|
|
173
|
+
holderMemoryMb?: number;
|
|
174
|
+
/** The worker that last claimed it said it neared its memory holding it (`heartbeat`'s `nearMemoryLimit`). */
|
|
175
|
+
nearMemoryLimit?: true;
|
|
127
176
|
};
|
|
128
177
|
/** What a panel may do to a job: set it aside, put it back, stop it, or run a finished one again. */
|
|
129
178
|
export type JobControlAction = 'pause' | 'resume' | 'cancel' | 'retry';
|
|
@@ -151,178 +200,3 @@ export type SpaceJob = Pick<Job, 'id' | 'environment' | 'status' | 'attempts' |
|
|
|
151
200
|
key?: string | null;
|
|
152
201
|
missed?: number | null;
|
|
153
202
|
};
|
|
154
|
-
/**
|
|
155
|
-
* How a worker reports what became of a claim.
|
|
156
|
-
*
|
|
157
|
-
* `delayMs` rather than an instant, and no timestamps: every moment the queue records is read from the QUEUE's
|
|
158
|
-
* clock, because a cluster whose nodes sit in different countries agrees about durations and not about now.
|
|
159
|
-
*/
|
|
160
|
-
export type JobSettlement = {
|
|
161
|
-
jobId: string;
|
|
162
|
-
workerId: string;
|
|
163
|
-
status: Extract<JobStatus, 'succeeded' | 'failed' | 'dead' | 'cancelled' | 'pending' | 'paused'>;
|
|
164
|
-
/** For a retry: how long from now before it may be claimed again. */
|
|
165
|
-
delayMs?: number;
|
|
166
|
-
runId?: string;
|
|
167
|
-
error?: string;
|
|
168
|
-
/** The attempt to append to the history. Omitted only when the claim is being handed back untouched. */
|
|
169
|
-
attempt?: Omit<JobAttempt, 'attempt' | 'startedAt' | 'endedAt'>;
|
|
170
|
-
/** What a job of the space's functions answered, when it succeeded. */
|
|
171
|
-
result?: unknown;
|
|
172
|
-
/** How long this slice ran, added to the job's `activeMs`. */
|
|
173
|
-
spentMs?: number;
|
|
174
|
-
/**
|
|
175
|
-
* The attempt the claim took is given back: a slice that ended without failing — set aside, cut by its time, or by a
|
|
176
|
-
* replica going away — is not one. Absent, it is given back only for a claim handed back untouched (`pending`, no
|
|
177
|
-
* `attempt`).
|
|
178
|
-
*/
|
|
179
|
-
refund?: boolean;
|
|
180
|
-
};
|
|
181
|
-
/** What a job's code saved while it runs — only by the worker holding it, so a stalled one cannot write over the next. */
|
|
182
|
-
export type JobWrite = {
|
|
183
|
-
jobId: string;
|
|
184
|
-
workerId: string;
|
|
185
|
-
state?: unknown;
|
|
186
|
-
progress?: Omit<JobProgress, 'at'>;
|
|
187
|
-
};
|
|
188
|
-
export type JobQuery = {
|
|
189
|
-
spaceIds: number[];
|
|
190
|
-
status?: JobStatus;
|
|
191
|
-
/** Only runs of actions, or only jobs of the spaces' functions. */
|
|
192
|
-
kind?: JobTarget['kind'];
|
|
193
|
-
/** Only what runs this action, or this job (`target.name`). */
|
|
194
|
-
name?: string;
|
|
195
|
-
limit: number;
|
|
196
|
-
offset: number;
|
|
197
|
-
};
|
|
198
|
-
/**
|
|
199
|
-
* A recurring intent, as a row rather than as a timer.
|
|
200
|
-
*
|
|
201
|
-
* `nextRunAt` is the point of the whole design: the instant of the next fire is DECIDED ONCE and written down, so
|
|
202
|
-
* every replica afterwards reads the same number instead of asking its own clock whether the moment has come. Two
|
|
203
|
-
* nodes whose clocks differ by a minute then produce the same fires, in the same order, exactly once each — the
|
|
204
|
-
* disagreement moves the WHEN by their skew and can never move the WHETHER.
|
|
205
|
-
*/
|
|
206
|
-
export type ActionSchedule = {
|
|
207
|
-
spaceId: number;
|
|
208
|
-
actionId: string;
|
|
209
|
-
cron: string;
|
|
210
|
-
timezone?: string;
|
|
211
|
-
environment: Environment;
|
|
212
|
-
enabled: boolean;
|
|
213
|
-
/** Epoch ms of the next fire this schedule owes. The queue's clock decides when that has arrived. */
|
|
214
|
-
nextRunAt: number;
|
|
215
|
-
/** The last fire actually enqueued. */
|
|
216
|
-
lastFireAt?: number;
|
|
217
|
-
/** Fires that went by while nothing was running to take them. Cumulative, and shown to an operator. */
|
|
218
|
-
missed: number;
|
|
219
|
-
maxAttempts: number;
|
|
220
|
-
updatedAt: number;
|
|
221
|
-
};
|
|
222
|
-
/** A schedule as it is derived from an action document — everything the queue does not own itself. */
|
|
223
|
-
export type ActionScheduleInput = Omit<ActionSchedule, 'missed' | 'updatedAt' | 'lastFireAt'>;
|
|
224
|
-
/**
|
|
225
|
-
* Where a deployment keeps its jobs and schedules.
|
|
226
|
-
*
|
|
227
|
-
* The same kind of seam as {@link ActionKvAdapter} and for the same reason — the server never learns where a
|
|
228
|
-
* deployment stores anything — but with one rule this one cannot be written without, and it is written here so no
|
|
229
|
-
* deployment has to rediscover it:
|
|
230
|
-
*
|
|
231
|
-
* **Every instant comes from the store.** `now` is the cluster's clock, and every comparison the queue makes
|
|
232
|
-
* internally — is this schedule due, has this lease lapsed, may this retry be claimed — is made against it, never
|
|
233
|
-
* against the caller's. That is why `settle` takes a `delayMs` and not a deadline, and why `claim` takes a
|
|
234
|
-
* `leaseMs` and not a `leaseUntil`: durations survive a cluster spread across time zones and machines whose clocks
|
|
235
|
-
* drift, and absolute instants minted by a caller do not.
|
|
236
|
-
*
|
|
237
|
-
* **`enqueue` is idempotent by `id`,** and answers whether it was the one that created the job. That, and nothing
|
|
238
|
-
* else, is what makes a fire happen exactly once when several replicas are racing to produce it.
|
|
239
|
-
*
|
|
240
|
-
* **`claim` is atomic, and it also reaps.** A job whose lease has lapsed is a job whose worker died, and it is
|
|
241
|
-
* taken by whoever claims next — the same operation, because a separate reaper is a second thing to deploy, to
|
|
242
|
-
* schedule and to forget.
|
|
243
|
-
*/
|
|
244
|
-
export type JobQueue = {
|
|
245
|
-
/** The cluster's clock. The only clock anything in the scheduling path is allowed to read. */
|
|
246
|
-
now: () => Promise<Date>;
|
|
247
|
-
/** True when this call created the job; false when that id was already there. Never throws on a duplicate. */
|
|
248
|
-
enqueue: (job: JobInput) => Promise<boolean>;
|
|
249
|
-
/**
|
|
250
|
-
* Takes up to `limit` jobs that are due, and any whose lease has lapsed — atomically, one worker per job.
|
|
251
|
-
*
|
|
252
|
-
* A reclaimed job arrives with its previous holder's attempt already written to the history as `lost`.
|
|
253
|
-
*/
|
|
254
|
-
claim: (params: {
|
|
255
|
-
workerId: string;
|
|
256
|
-
leaseMs: number;
|
|
257
|
-
limit: number;
|
|
258
|
-
}) => Promise<Job[]>;
|
|
259
|
-
/**
|
|
260
|
-
* Extends the lease on jobs this worker still holds, and answers which of them it is asked to stop — cancelled, or
|
|
261
|
-
* set aside (`pause`).
|
|
262
|
-
*/
|
|
263
|
-
heartbeat: (params: {
|
|
264
|
-
jobIds: string[];
|
|
265
|
-
workerId: string;
|
|
266
|
-
leaseMs: number;
|
|
267
|
-
}) => Promise<{
|
|
268
|
-
jobId: string;
|
|
269
|
-
stop: JobStop;
|
|
270
|
-
}[]>;
|
|
271
|
-
settle: (settlement: JobSettlement) => Promise<void>;
|
|
272
|
-
/** Writes what a running job's code saved or reported. False when this worker no longer holds it. */
|
|
273
|
-
write: (write: JobWrite) => Promise<boolean>;
|
|
274
|
-
/** Due schedules, oldest fire first. */
|
|
275
|
-
dueSchedules: (limit: number) => Promise<ActionSchedule[]>;
|
|
276
|
-
/**
|
|
277
|
-
* Moves a schedule forward, but only if it is still where the caller last saw it.
|
|
278
|
-
*
|
|
279
|
-
* The compare-and-set is what stops two replicas from advancing the same schedule twice. Answers false when
|
|
280
|
-
* somebody else got there first, which is not an error — it is the other replica having done the work.
|
|
281
|
-
*/
|
|
282
|
-
advanceSchedule: (params: {
|
|
283
|
-
spaceId: number;
|
|
284
|
-
actionId: string;
|
|
285
|
-
from: number;
|
|
286
|
-
to: number;
|
|
287
|
-
missed: number;
|
|
288
|
-
}) => Promise<boolean>;
|
|
289
|
-
/** Replaces what this space has scheduled. An action no longer listed stops having a schedule at all. */
|
|
290
|
-
putSchedules: (params: {
|
|
291
|
-
spaceId: number;
|
|
292
|
-
schedules: ActionScheduleInput[];
|
|
293
|
-
}) => Promise<void>;
|
|
294
|
-
listJobs: (query: JobQuery) => Promise<{
|
|
295
|
-
jobs: Job[];
|
|
296
|
-
total: number;
|
|
297
|
-
}>;
|
|
298
|
-
getJob: (spaceIds: number[], jobId: string) => Promise<Job | undefined>;
|
|
299
|
-
listSchedules: (spaceIds: number[]) => Promise<ActionSchedule[]>;
|
|
300
|
-
/**
|
|
301
|
-
* Puts a finished job back in the queue — an operator retrying it, or the code starting a keyed job again. Answers false
|
|
302
|
-
* when it is not finished. With `input`, it runs with that; with `fresh`, a job of the space's functions starts over
|
|
303
|
-
* rather than from what it saved.
|
|
304
|
-
*/
|
|
305
|
-
requeue: (spaceIds: number[], jobId: string, options?: {
|
|
306
|
-
input?: Record<string, unknown>;
|
|
307
|
-
fresh?: boolean;
|
|
308
|
-
}) => Promise<boolean>;
|
|
309
|
-
/** Stops a job: dropped if it is waiting or set aside, aborted at its next step if it is running. */
|
|
310
|
-
cancel: (spaceIds: number[], jobId: string) => Promise<boolean>;
|
|
311
|
-
/**
|
|
312
|
-
* Sets a job of the space's functions aside: one waiting is `paused` at once, one running is flagged for the worker
|
|
313
|
-
* holding it, which stops it once its code has saved. Answers whether it changed anything.
|
|
314
|
-
*/
|
|
315
|
-
pause: (spaceIds: number[], jobId: string) => Promise<boolean>;
|
|
316
|
-
/** Puts a `paused` job back in the queue, to start again from what it saved. */
|
|
317
|
-
resume: (spaceIds: number[], jobId: string) => Promise<boolean>;
|
|
318
|
-
/**
|
|
319
|
-
* Drops the space's jobs waiting under `key` (`cancelled`), and answers how many. With `olderThan`, only the ones
|
|
320
|
-
* enqueued before that job — created earlier, or at the same instant with a smaller id — so of two set at once the
|
|
321
|
-
* newer is the one left, on every replica. A running one is left: it is usually the run that set the next.
|
|
322
|
-
*/
|
|
323
|
-
cancelPending: (params: {
|
|
324
|
-
spaceId: number;
|
|
325
|
-
key: string;
|
|
326
|
-
olderThan?: string;
|
|
327
|
-
}) => Promise<number>;
|
|
328
|
-
};
|
|
@@ -99,8 +99,11 @@ export type Plugin = {
|
|
|
99
99
|
subPlugins?: string[];
|
|
100
100
|
type: string;
|
|
101
101
|
};
|
|
102
|
+
/**
|
|
103
|
+
* What draws a space's plugins: the plugins, and how to register styles. Stable while a page mounts — every container
|
|
104
|
+
* reads it — so the styles registered are in `PluginAssetsContextValue`, a context of their own.
|
|
105
|
+
*/
|
|
102
106
|
export type PluginsContextValue = {
|
|
103
|
-
assets: Record<string, Asset>;
|
|
104
107
|
plugins: Record<string, ComponentDefinition>;
|
|
105
108
|
dispatchPlugins?: unknown;
|
|
106
109
|
add?: (pluginType: string, resource?: string) => Promise<boolean>;
|
|
@@ -112,6 +115,10 @@ export type PluginsContextValue = {
|
|
|
112
115
|
unregisterCustomAssets: (assets: string[]) => void;
|
|
113
116
|
pluginSettingsStyles?: Record<string, string[]>;
|
|
114
117
|
};
|
|
118
|
+
/** The stylesheets registered by the space's plugins and elements, for what paints them. */
|
|
119
|
+
export type PluginAssetsContextValue = {
|
|
120
|
+
assets: Record<string, Asset>;
|
|
121
|
+
};
|
|
115
122
|
export type PluginRaw = {
|
|
116
123
|
resource: string;
|
|
117
124
|
settings: Plugin['settings'];
|
|
@@ -3,8 +3,8 @@ import { ChannelDeclarations } from './RealtimeTypes';
|
|
|
3
3
|
import { SnippetStyle } from './SnippetTypes';
|
|
4
4
|
import { SpaceTests } from './TestTypes';
|
|
5
5
|
import { BuiltinParam } from '../authoring/paramSpec';
|
|
6
|
+
import { RuleGroup } from '../conditions/types';
|
|
6
7
|
import { ElementMotion } from '../schema/motion';
|
|
7
|
-
import { RuleGroup } from '@plitzi/plitzi-ui/QueryBuilder';
|
|
8
8
|
/** The `when` guard a binding, a flag rule and a sub-value are written with: part of the document, so exported with it. */
|
|
9
9
|
export type { RuleGroup };
|
|
10
10
|
export type ElementRuntime = 'server' | 'client' | 'shared';
|