@vertigis/workflow 5.48.2 → 5.50.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.
Files changed (180) hide show
  1. package/Collections.d.ts +27 -27
  2. package/Collections.js +1 -1
  3. package/EnumUtils.d.ts +5 -5
  4. package/EnumUtils.js +1 -1
  5. package/Errors.d.ts +27 -27
  6. package/Hooks.d.ts +2 -2
  7. package/IActivityHandler.d.ts +14 -14
  8. package/LanguageStringUtils.js +1 -1
  9. package/ProgramInspectorFacility.d.ts +1 -1
  10. package/ProgramInspectorFacility.js +1 -1
  11. package/Task.d.ts +3 -3
  12. package/Task.js +1 -1
  13. package/TemplateUtils.d.ts +2 -2
  14. package/Validation.d.ts +10 -1
  15. package/Validation.js +1 -1
  16. package/activities/app/GetApplicationData.d.ts +1 -1
  17. package/activities/app/GetApplicationData.js +1 -1
  18. package/activities/app/RemoveApplicationData.d.ts +1 -1
  19. package/activities/app/RemoveApplicationData.js +1 -1
  20. package/activities/app/SetApplicationData.d.ts +1 -1
  21. package/activities/app/SetApplicationData.js +1 -1
  22. package/activities/arcgis/AddFeatures.d.ts +7 -4
  23. package/activities/arcgis/AddFeatures.js +1 -1
  24. package/activities/arcgis/AreaEngineTask.d.ts +1 -1
  25. package/activities/arcgis/AreaEngineTask.js +1 -1
  26. package/activities/arcgis/BufferEngineTask.d.ts +1 -1
  27. package/activities/arcgis/BufferEngineTask.js +1 -1
  28. package/activities/arcgis/CastGeometry.d.ts +4 -4
  29. package/activities/arcgis/CompareGeometries.d.ts +1 -1
  30. package/activities/arcgis/CompareGeometries.js +1 -1
  31. package/activities/arcgis/DeleteFeatures.d.ts +7 -3
  32. package/activities/arcgis/DeleteFeatures.js +1 -1
  33. package/activities/arcgis/DifferenceEngineTask.d.ts +1 -1
  34. package/activities/arcgis/DifferenceEngineTask.js +1 -1
  35. package/activities/arcgis/FlipEngineTask.d.ts +1 -1
  36. package/activities/arcgis/FlipEngineTask.js +1 -1
  37. package/activities/arcgis/GenerateArcGisToken.d.ts +2 -2
  38. package/activities/arcgis/GeoprocessingAsync.d.ts +2 -2
  39. package/activities/arcgis/GetAttributeValue.d.ts +1 -0
  40. package/activities/arcgis/GetAttributeValues.d.ts +1 -0
  41. package/activities/arcgis/GetCurrentPosition.d.ts +28 -28
  42. package/activities/arcgis/GetFeatureGeometries.d.ts +2 -2
  43. package/activities/arcgis/GetFeatureSetExtent.d.ts +2 -2
  44. package/activities/arcgis/GetFormElementItemsFromFeatures.d.ts +2 -2
  45. package/activities/arcgis/GetFormElementItemsFromFeatures.js +1 -1
  46. package/activities/arcgis/GetGeometryExtent.d.ts +2 -2
  47. package/activities/arcgis/LengthEngineTask.d.ts +1 -1
  48. package/activities/arcgis/LengthEngineTask.js +1 -1
  49. package/activities/arcgis/MapProvider.d.ts +92 -92
  50. package/activities/arcgis/MapProvider.js +1 -1
  51. package/activities/arcgis/NearestCoordinateEngineTask.d.ts +6 -6
  52. package/activities/arcgis/NearestVertexEngineTask.d.ts +6 -6
  53. package/activities/arcgis/NearestVerticesEngineTask.d.ts +6 -6
  54. package/activities/arcgis/ProjectServiceTask.js +1 -1
  55. package/activities/arcgis/ResetLayerDefinitionExpression.d.ts +2 -2
  56. package/activities/arcgis/RunPrint.d.ts +2 -2
  57. package/activities/arcgis/RunPrint.js +1 -1
  58. package/activities/arcgis/RunReport.js +1 -1
  59. package/activities/arcgis/RunWorkflow.d.ts +4 -4
  60. package/activities/arcgis/RunWorkflow.js +1 -1
  61. package/activities/arcgis/SetImageryLayerOptions.d.ts +2 -2
  62. package/activities/arcgis/SetLayerDefinitionExpression.d.ts +2 -2
  63. package/activities/arcgis/SetLayerProperty.d.ts +2 -2
  64. package/activities/arcgis/SetLayerVisibility.d.ts +2 -2
  65. package/activities/arcgis/SetViewExtent.d.ts +4 -4
  66. package/activities/arcgis/SetViewpoint.d.ts +2 -2
  67. package/activities/arcgis/TypeChecking.d.ts +3 -3
  68. package/activities/arcgis/UpdateFeatures.d.ts +6 -3
  69. package/activities/arcgis/UpdateFeatures.js +1 -1
  70. package/activities/arcgis/libs/arcGisRestApi.d.ts +4 -4
  71. package/activities/arcgis/libs/shared.d.ts +9 -0
  72. package/activities/arcgis/libs/shared.js +1 -0
  73. package/activities/arcgis/printing.d.ts +14 -14
  74. package/activities/arcgis/runUtils.d.ts +2 -2
  75. package/activities/arcgis/runUtils.js +1 -1
  76. package/activities/arcgis/shared.d.ts +9 -2
  77. package/activities/arcgis/shared.js +1 -1
  78. package/activities/core/CalculateDate.d.ts +1 -1
  79. package/activities/core/CalculateDate.js +1 -1
  80. package/activities/core/ChannelProvider.d.ts +42 -42
  81. package/activities/core/ChannelProvider.js +1 -1
  82. package/activities/core/ForEach.d.ts +4 -4
  83. package/activities/core/FormatDate.d.ts +21 -21
  84. package/activities/core/FormatDate.js +1 -1
  85. package/activities/core/GetFirstItem.d.ts +1 -0
  86. package/activities/core/GetItemAtIndex.d.ts +1 -0
  87. package/activities/core/GetLastItem.d.ts +1 -0
  88. package/activities/core/GetWorkflowInputs.d.ts +6 -2
  89. package/activities/core/Log.d.ts +1 -1
  90. package/activities/core/Log.js +1 -1
  91. package/activities/core/Loop.d.ts +2 -2
  92. package/activities/core/ParseJson.d.ts +1 -0
  93. package/activities/core/WebRequest.d.ts +2 -2
  94. package/activities/csv/ParseCsv.d.ts +1 -0
  95. package/activities/essentials/GetEssentialsSite.d.ts +2 -2
  96. package/activities/essentials/RunEssentialsWorkflow.d.ts +2 -2
  97. package/activities/essentials/RunEssentialsWorkflow.js +1 -1
  98. package/activities/forms/DisplayForm.d.ts +6 -6
  99. package/activities/forms/DisplayForm.js +1 -1
  100. package/activities/forms/FormActor.d.ts +22 -22
  101. package/activities/forms/FormRenderer.d.ts +2 -2
  102. package/activities/forms/FormRenderer.js +1 -1
  103. package/activities/forms/GetFormElementItemsFromCollection.d.ts +7 -7
  104. package/activities/forms/GetFormElementItemsFromCollection.js +1 -1
  105. package/activities/forms/SetFormElementProperty.d.ts +1 -1
  106. package/activities/math/Max.d.ts +1 -1
  107. package/activities/math/Max.js +1 -1
  108. package/activities/math/Min.d.ts +1 -1
  109. package/activities/math/Min.js +1 -1
  110. package/activities/server/RunApplication.d.ts +2 -2
  111. package/activities/server/RunPython.d.ts +4 -4
  112. package/activities/ui/DialogContent.d.ts +6 -6
  113. package/activities/ui/DialogProvider.d.ts +5 -5
  114. package/activities/ui/DialogProvider.js +1 -1
  115. package/definition/ActivityInput.d.ts +6 -6
  116. package/definition/ProgramInspector.d.ts +118 -118
  117. package/definition/ProgramInspector.js +1 -1
  118. package/definition/Reference.d.ts +2 -2
  119. package/definition/Resource.d.ts +15 -15
  120. package/definition/Transition.d.ts +4 -4
  121. package/diagnostics/ConsoleDebugLogger.d.ts +2 -2
  122. package/diagnostics/ConsoleDebugLogger.js +1 -1
  123. package/execution/ActivityContext.d.ts +35 -35
  124. package/execution/ActivityContext.js +1 -1
  125. package/execution/ActivityContextProxy.d.ts +7 -7
  126. package/execution/ActivityContextProxy.js +1 -1
  127. package/execution/AmbientState.d.ts +29 -29
  128. package/execution/AmbientState.js +1 -1
  129. package/execution/AmbientStateProxy.d.ts +10 -10
  130. package/execution/AmbientStateProxy.js +1 -1
  131. package/execution/AsyncContext.d.ts +1 -1
  132. package/execution/AsyncContext.js +1 -1
  133. package/execution/Engine.d.ts +27 -28
  134. package/execution/Engine.js +1 -1
  135. package/execution/IDebugSession.d.ts +10 -10
  136. package/execution/MonikerFrame.d.ts +2 -2
  137. package/execution/MonikerFrame.js +1 -1
  138. package/execution/Proxy.d.ts +1 -1
  139. package/execution/Proxy.js +1 -1
  140. package/execution/StepContext.d.ts +1 -1
  141. package/execution/StepContext.js +1 -1
  142. package/execution/TransitionContext.d.ts +1 -1
  143. package/execution/TransitionContext.js +1 -1
  144. package/forms/ExclusiveTimer.d.ts +2 -2
  145. package/forms/ExclusiveTimer.js +1 -1
  146. package/forms/FormComponent.d.ts +7 -7
  147. package/forms/FormComponent.js +1 -1
  148. package/forms/FormDefinition.d.ts +50 -42
  149. package/forms/FormHost.d.ts +161 -146
  150. package/forms/FormHost.js +1 -1
  151. package/forms/FormPresenterHost.d.ts +42 -42
  152. package/forms/MutuallyExclusiveSectionGroup.d.ts +6 -6
  153. package/forms/MutuallyExclusiveSectionGroup.js +1 -1
  154. package/forms/NumberParser.d.ts +2 -2
  155. package/forms/branding/WorkflowColor.d.ts +5 -5
  156. package/forms/branding/WorkflowColor.js +1 -1
  157. package/forms/components/AutoComplete.js +1 -1
  158. package/forms/components/Button.js +1 -1
  159. package/forms/components/DateTimePicker.js +1 -1
  160. package/forms/components/Form.js +1 -1
  161. package/forms/components/FormLabelNumberField.d.ts +4 -4
  162. package/forms/components/GeometryPickerListItem.d.ts +4 -4
  163. package/forms/components/ItemPicker.js +1 -1
  164. package/forms/components/NumberRangeSlider.js +1 -1
  165. package/forms/components/NumberSlider.js +1 -1
  166. package/forms/components/Scanner.js +1 -1
  167. package/forms/components/SignatureDialog.d.ts +2 -2
  168. package/forms/components/SketchDialog.d.ts +5 -5
  169. package/forms/components/common.js +1 -1
  170. package/forms/dateUtilities.d.ts +2 -2
  171. package/forms/elements/types.d.ts +2 -2
  172. package/forms/index.d.ts +2 -2
  173. package/forms/numberFormatter.d.ts +8 -8
  174. package/forms/numberUtilities.d.ts +1 -1
  175. package/forms/utils.d.ts +6 -12
  176. package/libs/version.d.ts +1 -1
  177. package/libs/version.js +1 -1
  178. package/package.json +1 -1
  179. package/ui/UIService.d.ts +2 -2
  180. package/ui/UIService.js +1 -1
