@burdenoff/fluidgrids-fe-sdk 2026.1113.1 → 2026.1113.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/dist/{AiStudioPage-D3MAk-bs.js → AiStudioPage-5KYZ8r8-.js} +464 -7
- package/dist/{ApprovalInboxPage-Bb8H9ruw.js → ApprovalInboxPage-BsJX4osU.js} +4 -3
- package/dist/{ConnectionFormDialog-Bg9_OdHX.js → ConnectionFormDialog-Dr1-CTan.js} +2 -1
- package/dist/CreateFluidgridsTagDocument-Dtp9KPLJ.js +1055 -0
- package/dist/{DataSinkDashboardPage-Dc2QuJbL.js → DataSinkDashboardPage-8ZDn85e2.js} +1 -1
- package/dist/{DataTablesPage-Cv4veaKK.js → DataTablesPage-BBvABuxE.js} +5 -4
- package/dist/{EntityTagPicker-D8ws706D.js → EntityTagPicker-BppBSEJk.js} +2 -2
- package/dist/{ExecutionDetailPage-CTVGE-d-.js → ExecutionDetailPage-BXDF2eoT.js} +1444 -18
- package/dist/ExecutionsListDocument-CzdLPpj5.js +1259 -0
- package/dist/{ExecutionsListPage-J0sJPuoM.js → ExecutionsListPage--4BthM8L.js} +285 -11
- package/dist/FailureTriagePanel-B5WCSRFo.js +1252 -0
- package/dist/{FluidGridsProvider-C4FVNz0n.js → FluidGridsProvider-Dc_Jhtch.js} +8666 -8734
- package/dist/{HistoryPage-B9XcTPrO.js → HistoryPage-BvFk2m1m.js} +4 -3
- package/dist/{InsightsPage-DFOltjyj.js → InsightsPage-Dwmb02F6.js} +2682 -5
- package/dist/{MissingNodesInstallModal-D8H-YNCJ.js → MissingNodesInstallModal-Cze674hp.js} +2 -2
- package/dist/{NodesPage-YQ-hP60x.js → NodesPage-C5Dq-ru-.js} +3 -2
- package/dist/{OpenTemplateAsCodeButton-hH26HQCk.js → OpenTemplateAsCodeButton-8MZHih6I.js} +2 -2
- package/dist/{PaidTemplateConfirm-DoKWMBtR.js → PaidTemplateConfirm-0G-gv29n.js} +1 -1
- package/dist/{PublishCustomNodeAction-5XXnSA3H.js → PublishCustomNodeAction-OOY35dUv.js} +1 -1
- package/dist/QuotaExhaustedDialog-wvu_-WJ-.js +55 -0
- package/dist/{RunnerStatusPill-Ctg4TJcP.js → RunnerStatusPill-Bh7mEsPh.js} +2 -1
- package/dist/{RunnersPage-CAt4YDhB.js → RunnersPage-DHeuUDil.js} +2 -2
- package/dist/{SettingsPage-DEKPCVVP.js → SettingsPage-CfjXiGpb.js} +694 -14
- package/dist/{TagFilterSelect-CwM2-DU6.js → TagFilterSelect-CAShgvbS.js} +1 -1
- package/dist/{TaskQueuesPage-Dhi6SIT4.js → TaskQueuesPage--Mmn36b-.js} +3 -3
- package/dist/{TemplateCard-DVSd_4zJ.js → TemplateCard-BA_9em22.js} +644 -352
- package/dist/{TemplateConfigurationModal-BKi1z7z7.js → TemplateConfigurationModal-BT3PaR0O.js} +4 -3
- package/dist/{TemplateDetailPanel-DK1gF7P5.js → TemplateDetailPanel-BxFNnlXm.js} +2 -1
- package/dist/{TemplatePreview-DuSX2Q7H.js → TemplatePreview-Bagja6WN.js} +7 -7
- package/dist/{TemplatesPage-CAWHh61l.js → TemplatesPage-CAajpJ5w.js} +711 -6
- package/dist/{VariablesPage-D7CoatWf.js → VariablesPage-CgUBKhAe.js} +3 -3
- package/dist/{VersionDiffDialog-DGwysiyE.js → VersionDiffDialog-D9W5Fm56.js} +233 -129
- package/dist/VersionLifecycleBar-DuphLOT0.js +131 -0
- package/dist/{WorkflowBuilder-DAeoQi5E.js → WorkflowBuilder-DMpSPElu.js} +16 -13
- package/dist/{WorkflowBuilder-BJgqDboZ.js → WorkflowBuilder-v8h8skwG.js} +5 -5
- package/dist/WorkflowDefinitionDocument-DZLbTPUZ.js +321 -0
- package/dist/WorkflowEditLeaseStatusDocument-Dp62med3.js +627 -0
- package/dist/WorkflowProposalCard-zCdUpCk8.js +249 -0
- package/dist/WorkflowProposalDocument-BdUbsrd0.js +620 -0
- package/dist/{WorkflowSearchRedirect-CMEvd_AR.js → WorkflowSearchRedirect-G78lINAE.js} +1 -1
- package/dist/{WorkflowShareDialog-BgHRsDP0.js → WorkflowShareDialog-B7VOgr4-.js} +304 -3
- package/dist/WorkflowVersionsDocument-CfPMloRW.js +3195 -0
- package/dist/{WorkflowsList-CcQPxWKL.js → WorkflowsList-CPYzfE4K.js} +11 -9
- package/dist/agent-form-D0uLvzx4.js +718 -0
- package/dist/{agentTools-DKpNKztf.js → agentTools-DTXUqtfu.js} +4 -4
- package/dist/api-BZVyX5d2.js +2286 -0
- package/dist/api-BqA-f-AD.js +8064 -0
- package/dist/app-BJUvugPM.js +3813 -0
- package/dist/assert-rules-CPNrO44K.js +318 -0
- package/dist/attach-node-helpers-CNsYtLOR.js +32 -0
- package/dist/badge-CXfPhoMH.js +26 -0
- package/dist/{canvasNoteTools-C_AN79m0.js → canvasNoteTools-DmfZwtnL.js} +3 -3
- package/dist/{channel-CZ70oI81.js → channel-DtF1n_ab.js} +1 -1
- package/dist/client-Ctl4jmY3.js +127 -0
- package/dist/code-editor-diagnostics-Zr0cIcx1.js +46 -0
- package/dist/{code-editor-field-Dt6KNWwN.js → code-editor-field-Cv907s3W.js} +2 -2
- package/dist/{codec-client-CJ95Rmqo.js → codec-client-CAYl6j46.js} +2 -1
- package/dist/conditionBuilder-D8aLGL1w.js +1134 -0
- package/dist/config-X97zrIvn.js +600 -0
- package/dist/{definition-canvas-Bshn_dSP.js → definition-canvas-DL25_6NH.js} +1 -1
- package/dist/{dialog-Cjb4lB4D.js → dialog-BVd152GS.js} +3 -14
- package/dist/durable-nodes-DXCCQYWD.js +81 -0
- package/dist/errors-xPZ-IbQd.js +142 -0
- package/dist/executions.js +2 -2
- package/dist/{flow-builder-D3Hl2AFk.js → flow-builder-Dv5fWJ6F.js} +9301 -8189
- package/dist/{node-registry-refresh-Dy0uRg9f.js → global-client-DP_Wxe5t.js} +2 -27
- package/dist/global-operations-7pvXw_j9.js +145 -0
- package/dist/history.js +1 -1
- package/dist/{index-CWcP-tG1.d.ts → index-DtMUtXNq.d.ts} +247 -247
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4403 -46
- package/dist/input-ChT6Q-Pr.js +17 -0
- package/dist/logs-panel-DtG93ocy.js +342 -0
- package/dist/mapping-colors-BIX_YeCQ.js +48 -0
- package/dist/{node-detail-view-bVLeYarT.js → node-detail-view-BKI_2kM6.js} +12 -11
- package/dist/{node-editor-tab-body-JHHVtQgR.js → node-editor-tab-body-Cc1MWEFR.js} +3 -3
- package/dist/{node-operation-selection-DAbS6jSY.js → node-operation-selection-Czeeb2D4.js} +2 -139
- package/dist/node-registry-refresh-s3okf83X.js +27 -0
- package/dist/nodes.js +1 -1
- package/dist/notesKey-5EaREBGA.js +12 -0
- package/dist/observability.d.ts +1 -1
- package/dist/observability.js +2 -2
- package/dist/{popover-Xx3gN7vg.js → popover-DDv7J1Kl.js} +717 -6
- package/dist/{quick-config-panel-BvVQXuIL.js → quick-config-panel-BPCRfqWI.js} +4 -4
- package/dist/read-only-context-Dt9N9SIG.js +18 -0
- package/dist/{schedule-panel-DCb40TPN.js → schedule-panel-C1KwfLCE.js} +14 -12
- package/dist/settings.js +1 -1
- package/dist/{shared-CMfn30xT.js → shared-Ctl9ZHo1.js} +2 -1
- package/dist/{sidebar-node-editor-DxCWFZG2.js → sidebar-node-editor-d9Rlq5pU.js} +4 -4
- package/dist/sticky-notes-23j-wL6Q.js +96 -0
- package/dist/template-code-dqRunGOv.js +184 -0
- package/dist/template-preview-C01KV277.js +29 -0
- package/dist/templates.js +2 -2
- package/dist/token-refresh-link-BjN7H4qA.js +291 -0
- package/dist/useAgentDefinitions-ZKX2N9aP.js +3101 -0
- package/dist/useConnections-BlB0gbOB.js +931 -0
- package/dist/useDurableParity-BgLH_SCF.js +2088 -0
- package/dist/{useEntityTags-Db4Pc8_M.js → useEntityTags-4iW6UTly.js} +227 -3
- package/dist/{useExecutions-DOpG1pUQ.js → useExecutions-Bm7q_UwN.js} +6 -3
- package/dist/useGlobalStoreClient-DMTrywdX.js +24 -0
- package/dist/{useHumanRequests-ZiR0sSzS.js → useHumanRequests-DwG2tQ3f.js} +2 -1
- package/dist/{useObservability-rQmwhoZZ.js → useObservability-DPATdbw7.js} +4 -2
- package/dist/{useRunHistory-COn6dl7l.js → useRunHistory-CGfjCsJ3.js} +1122 -4
- package/dist/{useVariables-2ddyJX4a.js → useVariables-DFdZofLQ.js} +2 -1
- package/dist/{useWorkflowCodeExport-ZoUJKRSK.js → useWorkflowCodeExport-D_mCuhKP.js} +289 -4
- package/dist/useWorkflowOrganization-r5FWNBs6.js +1690 -0
- package/dist/useWorkflowProposal-Bh2_qjmM.js +7478 -0
- package/dist/{useWorkflows-jOW60YmD.js → useWorkflows-aqVD7kGa.js} +694 -4
- package/dist/workflow-builder.js +5 -5
- package/dist/{workflow-code-transfer-l9wO34S0.js → workflow-code-transfer-5C0HUzae.js} +1 -53
- package/dist/workflow-host.js +4 -2
- package/dist/workflow-pages.d.ts +1 -1
- package/dist/workflow-pages.js +19 -19
- package/dist/workflow-preview.js +3 -2
- package/dist/workflows-list.js +1 -1
- package/package.json +1 -1
- package/dist/FailureTriagePanel-BbYFYeV_.js +0 -311
- package/dist/WorkflowProposalCard-DGMdZC4R.js +0 -1432
- package/dist/agent-form-Bfvm32j1.js +0 -83
- package/dist/api-DQtHXbIg.js +0 -224
- package/dist/api-MeAm6g7E.js +0 -55
- package/dist/client-C9XSzSXr.js +0 -1147
- package/dist/graphql-operation-types-C9qbvRa8.js +0 -53122
- package/dist/useAgentDefinitions-_hgNCK1A.js +0 -550
- package/dist/useConnections-Cs7LCWEM.js +0 -401
- package/dist/useDurableParity-CcLeCDfv.js +0 -504
- package/dist/useWorkflowOrganization-QxVePSkk.js +0 -282
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
// src/feature-flags/durable-nodes.ts
|
|
3
|
+
/**
|
|
4
|
+
* Palette gating for the durable-function nodes (BOFF-9905).
|
|
5
|
+
*
|
|
6
|
+
* wspace-workflow-svc only seeds the `internal:code-workflow` and
|
|
7
|
+
* `internal:wait-for-signal` manifests while `DURABLE_NODE_MANIFESTS_ENABLED`
|
|
8
|
+
* is set, and refuses durable work while the `fluidgrids.durable-functions`
|
|
9
|
+
* flag is off for the workspace. Once the manifests are seeded for every
|
|
10
|
+
* workspace, the builder still has to hide the two nodes from the palettes of
|
|
11
|
+
* workspaces where the flag is off. This module is that client-side filter; it
|
|
12
|
+
* mirrors the server-side gate and is never the gate itself.
|
|
13
|
+
*
|
|
14
|
+
* Hiding only affects what can be picked from a palette. A workflow that
|
|
15
|
+
* already contains one of these nodes keeps rendering and running unchanged.
|
|
16
|
+
*/
|
|
17
|
+
/** Node types offered only while durable functions are enabled. */
|
|
18
|
+
const DURABLE_FUNCTION_NODE_TYPES = /* @__PURE__ */ new Set(["internal:code-workflow", "internal:wait-for-signal"]);
|
|
19
|
+
/**
|
|
20
|
+
* The run-control nodes of Phase C (BOFF-9906, DC15). wspace-workflow-svc
|
|
21
|
+
* seeds their manifests only while `RUN_CONTROL_NODE_MANIFESTS_ENABLED` is
|
|
22
|
+
* set, which is turned on after this filter ships; the builder then still
|
|
23
|
+
* hides each one where its flag is off: Signal Run needs run control, Set
|
|
24
|
+
* Search Attributes needs search attributes.
|
|
25
|
+
*/
|
|
26
|
+
const RUN_CONTROL_NODE_TYPES = /* @__PURE__ */ new Set(["internal:signal-run", "internal:set-search-attributes"]);
|
|
27
|
+
/**
|
|
28
|
+
* The Assert node of the workflow test suites (BOFF-9960). wspace-workflow-svc
|
|
29
|
+
* seeds its manifest for every workspace, so the builder hides it wherever the
|
|
30
|
+
* `fluidgrids.workflow-tests` flag is off.
|
|
31
|
+
*/
|
|
32
|
+
const WORKFLOW_TEST_NODE_TYPES = /* @__PURE__ */ new Set(["internal:assert"]);
|
|
33
|
+
/** Whether a workflow node type is one of the Phase C run-control nodes. */
|
|
34
|
+
function isRunControlNodeType(nodeType) {
|
|
35
|
+
return !!nodeType && RUN_CONTROL_NODE_TYPES.has(nodeType);
|
|
36
|
+
}
|
|
37
|
+
/** Normalises the boolean (Phase B) or object form of the palette gates. */
|
|
38
|
+
function paletteGatesOf(gates) {
|
|
39
|
+
if (typeof gates === "boolean") return {
|
|
40
|
+
durableFunctions: gates,
|
|
41
|
+
runControl: false,
|
|
42
|
+
searchAttributes: false,
|
|
43
|
+
workflowTests: false
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
durableFunctions: gates?.durableFunctions === true,
|
|
47
|
+
runControl: gates?.runControl === true,
|
|
48
|
+
searchAttributes: gates?.searchAttributes === true,
|
|
49
|
+
workflowTests: gates?.workflowTests === true
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function hiddenBy(nodeType, gates) {
|
|
53
|
+
if (DURABLE_FUNCTION_NODE_TYPES.has(nodeType)) return !gates.durableFunctions;
|
|
54
|
+
if (nodeType === "internal:signal-run") return !gates.runControl;
|
|
55
|
+
if (nodeType === "internal:set-search-attributes") return !gates.searchAttributes;
|
|
56
|
+
if (WORKFLOW_TEST_NODE_TYPES.has(nodeType)) return !gates.workflowTests;
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
/** Whether a workflow node type is one of the durable-function nodes. */
|
|
60
|
+
function isDurableFunctionNodeType(nodeType) {
|
|
61
|
+
return !!nodeType && DURABLE_FUNCTION_NODE_TYPES.has(nodeType);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Whether a node type must be left out of the builder palettes. Fails closed:
|
|
65
|
+
* a family the caller does not say is enabled is not.
|
|
66
|
+
*/
|
|
67
|
+
function isNodeTypeHiddenFromPalette(nodeType, gates = false) {
|
|
68
|
+
return !!nodeType && hiddenBy(nodeType, paletteGatesOf(gates));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Drops the palette entries that must stay hidden. Returns the input array
|
|
72
|
+
* itself when nothing is hidden, so the canvas palettes keep the exact list
|
|
73
|
+
* (and references) they had before this filter existed.
|
|
74
|
+
*/
|
|
75
|
+
function filterPaletteNodes(nodes, gates = false) {
|
|
76
|
+
const resolved = paletteGatesOf(gates);
|
|
77
|
+
if (!nodes.some((node) => hiddenBy(node.type, resolved))) return nodes;
|
|
78
|
+
return nodes.filter((node) => !hiddenBy(node.type, resolved));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export { isDurableFunctionNodeType as a, filterPaletteNodes as i, RUN_CONTROL_NODE_TYPES as n, isNodeTypeHiddenFromPalette as o, WORKFLOW_TEST_NODE_TYPES as r, isRunControlNodeType as s, DURABLE_FUNCTION_NODE_TYPES as t };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { CombinedGraphQLErrors, ServerError } from "@apollo/client/errors";
|
|
3
|
+
|
|
4
|
+
// src/graphql/errors.ts
|
|
5
|
+
/**
|
|
6
|
+
* Operation-error helpers.
|
|
7
|
+
*
|
|
8
|
+
* The SDK usually runs against a host-injected Apollo client (see
|
|
9
|
+
* `setFluidGridsClient`). App shells configure their shared client with
|
|
10
|
+
* `errorPolicy: 'all'`, so `client.mutate` / `client.query` RESOLVE on
|
|
11
|
+
* GraphQL errors — `result.data` is empty and the real failure sits in
|
|
12
|
+
* `result.error`. Callers that only check `result.data` silently swallow
|
|
13
|
+
* server errors (e.g. QUOTA_EXHAUSTED) and surface generic messages.
|
|
14
|
+
*
|
|
15
|
+
* Use `throwIfResultError(result)` right after a mutate/query so failures
|
|
16
|
+
* flow through the existing catch paths, and `describeOperationError(err)`
|
|
17
|
+
* to turn whatever was thrown into a user-presentable message.
|
|
18
|
+
*/
|
|
19
|
+
/** Well-known gateway error codes mapped to user-friendly messages. */
|
|
20
|
+
function describeGraphQLError(error) {
|
|
21
|
+
switch (typeof error.extensions?.code === "string" ? error.extensions.code : void 0) {
|
|
22
|
+
case "QUOTA_EXHAUSTED": {
|
|
23
|
+
const quota = /Quota exhausted for (\S+)/.exec(error.message)?.[1];
|
|
24
|
+
return `Quota exhausted — your workspace has used up its ${quota ? `"${quota}" quota` : "usage quota"}. Upgrade your plan or wait for the quota to reset.`;
|
|
25
|
+
}
|
|
26
|
+
case "QUOTA_NOT_PROVISIONED": return "This workspace's plan does not include this usage allowance yet. Contact your workspace admin or support to have it provisioned.";
|
|
27
|
+
case "UNAUTHENTICATED": return "Your session has expired. Please sign in again.";
|
|
28
|
+
case "FORBIDDEN": return error.message || "You don't have permission to perform this action.";
|
|
29
|
+
default: return error.message || "Unknown error";
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/** The first GraphQL error of a raw JSON response body, if it carries one. */
|
|
33
|
+
function firstGraphQLErrorInBody(bodyText) {
|
|
34
|
+
try {
|
|
35
|
+
const parsed = JSON.parse(bodyText);
|
|
36
|
+
if (typeof parsed !== "object" || parsed === null) return null;
|
|
37
|
+
const errors = parsed.errors;
|
|
38
|
+
if (!Array.isArray(errors) || errors.length === 0) return null;
|
|
39
|
+
const first = errors[0];
|
|
40
|
+
if (typeof first !== "object" || first === null) return null;
|
|
41
|
+
if (typeof first.message !== "string") return null;
|
|
42
|
+
return first;
|
|
43
|
+
} catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Turn anything thrown (or found in `result.error`) into a message fit for
|
|
49
|
+
* a toast / run log. Unwraps Apollo `CombinedGraphQLErrors` so well-known
|
|
50
|
+
* gateway codes (quota, auth) read properly instead of a concatenated dump.
|
|
51
|
+
*/
|
|
52
|
+
function describeOperationError(error, fallback = "Unknown error") {
|
|
53
|
+
if (CombinedGraphQLErrors.is(error)) {
|
|
54
|
+
const first = error.errors[0];
|
|
55
|
+
return first ? describeGraphQLError(first) : error.message || fallback;
|
|
56
|
+
}
|
|
57
|
+
if (ServerError.is(error)) {
|
|
58
|
+
const first = firstGraphQLErrorInBody(error.bodyText);
|
|
59
|
+
if (first) return describeGraphQLError(first);
|
|
60
|
+
}
|
|
61
|
+
if (error instanceof Error) return error.message || fallback;
|
|
62
|
+
if (typeof error === "string" && error.length > 0) return error;
|
|
63
|
+
return fallback;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Throw `result.error` when the injected client resolved an errored
|
|
67
|
+
* operation (errorPolicy 'all'). Returns the result unchanged otherwise, so
|
|
68
|
+
* it can be chained inline:
|
|
69
|
+
*
|
|
70
|
+
* ```ts
|
|
71
|
+
* const result = throwIfResultError(await client.mutate({ ... }));
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
function throwIfResultError(result) {
|
|
75
|
+
if (result.error) throw new Error(describeOperationError(result.error), { cause: result.error });
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
/** True when a GraphQL error list carries a FORBIDDEN code. */
|
|
79
|
+
function hasForbiddenCode(errors) {
|
|
80
|
+
return (errors ?? []).some((error) => error.extensions?.code === "FORBIDDEN");
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* True when an operation failed because the caller lacks the permission
|
|
84
|
+
* (gateway `@rbac` denial). Accepts the raw Apollo error, a `result.error`,
|
|
85
|
+
* or the Error `throwIfResultError` throws (the original sits in `cause`).
|
|
86
|
+
* Pages use it to render a no-access state instead of a load failure.
|
|
87
|
+
*/
|
|
88
|
+
function isForbiddenError(error) {
|
|
89
|
+
if (CombinedGraphQLErrors.is(error)) return hasForbiddenCode(error.errors);
|
|
90
|
+
if (ServerError.is(error)) {
|
|
91
|
+
if (error.statusCode === 403) return true;
|
|
92
|
+
const first = firstGraphQLErrorInBody(error.bodyText);
|
|
93
|
+
return first ? hasForbiddenCode([first]) : false;
|
|
94
|
+
}
|
|
95
|
+
if (error instanceof Error && error.cause !== void 0) return isForbiddenError(error.cause);
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
const REFRESHABLE_AUTH_FAILURES = /* @__PURE__ */ new Set(["CREDENTIAL_EXPIRED", "CREDENTIAL_REVOKED"]);
|
|
99
|
+
const EXPIRED_TOKEN_MESSAGE = /\b(?:jwt|token)\b[^.]{0,40}\bexpired\b|\bexpired\b[^.]{0,20}\b(?:jwt|token)\b/i;
|
|
100
|
+
function isUnauthenticatedGraphQLError(error) {
|
|
101
|
+
if (error.extensions?.code === "UNAUTHENTICATED") return true;
|
|
102
|
+
const authFailure = error.extensions?.authFailure;
|
|
103
|
+
if (typeof authFailure === "string" && REFRESHABLE_AUTH_FAILURES.has(authFailure)) return true;
|
|
104
|
+
return typeof error.message === "string" && EXPIRED_TOKEN_MESSAGE.test(error.message);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* True when a GraphQL error list says the caller's credential expired or is
|
|
108
|
+
* not accepted: an `UNAUTHENTICATED` code, an expired / revoked
|
|
109
|
+
* `authFailure` category, or an expired-token message.
|
|
110
|
+
*/
|
|
111
|
+
function hasUnauthenticatedGraphQLError(errors) {
|
|
112
|
+
return (errors ?? []).some(isUnauthenticatedGraphQLError);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* True when an operation failed because the session expired: HTTP 401, a
|
|
116
|
+
* GraphQL `UNAUTHENTICATED` error, or an expired / revoked credential.
|
|
117
|
+
* Accepts the raw Apollo error, a `result.error`, or the Error
|
|
118
|
+
* `throwIfResultError` throws (the original sits in `cause`). A 503
|
|
119
|
+
* `AUTH_SERVICE_UNAVAILABLE` is not an expired session and returns false.
|
|
120
|
+
*/
|
|
121
|
+
function isUnauthenticatedError(error) {
|
|
122
|
+
if (CombinedGraphQLErrors.is(error)) return hasUnauthenticatedGraphQLError(error.errors);
|
|
123
|
+
if (ServerError.is(error)) {
|
|
124
|
+
if (error.statusCode === 401) return true;
|
|
125
|
+
const first = firstGraphQLErrorInBody(error.bodyText);
|
|
126
|
+
return first ? isUnauthenticatedGraphQLError(first) : false;
|
|
127
|
+
}
|
|
128
|
+
if (error instanceof Error && error.cause !== void 0) return isUnauthenticatedError(error.cause);
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
/** The gateway error code of an operation failure, when it carries one. */
|
|
132
|
+
function operationErrorCode(error) {
|
|
133
|
+
const codeOf = (graphQLError) => {
|
|
134
|
+
const code = graphQLError?.extensions?.code;
|
|
135
|
+
return typeof code === "string" ? code : void 0;
|
|
136
|
+
};
|
|
137
|
+
if (CombinedGraphQLErrors.is(error)) return codeOf(error.errors[0]);
|
|
138
|
+
if (ServerError.is(error)) return codeOf(firstGraphQLErrorInBody(error.bodyText) ?? void 0);
|
|
139
|
+
if (error instanceof Error && error.cause !== void 0) return operationErrorCode(error.cause);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export { operationErrorCode as a, isUnauthenticatedError as i, hasUnauthenticatedGraphQLError as n, throwIfResultError as o, isForbiddenError as r, describeOperationError as t };
|
package/dist/executions.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as ExecutionsListPage } from "./ExecutionsListPage
|
|
3
|
-
import { t as ExecutionDetailPage } from "./ExecutionDetailPage-
|
|
2
|
+
import { t as ExecutionsListPage } from "./ExecutionsListPage--4BthM8L.js";
|
|
3
|
+
import { t as ExecutionDetailPage } from "./ExecutionDetailPage-BXDF2eoT.js";
|
|
4
4
|
|
|
5
5
|
export { ExecutionDetailPage, ExecutionsListPage };
|