@aglyn/plugins-logic 1.0.0-beta.143
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/LICENSE +201 -0
- package/README.md +7 -0
- package/package.json +45 -0
- package/src/index.d.ts +19 -0
- package/src/index.js +20 -0
- package/src/index.js.map +1 -0
- package/src/lib/components/host-functions-card.component.d.ts +19 -0
- package/src/lib/components/host-functions-card.component.js +1075 -0
- package/src/lib/components/host-functions-card.component.js.map +1 -0
- package/src/lib/components/host-reference-health-card.component.d.ts +15 -0
- package/src/lib/components/host-reference-health-card.component.js +279 -0
- package/src/lib/components/host-reference-health-card.component.js.map +1 -0
- package/src/lib/components/host-variables-card.component.d.ts +18 -0
- package/src/lib/components/host-variables-card.component.js +630 -0
- package/src/lib/components/host-variables-card.component.js.map +1 -0
- package/src/lib/components/logic-console-page.d.ts +12 -0
- package/src/lib/components/logic-console-page.js +68 -0
- package/src/lib/components/logic-console-page.js.map +1 -0
- package/src/lib/components/where-used-dialog.component.d.ts +20 -0
- package/src/lib/components/where-used-dialog.component.js +103 -0
- package/src/lib/components/where-used-dialog.component.js.map +1 -0
- package/src/lib/constants/bundle-common.d.ts +8 -0
- package/src/lib/constants/bundle-common.js +9 -0
- package/src/lib/constants/bundle-common.js.map +1 -0
- package/src/lib/model/index.d.ts +23 -0
- package/src/lib/model/index.js +23 -0
- package/src/lib/model/index.js.map +1 -0
- package/src/lib/model/parameter-options.d.ts +26 -0
- package/src/lib/model/parameter-options.js +29 -0
- package/src/lib/model/parameter-options.js.map +1 -0
- package/src/lib/model/reference-audit.d.ts +75 -0
- package/src/lib/model/reference-audit.js +155 -0
- package/src/lib/model/reference-audit.js.map +1 -0
- package/src/lib/plugin.d.ts +29 -0
- package/src/lib/plugin.js +82 -0
- package/src/lib/plugin.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/logic/src/lib/components/host-variables-card.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport {\n type AglynOrgBilling,\n checkQuota,\n formatVariableValue,\n HOST_VARIABLE_TYPE_LABELS,\n type HostVariable,\n type HostVariableType,\n pluginDocsHelp,\n VARIABLE_NAME_PATTERN,\n} from '@aglyn/aglyn'\n/*\n * The MODULE, not the barrel, for the two PURE helpers. Every spec that renders\n * this card mocks `@aglyn/tenant-feature-instance` wholesale to stage its\n * Firestore hooks, and a query builder imported through that barrel disappears\n * under the mock — which fails as \"not a function\" in the component rather than\n * as anything about the test's subject. Neither of these is a hook.\n */\nimport {\n ceilingedWindow,\n collectionCeiling,\n} from '@aglyn/tenant-feature-instance/hooks/host-collection-queries'\nimport { CardDisplay, useConfirmationContext } from '@aglyn/shared-ui-jsx'\nimport { ListPagination } from '@aglyn/shared-ui-jsx/components/list-pagination.component'\nimport { TABLE_PAGE_SIZE_DEFAULT } from '@aglyn/shared-ui-jsx/const/table-pagination'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport { Timestamp } from '@aglyn/shared-util-timestamp'\nimport {\n Alert,\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n MenuItem,\n Stack,\n Switch,\n TextField,\n Typography,\n} from '@mui/material'\nimport {\n collection,\n doc,\n getCountFromServer,\n setDoc,\n updateDoc,\n} from 'firebase/firestore'\nimport { useCallback, useEffect, useMemo, useState } from 'react'\nimport {\n useFirestore,\n useFirestoreCollection,\n useHostResourceApi,\n useUser,\n writeGuardedBySeed,\n} from '@aglyn/tenant-feature-instance'\nimport WhereUsedDialog from './where-used-dialog.component'\nimport {\n fetchWhereUsed,\n summarizeDependents,\n type WhereUsedResult,\n} from '@aglyn/aglyn/app-utils/where-used'\n\n/**\n * How many variables the card reads.\n *\n * A CEILING, not a page size — see the query, which explains why this list\n * cannot be paged by the server without making the duplicate-name check lie.\n */\nconst VARIABLE_CEILING = 100\n\n/**\n * How many workflows the computed-variable picker offers.\n *\n * Paid for only while the editor is open, which is what makes a ceiling this\n * size affordable: it is one reader mid-edit rather than every visitor to the\n * page.\n */\nconst WORKFLOW_OPTION_CEILING = 100\n\nexport interface HostVariablesCardProps {\n hostId: string\n /** Resolved entitlement source for quota checks (AGL-395). */\n org?: Partial<AglynOrgBilling>\n}\n\ninterface VariableDraft {\n /** Computed-source workflow doc id (AGL-261); name is the display hint. */\n workflowId: string\n id: string | null\n name: string\n type: HostVariableType\n value: string\n /** Workflow (by name) computing this variable at render (AGL-129). */\n workflowName: string\n}\n\n/** Per-type value editor: mirrors the mockup's type list. */\nfunction VariableValueField(props: {\n draft: VariableDraft\n onChange: (value: string) => void\n}) {\n const { draft, onChange } = props\n switch (draft.type) {\n case 'boolean':\n return (\n <Stack direction=\"row\" spacing={1} sx={{ alignItems: 'center' }}>\n <Switch\n checked={draft.value === 'true'}\n onChange={(event) =>\n onChange(event.target.checked ? 'true' : 'false')\n }\n />\n <Typography variant=\"body2\">\n {draft.value === 'true' ? 'True' : 'False'}\n </Typography>\n </Stack>\n )\n case 'date':\n case 'time':\n return (\n <TextField\n label=\"Value\"\n type={draft.type}\n value={draft.value}\n onChange={(event) => onChange(event.target.value)}\n size=\"small\"\n slotProps={{ inputLabel: { shrink: true } }}\n />\n )\n case 'number':\n return (\n <TextField\n label=\"Value\"\n value={draft.value}\n onChange={(event) =>\n onChange(event.target.value.replace(/[^0-9.eE+-]/g, ''))\n }\n size=\"small\"\n />\n )\n case 'dictionary':\n case 'collection':\n return (\n <TextField\n label=\"Value (JSON)\"\n placeholder={\n draft.type === 'dictionary' ? '{\"key\": \"value\"}' : '[\"a\", \"b\"]'\n }\n value={draft.value}\n onChange={(event) => onChange(event.target.value)}\n size=\"small\"\n multiline\n minRows={3}\n />\n )\n default:\n return (\n <TextField\n label=\"Value\"\n value={draft.value}\n onChange={(event) => onChange(event.target.value)}\n size=\"small\"\n multiline\n />\n )\n }\n}\n\n/**\n * Host variables (Component Builder, AGL-91): the mockup's Edit Variable\n * dialog — name + typed value — persisted to `hosts/{hostId}/variables`.\n * Any string prop can reference a variable with `{{name}}`; the org\n * compose pipeline resolves it at render. Soft delete keeps old tokens\n * rendering literally rather than breaking published pages.\n */\nexport function HostVariablesCard(props: HostVariablesCardProps) {\n const { hostId } = props\n const firestore = useFirestore()\n const { data: user } = useUser()\n const createHostResource = useHostResourceApi()\n const { enqueueSnackbar } = useSnackbar()\n const { confirm } = useConfirmationContext()\n const { org } = props\n // Where-used dependents dialog (AGL-187).\n const [usage, setUsage] = useState<{\n name: string\n result: WhereUsedResult\n } | null>(null)\n const [usageLoading, setUsageLoading] = useState<string | null>(null)\n const {\n data: variableDocs,\n status: variablesStatus,\n /**\n * The rows this editor is seeded from are unconfirmed by the server\n * (AGL-1358). Editing copies a whole stored variable into `draft` and\n * writes all of it back, so `merge: true` protects nothing — every field\n * is in the payload. `value` is the literal every `{{name}}` binding on\n * every published page resolves to, and `workflowId` is what rebinds a\n * computed variable to its source (AGL-261), so a cached seed can point\n * a live binding back at a value or a workflow the author replaced.\n */\n fromCache: variablesFromCache,\n } = useFirestoreCollection<any>(\n /*\n * ORDERED AND CEILINGED, deliberately not paged by the query (AGL-2501).\n *\n * `limit(100)` alone is answered in DOCUMENT-ID order, so the window is a\n * pseudo-random hundred that the `localeCompare` below arranges into a\n * convincing A-to-Z list. `variablesPerHost` runs to 5,000, so a Scale\n * site with three hundred variables sees a hundred of them and nothing\n * said so.\n *\n * `collectionCeiling` does not change WHICH hundred — document-id order is\n * what the bare cap already returned. What it changes is that the order is\n * NAMED, so the obvious next edit is caught: ordering on `name` would not\n * mis-sort this list, it would HIDE from it every variable written without\n * one, and `/api/hosts/resources` validates no field for presence while\n * `IMPORTABLE_FIELDS.variables` copies a name only if the exported\n * document carried it. The document name cannot be absent.\n *\n * The QUERY is not paged because `nameTaken` below tests the draft against\n * these rows. Case-insensitive uniqueness is what keeps legacy `{{name}}`\n * token resolution unambiguous (AGL-185), and on a ten-row server page\n * that check would compare a new variable against a tenth of the site and\n * cheerfully create the duplicate it exists to prevent.\n *\n * The check is still only as complete as the ceiling, and that is now\n * SAID rather than assumed: the notice under the list appears exactly when\n * the probe finds a variable this card did not read.\n */\n () =>\n collectionCeiling(\n collection(firestore, 'hosts', hostId, 'variables'),\n VARIABLE_CEILING,\n ),\n [firestore, hostId],\n { idField: '$id' },\n )\n const { rows: readVariables, truncated: variablesTruncated } =\n ceilingedWindow<any>(variableDocs, VARIABLE_CEILING)\n const [draft, setDraft] = useState<VariableDraft | null>(null)\n /**\n * The editor has been opened at least once in this session.\n *\n * A LATCH rather than `draft` itself, because the workflow picker below keys its\n * listeners on it. Tracking the dialog would tear that subscription down\n * on Cancel and pay for them again on the next Edit, so a merchant working\n * through ten variables would buy the same window ten times — worse than\n * the mount-time read this replaces. Latched, a reader who never edits pays\n * nothing and a reader who edits pays once.\n */\n const [editorOpened, setEditorOpened] = useState(false)\n if (draft && !editorOpened) setEditorOpened(true)\n /*\n * Workflow picker options (AGL-261): computed variables reference the\n * workflow by doc id instead of a typed name.\n *\n * READ WHEN THE EDITOR OPENS, not when the card mounts (AGL-2501). Nothing\n * outside the dialog below touches these rows — the table shows a computed\n * variable's stored `workflowName`, never a name looked up here — so an\n * unconditional listener would charge every visitor to this page for a\n * hundred workflows to fill a select most of them never see.\n *\n * Ceilinged and ordered for the same reason as the variables above: a bare\n * `limit` is answered in document-id order, so the `localeCompare` below\n * would arrange a pseudo-random hundred into a convincing alphabet and a\n * workflow past it could not be picked, with nothing saying why.\n */\n const { data: workflowDocs } = useFirestoreCollection<any>(\n () =>\n editorOpened\n ? collectionCeiling(\n collection(firestore, 'hosts', hostId, 'workflows'),\n WORKFLOW_OPTION_CEILING,\n )\n : null,\n [firestore, hostId, editorOpened],\n { idField: '$id' },\n )\n const { rows: readWorkflows, truncated: workflowOptionsTruncated } =\n ceilingedWindow<any>(workflowDocs, WORKFLOW_OPTION_CEILING)\n // Sorting the whole ceiling, not a page of it.\n const workflowOptions = readWorkflows\n .filter((workflow: any) => !workflow.deletedAt && workflow.name)\n .map((workflow: any) => ({\n id: workflow.$id as string,\n name: workflow.name as string,\n }))\n .sort((a, b) => a.name.localeCompare(b.name))\n /*\n * Sorting is safe HERE in a way it is not on a paged list: these rows are\n * the whole collection below the ceiling, not a slice of one, so the order\n * on screen is the order of everything the card holds.\n */\n const variables = useMemo(\n () =>\n readVariables\n .filter((variable: any) => !variable.deletedAt)\n .sort((a: any, b: any) =>\n String(a.name ?? '').localeCompare(String(b.name ?? '')),\n ),\n [readVariables],\n )\n // The page is a SLICE, because the rows are already in hand and `nameTaken`\n // needs all of them. What the card lacked was not a cheaper read but a\n // control: a hundred variables rendered as one wall.\n const [page, setPage] = useState(0)\n const [pageSize, setPageSize] = useState(TABLE_PAGE_SIZE_DEFAULT)\n const visibleVariables = useMemo(\n () => variables.slice(page * pageSize, page * pageSize + pageSize),\n [variables, page, pageSize],\n )\n /**\n * The variable HEAD-COUNT is a server aggregate, not the length of the\n * capped listener (AGL-1716, the AGL-1706 shape).\n *\n * The listener is `limit(100)` and `variables.length` was handed to\n * `checkQuota(org, 'variablesPerHost', …)`. The bands are 3 / 25 / 100 /\n * 1,000 / 5,000, so the window ties Pro's 100 and hides Business's 1,000\n * and Scale's 5,000 entirely: on those plans the gate compared 100 against\n * thousands and could never refuse, while `api/hosts/resources` counted\n * the collection and did. The card offered headroom that did not exist and\n * then failed the create.\n *\n * UNFILTERED, matching the enforcing route: it runs a plain\n * `collection('variables').count()` for this quota — its `softDeletes`\n * branch governs only the flat per-host webhook cap — so a soft-deleted\n * variable has always counted toward `variablesPerHost` server-side while\n * this card excluded it. The card now asks the route's question in the\n * route's terms, which is the only thing that makes a console gate a\n * useful prediction of the route's verdict.\n *\n * THE LIST KEEPS ITS CAP. Only a create moves the number (deletes here are\n * soft, and the route counts them), so that is where it is re-read.\n */\n const [variableCountEpoch, setVariableCountEpoch] = useState(0)\n const [serverVariableCount, setServerVariableCount] = useState<number | null>(\n null,\n )\n useEffect(() => {\n let active = true\n void getCountFromServer(collection(firestore, 'hosts', hostId, 'variables'))\n .then((snapshot) => {\n if (active) setServerVariableCount(snapshot.data().count)\n })\n .catch(() => {\n // Falls back to the loaded rows below — a LOWER bound, and this\n // card's prior behaviour. Deliberately not 0: `checkQuota` answers\n // from whatever it is handed, and 0 used is a confident wrong\n // number in the flattering direction.\n })\n return () => {\n active = false\n }\n }, [firestore, hostId, variableCountEpoch])\n const variableCount = serverVariableCount ?? variables.length\n\n const validName = VARIABLE_NAME_PATTERN.test(draft?.name ?? '')\n // Case-insensitive (AGL-185): names must stay unambiguous for legacy\n // {{name}} token resolution and picker display.\n const nameTaken = Boolean(\n draft &&\n variables.some(\n (variable: any) =>\n String(variable.name ?? '').toLowerCase() ===\n draft.name.trim().toLowerCase() && variable.$id !== draft.id,\n ),\n )\n\n const handleSave = useCallback(async () => {\n if (!draft || !validName || nameTaken) return\n const fields = {\n name: draft.name,\n type: draft.type,\n value: draft.value,\n workflowId: draft.workflowId.trim(),\n workflowName: draft.workflowName.trim(),\n }\n try {\n if (draft.id) {\n /**\n * Edit stays client-direct (no quota consumed) — and is refused when\n * its seed was never confirmed by the server (AGL-1358). `merge:\n * true` protects nothing here: `fields` is every editable key of the\n * stored row, copied off the listener whether or not it was touched.\n *\n * The guard WRAPS the write. An early return is a shape you can keep\n * while losing the protection; here the write is only reachable\n * through the verdict.\n */\n const verdict = await writeGuardedBySeed(\n {\n subject: 'variable',\n unreadable: variablesStatus === 'error',\n fromCache: variablesFromCache,\n },\n async () => {\n await setDoc(\n doc(firestore, 'hosts', hostId, 'variables', draft.id),\n { ...fields, updatedAt: Timestamp.now() },\n { merge: true },\n )\n },\n )\n // Before `setDraft(null)`, so a refusal keeps the dialog open with\n // what was typed. A save that silently does nothing sends the user\n // back to retype a form that will be refused again just as quietly.\n if (!verdict.ok) {\n return void enqueueSnackbar(verdict.message, {\n variant: 'warning',\n persist: false,\n })\n }\n } else {\n // New variable rides the quota-enforcing resources API (AGL-473).\n await createHostResource({ hostId, resource: 'variable', data: fields })\n // A create moves the count and the aggregate is a one-shot — the\n // listener refreshes the ROWS for free, the count has to be asked\n // again or the cap drifts stale for the rest of the session.\n setVariableCountEpoch((epoch) => epoch + 1)\n }\n setDraft(null)\n enqueueSnackbar(\n `Saved — use {{${draft.name}}} in any text to bind it`,\n { variant: 'success', persist: false },\n )\n } catch (error: any) {\n console.error(error)\n enqueueSnackbar(error?.message ?? 'An error has occurred', {\n variant: 'error',\n allowDuplicate: true,\n })\n }\n }, [\n draft,\n validName,\n nameTaken,\n firestore,\n hostId,\n createHostResource,\n enqueueSnackbar,\n variablesStatus,\n variablesFromCache,\n ])\n\n const handleShowUsage = useCallback(\n (variable: any) => async () => {\n setUsageLoading(variable.$id)\n const result = await fetchWhereUsed(user as any, {\n hostId,\n kind: 'variable',\n id: variable.$id,\n name: variable.name,\n })\n setUsageLoading(null)\n setUsage({ name: variable.name, result })\n },\n [user, hostId],\n )\n\n const handleDelete = useCallback(\n (variable: any) => async () => {\n // Real dependents warning (AGL-187) instead of the generic copy.\n const scan = await fetchWhereUsed(user as any, {\n hostId,\n kind: 'variable',\n id: variable.$id,\n name: variable.name,\n })\n const confirmed = await confirm({\n title: 'Delete this variable?',\n description: scan.total\n ? `\"${variable.name}\" is used in ${summarizeDependents(scan)}. ` +\n 'Those bindings will render as empty or literal tokens after ' +\n 'the next publish.'\n : `\"${variable.name}\" is not referenced by any published ` +\n 'screen, layout, or workflow.',\n confirmationText: 'Delete',\n confirmationButtonProps: { color: 'error' },\n })\n .then(() => true)\n .catch(() => false)\n if (!confirmed) return\n await updateDoc(\n doc(firestore, 'hosts', hostId, 'variables', variable.$id),\n { deletedAt: Timestamp.now() },\n )\n enqueueSnackbar('Variable deleted', {\n variant: 'success',\n persist: false,\n })\n },\n [user, confirm, firestore, hostId, enqueueSnackbar],\n )\n\n return (\n <CardDisplay\n header={'Variables'}\n help={pluginDocsHelp('bindings', { anchor: '#typed-variables' })}\n contentGutterX\n contentGutterY\n >\n <Stack spacing={1}>\n {variables.length === 0 ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Define typed values once and bind them anywhere with ' +\n '{{name}} — change the variable, every page updates on the ' +\n 'next publish.'}\n </Typography>\n ) : (\n visibleVariables.map((variable: any) => (\n <Stack\n key={variable.$id}\n direction=\"row\"\n spacing={1}\n sx={{ alignItems: 'center' }}\n >\n <Stack sx={{ flex: 1, minWidth: 0 }}>\n <Typography variant=\"body2\" noWrap>\n {`{{${variable.name}}}`}\n </Typography>\n <Typography variant=\"caption\" color=\"text.secondary\" noWrap>\n {`${HOST_VARIABLE_TYPE_LABELS[variable.type as HostVariableType] ?? variable.type} · ${\n formatVariableValue(variable as HostVariable) || '—'\n }`}\n </Typography>\n </Stack>\n <Button\n size=\"small\"\n disabled={usageLoading === variable.$id}\n onClick={handleShowUsage(variable)}\n >\n {usageLoading === variable.$id ? 'Scanning…' : 'Usage'}\n </Button>\n <Button\n size=\"small\"\n onClick={() =>\n setDraft({\n id: variable.$id,\n name: variable.name ?? '',\n type: variable.type ?? 'text',\n value: variable.value ?? '',\n workflowId: variable.workflowId ?? '',\n workflowName: variable.workflowName ?? '',\n })\n }\n >\n {'Edit'}\n </Button>\n <Button\n size=\"small\"\n color=\"error\"\n onClick={handleDelete(variable)}\n >\n {'Delete'}\n </Button>\n </Stack>\n ))\n )}\n {variables.length === 0 ? null : (\n <ListPagination\n page={page}\n pageSize={pageSize}\n rowCount={visibleVariables.length}\n // The variables the card HOLDS. Not `variableCount`, which is the\n // site's total including soft-deleted rows and answers the quota's\n // question rather than the reader's.\n count={variables.length}\n onPageChange={setPage}\n onPageSizeChange={setPageSize}\n />\n )}\n {variablesTruncated ? (\n <Alert severity=\"info\">\n {`Showing ${VARIABLE_CEILING} variables, ordered by id. This site ` +\n 'has more — the duplicate-name check below only covers the ' +\n 'ones listed here, so a name may already be taken by one that ' +\n 'is not.'}\n </Alert>\n ) : null}\n <Button\n size=\"small\"\n color=\"primary\"\n sx={{ alignSelf: 'flex-start' }}\n onClick={() => {\n // Plan cap (AGL-99): dark-launch — plan-less workspaces uncapped.\n // The site's variables, not this page of them (AGL-1716).\n const quota = checkQuota(org, 'variablesPerHost', variableCount)\n if (!quota.allowed) {\n return void enqueueSnackbar(\n `Variable limit reached (${quota.limit}) — upgrade in Billing`,\n { variant: 'warning', persist: false },\n )\n }\n setDraft({\n id: null,\n name: '',\n type: 'text',\n value: '',\n workflowId: '',\n workflowName: '',\n })\n }}\n >\n {'Add variable'}\n </Button>\n </Stack>\n <Dialog\n open={Boolean(draft)}\n onClose={() => setDraft(null)}\n maxWidth=\"xs\"\n fullWidth\n >\n <DialogTitle>\n {draft?.id ? 'Edit Variable' : 'Add Variable'}\n </DialogTitle>\n <DialogContent\n sx={{ display: 'flex', flexDirection: 'column', gap: 2, pt: 1 }}\n >\n <TextField\n label=\"Name\"\n helperText={\n nameTaken\n ? 'A variable with this name already exists'\n : 'Used to identify the variable'\n }\n error={(Boolean(draft?.name) && !validName) || nameTaken}\n value={draft?.name ?? ''}\n onChange={(event) =>\n setDraft((prev) =>\n prev\n ? {\n ...prev,\n name: event.target.value.replace(\n /[^a-zA-Z0-9_]/g,\n '',\n ),\n }\n : prev,\n )\n }\n size=\"small\"\n autoFocus\n sx={{ mt: 1 }}\n />\n <TextField\n label=\"Type\"\n value={draft?.type ?? 'text'}\n onChange={(event) =>\n setDraft((prev) =>\n prev\n ? {\n ...prev,\n type: event.target.value as HostVariableType,\n value: '',\n }\n : prev,\n )\n }\n size=\"small\"\n select\n >\n {Object.entries(HOST_VARIABLE_TYPE_LABELS).map(\n ([value, label]) => (\n <MenuItem key={value} value={value}>\n {label}\n </MenuItem>\n ),\n )}\n </TextField>\n {draft ? (\n <VariableValueField\n draft={draft}\n onChange={(value) =>\n setDraft((prev) => (prev ? { ...prev, value } : prev))\n }\n />\n ) : null}\n <TextField\n select\n label=\"Computed from workflow (optional)\"\n helperText={\n workflowOptionsTruncated\n ? `Showing ${WORKFLOW_OPTION_CEILING} workflows, ordered by ` +\n 'id. This site has more, so one of them is not offered here.'\n : 'Pick a workflow — its result becomes this ' +\n 'variable\\u2019s value at render; the value above is the ' +\n 'fallback (AGL-129)'\n }\n value={\n draft?.workflowId ||\n workflowOptions.find(\n (option) => option.name === draft?.workflowName,\n )?.id ||\n ''\n }\n onChange={(event) =>\n setDraft((prev) =>\n prev\n ? {\n ...prev,\n workflowId: event.target.value,\n workflowName:\n workflowOptions.find(\n (option) => option.id === event.target.value,\n )?.name ?? '',\n }\n : prev,\n )\n }\n size=\"small\"\n >\n <MenuItem value=\"\">{'None'}</MenuItem>\n {workflowOptions.map((option) => (\n <MenuItem key={option.id} value={option.id}>\n {option.name}\n </MenuItem>\n ))}\n </TextField>\n </DialogContent>\n <DialogActions>\n <Button onClick={() => setDraft(null)}>{'Cancel'}</Button>\n <Button\n variant=\"contained\"\n color=\"primary\"\n disabled={!validName || nameTaken}\n onClick={handleSave}\n >\n {'Save variable'}\n </Button>\n </DialogActions>\n </Dialog>\n <WhereUsedDialog\n hostId={hostId}\n usage={usage}\n onClose={() => setUsage(null)}\n />\n </CardDisplay>\n )\n}\nHostVariablesCard.displayName = 'HostVariablesCard'\n\nexport default HostVariablesCard\n"],"names":["checkQuota","formatVariableValue","HOST_VARIABLE_TYPE_LABELS","pluginDocsHelp","VARIABLE_NAME_PATTERN","ceilingedWindow","collectionCeiling","CardDisplay","useConfirmationContext","ListPagination","TABLE_PAGE_SIZE_DEFAULT","useSnackbar","Timestamp","Alert","Button","Dialog","DialogActions","DialogContent","DialogTitle","MenuItem","Stack","Switch","TextField","Typography","collection","doc","getCountFromServer","setDoc","updateDoc","useCallback","useEffect","useMemo","useState","useFirestore","useFirestoreCollection","useHostResourceApi","useUser","writeGuardedBySeed","WhereUsedDialog","fetchWhereUsed","summarizeDependents","VARIABLE_CEILING","WORKFLOW_OPTION_CEILING","VariableValueField","props","draft","onChange","type","direction","spacing","sx","alignItems","checked","value","event","target","variant","label","size","slotProps","inputLabel","shrink","replace","placeholder","multiline","minRows","HostVariablesCard","workflowOptions","hostId","firestore","data","user","createHostResource","enqueueSnackbar","confirm","org","usage","setUsage","usageLoading","setUsageLoading","variableDocs","status","variablesStatus","fromCache","variablesFromCache","idField","rows","readVariables","truncated","variablesTruncated","setDraft","editorOpened","setEditorOpened","workflowDocs","readWorkflows","workflowOptionsTruncated","filter","workflow","deletedAt","name","map","id","$id","sort","a","b","localeCompare","variables","variable","String","page","setPage","pageSize","setPageSize","visibleVariables","slice","variableCountEpoch","setVariableCountEpoch","serverVariableCount","setServerVariableCount","active","then","snapshot","count","catch","variableCount","length","validName","test","nameTaken","Boolean","some","toLowerCase","trim","handleSave","fields","workflowId","workflowName","verdict","subject","unreadable","updatedAt","now","merge","ok","message","persist","resource","epoch","error","console","allowDuplicate","handleShowUsage","result","kind","handleDelete","scan","confirmed","title","description","total","confirmationText","confirmationButtonProps","color","header","help","anchor","contentGutterX","contentGutterY","flex","minWidth","noWrap","disabled","onClick","rowCount","onPageChange","onPageSizeChange","severity","alignSelf","quota","allowed","limit","open","onClose","maxWidth","fullWidth","display","flexDirection","gap","pt","helperText","prev","autoFocus","mt","select","Object","entries","find","option","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SAEEA,UAAU,EACVC,mBAAmB,EACnBC,yBAAyB,EAGzBC,cAAc,EACdC,qBAAqB,QAChB,eAAc;AACrB;;;;;;CAMC,GACD,SACEC,eAAe,EACfC,iBAAiB,QACZ,+DAA8D;AACrE,SAASC,WAAW,EAAEC,sBAAsB,QAAQ,uBAAsB;AAC1E,SAASC,cAA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CAACqG;;4CAMA5H;+CALR4H,OACI,aACKA;4CACHvD,YAAYlF,MAAMC,MAAM,CAACF,KAAK;4CAC9BoF,YAAY,WACVtE,wBAAAA,gBAAgBkI,IAAI,CAClB,CAACC,SAAWA,OAAOjG,EAAE,KAAK/C,MAAMC,MAAM,CAACF,KAAK,sBAD9Cc,sBAEGgC,IAAI,mBAAI;6CAEf4F;;gCAGRrI,MAAK;;kDAEL,KAACvC;wCAASkC,OAAM;kDAAI;;oCACnBc,gBAAgBiC,GAAG,CAAC,CAACkG,uBACpB,KAACnL;4CAAyBkC,OAAOiJ,OAAOjG,EAAE;sDACvCiG,OAAOnG,IAAI;2CADCmG,OAAOjG,EAAE;;;;;kCAM9B,MAACrF;;0CACC,KAACF;gCAAO+J,SAAS,IAAMnF,SAAS;0CAAQ;;0CACxC,KAAC5E;gCACC0C,SAAQ;gCACR2G,OAAM;gCACNS,UAAU,CAAC7C,aAAaE;gCACxB4C,SAASvC;0CAER;;;;;;0BAIP,KAAChG;gBACC8B,QAAQA;gBACRQ,OAAOA;gBACP2G,SAAS,IAAM1G,SAAS;;;;AAIhC;AACAX,kBAAkBqI,WAAW,GAAG;AAEhC,eAAerI,kBAAiB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ConsolePluginPageProps } from '@aglyn/aglyn';
|
|
2
|
+
/**
|
|
3
|
+
* Logic page (AGL-91/92 → AGL-395): variables + no-code functions and the
|
|
4
|
+
* reference-integrity audit, owned by the logic plugin and rendered by the
|
|
5
|
+
* shell's generic plugin route. The org doc (resolved by the shell)
|
|
6
|
+
* flows into the variable/function cards for their per-plan quota checks.
|
|
7
|
+
*/
|
|
8
|
+
export declare function LogicConsolePage(props: ConsolePluginPageProps): import("react").JSX.Element;
|
|
9
|
+
export declare namespace LogicConsolePage {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
12
|
+
export default LogicConsolePage;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
|
+
import { GridItems } from "@aglyn/shared-ui-jsx";
|
|
19
|
+
import HostFunctionsCard from "./host-functions-card.component.js";
|
|
20
|
+
import HostReferenceHealthCard from "./host-reference-health-card.component.js";
|
|
21
|
+
import HostVariablesCard from "./host-variables-card.component.js";
|
|
22
|
+
/**
|
|
23
|
+
* Logic page (AGL-91/92 → AGL-395): variables + no-code functions and the
|
|
24
|
+
* reference-integrity audit, owned by the logic plugin and rendered by the
|
|
25
|
+
* shell's generic plugin route. The org doc (resolved by the shell)
|
|
26
|
+
* flows into the variable/function cards for their per-plan quota checks.
|
|
27
|
+
*/ export function LogicConsolePage(props) {
|
|
28
|
+
const { hostId, org } = props;
|
|
29
|
+
return /*#__PURE__*/ _jsx(GridItems, {
|
|
30
|
+
masonry: true,
|
|
31
|
+
spacing: 3,
|
|
32
|
+
items: [
|
|
33
|
+
{
|
|
34
|
+
size: {
|
|
35
|
+
xs: 12,
|
|
36
|
+
md: 6
|
|
37
|
+
},
|
|
38
|
+
children: /*#__PURE__*/ _jsx(HostVariablesCard, {
|
|
39
|
+
hostId: hostId,
|
|
40
|
+
org: org
|
|
41
|
+
})
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
size: {
|
|
45
|
+
xs: 12,
|
|
46
|
+
md: 6
|
|
47
|
+
},
|
|
48
|
+
children: /*#__PURE__*/ _jsx(HostFunctionsCard, {
|
|
49
|
+
hostId: hostId,
|
|
50
|
+
org: org
|
|
51
|
+
})
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
// Broken-wiring audit (wave v7).
|
|
55
|
+
size: {
|
|
56
|
+
xs: 12
|
|
57
|
+
},
|
|
58
|
+
children: /*#__PURE__*/ _jsx(HostReferenceHealthCard, {
|
|
59
|
+
hostId: hostId
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
LogicConsolePage.displayName = 'LogicConsolePage';
|
|
66
|
+
export default LogicConsolePage;
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=logic-console-page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/logic/src/lib/components/logic-console-page.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport type { ConsolePluginPageProps } from '@aglyn/aglyn'\nimport { GridItems } from '@aglyn/shared-ui-jsx'\nimport HostFunctionsCard from './host-functions-card.component'\nimport HostReferenceHealthCard from './host-reference-health-card.component'\nimport HostVariablesCard from './host-variables-card.component'\n\n/**\n * Logic page (AGL-91/92 → AGL-395): variables + no-code functions and the\n * reference-integrity audit, owned by the logic plugin and rendered by the\n * shell's generic plugin route. The org doc (resolved by the shell)\n * flows into the variable/function cards for their per-plan quota checks.\n */\nexport function LogicConsolePage(props: ConsolePluginPageProps) {\n const { hostId, org } = props\n return (\n <GridItems\n masonry\n spacing={3}\n items={[\n {\n size: { xs: 12, md: 6 },\n children: <HostVariablesCard hostId={hostId} org={org} />,\n },\n {\n size: { xs: 12, md: 6 },\n children: <HostFunctionsCard hostId={hostId} org={org} />,\n },\n {\n // Broken-wiring audit (wave v7).\n size: { xs: 12 },\n children: <HostReferenceHealthCard hostId={hostId} />,\n },\n ]}\n />\n )\n}\nLogicConsolePage.displayName = 'LogicConsolePage'\n\nexport default LogicConsolePage\n"],"names":["GridItems","HostFunctionsCard","HostReferenceHealthCard","HostVariablesCard","LogicConsolePage","props","hostId","org","masonry","spacing","items","size","xs","md","children","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAGA,SAASA,SAAS,QAAQ,uBAAsB;AAChD,OAAOC,uBAAuB,qCAAiC;AAC/D,OAAOC,6BAA6B,4CAAwC;AAC5E,OAAOC,uBAAuB,qCAAiC;AAE/D;;;;;CAKC,GACD,OAAO,SAASC,iBAAiBC,KAA6B;IAC5D,MAAM,EAAEC,MAAM,EAAEC,GAAG,EAAE,GAAGF;IACxB,qBACE,KAACL;QACCQ,OAAO;QACPC,SAAS;QACTC,OAAO;YACL;gBACEC,MAAM;oBAAEC,IAAI;oBAAIC,IAAI;gBAAE;gBACtBC,wBAAU,KAACX;oBAAkBG,QAAQA;oBAAQC,KAAKA;;YACpD;YACA;gBACEI,MAAM;oBAAEC,IAAI;oBAAIC,IAAI;gBAAE;gBACtBC,wBAAU,KAACb;oBAAkBK,QAAQA;oBAAQC,KAAKA;;YACpD;YACA;gBACE,iCAAiC;gBACjCI,MAAM;oBAAEC,IAAI;gBAAG;gBACfE,wBAAU,KAACZ;oBAAwBI,QAAQA;;YAC7C;SACD;;AAGP;AACAF,iBAAiBW,WAAW,GAAG;AAE/B,eAAeX,iBAAgB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { WhereUsedResult } from '@aglyn/aglyn/app-utils/where-used';
|
|
2
|
+
export interface WhereUsedDialogProps {
|
|
3
|
+
hostId: string;
|
|
4
|
+
usage: {
|
|
5
|
+
name: string;
|
|
6
|
+
result: WhereUsedResult;
|
|
7
|
+
} | null;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Shared dependents dialog (AGL-187/193): where a variable, function, or
|
|
12
|
+
* workflow is referenced — screen/layout rows deep-link into the besigner
|
|
13
|
+
* of the scanned published version; legacy-token references are flagged
|
|
14
|
+
* since renames break them.
|
|
15
|
+
*/
|
|
16
|
+
export declare function WhereUsedDialog(props: WhereUsedDialogProps): import("react").JSX.Element;
|
|
17
|
+
export declare namespace WhereUsedDialog {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
export default WhereUsedDialog;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ 'use client';
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
|
+
import { Button, Dialog, DialogActions, DialogContent, DialogTitle, Stack, Typography } from "@mui/material";
|
|
19
|
+
import { AppLink } from "@aglyn/shared-ui-jsx";
|
|
20
|
+
import { useConsoleHostRoute } from "@aglyn/tenant-feature-instance";
|
|
21
|
+
/**
|
|
22
|
+
* Besigner deep-links for a scanned screen/layout version. The routes live
|
|
23
|
+
* in the console app's table; the patterns are stable, so the plugin builds
|
|
24
|
+
* them directly rather than importing app-only route constants.
|
|
25
|
+
*/ const screenBesignerHref = (// Console route base, not a host doc id (AGL-673).
|
|
26
|
+
hostId, screenId, versionId)=>`${hostId}/screens/${screenId}/versions/${versionId}/besigner`;
|
|
27
|
+
const layoutBesignerHref = (hostId, layoutId, versionId)=>`${hostId}/layouts/${layoutId}/versions/${versionId}/besigner`;
|
|
28
|
+
/**
|
|
29
|
+
* Shared dependents dialog (AGL-187/193): where a variable, function, or
|
|
30
|
+
* workflow is referenced — screen/layout rows deep-link into the besigner
|
|
31
|
+
* of the scanned published version; legacy-token references are flagged
|
|
32
|
+
* since renames break them.
|
|
33
|
+
*/ export function WhereUsedDialog(props) {
|
|
34
|
+
const { hostId, usage, onClose } = props;
|
|
35
|
+
const consoleRoute = useConsoleHostRoute(hostId);
|
|
36
|
+
const base = consoleRoute.base;
|
|
37
|
+
return /*#__PURE__*/ _jsxs(Dialog, {
|
|
38
|
+
open: Boolean(usage),
|
|
39
|
+
onClose: onClose,
|
|
40
|
+
maxWidth: "xs",
|
|
41
|
+
fullWidth: true,
|
|
42
|
+
children: [
|
|
43
|
+
/*#__PURE__*/ _jsx(DialogTitle, {
|
|
44
|
+
children: `Where "${usage == null ? void 0 : usage.name}" is used`
|
|
45
|
+
}),
|
|
46
|
+
/*#__PURE__*/ _jsx(DialogContent, {
|
|
47
|
+
children: (usage == null ? void 0 : usage.result.total) === 0 ? /*#__PURE__*/ _jsx(Typography, {
|
|
48
|
+
variant: "body2",
|
|
49
|
+
color: "text.secondary",
|
|
50
|
+
children: 'Not referenced by any published screen, layout, or workflow. ' + 'Unpublished drafts are not scanned.'
|
|
51
|
+
}) : /*#__PURE__*/ _jsxs(Stack, {
|
|
52
|
+
spacing: 1,
|
|
53
|
+
children: [
|
|
54
|
+
usage == null ? void 0 : usage.result.dependents.map((dependent)=>{
|
|
55
|
+
// No resolved base means no valid link — the branch below
|
|
56
|
+
// already renders plain text, which beats a link to nowhere.
|
|
57
|
+
const href = base && dependent.versionId && dependent.type === 'screen' ? screenBesignerHref(base, dependent.id, dependent.versionId) : base && dependent.versionId && dependent.type === 'layout' ? layoutBesignerHref(base, dependent.id, dependent.versionId) : null;
|
|
58
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
59
|
+
direction: "row",
|
|
60
|
+
spacing: 1,
|
|
61
|
+
sx: {
|
|
62
|
+
justifyContent: 'space-between'
|
|
63
|
+
},
|
|
64
|
+
children: [
|
|
65
|
+
href ? /*#__PURE__*/ _jsx(AppLink, {
|
|
66
|
+
href: href,
|
|
67
|
+
variant: "body2",
|
|
68
|
+
noWrap: true,
|
|
69
|
+
children: dependent.name
|
|
70
|
+
}) : /*#__PURE__*/ _jsx(Typography, {
|
|
71
|
+
variant: "body2",
|
|
72
|
+
noWrap: true,
|
|
73
|
+
children: dependent.name
|
|
74
|
+
}),
|
|
75
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
76
|
+
variant: "caption",
|
|
77
|
+
color: "text.secondary",
|
|
78
|
+
children: dependent.type + (dependent.via.includes('name') ? ' · legacy token' : '')
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}, `${dependent.type}-${dependent.id}`);
|
|
82
|
+
}),
|
|
83
|
+
(usage == null ? void 0 : usage.result.legacyCount) ? /*#__PURE__*/ _jsx(Typography, {
|
|
84
|
+
variant: "caption",
|
|
85
|
+
color: "warning.main",
|
|
86
|
+
children: 'Legacy tokens reference this by name and break if it is ' + 'renamed — re-publish those screens to upgrade them.'
|
|
87
|
+
}) : null
|
|
88
|
+
]
|
|
89
|
+
})
|
|
90
|
+
}),
|
|
91
|
+
/*#__PURE__*/ _jsx(DialogActions, {
|
|
92
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
93
|
+
onClick: onClose,
|
|
94
|
+
children: 'Close'
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
WhereUsedDialog.displayName = 'WhereUsedDialog';
|
|
101
|
+
export default WhereUsedDialog;
|
|
102
|
+
|
|
103
|
+
//# sourceMappingURL=where-used-dialog.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/logic/src/lib/components/where-used-dialog.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport {\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n Stack,\n Typography,\n} from '@mui/material'\nimport { AppLink } from '@aglyn/shared-ui-jsx'\nimport { useConsoleHostRoute } from '@aglyn/tenant-feature-instance'\nimport type { WhereUsedResult } from '@aglyn/aglyn/app-utils/where-used'\n\n/**\n * Besigner deep-links for a scanned screen/layout version. The routes live\n * in the console app's table; the patterns are stable, so the plugin builds\n * them directly rather than importing app-only route constants.\n */\nconst screenBesignerHref = (\n // Console route base, not a host doc id (AGL-673).\n hostId: string,\n screenId: string,\n versionId: string,\n) => `${hostId}/screens/${screenId}/versions/${versionId}/besigner`\nconst layoutBesignerHref = (\n hostId: string,\n layoutId: string,\n versionId: string,\n) => `${hostId}/layouts/${layoutId}/versions/${versionId}/besigner`\n\nexport interface WhereUsedDialogProps {\n hostId: string\n usage: { name: string; result: WhereUsedResult } | null\n onClose: () => void\n}\n\n/**\n * Shared dependents dialog (AGL-187/193): where a variable, function, or\n * workflow is referenced — screen/layout rows deep-link into the besigner\n * of the scanned published version; legacy-token references are flagged\n * since renames break them.\n */\nexport function WhereUsedDialog(props: WhereUsedDialogProps) {\n const { hostId, usage, onClose } = props\n const consoleRoute = useConsoleHostRoute(hostId)\n const base = consoleRoute.base\n return (\n <Dialog open={Boolean(usage)} onClose={onClose} maxWidth=\"xs\" fullWidth>\n <DialogTitle>{`Where \"${usage?.name}\" is used`}</DialogTitle>\n <DialogContent>\n {usage?.result.total === 0 ? (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Not referenced by any published screen, layout, or workflow. ' +\n 'Unpublished drafts are not scanned.'}\n </Typography>\n ) : (\n <Stack spacing={1}>\n {usage?.result.dependents.map((dependent) => {\n // No resolved base means no valid link — the branch below\n // already renders plain text, which beats a link to nowhere.\n const href =\n base && dependent.versionId && dependent.type === 'screen'\n ? screenBesignerHref(base, dependent.id, dependent.versionId)\n : base && dependent.versionId && dependent.type === 'layout'\n ? layoutBesignerHref(base, dependent.id, dependent.versionId)\n : null\n return (\n <Stack\n key={`${dependent.type}-${dependent.id}`}\n direction=\"row\"\n spacing={1}\n sx={{ justifyContent: 'space-between' }}\n >\n {href ? (\n <AppLink href={href} variant=\"body2\" noWrap>\n {dependent.name}\n </AppLink>\n ) : (\n <Typography variant=\"body2\" noWrap>\n {dependent.name}\n </Typography>\n )}\n <Typography variant=\"caption\" color=\"text.secondary\">\n {dependent.type +\n (dependent.via.includes('name') ? ' · legacy token' : '')}\n </Typography>\n </Stack>\n )\n })}\n {usage?.result.legacyCount ? (\n <Typography variant=\"caption\" color=\"warning.main\">\n {'Legacy tokens reference this by name and break if it is ' +\n 'renamed — re-publish those screens to upgrade them.'}\n </Typography>\n ) : null}\n </Stack>\n )}\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose}>{'Close'}</Button>\n </DialogActions>\n </Dialog>\n )\n}\nWhereUsedDialog.displayName = 'WhereUsedDialog'\n\nexport default WhereUsedDialog\n"],"names":["Button","Dialog","DialogActions","DialogContent","DialogTitle","Stack","Typography","AppLink","useConsoleHostRoute","screenBesignerHref","hostId","screenId","versionId","layoutBesignerHref","layoutId","WhereUsedDialog","props","usage","onClose","consoleRoute","base","open","Boolean","maxWidth","fullWidth","name","result","total","variant","color","spacing","dependents","map","dependent","href","type","id","direction","sx","justifyContent","noWrap","via","includes","legacyCount","onClick","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAEA,SACEA,MAAM,EACNC,MAAM,EACNC,aAAa,EACbC,aAAa,EACbC,WAAW,EACXC,KAAK,EACLC,UAAU,QACL,gBAAe;AACtB,SAASC,OAAO,QAAQ,uBAAsB;AAC9C,SAASC,mBAAmB,QAAQ,iCAAgC;AAGpE;;;;CAIC,GACD,MAAMC,qBAAqB,CACzB,mDAAmD;AACnDC,QACAC,UACAC,YACG,GAAGF,OAAO,SAAS,EAAEC,SAAS,UAAU,EAAEC,UAAU,SAAS,CAAC;AACnE,MAAMC,qBAAqB,CACzBH,QACAI,UACAF,YACG,GAAGF,OAAO,SAAS,EAAEI,SAAS,UAAU,EAAEF,UAAU,SAAS,CAAC;AAQnE;;;;;CAKC,GACD,OAAO,SAASG,gBAAgBC,KAA2B;IACzD,MAAM,EAAEN,MAAM,EAAEO,KAAK,EAAEC,OAAO,EAAE,GAAGF;IACnC,MAAMG,eAAeX,oBAAoBE;IACzC,MAAMU,OAAOD,aAAaC,IAAI;IAC9B,qBACE,MAACnB;QAAOoB,MAAMC,QAAQL;QAAQC,SAASA;QAASK,UAAS;QAAKC,SAAS;;0BACrE,KAACpB;0BAAa,CAAC,OAAO,EAAEa,yBAAAA,MAAOQ,IAAI,CAAC,SAAS,CAAC;;0BAC9C,KAACtB;0BACEc,CAAAA,yBAAAA,MAAOS,MAAM,CAACC,KAAK,MAAK,kBACvB,KAACrB;oBAAWsB,SAAQ;oBAAQC,OAAM;8BAC/B,kEACC;mCAGJ,MAACxB;oBAAMyB,SAAS;;wBACbb,yBAAAA,MAAOS,MAAM,CAACK,UAAU,CAACC,GAAG,CAAC,CAACC;4BAC7B,0DAA0D;4BAC1D,6DAA6D;4BAC7D,MAAMC,OACJd,QAAQa,UAAUrB,SAAS,IAAIqB,UAAUE,IAAI,KAAK,WAC9C1B,mBAAmBW,MAAMa,UAAUG,EAAE,EAAEH,UAAUrB,SAAS,IAC1DQ,QAAQa,UAAUrB,SAAS,IAAIqB,UAAUE,IAAI,KAAK,WAChDtB,mBAAmBO,MAAMa,UAAUG,EAAE,EAAEH,UAAUrB,SAAS,IAC1D;4BACR,qBACE,MAACP;gCAECgC,WAAU;gCACVP,SAAS;gCACTQ,IAAI;oCAAEC,gBAAgB;gCAAgB;;oCAErCL,qBACC,KAAC3B;wCAAQ2B,MAAMA;wCAAMN,SAAQ;wCAAQY,MAAM;kDACxCP,UAAUR,IAAI;uDAGjB,KAACnB;wCAAWsB,SAAQ;wCAAQY,MAAM;kDAC/BP,UAAUR,IAAI;;kDAGnB,KAACnB;wCAAWsB,SAAQ;wCAAUC,OAAM;kDACjCI,UAAUE,IAAI,GACZF,CAAAA,UAAUQ,GAAG,CAACC,QAAQ,CAAC,UAAU,oBAAoB,EAAC;;;+BAhBtD,GAAGT,UAAUE,IAAI,CAAC,CAAC,EAAEF,UAAUG,EAAE,EAAE;wBAoB9C;wBACCnB,CAAAA,yBAAAA,MAAOS,MAAM,CAACiB,WAAW,kBACxB,KAACrC;4BAAWsB,SAAQ;4BAAUC,OAAM;sCACjC,6DACC;6BAEF;;;;0BAIV,KAAC3B;0BACC,cAAA,KAACF;oBAAO4C,SAAS1B;8BAAU;;;;;AAInC;AACAH,gBAAgB8B,WAAW,GAAG;AAE9B,eAAe9B,gBAAe"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
*/ export const BUNDLE_ID = 'logic';
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=bundle-common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/logic/src/lib/constants/bundle-common.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n */\n\nexport const BUNDLE_ID = 'logic'\n"],"names":["BUNDLE_ID"],"mappings":"AAAA;;;;;;CAMC,GAED,OAAO,MAAMA,YAAY,QAAO"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Logic plugin model (AGL-413): the automations/workflows/variables reference-integrity audit relocated from core app-utils.
|
|
19
|
+
* Context-free — importable by client components, /server handlers, and
|
|
20
|
+
* other plugins/apps via `@aglyn/plugins-logic/model`.
|
|
21
|
+
*/
|
|
22
|
+
export * from './parameter-options';
|
|
23
|
+
export * from './reference-audit';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ /**
|
|
17
|
+
* Logic plugin model (AGL-413): the automations/workflows/variables reference-integrity audit relocated from core app-utils.
|
|
18
|
+
* Context-free — importable by client components, /server handlers, and
|
|
19
|
+
* other plugins/apps via `@aglyn/plugins-logic/model`.
|
|
20
|
+
*/ export * from "./parameter-options.js";
|
|
21
|
+
export * from "./reference-audit.js";
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/logic/src/lib/model/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Logic plugin model (AGL-413): the automations/workflows/variables reference-integrity audit relocated from core app-utils.\n * Context-free — importable by client components, /server handlers, and\n * other plugins/apps via `@aglyn/plugins-logic/model`.\n */\nexport * from './parameter-options'\nexport * from './reference-audit'\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED;;;;CAIC,GACD,cAAc,yBAAqB;AACnC,cAAc,uBAAmB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { type HostFunctionParameterOption } from '@aglyn/aglyn';
|
|
18
|
+
/**
|
|
19
|
+
* A parameter's choice list as one line of text (AGL-3202). The grammar lives
|
|
20
|
+
* in core — `parseFunctionParameterOptions` — because the canvas's Function
|
|
21
|
+
* Input element reads the same line and a plugin may not import another. These
|
|
22
|
+
* are the names the function builder has always called it by.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parseParameterOptions(text: string): HostFunctionParameterOption[];
|
|
25
|
+
/** The inverse, for showing a stored list in that one line. */
|
|
26
|
+
export declare function formatParameterOptions(options: HostFunctionParameterOption[] | undefined): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ import { formatFunctionParameterOptions, parseFunctionParameterOptions } from "@aglyn/aglyn";
|
|
17
|
+
/**
|
|
18
|
+
* A parameter's choice list as one line of text (AGL-3202). The grammar lives
|
|
19
|
+
* in core — `parseFunctionParameterOptions` — because the canvas's Function
|
|
20
|
+
* Input element reads the same line and a plugin may not import another. These
|
|
21
|
+
* are the names the function builder has always called it by.
|
|
22
|
+
*/ export function parseParameterOptions(text) {
|
|
23
|
+
return parseFunctionParameterOptions(text);
|
|
24
|
+
}
|
|
25
|
+
/** The inverse, for showing a stored list in that one line. */ export function formatParameterOptions(options) {
|
|
26
|
+
return formatFunctionParameterOptions(options);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=parameter-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/logic/src/lib/model/parameter-options.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n formatFunctionParameterOptions,\n type HostFunctionParameterOption,\n parseFunctionParameterOptions,\n} from '@aglyn/aglyn'\n\n/**\n * A parameter's choice list as one line of text (AGL-3202). The grammar lives\n * in core — `parseFunctionParameterOptions` — because the canvas's Function\n * Input element reads the same line and a plugin may not import another. These\n * are the names the function builder has always called it by.\n */\nexport function parseParameterOptions(\n text: string,\n): HostFunctionParameterOption[] {\n return parseFunctionParameterOptions(text)\n}\n\n/** The inverse, for showing a stored list in that one line. */\nexport function formatParameterOptions(\n options: HostFunctionParameterOption[] | undefined,\n): string {\n return formatFunctionParameterOptions(options)\n}\n"],"names":["formatFunctionParameterOptions","parseFunctionParameterOptions","parseParameterOptions","text","formatParameterOptions","options"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,8BAA8B,EAE9BC,6BAA6B,QACxB,eAAc;AAErB;;;;;CAKC,GACD,OAAO,SAASC,sBACdC,IAAY;IAEZ,OAAOF,8BAA8BE;AACvC;AAEA,6DAA6D,GAC7D,OAAO,SAASC,uBACdC,OAAkD;IAElD,OAAOL,+BAA+BK;AACxC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import type { HostAction } from '@aglyn/aglyn';
|
|
18
|
+
import type { HostVariable } from '@aglyn/aglyn';
|
|
19
|
+
import type { HostWorkflow } from '@aglyn/aglyn';
|
|
20
|
+
/**
|
|
21
|
+
* Reference-integrity audit (wave v7): id references (AGL-261) are
|
|
22
|
+
* rename-safe but not delete-safe — deleting a workflow leaves actions
|
|
23
|
+
* pointing at nothing, and the executors fail silently at run time.
|
|
24
|
+
* This pure audit cross-checks every reference an automation, workflow,
|
|
25
|
+
* or computed variable holds against the ids/names that still exist,
|
|
26
|
+
* so the console can surface broken wiring before a visitor hits it.
|
|
27
|
+
*/
|
|
28
|
+
export interface ReferenceIssue {
|
|
29
|
+
/** What holds the broken reference. */
|
|
30
|
+
source: 'action' | 'workflow' | 'variable' | 'screen';
|
|
31
|
+
sourceId: string;
|
|
32
|
+
/** Display name of the holder. */
|
|
33
|
+
sourceName: string;
|
|
34
|
+
/** What the reference points at ("workflow", "dataset", …). */
|
|
35
|
+
refType: string;
|
|
36
|
+
/** The dangling id or name as stored. */
|
|
37
|
+
missing: string;
|
|
38
|
+
}
|
|
39
|
+
/** A screen's composed nodes, for canvas-reference auditing (AGL-345). */
|
|
40
|
+
export interface ScreenAuditEntry {
|
|
41
|
+
$id: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
nodes: Record<string, {
|
|
44
|
+
props?: Record<string, unknown>;
|
|
45
|
+
} | undefined>;
|
|
46
|
+
}
|
|
47
|
+
export interface ReferenceAuditInput {
|
|
48
|
+
actions?: Array<HostAction & {
|
|
49
|
+
$id: string;
|
|
50
|
+
}>;
|
|
51
|
+
workflows?: Array<HostWorkflow & {
|
|
52
|
+
$id: string;
|
|
53
|
+
}>;
|
|
54
|
+
variables?: Array<HostVariable & {
|
|
55
|
+
$id: string;
|
|
56
|
+
}>;
|
|
57
|
+
/** Screen node maps to scan for entity/screen-link references. */
|
|
58
|
+
screens?: ScreenAuditEntry[];
|
|
59
|
+
/** Known-good targets: doc ids AND display names both resolve. */
|
|
60
|
+
known: {
|
|
61
|
+
workflows?: Set<string>;
|
|
62
|
+
functions?: Set<string>;
|
|
63
|
+
datasets?: Set<string>;
|
|
64
|
+
lists?: Set<string>;
|
|
65
|
+
campaigns?: Set<string>;
|
|
66
|
+
overlays?: Set<string>;
|
|
67
|
+
webhooks?: Set<string>;
|
|
68
|
+
/** New reference kinds (AGL-345). */
|
|
69
|
+
screens?: Set<string>;
|
|
70
|
+
products?: Set<string>;
|
|
71
|
+
collections?: Set<string>;
|
|
72
|
+
categories?: Set<string>;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export declare function auditHostReferences(input: ReferenceAuditInput): ReferenceIssue[];
|