@@ -1 +1 @@
1
- import{Dictionary,Iterator,Stash}from"../Collections.js";export class ProgramInspector{constructor(t){this.incidents=new IncidentList,this.components=new ComponentList(this.incidents),this.forms=new FormList(this.incidents),this.hiddenValidationIssues=new Set,this.references=new ReferenceList(this.incidents),this.steps=new StepList(this.incidents),this.transitions=new TransitionList(this.incidents),this.program=makeBlankProgram(),this.editorId=t}newId(t){return"number"==typeof t&&(this.incidents.nextId=t),this.incidents.newId()}exists(t){return void 0!==this.incidents.findFor(t)}find(t){const e=this.incidents.find(t);return void 0!==e?e.resource:void 0}findComponent(t){return this.components.findWith(t)}findForm(t){return this.forms.findWith(t)}findReference(t){return this.references.findWith(t)}findStep(t){return this.steps.findWith(t)}findTransition(t){return this.transitions.findWith(t)}all(){return iterate(this.incidents)}allComponents(){return this.components.all()}allForms(){return this.forms.all()}allReferences(){return this.references.all()}allSteps(){return this.steps.all()}allTransitions(){return this.transitions.all()}addComponent(){return this.components.add().resource}addForm(){return this.forms.add().resource}addReference(){return this.references.add().resource}addStep(){return this.steps.add().resource}addTransition(t,e){const r=this.steps.findFor(t),n=this.steps.findFor(e);if(void 0!==r&&void 0!==n){let s=r.transitions;void 0===s&&(s=r.transitions=new Dictionary);let i=n.transitions;void 0===i&&(i=n.transitions=new Dictionary);const o=this.transitions.add(),a=o.resource;return o.source=r,a.source=t,s.assign(o.token,o),o.target=n,a.target=e,i.assign(o.token,o),r.branches=void 0,a}}cacheComponents(){return this.components.cache()}cacheForms(){return this.forms.cache()}cacheReference(){return this.references.cache()}cacheSteps(){return this.steps.cache()}cacheTransitions(){return this.transitions.cache()}relate(t,e){const r=arguments.length>1?branchToToken(e):void 0;return Iterator.from(t).map(t=>this.incidents.relate(t,r))}remove(t,e){const r=t=>{let r=0;!1===e&&this.isComponent(t)&&(r+=this.remove(this.relate(t)));const n=this.incidents.findFor(t);return void 0!==n&&(r+=n.master.unlink(n),this.start===n.resource&&(this.start=void 0)),r};if(Array.isArray(t)||t instanceof Iterator){let e=0;const n=Iterator.from(t);for(;n.next();)e+=r(n.current);return e}return r(t)>0}removeComponent(t){return this.components.removeFor(t)}removeForm(t){return this.forms.removeFor(t)}removeReference(t){return this.references.removeFor(t)}removeStep(t){return!!this.steps.removeFor(t)&&(this.start===t&&(this.start=void 0),!0)}removeTransition(t){return this.transitions.removeFor(t)}shift(t,e){const r=this.incidents.findFor(t);return void 0!==r&&r.master.shift(r,e)}shiftComponent(t,e){return this.components.shiftFor(t,e)}shiftForm(t,e){return this.forms.shiftFor(t,e)}shiftReference(t,e){return this.references.shiftFor(t,e)}shiftStep(t,e){return this.steps.shiftFor(t,e)}shiftTransition(t,e){return this.transitions.shiftFor(t,e)}rename(t,e){const r=this.incidents.findFor(t);return void 0!==r?r.master.rename(r,e):void 0}renameComponent(t,e){return this.components.renameFor(t,e)}renameForm(t,e){return this.forms.renameFor(t,e)}renameReference(t,e){return this.references.renameFor(t,e)}renameStep(t,e){return this.steps.renameFor(t,e)}renameTransition(t,e){return this.transitions.renameFor(t,e)}changeStart(t){return!!this.isStep(t)&&(this.start=t,!0)}changeBranch(t,e){const r=this.transitions.findFor(t);return void 0!==r&&(r.source.branches=void 0,t.branch="string"==typeof e?e:void 0,!0)}changeParent(t,e){let r,n=this.steps.findFor(t);return void 0===n&&(n=this.transitions.findFor(t)),void 0!==n&&((null==e||(r=this.components.findFor(e),void 0!==r))&&(n.master.changeParent(n,r),!0))}changeSource(t,e){const r=this.transitions.findFor(t);if(void 0===r)return!1;const n=this.steps.findFor(e);if(void 0===n)return!1;r.source.branches=void 0,r.source!==r.target&&r.source.transitions.remove(r.token);let s=n.transitions;return void 0===s&&(s=n.transitions=new Dictionary),r.source=n,t.source=e,n.branches=void 0,s.assign(r.token,r),!0}changeTarget(t,e){const r=this.transitions.findFor(t);if(void 0===r)return!1;const n=this.steps.findFor(e);if(void 0===n)return!1;r.target!==r.source&&r.target.transitions.remove(r.token);let s=n.transitions;return void 0===s&&(s=n.transitions=new Dictionary),r.target=n,t.target=e,s.assign(r.token,r),!0}isComponent(t){return void 0!==this.components.findFor(t)}isParent(t,e){return this.isActivity(e)&&e.parent===t}isForm(t){return void 0!==this.forms.findFor(t)}isActivity(t){return this.isStep(t)||this.isTransition(t)}isReference(t){return void 0!==this.references.findFor(t)}isStep(t){return void 0!==this.steps.findFor(t)}isTransition(t){return void 0!==this.transitions.findFor(t)}isSource(t,e){return this.isTransition(t)&&t.source===e}isTarget(t,e){return this.isTransition(t)&&t.target===e}getDeploymentConfig(){return this.program.deploymentConfig||{supportedApps:{}}}getDefaultLocale(){return navigator.language||"inv"}getHiddenValidationIssues(){return this.hiddenValidationIssues}getStrings(t){const e=this.program.strings||{};t||(t=this.getDefaultLocale());let r={...e.inv||{}};if("inv"===t)return r;if(t=canonicalizeLocale(t)){const n=parseLocale(t).language;t!==n&&n in e&&(r={...r,...e[n]}),t in e&&(r={...r,...e[t]})}return r}realize(){this.program.components=this.allComponents().list(),this.program.forms=this.allForms().list(),this.program.hiddenValidationIssues=[...this.hiddenValidationIssues],this.program.references=this.allReferences().list(),this.program.steps=this.allSteps().list(),this.program.transitions=this.allTransitions().list(),this.program.start=this.start;const t=this.allComponents();for(;t.next();)t.current.steps=[],t.current.transitions=[];const e=this.allSteps();for(;e.next();){const t=e.current;t.transitions=[];const r=t.parent;void 0!==r&&r.steps.push(t)}const r=this.allTransitions();for(;r.next();){const t=r.current,e=t.parent;void 0!==e&&e.transitions.push(t),t.source.transitions.push(t),t.target!==t.source&&t.target.transitions.push(t)}}release(){this.program.components=[],this.program.forms=[],this.program.hiddenValidationIssues=[],this.program.references=[],this.program.steps=[],this.program.transitions=[],this.program.start=void 0;const t=this.allComponents();for(;t.next();)t.current.steps=[],t.current.transitions=[];const e=this.allSteps();for(;e.next();)e.current.transitions=[]}resolveStart(t){if("number"==typeof t)return this.findStep(t);if("string"==typeof t)return this.findStep(t);if("object"==typeof t&&null!==t){const e=t.id;if("number"==typeof e)return this.findStep(e);const r=t.name;return"string"==typeof r?this.findStep(r):void 0}return this.start}import(t,e,r){if("string"==typeof t&&(t=JSON.parse(t)),"object"!=typeof t||null===t)return{};"function"!=typeof r&&(r=void 0),e=!1!==e;const n={},s={},i=new Stash,o=(t,e)=>{copyResource(t,e);let n=t.id,o=t.name;if(void 0!==r){const t=r(n,o);"number"==typeof t?(n=t,o=void 0):"string"==typeof t?(n=void 0,o=t):"object"==typeof t&&null!==t?(n=t.id,o=t.name):!0!==t&&(n=void 0,o=void 0)}"number"==typeof n&&(this.shift(e,n),s[n]=e),"string"==typeof o&&this.rename(e,o);const a="number"==typeof n?"id$"+n:"auto";return i.write(a,t,e),e};function a(t,e,r){const s=e.id;if("number"!=typeof s)return o(e,r());const i=t+s,a=n[i];return o(e,void 0===a?n[i]=r():a)}const c=()=>this.addComponent();function u(t){const e=a("component$",t,c);return y(t.steps,t=>p(t,e)),y(t.transitions,t=>v(t,e)),e}const d=()=>this.addForm();const h=()=>this.addReference();const f=()=>this.addStep(),p=(t,r)=>{const n=a("step$",t,f);return this.changeParent(n,g(t.parent,u)||n.parent||r),y(t.transitions,t=>v(t,e?r:void 0,n)),n},m=this.addStep(),l=()=>this.addTransition(m,m),v=(t,e,r)=>{const n=a("transition$",t,()=>l());this.changeParent(n,g(t.parent,u)||n.parent||e);const s=n.source!==m?n.source:void 0;this.changeSource(n,g(t.source,p)||s||r);const i=n.target!==m?n.target:void 0;return this.changeTarget(n,g(t.target,p)||i||r),n};function g(t,e){if(isObject(t)){const r=t.id,n="number"==typeof r?"id$"+r:"auto";return i.read(n,t)||e(t)}}function y(t,e){if(Array.isArray(t))for(const r of t)g(r,e)}let F;copyResource(t,this.program),y(t.components,u),y(t.forms,function(t){return a("form$",t,d)}),y(t.references,function(t){return a("reference$",t,h)}),y(t.steps,p),y(t.transitions,v),this.hiddenValidationIssues=new Set(t.hiddenValidationIssues??[]),s.start=g(t.start,p),void 0===r&&(this.start=s.start);const k=t=>(void 0===F&&(F=this.addStep(),this.changeParent(F,t)),F),I=this.relate(m);for(;I.next();){F=void 0;const t=I.current;t.source===m&&this.changeSource(t,k(t.parent)),t.target===m&&this.changeTarget(t,k(t.parent))}return this.removeStep(m),this.realize(),s}export(){this.realize();const t=new ProgramInspector;t.import(this.program,!1);const e=t.program;e.steps=minifyArray(e.steps,function(t){return t.transitions=minifyArray(t.transitions,function(e){return e.source===t&&e.parent===t.parent&&(e.parent=void 0,e.source=void 0,e.target=e.target!==e.source?{id:e.target.id}:void 0,!0)}),void 0===t.parent}),e.transitions=minifyArray(e.transitions,function(t){return void 0===t.parent&&void 0!==t.source&&(t.source={id:t.source.id},t.target={id:t.target.id},!0)}),e.components=minifyArray(e.components,function(t){return t.steps=minifyArray(t.steps,function(t){return t.parent=void 0,!0}),t.transitions=minifyArray(t.transitions,function(t){return void 0!==t.parent&&(t.parent=void 0,t.source={id:t.source.id},t.target={id:t.target.id},!0)}),!0}),e.forms=minifyArray(e.forms),e.hiddenValidationIssues=minifyArray(e.hiddenValidationIssues??[]),e.references=minifyArray(e.references);const r=t.start;return e.start=void 0!==r?{id:r.id}:void 0,e}reset(){this.incidents.clear(),this.components.clear(),this.forms.clear(),this.references.clear(),this.steps.clear(),this.transitions.clear(),this.incidents.nextId=1,this.program=makeBlankProgram(),this.start=void 0}toJSON(){return this.export()}}function iterate(t){if(void 0===t)return Iterator.empty;return t.iterate().filter(function(t,e){return 0===String(e).lastIndexOf("token$",0)}).map(t=>t.resource,t=>t.id)}class IncidentList extends Dictionary{constructor(){super(...arguments),this.nextId=1}findFor(t){if(null!=t){const e=this.find(t.id);if(void 0!==e&&e.resource===t)return e}}newId(){let t=this.nextId;for(;this.exists(t);)t++;return this.nextId=t+1,t}relate(t,e){const r=this.findFor(t);return void 0!==r?r.master.relate(r,e):Iterator.empty}}class ResourceList extends Dictionary{constructor(t){super(),this.incidents=t}all(){return iterate(this)}cache(){let t=this.cacheLookup;if(void 0!==t)return t;t=this.cacheLookup={};const e=this.iterate();for(;e.next();){const r=e.current.resource;t[r.id]=r;const n=r.name;void 0!==n&&(t["$"+n]=r)}return t}findFor(t){const e=this.incidents.findFor(t);return this.test(e)?e:void 0}test(t){return void 0!==t&&t.master===this}findWith(t){"string"==typeof t&&(t=this.qualify(t));const e=this.incidents.find(t);return this.test(e)?e.resource:void 0}shift(t,e){this.incidents.remove(t.resource.id),"number"!=typeof e&&(e=this.incidents.newId());const r=this.incidents.assign(t.resource.id=e,t);void 0!==r&&this.incidents.assign(r.resource.id=this.incidents.newId(),r),this.cacheLookup=void 0}shiftFor(t,e){const r=this.findFor(t);return void 0!==r&&(this.shift(r,e),!0)}rename(t,e){const r=t.resource.name;if(void 0!==r&&this.incidents.remove(this.qualify(r)),"string"==typeof e){const r=this.qualify(t.resource.name=e),n=this.incidents.assign(r,t);void 0!==n&&(n.resource.name=void 0)}else t.resource.name=void 0;return this.cacheLookup=void 0,r}renameFor(t,e){const r=this.findFor(t);return void 0!==r&&(this.rename(r,e),!0)}add(){const t={},e=t.resource=this.create();return t.token=generateToken(),t.master=this,e.id=this.incidents.newId(),this.assign(t.token,t),this.incidents.assign(e.id,t),this.cacheLookup=void 0,t}removeFor(t){const e=this.findFor(t);return void 0!==e&&(this.unlink(e),!0)}unlink(t){this.remove(t.token),this.cacheLookup=void 0;const e=t.resource.id;this.incidents.remove(e);const r=t.resource.name;return void 0!==r&&this.incidents.remove(this.qualify(r)),1}relate(t,e){return Iterator.empty}changeParent(t,e){const r=t.parent;void 0!==r&&this.siblings(r).remove(t.token),void 0!==e?(t.parent=e,t.resource.parent=e.resource,this.siblings(e).assign(t.token,t)):(t.parent=void 0,t.resource.parent=void 0)}}class ComponentList extends ResourceList{create(){return{steps:[],transitions:[]}}qualify(t){return"component$"+t}unlink(t){super.unlink(t);const e=t.steps;if(void 0!==e){const t=e.iterate();for(;t.next();)t.current.resource.parent=void 0}const r=t.transitions;if(void 0!==r){const t=r.iterate();for(;t.next();)t.current.resource.parent=void 0}return 1}relate(t){const e=iterate(t.steps),r=iterate(t.transitions);return e.concat(r)}}class FormList extends ResourceList{create(){return{defaults:{},elements:{}}}qualify(t){return"form$"+t}}class ReferenceList extends ResourceList{create(){return{suite:"",path:""}}qualify(t){return"reference$"+t}}class StepList extends ResourceList{create(){return{inputs:{},transitions:[]}}qualify(t){return"activity$"+t}siblings(t){return t.steps||(t.steps=new Dictionary)}unlink(t){let e=super.unlink(t);void 0!==t.parent&&t.parent.steps.remove(t.token);const r=t.transitions;if(void 0!==r){const t=r.iterate();for(;t.next();)e+=t.current.master.unlink(t.current)}return e}relate(t,e){const r=t.transitions;if(void 0===r)return Iterator.empty;if(void 0===e)return iterate(r);let n=t.branches;if(void 0===n){n=t.branches={};for(const e of iterate(r).list().sort(compareTransitions))if(e.source===t.resource){const t=branchToToken(e.branch),r=n[t];void 0===r?n[t]=e:Array.isArray(r)?r.push(e):n[t]=[r,e]}}return n[e]||Iterator.empty}}class TransitionList extends ResourceList{create(){return{inputs:{}}}qualify(t){return"activity$"+t}siblings(t){return t.transitions||(t.transitions=new Dictionary)}unlink(t){return super.unlink(t),t.source.branches=void 0,t.source.transitions.remove(t.token),t.target.transitions.remove(t.token),void 0!==t.parent&&t.parent.transitions.remove(t.token),1}relate(t){return t.source!==t.target?[t.source.resource,t.target.resource]:t.source.resource}}const safeProps={id:!1,name:!1,components:!1,elements:!0,forms:!1,hiddenValidationIssues:!1,references:!1,steps:!1,transitions:!1,start:!1,parent:!1,source:!1,target:!1,suite:!0,path:!0};function copyResource(t,e){for(const r in t)!1!==safeProps[r]&&(e[r]=deepClone(t[r]))}function deepClone(t){if(null!=t){if(Array.isArray(t))return t.map(deepClone);if("object"==typeof t){const e={};for(const r in t){const n=t[r];null!=n&&(e[r]=n)}return e}return t}}function isObject(t){return!Array.isArray(t)&&("object"==typeof t&&null!==t)}function makeBlankProgram(){return{components:[],forms:[],hiddenValidationIssues:[],references:[],steps:[],transitions:[]}}function minifyArray(t,e){let r=0;for(let n=0;n<t.length;n++){const s=t[n];(void 0===e||e(s))&&(t[r++]=s)}return t.length=r,t.length>0?t:void 0}function branchToToken(t){return void 0!==t?"string$"+t:"blank"}function hasInputs(t){for(const e in t)return!0;return!1}function compareTransitions(t,e){return"number"==typeof t.rank?"number"==typeof e.rank?t<e?-1:t>e?1:0:-1:"number"==typeof e.rank?1:hasInputs(t)?hasInputs(e)?0:-1:hasInputs(e)?1:0}const generateToken=function(){let t,e;function r(){t=0,e="token$"+(new Date).valueOf()+"$"}r();return function(){return t>=1073741824&&r(),e+t++}}();export function parseLocale(t){if("string"!=typeof t)return;const e=t.split("-");if(e.length<1||e.length>3||e.some(t=>0===t.length))return;const r={language:e[0].toLowerCase()};return 2==e.length?2==e[1].length?r.territory=e[1].toUpperCase():r.script=e[1][0].toUpperCase()+e[1].slice(1).toLowerCase():3===e.length&&(r.script=e[1][0].toUpperCase()+e[1].slice(1).toLowerCase(),r.territory=e[2].toUpperCase()),r}export function canonicalizeLocale(t){const e=parseLocale(t);if(!e)return;let r=e.language;return e.script&&(r+="-"+e.script),e.territory&&(r+="-"+e.territory),r}
1
+ import{Dictionary,Iterator,Stash}from"../Collections.js";export class ProgramInspector{constructor(t){this.program=makeBlankProgram(),this.hiddenValidationIssues=new Set,this.incidents=new IncidentList,this.references=new ReferenceList(this.incidents),this.steps=new StepList(this.incidents),this.transitions=new TransitionList(this.incidents),this.editorId=t,this.components=new ComponentList(this.incidents),this.forms=new FormList(this.incidents)}addComponent(){return this.components.add().resource}addForm(){return this.forms.add().resource}addReference(){return this.references.add().resource}addStep(){return this.steps.add().resource}addTransition(t,e){const r=this.steps.findFor(t),n=this.steps.findFor(e);if(void 0!==r&&void 0!==n){let s=r.transitions;void 0===s&&(s=r.transitions=new Dictionary);let i=n.transitions;void 0===i&&(i=n.transitions=new Dictionary);const o=this.transitions.add(),a=o.resource;return o.source=r,a.source=t,s.assign(o.token,o),o.target=n,a.target=e,i.assign(o.token,o),r.branches=void 0,a}}all(){return iterate(this.incidents)}allComponents(){return this.components.all()}allForms(){return this.forms.all()}allReferences(){return this.references.all()}allSteps(){return this.steps.all()}allTransitions(){return this.transitions.all()}cacheComponents(){return this.components.cache()}cacheForms(){return this.forms.cache()}cacheReference(){return this.references.cache()}cacheSteps(){return this.steps.cache()}cacheTransitions(){return this.transitions.cache()}changeBranch(t,e){const r=this.transitions.findFor(t);return void 0!==r&&(r.source.branches=void 0,t.branch="string"==typeof e?e:void 0,!0)}changeParent(t,e){let r,n=this.steps.findFor(t);return void 0===n&&(n=this.transitions.findFor(t)),void 0!==n&&((null==e||(r=this.components.findFor(e),void 0!==r))&&(n.master.changeParent(n,r),!0))}changeSource(t,e){const r=this.transitions.findFor(t);if(void 0===r)return!1;const n=this.steps.findFor(e);if(void 0===n)return!1;r.source.branches=void 0,r.source!==r.target&&r.source.transitions.remove(r.token);let s=n.transitions;return void 0===s&&(s=n.transitions=new Dictionary),r.source=n,t.source=e,n.branches=void 0,s.assign(r.token,r),!0}changeStart(t){return!!this.isStep(t)&&(this.start=t,!0)}changeTarget(t,e){const r=this.transitions.findFor(t);if(void 0===r)return!1;const n=this.steps.findFor(e);if(void 0===n)return!1;r.target!==r.source&&r.target.transitions.remove(r.token);let s=n.transitions;return void 0===s&&(s=n.transitions=new Dictionary),r.target=n,t.target=e,s.assign(r.token,r),!0}exists(t){return void 0!==this.incidents.findFor(t)}export(){this.realize();const t=new ProgramInspector;t.import(this.program,!1);const e=t.program;e.steps=minifyArray(e.steps,function(t){return t.transitions=minifyArray(t.transitions,function(e){return e.source===t&&e.parent===t.parent&&(e.parent=void 0,e.source=void 0,e.target=e.target!==e.source?{id:e.target.id}:void 0,!0)}),void 0===t.parent}),e.transitions=minifyArray(e.transitions,function(t){return void 0===t.parent&&void 0!==t.source&&(t.source={id:t.source.id},t.target={id:t.target.id},!0)}),e.components=minifyArray(e.components,function(t){return t.steps=minifyArray(t.steps,function(t){return t.parent=void 0,!0}),t.transitions=minifyArray(t.transitions,function(t){return void 0!==t.parent&&(t.parent=void 0,t.source={id:t.source.id},t.target={id:t.target.id},!0)}),!0}),e.forms=minifyArray(e.forms),e.hiddenValidationIssues=minifyArray(e.hiddenValidationIssues??[]),e.references=minifyArray(e.references);const r=t.start;return e.start=void 0!==r?{id:r.id}:void 0,e}find(t){const e=this.incidents.find(t);return void 0!==e?e.resource:void 0}findComponent(t){return this.components.findWith(t)}findForm(t){return this.forms.findWith(t)}findReference(t){return this.references.findWith(t)}findStep(t){return this.steps.findWith(t)}findTransition(t){return this.transitions.findWith(t)}getDefaultLocale(){return navigator.language||"inv"}getDeploymentConfig(){return this.program.deploymentConfig||{supportedApps:{}}}getHiddenValidationIssues(){return this.hiddenValidationIssues}getStrings(t){const e=this.program.strings||{};t||(t=this.getDefaultLocale());let r={...e.inv||{}};if("inv"===t)return r;if(t=canonicalizeLocale(t)){const n=parseLocale(t).language;t!==n&&n in e&&(r={...r,...e[n]}),t in e&&(r={...r,...e[t]})}return r}import(t,e,r){if("string"==typeof t&&(t=JSON.parse(t)),"object"!=typeof t||null===t)return{};"function"!=typeof r&&(r=void 0),e=!1!==e;const n={},s={},i=new Stash,o=(t,e)=>{copyResource(t,e);let n=t.id,o=t.name;if(void 0!==r){const t=r(n,o);"number"==typeof t?(n=t,o=void 0):"string"==typeof t?(n=void 0,o=t):"object"==typeof t&&null!==t?(n=t.id,o=t.name):!0!==t&&(n=void 0,o=void 0)}"number"==typeof n&&(this.shift(e,n),s[n]=e),"string"==typeof o&&this.rename(e,o);const a="number"==typeof n?"id$"+n:"auto";return i.write(a,t,e),e};function a(t,e,r){const s=e.id;if("number"!=typeof s)return o(e,r());const i=t+s,a=n[i];return o(e,void 0===a?n[i]=r():a)}const c=()=>this.addComponent();function u(t){const e=a("component$",t,c);return y(t.steps,t=>p(t,e)),y(t.transitions,t=>v(t,e)),e}const d=()=>this.addForm();const h=()=>this.addReference();const f=()=>this.addStep(),p=(t,r)=>{const n=a("step$",t,f);return this.changeParent(n,g(t.parent,u)||n.parent||r),y(t.transitions,t=>v(t,e?r:void 0,n)),n},m=this.addStep(),l=()=>this.addTransition(m,m),v=(t,e,r)=>{const n=a("transition$",t,()=>l());this.changeParent(n,g(t.parent,u)||n.parent||e);const s=n.source!==m?n.source:void 0;this.changeSource(n,g(t.source,p)||s||r);const i=n.target!==m?n.target:void 0;return this.changeTarget(n,g(t.target,p)||i||r),n};function g(t,e){if(isObject(t)){const r=t.id,n="number"==typeof r?"id$"+r:"auto";return i.read(n,t)||e(t)}}function y(t,e){if(Array.isArray(t))for(const r of t)g(r,e)}let F;copyResource(t,this.program),y(t.components,u),y(t.forms,function(t){return a("form$",t,d)}),y(t.references,function(t){return a("reference$",t,h)}),y(t.steps,p),y(t.transitions,v),this.hiddenValidationIssues=new Set(t.hiddenValidationIssues??[]),s.start=g(t.start,p),void 0===r&&(this.start=s.start);const k=t=>(void 0===F&&(F=this.addStep(),this.changeParent(F,t)),F),I=this.relate(m);for(;I.next();){F=void 0;const t=I.current;t.source===m&&this.changeSource(t,k(t.parent)),t.target===m&&this.changeTarget(t,k(t.parent))}return this.removeStep(m),this.realize(),s}isActivity(t){return this.isStep(t)||this.isTransition(t)}isComponent(t){return void 0!==this.components.findFor(t)}isForm(t){return void 0!==this.forms.findFor(t)}isParent(t,e){return this.isActivity(e)&&e.parent===t}isReference(t){return void 0!==this.references.findFor(t)}isSource(t,e){return this.isTransition(t)&&t.source===e}isStep(t){return void 0!==this.steps.findFor(t)}isTarget(t,e){return this.isTransition(t)&&t.target===e}isTransition(t){return void 0!==this.transitions.findFor(t)}newId(t){return"number"==typeof t&&(this.incidents.nextId=t),this.incidents.newId()}realize(){this.program.components=this.allComponents().list(),this.program.forms=this.allForms().list(),this.program.hiddenValidationIssues=[...this.hiddenValidationIssues],this.program.references=this.allReferences().list(),this.program.steps=this.allSteps().list(),this.program.transitions=this.allTransitions().list(),this.program.start=this.start;const t=this.allComponents();for(;t.next();)t.current.steps=[],t.current.transitions=[];const e=this.allSteps();for(;e.next();){const t=e.current;t.transitions=[];const r=t.parent;void 0!==r&&r.steps.push(t)}const r=this.allTransitions();for(;r.next();){const t=r.current,e=t.parent;void 0!==e&&e.transitions.push(t),t.source.transitions.push(t),t.target!==t.source&&t.target.transitions.push(t)}}relate(t,e){const r=arguments.length>1?branchToToken(e):void 0;return Iterator.from(t).map(t=>this.incidents.relate(t,r))}release(){this.program.components=[],this.program.forms=[],this.program.hiddenValidationIssues=[],this.program.references=[],this.program.steps=[],this.program.transitions=[],this.program.start=void 0;const t=this.allComponents();for(;t.next();)t.current.steps=[],t.current.transitions=[];const e=this.allSteps();for(;e.next();)e.current.transitions=[]}remove(t,e){const r=t=>{let r=0;!1===e&&this.isComponent(t)&&(r+=this.remove(this.relate(t)));const n=this.incidents.findFor(t);return void 0!==n&&(r+=n.master.unlink(n),this.start===n.resource&&(this.start=void 0)),r};if(Array.isArray(t)||t instanceof Iterator){let e=0;const n=Iterator.from(t);for(;n.next();)e+=r(n.current);return e}return r(t)>0}removeComponent(t){return this.components.removeFor(t)}removeForm(t){return this.forms.removeFor(t)}removeReference(t){return this.references.removeFor(t)}removeStep(t){return!!this.steps.removeFor(t)&&(this.start===t&&(this.start=void 0),!0)}removeTransition(t){return this.transitions.removeFor(t)}rename(t,e){const r=this.incidents.findFor(t);return void 0!==r?r.master.rename(r,e):void 0}renameComponent(t,e){return this.components.renameFor(t,e)}renameForm(t,e){return this.forms.renameFor(t,e)}renameReference(t,e){return this.references.renameFor(t,e)}renameStep(t,e){return this.steps.renameFor(t,e)}renameTransition(t,e){return this.transitions.renameFor(t,e)}reset(){this.incidents.clear(),this.components.clear(),this.forms.clear(),this.references.clear(),this.steps.clear(),this.transitions.clear(),this.incidents.nextId=1,this.program=makeBlankProgram(),this.start=void 0}resolveStart(t){if("number"==typeof t)return this.findStep(t);if("string"==typeof t)return this.findStep(t);if("object"==typeof t&&null!==t){const e=t.id;if("number"==typeof e)return this.findStep(e);const r=t.name;return"string"==typeof r?this.findStep(r):void 0}return this.start}shift(t,e){const r=this.incidents.findFor(t);return void 0!==r&&r.master.shift(r,e)}shiftComponent(t,e){return this.components.shiftFor(t,e)}shiftForm(t,e){return this.forms.shiftFor(t,e)}shiftReference(t,e){return this.references.shiftFor(t,e)}shiftStep(t,e){return this.steps.shiftFor(t,e)}shiftTransition(t,e){return this.transitions.shiftFor(t,e)}toJSON(){return this.export()}}function iterate(t){if(void 0===t)return Iterator.empty;return t.iterate().filter(function(t,e){return 0===String(e).lastIndexOf("token$",0)}).map(t=>t.resource,t=>t.id)}class IncidentList extends Dictionary{constructor(){super(...arguments),this.nextId=1}findFor(t){if(null!=t){const e=this.find(t.id);if(void 0!==e&&e.resource===t)return e}}newId(){let t=this.nextId;for(;this.exists(t);)t++;return this.nextId=t+1,t}relate(t,e){const r=this.findFor(t);return void 0!==r?r.master.relate(r,e):Iterator.empty}}class ResourceList extends Dictionary{constructor(t){super(),this.incidents=t}add(){const t={},e=t.resource=this.create();return t.token=generateToken(),t.master=this,e.id=this.incidents.newId(),this.assign(t.token,t),this.incidents.assign(e.id,t),this.cacheLookup=void 0,t}all(){return iterate(this)}cache(){let t=this.cacheLookup;if(void 0!==t)return t;t=this.cacheLookup={};const e=this.iterate();for(;e.next();){const r=e.current.resource;t[r.id]=r;const n=r.name;void 0!==n&&(t["$"+n]=r)}return t}changeParent(t,e){const r=t.parent;void 0!==r&&this.siblings(r).remove(t.token),void 0!==e?(t.parent=e,t.resource.parent=e.resource,this.siblings(e).assign(t.token,t)):(t.parent=void 0,t.resource.parent=void 0)}findFor(t){const e=this.incidents.findFor(t);return this.test(e)?e:void 0}findWith(t){"string"==typeof t&&(t=this.qualify(t));const e=this.incidents.find(t);return this.test(e)?e.resource:void 0}relate(t,e){return Iterator.empty}removeFor(t){const e=this.findFor(t);return void 0!==e&&(this.unlink(e),!0)}rename(t,e){const r=t.resource.name;if(void 0!==r&&this.incidents.remove(this.qualify(r)),"string"==typeof e){const r=this.qualify(t.resource.name=e),n=this.incidents.assign(r,t);void 0!==n&&(n.resource.name=void 0)}else t.resource.name=void 0;return this.cacheLookup=void 0,r}renameFor(t,e){const r=this.findFor(t);return void 0!==r&&(this.rename(r,e),!0)}shift(t,e){this.incidents.remove(t.resource.id),"number"!=typeof e&&(e=this.incidents.newId());const r=this.incidents.assign(t.resource.id=e,t);void 0!==r&&this.incidents.assign(r.resource.id=this.incidents.newId(),r),this.cacheLookup=void 0}shiftFor(t,e){const r=this.findFor(t);return void 0!==r&&(this.shift(r,e),!0)}test(t){return void 0!==t&&t.master===this}unlink(t){this.remove(t.token),this.cacheLookup=void 0;const e=t.resource.id;this.incidents.remove(e);const r=t.resource.name;return void 0!==r&&this.incidents.remove(this.qualify(r)),1}}class ComponentList extends ResourceList{create(){return{steps:[],transitions:[]}}qualify(t){return"component$"+t}relate(t){const e=iterate(t.steps),r=iterate(t.transitions);return e.concat(r)}unlink(t){super.unlink(t);const e=t.steps;if(void 0!==e){const t=e.iterate();for(;t.next();)t.current.resource.parent=void 0}const r=t.transitions;if(void 0!==r){const t=r.iterate();for(;t.next();)t.current.resource.parent=void 0}return 1}}class FormList extends ResourceList{create(){return{defaults:{},elements:{}}}qualify(t){return"form$"+t}}class ReferenceList extends ResourceList{create(){return{suite:"",path:""}}qualify(t){return"reference$"+t}}class StepList extends ResourceList{create(){return{inputs:{},transitions:[]}}qualify(t){return"activity$"+t}relate(t,e){const r=t.transitions;if(void 0===r)return Iterator.empty;if(void 0===e)return iterate(r);let n=t.branches;if(void 0===n){n=t.branches={};for(const e of iterate(r).list().sort(compareTransitions))if(e.source===t.resource){const t=branchToToken(e.branch),r=n[t];void 0===r?n[t]=e:Array.isArray(r)?r.push(e):n[t]=[r,e]}}return n[e]||Iterator.empty}siblings(t){return t.steps||(t.steps=new Dictionary)}unlink(t){let e=super.unlink(t);void 0!==t.parent&&t.parent.steps.remove(t.token);const r=t.transitions;if(void 0!==r){const t=r.iterate();for(;t.next();)e+=t.current.master.unlink(t.current)}return e}}class TransitionList extends ResourceList{create(){return{inputs:{}}}qualify(t){return"activity$"+t}relate(t){return t.source!==t.target?[t.source.resource,t.target.resource]:t.source.resource}siblings(t){return t.transitions||(t.transitions=new Dictionary)}unlink(t){return super.unlink(t),t.source.branches=void 0,t.source.transitions.remove(t.token),t.target.transitions.remove(t.token),void 0!==t.parent&&t.parent.transitions.remove(t.token),1}}const safeProps={id:!1,name:!1,components:!1,elements:!0,forms:!1,hiddenValidationIssues:!1,references:!1,steps:!1,transitions:!1,start:!1,parent:!1,source:!1,target:!1,suite:!0,path:!0};function copyResource(t,e){for(const r in t)!1!==safeProps[r]&&(e[r]=deepClone(t[r]))}function deepClone(t){if(null!=t){if(Array.isArray(t))return t.map(deepClone);if("object"==typeof t){const e={};for(const r in t){const n=t[r];null!=n&&(e[r]=n)}return e}return t}}function isObject(t){return!Array.isArray(t)&&("object"==typeof t&&null!==t)}function makeBlankProgram(){return{components:[],forms:[],hiddenValidationIssues:[],references:[],steps:[],transitions:[]}}function minifyArray(t,e){let r=0;for(let n=0;n<t.length;n++){const s=t[n];(void 0===e||e(s))&&(t[r++]=s)}return t.length=r,t.length>0?t:void 0}function branchToToken(t){return void 0!==t?"string$"+t:"blank"}function hasInputs(t){for(const e in t)return!0;return!1}function compareTransitions(t,e){return"number"==typeof t.rank?"number"==typeof e.rank?t<e?-1:t>e?1:0:-1:"number"==typeof e.rank?1:hasInputs(t)?hasInputs(e)?0:-1:hasInputs(e)?1:0}const generateToken=function(){let t,e;function r(){t=0,e="token$"+(new Date).valueOf()+"$"}r();return function(){return t>=1073741824&&r(),e+t++}}();export function parseLocale(t){if("string"!=typeof t)return;const e=t.split("-");if(e.length<1||e.length>3||e.some(t=>0===t.length))return;const r={language:e[0].toLowerCase()};return 2==e.length?2==e[1].length?r.territory=e[1].toUpperCase():r.script=e[1][0].toUpperCase()+e[1].slice(1).toLowerCase():3===e.length&&(r.script=e[1][0].toUpperCase()+e[1].slice(1).toLowerCase(),r.territory=e[2].toUpperCase()),r}export function canonicalizeLocale(t){const e=parseLocale(t);if(!e)return;let r=e.language;return e.script&&(r+="-"+e.script),e.territory&&(r+="-"+e.territory),r}
@@ -4,8 +4,8 @@ import type { Resource } from "./Resource";
4
4
  * @product This is intended for internal use only within VertiGIS Studio products.
