@spiffcommerce/core 12.10.5 → 12.10.6

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 CHANGED
@@ -651,7 +651,7 @@ var t=require("@apollo/client"),e=require("lodash.clonedeep"),A=require("react/j
651
651
  id
652
652
  }
653
653
  }
654
- `;function rc(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 i=A.call(t,e||"default");if("object"!=typeof i)return i;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}class ac{constructor(t,e){rc(this,"bundle",void 0),rc(this,"property",void 0),this.bundle=t,this.property=e}getName(){return this.property.name}getDescription(){return this.property.description}getType(){return this.property.type}getSharedSteps(t){return(t??this.bundle.getWorkflowExperiences()).flatMap((t=>t.getSteps().filter((t=>{t.getRaw().globalPropertyConfigurationAspectNames?.includes(this.property.name)}))))}}class sc extends ac{constructor(t,e){super(t,e)}async selectImage(t){await Promise.all([this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,t.key),this.applyImageSelection(t)])}async applyGlobalState(t){const e=this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);if(!e)return Promise.resolve();const A=await Yr.getLocalOrFromServer(e);return A?this.applyImageSelection(A,t):Promise.resolve()}async applyImageSelection(t,e){const A=this.getSharedSteps(e).map((e=>e.selectImage(t)));await Promise.all(A)}}class oc extends ac{constructor(t,e,A){super(t,e),rc(this,"optionResource",void 0),this.optionResource=A}getCurrentVariant(){if(!this.optionResource)return;const t=this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);if(!t)return;const e=this.optionResource.variants?.find((e=>e.id===t));return e?new fo(e):void 0}getAvailableVariants(){return(this.optionResource?.variants?.filter((t=>t.enabled))||[]).map((t=>new fo(t)))}getAllVariants(){return(this.optionResource?.variants||[]).map((t=>new fo(t)))}async selectVariant(t){await Promise.all([this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,t.getId()),this.applyVariantSelection(t)])}async applyGlobalState(t){const e=this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);if(!e)return Promise.resolve();const A=this.optionResource?.variants?.find((t=>t.id===e));return A?this.applyVariantSelection(new fo(A),t):Promise.resolve()}async applyVariantSelection(t,e){const A=this.getSharedSteps(e).map((e=>e.selectVariant(t)));await Promise.all(A)}}const cc=M.gql`
654
+ `;function rc(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 i=A.call(t,e||"default");if("object"!=typeof i)return i;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}class ac{constructor(t,e){rc(this,"bundle",void 0),rc(this,"property",void 0),this.bundle=t,this.property=e}getName(){return this.property.name}getDescription(){return this.property.description}getType(){return this.property.type}getSharedSteps(t){return(t??this.bundle.getWorkflowExperiences()).flatMap((t=>t.getSteps().filter((t=>t.getRaw().globalPropertyConfigurationAspectNames?.includes(this.property.name)))))}}class sc extends ac{constructor(t,e){super(t,e)}async selectImage(t){await Promise.all([this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,t.key),this.applyImageSelection(t)])}async applyGlobalState(t){const e=this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);if(!e)return Promise.resolve();const A=await Yr.getLocalOrFromServer(e);return A?this.applyImageSelection(A,t):Promise.resolve()}async applyImageSelection(t,e){const A=this.getSharedSteps(e).map((e=>e.selectImage(t)));await Promise.all(A)}}class oc extends ac{constructor(t,e,A){super(t,e),rc(this,"optionResource",void 0),this.optionResource=A}getCurrentVariant(){if(!this.optionResource)return;const t=this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);if(!t)return;const e=this.optionResource.variants?.find((e=>e.id===t));return e?new fo(e):void 0}getAvailableVariants(){return(this.optionResource?.variants?.filter((t=>t.enabled))||[]).map((t=>new fo(t)))}getAllVariants(){return(this.optionResource?.variants||[]).map((t=>new fo(t)))}async selectVariant(t){await Promise.all([this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,t.getId()),this.applyVariantSelection(t)])}async applyGlobalState(t){const e=this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);if(!e)return Promise.resolve();const A=this.optionResource?.variants?.find((t=>t.id===e));return A?this.applyVariantSelection(new fo(A),t):Promise.resolve()}async applyVariantSelection(t,e){const A=this.getSharedSteps(e).map((e=>e.selectVariant(t)));await Promise.all(A)}}const cc=M.gql`
655
655
  mutation CreateGlobalPropertyState($bundleId: String!) {
656
656
  globalPropertyStateCreate(bundleId: $bundleId) {
657
657
  id
package/dist/module.js CHANGED
@@ -651,7 +651,7 @@ import{CommandContext as t,AssetType as A,BringForwardCommand as e,BringToFrontC
651
651
  id
652
652
  }
653
653
  }
654
- `;function ri(t,A,e){return(A=function(t){var A=function(t,A){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,A||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===A?String:Number)(t)}(t,"string");return"symbol"==typeof A?A:String(A)}(A))in t?Object.defineProperty(t,A,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[A]=e,t}class si{constructor(t,A){ri(this,"bundle",void 0),ri(this,"property",void 0),this.bundle=t,this.property=A}getName(){return this.property.name}getDescription(){return this.property.description}getType(){return this.property.type}getSharedSteps(t){return(t??this.bundle.getWorkflowExperiences()).flatMap((t=>t.getSteps().filter((t=>{t.getRaw().globalPropertyConfigurationAspectNames?.includes(this.property.name)}))))}}class ci extends si{constructor(t,A){super(t,A)}async selectImage(t){await Promise.all([this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,t.key),this.applyImageSelection(t)])}async applyGlobalState(t){const A=this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);if(!A)return Promise.resolve();const e=await HA.getLocalOrFromServer(A);return e?this.applyImageSelection(e,t):Promise.resolve()}async applyImageSelection(t,A){const e=this.getSharedSteps(A).map((A=>A.selectImage(t)));await Promise.all(e)}}class gi extends si{constructor(t,A,e){super(t,A),ri(this,"optionResource",void 0),this.optionResource=e}getCurrentVariant(){if(!this.optionResource)return;const t=this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);if(!t)return;const A=this.optionResource.variants?.find((A=>A.id===t));return A?new fa(A):void 0}getAvailableVariants(){return(this.optionResource?.variants?.filter((t=>t.enabled))||[]).map((t=>new fa(t)))}getAllVariants(){return(this.optionResource?.variants||[]).map((t=>new fa(t)))}async selectVariant(t){await Promise.all([this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,t.getId()),this.applyVariantSelection(t)])}async applyGlobalState(t){const A=this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);if(!A)return Promise.resolve();const e=this.optionResource?.variants?.find((t=>t.id===A));return e?this.applyVariantSelection(new fa(e),t):Promise.resolve()}async applyVariantSelection(t,A){const e=this.getSharedSteps(A).map((A=>A.selectVariant(t)));await Promise.all(e)}}const li=Zt`
654
+ `;function ri(t,A,e){return(A=function(t){var A=function(t,A){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,A||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===A?String:Number)(t)}(t,"string");return"symbol"==typeof A?A:String(A)}(A))in t?Object.defineProperty(t,A,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[A]=e,t}class si{constructor(t,A){ri(this,"bundle",void 0),ri(this,"property",void 0),this.bundle=t,this.property=A}getName(){return this.property.name}getDescription(){return this.property.description}getType(){return this.property.type}getSharedSteps(t){return(t??this.bundle.getWorkflowExperiences()).flatMap((t=>t.getSteps().filter((t=>t.getRaw().globalPropertyConfigurationAspectNames?.includes(this.property.name)))))}}class ci extends si{constructor(t,A){super(t,A)}async selectImage(t){await Promise.all([this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,t.key),this.applyImageSelection(t)])}async applyGlobalState(t){const A=this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);if(!A)return Promise.resolve();const e=await HA.getLocalOrFromServer(A);return e?this.applyImageSelection(e,t):Promise.resolve()}async applyImageSelection(t,A){const e=this.getSharedSteps(A).map((A=>A.selectImage(t)));await Promise.all(e)}}class gi extends si{constructor(t,A,e){super(t,A),ri(this,"optionResource",void 0),this.optionResource=e}getCurrentVariant(){if(!this.optionResource)return;const t=this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);if(!t)return;const A=this.optionResource.variants?.find((A=>A.id===t));return A?new fa(A):void 0}getAvailableVariants(){return(this.optionResource?.variants?.filter((t=>t.enabled))||[]).map((t=>new fa(t)))}getAllVariants(){return(this.optionResource?.variants||[]).map((t=>new fa(t)))}async selectVariant(t){await Promise.all([this.bundle.getGlobalPropertyStateManager().setAspect(this.property.name,t.getId()),this.applyVariantSelection(t)])}async applyGlobalState(t){const A=this.bundle.getGlobalPropertyStateManager().getAspect(this.property.name);if(!A)return Promise.resolve();const e=this.optionResource?.variants?.find((t=>t.id===A));return e?this.applyVariantSelection(new fa(e),t):Promise.resolve()}async applyVariantSelection(t,A){const e=this.getSharedSteps(A).map((A=>A.selectVariant(t)));await Promise.all(e)}}const li=Zt`
655
655
  mutation CreateGlobalPropertyState($bundleId: String!) {
656
656
  globalPropertyStateCreate(bundleId: $bundleId) {
657
657
  id
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spiffcommerce/core",
3
- "version": "12.10.5",
3
+ "version": "12.10.6",
4
4
  "description": "Core client API for interacting with the Spiff Commerce backend.",
5
5
  "source": "src/index.ts",
6
6
  "main": "dist/main.js",