@spiffcommerce/core 19.1.1 → 19.2.0
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/index.d.ts +6 -0
- package/dist/index.js +250 -226
- package/dist/index.umd.cjs +24 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createHttpLink as Bt, InMemoryCache as dt, ApolloClient as wt, from as Et, gql as
|
|
1
|
+
import { createHttpLink as Bt, InMemoryCache as dt, ApolloClient as wt, from as Et, gql as F } from "@apollo/client/core";
|
|
2
2
|
import { fetch as ZA, getAttributesFromArrayBuffer as De, AssetType as ce, StepType as D, getFrameData as $A, frameDataCache as ht, GroupCommand as G, UpdateFramePattern as Fe, UpdateFrameThresholdSettingsCommand as Ct, calculateOffsets as _A, LayoutElementType as v, generate as J, CreateElementCommand as L, generateSVGWithUnknownColors as Me, svgObjectURL as pA, fetchAsString as q, DeleteElementCommand as Z, generateDefaultRectangleFrameSvg as ge, GetSVGDimensions as Qt, patternImageDataCache as le, fetchAsArrayBuffer as ut, findElement as fA, modifySVGWithElementProperties as mt, IllustrationColorCommand as OA, IllustrationCacheCommand as It, getFontMetrics as pt, getPatternImageData as zA, FontAlignmentCommand as ft, FontColorCommand as Dt, FontImageFillCommand as kA, applyTextTransformations as KA, determineCorrectFontSizeAndLines as uA, FontSourceCommand as Be, loadFont as Ae, TextChangeCommand as Ft, FontSizeCommand as Mt, createElementNS as yt, createElement as lA, _loadFontExternalDataURL as ee, UpdateWorkflowStateCommand as de, CommandContext as Yt, createCanvas as DA, getSvgElement as ye, LayoutRenderingPurpose as Ye, renderPapyrusComponentAsString as Se, loadImage as xe, getDomParser as Pe, toBase64 as we, getVariant as St, generateFrameSVG as xt, getDefaultVariant as NA, domParser as Ne, sanitizeSvgTree as He, traverse as Pt, xmlSerializer as Re, CreateLayoutCommand as Nt, AspectType as mA, rehydrateSerializedLayout as _ } from "@spiffcommerce/papyrus";
|
|
3
|
-
import { AssetType as
|
|
3
|
+
import { AssetType as Ji, BringForwardCommand as bi, BringToBackCommand as Li, BringToFrontCommand as Ti, CanvasCommand as Oi, CommandContext as zi, CreateElementCommand as Ki, CreateLayoutCommand as ji, DeleteElementCommand as Vi, FontAlignmentCommand as Wi, FontColorCommand as Xi, FontSizeCommand as qi, FontSourceCommand as Zi, GroupCommand as $i, LayoutElementFactory as _i, LayoutElementType as As, MoveCommand as es, ResizeCommand as ts, RotateCommand as ns, SendBackwardsCommand as as, StepAspectType as is, StepType as ss, TextChangeCommand as os, UnitOfMeasurement as rs, dataUrlFromExternalUrl as cs, determineCorrectFontSizeAndLines as gs, findElement as ls, frameDataCache as Bs, generate as ds, generateSVGWithUnknownColors as ws, getAttributesFromArrayBuffer as Es, getAxisAlignedBoundingBox as hs, getFrameData as Cs, getSvgElement as Qs, loadFont as us, patternImageDataCache as ms, registerFetchImplementation as Is, registerWindowImplementation as ps, rehydrateSerializedLayout as fs, setCanvasModule as Ds } from "@spiffcommerce/papyrus";
|
|
4
4
|
import { setContext as Ht } from "@apollo/client/link/context";
|
|
5
5
|
import { onError as Rt } from "@apollo/client/link/error";
|
|
6
6
|
import { Pith as Ue } from "pith";
|
|
@@ -251,14 +251,14 @@ class Lt {
|
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
253
|
}
|
|
254
|
-
const
|
|
254
|
+
const P = new Lt(), Tt = F`
|
|
255
255
|
fragment AssetMetadataFields on Asset {
|
|
256
256
|
metadata {
|
|
257
257
|
key
|
|
258
258
|
value
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
-
`, GA = (c) =>
|
|
261
|
+
`, GA = (c) => F`
|
|
262
262
|
${c && Tt || ""}
|
|
263
263
|
fragment AssetFields on Asset {
|
|
264
264
|
name
|
|
@@ -273,14 +273,14 @@ const N = new Lt(), Tt = M`
|
|
|
273
273
|
}
|
|
274
274
|
${c && "...AssetMetadataFields" || ""}
|
|
275
275
|
}
|
|
276
|
-
`, Ot =
|
|
276
|
+
`, Ot = F`
|
|
277
277
|
${GA(!1)}
|
|
278
278
|
query GetAssets($keys: [String]!) {
|
|
279
279
|
assets(keys: $keys) {
|
|
280
280
|
...AssetFields
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
|
-
`, ne =
|
|
283
|
+
`, ne = F`
|
|
284
284
|
fragment MaterialFields on Material {
|
|
285
285
|
id
|
|
286
286
|
name
|
|
@@ -327,14 +327,14 @@ const N = new Lt(), Tt = M`
|
|
|
327
327
|
fileLink
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
`, zt =
|
|
330
|
+
`, zt = F`
|
|
331
331
|
${ne}
|
|
332
332
|
query GetMaterials($ids: [String]) {
|
|
333
333
|
materials(id: $ids) {
|
|
334
334
|
...MaterialFields
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
`, Kt =
|
|
337
|
+
`, Kt = F`
|
|
338
338
|
mutation CreateAsset($name: String!, $type: String!, $mimeType: String!, $anonymous: Boolean, $temporary: Boolean) {
|
|
339
339
|
assetCreate(name: $name, type: $type, mimeType: $mimeType, anonymous: $anonymous, temporary: $temporary) {
|
|
340
340
|
uploadUrl
|
|
@@ -348,14 +348,14 @@ const N = new Lt(), Tt = M`
|
|
|
348
348
|
}
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
`, Te = async (c) => (await
|
|
351
|
+
`, Te = async (c) => (await P.getShadowGraphqlClient().query({
|
|
352
352
|
query: Ot,
|
|
353
353
|
errorPolicy: "all",
|
|
354
354
|
fetchPolicy: "no-cache",
|
|
355
355
|
variables: {
|
|
356
356
|
keys: c
|
|
357
357
|
}
|
|
358
|
-
})).data.assets, jt = async (c) => (await
|
|
358
|
+
})).data.assets, jt = async (c) => (await P.getShadowGraphqlClient().query({
|
|
359
359
|
query: zt,
|
|
360
360
|
errorPolicy: "all",
|
|
361
361
|
fetchPolicy: "no-cache",
|
|
@@ -364,7 +364,7 @@ const N = new Lt(), Tt = M`
|
|
|
364
364
|
}
|
|
365
365
|
})).data.materials, Vt = async (c, A, e, t, n) => {
|
|
366
366
|
var i;
|
|
367
|
-
return (i = (await
|
|
367
|
+
return (i = (await P.getShadowGraphqlClient().mutate({
|
|
368
368
|
mutation: Kt,
|
|
369
369
|
errorPolicy: "all",
|
|
370
370
|
fetchPolicy: "no-cache",
|
|
@@ -564,7 +564,7 @@ class Xt {
|
|
|
564
564
|
this.disabled = A;
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
-
const cA = new Xt(), Oe =
|
|
567
|
+
const cA = new Xt(), Oe = F`
|
|
568
568
|
fragment OptionFields on Option {
|
|
569
569
|
id
|
|
570
570
|
name
|
|
@@ -604,7 +604,7 @@ const cA = new Xt(), Oe = M`
|
|
|
604
604
|
...AssetFields
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
|
-
`, qt =
|
|
607
|
+
`, qt = F`
|
|
608
608
|
${GA(!1)}
|
|
609
609
|
${ne}
|
|
610
610
|
${Oe}
|
|
@@ -614,7 +614,7 @@ const cA = new Xt(), Oe = M`
|
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
`, Zt = async (c) => {
|
|
617
|
-
const A = await
|
|
617
|
+
const A = await P.getShadowGraphqlClient().query({
|
|
618
618
|
query: qt,
|
|
619
619
|
errorPolicy: "all",
|
|
620
620
|
fetchPolicy: "no-cache",
|
|
@@ -692,7 +692,7 @@ class An {
|
|
|
692
692
|
}
|
|
693
693
|
const j = new An();
|
|
694
694
|
var en = /* @__PURE__ */ ((c) => (c.Hub = "Hub", c.Shopify = "Shopify", c))(en || {}), tn = /* @__PURE__ */ ((c) => (c[c.Orbit = 0] = "Orbit", c[c.Pan = 1] = "Pan", c))(tn || {}), nn = /* @__PURE__ */ ((c) => (c.Manual = "Manual", c.OnStart = "OnStart", c.OnQuit = "OnQuit", c.OnEnd = "OnEnd", c))(nn || {}), an = /* @__PURE__ */ ((c) => (c.Email = "Email", c.FirstName = "FirstName", c.LastName = "LastName", c.Phone = "Phone", c))(an || {}), YA = /* @__PURE__ */ ((c) => (c.Owner = "Owner", c.Approver = "Approver", c.Editor = "Editor", c.Viewer = "Viewer", c))(YA || {});
|
|
695
|
-
const nA =
|
|
695
|
+
const nA = F`
|
|
696
696
|
fragment AdditionalIntegrationProductFields on IntegrationProduct {
|
|
697
697
|
id
|
|
698
698
|
product {
|
|
@@ -709,7 +709,7 @@ const nA = M`
|
|
|
709
709
|
preloadImageUrl
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
|
-
`, Qe =
|
|
712
|
+
`, Qe = F`
|
|
713
713
|
${nA}
|
|
714
714
|
mutation CreateTransaction(
|
|
715
715
|
$integrationProductId: String
|
|
@@ -793,7 +793,7 @@ const nA = M`
|
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
|
-
`, sn =
|
|
796
|
+
`, sn = F`
|
|
797
797
|
${nA}
|
|
798
798
|
mutation CreateTransactions($inputs: [TransactionCreateInput]!) {
|
|
799
799
|
transactionCreateMany(inputs: $inputs) {
|
|
@@ -865,7 +865,7 @@ const nA = M`
|
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
|
-
`, on =
|
|
868
|
+
`, on = F`
|
|
869
869
|
${nA}
|
|
870
870
|
mutation ClaimTransaction($id: String!) {
|
|
871
871
|
transactionClaim(id: $id) {
|
|
@@ -937,7 +937,7 @@ const nA = M`
|
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
|
-
`, BA =
|
|
940
|
+
`, BA = F`
|
|
941
941
|
${nA}
|
|
942
942
|
query ReadTransactions($ids: [String]!) {
|
|
943
943
|
transactions(ids: $ids) {
|
|
@@ -1030,20 +1030,20 @@ const nA = M`
|
|
|
1030
1030
|
}
|
|
1031
1031
|
}
|
|
1032
1032
|
}
|
|
1033
|
-
`, rn =
|
|
1033
|
+
`, rn = F`
|
|
1034
1034
|
mutation UpdateTransactionWorkflowState($id: String!, $workflowState: String!) {
|
|
1035
1035
|
transactionUpdate(id: $id, workflowState: $workflowState) {
|
|
1036
1036
|
id
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
`, cn =
|
|
1039
|
+
`, cn = F`
|
|
1040
1040
|
mutation UpdateTransactionWorkflowId($id: String!, $workflowId: String!) {
|
|
1041
1041
|
transactionUpdate(id: $id, workflowId: $workflowId) {
|
|
1042
1042
|
id
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
1045
|
`;
|
|
1046
|
-
|
|
1046
|
+
F`
|
|
1047
1047
|
query ReadTransactionForDesignCreation($id: String!) {
|
|
1048
1048
|
transactions(ids: [$id]) {
|
|
1049
1049
|
id
|
|
@@ -1083,14 +1083,14 @@ M`
|
|
|
1083
1083
|
}
|
|
1084
1084
|
}
|
|
1085
1085
|
`;
|
|
1086
|
-
const ze =
|
|
1086
|
+
const ze = F`
|
|
1087
1087
|
query ReadWorkflowStates($ids: [String]!) {
|
|
1088
1088
|
transactions(ids: $ids) {
|
|
1089
1089
|
id
|
|
1090
1090
|
workflowState
|
|
1091
1091
|
}
|
|
1092
1092
|
}
|
|
1093
|
-
`, Ke =
|
|
1093
|
+
`, Ke = F`
|
|
1094
1094
|
${nA}
|
|
1095
1095
|
fragment IntegrationProductFields on IntegrationProduct {
|
|
1096
1096
|
id
|
|
@@ -1132,14 +1132,14 @@ const ze = M`
|
|
|
1132
1132
|
}
|
|
1133
1133
|
}
|
|
1134
1134
|
}
|
|
1135
|
-
`, gn =
|
|
1135
|
+
`, gn = F`
|
|
1136
1136
|
${Ke}
|
|
1137
1137
|
query GetIntegrationProducts($ids: [String!]!) {
|
|
1138
1138
|
integrationProducts(ids: $ids) {
|
|
1139
1139
|
...IntegrationProductFields
|
|
1140
1140
|
}
|
|
1141
1141
|
}
|
|
1142
|
-
`, ln =
|
|
1142
|
+
`, ln = F`
|
|
1143
1143
|
${Ke}
|
|
1144
1144
|
query GetIntegrationProductFromExternalIds($externalIntegrationId: String!, $externalProductId: String!) {
|
|
1145
1145
|
integrationProductFromExternalIds(
|
|
@@ -3214,11 +3214,11 @@ class Hn {
|
|
|
3214
3214
|
const E = t.colorOption;
|
|
3215
3215
|
let Q;
|
|
3216
3216
|
if (E && E.variants) {
|
|
3217
|
-
const
|
|
3217
|
+
const N = E.variants.find((H) => {
|
|
3218
3218
|
var T;
|
|
3219
3219
|
return H.id === ((T = E.defaultVariant) == null ? void 0 : T.id);
|
|
3220
3220
|
}) || E.variants[0];
|
|
3221
|
-
Q = this.createTextFillSpotColor(E,
|
|
3221
|
+
Q = this.createTextFillSpotColor(E, N), i.updateStorage(A, {
|
|
3222
3222
|
colorProfileAssetKey: (h = E.colorProfile) == null ? void 0 : h.key
|
|
3223
3223
|
});
|
|
3224
3224
|
}
|
|
@@ -3249,7 +3249,7 @@ class Hn {
|
|
|
3249
3249
|
}, m = [], I = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
3250
3250
|
if (!u.fontData)
|
|
3251
3251
|
throw new k("Failed to resolve font data for text.");
|
|
3252
|
-
const [
|
|
3252
|
+
const [M, y] = uA(
|
|
3253
3253
|
u.fontSize,
|
|
3254
3254
|
u.fontData,
|
|
3255
3255
|
{
|
|
@@ -3263,11 +3263,11 @@ class Hn {
|
|
|
3263
3263
|
[o],
|
|
3264
3264
|
{ size: t.size, minSize: t.minSize, maxSize: t.maxSize }
|
|
3265
3265
|
);
|
|
3266
|
-
I.set(u.id,
|
|
3266
|
+
I.set(u.id, M), p.set(u.id, y);
|
|
3267
3267
|
const S = t.curved || t.vertical ? o : (y || []).join(`
|
|
3268
3268
|
`);
|
|
3269
3269
|
m.push(
|
|
3270
|
-
this.generateTextChangeCommandsForRegion(
|
|
3270
|
+
this.generateTextChangeCommandsForRegion(M, t, u.id, S)
|
|
3271
3271
|
);
|
|
3272
3272
|
const Y = new L(u, d);
|
|
3273
3273
|
return {
|
|
@@ -3325,8 +3325,8 @@ class Hn {
|
|
|
3325
3325
|
const u = i.getProfanities(), m = jA(l.toLowerCase());
|
|
3326
3326
|
for (const I of m)
|
|
3327
3327
|
for (const p in u) {
|
|
3328
|
-
const
|
|
3329
|
-
if (I ===
|
|
3328
|
+
const M = u[p].toLowerCase().replace(/\s/g, "");
|
|
3329
|
+
if (I === M)
|
|
3330
3330
|
return o(!0), { error: "Blocked profanity." };
|
|
3331
3331
|
}
|
|
3332
3332
|
return !A.data.vertical && !A.data.allowNewlines && (l.includes(`
|
|
@@ -4802,12 +4802,12 @@ class bn extends ae {
|
|
|
4802
4802
|
m.appendChild(I), I.appendChild(et(3, 7, 4, "shadow"));
|
|
4803
4803
|
const p = R("g");
|
|
4804
4804
|
m.appendChild(p), p.setAttribute("filter", "url(#shadow)"), p.innerHTML = t;
|
|
4805
|
-
const
|
|
4806
|
-
m.appendChild(
|
|
4805
|
+
const M = R("g");
|
|
4806
|
+
m.appendChild(M), M.setAttribute("fill", "red"), M.setAttribute("stroke", "red"), M.setAttribute("stroke-width", "9"), M.innerHTML = t;
|
|
4807
4807
|
const y = R("g");
|
|
4808
4808
|
m.appendChild(y), y.setAttribute("fill", "#9d2621"), y.setAttribute("transform", "translate(1,1)"), y.innerHTML = t;
|
|
4809
4809
|
const S = R("g");
|
|
4810
|
-
return m.appendChild(S), S.setAttribute("fill", "yellow"), S.innerHTML = t, new oe(m).transform(([
|
|
4810
|
+
return m.appendChild(S), S.setAttribute("fill", "yellow"), S.innerHTML = t, new oe(m).transform(([N, H]) => [N, H + (a / 2 - N) ** 2 / (a * 2.9)]), m;
|
|
4811
4811
|
}, [o, r, g] = _e(e);
|
|
4812
4812
|
if (!o)
|
|
4813
4813
|
return "";
|
|
@@ -4842,17 +4842,17 @@ class Tn extends ae {
|
|
|
4842
4842
|
}
|
|
4843
4843
|
brandSvg(A, e, t) {
|
|
4844
4844
|
const n = A.toSVG(2), a = A.getBoundingBox(), i = a.y2 - a.y1, s = a.x2 - a.x1, o = A.toPathData(3), r = () => {
|
|
4845
|
-
const p = R("g"),
|
|
4846
|
-
p.appendChild(
|
|
4845
|
+
const p = R("g"), M = R("g");
|
|
4846
|
+
p.appendChild(M), M.setAttribute("stroke", "#5C1A0D"), M.setAttribute("stroke-width", "4"), M.setAttribute("transform", "translate(1,1)"), M.innerHTML = n;
|
|
4847
4847
|
const y = R("g");
|
|
4848
4848
|
p.appendChild(y), y.setAttribute("fill", "#FFE386"), y.setAttribute("transform", "translate(1,1)"), y.innerHTML = n;
|
|
4849
4849
|
const S = R("g");
|
|
4850
4850
|
p.appendChild(S), S.setAttribute("fill", "white"), S.innerHTML = n;
|
|
4851
4851
|
const Y = new oe(p);
|
|
4852
|
-
return Y.transform(([
|
|
4853
|
-
|
|
4854
|
-
H + (s / 3 -
|
|
4855
|
-
]), Y.transform(([
|
|
4852
|
+
return Y.transform(([N, H]) => [N, H + ((s - N) * H) ** 2 / (s * 5e4)]), Y.transform(([N, H]) => [
|
|
4853
|
+
N,
|
|
4854
|
+
H + (s / 3 - N) ** 2 / s * this.indicator(N < s / 3)
|
|
4855
|
+
]), Y.transform(([N, H]) => [N - (i - H) * (s - N) / 800, H]), p;
|
|
4856
4856
|
}, [g, B, l] = _e(e);
|
|
4857
4857
|
if (!g)
|
|
4858
4858
|
return "";
|
|
@@ -4896,10 +4896,10 @@ class zn extends ae {
|
|
|
4896
4896
|
I.classList.add("module-layer0"), f.appendChild(I), I.setAttribute("filter", "url(#shadow)"), I.innerHTML = m.outerHTML;
|
|
4897
4897
|
const p = R("g");
|
|
4898
4898
|
p.classList.add("module-layer1"), f.appendChild(p), p.setAttribute("stroke-width", "3"), p.setAttribute("stroke", "rgb(45,41,38)"), p.setAttribute("fill", "rgb(45,41,38)"), p.setAttribute("transform", "translate(0.5,0)"), p.innerHTML = s;
|
|
4899
|
-
const
|
|
4900
|
-
|
|
4899
|
+
const M = R("g");
|
|
4900
|
+
M.classList.add("module-layer2"), f.appendChild(M), M.setAttribute("fill", "rgb(255,209,0)"), M.setAttribute("transform", "translate(1,-0.1)"), M.innerHTML = s;
|
|
4901
4901
|
const y = R("g");
|
|
4902
|
-
return y.classList.add("module-layer3"), f.appendChild(y), y.setAttribute("fill", "white"), y.innerHTML = s, new oe(f).transform(([Y,
|
|
4902
|
+
return y.classList.add("module-layer3"), f.appendChild(y), y.setAttribute("fill", "white"), y.innerHTML = s, new oe(f).transform(([Y, N]) => [Y, N + (r / 2 - Y) ** 2 / (r * 6)]), f;
|
|
4903
4903
|
}, l = R("g");
|
|
4904
4904
|
l.classList.add("module-root");
|
|
4905
4905
|
const d = R("defs");
|
|
@@ -5346,7 +5346,7 @@ class jn {
|
|
|
5346
5346
|
this.stepSelections = {
|
|
5347
5347
|
...this.stepSelections,
|
|
5348
5348
|
[A]: { selectedVariants: e }
|
|
5349
|
-
}, this.selectionCost = Object.values(this.stepSelections).reduce((I, p) => I + p.selectedVariants.map((
|
|
5349
|
+
}, this.selectionCost = Object.values(this.stepSelections).reduce((I, p) => I + p.selectedVariants.map((M) => M.priceModifier || 0).reduce((M, y) => M + y, 0), 0), this.workflow.steps.forEach((I) => {
|
|
5350
5350
|
tA(I, this.stepSelections) || (this.stepInitialised[I.stepName] = !1, delete this.stepMetadata[I.stepName], delete this.stepSelections[I.stepName], delete this.storage[I.stepName]);
|
|
5351
5351
|
});
|
|
5352
5352
|
const i = this.allScenes, s = eA(i, a), o = eA(i, this.stepSelections), r = s.map((I) => I.silentSteps).flat(), B = o.map((I) => I.silentSteps).flat().filter(
|
|
@@ -6065,13 +6065,13 @@ class wA {
|
|
|
6065
6065
|
case D.Model:
|
|
6066
6066
|
return new Xn(A, e);
|
|
6067
6067
|
case D.Frame:
|
|
6068
|
-
return new
|
|
6068
|
+
return new Ii(A, e);
|
|
6069
6069
|
default:
|
|
6070
6070
|
throw new k(`Step type ${e.type} not yet supported in Core SDK`);
|
|
6071
6071
|
}
|
|
6072
6072
|
}
|
|
6073
6073
|
}
|
|
6074
|
-
const it =
|
|
6074
|
+
const it = F`
|
|
6075
6075
|
fragment CreateDesignTransaction on Transaction {
|
|
6076
6076
|
id
|
|
6077
6077
|
designName
|
|
@@ -6090,7 +6090,7 @@ const it = M`
|
|
|
6090
6090
|
additionalExternalVariantId
|
|
6091
6091
|
}
|
|
6092
6092
|
}
|
|
6093
|
-
`, ea =
|
|
6093
|
+
`, ea = F`
|
|
6094
6094
|
${it}
|
|
6095
6095
|
mutation CreateDesign(
|
|
6096
6096
|
$name: String!
|
|
@@ -6122,7 +6122,7 @@ const it = M`
|
|
|
6122
6122
|
}
|
|
6123
6123
|
}
|
|
6124
6124
|
}
|
|
6125
|
-
`, ta =
|
|
6125
|
+
`, ta = F`
|
|
6126
6126
|
${it}
|
|
6127
6127
|
mutation CreateDesigns($inputs: [DesignCreateInput]!) {
|
|
6128
6128
|
designCreateMany(inputs: $inputs) {
|
|
@@ -6138,7 +6138,7 @@ const it = M`
|
|
|
6138
6138
|
}
|
|
6139
6139
|
`, na = async (c) => {
|
|
6140
6140
|
var e;
|
|
6141
|
-
return (e = (await
|
|
6141
|
+
return (e = (await P.getShadowGraphqlClient().mutate({
|
|
6142
6142
|
mutation: ea,
|
|
6143
6143
|
errorPolicy: "all",
|
|
6144
6144
|
fetchPolicy: "no-cache",
|
|
@@ -6155,7 +6155,7 @@ const it = M`
|
|
|
6155
6155
|
})).data) == null ? void 0 : e.designCreate;
|
|
6156
6156
|
}, aa = async (c) => {
|
|
6157
6157
|
var e;
|
|
6158
|
-
return (e = (await
|
|
6158
|
+
return (e = (await P.getShadowGraphqlClient().mutate({
|
|
6159
6159
|
mutation: ta,
|
|
6160
6160
|
errorPolicy: "all",
|
|
6161
6161
|
fetchPolicy: "no-cache",
|
|
@@ -6264,13 +6264,13 @@ const it = M`
|
|
|
6264
6264
|
};
|
|
6265
6265
|
return a && (d.metadata = a), t && (d.selectedVariants = t), n && (d.sku = n), d;
|
|
6266
6266
|
}, ot = async (c, A, e, t, n, a, i, s, o, r) => {
|
|
6267
|
-
var
|
|
6267
|
+
var M;
|
|
6268
6268
|
await (async () => {
|
|
6269
6269
|
var T;
|
|
6270
6270
|
if (r !== void 0)
|
|
6271
6271
|
return r;
|
|
6272
6272
|
await c.outstandingRequestsPromise();
|
|
6273
|
-
const S = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id),
|
|
6273
|
+
const S = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(n.id), N = await P.getShadowGraphqlClient().query({
|
|
6274
6274
|
query: ze,
|
|
6275
6275
|
variables: { ids: [n.id] },
|
|
6276
6276
|
fetchPolicy: "no-cache",
|
|
@@ -6278,17 +6278,17 @@ const it = M`
|
|
|
6278
6278
|
context: {
|
|
6279
6279
|
transactionOwnerId: S
|
|
6280
6280
|
}
|
|
6281
|
-
}), H = (T =
|
|
6282
|
-
return
|
|
6283
|
-
|
|
6281
|
+
}), H = (T = N.data) == null ? void 0 : T.transactions[0].workflowState;
|
|
6282
|
+
return N.errors ? (N.errors.forEach((b) => {
|
|
6283
|
+
N.errors && console.log("Server Error:", b.message);
|
|
6284
6284
|
}), null) : H ?? null;
|
|
6285
6285
|
})() || (console.warn("State mismatch detected. Uploading known state explicitly"), console.warn("State Object:", JSON.stringify(t())), await c.updateStateWithServerImmediate(t), console.log("Server state is undefined @ Workflow completion"));
|
|
6286
|
-
const l = c.getPreviewService(), d = (
|
|
6286
|
+
const l = c.getPreviewService(), d = (M = A == null ? void 0 : A.finalizeStepConfig) == null ? void 0 : M.lookAtAnimation, w = l && A.showModelOnFinishStep && !!d, h = o && XA(o, A, !0), E = o && XA(o, A, !1), Q = async (y) => {
|
|
6287
6287
|
const S = {};
|
|
6288
6288
|
let Y = 0;
|
|
6289
6289
|
if (Object.keys(a).length > 0)
|
|
6290
|
-
for (const
|
|
6291
|
-
const H = a[
|
|
6290
|
+
for (const N of Object.keys(a)) {
|
|
6291
|
+
const H = a[N], T = A.steps.find((b) => b.stepName === N);
|
|
6292
6292
|
for (let b = 0; b < H.selections.length; ++b) {
|
|
6293
6293
|
const V = H.selections[b];
|
|
6294
6294
|
if (T && (!y || T.option && (T.option.variants || []).length > 1 && !T.data.hideSelectionInCart && !T.data.hideSelectionsInCart)) {
|
|
@@ -6332,14 +6332,14 @@ const it = M`
|
|
|
6332
6332
|
};
|
|
6333
6333
|
if (E) {
|
|
6334
6334
|
const S = [];
|
|
6335
|
-
for (const [Y,
|
|
6336
|
-
S.push({ key: Y, value:
|
|
6335
|
+
for (const [Y, N] of Object.entries(E))
|
|
6336
|
+
S.push({ key: Y, value: N });
|
|
6337
6337
|
y.metadata = S;
|
|
6338
6338
|
}
|
|
6339
6339
|
if (f) {
|
|
6340
6340
|
const S = [];
|
|
6341
|
-
for (const [Y,
|
|
6342
|
-
S.push({ key: Y, ids:
|
|
6341
|
+
for (const [Y, N] of Object.entries(m))
|
|
6342
|
+
S.push({ key: Y, ids: N });
|
|
6343
6343
|
y.selectedVariants = S;
|
|
6344
6344
|
}
|
|
6345
6345
|
return y;
|
|
@@ -6385,7 +6385,7 @@ const it = M`
|
|
|
6385
6385
|
);
|
|
6386
6386
|
const n = await (async () => {
|
|
6387
6387
|
var r;
|
|
6388
|
-
const o = await
|
|
6388
|
+
const o = await P.getShadowGraphqlClient().query({
|
|
6389
6389
|
query: ze,
|
|
6390
6390
|
variables: { ids: c.map((g) => g.transaction.id) },
|
|
6391
6391
|
fetchPolicy: "no-cache",
|
|
@@ -6497,7 +6497,7 @@ class ra {
|
|
|
6497
6497
|
throw new k("Unexpected storage method requested");
|
|
6498
6498
|
}
|
|
6499
6499
|
}
|
|
6500
|
-
const LA = new ra(), ca =
|
|
6500
|
+
const LA = new ra(), ca = F`
|
|
6501
6501
|
mutation AddTransactionStakeholder($id: String!, $type: String!, $details: CustomerDetailsInput!) {
|
|
6502
6502
|
transactionAddStakeholder(id: $id, details: $details, type: $type) {
|
|
6503
6503
|
id
|
|
@@ -6706,7 +6706,7 @@ class EA {
|
|
|
6706
6706
|
}
|
|
6707
6707
|
async assignCustomerDetails(A) {
|
|
6708
6708
|
var i, s, o;
|
|
6709
|
-
const t = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(this.getWorkflowManager().getTransaction().id), a = (o = (s = (i = (await
|
|
6709
|
+
const t = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(this.getWorkflowManager().getTransaction().id), a = (o = (s = (i = (await P.getShadowGraphqlClient().mutate({
|
|
6710
6710
|
mutation: ca,
|
|
6711
6711
|
variables: {
|
|
6712
6712
|
id: this.getWorkflowManager().getTransaction().id,
|
|
@@ -6760,7 +6760,7 @@ class EA {
|
|
|
6760
6760
|
const A = HA(this.getCommandContext().getState());
|
|
6761
6761
|
if (!A)
|
|
6762
6762
|
throw new k("Internal state is undefined! Cannot copy experience!");
|
|
6763
|
-
const e = JSON.stringify(A.transaction), t = this.getWorkflowManager().getWorkflow(), n = new
|
|
6763
|
+
const e = JSON.stringify(A.transaction), t = this.getWorkflowManager().getWorkflow(), n = new ui({}), a = (s = this.getWorkflowManager().getTransaction().integrationProduct) == null ? void 0 : s.id;
|
|
6764
6764
|
if (!a)
|
|
6765
6765
|
throw new k("Integration product id is undefined!");
|
|
6766
6766
|
return await n.initFromIntegrationProduct(a), await n.getWorkflowExperience(t.id, e, void 0);
|
|
@@ -6920,29 +6920,29 @@ const ga = [
|
|
|
6920
6920
|
const h = {};
|
|
6921
6921
|
Pt(w, (p) => {
|
|
6922
6922
|
ga.includes(p.tagName) && !p.attributes.getNamedItem("fill") && p.setAttribute("fill", "#000000");
|
|
6923
|
-
const
|
|
6924
|
-
if (
|
|
6925
|
-
const S =
|
|
6926
|
-
p.classList.add(
|
|
6923
|
+
const M = p.attributes.getNamedItem("fill");
|
|
6924
|
+
if (M && M.value !== "none") {
|
|
6925
|
+
const S = M.value, N = `spiff-fill-${S.replace(/\W/g, "")}`;
|
|
6926
|
+
p.classList.add(N), h[N] = { browserValue: S };
|
|
6927
6927
|
}
|
|
6928
6928
|
const y = p.attributes.getNamedItem("stroke");
|
|
6929
6929
|
if (y && y.value !== "none") {
|
|
6930
|
-
const S = y.value,
|
|
6931
|
-
p.classList.add(
|
|
6930
|
+
const S = y.value, N = `spiff-stroke-${S.replace(/\W/g, "")}`;
|
|
6931
|
+
p.classList.add(N), h[N] = { browserValue: S };
|
|
6932
6932
|
}
|
|
6933
6933
|
});
|
|
6934
6934
|
const Q = Re().serializeToString(w), C = n.colors;
|
|
6935
6935
|
if (C) {
|
|
6936
|
-
for (const [p,
|
|
6936
|
+
for (const [p, M] of Object.entries(h))
|
|
6937
6937
|
for (const y of Object.keys(C))
|
|
6938
|
-
if (
|
|
6938
|
+
if (M.browserValue === y) {
|
|
6939
6939
|
h[p] = { browserValue: C[y] };
|
|
6940
6940
|
break;
|
|
6941
6941
|
}
|
|
6942
6942
|
}
|
|
6943
6943
|
const f = (p) => {
|
|
6944
|
-
const
|
|
6945
|
-
if (!
|
|
6944
|
+
const M = c.find((S) => S.panelId === p.panelId);
|
|
6945
|
+
if (!M)
|
|
6946
6946
|
throw new z(p);
|
|
6947
6947
|
const y = J();
|
|
6948
6948
|
return new L(
|
|
@@ -6960,7 +6960,7 @@ const ga = [
|
|
|
6960
6960
|
layerIndex: p.layerIndex,
|
|
6961
6961
|
immutable: p.immutable
|
|
6962
6962
|
},
|
|
6963
|
-
|
|
6963
|
+
M
|
|
6964
6964
|
);
|
|
6965
6965
|
}, u = t.data.regions;
|
|
6966
6966
|
try {
|
|
@@ -7478,7 +7478,7 @@ class Da extends je {
|
|
|
7478
7478
|
B.resize(s, o), await B.render(), this.onRender();
|
|
7479
7479
|
}
|
|
7480
7480
|
}
|
|
7481
|
-
const
|
|
7481
|
+
const Ri = (c, A) => {
|
|
7482
7482
|
const e = [];
|
|
7483
7483
|
return c.forEach((t) => {
|
|
7484
7484
|
const n = A.steps.find((a) => a.stepName === t.stepName);
|
|
@@ -7489,7 +7489,7 @@ const Hi = (c, A) => {
|
|
|
7489
7489
|
}
|
|
7490
7490
|
});
|
|
7491
7491
|
}), e;
|
|
7492
|
-
},
|
|
7492
|
+
}, Ui = async (c, A, e, t) => {
|
|
7493
7493
|
let n = {
|
|
7494
7494
|
serializableWorkflow: { steps: [] },
|
|
7495
7495
|
layouts: {}
|
|
@@ -7497,7 +7497,7 @@ const Hi = (c, A) => {
|
|
|
7497
7497
|
n = new G(e.map((o) => new Nt(o))).apply(n);
|
|
7498
7498
|
const i = await ma(c, A, e, t);
|
|
7499
7499
|
return new G(i).apply(n);
|
|
7500
|
-
}, Fa =
|
|
7500
|
+
}, Fa = F`
|
|
7501
7501
|
${nA}
|
|
7502
7502
|
fragment ProductFields on Product {
|
|
7503
7503
|
id
|
|
@@ -7539,7 +7539,7 @@ const Hi = (c, A) => {
|
|
|
7539
7539
|
name
|
|
7540
7540
|
}
|
|
7541
7541
|
}
|
|
7542
|
-
`, Ma =
|
|
7542
|
+
`, Ma = F`
|
|
7543
7543
|
${Fa}
|
|
7544
7544
|
fragment ProductCollectionProductFields on ProductCollectionProduct {
|
|
7545
7545
|
id
|
|
@@ -7549,7 +7549,7 @@ const Hi = (c, A) => {
|
|
|
7549
7549
|
...ProductFields
|
|
7550
7550
|
}
|
|
7551
7551
|
}
|
|
7552
|
-
`, rt =
|
|
7552
|
+
`, rt = F`
|
|
7553
7553
|
${Ma}
|
|
7554
7554
|
fragment ProductCollectionFields on ProductCollection {
|
|
7555
7555
|
id
|
|
@@ -7596,7 +7596,7 @@ const Hi = (c, A) => {
|
|
|
7596
7596
|
}
|
|
7597
7597
|
}
|
|
7598
7598
|
}
|
|
7599
|
-
`, ya =
|
|
7599
|
+
`, ya = F`
|
|
7600
7600
|
${rt}
|
|
7601
7601
|
query GetBundle($id: String!) {
|
|
7602
7602
|
bundles(ids: [$id]) {
|
|
@@ -7618,7 +7618,7 @@ const Hi = (c, A) => {
|
|
|
7618
7618
|
}
|
|
7619
7619
|
}
|
|
7620
7620
|
}
|
|
7621
|
-
`, Ya =
|
|
7621
|
+
`, Ya = F`
|
|
7622
7622
|
query GetBundleStakeholders($id: String!) {
|
|
7623
7623
|
bundles(ids: [$id]) {
|
|
7624
7624
|
id
|
|
@@ -7638,7 +7638,7 @@ const Hi = (c, A) => {
|
|
|
7638
7638
|
}
|
|
7639
7639
|
}
|
|
7640
7640
|
}
|
|
7641
|
-
`, Sa =
|
|
7641
|
+
`, Sa = F`
|
|
7642
7642
|
query GetBundlesForCustomer($id: String!) {
|
|
7643
7643
|
customers(ids: [$id]) {
|
|
7644
7644
|
bundleStakeholders {
|
|
@@ -7659,7 +7659,7 @@ const Hi = (c, A) => {
|
|
|
7659
7659
|
}
|
|
7660
7660
|
}
|
|
7661
7661
|
}
|
|
7662
|
-
`, xa =
|
|
7662
|
+
`, xa = F`
|
|
7663
7663
|
${rt}
|
|
7664
7664
|
mutation CreateBundle($collectionId: String, $initialMetadata: [MetadataInput!]) {
|
|
7665
7665
|
bundleCreate(collectionId: $collectionId, metadata: $initialMetadata) {
|
|
@@ -7678,25 +7678,25 @@ const Hi = (c, A) => {
|
|
|
7678
7678
|
}
|
|
7679
7679
|
}
|
|
7680
7680
|
}
|
|
7681
|
-
`, Pa =
|
|
7681
|
+
`, Pa = F`
|
|
7682
7682
|
mutation UpdateBundle($id: String!, $name: String, $metadata: [MetadataInput!], $bundleStateData: String) {
|
|
7683
7683
|
bundleUpdate(id: $id, name: $name, metadata: $metadata, bundleStateData: $bundleStateData) {
|
|
7684
7684
|
id
|
|
7685
7685
|
}
|
|
7686
7686
|
}
|
|
7687
|
-
`, Na =
|
|
7687
|
+
`, Na = F`
|
|
7688
7688
|
mutation BundleAddTransaction($id: String!, $transactionId: String!) {
|
|
7689
7689
|
bundleAddTransaction(id: $id, transactionId: $transactionId) {
|
|
7690
7690
|
id
|
|
7691
7691
|
}
|
|
7692
7692
|
}
|
|
7693
|
-
`, Ha =
|
|
7693
|
+
`, Ha = F`
|
|
7694
7694
|
mutation BundleAddTransactions($id: String!, $transactionIds: [String!]!, $transactionOwnerIds: [String!]) {
|
|
7695
7695
|
bundleAddTransactions(id: $id, transactionIds: $transactionIds, transactionOwnerIds: $transactionOwnerIds) {
|
|
7696
7696
|
id
|
|
7697
7697
|
}
|
|
7698
7698
|
}
|
|
7699
|
-
`, Ra =
|
|
7699
|
+
`, Ra = F`
|
|
7700
7700
|
mutation BundleRemoveTransaction(
|
|
7701
7701
|
$id: String!
|
|
7702
7702
|
$transactionId: String!
|
|
@@ -7711,7 +7711,7 @@ const Hi = (c, A) => {
|
|
|
7711
7711
|
id
|
|
7712
7712
|
}
|
|
7713
7713
|
}
|
|
7714
|
-
`, Ua =
|
|
7714
|
+
`, Ua = F`
|
|
7715
7715
|
mutation BundleRemoveTransactions(
|
|
7716
7716
|
$id: String!
|
|
7717
7717
|
$transactionIds: [String!]!
|
|
@@ -7726,7 +7726,7 @@ const Hi = (c, A) => {
|
|
|
7726
7726
|
id
|
|
7727
7727
|
}
|
|
7728
7728
|
}
|
|
7729
|
-
`, Ga =
|
|
7729
|
+
`, Ga = F`
|
|
7730
7730
|
mutation BundleAddStakeholder($id: String!, $details: CustomerDetailsInput!, $type: String!) {
|
|
7731
7731
|
bundleAddStakeholder(id: $id, details: $details, type: $type) {
|
|
7732
7732
|
id
|
|
@@ -7746,7 +7746,7 @@ const Hi = (c, A) => {
|
|
|
7746
7746
|
}
|
|
7747
7747
|
}
|
|
7748
7748
|
}
|
|
7749
|
-
`, va =
|
|
7749
|
+
`, va = F`
|
|
7750
7750
|
mutation BundleUpdateStakeholders($id: String!, $input: [BundleStakeholderInput!]!) {
|
|
7751
7751
|
bundleUpdateStakeholders(id: $id, input: $input) {
|
|
7752
7752
|
id
|
|
@@ -7766,7 +7766,7 @@ const Hi = (c, A) => {
|
|
|
7766
7766
|
}
|
|
7767
7767
|
}
|
|
7768
7768
|
}
|
|
7769
|
-
`, ka =
|
|
7769
|
+
`, ka = F`
|
|
7770
7770
|
mutation BundleUpdateTransactionOrder($id: String!, $transactionIds: [String!]!) {
|
|
7771
7771
|
bundleUpdateTransactionOrder(id: $id, transactionIds: $transactionIds) {
|
|
7772
7772
|
id
|
|
@@ -8018,7 +8018,7 @@ class Ta extends ct {
|
|
|
8018
8018
|
return this.getSharedSteps()[0].getCustomColor();
|
|
8019
8019
|
}
|
|
8020
8020
|
}
|
|
8021
|
-
const Oa =
|
|
8021
|
+
const Oa = F`
|
|
8022
8022
|
mutation CreateGlobalPropertyState($bundleId: String!) {
|
|
8023
8023
|
globalPropertyStateCreate(bundleId: $bundleId) {
|
|
8024
8024
|
id
|
|
@@ -8028,7 +8028,7 @@ const Oa = M`
|
|
|
8028
8028
|
}
|
|
8029
8029
|
}
|
|
8030
8030
|
}
|
|
8031
|
-
`, za =
|
|
8031
|
+
`, za = F`
|
|
8032
8032
|
mutation UpdateGlobalPropertyState($id: String!, $aspects: [GlobalPropertyStateAspectInput]!) {
|
|
8033
8033
|
globalPropertyStateUpdate(id: $id, aspects: $aspects) {
|
|
8034
8034
|
id
|
|
@@ -8038,7 +8038,7 @@ const Oa = M`
|
|
|
8038
8038
|
}
|
|
8039
8039
|
}
|
|
8040
8040
|
}
|
|
8041
|
-
`, Ka =
|
|
8041
|
+
`, Ka = F`
|
|
8042
8042
|
query GetGlobalPropertyState($bundleId: String!) {
|
|
8043
8043
|
globalPropertyState(bundleId: $bundleId) {
|
|
8044
8044
|
id
|
|
@@ -8078,7 +8078,7 @@ class ja {
|
|
|
8078
8078
|
var e;
|
|
8079
8079
|
if (!this.globalPropertyState)
|
|
8080
8080
|
throw new Error("Global property state not initialized");
|
|
8081
|
-
const A = await
|
|
8081
|
+
const A = await P.getShadowGraphqlClient().mutate({
|
|
8082
8082
|
mutation: za,
|
|
8083
8083
|
variables: {
|
|
8084
8084
|
id: this.globalPropertyState.id,
|
|
@@ -8095,7 +8095,7 @@ class ja {
|
|
|
8095
8095
|
}
|
|
8096
8096
|
async getOrCreateGlobalPropertyState() {
|
|
8097
8097
|
var t;
|
|
8098
|
-
const A = await
|
|
8098
|
+
const A = await P.getShadowGraphqlClient().query({
|
|
8099
8099
|
query: Ka,
|
|
8100
8100
|
errorPolicy: "all",
|
|
8101
8101
|
fetchPolicy: "no-cache",
|
|
@@ -8108,7 +8108,7 @@ class ja {
|
|
|
8108
8108
|
});
|
|
8109
8109
|
if (A.data.globalPropertyState && A.data.globalPropertyState.id)
|
|
8110
8110
|
return A.data.globalPropertyState;
|
|
8111
|
-
const e = await
|
|
8111
|
+
const e = await P.getShadowGraphqlClient().mutate({
|
|
8112
8112
|
mutation: Oa,
|
|
8113
8113
|
variables: {
|
|
8114
8114
|
bundleId: this.bundleId
|
|
@@ -8491,7 +8491,7 @@ class pe {
|
|
|
8491
8491
|
"Unable to add transaction to bundle - Already Exists: " + t.filter((i) => !!i).map((i) => i == null ? void 0 : i.getWorkflowManager().getTransaction().id).join(", ")
|
|
8492
8492
|
);
|
|
8493
8493
|
const n = x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), a = e.map((i) => n.get(i));
|
|
8494
|
-
await
|
|
8494
|
+
await P.getShadowGraphqlClient().mutate({
|
|
8495
8495
|
mutation: Ha,
|
|
8496
8496
|
variables: {
|
|
8497
8497
|
id: this.id,
|
|
@@ -8520,7 +8520,7 @@ class pe {
|
|
|
8520
8520
|
))
|
|
8521
8521
|
throw new Error("Unable to add transaction to bundle - Already Exists!");
|
|
8522
8522
|
const i = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(t);
|
|
8523
|
-
await
|
|
8523
|
+
await P.getShadowGraphqlClient().mutate({
|
|
8524
8524
|
mutation: Na,
|
|
8525
8525
|
variables: {
|
|
8526
8526
|
id: this.id,
|
|
@@ -8553,7 +8553,7 @@ class pe {
|
|
|
8553
8553
|
const n = this.workflowExperiences.find(
|
|
8554
8554
|
(a) => a.getWorkflowManager().getTransaction().id === e.id
|
|
8555
8555
|
);
|
|
8556
|
-
this.previewService && n.getWorkflowManager().ejectFromPreviewService(), this.bundleStateManager.removeStateForTransaction(e.id), await
|
|
8556
|
+
this.previewService && n.getWorkflowManager().ejectFromPreviewService(), this.bundleStateManager.removeStateForTransaction(e.id), await P.getShadowGraphqlClient().mutate({
|
|
8557
8557
|
mutation: Ra,
|
|
8558
8558
|
variables: {
|
|
8559
8559
|
id: this.id,
|
|
@@ -8583,7 +8583,7 @@ class pe {
|
|
|
8583
8583
|
1
|
|
8584
8584
|
)[0]
|
|
8585
8585
|
);
|
|
8586
|
-
this.previewService && t.forEach((n) => n.getWorkflowManager().ejectFromPreviewService()), A.forEach((n) => this.bundleStateManager.removeStateForTransaction(n.id)), await
|
|
8586
|
+
this.previewService && t.forEach((n) => n.getWorkflowManager().ejectFromPreviewService()), A.forEach((n) => this.bundleStateManager.removeStateForTransaction(n.id)), await P.getShadowGraphqlClient().mutate({
|
|
8587
8587
|
mutation: Ua,
|
|
8588
8588
|
variables: {
|
|
8589
8589
|
id: this.id,
|
|
@@ -8644,7 +8644,7 @@ class pe {
|
|
|
8644
8644
|
}
|
|
8645
8645
|
async addStakeholder(A, e) {
|
|
8646
8646
|
var a;
|
|
8647
|
-
const t = await
|
|
8647
|
+
const t = await P.getShadowGraphqlClient().mutate({
|
|
8648
8648
|
mutation: Ga,
|
|
8649
8649
|
variables: {
|
|
8650
8650
|
id: this.id,
|
|
@@ -8662,7 +8662,7 @@ class pe {
|
|
|
8662
8662
|
}
|
|
8663
8663
|
async updateStakeholders(A) {
|
|
8664
8664
|
var n;
|
|
8665
|
-
const e = await
|
|
8665
|
+
const e = await P.getShadowGraphqlClient().mutate({
|
|
8666
8666
|
mutation: va,
|
|
8667
8667
|
variables: {
|
|
8668
8668
|
id: this.id,
|
|
@@ -8678,7 +8678,7 @@ class pe {
|
|
|
8678
8678
|
this.storeStakeholderCustomers(t);
|
|
8679
8679
|
}
|
|
8680
8680
|
async getAllStakeholders() {
|
|
8681
|
-
const A = await
|
|
8681
|
+
const A = await P.getShadowGraphqlClient().query({
|
|
8682
8682
|
query: Ya,
|
|
8683
8683
|
errorPolicy: "all",
|
|
8684
8684
|
variables: {
|
|
@@ -8778,7 +8778,7 @@ class pe {
|
|
|
8778
8778
|
}
|
|
8779
8779
|
async updateBundle() {
|
|
8780
8780
|
var e;
|
|
8781
|
-
if (!((e = (await
|
|
8781
|
+
if (!((e = (await P.getShadowGraphqlClient().mutate({
|
|
8782
8782
|
mutation: Pa,
|
|
8783
8783
|
variables: {
|
|
8784
8784
|
id: this.id,
|
|
@@ -8793,7 +8793,7 @@ class pe {
|
|
|
8793
8793
|
throw new Error("Bundle not found!");
|
|
8794
8794
|
}
|
|
8795
8795
|
async updateTransactionOrder() {
|
|
8796
|
-
await
|
|
8796
|
+
await P.getShadowGraphqlClient().mutate({
|
|
8797
8797
|
mutation: ka,
|
|
8798
8798
|
variables: {
|
|
8799
8799
|
id: this.id,
|
|
@@ -8827,7 +8827,7 @@ class pe {
|
|
|
8827
8827
|
);
|
|
8828
8828
|
}
|
|
8829
8829
|
}
|
|
8830
|
-
const $a =
|
|
8830
|
+
const $a = F`
|
|
8831
8831
|
mutation processFlowCreate($processFlowId: String!, $inputs: [String]!) {
|
|
8832
8832
|
processExecutionCreate(processFlowId: $processFlowId, inputs: $inputs) {
|
|
8833
8833
|
id
|
|
@@ -8844,7 +8844,7 @@ class _a {
|
|
|
8844
8844
|
*/
|
|
8845
8845
|
async execute(A, e, t) {
|
|
8846
8846
|
var B, l, d;
|
|
8847
|
-
const a = (l = (B = (await
|
|
8847
|
+
const a = (l = (B = (await P.getShadowGraphqlClient().mutate({
|
|
8848
8848
|
mutation: $a,
|
|
8849
8849
|
variables: {
|
|
8850
8850
|
processFlowId: A,
|
|
@@ -8860,8 +8860,8 @@ class _a {
|
|
|
8860
8860
|
}
|
|
8861
8861
|
let s = !1, o = 0, r, g;
|
|
8862
8862
|
for (; !s; ) {
|
|
8863
|
-
r = await
|
|
8864
|
-
query:
|
|
8863
|
+
r = await P.getShadowGraphqlClient().query({
|
|
8864
|
+
query: F`
|
|
8865
8865
|
query getProcessFlowExecution($ids: [String]!) {
|
|
8866
8866
|
processExecutions(ids: $ids) {
|
|
8867
8867
|
id
|
|
@@ -9029,7 +9029,7 @@ class fe {
|
|
|
9029
9029
|
return new qA(A[0]);
|
|
9030
9030
|
}
|
|
9031
9031
|
}
|
|
9032
|
-
const ni =
|
|
9032
|
+
const ni = F`
|
|
9033
9033
|
fragment RegionFields on Region {
|
|
9034
9034
|
width
|
|
9035
9035
|
top
|
|
@@ -9047,7 +9047,7 @@ const ni = M`
|
|
|
9047
9047
|
height
|
|
9048
9048
|
}
|
|
9049
9049
|
}
|
|
9050
|
-
`, ai =
|
|
9050
|
+
`, ai = F`
|
|
9051
9051
|
fragment LookAtAnimationFields on LookAtAnimation {
|
|
9052
9052
|
latDeg
|
|
9053
9053
|
lonDeg
|
|
@@ -9058,7 +9058,7 @@ const ni = M`
|
|
|
9058
9058
|
z
|
|
9059
9059
|
}
|
|
9060
9060
|
}
|
|
9061
|
-
`, ii =
|
|
9061
|
+
`, ii = F`
|
|
9062
9062
|
fragment RenderingPipelineConfigurationFields on RenderingPipelineConfiguration {
|
|
9063
9063
|
antiAliasing {
|
|
9064
9064
|
samples
|
|
@@ -9142,14 +9142,14 @@ const ni = M`
|
|
|
9142
9142
|
weight
|
|
9143
9143
|
}
|
|
9144
9144
|
}
|
|
9145
|
-
`, si =
|
|
9145
|
+
`, si = F`
|
|
9146
9146
|
fragment ModelAnimationFields on ModelAnimation {
|
|
9147
9147
|
from
|
|
9148
9148
|
to
|
|
9149
9149
|
loop
|
|
9150
9150
|
name
|
|
9151
9151
|
}
|
|
9152
|
-
`, oi = (c) =>
|
|
9152
|
+
`, oi = (c) => F`
|
|
9153
9153
|
${GA(c)}
|
|
9154
9154
|
${ne}
|
|
9155
9155
|
${Oe}
|
|
@@ -9534,7 +9534,7 @@ const ni = M`
|
|
|
9534
9534
|
}
|
|
9535
9535
|
}
|
|
9536
9536
|
}
|
|
9537
|
-
`, ri =
|
|
9537
|
+
`, ri = F`
|
|
9538
9538
|
query GetTransactionForPartner($id: String!) {
|
|
9539
9539
|
transactions(ids: [$id]) {
|
|
9540
9540
|
id
|
|
@@ -9551,7 +9551,25 @@ const ni = M`
|
|
|
9551
9551
|
}
|
|
9552
9552
|
}
|
|
9553
9553
|
}
|
|
9554
|
-
`, ci =
|
|
9554
|
+
`, ci = F`
|
|
9555
|
+
query GetIntegrationWithPartnerAndLogo {
|
|
9556
|
+
currentIntegration {
|
|
9557
|
+
id
|
|
9558
|
+
logo
|
|
9559
|
+
theme {
|
|
9560
|
+
id
|
|
9561
|
+
configuration
|
|
9562
|
+
primaryColor
|
|
9563
|
+
secondaryColor
|
|
9564
|
+
textColor
|
|
9565
|
+
}
|
|
9566
|
+
partner {
|
|
9567
|
+
id
|
|
9568
|
+
name
|
|
9569
|
+
}
|
|
9570
|
+
}
|
|
9571
|
+
}
|
|
9572
|
+
`, gi = F`
|
|
9555
9573
|
${GA(!1)}
|
|
9556
9574
|
query GetWorkflowForTheme($id: String!) {
|
|
9557
9575
|
workflow(id: $id) {
|
|
@@ -9573,7 +9591,7 @@ const ni = M`
|
|
|
9573
9591
|
}
|
|
9574
9592
|
}
|
|
9575
9593
|
}
|
|
9576
|
-
`,
|
|
9594
|
+
`, li = F`
|
|
9577
9595
|
query GetCustomer($emailAddress: String!) {
|
|
9578
9596
|
customer(emailAddress: $emailAddress) {
|
|
9579
9597
|
id
|
|
@@ -9583,7 +9601,7 @@ const ni = M`
|
|
|
9583
9601
|
}
|
|
9584
9602
|
}
|
|
9585
9603
|
}
|
|
9586
|
-
`,
|
|
9604
|
+
`, Bi = F`
|
|
9587
9605
|
mutation CustomerCreate($details: CustomerDetailsInput!) {
|
|
9588
9606
|
customerCreate(details: $details) {
|
|
9589
9607
|
id
|
|
@@ -9593,7 +9611,7 @@ const ni = M`
|
|
|
9593
9611
|
}
|
|
9594
9612
|
}
|
|
9595
9613
|
}
|
|
9596
|
-
`,
|
|
9614
|
+
`, di = F`
|
|
9597
9615
|
mutation CustomerAuthenticate($loginToken: String!) {
|
|
9598
9616
|
customerAuthenticate(loginToken: $loginToken) {
|
|
9599
9617
|
id
|
|
@@ -9620,11 +9638,11 @@ const ni = M`
|
|
|
9620
9638
|
}
|
|
9621
9639
|
}
|
|
9622
9640
|
}
|
|
9623
|
-
`,
|
|
9641
|
+
`, wi = F`
|
|
9624
9642
|
mutation CustomerGenerateVerificationCode($emailAddress: String!) {
|
|
9625
9643
|
customerGenerateVerificationCode(emailAddress: $emailAddress)
|
|
9626
9644
|
}
|
|
9627
|
-
`,
|
|
9645
|
+
`, Ei = F`
|
|
9628
9646
|
mutation CustomerVerifyCode($emailAddress: String!, $verificationCode: String!) {
|
|
9629
9647
|
customerVerifyCode(emailAddress: $emailAddress, verificationCode: $verificationCode) {
|
|
9630
9648
|
id
|
|
@@ -9668,9 +9686,9 @@ const ni = M`
|
|
|
9668
9686
|
(A = i.fontData) != null && A.assetUrl && await Ae(i.fontData.assetUrl);
|
|
9669
9687
|
}
|
|
9670
9688
|
}
|
|
9671
|
-
},
|
|
9689
|
+
}, hi = async (c, A) => {
|
|
9672
9690
|
var n;
|
|
9673
|
-
const e = await
|
|
9691
|
+
const e = await P.getShadowGraphqlClient().query({
|
|
9674
9692
|
query: oi(((n = A == null ? void 0 : A.assets) == null ? void 0 : n.metadata) || !1),
|
|
9675
9693
|
errorPolicy: "all",
|
|
9676
9694
|
fetchPolicy: "no-cache",
|
|
@@ -9688,7 +9706,7 @@ const ni = M`
|
|
|
9688
9706
|
}), cA.set({ id: i.option.id }, Promise.resolve(i.option)));
|
|
9689
9707
|
});
|
|
9690
9708
|
}), t;
|
|
9691
|
-
},
|
|
9709
|
+
}, Ci = async (c, A) => {
|
|
9692
9710
|
const t = (await A).find((n) => n.id === c);
|
|
9693
9711
|
if (!t)
|
|
9694
9712
|
throw new Error(`Workflow not found: ${c}`);
|
|
@@ -9697,11 +9715,11 @@ const ni = M`
|
|
|
9697
9715
|
const e = c.map((s) => cA.get({ id: s, options: A })), t = c.filter((s, o) => e[o] === void 0);
|
|
9698
9716
|
if (t.length === 0)
|
|
9699
9717
|
return Promise.all(e);
|
|
9700
|
-
const n =
|
|
9701
|
-
(s) => cA.set({ id: s, options: A },
|
|
9718
|
+
const n = hi(t, A), a = t.map(
|
|
9719
|
+
(s) => cA.set({ id: s, options: A }, Ci(s, n))
|
|
9702
9720
|
), i = e.filter((s) => s !== void 0);
|
|
9703
9721
|
return await Promise.all(i.concat(a));
|
|
9704
|
-
}, QA = async (c, A) => (await lt([c], A))[0],
|
|
9722
|
+
}, QA = async (c, A) => (await lt([c], A))[0], Qi = (c) => c.sort((A, e) => A.index - e.index).map((A) => ({
|
|
9705
9723
|
id: J(),
|
|
9706
9724
|
panelId: A.name,
|
|
9707
9725
|
name: A.name,
|
|
@@ -9716,13 +9734,13 @@ const ni = M`
|
|
|
9716
9734
|
editableArea: A.editableArea
|
|
9717
9735
|
})), TA = (c, A) => {
|
|
9718
9736
|
const e = c.workflowState, t = e ? JSON.parse(e) : void 0;
|
|
9719
|
-
return t ? Object.values(t.layouts).map((n) => n.layout) :
|
|
9737
|
+
return t ? Object.values(t.layouts).map((n) => n.layout) : Qi(A.panels);
|
|
9720
9738
|
};
|
|
9721
|
-
class
|
|
9739
|
+
class ui {
|
|
9722
9740
|
constructor(A) {
|
|
9723
9741
|
this.updateTransactionState = async (e) => {
|
|
9724
9742
|
try {
|
|
9725
|
-
return
|
|
9743
|
+
return P.getShadowGraphqlClient().mutate({
|
|
9726
9744
|
...e,
|
|
9727
9745
|
mutation: rn
|
|
9728
9746
|
});
|
|
@@ -9748,6 +9766,12 @@ class Qi {
|
|
|
9748
9766
|
throw new Error("Application key required to use Flow Service.");
|
|
9749
9767
|
return new _a();
|
|
9750
9768
|
}
|
|
9769
|
+
async getIntegration() {
|
|
9770
|
+
return (await P.getShadowGraphqlClient().query({
|
|
9771
|
+
query: ci,
|
|
9772
|
+
errorPolicy: "all"
|
|
9773
|
+
})).data.currentIntegration;
|
|
9774
|
+
}
|
|
9751
9775
|
// TODO: Authentication functions should probably be moved to a separate class.
|
|
9752
9776
|
/**
|
|
9753
9777
|
* Attempts to load persisted authentication information from local storage, and authenticate with the Spiff Commerce API.
|
|
@@ -9790,7 +9814,7 @@ class Qi {
|
|
|
9790
9814
|
*/
|
|
9791
9815
|
async authenticateTransactionFromLocalStorage(A) {
|
|
9792
9816
|
var g, B, l, d, w, h;
|
|
9793
|
-
const e =
|
|
9817
|
+
const e = P.getShadowGraphqlClient(), t = await e.query({
|
|
9794
9818
|
query: ri,
|
|
9795
9819
|
errorPolicy: "all",
|
|
9796
9820
|
fetchPolicy: "no-cache",
|
|
@@ -9831,7 +9855,7 @@ class Qi {
|
|
|
9831
9855
|
}
|
|
9832
9856
|
}
|
|
9833
9857
|
const r = (await e.query({
|
|
9834
|
-
query:
|
|
9858
|
+
query: gi,
|
|
9835
9859
|
errorPolicy: "all",
|
|
9836
9860
|
variables: {
|
|
9837
9861
|
id: n.workflowId
|
|
@@ -9866,8 +9890,8 @@ class Qi {
|
|
|
9866
9890
|
async getOrCreateCustomer(A) {
|
|
9867
9891
|
var i;
|
|
9868
9892
|
this.customer = void 0;
|
|
9869
|
-
const e =
|
|
9870
|
-
query:
|
|
9893
|
+
const e = P.getShadowGraphqlClient(), n = (await e.query({
|
|
9894
|
+
query: li,
|
|
9871
9895
|
errorPolicy: "all",
|
|
9872
9896
|
fetchPolicy: "no-cache",
|
|
9873
9897
|
variables: {
|
|
@@ -9876,7 +9900,7 @@ class Qi {
|
|
|
9876
9900
|
})).data.customer;
|
|
9877
9901
|
if (!n.id) {
|
|
9878
9902
|
const o = (i = (await e.mutate({
|
|
9879
|
-
mutation:
|
|
9903
|
+
mutation: Bi,
|
|
9880
9904
|
errorPolicy: "all",
|
|
9881
9905
|
fetchPolicy: "no-cache",
|
|
9882
9906
|
variables: {
|
|
@@ -9901,14 +9925,14 @@ class Qi {
|
|
|
9901
9925
|
}
|
|
9902
9926
|
async authenticateCustomerId(A) {
|
|
9903
9927
|
var s;
|
|
9904
|
-
const e =
|
|
9928
|
+
const e = P.getShadowGraphqlClient(), t = x.getMap("customerTokens");
|
|
9905
9929
|
if (!(t != null && t.has(A)))
|
|
9906
9930
|
return !1;
|
|
9907
9931
|
const n = t.get(A);
|
|
9908
9932
|
if (!n)
|
|
9909
9933
|
return !1;
|
|
9910
9934
|
const i = (s = (await e.mutate({
|
|
9911
|
-
mutation:
|
|
9935
|
+
mutation: di,
|
|
9912
9936
|
errorPolicy: "all",
|
|
9913
9937
|
fetchPolicy: "no-cache",
|
|
9914
9938
|
variables: {
|
|
@@ -9922,8 +9946,8 @@ class Qi {
|
|
|
9922
9946
|
* @param emailAddress The email address to generate a verification code for. The user will be sent an email with the verification code.
|
|
9923
9947
|
*/
|
|
9924
9948
|
async generateVerificationCode(A) {
|
|
9925
|
-
await
|
|
9926
|
-
mutation:
|
|
9949
|
+
await P.getShadowGraphqlClient().mutate({
|
|
9950
|
+
mutation: wi,
|
|
9927
9951
|
variables: {
|
|
9928
9952
|
emailAddress: A
|
|
9929
9953
|
}
|
|
@@ -9937,8 +9961,8 @@ class Qi {
|
|
|
9937
9961
|
*/
|
|
9938
9962
|
async verifyCode(A, e) {
|
|
9939
9963
|
var a, i;
|
|
9940
|
-
const n = (a = (await
|
|
9941
|
-
mutation:
|
|
9964
|
+
const n = (a = (await P.getShadowGraphqlClient().mutate({
|
|
9965
|
+
mutation: Ei,
|
|
9942
9966
|
errorPolicy: "all",
|
|
9943
9967
|
fetchPolicy: "no-cache",
|
|
9944
9968
|
variables: {
|
|
@@ -9963,7 +9987,7 @@ class Qi {
|
|
|
9963
9987
|
*/
|
|
9964
9988
|
async getNewBundle(A, e) {
|
|
9965
9989
|
var s;
|
|
9966
|
-
const n = (s = (await
|
|
9990
|
+
const n = (s = (await P.getShadowGraphqlClient().mutate({
|
|
9967
9991
|
mutation: xa,
|
|
9968
9992
|
variables: {
|
|
9969
9993
|
collectionId: A,
|
|
@@ -9987,7 +10011,7 @@ class Qi {
|
|
|
9987
10011
|
*/
|
|
9988
10012
|
async getExistingBundle(A, e, t) {
|
|
9989
10013
|
var g, B, l, d;
|
|
9990
|
-
const n = x.getMap("bundleOwnerIds"), a = n == null ? void 0 : n.get(A), i = await
|
|
10014
|
+
const n = x.getMap("bundleOwnerIds"), a = n == null ? void 0 : n.get(A), i = await P.getShadowGraphqlClient().query({
|
|
9991
10015
|
query: ya,
|
|
9992
10016
|
variables: {
|
|
9993
10017
|
id: A
|
|
@@ -10012,7 +10036,7 @@ class Qi {
|
|
|
10012
10036
|
var a;
|
|
10013
10037
|
if (!this.customer)
|
|
10014
10038
|
throw new Error("Customer not authenticated.");
|
|
10015
|
-
const A = await
|
|
10039
|
+
const A = await P.getShadowGraphqlClient().query({
|
|
10016
10040
|
query: Sa,
|
|
10017
10041
|
variables: {
|
|
10018
10042
|
id: this.customer.id
|
|
@@ -10041,7 +10065,7 @@ class Qi {
|
|
|
10041
10065
|
return await this.getWorkflowExperienceDeprecated(A, e, t);
|
|
10042
10066
|
const a = async () => {
|
|
10043
10067
|
var Q, C;
|
|
10044
|
-
const E =
|
|
10068
|
+
const E = P.getShadowGraphqlClient();
|
|
10045
10069
|
if (n.type === "transaction") {
|
|
10046
10070
|
const { transactionId: f, readOnly: u } = n, m = await E.query({
|
|
10047
10071
|
query: BA,
|
|
@@ -10066,7 +10090,7 @@ class Qi {
|
|
|
10066
10090
|
const p = n.type === "integration" ? { integrationProductId: n.integrationProductId } : {
|
|
10067
10091
|
externalIntegrationId: n.externalIntegrationId,
|
|
10068
10092
|
externalProductId: n.externalProductId
|
|
10069
|
-
},
|
|
10093
|
+
}, M = await E.mutate({
|
|
10070
10094
|
mutation: Qe,
|
|
10071
10095
|
variables: {
|
|
10072
10096
|
...p,
|
|
@@ -10078,9 +10102,9 @@ class Qi {
|
|
|
10078
10102
|
// TODO: this should be changed to required once the API is updated. Should this also be moved to server.ts?
|
|
10079
10103
|
context: this.options.applicationKey ? { headers: { "X-Application-Key": this.options.applicationKey } } : void 0
|
|
10080
10104
|
});
|
|
10081
|
-
if (!
|
|
10105
|
+
if (!M.data || !M.data.transactionCreate)
|
|
10082
10106
|
throw new U("Failed to create transaction!");
|
|
10083
|
-
const y =
|
|
10107
|
+
const y = M.data.transactionCreate;
|
|
10084
10108
|
if (!y.product)
|
|
10085
10109
|
throw new U("Failed to create transaction, product not available.");
|
|
10086
10110
|
return y;
|
|
@@ -10142,7 +10166,7 @@ class Qi {
|
|
|
10142
10166
|
async getWorkflowExperiences(A, e) {
|
|
10143
10167
|
if (A.length === 0)
|
|
10144
10168
|
throw new U("No options provided!");
|
|
10145
|
-
const t =
|
|
10169
|
+
const t = P.getShadowGraphqlClient(), n = async (m) => {
|
|
10146
10170
|
var y, S;
|
|
10147
10171
|
if (m.length === 0)
|
|
10148
10172
|
return [];
|
|
@@ -10153,22 +10177,22 @@ class Qi {
|
|
|
10153
10177
|
},
|
|
10154
10178
|
errorPolicy: "all",
|
|
10155
10179
|
fetchPolicy: "no-cache"
|
|
10156
|
-
}),
|
|
10157
|
-
if (
|
|
10180
|
+
}), M = p.data.transactions;
|
|
10181
|
+
if (M.length !== m.length) {
|
|
10158
10182
|
const Y = ((S = (y = p.errors) == null ? void 0 : y[0]) == null ? void 0 : S.message) || "Unknown error";
|
|
10159
10183
|
throw new U(`Not all transactions were found: ${Y}`);
|
|
10160
10184
|
}
|
|
10161
|
-
return
|
|
10185
|
+
return M.map((Y, N) => {
|
|
10162
10186
|
var H;
|
|
10163
10187
|
return {
|
|
10164
10188
|
transaction: Y,
|
|
10165
10189
|
workflowId: Y.workflowId,
|
|
10166
10190
|
readOnly: ((H = m.find((T) => T.option.transactionId === Y.id)) == null ? void 0 : H.option.readOnly) ?? !1,
|
|
10167
|
-
index: m[
|
|
10191
|
+
index: m[N].index
|
|
10168
10192
|
};
|
|
10169
10193
|
});
|
|
10170
10194
|
}, a = async (m) => {
|
|
10171
|
-
var
|
|
10195
|
+
var M, y, S;
|
|
10172
10196
|
if (m.length === 0)
|
|
10173
10197
|
return [];
|
|
10174
10198
|
const I = await t.mutate({
|
|
@@ -10184,16 +10208,16 @@ class Qi {
|
|
|
10184
10208
|
},
|
|
10185
10209
|
errorPolicy: "all",
|
|
10186
10210
|
fetchPolicy: "no-cache"
|
|
10187
|
-
}), p = (
|
|
10211
|
+
}), p = (M = I.data) == null ? void 0 : M.transactionCreateMany;
|
|
10188
10212
|
if (!p || p.length === 0) {
|
|
10189
10213
|
const Y = ((S = (y = I.errors) == null ? void 0 : y[0]) == null ? void 0 : S.message) || "Unknown error";
|
|
10190
10214
|
throw new U(`Failed to create transactions: ${Y}`);
|
|
10191
10215
|
}
|
|
10192
|
-
return p.map((Y,
|
|
10216
|
+
return p.map((Y, N) => ({
|
|
10193
10217
|
transaction: Y,
|
|
10194
10218
|
workflowId: Y.workflowId,
|
|
10195
10219
|
readOnly: !1,
|
|
10196
|
-
index: m[
|
|
10220
|
+
index: m[N].index
|
|
10197
10221
|
}));
|
|
10198
10222
|
}, i = A.map((m, I) => ({ option: m, index: I })), s = i.filter((m) => m.option.type === "transaction"), o = i.filter(
|
|
10199
10223
|
(m) => m.option.type === "integration" || m.option.type === "external"
|
|
@@ -10202,24 +10226,24 @@ class Qi {
|
|
|
10202
10226
|
...g.map(a)
|
|
10203
10227
|
])).flat(), l = [...new Set(B.map((m) => m.workflowId))], d = await lt(l, e), w = new Map(d.map((m) => [m.id, m])), h = x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map(), E = B.map(async (m) => {
|
|
10204
10228
|
var T;
|
|
10205
|
-
const { transaction: I, workflowId: p, readOnly:
|
|
10229
|
+
const { transaction: I, workflowId: p, readOnly: M, index: y } = m, S = w.get(p), Y = A[y];
|
|
10206
10230
|
!h.get(I.id) && I.transactionOwnerId && h.set(I.id, I.transactionOwnerId);
|
|
10207
|
-
const
|
|
10231
|
+
const N = h.get(I.id) || void 0, H = {
|
|
10208
10232
|
product: I.product,
|
|
10209
10233
|
transaction: I,
|
|
10210
10234
|
layouts: [],
|
|
10211
10235
|
singleVariantsRenderable: (T = Y == null ? void 0 : Y.workflowConfiguration) == null ? void 0 : T.singleVariantsRenderable,
|
|
10212
|
-
stateMutationFunc:
|
|
10236
|
+
stateMutationFunc: M ? async () => {
|
|
10213
10237
|
throw new k("State mutation is forbidden in read only mode!");
|
|
10214
|
-
} : async (b) => this.updateTransactionState({ ...b, context: { transactionOwnerId:
|
|
10215
|
-
readOnly:
|
|
10238
|
+
} : async (b) => this.updateTransactionState({ ...b, context: { transactionOwnerId: N } }),
|
|
10239
|
+
readOnly: M,
|
|
10216
10240
|
workflow: S,
|
|
10217
10241
|
isReloadedTransaction: Y.type === "transaction"
|
|
10218
10242
|
};
|
|
10219
10243
|
if (Y.type === "transaction" && I.workflowState) {
|
|
10220
10244
|
const b = JSON.parse(I.workflowState);
|
|
10221
10245
|
H.layouts = Object.values(b.layouts).map((V) => V.layout), await _(b), await AA(b), H.reloadedState = b;
|
|
10222
|
-
} else if (!
|
|
10246
|
+
} else if (!M && Y.workflowState) {
|
|
10223
10247
|
const b = JSON.parse(Y.workflowState);
|
|
10224
10248
|
H.layouts = Object.values(b.layouts).map((V) => V.layout), await _(b), await AA(b), H.reloadedState = b;
|
|
10225
10249
|
} else
|
|
@@ -10233,8 +10257,8 @@ class Qi {
|
|
|
10233
10257
|
});
|
|
10234
10258
|
x.setMap("transactionOwnerIds", h);
|
|
10235
10259
|
const f = (await Promise.all(E)).sort((m, I) => m.index - I.index).map(async (m) => {
|
|
10236
|
-
const { experienceOptions: I, options: p } = m,
|
|
10237
|
-
return await
|
|
10260
|
+
const { experienceOptions: I, options: p } = m, M = new EA(this, I);
|
|
10261
|
+
return await M.getWorkflowManager().getInitializationPromise(), p.type !== "transaction" && this.customer && await M.attachCustomerDetails({ email: this.customer.emailAddress }), M;
|
|
10238
10262
|
}), u = await Promise.all(f);
|
|
10239
10263
|
return u.forEach((m) => m.getWorkflowManager().setWorkflowStateSyncEnabled(!0)), u;
|
|
10240
10264
|
}
|
|
@@ -10247,7 +10271,7 @@ class Qi {
|
|
|
10247
10271
|
var i;
|
|
10248
10272
|
if (A === "")
|
|
10249
10273
|
throw new U("No integration product ID provided.");
|
|
10250
|
-
const t = await
|
|
10274
|
+
const t = await P.getShadowGraphqlClient().mutate({
|
|
10251
10275
|
mutation: Qe,
|
|
10252
10276
|
variables: {
|
|
10253
10277
|
integrationProductId: A,
|
|
@@ -10285,7 +10309,7 @@ class Qi {
|
|
|
10285
10309
|
var s, o, r, g;
|
|
10286
10310
|
if (A === "")
|
|
10287
10311
|
throw new U("No transaction ID provided.");
|
|
10288
|
-
const t =
|
|
10312
|
+
const t = P.getShadowGraphqlClient(), n = async () => {
|
|
10289
10313
|
var d, w;
|
|
10290
10314
|
const l = (d = (await t.query({
|
|
10291
10315
|
query: BA,
|
|
@@ -10376,7 +10400,7 @@ class Qi {
|
|
|
10376
10400
|
return await r.getWorkflowManager().getInitializationPromise(), r;
|
|
10377
10401
|
}
|
|
10378
10402
|
if (A) {
|
|
10379
|
-
const r = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(this.experienceOptions.transaction.id), g =
|
|
10403
|
+
const r = (x.getMap("transactionOwnerIds") || /* @__PURE__ */ new Map()).get(this.experienceOptions.transaction.id), g = P.getShadowGraphqlClient().mutate({
|
|
10380
10404
|
mutation: cn,
|
|
10381
10405
|
variables: {
|
|
10382
10406
|
workflowId: A,
|
|
@@ -10435,7 +10459,7 @@ class Qi {
|
|
|
10435
10459
|
}
|
|
10436
10460
|
async getIntegrationProductById(A) {
|
|
10437
10461
|
var a, i;
|
|
10438
|
-
const n = (a = (await
|
|
10462
|
+
const n = (a = (await P.getShadowGraphqlClient().query({
|
|
10439
10463
|
query: gn,
|
|
10440
10464
|
variables: {
|
|
10441
10465
|
ids: [A]
|
|
@@ -10449,7 +10473,7 @@ class Qi {
|
|
|
10449
10473
|
}
|
|
10450
10474
|
async getIntegrationProductFromExternalIds(A, e) {
|
|
10451
10475
|
var i;
|
|
10452
|
-
const a = (i = (await
|
|
10476
|
+
const a = (i = (await P.getShadowGraphqlClient().query({
|
|
10453
10477
|
query: ln,
|
|
10454
10478
|
variables: {
|
|
10455
10479
|
externalProductId: e,
|
|
@@ -10463,7 +10487,7 @@ class Qi {
|
|
|
10463
10487
|
return new fe(a);
|
|
10464
10488
|
}
|
|
10465
10489
|
}
|
|
10466
|
-
class
|
|
10490
|
+
class Gi {
|
|
10467
10491
|
getInitializationPromise() {
|
|
10468
10492
|
return Promise.resolve();
|
|
10469
10493
|
}
|
|
@@ -10588,8 +10612,8 @@ class Ui {
|
|
|
10588
10612
|
setWorkflowStateSyncEnabled(A) {
|
|
10589
10613
|
}
|
|
10590
10614
|
}
|
|
10591
|
-
var
|
|
10592
|
-
class
|
|
10615
|
+
var mi = /* @__PURE__ */ ((c) => (c.SelectFrame = "SelectFrame", c.SelectImage = "SelectImage", c.Position = "Position", c))(mi || {});
|
|
10616
|
+
class Ii extends W {
|
|
10593
10617
|
constructor(A, e) {
|
|
10594
10618
|
var t;
|
|
10595
10619
|
super(A, e), this.frameService = (t = this.manager.getStepSpecificServices(this.getId())) == null ? void 0 : t.frameService;
|
|
@@ -10631,43 +10655,43 @@ class mi extends W {
|
|
|
10631
10655
|
}
|
|
10632
10656
|
export {
|
|
10633
10657
|
$ as AssetNotFoundError,
|
|
10634
|
-
|
|
10635
|
-
|
|
10636
|
-
|
|
10637
|
-
|
|
10638
|
-
|
|
10658
|
+
Ji as AssetType,
|
|
10659
|
+
bi as BringForwardCommand,
|
|
10660
|
+
Li as BringToBackCommand,
|
|
10661
|
+
Ti as BringToFrontCommand,
|
|
10662
|
+
Oi as CanvasCommand,
|
|
10639
10663
|
Xa as CollectionProduct,
|
|
10640
|
-
|
|
10664
|
+
zi as CommandContext,
|
|
10641
10665
|
an as ConversionDataType,
|
|
10642
10666
|
nn as ConversionLocation,
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10667
|
+
Ki as CreateElementCommand,
|
|
10668
|
+
ji as CreateLayoutCommand,
|
|
10669
|
+
Vi as DeleteElementCommand,
|
|
10646
10670
|
CA as FlowExecutionNodeResult,
|
|
10647
10671
|
Ai as FlowExecutionResult,
|
|
10648
10672
|
_a as FlowService,
|
|
10649
|
-
|
|
10650
|
-
|
|
10651
|
-
|
|
10652
|
-
|
|
10673
|
+
Wi as FontAlignmentCommand,
|
|
10674
|
+
Xi as FontColorCommand,
|
|
10675
|
+
qi as FontSizeCommand,
|
|
10676
|
+
Zi as FontSourceCommand,
|
|
10653
10677
|
Cn as FrameService,
|
|
10654
|
-
|
|
10655
|
-
|
|
10678
|
+
mi as FrameStep,
|
|
10679
|
+
Ii as FrameStepHandle,
|
|
10656
10680
|
re as GlobalPropertyHandle,
|
|
10657
|
-
|
|
10681
|
+
$i as GroupCommand,
|
|
10658
10682
|
Vn as IllustrationStepHandle,
|
|
10659
10683
|
PA as InformationMessageType,
|
|
10660
10684
|
Aa as InformationStepHandle,
|
|
10661
10685
|
fe as IntegrationProduct,
|
|
10662
10686
|
en as IntegrationType,
|
|
10663
|
-
|
|
10664
|
-
|
|
10687
|
+
_i as LayoutElementFactory,
|
|
10688
|
+
As as LayoutElementType,
|
|
10665
10689
|
z as LayoutNotFoundError,
|
|
10666
10690
|
Wn as MaterialStepHandle,
|
|
10667
10691
|
MA as MisconfigurationError,
|
|
10668
|
-
|
|
10692
|
+
Gi as MockWorkflowManager,
|
|
10669
10693
|
Xn as ModelStepHandle,
|
|
10670
|
-
|
|
10694
|
+
es as MoveCommand,
|
|
10671
10695
|
gt as ObjectInput,
|
|
10672
10696
|
ti as ObjectInputType,
|
|
10673
10697
|
FA as OptionNotFoundError,
|
|
@@ -10680,63 +10704,63 @@ export {
|
|
|
10680
10704
|
Ve as PromiseQueue,
|
|
10681
10705
|
Zn as QuestionStepHandle,
|
|
10682
10706
|
je as QueueablePromise,
|
|
10683
|
-
|
|
10707
|
+
ts as ResizeCommand,
|
|
10684
10708
|
rA as ResourceNotFoundError,
|
|
10685
|
-
|
|
10686
|
-
|
|
10709
|
+
ns as RotateCommand,
|
|
10710
|
+
as as SendBackwardsCommand,
|
|
10687
10711
|
$n as ShapeStepHandle,
|
|
10688
|
-
|
|
10712
|
+
ui as SpiffCommerceClient,
|
|
10689
10713
|
YA as StakeholderType,
|
|
10690
|
-
|
|
10714
|
+
is as StepAspectType,
|
|
10691
10715
|
W as StepHandle,
|
|
10692
|
-
|
|
10693
|
-
|
|
10716
|
+
ss as StepType,
|
|
10717
|
+
os as TextChangeCommand,
|
|
10694
10718
|
_n as TextStepHandle,
|
|
10695
10719
|
Za as Transform,
|
|
10696
10720
|
qa as TransformCollection,
|
|
10697
10721
|
k as UnhandledBehaviorError,
|
|
10698
|
-
|
|
10722
|
+
rs as UnitOfMeasurement,
|
|
10699
10723
|
X as Variant,
|
|
10700
10724
|
EA as WorkflowExperienceImpl,
|
|
10701
10725
|
O as assetService,
|
|
10702
10726
|
sa as createDesign,
|
|
10703
|
-
|
|
10727
|
+
cs as dataUrlFromExternalUrl,
|
|
10704
10728
|
LA as designService,
|
|
10705
|
-
|
|
10729
|
+
gs as determineCorrectFontSizeAndLines,
|
|
10706
10730
|
mn as digitalContentStepService,
|
|
10707
|
-
|
|
10708
|
-
|
|
10731
|
+
ls as findElement,
|
|
10732
|
+
Bs as frameDataCache,
|
|
10709
10733
|
VA as frameStepService,
|
|
10710
|
-
|
|
10734
|
+
ds as generate,
|
|
10711
10735
|
ma as generateCommands,
|
|
10712
|
-
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
10736
|
+
ws as generateSVGWithUnknownColors,
|
|
10737
|
+
Ui as generateStateFromDesignInputSteps,
|
|
10738
|
+
Es as getAttributesFromArrayBuffer,
|
|
10739
|
+
hs as getAxisAlignedBoundingBox,
|
|
10716
10740
|
hn as getBoundedOffsets,
|
|
10717
|
-
|
|
10718
|
-
|
|
10741
|
+
Cs as getFrameData,
|
|
10742
|
+
Qs as getSvgElement,
|
|
10719
10743
|
QA as getWorkflow,
|
|
10720
10744
|
lt as getWorkflows,
|
|
10721
|
-
|
|
10745
|
+
P as graphQlManager,
|
|
10722
10746
|
IA as illustrationStepService,
|
|
10723
|
-
|
|
10747
|
+
us as loadFont,
|
|
10724
10748
|
Xe as materialStepService,
|
|
10725
10749
|
qe as modelStepService,
|
|
10726
10750
|
Mn as moduleStepService,
|
|
10727
10751
|
j as optionService,
|
|
10728
|
-
|
|
10752
|
+
ms as patternImageDataCache,
|
|
10729
10753
|
x as persistenceService,
|
|
10730
10754
|
Ze as pictureStepService,
|
|
10731
10755
|
$e as questionStepService,
|
|
10732
|
-
|
|
10733
|
-
|
|
10734
|
-
|
|
10735
|
-
|
|
10756
|
+
Is as registerFetchImplementation,
|
|
10757
|
+
ps as registerWindowImplementation,
|
|
10758
|
+
fs as rehydrateSerializedLayout,
|
|
10759
|
+
Ds as setCanvasModule,
|
|
10736
10760
|
oA as shapeStepService,
|
|
10737
10761
|
Qn as shortenUrl,
|
|
10738
10762
|
yA as spiffCoreConfiguration,
|
|
10739
|
-
|
|
10763
|
+
Ri as stepAspectValuesToDesignInputSteps,
|
|
10740
10764
|
K as textStepService,
|
|
10741
10765
|
Pn as toast
|
|
10742
10766
|
};
|