5
5
  */
6
6
  export interface Reference extends Resource {
7
- /** Indicates the suite to load. */
8
- suite: string;
9
7
  /** Indicates the location of the source code to load. */
10
8
  path: string;
9
+ /** Indicates the suite to load. */
10
+ suite: string;
11
11
  }
@@ -1,26 +1,26 @@
1
1
  /** Defines the resource for a program. */
2
2
  export interface Resource {
3
+ /** Indicates the description for annotation of the resource on a design surface. */
4
+ description?: string;
5
+ /** The version of VertiGIS Studio Workflow Designer used to create this workflow. */
6
+ designerVersion?: string;
3
7
  /** Indicates the identifier of the resource for id-based lookups. */
4
8
  id?: number;
9
+ /** Information about how the program is licensed. */
10
+ licenseInfo?: {
11
+ /** The url of the license endpoint for on-premises workflows. */
12
+ licenseUrl?: string;
13
+ /** The ID of the licensee that created the program. */
14
+ licenseeId?: string;
15
+ };
16
+ /** Indicates the look of the resource on a design surface. */
17
+ look?: string;
5
18
  /** Indicates the name of the resource for name-based lookups. */
6
19
  name?: string;
7
- /** Indicates the label for annotation of the resource on a design surface. */
8
- title?: string;
9
- /** Indicates the description for annotation of the resource on a design surface. */
10
- description?: string;
11
20
  /** Indicates the position of the resource on a design surface. */
12
21
  position?: string;
13
- /** Indicates the look of the resource on a design surface. */
14
- look?: string;
15
22
  /** Indicates the purpose of the resource on a design surface. */
16
23
  purpose?: string;
17
- /** Information about how the program is licensed. */
18
- licenseInfo?: {
19
- /** The ID of the licensee that created the program. */
20
- licenseeId?: string;
21
- /** The url of the license endpoint for on-premises workflows. */
22
- licenseUrl?: string;
23
- };
24
- /** The version of VertiGIS Studio Workflow Designer used to create this workflow. */
25
- designerVersion?: string;
24
+ /** Indicates the label for annotation of the resource on a design surface. */
25
+ title?: string;
26
26
  }
