@spiffcommerce/core 15.3.0 → 15.3.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/main.js +2 -7
- package/dist/module.js +2 -7
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -931,14 +931,9 @@ var t=require("@apollo/client"),e=require("lodash.clonedeep"),i=require("react/j
|
|
|
931
931
|
mutation processFlowCreate($processFlowId: String!, $inputs: [String]!) {
|
|
932
932
|
processExecutionCreate(processFlowId: $processFlowId, inputs: $inputs) {
|
|
933
933
|
id
|
|
934
|
-
nodes {
|
|
935
|
-
id
|
|
936
|
-
type
|
|
937
|
-
artifacts
|
|
938
|
-
}
|
|
939
934
|
}
|
|
940
935
|
}
|
|
941
|
-
`;let Jc;var Lc;(Lc=Jc||(Jc={})).Split="Split",Lc.TextJoin="TextJoin",Lc.TextSlice="TextSlice",Lc.TextUpper="TextUpper",Lc.TextLower="TextLower",Lc.ParseJson="ParseJson",Lc.TextBuilder="TextBuilder",Lc.Design="Design",Lc.OverlayImage="OverlayImage",Lc.OverlayText="OverlayText",Lc.TableGenerator="TableGenerator",Lc.QR="QR",Lc.CSV="CSV",Lc.PDF="PDF",Lc.PNG="PNG",Lc.Email="Email",Lc.LocationDelivery="LocationDelivery",Lc.TemplateEmail="TemplateEmail",Lc.Map="Map",Lc.Sort="Sort",Lc.Group="Group",Lc.InnerJoin="InnerJoin",Lc.Contains="Contains",Lc.Flatten="Flatten",Lc.KeyValuePairs="KeyValuePairs",Lc.ListConcatenate="ListConcatenate",Lc.Repeat="Repeat",Lc.Size="Size",Lc.ListBuilder="ListBuilder",Lc.MapBuilder="MapBuilder",Lc.PairBuilder="PairBuilder",Lc.AND="AND",Lc.OR="OR",Lc.NOT="NOT",Lc.Equals="Equals",Lc.Present="Present",Lc.ManualOperation="ManualOperation",Lc.Switch="Switch",Lc.AssetMetadata="AssetMetadata",Lc.DataSelect="DataSelect",Lc.LayoutSelect="LayoutSelect",Lc.TransactionMetadata="TransactionMetadata",Lc.VariantSelection="VariantSelection",Lc.StartTerminal="StartTerminal",Lc.EndTerminal="EndTerminal",Lc.MiscNote="MiscNote",Lc.Assign="Assign",Lc.CsvVlookup="CsvVlookup",Lc.ProcessFlow="ProcessFlow",Lc.TemporaryAssetUrl="TemporaryAssetUrl",Lc.WebRequest="WebRequest";class zc{async execute(e,i,n){
|
|
936
|
+
`;let Jc;var Lc;(Lc=Jc||(Jc={})).Split="Split",Lc.TextJoin="TextJoin",Lc.TextSlice="TextSlice",Lc.TextUpper="TextUpper",Lc.TextLower="TextLower",Lc.ParseJson="ParseJson",Lc.TextBuilder="TextBuilder",Lc.Design="Design",Lc.OverlayImage="OverlayImage",Lc.OverlayText="OverlayText",Lc.TableGenerator="TableGenerator",Lc.QR="QR",Lc.CSV="CSV",Lc.PDF="PDF",Lc.PNG="PNG",Lc.Email="Email",Lc.LocationDelivery="LocationDelivery",Lc.TemplateEmail="TemplateEmail",Lc.Map="Map",Lc.Sort="Sort",Lc.Group="Group",Lc.InnerJoin="InnerJoin",Lc.Contains="Contains",Lc.Flatten="Flatten",Lc.KeyValuePairs="KeyValuePairs",Lc.ListConcatenate="ListConcatenate",Lc.Repeat="Repeat",Lc.Size="Size",Lc.ListBuilder="ListBuilder",Lc.MapBuilder="MapBuilder",Lc.PairBuilder="PairBuilder",Lc.AND="AND",Lc.OR="OR",Lc.NOT="NOT",Lc.Equals="Equals",Lc.Present="Present",Lc.ManualOperation="ManualOperation",Lc.Switch="Switch",Lc.AssetMetadata="AssetMetadata",Lc.DataSelect="DataSelect",Lc.LayoutSelect="LayoutSelect",Lc.TransactionMetadata="TransactionMetadata",Lc.VariantSelection="VariantSelection",Lc.StartTerminal="StartTerminal",Lc.EndTerminal="EndTerminal",Lc.MiscNote="MiscNote",Lc.Assign="Assign",Lc.CsvVlookup="CsvVlookup",Lc.ProcessFlow="ProcessFlow",Lc.TemporaryAssetUrl="TemporaryAssetUrl",Lc.WebRequest="WebRequest";class zc{async execute(e,i,n){const A=(await Ia.getShadowGraphqlClient().mutate({mutation:Oc,variables:{processFlowId:e,inputs:[...i.map((t=>t.getValueForTransmission()))]}})).data?.processExecutionCreate?.id;if(!A)throw new Error("Failed to create process execution.");function a(t){return new Promise((e=>{setTimeout(e,t)}))}let r,o=!1,s=0;for(;!o;){if(await a(n?.sleepTime?Math.max(n.sleepTime,500):2e3),r=await Ia.getShadowGraphqlClient().query({query:t.gql`
|
|
942
937
|
query getProcessFlowExecution($ids: [String]!) {
|
|
943
938
|
processExecutions(ids: $ids) {
|
|
944
939
|
id
|
|
@@ -951,7 +946,7 @@ var t=require("@apollo/client"),e=require("lodash.clonedeep"),i=require("react/j
|
|
|
951
946
|
}
|
|
952
947
|
}
|
|
953
948
|
}
|
|
954
|
-
`,variables:{ids:[
|
|
949
|
+
`,variables:{ids:[A]}}),!r||!r.data?.getProcessFlowExecution)throw new Error("Failed to retrieve server response for execution.");const e=r.data?.getProcessFlowExecution?.completedAt;if(e){o=!0;break}if(r.data?.getProcessFlowExecution?.failedAt)throw new Error("Execution has failed to complete. See Executions tab in partner account on SpiffCommerce Hub.");s+=1;if(s>=(n?.repeats?n?.repeats:5))throw new Error("Maximum wait time exceeded for execution result.")}return Promise.resolve(new jc(r.data?.getProcessFlowExecution))}}class jc{constructor(t){Tc(this,"execution",void 0),this.execution=t}getRaw(){return this.execution}getNodes(){return this.execution.nodes.map((t=>new Vc(t)))}getNodesByType(t){return this.execution.nodes.filter((e=>e.type===t)).map((t=>new Vc(t)))}getInputs(){return this.execution.nodes.filter((t=>t.type===Jc.StartTerminal)).map((t=>new Vc(t)))}getOutputs(){return this.execution.nodes.filter((t=>t.type===Jc.EndTerminal)).map((t=>new Vc(t)))}getCompletedAt(){if(this.execution.completedAt)return new Date(this.execution.completedAt)}getFailedAt(){if(this.execution.failedAt)return new Date(this.execution.failedAt)}}class Vc{constructor(t){Tc(this,"node",void 0),this.node=t}getId(){return this.node.id}getType(){return this.node.type}getArtifacts(){return new Map(Object.entries(JSON.parse(this.node.artifacts).value))}getArtifactByName(t){return console.log(this.getArtifacts()),this.getArtifacts().get(t)}}class Kc{constructor(t){Tc(this,"value",void 0),this.value=t}getRaw(){return this.value}getValueForTransmission(){const t=this.value;return t.startsWith("[")?JSON.stringify(JSON.parse(t)):JSON.stringify(t)}}let Wc;var Xc;(Xc=Wc||(Wc={})).Transaction="Transaction",Xc.Bundle="Bundle",Xc.Product="Product",Xc.Variant="Variant",Xc.Option="Option",Xc.LineItem="LineItem",Xc.Asset="Asset";class qc extends Kc{constructor(t,e){if("Asset"!==e&&!qc.validUUID(t))throw new Error("Invalid ID, must be a valid v4 UUID. https://www.uuidgenerator.net/");super(`{"isSpiffObject": true, "id": "${t}", "type": "${e}"}`)}static validUUID(t){return t.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)}}class Zc extends Kc{constructor(t){super(t)}}function $c(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}const _c=t.gql`
|
|
955
950
|
fragment RegionFields on Region {
|
|
956
951
|
width
|
|
957
952
|
top
|
package/dist/module.js
CHANGED
|
@@ -931,14 +931,9 @@ import{CommandContext as t,AssetType as e,BringForwardCommand as A,BringToFrontC
|
|
|
931
931
|
mutation processFlowCreate($processFlowId: String!, $inputs: [String]!) {
|
|
932
932
|
processExecutionCreate(processFlowId: $processFlowId, inputs: $inputs) {
|
|
933
933
|
id
|
|
934
|
-
nodes {
|
|
935
|
-
id
|
|
936
|
-
type
|
|
937
|
-
artifacts
|
|
938
|
-
}
|
|
939
934
|
}
|
|
940
935
|
}
|
|
941
|
-
`;let Li;var Oi;(Oi=Li||(Li={})).Split="Split",Oi.TextJoin="TextJoin",Oi.TextSlice="TextSlice",Oi.TextUpper="TextUpper",Oi.TextLower="TextLower",Oi.ParseJson="ParseJson",Oi.TextBuilder="TextBuilder",Oi.Design="Design",Oi.OverlayImage="OverlayImage",Oi.OverlayText="OverlayText",Oi.TableGenerator="TableGenerator",Oi.QR="QR",Oi.CSV="CSV",Oi.PDF="PDF",Oi.PNG="PNG",Oi.Email="Email",Oi.LocationDelivery="LocationDelivery",Oi.TemplateEmail="TemplateEmail",Oi.Map="Map",Oi.Sort="Sort",Oi.Group="Group",Oi.InnerJoin="InnerJoin",Oi.Contains="Contains",Oi.Flatten="Flatten",Oi.KeyValuePairs="KeyValuePairs",Oi.ListConcatenate="ListConcatenate",Oi.Repeat="Repeat",Oi.Size="Size",Oi.ListBuilder="ListBuilder",Oi.MapBuilder="MapBuilder",Oi.PairBuilder="PairBuilder",Oi.AND="AND",Oi.OR="OR",Oi.NOT="NOT",Oi.Equals="Equals",Oi.Present="Present",Oi.ManualOperation="ManualOperation",Oi.Switch="Switch",Oi.AssetMetadata="AssetMetadata",Oi.DataSelect="DataSelect",Oi.LayoutSelect="LayoutSelect",Oi.TransactionMetadata="TransactionMetadata",Oi.VariantSelection="VariantSelection",Oi.StartTerminal="StartTerminal",Oi.EndTerminal="EndTerminal",Oi.MiscNote="MiscNote",Oi.Assign="Assign",Oi.CsvVlookup="CsvVlookup",Oi.ProcessFlow="ProcessFlow",Oi.TemporaryAssetUrl="TemporaryAssetUrl",Oi.WebRequest="WebRequest";class zi{async execute(t,e,A){
|
|
936
|
+
`;let Li;var Oi;(Oi=Li||(Li={})).Split="Split",Oi.TextJoin="TextJoin",Oi.TextSlice="TextSlice",Oi.TextUpper="TextUpper",Oi.TextLower="TextLower",Oi.ParseJson="ParseJson",Oi.TextBuilder="TextBuilder",Oi.Design="Design",Oi.OverlayImage="OverlayImage",Oi.OverlayText="OverlayText",Oi.TableGenerator="TableGenerator",Oi.QR="QR",Oi.CSV="CSV",Oi.PDF="PDF",Oi.PNG="PNG",Oi.Email="Email",Oi.LocationDelivery="LocationDelivery",Oi.TemplateEmail="TemplateEmail",Oi.Map="Map",Oi.Sort="Sort",Oi.Group="Group",Oi.InnerJoin="InnerJoin",Oi.Contains="Contains",Oi.Flatten="Flatten",Oi.KeyValuePairs="KeyValuePairs",Oi.ListConcatenate="ListConcatenate",Oi.Repeat="Repeat",Oi.Size="Size",Oi.ListBuilder="ListBuilder",Oi.MapBuilder="MapBuilder",Oi.PairBuilder="PairBuilder",Oi.AND="AND",Oi.OR="OR",Oi.NOT="NOT",Oi.Equals="Equals",Oi.Present="Present",Oi.ManualOperation="ManualOperation",Oi.Switch="Switch",Oi.AssetMetadata="AssetMetadata",Oi.DataSelect="DataSelect",Oi.LayoutSelect="LayoutSelect",Oi.TransactionMetadata="TransactionMetadata",Oi.VariantSelection="VariantSelection",Oi.StartTerminal="StartTerminal",Oi.EndTerminal="EndTerminal",Oi.MiscNote="MiscNote",Oi.Assign="Assign",Oi.CsvVlookup="CsvVlookup",Oi.ProcessFlow="ProcessFlow",Oi.TemporaryAssetUrl="TemporaryAssetUrl",Oi.WebRequest="WebRequest";class zi{async execute(t,e,A){const n=(await ye.getShadowGraphqlClient().mutate({mutation:Ti,variables:{processFlowId:t,inputs:[...e.map((t=>t.getValueForTransmission()))]}})).data?.processExecutionCreate?.id;if(!n)throw new Error("Failed to create process execution.");function a(t){return new Promise((e=>{setTimeout(e,t)}))}let i,r=!1,o=0;for(;!r;){if(await a(A?.sleepTime?Math.max(A.sleepTime,500):2e3),i=await ye.getShadowGraphqlClient().query({query:It`
|
|
942
937
|
query getProcessFlowExecution($ids: [String]!) {
|
|
943
938
|
processExecutions(ids: $ids) {
|
|
944
939
|
id
|
|
@@ -951,7 +946,7 @@ import{CommandContext as t,AssetType as e,BringForwardCommand as A,BringToFrontC
|
|
|
951
946
|
}
|
|
952
947
|
}
|
|
953
948
|
}
|
|
954
|
-
`,variables:{ids:[
|
|
949
|
+
`,variables:{ids:[n]}}),!i||!i.data?.getProcessFlowExecution)throw new Error("Failed to retrieve server response for execution.");const t=i.data?.getProcessFlowExecution?.completedAt;if(t){r=!0;break}if(i.data?.getProcessFlowExecution?.failedAt)throw new Error("Execution has failed to complete. See Executions tab in partner account on SpiffCommerce Hub.");o+=1;if(o>=(A?.repeats?A?.repeats:5))throw new Error("Maximum wait time exceeded for execution result.")}return Promise.resolve(new ji(i.data?.getProcessFlowExecution))}}class ji{constructor(t){Ji(this,"execution",void 0),this.execution=t}getRaw(){return this.execution}getNodes(){return this.execution.nodes.map((t=>new Ki(t)))}getNodesByType(t){return this.execution.nodes.filter((e=>e.type===t)).map((t=>new Ki(t)))}getInputs(){return this.execution.nodes.filter((t=>t.type===Li.StartTerminal)).map((t=>new Ki(t)))}getOutputs(){return this.execution.nodes.filter((t=>t.type===Li.EndTerminal)).map((t=>new Ki(t)))}getCompletedAt(){if(this.execution.completedAt)return new Date(this.execution.completedAt)}getFailedAt(){if(this.execution.failedAt)return new Date(this.execution.failedAt)}}class Ki{constructor(t){Ji(this,"node",void 0),this.node=t}getId(){return this.node.id}getType(){return this.node.type}getArtifacts(){return new Map(Object.entries(JSON.parse(this.node.artifacts).value))}getArtifactByName(t){return console.log(this.getArtifacts()),this.getArtifacts().get(t)}}class Vi{constructor(t){Ji(this,"value",void 0),this.value=t}getRaw(){return this.value}getValueForTransmission(){const t=this.value;return t.startsWith("[")?JSON.stringify(JSON.parse(t)):JSON.stringify(t)}}let Wi;var Xi;(Xi=Wi||(Wi={})).Transaction="Transaction",Xi.Bundle="Bundle",Xi.Product="Product",Xi.Variant="Variant",Xi.Option="Option",Xi.LineItem="LineItem",Xi.Asset="Asset";class qi extends Vi{constructor(t,e){if("Asset"!==e&&!qi.validUUID(t))throw new Error("Invalid ID, must be a valid v4 UUID. https://www.uuidgenerator.net/");super(`{"isSpiffObject": true, "id": "${t}", "type": "${e}"}`)}static validUUID(t){return t.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i)}}class Zi extends Vi{constructor(t){super(t)}}function $i(t,e,A){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var A=t[Symbol.toPrimitive];if(void 0!==A){var n=A.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:A,enumerable:!0,configurable:!0,writable:!0}):t[e]=A,t}const _i=It`
|
|
955
950
|
fragment RegionFields on Region {
|
|
956
951
|
width
|
|
957
952
|
top
|