@spiffcommerce/core 20.1.0-alpha.1 → 20.1.0-alpha.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/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9069,7 +9069,7 @@ class Me {
|
|
|
9069
9069
|
throw new Error(
|
|
9070
9070
|
"No workflows found on product. This is generally due to a configuration error. Please confirm at least one workflow is configured for this product."
|
|
9071
9071
|
);
|
|
9072
|
-
return A.map((e) => new NA(e));
|
|
9072
|
+
return A.sort((e, t) => (e.index ?? 0) - (t.index ?? 0)).map((e) => new NA(e));
|
|
9073
9073
|
}
|
|
9074
9074
|
}
|
|
9075
9075
|
const ii = F`
|
package/dist/index.umd.cjs
CHANGED
|
@@ -2318,7 +2318,7 @@ IfnI8vaNAAAAAElFTkSuQmCC" transform="matrix(0.13 0.0141 -0.0141 0.1301 104.926 1
|
|
|
2318
2318
|
}
|
|
2319
2319
|
}
|
|
2320
2320
|
}
|
|
2321
|
-
`,variables:{ids:[a]}});const E=(w=r.data)==null?void 0:w.processExecutions[0];if(!r||!E)throw new Error("Failed to retrieve server response for execution.");if(E.failedAt)throw new Error("Execution has failed to complete. See Automation > FLows in Flight on partner account on SpiffCommerce Hub.");if(E.completedAt){o=!0,l=new eA(E);break}s+=1;const C=A!=null&&A.repeats?A==null?void 0:A.repeats:5;if(s>=C)throw new Error("Maximum wait time exceeded for execution result.");await i(A!=null&&A.sleepTime?Math.max(A.sleepTime,500):2e3)}if(!l)throw new Error("Failed to retrieve server response for execution.");return Promise.resolve(l)}}class eA{constructor(e){this.execution=e}getRaw(){return this.execution}getNodes(){return this.execution.nodes.map(e=>new de(e))}getNodesByType(e){return this.execution.nodes.filter(t=>t.type===e).map(t=>new de(t))}getInputs(){return this.execution.nodes.filter(e=>e.type==="StartTerminal").map(e=>new de(e))}getOutputs(){return this.execution.nodes.filter(e=>e.type==="EndTerminal").map(e=>new de(e))}getCompletedAt(){if(this.execution.completedAt)return new Date(this.execution.completedAt)}getFailedAt(){if(this.execution.failedAt)return new Date(this.execution.failedAt)}}class de{constructor(e){this.node=e}getId(){return this.node.id}getType(){return this.node.type}getArtifacts(){return new Map(Object.entries(JSON.parse(this.node.artifacts).value))}getArtifactByName(e){return this.getArtifacts().get(e)}}class Ke{constructor(e){this.value=e}getRaw(){return this.value}getValueForTransmission(){const e=this.value;return e.startsWith("[")?JSON.stringify(JSON.parse(e)):e}}var tA=(c=>(c.Transaction="Transaction",c.Bundle="Bundle",c.Product="Product",c.Variant="Variant",c.Option="Option",c.LineItem="LineItem",c.Asset="Asset",c))(tA||{});class Aa extends Ke{constructor(e){super(`"${e}"`)}}class Ve extends Ke{constructor(e,t){if(t!=="Asset"&&!Ve.validUUID(e))throw new Error("Invalid ID, must be a valid v4 UUID. https://www.uuidgenerator.net/");super(`{"isSpiffObject": true, "id": "${e}", "type": "${t}"}`)}static validUUID(e){return e.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 na extends Ke{constructor(e){super(`[${e.map(t=>t.getRaw()).join(",")}]`)}}class We{constructor(e){this.integrationProduct=e}getId(){return this.integrationProduct.id}getResource(){return this.integrationProduct}getBasePrice(){var A;if(!this.integrationProduct.product)throw new Error("IntegrationProductResource does not have a product");const e=this.integrationProduct.product.basePrice||0,t=(A=this.integrationProduct)==null?void 0:A.additionalIntegrationProduct;if(!t)return e;if(t&&!t.product)throw new Error("An additional integration product was found, but it does not have a product");return e+(t.product.basePrice||0)}getDefaultWorkflow(){if(!this.integrationProduct.product)throw new Error("IntegrationProductResource does not have a product");const e=this.integrationProduct.product.workflows||[];if(e.length===0)throw new Error("No workflows found on product. This is generally due to a configuration error. Please confirm at least one workflow is configured for this product.");return new Be(e[0])}getAllWorkflows(){if(!this.integrationProduct.product)throw new Error("IntegrationProductResource does not have a product");const e=this.integrationProduct.product.workflows||[];if(e.length===0)throw new Error("No workflows found on product. This is generally due to a configuration error. Please confirm at least one workflow is configured for this product.");return e.map(t=>new Be(t))}}const aa=M.gql`
|
|
2321
|
+
`,variables:{ids:[a]}});const E=(w=r.data)==null?void 0:w.processExecutions[0];if(!r||!E)throw new Error("Failed to retrieve server response for execution.");if(E.failedAt)throw new Error("Execution has failed to complete. See Automation > FLows in Flight on partner account on SpiffCommerce Hub.");if(E.completedAt){o=!0,l=new eA(E);break}s+=1;const C=A!=null&&A.repeats?A==null?void 0:A.repeats:5;if(s>=C)throw new Error("Maximum wait time exceeded for execution result.");await i(A!=null&&A.sleepTime?Math.max(A.sleepTime,500):2e3)}if(!l)throw new Error("Failed to retrieve server response for execution.");return Promise.resolve(l)}}class eA{constructor(e){this.execution=e}getRaw(){return this.execution}getNodes(){return this.execution.nodes.map(e=>new de(e))}getNodesByType(e){return this.execution.nodes.filter(t=>t.type===e).map(t=>new de(t))}getInputs(){return this.execution.nodes.filter(e=>e.type==="StartTerminal").map(e=>new de(e))}getOutputs(){return this.execution.nodes.filter(e=>e.type==="EndTerminal").map(e=>new de(e))}getCompletedAt(){if(this.execution.completedAt)return new Date(this.execution.completedAt)}getFailedAt(){if(this.execution.failedAt)return new Date(this.execution.failedAt)}}class de{constructor(e){this.node=e}getId(){return this.node.id}getType(){return this.node.type}getArtifacts(){return new Map(Object.entries(JSON.parse(this.node.artifacts).value))}getArtifactByName(e){return this.getArtifacts().get(e)}}class Ke{constructor(e){this.value=e}getRaw(){return this.value}getValueForTransmission(){const e=this.value;return e.startsWith("[")?JSON.stringify(JSON.parse(e)):e}}var tA=(c=>(c.Transaction="Transaction",c.Bundle="Bundle",c.Product="Product",c.Variant="Variant",c.Option="Option",c.LineItem="LineItem",c.Asset="Asset",c))(tA||{});class Aa extends Ke{constructor(e){super(`"${e}"`)}}class Ve extends Ke{constructor(e,t){if(t!=="Asset"&&!Ve.validUUID(e))throw new Error("Invalid ID, must be a valid v4 UUID. https://www.uuidgenerator.net/");super(`{"isSpiffObject": true, "id": "${e}", "type": "${t}"}`)}static validUUID(e){return e.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 na extends Ke{constructor(e){super(`[${e.map(t=>t.getRaw()).join(",")}]`)}}class We{constructor(e){this.integrationProduct=e}getId(){return this.integrationProduct.id}getResource(){return this.integrationProduct}getBasePrice(){var A;if(!this.integrationProduct.product)throw new Error("IntegrationProductResource does not have a product");const e=this.integrationProduct.product.basePrice||0,t=(A=this.integrationProduct)==null?void 0:A.additionalIntegrationProduct;if(!t)return e;if(t&&!t.product)throw new Error("An additional integration product was found, but it does not have a product");return e+(t.product.basePrice||0)}getDefaultWorkflow(){if(!this.integrationProduct.product)throw new Error("IntegrationProductResource does not have a product");const e=this.integrationProduct.product.workflows||[];if(e.length===0)throw new Error("No workflows found on product. This is generally due to a configuration error. Please confirm at least one workflow is configured for this product.");return new Be(e[0])}getAllWorkflows(){if(!this.integrationProduct.product)throw new Error("IntegrationProductResource does not have a product");const e=this.integrationProduct.product.workflows||[];if(e.length===0)throw new Error("No workflows found on product. This is generally due to a configuration error. Please confirm at least one workflow is configured for this product.");return e.sort((t,A)=>(t.index??0)-(A.index??0)).map(t=>new Be(t))}}const aa=M.gql`
|
|
2322
2322
|
fragment RegionFields on Region {
|
|
2323
2323
|
width
|
|
2324
2324
|
top
|
package/package.json
CHANGED