@@ -4,14 +4,14 @@ import type { Step } from "./Step";
4
4
  export interface Transition extends Activity {
5
5
  /** Indicates the branch of that the transition participates in. */
6
6
  branch?: string;
7
- /** Indicates the source of this transition (what was previous). */
8
- source?: Step;
9
- /** Indicates the target of this transition (what is next). */
10
- target?: Step;
11
7
  /** Indicates the precedence for this transition. */
12
8
  rank?: number;
9
+ /** Indicates the source of this transition (what was previous). */
10
+ source?: Step;
13
11
  /** Indicates the type of connector for the source on a design surface. */
14
12
  sourceConnector?: string;
13
+ /** Indicates the target of this transition (what is next). */
14
+ target?: Step;
15
15
  /** Indicates the type of connector for the target on a design surface. */
16
16
  targetConnector?: string;
17
17
  }
@@ -1,4 +1,4 @@
1
- import type { IDebugSession } from "../execution/IDebugSession";
1
+ import type ActivityContext from "../execution/ActivityContext";
2
2
  /**
3
3
  * A helper class for logging activity debug session information to the console.
4
4
  * @product This is intended for internal use only within VertiGIS Studio products.
@@ -6,5 +6,5 @@ import type { IDebugSession } from "../execution/IDebugSession";
6
6
  export declare class ConsoleDebugLogger {
7
7
  private lastId;
8
8
  /** Accepts a debug session object. */
9
- onSession(session: IDebugSession): void;
9
+ onSession(activityContext: ActivityContext | undefined, isExit?: boolean): void;
10
10
  }
@@ -1 +1 @@
1
- export class ConsoleDebugLogger{onSession(t){if(!t)return;const e=t.frame.current,s=e.activity;if(!s.action)return;const n={inputs:e.inputs,outputs:e.outputs},o=s.name?"$"+s.name:s.id,i=`${s.action} (${o})`;this.lastId===e.id?console.debug(` ${i} --\x3e`,n):(console.debug(`--\x3e ${i} `,n),this.lastId=e.id)}}
1
+ export class ConsoleDebugLogger{onSession(t,o){if(!t)return;const s=t.activity;if(!s.action)return;const e={inputs:t.inputs,outputs:t.outputs},i=s.name?"$"+s.name:s.id,n=`${s.action} (${i})`;void 0===o&&(o=this.lastId===t.id),o?console.debug(` ${n} --\x3e`,e):(console.debug(`--\x3e ${n} `,e),this.lastId=t.id)}}
@@ -30,63 +30,63 @@ type Recent = {
30
30
  * extremely important in terms of issue routing.
31
31
  */
32
32
  declare abstract class ActivityContext implements IActivityState, IActivityContext {
33
- id: any;
34
- luid: any;
35
33
  action: string;
36
34
  activity: Activity;
37
35
  ambient: AmbientState;
38
- frame: MonikerFrame;
39
- proxy: ActivityContextProxy;
40
- caught?: Error;
41
- passes: number;
42
- recent?: Recent;
43
- repeat?: boolean;
44
- state: any;
45
36
  branch?: string;
46
37
  callBranch?: boolean;
38
+ cancellationToken: Task<void>;
39
+ caught?: Error;
40
+ evaluators: Record<string, ExpressionEvaluator>;
41
+ extras: any[];
47
42
  forkBranch?: boolean;
48
- jumpBranch?: string;
49
- registeredForErrors?: boolean;
50
- stateToPersist: any;
43
+ frame: MonikerFrame;
44
+ handler?: Bluebird<IActivityHandler | undefined>;
45
+ id: any;
51
46
  inputs: Record<string, any>;
52
- outputs: Record<string, any>;
53
- extras: any[];
47
+ jumpBranch?: string;
48
+ luid: any;
54
49
  monikers: string[];
55
- handler?: Bluebird<IActivityHandler | undefined>;
56
- evaluators: Record<string, ExpressionEvaluator>;
57
- scope: Record<string, any>;
58
- cancellationToken: Task<void>;
59
- cancellationResolve: () => void;
50
+ outputs: Record<string, any>;
51
+ passes: number;
60
52
  promise: Bluebird<Error[]> | undefined;
53
+ proxy: ActivityContextProxy;
54
+ recent?: Recent;
55
+ registeredForErrors?: boolean;
56
+ repeat?: boolean;
57
+ scope: Record<string, any>;
58
+ state: any;
59
+ stateToPersist: any;
61
60
  private static filterErrors;
62
61
  private static isError;
63
62
  private static isInvalidHandler;
64
63
  private static reduceErrors;
65
- registerForErrors(): void;
66
- persist(state: any): void;
67
64
  call(branch: any): void;
65
+ cancellationResolve: () => void;
66
+ execute(): Bluebird<Error[]> | Bluebird<undefined>;
68
67
  fork(branch: any): void;
69
- jump(branch: any): void;
68
+ goto(): void;
70
69
  hasBranch(branch: any): boolean;
71
- private emitExpressionEvaluationError;
72
- private emitExpressionSyntaxError;
73
- private emitExpressionAccessorError;
74
- private emitActivityBindingError;
70
+ jump(branch: any): void;
71
+ persist(state: any): void;
72
+ registerForErrors(): void;
73
+ protected generateMonikers(): void;
74
+ protected marshalError(): Error | undefined;
75
+ private concludeInline;
75
76
  private emitActivityActivationError;
77
+ private emitActivityBindingError;
76
78
  private emitActivityError;
79
+ private emitExpressionAccessorError;
80
+ private emitExpressionEvaluationError;
81
+ private emitExpressionSyntaxError;
77
82
  private executeHandlerInline;
78
- private resolveExtrasInline;
79
- private resolveInputsInline;
80
- private resolveHandlerInline;
81
83
  private findContext;
82
- private resolveOutputsInline;
83
84
  private resolveAccessorInline;
84
85
  private resolveAssetsInline;
85
- private concludeInline;
86
- protected generateMonikers(): void;
87
- protected marshalError(): Error | undefined;
86
+ private resolveExtrasInline;
87
+ private resolveHandlerInline;
88
+ private resolveInputsInline;
89
+ private resolveOutputsInline;
88
90
  protected abstract transferInline(): void;
89
- execute(): Bluebird<Error[]> | Bluebird<undefined>;
90
- goto(): void;
91
91
  }
92
92
  export {};
@@ -1 +1 @@
1
- import Bluebird from"bluebird";import{ExpressionEvaluationError,ExpressionSyntaxError,ExpressionAccessorError,ActivityBindingError,ActivityActivationError,ActivityError,GenericActivityError,AggregateActivityError}from"../Errors.js";import{query}from"../Hooks.js";import{isAccessor,isExpression,isLiteral}from"./util.js";const echoHandler={execute:t=>t},evaluators={};function compileExpression(t,i){const e=t.code;let r=evaluators[e];if(void 0===r){const i=[],s={};i.push('"use strict"; ');const n=t.accessors;if(Array.isArray(n))for(const t of n)isAccessor(t)&&!s[t]&&(i.push(`var ${t} = this.${t};`),s[t]=!0);i.push("return "),i.push(e),i.push(";"),r=evaluators[e]=new Function("resources","values",i.join(""))}return function(){return r.call(this,i,t.values)}}class PromiseWrapper{}class ActivityContext{constructor(){this.action="",this.activity={},this.ambient={},this.frame={},this.proxy={},this.passes=0,this.inputs={},this.outputs={},this.extras=[],this.monikers=[],this.evaluators={},this.scope={},this.cancellationToken={},this.cancellationResolve=()=>{}}static filterErrors(t){return t.filter(ActivityContext.isError)}static isError(t){return void 0!==t}static isInvalidHandler(t){return null==t||"function"!=typeof t.execute}static reduceErrors(t){return t.isPending()?t.then(ActivityContext.filterErrors):t.isFulfilled()?Bluebird.resolve(ActivityContext.filterErrors(t.value())):t}registerForErrors(){this.registeredForErrors=!0}persist(t){this.stateToPersist=t}call(t){this.callBranch=!0,this.forkBranch=!1,this.jumpBranch=t}fork(t){this.callBranch=!1,this.forkBranch=!0,this.jumpBranch=t}jump(t){this.callBranch=!1,this.forkBranch=!1,this.jumpBranch=t}hasBranch(t){const i=this.activity,e=this.ambient.inspector;return e.isStep(i)&&void 0!==e.relate(i,t).peek()}emitExpressionEvaluationError(t,i){const e=this.activity.id,r=this.activity.inputs[t];return new ExpressionEvaluationError(e,t,r.source||r.code,i)}emitExpressionSyntaxError(t,i){const e=this.activity.id,r=this.activity.inputs[t];return new ExpressionSyntaxError(e,t,r.source||r.code,i)}emitExpressionAccessorError(t,i,e){return new ExpressionAccessorError(this.activity.id,t,i,e)}emitActivityBindingError(t){const i=this.activity;return new ActivityBindingError(i.id,i.action,t)}emitActivityActivationError(t,i){return new ActivityActivationError(this.activity.id,t,i)}emitActivityError(t){if(t instanceof ActivityError)return t;const i=this.activity,e=new GenericActivityError(void 0,t?.message);return e.activityId=i.id,e.error=t,e}executeHandlerInline(t){if(t.length>0||this.cancellationToken.isFulfilled())return t;const i=this.extras;for(let t=0;t<i.length;t++)i[t]=Bluebird.resolve(i[t]).value();const e=this.inputs;for(const t in e){let i=Bluebird.resolve(e[t]).value();i instanceof PromiseWrapper&&(i=i.result),e[t]=i}const r=this.proxy,s=this.handler.value(),n=Bluebird.attempt(function(){return s.execute(e,r,...i)});return n.isPending()?n.then(i=>(this.outputs=i,t),t=>[this.emitActivityError(t)]):n.isRejected()?[this.emitActivityError(n.reason())]:(this.outputs=n.value(),t)}resolveExtrasInline(){const t=query(this.handler.value());for(const i of t){const t=this.ambient.engine.activator.activate(i);if(this.extras.push(t),t.isPending())return t.then(()=>{},t=>this.emitActivityActivationError(i.type,t));if(t.isRejected())return this.emitActivityActivationError(i.type,t.reason())}}resolveInputsInline(t){if(t.length>0||this.cancellationToken.isFulfilled())return t;const i=[];i.push(this.resolveExtrasInline());const e=this.evaluators;if(void 0!==e){const t=this.scope;for(const i in t)t[i]=Bluebird.resolve(t[i]).value();const r=this.inputs;for(const s in e){const n=r[s]=Bluebird.attempt(function(){const i=e[s].call(t,void 0,void 0);if(i&&"function"==typeof i.then){const t=new PromiseWrapper;return t.result=i,t}return i});n.isPending()&&i.push(n.then(()=>{},t=>this.emitExpressionEvaluationError(s,t))),n.isRejected()&&i.push(this.emitExpressionEvaluationError(s,n.reason()))}}return ActivityContext.reduceErrors(Bluebird.all(i))}resolveHandlerInline(){const t=this.activity.action;if("string"!=typeof t)this.handler=Bluebird.resolve(echoHandler);else{const i=this.ambient,e=i.handlers;let r=this.handler=e[t];if(void 0===r){const s=i.engine,n=i.inspector;r=this.handler=e[t]=Bluebird.attempt(function(){return s.createHandler(t,n)})}if(r.isPending())return r.then(t=>ActivityContext.isInvalidHandler(t)?this.emitActivityBindingError():void 0,t=>this.emitActivityBindingError(t));if(r.isRejected())return this.emitActivityBindingError(r.reason());if(ActivityContext.isInvalidHandler(r.value()))return this.emitActivityBindingError()}}findContext(t){const i=this.ambient,e=i.stack;let r=i.frame;for(;void 0!==r;){const i=r.state[t];if(void 0!==i)return i;r=e[r.index-1]}}resolveOutputsInline(){const t=this.promise;if(t.isPending())return t.then(t=>void 0!==t&&t.length>0?Bluebird.reject(t):this.outputs,()=>{});if(t.isRejected())return Bluebird.resolve(void 0);const i=t.value();return void 0!==i&&i.length>0?Bluebird.reject(i):Bluebird.resolve(this.outputs)}resolveAccessorInline(t){const i=this.findContext(t);if(void 0!==i){const e=this.scope[t]=i.resolveOutputsInline();return e.isPending()?e.then(()=>{},i=>this.emitExpressionAccessorError(t,void 0,i)):e.isRejected()?this.emitExpressionAccessorError(t,void 0,e.reason()):void 0}const e=this.scope[t]=Bluebird.resolve(this.ambient.environment[t]);return e.isPending()?e.then(()=>{},i=>this.emitExpressionAccessorError(t,i)):e.isRejected()?this.emitExpressionAccessorError(t,e.reason()):void 0}resolveAssetsInline(){const t=[];t.push(this.resolveHandlerInline());const i=this.activity.inputs;if(null!=i){let e,r;const s=this.ambient;for(const n in i){const o=i[n];if(null!=o)if(isLiteral(o))this.inputs[n]=Bluebird.resolve(o);else if(isExpression(o)){void 0===e&&(this.scope=e={}),void 0===r&&(this.evaluators=r={});const i=o.accessors;if(Array.isArray(i))for(const r of i)"string"==typeof r&&void 0===e[r]&&t.push(this.resolveAccessorInline(r));const c=Bluebird.attempt(function(){return compileExpression(o,s.resources)});c.isFulfilled()?r[n]=c.value():t.push(this.emitExpressionSyntaxError(n,c.reason()))}else t.push(this.emitExpressionSyntaxError(n))}}return ActivityContext.reduceErrors(Bluebird.all(t))}concludeInline(t){return this.cancellationResolve(),t}generateMonikers(){const t=this.monikers,i=this.activity;t.push("$"+i.id);"string"==typeof i.name&&t.push("$"+i.name);const e=i.action;if("string"==typeof e){const i=e.split(":");if(i.length>1){const e=i[i.length-2];e.length>0&&t.push("$$"+e)}}}marshalError(){const t=this.promise.value();return t.length>1?new AggregateActivityError(this.activity.id,t):t.length>0?t[0]:void 0}execute(){let t=this.promise;const i=this.ambient;if(void 0===t){if(t=this.resolveAssetsInline(),t.isRejected())return t;if(t=t.isPending()?t.then(t=>this.resolveInputsInline(t)):Bluebird.resolve(this.resolveInputsInline(t.value())),t.isRejected())return t;if(t=t.isPending()?t.then(t=>this.executeHandlerInline(t)):Bluebird.resolve(this.executeHandlerInline(t.value())),t.isRejected())return t;if(t=t.isPending()?t.then(t=>this.concludeInline(t)):Bluebird.resolve(this.concludeInline(t.value())),t.isRejected())return t;t.isPending()&&(t=t.catch(t=>i.fail(t)),t.then(()=>i.execute())),this.generateMonikers();const e=i.frame.state;for(const t of this.monikers)e[t]=this;return this.promise=t,Bluebird.resolve(void 0)}return i.debug(i),i.halted||this.transferInline(),t}goto(){}}export default ActivityContext;
1
+ import Bluebird from"bluebird";import{ExpressionEvaluationError,ExpressionSyntaxError,ExpressionAccessorError,ActivityBindingError,ActivityActivationError,ActivityError,GenericActivityError,AggregateActivityError}from"../Errors.js";import{query}from"../Hooks.js";import{isAccessor,isExpression,isLiteral}from"./util.js";const echoHandler={execute:t=>t},evaluators={};function compileExpression(t,i){const e=t.code;let r=evaluators[e];if(void 0===r){const i=[],s={};i.push('"use strict"; ');const n=t.accessors;if(Array.isArray(n))for(const t of n)isAccessor(t)&&!s[t]&&(i.push(`var ${t} = this.${t};`),s[t]=!0);i.push("return "),i.push(e),i.push(";"),r=evaluators[e]=new Function("resources","values",i.join(""))}return function(){return r.call(this,i,t.values)}}class PromiseWrapper{}class ActivityContext{constructor(){this.action="",this.activity={},this.ambient={},this.cancellationToken={},this.evaluators={},this.extras=[],this.frame={},this.inputs={},this.monikers=[],this.outputs={},this.passes=0,this.proxy={},this.scope={},this.cancellationResolve=()=>{}}static filterErrors(t){return t.filter(ActivityContext.isError)}static isError(t){return void 0!==t}static isInvalidHandler(t){return null==t||"function"!=typeof t.execute}static reduceErrors(t){return t.isPending()?t.then(ActivityContext.filterErrors):t.isFulfilled()?Bluebird.resolve(ActivityContext.filterErrors(t.value())):t}call(t){this.callBranch=!0,this.forkBranch=!1,this.jumpBranch=t}execute(){let t=this.promise;const i=this.ambient;if(void 0===t){if(t=this.resolveAssetsInline(),t.isRejected())return t;if(t=t.isPending()?t.then(t=>this.resolveInputsInline(t)):Bluebird.resolve(this.resolveInputsInline(t.value())),t.isRejected())return t;if(t=t.isPending()?t.then(t=>this.executeHandlerInline(t)):Bluebird.resolve(this.executeHandlerInline(t.value())),t.isRejected())return t;if(t=t.isPending()?t.then(t=>this.concludeInline(t)):Bluebird.resolve(this.concludeInline(t.value())),t.isRejected())return t;t.isPending()&&(t=t.catch(t=>i.fail(t)),t.then(()=>i.execute())),this.generateMonikers();const e=i.frame.state;for(const t of this.monikers)e[t]=this;return this.promise=t,Bluebird.resolve(void 0)}return i.debug(i.frame?.current),i.halted||this.transferInline(),t}fork(t){this.callBranch=!1,this.forkBranch=!0,this.jumpBranch=t}goto(){}hasBranch(t){const i=this.activity,e=this.ambient.inspector;return e.isStep(i)&&void 0!==e.relate(i,t).peek()}jump(t){this.callBranch=!1,this.forkBranch=!1,this.jumpBranch=t}persist(t){this.stateToPersist=t}registerForErrors(){this.registeredForErrors=!0}generateMonikers(){const t=this.monikers,i=this.activity;t.push("$"+i.id);"string"==typeof i.name&&t.push("$"+i.name);const e=i.action;if("string"==typeof e){const i=e.split(":");if(i.length>1){const e=i[i.length-2];e.length>0&&t.push("$$"+e)}}}marshalError(){const t=this.promise.value();return t.length>1?new AggregateActivityError(this.activity.id,t):t.length>0?t[0]:void 0}concludeInline(t){return this.cancellationResolve(),t}emitActivityActivationError(t,i){return new ActivityActivationError(this.activity.id,t,i)}emitActivityBindingError(t){const i=this.activity;return new ActivityBindingError(i.id,i.action,t)}emitActivityError(t){if(t instanceof ActivityError)return t;const i=this.activity,e=new GenericActivityError(void 0,t?.message);return e.activityId=i.id,e.error=t,e}emitExpressionAccessorError(t,i,e){return new ExpressionAccessorError(this.activity.id,t,i,e)}emitExpressionEvaluationError(t,i){const e=this.activity.id,r=this.activity.inputs[t];return new ExpressionEvaluationError(e,t,r.source||r.code,i)}emitExpressionSyntaxError(t,i){const e=this.activity.id,r=this.activity.inputs[t];return new ExpressionSyntaxError(e,t,r.source||r.code,i)}executeHandlerInline(t){if(t.length>0||this.cancellationToken.isFulfilled())return t;const i=this.extras;for(let t=0;t<i.length;t++)i[t]=Bluebird.resolve(i[t]).value();const e=this.inputs;for(const t in e){let i=Bluebird.resolve(e[t]).value();i instanceof PromiseWrapper&&(i=i.result),e[t]=i}const r=this.proxy,s=this.handler.value(),n=Bluebird.attempt(function(){return s.execute(e,r,...i)});return n.isPending()?n.then(i=>(this.outputs=i,t),t=>[this.emitActivityError(t)]):n.isRejected()?[this.emitActivityError(n.reason())]:(this.outputs=n.value(),t)}findContext(t){const i=this.ambient,e=i.stack;let r=i.frame;for(;void 0!==r;){const i=r.state[t];if(void 0!==i)return i;r=e[r.index-1]}}resolveAccessorInline(t){const i=this.findContext(t);if(void 0!==i){const e=this.scope[t]=i.resolveOutputsInline();return e.isPending()?e.then(()=>{},i=>this.emitExpressionAccessorError(t,void 0,i)):e.isRejected()?this.emitExpressionAccessorError(t,void 0,e.reason()):void 0}const e=this.scope[t]=Bluebird.resolve(this.ambient.environment[t]);return e.isPending()?e.then(()=>{},i=>this.emitExpressionAccessorError(t,i)):e.isRejected()?this.emitExpressionAccessorError(t,e.reason()):void 0}resolveAssetsInline(){const t=[];t.push(this.resolveHandlerInline());const i=this.activity.inputs;if(null!=i){let e,r;const s=this.ambient;for(const n in i){const o=i[n];if(null!=o)if(isLiteral(o))this.inputs[n]=Bluebird.resolve(o);else if(isExpression(o)){void 0===e&&(this.scope=e={}),void 0===r&&(this.evaluators=r={});const i=o.accessors;if(Array.isArray(i))for(const r of i)"string"==typeof r&&void 0===e[r]&&t.push(this.resolveAccessorInline(r));const c=Bluebird.attempt(function(){return compileExpression(o,s.resources)});c.isFulfilled()?r[n]=c.value():t.push(this.emitExpressionSyntaxError(n,c.reason()))}else t.push(this.emitExpressionSyntaxError(n))}}return ActivityContext.reduceErrors(Bluebird.all(t))}resolveExtrasInline(){const t=query(this.handler.value());for(const i of t){const t=this.ambient.engine.activator.activate(i);if(this.extras.push(t),t.isPending())return t.then(()=>{},t=>this.emitActivityActivationError(i.type,t));if(t.isRejected())return this.emitActivityActivationError(i.type,t.reason())}}resolveHandlerInline(){const t=this.activity.action;if("string"!=typeof t)this.handler=Bluebird.resolve(echoHandler);else{const i=this.ambient,e=i.handlers;let r=this.handler=e[t];if(void 0===r){const s=i.engine,n=i.inspector;r=this.handler=e[t]=Bluebird.attempt(function(){return s.createHandler(t,n)})}if(r.isPending())return r.then(t=>ActivityContext.isInvalidHandler(t)?this.emitActivityBindingError():void 0,t=>this.emitActivityBindingError(t));if(r.isRejected())return this.emitActivityBindingError(r.reason());if(ActivityContext.isInvalidHandler(r.value()))return this.emitActivityBindingError()}}resolveInputsInline(t){if(t.length>0||this.cancellationToken.isFulfilled())return t;const i=[];i.push(this.resolveExtrasInline());const e=this.evaluators;if(void 0!==e){const t=this.scope;for(const i in t)t[i]=Bluebird.resolve(t[i]).value();const r=this.inputs;for(const s in e){const n=r[s]=Bluebird.attempt(function(){const i=e[s].call(t,void 0,void 0);if(i&&"function"==typeof i.then){const t=new PromiseWrapper;return t.result=i,t}return i});n.isPending()&&i.push(n.then(()=>{},t=>this.emitExpressionEvaluationError(s,t))),n.isRejected()&&i.push(this.emitExpressionEvaluationError(s,n.reason()))}}return ActivityContext.reduceErrors(Bluebird.all(i))}resolveOutputsInline(){const t=this.promise;if(t.isPending())return t.then(t=>void 0!==t&&t.length>0?Bluebird.reject(t):this.outputs,()=>{});if(t.isRejected())return Bluebird.resolve(void 0);const i=t.value();return void 0!==i&&i.length>0?Bluebird.reject(i):Bluebird.resolve(this.outputs)}}export default ActivityContext;
@@ -5,20 +5,20 @@ import type { IActivityContext } from "../IActivityHandler";
5
5
  * A proxy of the ActivityContext so that callers cannot influence the guts of the engine.
6
6
  */
7
7
  declare class ActivityContextProxy extends Proxy<ActivityContext> implements IActivityContext {
8
- get luid(): any;
9
- get ambient(): import("./AmbientStateProxy").default;
10
8
  get action(): string;
9
+ get ambient(): import("./AmbientStateProxy").default;
11
10
  get branch(): string | undefined;
12
11
  get cancellationToken(): import("../Task").Task<void>;
13
- get passes(): number;
14
12
  get caught(): Error | undefined;
13
+ get luid(): any;
14
+ get passes(): number;
15
+ get state(): any;
15
16
  call(branch?: boolean | number | string): void;
16
17
  fork(branch?: boolean | number | string): void;
17
- jump(branch?: boolean | number | string): void;
18
+ goto(): void;
18
19
  hasBranch(branch?: boolean | number | string): boolean;
19
- get state(): any;
20
- registerForErrors(): void;
20
+ jump(branch?: boolean | number | string): void;
21
21
  persist(value: any): void;
22
- goto(): void;
22
+ registerForErrors(): void;
23
23
  }
24
24
  export {};
@@ -1 +1 @@
1
- import Proxy,{clearGuard}from"./Proxy.js";class ActivityContextProxy extends Proxy{get luid(){return clearGuard(),this.target.luid}get ambient(){return clearGuard(),this.target.ambient.proxy}get action(){return clearGuard(),this.target.action}get branch(){return clearGuard(),this.target.branch}get cancellationToken(){return clearGuard(),this.target.cancellationToken}get passes(){return clearGuard(),this.target.passes}get caught(){return clearGuard(),this.target.caught}call(r){return clearGuard(),this.target.call(r)}fork(r){return clearGuard(),this.target.fork(r)}jump(r){return clearGuard(),this.target.jump(r)}hasBranch(r){return clearGuard(),this.target.hasBranch(r)}get state(){return clearGuard(),this.target.state}registerForErrors(){return clearGuard(),this.target.registerForErrors()}persist(r){return clearGuard(),this.target.persist(r)}goto(){return clearGuard(),this.target.goto()}}export default ActivityContextProxy;
1
+ import Proxy,{clearGuard}from"./Proxy.js";class ActivityContextProxy extends Proxy{get action(){return clearGuard(),this.target.action}get ambient(){return clearGuard(),this.target.ambient.proxy}get branch(){return clearGuard(),this.target.branch}get cancellationToken(){return clearGuard(),this.target.cancellationToken}get caught(){return clearGuard(),this.target.caught}get luid(){return clearGuard(),this.target.luid}get passes(){return clearGuard(),this.target.passes}get state(){return clearGuard(),this.target.state}call(r){return clearGuard(),this.target.call(r)}fork(r){return clearGuard(),this.target.fork(r)}goto(){return clearGuard(),this.target.goto()}hasBranch(r){return clearGuard(),this.target.hasBranch(r)}jump(r){return clearGuard(),this.target.jump(r)}persist(r){return clearGuard(),this.target.persist(r)}registerForErrors(){return clearGuard(),this.target.registerForErrors()}}export default ActivityContextProxy;
@@ -21,54 +21,54 @@ import type { LogLevel } from "../diagnostics/logging";
21
21
  * presently executing.
22
22
  */
23
23
  declare class AmbientState implements IDebugSession, IAmbientState {
24
- debug: (session: IDebugSession) => void;
24
+ asyncActivities: Record<number, AsyncActivityInfo>;
25
+ cancellationToken: Task<void>;
26
+ completion: Bluebird<object>;
25
27
  engine: Engine;
26
- inspector: ProgramInspector;
27
- id: string;
28
28
  environment: Record<string, any>;
29
29
  error: Error | undefined;
30
+ frame: MonikerFrame | undefined;
31
+ halted: boolean;
32
+ handlers: Record<string, Bluebird<IActivityHandler | undefined>>;
33
+ id: string;
34
+ inline: boolean;
30
35
  inputs: Record<string, any>;
31
- resources?: Record<string, any>;
36
+ inspector: ProgramInspector;
32
37
  locale: string | undefined;
33
38
  logLevel: LogLevel | undefined;
34
39
  outputs: Record<string, any>;
35
40
  printingServiceUrl: string | undefined;
36
- removeExternalEventHandler: (callback: ExternalEventCallback) => void;
37
- setExternalEventHandler: (callback: ExternalEventCallback) => void;
38
- trivia: Record<string, any> | undefined;
39
- asyncActivities: Record<number, AsyncActivityInfo>;
40
- frame: MonikerFrame | undefined;
41
+ proxy: AmbientStateProxy;
41
42
  queue: Transition[];
43
+ resources?: Record<string, any>;
44
+ scheduler: Bluebird<void>;
42
45
  stack: MonikerFrame[];
43
- handlers: Record<string, Bluebird<IActivityHandler | undefined>>;
46
+ trivia: Record<string, any> | undefined;
44
47
  get activityContexts(): Record<string, ActivityContext>;
45
- cancellationResolve: () => void;
46
- cancellationToken: Task<void>;
47
- completion: Bluebird<object>;
48
- resolveCompletion: (result: object) => void;
49
- rejectCompletion: (error: any) => void;
50
- scheduler: Bluebird<void>;
51
- proxy: AmbientStateProxy;
52
- inline: boolean;
53
- halted: boolean;
54
48
  private static createLinkedCancellationToken;
49
+ attempt(transition: Transition): void;
55
50
  break(): void;
51
+ bubble(error: Error): void;
52
+ call(): void;
53
+ cancel(): void;
54
+ cancellationResolve: () => void;
55
+ complete(outputs?: object): void;
56
56
  continue(): void;
57
+ debug: (activityContext: ActivityContext | undefined, isExit?: boolean) => void;
58
+ enqueue(step: Step, branch?: string): void;
57
59
  execute(action?: () => void): boolean;
58
- complete(outputs?: object): void;
59
- reject(error?: any): void;
60
60
  fail(thrown?: any): void;
61
- cancel(): void;
62
- push(): MonikerFrame;
63
- pop(error?: Error): MonikerFrame | undefined;
64
- call(): void;
65
61
  fork(): void;
66
- bubble(error: Error): void;
62
+ goto(frame: MonikerFrame): boolean;
67
63
  next(): void;
64
+ pop(error?: Error): MonikerFrame | undefined;
68
65
  prepare(next: ActivityContext, context?: ActivityContext, caught?: Error): void;
69
- attempt(transition: Transition): void;
66
+ push(): MonikerFrame;
67
+ reject(error?: any): void;
68
+ rejectCompletion: (error: any) => void;
69
+ removeExternalEventHandler: (callback: ExternalEventCallback) => void;
70
+ resolveCompletion: (result: object) => void;
71
+ setExternalEventHandler: (callback: ExternalEventCallback) => void;
70
72
  start(step: Step, context?: ActivityContext, caught?: Error): void;
71
- enqueue(step: Step, branch?: string): void;
72
- goto(frame: MonikerFrame): boolean;
73
73
  }
74
74
  export {};
@@ -1 +1 @@
1
- import Bluebird from"bluebird";import{ActivityCancellationError,EngineRuntimeError}from"../Errors.js";import{Task}from"../Task.js";import ActivityContextProxy from"./ActivityContextProxy.js";import AsyncContext from"./AsyncContext.js";import MonikerFrame from"./MonikerFrame.js";import StepContext from"./StepContext.js";import TransitionContext from"./TransitionContext.js";import{newSymbol}from"./util.js";class AmbientState{constructor(){this.debug=()=>{},this.engine={},this.inspector={},this.id="",this.environment={},this.inputs={},this.outputs={},this.removeExternalEventHandler=t=>{},this.setExternalEventHandler=t=>{},this.asyncActivities={},this.frame=new MonikerFrame,this.queue=[],this.stack=[],this.handlers={},this.cancellationResolve=()=>{},this.cancellationToken={},this.completion={},this.resolveCompletion=()=>{},this.rejectCompletion=()=>{},this.scheduler={},this.proxy={},this.inline=!1,this.halted=!1}get activityContexts(){const t={},e=[...this.stack,this.frame];for(const i of e)for(const e of Object.entries(i.state))t[e[0]]=e[1];return t}static createLinkedCancellationToken(t,e){const i=Task.race([new Task(e),t]),n=new AbortController;return i.signal=n.signal,i.finally(()=>n.abort()),i}break(){this.halted=!0}continue(){this.halted=!1,(void 0===this.scheduler||this.scheduler.isFulfilled())&&(this.scheduler=Bluebird.resolve(void 0).then(()=>{this.execute()}))}execute(t){if(this.inline)return!1;this.inline=!0;try{void 0!==t&&t();const e=this.completion;for(;e.isPending();){if(this.halted)return!1;const t=this.frame.current.execute();if(t.isPending())break;t.isRejected()&&this.fail(t.reason())}}catch(t){this.fail(t)}finally{this.inline=!1}return!0}complete(t){this.completion.isPending()&&(this.cancellationResolve(),this.resolveCompletion(t||this.outputs))}reject(t){this.completion.isPending()&&(this.cancellationResolve(),this.rejectCompletion(t||this.error))}fail(t){this.completion.isPending()&&(this.cancellationResolve(),this.rejectCompletion(new EngineRuntimeError(t)))}cancel(){this.completion.isPending()&&(this.cancellationResolve(),this.rejectCompletion(new ActivityCancellationError))}push(){const t=this.stack;t.push(this.frame);const e=this.frame=new MonikerFrame;return e.index=t.length,e}pop(t){const e=this.frame;if(void 0!==e){e.current=void 0;const t=e.cancellationResolve;void 0!==t&&t()}const i=this.frame=this.stack.pop();if(void 0===i){const e=Object.values(this.asyncActivities).filter(t=>!t.finished);if(e.length>0){const i=t=>t.activity.name?`$${t.activity.name}`:`${t.activity.id} [${t.activity.action}]`,n=1===e.length?"The workflow finished before this asynchronous activity finished execution:":"The workflow finished before these asynchronous activities finished execution:";t=new Error(`${n} ${e.map(t=>i(t.context)).join(", ")}\nEither use the outputs of an asynchronous activity or use the 'Await Asynchronous Activity' activity to ensure it has finished execution.`)}void 0!==t?this.reject(t):this.complete()}return i}call(){const t=this.frame,e=this.push();e.cancellationToken=t.cancellationToken,e.state=t.state}fork(){const t=this.push();t.cancellationToken=AmbientState.createLinkedCancellationToken(this.cancellationToken,e=>t.cancellationResolve=e),t.state={}}bubble(t){let e=this.pop(t);for(;void 0!==e&&!e.current.registeredForErrors;)e=this.pop(t);if(void 0!==e){const i=e.current;this.start(i.activity,i,t)}}next(){const t=this.queue.pop();if(void 0!==t)this.attempt(t);else{const t=this.pop();if(void 0!==t){const e=t.current;this.start(e.activity,e)}}}prepare(t,e,i){const n=t.frame=this.frame;if(n.current=t,t.luid=this.id+":"+t.activity.id,t.action=t.activity.action,t.ambient=this,t.id=newSymbol(),t.caught=i,t.cancellationToken=AmbientState.createLinkedCancellationToken(n.cancellationToken,e=>t.cancellationResolve=e),t.proxy=new ActivityContextProxy(t),void 0!==e){const i=t.recent=e.recent||(e.recent={}),n=i.context||e;i.context=t,t.passes=n.passes+1,t.stateToPersist=t.state=n.stateToPersist}else t.passes=0}attempt(t){const e=new TransitionContext;e.activity=t,e.branch=t.branch,this.prepare(e)}start(t,e,i){let n;n=t.async?new AsyncContext:new StepContext,n.activity=t,n.monikers.push("$"),this.prepare(n,e,i)}enqueue(t,e){const i=this.inspector;this.queue=i.relate(t,e).list(),this.next()}goto(t){const e=this.stack,i=t.index;for(;e[i]===t;)this.pop();return t===this.frame}}export default AmbientState;
1
+ import Bluebird from"bluebird";import{ActivityCancellationError,EngineRuntimeError}from"../Errors.js";import{Task}from"../Task.js";import ActivityContextProxy from"./ActivityContextProxy.js";import AsyncContext from"./AsyncContext.js";import MonikerFrame from"./MonikerFrame.js";import StepContext from"./StepContext.js";import TransitionContext from"./TransitionContext.js";import{newSymbol}from"./util.js";class AmbientState{constructor(){this.asyncActivities={},this.cancellationToken={},this.completion={},this.engine={},this.environment={},this.frame=new MonikerFrame,this.halted=!1,this.handlers={},this.id="",this.inline=!1,this.inputs={},this.inspector={},this.outputs={},this.proxy={},this.queue=[],this.scheduler={},this.stack=[],this.cancellationResolve=()=>{},this.debug=()=>{},this.rejectCompletion=()=>{},this.removeExternalEventHandler=t=>{},this.resolveCompletion=()=>{},this.setExternalEventHandler=t=>{}}get activityContexts(){const t={},e=[...this.stack,this.frame];for(const i of e)for(const e of Object.entries(i.state))t[e[0]]=e[1];return t}static createLinkedCancellationToken(t,e){const i=Task.race([new Task(e),t]),n=new AbortController;return i.signal=n.signal,i.finally(()=>n.abort()),i}attempt(t){const e=new TransitionContext;e.activity=t,e.branch=t.branch,this.prepare(e)}break(){this.halted=!0}bubble(t){let e=this.pop(t);for(;void 0!==e&&!e.current.registeredForErrors;)e=this.pop(t);if(void 0!==e){const i=e.current;this.start(i.activity,i,t)}}call(){const t=this.frame,e=this.push();e.cancellationToken=t.cancellationToken,e.state=t.state}cancel(){this.completion.isPending()&&(this.cancellationResolve(),this.rejectCompletion(new ActivityCancellationError))}complete(t){this.completion.isPending()&&(this.cancellationResolve(),this.resolveCompletion(t||this.outputs))}continue(){this.halted=!1,(void 0===this.scheduler||this.scheduler.isFulfilled())&&(this.scheduler=Bluebird.resolve(void 0).then(()=>{this.execute()}))}enqueue(t,e){const i=this.inspector;this.queue=i.relate(t,e).list(),this.next()}execute(t){if(this.inline)return!1;this.inline=!0;try{void 0!==t&&t();const e=this.completion;for(;e.isPending();){if(this.halted)return!1;const t=this.frame.current.execute();if(t.isPending())break;t.isRejected()&&this.fail(t.reason())}}catch(t){this.fail(t)}finally{this.inline=!1}return!0}fail(t){this.completion.isPending()&&(this.cancellationResolve(),this.rejectCompletion(new EngineRuntimeError(t)))}fork(){const t=this.push();t.cancellationToken=AmbientState.createLinkedCancellationToken(this.cancellationToken,e=>t.cancellationResolve=e),t.state={}}goto(t){const e=this.stack,i=t.index;for(;e[i]===t;)this.pop();return t===this.frame}next(){const t=this.queue.pop();if(void 0!==t)this.attempt(t);else{const t=this.pop();if(void 0!==t){const e=t.current;this.start(e.activity,e)}}}pop(t){const e=this.frame;if(void 0!==e){e.current=void 0;const t=e.cancellationResolve;void 0!==t&&t()}const i=this.frame=this.stack.pop();if(void 0===i){const e=Object.values(this.asyncActivities).filter(t=>!t.finished);if(e.length>0){const i=t=>t.activity.name?`$${t.activity.name}`:`${t.activity.id} [${t.activity.action}]`,n=1===e.length?"The workflow finished before this asynchronous activity finished execution:":"The workflow finished before these asynchronous activities finished execution:";t=new Error(`${n} ${e.map(t=>i(t.context)).join(", ")}\nEither use the outputs of an asynchronous activity or use the 'Await Asynchronous Activity' activity to ensure it has finished execution.`)}void 0!==t?this.reject(t):this.complete()}return i}prepare(t,e,i){const n=t.frame=this.frame;if(n.current=t,t.luid=this.id+":"+t.activity.id,t.action=t.activity.action,t.ambient=this,t.id=newSymbol(),t.caught=i,t.cancellationToken=AmbientState.createLinkedCancellationToken(n.cancellationToken,e=>t.cancellationResolve=e),t.proxy=new ActivityContextProxy(t),void 0!==e){const i=t.recent=e.recent||(e.recent={}),n=i.context||e;i.context=t,t.passes=n.passes+1,t.stateToPersist=t.state=n.stateToPersist}else t.passes=0}push(){const t=this.stack;t.push(this.frame);const e=this.frame=new MonikerFrame;return e.index=t.length,e}reject(t){this.completion.isPending()&&(this.cancellationResolve(),this.rejectCompletion(t||this.error))}start(t,e,i){let n;n=t.async?new AsyncContext:new StepContext,n.activity=t,n.monikers.push("$"),this.prepare(n,e,i)}}export default AmbientState;
@@ -7,23 +7,23 @@ import type { LogLevel } from "../diagnostics/logging";
7
7
  * A proxy of the AmbientState so that callers cannot influence the guts of the engine.
8
8
  */
9
9
  declare class AmbientStateProxy extends Proxy<AmbientState> implements IAmbientState {
10
- get outputs(): object;
11
- set outputs(outputs: object);
12
- get error(): Error | undefined;
13
- set error(error: Error | undefined);
10
+ get activityContexts(): Record<string, import("./ActivityContext").default>;
14
11
  get completion(): Bluebird<object>;
15
- complete(outputs?: object): void;
16
- reject(error?: Error): void;
17
12
  get environment(): Record<string, any>;
13
+ get error(): Error | undefined;
18
14
  get inputs(): Record<string, any>;
19
- get activityContexts(): Record<string, import("./ActivityContext").default>;
20
15
  get locale(): string | undefined;
21
16
  get logLevel(): LogLevel | undefined;
22
- set logLevel(level: LogLevel | undefined);
17
+ get outputs(): object;
23
18
  get printingServiceUrl(): string | undefined;
24
- removeExternalEventHandler(callback: ExternalEventCallback): void;
25
19
  get resources(): Record<string, any> | undefined;
26
- setExternalEventHandler(callback: ExternalEventCallback): void;
27
20
  get trivia(): Record<string, any> | undefined;
21
+ set error(error: Error | undefined);
22
+ set logLevel(level: LogLevel | undefined);
23
+ set outputs(outputs: object);
24
+ complete(outputs?: object): void;
25
+ reject(error?: Error): void;
26
+ removeExternalEventHandler(callback: ExternalEventCallback): void;
27
+ setExternalEventHandler(callback: ExternalEventCallback): void;
28
28
  }
29
29
  export {};
@@ -1 +1 @@
1
- import Proxy,{clearGuard}from"./Proxy.js";class AmbientStateProxy extends Proxy{get outputs(){return clearGuard(),this.target.outputs}set outputs(t){clearGuard(),this.target.outputs=t}get error(){return clearGuard(),this.target.error}set error(t){clearGuard(),this.target.error=t}get completion(){return clearGuard(),this.target.completion}complete(t){return clearGuard(),this.target.complete(t)}reject(t){return clearGuard(),this.target.reject(t)}get environment(){return clearGuard(),this.target.environment}get inputs(){return clearGuard(),this.target.inputs}get activityContexts(){return clearGuard(),this.target.activityContexts}get locale(){return clearGuard(),this.target.locale}get logLevel(){return clearGuard(),this.target.logLevel}set logLevel(t){clearGuard(),this.target.logLevel=t}get printingServiceUrl(){return clearGuard(),this.target.printingServiceUrl}removeExternalEventHandler(t){return clearGuard(),this.target.removeExternalEventHandler(t)}get resources(){return clearGuard(),this.target.resources}setExternalEventHandler(t){return clearGuard(),this.target.setExternalEventHandler(t)}get trivia(){return clearGuard(),this.target.trivia}}export default AmbientStateProxy;
1
+ import Proxy,{clearGuard}from"./Proxy.js";class AmbientStateProxy extends Proxy{get activityContexts(){return clearGuard(),this.target.activityContexts}get completion(){return clearGuard(),this.target.completion}get environment(){return clearGuard(),this.target.environment}get error(){return clearGuard(),this.target.error}get inputs(){return clearGuard(),this.target.inputs}get locale(){return clearGuard(),this.target.locale}get logLevel(){return clearGuard(),this.target.logLevel}get outputs(){return clearGuard(),this.target.outputs}get printingServiceUrl(){return clearGuard(),this.target.printingServiceUrl}get resources(){return clearGuard(),this.target.resources}get trivia(){return clearGuard(),this.target.trivia}set error(t){clearGuard(),this.target.error=t}set logLevel(t){clearGuard(),this.target.logLevel=t}set outputs(t){clearGuard(),this.target.outputs=t}complete(t){return clearGuard(),this.target.complete(t)}reject(t){return clearGuard(),this.target.reject(t)}removeExternalEventHandler(t){return clearGuard(),this.target.removeExternalEventHandler(t)}setExternalEventHandler(t){return clearGuard(),this.target.setExternalEventHandler(t)}}export default AmbientStateProxy;
@@ -5,7 +5,7 @@ export interface AsyncActivityInfo {
5
5
  finished: boolean;
6
6
  }
7
7
  declare class AsyncContext extends ActivityContext {
8
- transferInline(): void;
9
8
  execute(): Bluebird<undefined>;
9
+ transferInline(): void;
10
10
  }
11
11
  export {};
@@ -1 +1 @@
1
- import Bluebird from"bluebird";import ActivityContext from"./ActivityContext.js";class AsyncContext extends ActivityContext{transferInline(){this.ambient.enqueue(this.activity)}execute(){super.execute();const t={context:this,finished:!1};return this.ambient.asyncActivities[this.activity.id]=t,this.promise.finally(()=>{t.finished=!0}),Bluebird.resolve(void 0)}}export default AsyncContext;
1
+ import Bluebird from"bluebird";import ActivityContext from"./ActivityContext.js";class AsyncContext extends ActivityContext{execute(){if(super.execute(),void 0===this.ambient.asyncActivities[this.activity.id]){const t=this.frame.current,i={context:this,finished:!1};this.ambient.asyncActivities[this.activity.id]=i,this.promise.finally(()=>{i.finished=!0,this.ambient.debug(t,!0)})}return Bluebird.resolve(void 0)}transferInline(){this.ambient.enqueue(this.activity)}}export default AsyncContext;
@@ -2,8 +2,7 @@ import { Activator } from "../Activator";
2
2
  import { Task } from "../Task";
3
3
  import { ProgramInspector } from "../definition/ProgramInspector";
4
4
  import type { ExternalEvent, ExternalEventCallback } from "./ExternalEvent";
5
- import type { IDebugSession } from "./IDebugSession";
6
- import type { IActivityHandler } from "../IActivityHandler";
5
+ import type { IActivityContext, IActivityHandler } from "../IActivityHandler";
7
6
  import type { Program } from "../definition/Program";
8
7
  import type { Step } from "../definition/Step";
9
8
  import type { LogLevel } from "../diagnostics/logging";
@@ -16,15 +15,15 @@ export interface RunOptions {
16
15
  /** Indicates a completion promise that is raced with the underlying promise (cancellation). */
17
16
  cancellationToken?: PromiseLike<any>;
18
17
  /** Indicates a debugger callback. */
19
- debug?: (session: IDebugSession) => void;
18
+ debug?: (activityContext: IActivityContext | undefined, isExit?: boolean) => void;
20
19
  /** Indicates any environment that may be relevant to the program being run. */
21
20
  environment?: object;
21
+ /** Indicates any inputs that may be relevant to the program being run. */
22
+ inputs?: object;
22
23
  /** Indicates the locale for the program being run. */
23
24
  locale?: string;
24
25
  /** Indicates the logging level for the program being run. */
25
26
  logLevel?: LogLevel;
26
- /** Indicates any inputs that may be relevant to the program being run. */
27
- inputs?: object;
28
27
  /** The printing engine URL used for sending print requests. */
29
28
  printingServiceUrl?: string;
30
29
  /** Indicates the start step to start at. */
@@ -58,46 +57,46 @@ export interface IActivityHandlerFactory {
58
57
  * @product This is intended for internal use only within VertiGIS Studio products.
59
58
  */
60
59
  export declare class Engine {
61
- constructor(appSkuCode?: string);
62
- private _getFormElementRegistration;
63
- private _registerFormElement;
64
- /** Indicates the SKU code of the app being run. */
65
- appSkuCode: string | undefined;
66
60
  /** Indicates the activator to use for any workflow. */
67
61
  activator: Activator;
62
+ /** Indicates the SKU code of the app being run. */
63
+ appSkuCode: string | undefined;
68
64
  /** Indicates the default environment for any workflow. */
69
65
  environment: {};
70
- /** Callback function to send a new External Event to a Display Form activity. */
71
- private externalEventCallback;
72
- /**
73
- * Registers the supplied callback function as the event handler for external events, received from the host application.
74
- * @param callback The function to be called whenever an external event is received.
75
- */
76
- setExternalEventHandler(callback: ExternalEventCallback): void;
77
- /**
78
- * Removes the supplied callback function as the event handler for external events, received from the host application.
79
- * @param callback The function to be unregistered.
80
- */
81
- removeExternalEventHandler(callback: ExternalEventCallback): void;
82
- /** Indicates the default trivia for any workflow. */
83
- trivia: Record<string, any>;
84
66
  /** Indicates the factories to use to create activity handlers. */
85
67
  factories: IActivityHandlerFactory[];
68
+ formElements: Record<string, FormElementRegistration<any>>;
86
69
  /** Indicates the implementations to use to create activity handlers. */
87
70
  implementations: Record<string, IActivityHandlerImplementation>;
88
- formElements: Record<string, FormElementRegistration<any>>;
71
+ /** Indicates the default trivia for any workflow. */
72
+ trivia: Record<string, any>;
73
+ /** Callback function to send a new External Event to a Display Form activity. */
74
+ private externalEventCallback;
75
+ constructor(appSkuCode?: string);
89
76
  /** Builds the run options, augmenting the environment. */
90
77
  static buildOptions(inspector: ProgramInspector, options: RunOptions | undefined): RunOptions;
91
78
  /** Creates a handler for the given action. */
92
79
  createHandler(action: string, inspector?: ProgramInspector): PromiseLike<IActivityHandler | undefined> | IActivityHandler | undefined;
93
- /** Runs a program and returns a promise for the outputs. */
94
- run(document: Program, options?: RunOptions): Task<object>;
95
- run(inspector: ProgramInspector, options?: RunOptions): Task<object>;
96
80
  /**
97
81
  * Adds an event from an external source (the host application) to the current workflow.
98
82
  * This will be ignored unless there is currently a callback function registered to process it.
99
83
  * @param event The event to be sent to the workflow.
100
84
  */
101
85
  enqueueExternalEvent(event: ExternalEvent): void;
86
+ /**
87
+ * Removes the supplied callback function as the event handler for external events, received from the host application.
88
+ * @param callback The function to be unregistered.
89
+ */
90
+ removeExternalEventHandler(callback: ExternalEventCallback): void;
91
+ /** Runs a program and returns a promise for the outputs. */
92
+ run(document: Program, options?: RunOptions): Task<object>;
93
+ run(inspector: ProgramInspector, options?: RunOptions): Task<object>;
94
+ /**
95
+ * Registers the supplied callback function as the event handler for external events, received from the host application.
96
+ * @param callback The function to be called whenever an external event is received.
97
+ */
98
+ setExternalEventHandler(callback: ExternalEventCallback): void;
99
+ private _getFormElementRegistration;
100
+ private _registerFormElement;
102
101
  }
103
102
  export {};