@vertigis/workflow 5.44.0 → 5.45.1
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/Activator.d.ts +1 -1
- package/Hooks.d.ts +2 -2
- package/IActivityHandler.d.ts +2 -2
- package/ProgramInspectorFacility.d.ts +1 -1
- package/ProgramInspectorFacility.js +1 -1
- package/TemplateUtils.js +1 -1
- package/Validation.d.ts +31 -31
- package/Validation.js +1 -1
- package/activities/arcgis/AddFeatureLayer.d.ts +1 -1
- package/activities/arcgis/AddFeatureLayer.js +1 -1
- package/activities/arcgis/AddFeatures.d.ts +1 -1
- package/activities/arcgis/ConvertValueToArcGisFieldType.d.ts +2 -2
- package/activities/arcgis/CreateGraphic.d.ts +1 -1
- package/activities/arcgis/DeleteFeatures.d.ts +1 -1
- package/activities/arcgis/FeatureSetFromJson.d.ts +1 -1
- package/activities/arcgis/GeometryFromJson.d.ts +1 -1
- package/activities/arcgis/GeoprocessingAsync.js +1 -1
- package/activities/arcgis/GetCurrentPosition.js +1 -1
- package/activities/arcgis/GetFormElementItemsFromFeatures.js +1 -1
- package/activities/arcgis/MapProvider.d.ts +40 -2
- package/activities/arcgis/MapProvider.js +1 -1
- package/activities/arcgis/ProjectServiceTask.d.ts +1 -1
- package/activities/arcgis/QueryTask.js +1 -1
- package/activities/arcgis/RelationServiceTask.js +1 -1
- package/activities/arcgis/RendererFromJson.d.ts +1 -1
- package/activities/arcgis/ResetAllLayerDefinitionExpressions.d.ts +10 -0
- package/activities/arcgis/ResetAllLayerDefinitionExpressions.js +1 -0
- package/activities/arcgis/ResetLayerDefinitionExpression.d.ts +24 -0
- package/activities/arcgis/ResetLayerDefinitionExpression.js +1 -0
- package/activities/arcgis/ReverseGeocode.d.ts +1 -1
- package/activities/arcgis/RunWorkflow.js +1 -1
- package/activities/arcgis/SetImageryLayerOptions.d.ts +2 -2
- package/activities/arcgis/SetMap.d.ts +1 -1
- package/activities/arcgis/SetMap.js +1 -1
- package/activities/arcgis/SymbolFromJson.d.ts +1 -1
- package/activities/arcgis/TypeChecking.d.ts +0 -7
- package/activities/arcgis/TypeChecking.js +1 -1
- package/activities/arcgis/UpdateFeatures.d.ts +1 -1
- package/activities/arcgis/libs/arcGisRestApi.d.ts +1 -1
- package/activities/arcgis/shared.d.ts +1 -1
- package/activities/arcgis/shared.js +1 -1
- package/activities/arcgis/tools.js +1 -1
- package/activities/constants.js +1 -1
- package/activities/core/ChannelProvider.d.ts +2 -2
- package/activities/core/ChannelProvider.js +1 -1
- package/activities/core/ConvertToJson.d.ts +1 -1
- package/activities/core/ExecuteFunction.js +1 -1
- package/activities/core/ForEach.d.ts +6 -5
- package/activities/core/FormatDate.d.ts +39 -1
- package/activities/core/FormatDate.js +1 -1
- package/activities/core/GetWorkflowInputs.d.ts +1 -1
- package/activities/core/ParseUrl.js +1 -1
- package/activities/core/SetProperty.d.ts +1 -1
- package/activities/core/TextReplace.js +1 -1
- package/activities/core/converters.d.ts +1 -1
- package/activities/essentials/RunEssentialsWorkflow.js +1 -1
- package/activities/forms/FormRenderer.js +1 -1
- package/activities/forms/GetFormElementItemsFromCollection.js +1 -1
- package/activities/forms/SetCurrentFormElementItem.js +1 -1
- package/activities/forms/SetFormElementEvent.js +1 -1
- package/activities/index.js +1 -1
- package/definition/ActivityInput.d.ts +1 -1
- package/definition/Program.d.ts +11 -6
- package/definition/ProgramInspector.d.ts +9 -2
- package/definition/ProgramInspector.js +1 -1
- package/execution/ActivityContext.js +1 -1
- package/execution/AmbientState.d.ts +5 -5
- package/execution/AmbientState.js +1 -1
- package/execution/AmbientStateProxy.d.ts +4 -4
- package/execution/Engine.d.ts +4 -4
- package/execution/Engine.js +1 -1
- package/execution/ModuleLoader.d.ts +1 -1
- package/forms/FormComponent.d.ts +1 -1
- package/forms/FormDefinition.d.ts +4 -4
- package/forms/FormHost.d.ts +2 -2
- package/forms/FormPresenterHost.d.ts +2 -2
- package/forms/components/AutoComplete.js +1 -1
- package/forms/components/ButtonBar.js +1 -1
- package/forms/components/CheckBox.js +1 -1
- package/forms/components/CheckGroup.js +1 -1
- package/forms/components/DateRangePicker.js +1 -1
- package/forms/components/DateTimePicker.js +1 -1
- package/forms/components/DateTimeTextField.js +1 -1
- package/forms/components/FormElement.js +1 -1
- package/forms/components/GeometryPicker.js +1 -1
- package/forms/components/ItemPicker.js +1 -1
- package/forms/components/Number.js +1 -1
- package/forms/components/NumberRangeSlider.js +1 -1
- package/forms/components/NumberSlider.js +1 -1
- package/forms/components/RadioGroup.js +1 -1
- package/forms/components/Scanner.js +1 -1
- package/forms/components/Section.js +1 -1
- package/forms/components/TextBox.js +1 -1
- package/forms/components/TimePicker.js +1 -1
- package/forms/customNumberFormat.js +1 -1
- package/forms/index.d.ts +2 -4
- package/forms/numberFormatter.js +1 -1
- package/forms/numberUtilities.js +1 -1
- package/forms/presenter.d.ts +3 -3
- package/forms/textUtilities.js +1 -1
- package/forms/utils.js +1 -1
- package/libs/version.d.ts +1 -1
- package/libs/version.js +1 -1
- package/package.json +8 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import{ActivityCancellationError}from"../../Errors.js";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{oldDefaultServerVirtualPath,defaultServerVirtualPath}from"../constants.js";import{ChannelProvider}from"../core/ChannelProvider.js";import{runJob,getServiceToken}from"./runUtils.js";import{getAuthenticationToken,parsePortalItemUrl,getPortalItem,getPortalDataUrl}from"./shared.js";let RunWorkflow=class{async execute(e,t,r){var o=validation.string("url",e.url,validation.never),l=parsePortalItemUrl(o);if(l){var a=getAuthenticationToken(l.portalUrl),n=getPortalDataUrl(l,a);const i=t.cancellationToken;n=await getPortalItem(n,r,i);const s=r.create();if(i.finally(function(){s.cancel()}),this.isServerWorkflow(n))return this.runServerWorkflow(n,e.arguments,s,i,l.portalUrl,a)}return this.runClientWorkflow(o,e.arguments,t)}isServerWorkflow(e){if(null==e)return!1;var t=e.properties;if(null==t)return!1;e=t.isServerWorkflow,t=t.serverUrl;return!(!0!==e||!t)}async runServerWorkflow(e,t,r,o,l,a){let n=e.properties.serverUrl;n=n.replace(/\/+$/,"");let i;if(a&&"public"!==e.access)try{i=await getServiceToken(n,l,a,r)}catch(e){if(!oldDefaultServerVirtualPath.test(n))throw e;n=n.replace(oldDefaultServerVirtualPath,defaultServerVirtualPath),i=await getServiceToken(n,l,a,r)}t={workflow:{id:e.id},inputs:t};let s;try{s=await runJob(n,i,t,r)}catch(e){if(!oldDefaultServerVirtualPath.test(n))throw e;n=n.replace(oldDefaultServerVirtualPath,defaultServerVirtualPath),s=await runJob(n,i,t,r)}t=s.ticket;let c=await this.getResult(n,t,o);return c=c||await this.pollResult(n,t,1e3,r,o),{result:c||{}}}async getResult(o,l,a){return new Promise(r=>{var e=this.getWebSocketUrl(`${o}/job/artifacts?ticket=${l}`);const t=new WebSocket(e);a.finally(function(){t.close()}),t.addEventListener("open",
|
|
1
|
+
import{__decorate}from"tslib";import{ActivityCancellationError}from"../../Errors.js";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{oldDefaultServerVirtualPath,defaultServerVirtualPath}from"../constants.js";import{ChannelProvider}from"../core/ChannelProvider.js";import{runJob,getServiceToken}from"./runUtils.js";import{getAuthenticationToken,parsePortalItemUrl,getPortalItem,getPortalDataUrl}from"./shared.js";let RunWorkflow=class{async execute(e,t,r){var o=validation.string("url",e.url,validation.never),l=parsePortalItemUrl(o);if(l){var a=getAuthenticationToken(l.portalUrl),n=getPortalDataUrl(l,a);const i=t.cancellationToken;n=await getPortalItem(n,r,i);const s=r.create();if(i.finally(function(){s.cancel()}),this.isServerWorkflow(n))return this.runServerWorkflow(n,e.arguments,s,i,l.portalUrl,a)}return this.runClientWorkflow(o,e.arguments,t)}isServerWorkflow(e){if(null==e)return!1;var t=e.properties;if(null==t)return!1;e=t.isServerWorkflow,t=t.serverUrl;return!(!0!==e||!t)}async runServerWorkflow(e,t,r,o,l,a){let n=e.properties.serverUrl;n=n.replace(/\/+$/,"");let i;if(a&&"public"!==e.access)try{i=await getServiceToken(n,l,a,r)}catch(e){if(!oldDefaultServerVirtualPath.test(n))throw e;n=n.replace(oldDefaultServerVirtualPath,defaultServerVirtualPath),i=await getServiceToken(n,l,a,r)}t={workflow:{id:e.id},inputs:t};let s;try{s=await runJob(n,i,t,r)}catch(e){if(!oldDefaultServerVirtualPath.test(n))throw e;n=n.replace(oldDefaultServerVirtualPath,defaultServerVirtualPath),s=await runJob(n,i,t,r)}t=s.ticket;let c=await this.getResult(n,t,o);return c=c||await this.pollResult(n,t,1e3,r,o),{result:c||{}}}async getResult(o,l,a){return new Promise(r=>{var e=this.getWebSocketUrl(`${o}/job/artifacts?ticket=${l}`);const t=new WebSocket(e);a.finally(function(){t.close()}),t.addEventListener("open",()=>{t.send("")}),t.addEventListener("message",e=>{const t=JSON.parse(e.data);console.debug(t),t.results?.some(e=>"JobQuit"===e.$type)&&((e=t.results.filter(e=>"JobResult"===e.$type)[0])?r(e.outputs||{}):(console.error("Server workflow failed.",`${o}/job/logs?ticket=${l}`),r(null)))}),t.addEventListener("error",e=>{console.log("Unable to check workflow status using WebSocket.",e),r(null)}),t.addEventListener("close",e=>{e.wasClean||(console.log("WebSocket connection died.",e),r(null))})})}getWebSocketUrl(e){const t=new URL(e);var r=t.protocol;let o="";switch(r){case"https:":o="wss:";break;case"http:":o="ws:";break;default:o=r}return t.protocol=o,t.toString()}async delay(t){return new Promise(e=>setTimeout(e,t))}async pollResult(e,t,r,o,l){var a=await this.checkJobStatus(e,t,o,l);return a||(await this.delay(r),this.pollResult(e,t,1.1*r,o,l))}async checkJobStatus(e,t,r,o){if(r=r.new(),o.finally(function(){r.cancel()}),r.request.url=`${e}/job/artifacts?ticket=${t}`,!await r.send())throw console.error("Unable to check workflow status by polling.",r.response.message),new Error("Unable to check workflow status by polling.");const l=JSON.parse(r.response.content);if(console.debug(l),l.results?.some(e=>"JobQuit"===e.$type)){o=l.results.filter(e=>"JobResult"===e.$type)[0];if(o)return o.outputs;throw console.error("Server workflow failed.",`${e}/job/logs?ticket=${t}&`),new Error("Server workflow failed.")}return null}async runClientWorkflow(e,t,r){const o=r.ambient.trivia;var l=r.ambient.activityContexts,l=l?l.$$form:void 0;try{var a=l?{$$form:l}:{};return{result:await o.runWorkflow(e,t,a,o.isDescendantOf)}}catch(e){if(e instanceof ActivityCancellationError)return r.ambient.reject(e),{result:{}};throw e}}};RunWorkflow.action="gcx:wf:core::RunWorkflow",RunWorkflow.suite="gcx:wf:builtin",RunWorkflow=__decorate([activate(ChannelProvider)],RunWorkflow);export{RunWorkflow};
|
|
@@ -11,7 +11,7 @@ export interface SetImageryLayerOptionsInputs {
|
|
|
11
11
|
/** The raster function used to render the imagery layer. */
|
|
12
12
|
renderingRule?: __esri.RasterFunction | __esri.RasterFunctionProperties;
|
|
13
13
|
/** The filter used to process the pixel data of the imagery layer. The pixelData object contains a pixelBlock property that gives you access to all of the pixels in the raster on the client. */
|
|
14
|
-
pixelFilter?:
|
|
14
|
+
pixelFilter?: __esri.PixelFilterFunction;
|
|
15
15
|
}
|
|
16
16
|
/** Defines outputs to the SetImageryLayerInfo activity. */
|
|
17
17
|
export interface SetImageryLayerOptionsOutputs {
|
|
@@ -22,7 +22,7 @@ export interface SetImageryLayerOptionsOutputs {
|
|
|
22
22
|
/** Indicates the rendering rule used. */
|
|
23
23
|
renderingRule?: __esri.RasterFunction;
|
|
24
24
|
/** Indicates the pixel function used. */
|
|
25
|
-
pixelFilter?:
|
|
25
|
+
pixelFilter?: __esri.PixelFilterFunction;
|
|
26
26
|
}
|
|
27
27
|
export declare class SetImageryLayerOptions implements IActivityHandler {
|
|
28
28
|
static readonly action = "gcx:wf:arcgis::SetImageryLayerOptions";
|
|
@@ -10,5 +10,5 @@ export interface SetMapInputs {
|
|
|
10
10
|
export declare class SetMap implements IActivityHandler {
|
|
11
11
|
static readonly action = "gcx:wf:arcgis::SetMap";
|
|
12
12
|
static readonly suite = "gcx:wf:builtin";
|
|
13
|
-
execute(): EmptyOutputs;
|
|
13
|
+
execute(inputs: SetMapInputs): EmptyOutputs;
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class SetMap{execute(){return{}}}SetMap.action="gcx:wf:arcgis::SetMap",SetMap.suite="gcx:wf:builtin";export{SetMap};
|
|
1
|
+
class SetMap{execute(e){return{}}}SetMap.action="gcx:wf:arcgis::SetMap",SetMap.suite="gcx:wf:builtin";export{SetMap};
|
|
@@ -2,7 +2,7 @@ import type { IActivityHandler } from "../../IActivityHandler";
|
|
|
2
2
|
/** Defines inputs for the Symbol From JSON activity. */
|
|
3
3
|
export interface SymbolFromJsonInputs {
|
|
4
4
|
/** The symbol JSON as a string or object. */
|
|
5
|
-
json: string |
|
|
5
|
+
json: string | object;
|
|
6
6
|
}
|
|
7
7
|
/** Defines outputs for the Symbol From JSON activity. */
|
|
8
8
|
export interface SymbolFromJsonOutputs {
|
|
@@ -36,10 +36,3 @@ export declare function isLayerWithSublayers(layer: __esri.Layer): layer is __es
|
|
|
36
36
|
* @param layer
|
|
37
37
|
*/
|
|
38
38
|
export declare function isLayerWithRedraw(layer: __esri.Layer): layer is __esri.Layer & LayerWithRedraw;
|
|
39
|
-
/**
|
|
40
|
-
* @param sublayer The sublayer to be checked.
|
|
41
|
-
*/
|
|
42
|
-
export declare function isSublayerWithDefinitionExpression(sublayer: __esri.Sublayer | {
|
|
43
|
-
id?: string | number;
|
|
44
|
-
visible?: boolean;
|
|
45
|
-
}): sublayer is __esri.Sublayer & LayerWithDefinitionExpression;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function isGraphicsLayer(i){return"object"==typeof i.graphics}function isLayerWithDefinitionExpression(i){return void 0!==i.definitionExpression}function isLayerWithPopupTemplate(i){return void 0!==i.popupTemplate}function isLayerWithSublayers(i){return"function"==typeof i.findSublayerById}function isLayerWithRedraw(i){return"function"==typeof i.redraw}
|
|
1
|
+
function isGraphicsLayer(i){return"object"==typeof i.graphics}function isLayerWithDefinitionExpression(i){return void 0!==i.definitionExpression}function isLayerWithPopupTemplate(i){return void 0!==i.popupTemplate}function isLayerWithSublayers(i){return"function"==typeof i.findSublayerById}function isLayerWithRedraw(i){return"function"==typeof i.redraw}export{isGraphicsLayer,isLayerWithDefinitionExpression,isLayerWithPopupTemplate,isLayerWithSublayers,isLayerWithRedraw};
|
|
@@ -23,5 +23,5 @@ export declare class UpdateFeatures implements IActivityHandler {
|
|
|
23
23
|
static readonly suite = "gcx:wf:builtin";
|
|
24
24
|
execute(inputs: UpdateFeaturesInputs, context: IActivityContext): Promise<UpdateFeaturesOutputs>;
|
|
25
25
|
/** Called after the apply edit operation completes. */
|
|
26
|
-
protected onApplyEditsComplete(
|
|
26
|
+
protected onApplyEditsComplete(results: ApplyEditsResponse): void;
|
|
27
27
|
}
|
|
@@ -28,7 +28,7 @@ export interface GeocodeResponse extends __esri.RequestResponse {
|
|
|
28
28
|
spatialReference?: __esri.SpatialReference;
|
|
29
29
|
}
|
|
30
30
|
export interface ReverseGeocodeResponse extends __esri.RequestResponse {
|
|
31
|
-
address?:
|
|
31
|
+
address?: object;
|
|
32
32
|
location?: __esri.Point;
|
|
33
33
|
}
|
|
34
34
|
export interface FeatureLayerInfo {
|
|
@@ -48,7 +48,7 @@ export declare function equalsIgnoreCase(str1: string | undefined | null, str2:
|
|
|
48
48
|
* @param attributes A set of attributes.
|
|
49
49
|
* @returns The name of a case-insensitive matching name, or `undefined` if no match was found.
|
|
50
50
|
*/
|
|
51
|
-
export declare function getFieldName(fieldName: string | undefined, attributes:
|
|
51
|
+
export declare function getFieldName(fieldName: string | undefined, attributes: object): string | undefined;
|
|
52
52
|
/**
|
|
53
53
|
* Returns true if the value is present based on a case-insensitive match, false otherwise.
|
|
54
54
|
* @param values A set of values to inspect.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import esriId from"@arcgis/core/identity/IdentityManager";function getAuthenticationToken(e){return esriId.findCredential(e)?.token||""}function parsePortalItemUrl(e){e=e.match(/^(.*?)\/home\/item\.html\?id=(.*?)(
|
|
1
|
+
import esriId from"@arcgis/core/identity/IdentityManager";function getAuthenticationToken(e){return esriId.findCredential(e)?.token||""}function parsePortalItemUrl(e){e=e.match(/^(.*?)\/home\/item\.html\?id=(.*?)(#.*)?$/);if(e)return{portalUrl:e[1],itemId:e[2]}}function getPortalDataUrl(e,t){return`${e.portalUrl}/sharing/rest/content/items/${e.itemId}?f=json&token=${t}`}async function getPortalItem(e,t,n){const r=t.create(void 0,"arcgis");if(n.finally(function(){r.cancel()}),r.request.url=e,!await r.send())throw console.error("Unable to get portal item.",r.response.message),Error("Unable to get portal item.");return r.getResponseData(r.response.payload)}function formatGlobalId(e){return"}"!=(e="{"!=e[0]?"{"+e:e)[e.length-1]&&(e+="}"),e}function combineGlobalIds(e){return`[${e.map(e=>`"${formatGlobalId(e)}"`).join(",")}]`}function equalsIgnoreCase(e,t){return e===t||null!=e&&(null!=t&&e.toLowerCase()===t.toLowerCase())}function getFieldName(t,e){return Object.keys(e).find(e=>equalsIgnoreCase(t,e))}function containsIgnoreCase(e,t){return e.some(e=>equalsIgnoreCase(e,t))}export{getAuthenticationToken,parsePortalItemUrl,getPortalDataUrl,getPortalItem,formatGlobalId,combineGlobalIds,equalsIgnoreCase,getFieldName,containsIgnoreCase};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Extent from"@arcgis/core/geometry/Extent";import esriRequest from"@arcgis/core/request";import{jsonToQueryObject}from"../../activities/core/converters.js";function isAbortable(e){return"object"==typeof e.signal}function isCancellable(e){return null!=e&&"function"==typeof e.cancel}function addToPath(n,r){return n.replace(/([
|
|
1
|
+
import Extent from"@arcgis/core/geometry/Extent";import esriRequest from"@arcgis/core/request";import{jsonToQueryObject}from"../../activities/core/converters.js";function isAbortable(e){return"object"==typeof e.signal}function isCancellable(e){return null!=e&&"function"==typeof e.cancel}function addToPath(n,r){return n.replace(/([#?].*)?$/,function(e){const t=n.substring(0,n.length-e.length);return t.match(/\/+$/)?r+e:"/"+r+e})}function isExtent(e){return"number"==typeof e.xmin&&("number"==typeof e.xmax&&("number"==typeof e.ymin&&"number"==typeof e.ymax))}function polygonFromExtent(e,t){if(null!=e)return isExtent(e)?new t({rings:[[[e.xmin,e.ymin],[e.xmax,e.ymin],[e.xmax,e.ymax],[e.xmin,e.ymax]]],spatialReference:e.spatialReference}):e}function post(e,t,n,r){return performRequest(e,t,n,r,"post")}function performRequest(e,t,n,r,a="auto"){t.f="json";const i={method:a,query:jsonToQueryObject(t),responseType:"json",timeout:n,cacheBust:!1};return r&&(i.signal=r),esriRequest(e,i).then(e=>e.data)}function isFeatureSet(e){return null!=e&&(!Array.isArray(e)&&!!Array.isArray(e.features))}function featuresToArray(e){return null==e?[]:e instanceof Array?e:isFeatureSet(e)?e.features:void 0!==e.attributes&&null!==e.attributes||void 0!==e.geometry&&null!==e.geometry?[e]:[]}function extentOf(e){let t;for(const r of e||[])if(r)if("point"===r.type){var n=r;void 0===t?t=pointToExtent(n):(t.xmin=Math.min(t.xmin,n.x),t.ymin=Math.min(t.ymin,n.y),t.xmax=Math.max(t.xmax,n.x),t.ymax=Math.max(t.ymax,n.y),t.spatialReference=r.spatialReference||t.spatialReference,"number"==typeof n.z&&(t.zmin=Math.min(t.zmin,n.z),t.zmax=Math.max(t.zmax,n.z)))}else{let e=r.extent;void 0!==e&&null!==e&&(void 0!==t?(t.xmin=Math.min(t.xmin,e.xmin),t.ymin=Math.min(t.ymin,e.ymin),t.xmax=Math.max(t.xmax,e.xmax),t.ymax=Math.max(t.ymax,e.ymax),t.spatialReference=r.spatialReference||t.spatialReference,"number"==typeof e.zmin&&(t.zmin=Math.min(t.zmin,e.zmin)),"number"==typeof e.zmax&&(t.zmax=Math.max(t.zmax,e.zmax))):(e=e.clone(),t=e))}return t}function pointToExtent(e){const t=new Extent({xmin:e.x,ymin:e.y,xmax:e.x,ymax:e.y,spatialReference:e.spatialReference});return"number"==typeof e.z&&(t.zmin=e.z,t.zmax=e.z),t}export{isAbortable,isCancellable,addToPath,polygonFromExtent,post,performRequest,isFeatureSet,featuresToArray,extentOf};
|
package/activities/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const oldDefaultServerVirtualPath=/(\/\/[
|
|
1
|
+
const oldDefaultServerVirtualPath=/(\/\/[^/]+)\/geocortex\/workflow\/service\/?$/i,defaultServerVirtualPath="$1/vertigisstudio/workflow/service";export{oldDefaultServerVirtualPath,defaultServerVirtualPath};
|
|
@@ -24,7 +24,7 @@ export interface Response {
|
|
|
24
24
|
/** The content for the current request/response. */
|
|
25
25
|
content?: ArrayBuffer | string;
|
|
26
26
|
/** The payload for the current request/response. */
|
|
27
|
-
payload?:
|
|
27
|
+
payload?: object;
|
|
28
28
|
}
|
|
29
29
|
export interface ChannelInfo {
|
|
30
30
|
/** The request. */
|
|
@@ -83,7 +83,7 @@ export declare class ChannelProvider implements ChannelInfo {
|
|
|
83
83
|
* which we need to use instead in the appropriate sub class.
|
|
84
84
|
* @param payload The payload returned by an esri request.
|
|
85
85
|
*/
|
|
86
|
-
getResponseData(payload:
|
|
86
|
+
getResponseData(payload: object | undefined): object | undefined;
|
|
87
87
|
/** Constructs a new request from this channel. */
|
|
88
88
|
new(): ChannelProvider;
|
|
89
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Bluebird from"bluebird";function parseResponseHeaders(e){const s={};if("string"!=typeof e)return s;for(const i of e.split(/\r?\n/)){var t=i.indexOf(":");if(0<=t){var r=i.substring(0,t).trim(),t=i.substring(t+1).trim();const n=s[r];n instanceof Array?n.push(t):"string"==typeof n?s[r]=[n,t]:s[r]=t}}return s}class ChannelProvider{static register(e){e.factories.push(e=>e===this.type?this:void 0)}static create(e,s){return e instanceof this?e.new():new this(this,s)}constructor(e,s){this.basePromise=new Bluebird(e=>{this.resolve=e}),this.binary=!1,this.timeout=6e4,this.corsWithCredentials=!1,this.name=s,this.type=e,this.request={headers:{}},this.response={headers:{}}}tryConclude(e){const s=this.xhr;var t;s.readyState===s.DONE&&(this.response.status=s.status,this.response.message=s.statusText,this.response.headers=parseResponseHeaders(s.getAllResponseHeaders()),("string"==typeof(t=s.response)||t instanceof ArrayBuffer)&&(this.response.content=t),this.resolve(!0)),null!=e&&(this.response.error=e,this.resolve(!1))}cancel(){this.resolve(!1)}send(){let e=this.promise;if(void 0===e){if(e=this.promise=this.basePromise.timeout(this.timeout).catch(()=>!1),e.isResolved())return e;const n=this.xhr=new XMLHttpRequest;e.finally(()=>n.abort());try{n.open(this.request.method||"GET",this.request.url,!0),n.onreadystatechange=
|
|
1
|
+
import Bluebird from"bluebird";function parseResponseHeaders(e){const s={};if("string"!=typeof e)return s;for(const i of e.split(/\r?\n/)){var t=i.indexOf(":");if(0<=t){var r=i.substring(0,t).trim(),t=i.substring(t+1).trim();const n=s[r];n instanceof Array?n.push(t):"string"==typeof n?s[r]=[n,t]:s[r]=t}}return s}class ChannelProvider{static register(e){e.factories.push(e=>e===this.type?this:void 0)}static create(e,s){return e instanceof this?e.new():new this(this,s)}constructor(e,s){this.basePromise=new Bluebird(e=>{this.resolve=e}),this.binary=!1,this.timeout=6e4,this.corsWithCredentials=!1,this.name=s,this.type=e,this.request={headers:{}},this.response={headers:{}}}tryConclude(e){const s=this.xhr;var t;s.readyState===s.DONE&&(this.response.status=s.status,this.response.message=s.statusText,this.response.headers=parseResponseHeaders(s.getAllResponseHeaders()),("string"==typeof(t=s.response)||t instanceof ArrayBuffer)&&(this.response.content=t),this.resolve(!0)),null!=e&&(this.response.error=e,this.resolve(!1))}cancel(){this.resolve(!1)}send(){let e=this.promise;if(void 0===e){if(e=this.promise=this.basePromise.timeout(this.timeout).catch(()=>!1),e.isResolved())return e;const n=this.xhr=new XMLHttpRequest;e.finally(()=>n.abort());try{n.open(this.request.method||"GET",this.request.url,!0),n.onreadystatechange=()=>this.tryConclude(),n.onerror=e=>this.tryConclude(e.error),this.corsWithCredentials&&(n.withCredentials=!0),this.binary?n.responseType="arraybuffer":n.responseType="text";var s=this.request.headers;for(const o in s){var t=s[o];if(t instanceof Array)for(const h of t)n.setRequestHeader(o,"string"==typeof h?h:JSON.stringify(h));else n.setRequestHeader(o,"string"==typeof t?t:JSON.stringify(t))}var r=this.request.json,i=void 0!==r?JSON.stringify(r):this.request.content;n.send(i)}catch(e){this.response.error=e,this.resolve(!1)}}return e}getResponseData(e){return e}new(){return new this.type(this.type,this.name)}}ChannelProvider.type="59378113-D159-4E5C-A4AB-292F6E52620E:ChannelProvider";export{ChannelProvider};
|
|
@@ -2,7 +2,7 @@ import type { IActivityHandler } from "../../IActivityHandler";
|
|
|
2
2
|
/** Defines outputs for the ConvertToJson activity. */
|
|
3
3
|
export interface ConvertToJsonInputs {
|
|
4
4
|
/** The object to convert to JSON text. */
|
|
5
|
-
object:
|
|
5
|
+
object: any;
|
|
6
6
|
}
|
|
7
7
|
/** Defines outputs for the ConvertToJson activity. */
|
|
8
8
|
export interface ConvertToJsonOutputs {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validation}from"../../Validation.js";class ExecuteFunction{execute(t,e){if(0<e.passes)return{result:e.state.result};var i={arguments:{...t.arguments},result:void 0};e.persist(i);let n=validation.string("subworkflowId",t.subworkflowId,validation.never);return"$"===n[0]&&(n=n.substring(1)),e.ambient.trivia.setFunctionTransition(n),e.call("default"),i}}ExecuteFunction.action="gcx:wf:core:subworkflow:RunSubworkflow",ExecuteFunction.suite="gcx:wf:builtin";export{ExecuteFunction};
|
|
1
|
+
import{validation}from"../../Validation.js";class ExecuteFunction{execute(t,e){if(0<e.passes)return{result:e.state.result};var i={arguments:{...t.arguments},result:void 0};e.persist(i);let n=validation.string("subworkflowId",t.subworkflowId,validation.never).trim();return"$"===n[0]&&(n=n.substring(1)),e.ambient.trivia.setFunctionTransition(n),e.call("default"),i}}ExecuteFunction.action="gcx:wf:core:subworkflow:RunSubworkflow",ExecuteFunction.suite="gcx:wf:builtin";export{ExecuteFunction};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import type { IActivityHandler, IActivityContext } from "../../IActivityHandler";
|
|
2
2
|
/** Defines inputs to the ForEach activity. */
|
|
3
|
-
export interface ForEachInputs
|
|
3
|
+
export interface ForEachInputs {
|
|
4
4
|
/** A collection of items to iterate over. */
|
|
5
|
-
items:
|
|
5
|
+
items: any[] | Iterable<any> | Record<string, any>;
|
|
6
6
|
/** Whether or not to continue processing items. */
|
|
7
7
|
exit?: boolean;
|
|
8
|
+
itemType?: "any" | "string" | "number" | "esri.AddressCandidate" | "esri.Extent" | "esri.FeatureSet" | "esri.Geometry" | "esri.Graphic" | "esri.Layer" | "esri.Multipoint" | "esri.Point" | "esri.Polygon" | "esri.Polyline" | "esri.PortalGroup" | "esri.PortalUser" | "esri.SpatialReference" | "esri.Symbol" | string;
|
|
8
9
|
}
|
|
9
10
|
/** Defines outputs to the ForEach activity. */
|
|
10
|
-
export interface ForEachOutputs
|
|
11
|
+
export interface ForEachOutputs {
|
|
11
12
|
/** The key of the item currently being processed. */
|
|
12
13
|
key?: string;
|
|
13
14
|
/** The pass that the loop is on, if looping. */
|
|
@@ -15,11 +16,11 @@ export interface ForEachOutputs<T> {
|
|
|
15
16
|
/** The count of the items. */
|
|
16
17
|
count?: number;
|
|
17
18
|
/** The current item from the items collection */
|
|
18
|
-
item?:
|
|
19
|
+
item?: any;
|
|
19
20
|
}
|
|
20
21
|
export declare class ForEach implements IActivityHandler {
|
|
21
22
|
static readonly action = "gcx:wf:core:loop:ForEach";
|
|
22
23
|
static readonly suite = "gcx:wf:builtin";
|
|
23
24
|
/** Carries out the functionality for the ForEach activity. */
|
|
24
|
-
execute
|
|
25
|
+
execute(inputs: ForEachInputs, context: IActivityContext): ForEachOutputs;
|
|
25
26
|
}
|
|
@@ -16,5 +16,43 @@ export declare class FormatDate implements IActivityHandler {
|
|
|
16
16
|
static readonly action = "gcx:wf:core::FormatDate";
|
|
17
17
|
static readonly suite = "gcx:wf:builtin";
|
|
18
18
|
execute(inputs: FormatDateInputs, context: IActivityContext): FormatDateOutputs;
|
|
19
|
-
getFormattedDate
|
|
19
|
+
private getFormattedDate;
|
|
20
|
+
/**
|
|
21
|
+
* This is used for a subset of the standard date and time format strings
|
|
22
|
+
* which do not relate to an explicit custom equivalent.
|
|
23
|
+
* With these constraints in mind, we can make some assumptions to simplify the code.
|
|
24
|
+
* 1. The "abbreviated month" is never present.
|
|
25
|
+
* 2. The "abbreviated day" is never present.
|
|
26
|
+
* 3. The "full day" is never present.
|
|
27
|
+
* @param dateTimeFormatParts The results of formatting a test date (2000-05-01 14:00:00) to parts.
|
|
28
|
+
* @returns Our own details of the parts, for formatting the date from the activity inputs.
|
|
29
|
+
*/
|
|
30
|
+
private toCustomDateFormatParts;
|
|
31
|
+
/**
|
|
32
|
+
* This method inspects a single-character Custom date and time format string which is assumed to be
|
|
33
|
+
* a Standard date and time format string. These are all described on this page:
|
|
34
|
+
*
|
|
35
|
+
* https://learn.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings
|
|
36
|
+
*
|
|
37
|
+
* We use the `STANDARD_FORMAT_STRINGS` namespace to describe each of the supported options.
|
|
38
|
+
*
|
|
39
|
+
* @param formatString A standard date and time format string
|
|
40
|
+
* @param locale The current locale.
|
|
41
|
+
* @returns Details to be used to format the date and time.
|
|
42
|
+
*/
|
|
43
|
+
private inspectStandardFormatString;
|
|
44
|
+
/**
|
|
45
|
+
* This method inspects a multi-character Custom date and time format string.
|
|
46
|
+
* These are all described on this page:
|
|
47
|
+
*
|
|
48
|
+
* https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings
|
|
49
|
+
*
|
|
50
|
+
* We use the `CUSTOM_FORMAT_CHARS` namespace to describe the supported characters.
|
|
51
|
+
*
|
|
52
|
+
* @param customFormatString The format string to be inspected.
|
|
53
|
+
* @param locale The locale to be used for localized characters, like separators.
|
|
54
|
+
* @returns Details about how to format a date from the specified format string.
|
|
55
|
+
*/
|
|
56
|
+
private inspectCustomFormat;
|
|
57
|
+
private renderCustom;
|
|
20
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_LOCALE}from"../../constants.js";class FormatDate{execute(t,e){const a=new Date(t.date);var r=a.toISOString();return{formatted:this.getFormattedDate(a,t.format,e.ambient.locale)||r,iso:r,local:a.toString(),unix:a.valueOf(),utc:a.toUTCString()}}getFormattedDate(t,e,a){switch(a=a||DEFAULT_LOCALE,e){case"LT":return new Intl.DateTimeFormat(a,{timeStyle:"short"}).format(t);case"LTS":return new Intl.DateTimeFormat(a,{timeStyle:"medium"}).format(t);case"L":return new Intl.DateTimeFormat(a,{month:"2-digit",day:"2-digit",year:"numeric"}).format(t);case"l":return new Intl.DateTimeFormat(a,{month:"numeric",day:"numeric",year:"numeric"}).format(t);case"LL":return new Intl.DateTimeFormat(a,{dateStyle:"long"}).format(t);case"ll":return new Intl.DateTimeFormat(a,{dateStyle:"medium"}).format(t);case"LLL":return new Intl.DateTimeFormat(a,{dateStyle:"long",timeStyle:"short"}).format(t);case"lll":return new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short"}).format(t);case"LLLL":return`${new Intl.DateTimeFormat(a,{weekday:"long"}).format(t)}, ${new Intl.DateTimeFormat(a,{dateStyle:"long",timeStyle:"short"}).format(t)}`;case"llll":return`${new Intl.DateTimeFormat(a,{weekday:"short"}).format(t)}, ${new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short"}).format(t)}`;default:return}}}FormatDate.action="gcx:wf:core::FormatDate",FormatDate.suite="gcx:wf:builtin";export{FormatDate};
|
|
1
|
+
import{ActivityInputError}from"../../Errors.js";import{DEFAULT_LOCALE}from"../../constants.js";class FormatDate{execute(t,e){const a=new Date(t.date);return{formatted:this.getFormattedDate(a,t.format,e.ambient.locale),iso:a.toISOString(),local:a.toString(),unix:a.valueOf(),utc:a.toUTCString()}}getFormattedDate(t,e,a){switch(a=a||DEFAULT_LOCALE,e){case"LT":return new Intl.DateTimeFormat(a,{timeStyle:"short"}).format(t);case"LTS":return new Intl.DateTimeFormat(a,{timeStyle:"medium"}).format(t);case"L":return new Intl.DateTimeFormat(a,{month:"2-digit",day:"2-digit",year:"numeric"}).format(t);case"l":return new Intl.DateTimeFormat(a,{month:"numeric",day:"numeric",year:"numeric"}).format(t);case"LL":return new Intl.DateTimeFormat(a,{dateStyle:"long"}).format(t);case"ll":return new Intl.DateTimeFormat(a,{dateStyle:"medium"}).format(t);case"LLL":return new Intl.DateTimeFormat(a,{dateStyle:"long",timeStyle:"short"}).format(t);case"lll":return new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short"}).format(t);case"LLLL":return`${new Intl.DateTimeFormat(a,{weekday:"long"}).format(t)}, ${new Intl.DateTimeFormat(a,{dateStyle:"long",timeStyle:"short"}).format(t)}`;case"llll":return`${new Intl.DateTimeFormat(a,{weekday:"short"}).format(t)}, ${new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short"}).format(t)}`;case void 0:case"":return t.toISOString();default:return this.renderCustom(t,e,a)}}toCustomDateFormatParts(t){const a=[];for(const n of t){var r=n.value;let t=n.type,e;switch(t){case"day":case"fractionalSecond":case"hour":case"minute":case"month":if(!/\d/i.test(r)){e=4;break}case"second":case"year":e=r.length;break;case"weekday":t="day",e=4}"hour"===t&&12<parseInt(r)&&(t="hour24"),a.push({length:e,type:t,value:"literal"===t?r:void 0})}return a}inspectStandardFormatString(t,e){var a="current";let r="local",n;switch(t){case STANDARD_FORMAT_STRINGS.DATE_SHORT:n={};break;case STANDARD_FORMAT_STRINGS.DATE_LONG:n={weekday:"long",year:"numeric",month:"long",day:"numeric"};break;case STANDARD_FORMAT_STRINGS.DATETIME_FULL_SHORT_TIME:var o=[...new Intl.DateTimeFormat(e,{weekday:"long",year:"numeric",month:"long",day:"numeric"}).formatToParts(new Date(2e3,0,5)),{type:"literal",value:" "},...new Intl.DateTimeFormat(e,{timeStyle:"short"}).formatToParts(new Date(2e3,0,5,1,2,3))];return{dateTimeKind:r,culture:a,customDateFormatParts:this.toCustomDateFormatParts(o)};case STANDARD_FORMAT_STRINGS.DATE_TIME_UNIVERSAL_FULL:r="utc";case STANDARD_FORMAT_STRINGS.DATETIME_FULL_LONG_TIME:var T=[...new Intl.DateTimeFormat(e,{weekday:"long",year:"numeric",month:"long",day:"numeric"}).formatToParts(new Date(2e3,0,5)),{type:"literal",value:" "},...new Intl.DateTimeFormat(e,{timeStyle:"medium"}).formatToParts(new Date(2e3,0,5,1,2,3))];return{dateTimeKind:r,culture:a,customDateFormatParts:this.toCustomDateFormatParts(T)};case STANDARD_FORMAT_STRINGS.DATETIME_GENERAL_SHORT_TIME:n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1};break;case STANDARD_FORMAT_STRINGS.DATETIME_GENERAL_LONG_TIME:n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1};break;case STANDARD_FORMAT_STRINGS.MONTH_DAY_1:case STANDARD_FORMAT_STRINGS.MONTH_DAY_2:{const s=new Intl.DateTimeFormat(e,{dateStyle:"short"}).formatToParts(new Date(2e3,0,5));T=s.find(t=>"day"===t.type),T=T&&1===T.value.length?"numeric":"2-digit";n={month:"long",day:T};break}case STANDARD_FORMAT_STRINGS.ROUND_TRIP_DATE_TIME_1:case STANDARD_FORMAT_STRINGS.ROUND_TRIP_DATE_TIME_2:return{dateTimeKind:r,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.RFC1123_1:case STANDARD_FORMAT_STRINGS.RFC1123_2:return{dateTimeKind:r,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.DATE_TIME_SORTABLE:return{dateTimeKind:r,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.TIME_SHORT:n={timeStyle:"short"};break;case STANDARD_FORMAT_STRINGS.TIME_LONG:n={timeStyle:"long"};break;case STANDARD_FORMAT_STRINGS.DATE_TIME_UNIVERSAL_SORTABLE:return{dateTimeKind:r,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("yyyy'-'MM'-'dd HH':'mm':'ss'Z'",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.YEAR_MONTH_1:case STANDARD_FORMAT_STRINGS.YEAR_MONTH_2:n={month:"long",year:"numeric"}}return{dateTimeKind:r,culture:a,customDateFormatParts:this.toCustomDateFormatParts(new Intl.DateTimeFormat(e,n).formatToParts(new Date(2e3,0,5,14)))}}inspectCustomFormat(a,t){if(1===a.length)return this.inspectStandardFormatString(a,t);const r=[];let n="",o=!1,T=!1,s="";for(let e=0;e<=a.length;e++){var i=a[e];if(T)i===s?(r.push({type:"literal",value:n}),n="",T=!1,s=""):i&&(n+=i);else if(o){if(e===a.length)throw new ActivityInputError("format","Escape character without subsequent character.");r.push({type:"literal",value:i}),o=!1}else{let t=0<e?a[e-1]:"";if(a[e-2]===CUSTOM_FORMAT_CHARS.ESCAPE_CHARACTER&&(t=""),i!==t){var l=maxLengths[t];if(void 0!==l&&n.length>l)throw new ActivityInputError("format",`Too many occurrences of the '${t}' character in a sequence.`);switch(t){case"":break;case CUSTOM_FORMAT_CHARS.CUSTOM_FORMAT_SPECIFIER:if(e===a.length)throw new ActivityInputError("format","In a custom format string, the '%' character must be followed by another character.");continue;case CUSTOM_FORMAT_CHARS.DATE_SEPARATOR:r.push({type:"dateSeparator",length:n.length});break;case CUSTOM_FORMAT_CHARS.DAY:r.push({type:"day",length:n.length});break;case CUSTOM_FORMAT_CHARS.ERA:r.push({type:"era",length:n.length});break;case CUSTOM_FORMAT_CHARS.ESCAPE_CHARACTER:break;case CUSTOM_FORMAT_CHARS.HOURS_LOWER:r.push({type:"hour",length:n.length});break;case CUSTOM_FORMAT_CHARS.HOURS_UPPER:r.push({type:"hour24",length:n.length});break;case CUSTOM_FORMAT_CHARS.LITERAL_DOUBLE_QUOTE:case CUSTOM_FORMAT_CHARS.LITERAL_SINGLE_QUOTE:break;case CUSTOM_FORMAT_CHARS.MERIDIEM:r.push({type:"dayPeriod",length:n.length});break;case CUSTOM_FORMAT_CHARS.MINUTE:r.push({type:"minute",length:n.length});break;case CUSTOM_FORMAT_CHARS.MONTH:r.push({type:"month",length:n.length});break;case CUSTOM_FORMAT_CHARS.OFFSET:r.push({type:"offset",length:n.length});break;case CUSTOM_FORMAT_CHARS.SECONDS:r.push({type:"second",length:n.length});break;case CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_LOWER:r.push({type:"fractionalSecond",length:n.length});break;case CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_UPPPER:r.push({type:"fractionalSecondOptional",length:n.length});break;case CUSTOM_FORMAT_CHARS.TIME_SEPARATOR:r.push({type:"timeSeparator",length:n.length});break;case CUSTOM_FORMAT_CHARS.TIME_ZONE:r.push({type:"offset",length:3});break;case CUSTOM_FORMAT_CHARS.YEAR:r.push({type:"year",length:n.length});break;default:r.push({type:"literal",value:n})}i&&(i===CUSTOM_FORMAT_CHARS.ESCAPE_CHARACTER?o=!0:n=isLiteralChar(i)?(T=!0,s=i,""):i)}else n+=i}}if(T)throw new ActivityInputError("format",`Unterminated literal: ${s}${n}`);return{customDateFormatParts:r,culture:"current",dateTimeKind:"local"}}renderCustom(r,t,e){if(t.length<1)return"";var{culture:a,customDateFormatParts:t,dateTimeKind:n}=this.inspectCustomFormat(t,e);"invariant"===a&&(e="inv");let o;"utc"===n&&(o="utc");const T=[];for(const h of t){const{type:O,value:E}=h;var s=h.length??1;switch(O){case"day":{let t="";switch(s){case 1:case 2:t=("utc"===n?r.getUTCDate():r.getDate()).toString(),2===s&&1===t.length&&(t="0"+t);break;default:t=new Intl.DateTimeFormat(e,{timeZone:o,weekday:3===s?"short":"long"}).format(r)}T.push(t);break}case"month":{let t="";switch(s){case 1:case 2:t=(("utc"===n?r.getUTCMonth():r.getMonth())+1).toString(),2===s&&1===t.length&&(t="0"+t);break;default:t=new Intl.DateTimeFormat(e,{month:3===s?"short":"long",timeZone:o}).format(r)}T.push(t);break}case"year":{let t=("utc"===n?r.getUTCFullYear():r.getFullYear()).toString();switch(s){case 1:case 2:2<t.length&&(t=t.substring(t.length-2,t.length)),1===s&&2===t.length&&"0"===t[0]&&(t=t.substring(1,2));break;default:t.length<s&&(t="0".repeat(s-t.length)+t)}T.push(t)}break;case"hour":case"hour24":{let t="utc"===n?r.getUTCHours():r.getHours();"hour"===O&&(12<t&&(t-=12),0===t&&(t=12));let e=t.toString();1<s&&1===e.length&&(e="0"+e),T.push(e);break}case"minute":{let t=("utc"===n?r.getUTCMinutes():r.getMinutes()).toString();1<s&&1===t.length&&(t="0"+t),T.push(t);break}case"second":{let t=("utc"===n?r.getUTCSeconds():r.getSeconds()).toString();1<s&&1===t.length&&(t="0"+t),T.push(t);break}case"fractionalSecond":case"fractionalSecondOptional":{const M="utc"===o?r.getUTCMilliseconds():r.getMilliseconds();let t=M.toString();if(M<10?t="00"+M:M<100&&(t="0"+M),t.length>s&&(t=t.substring(0,s)),"fractionalSecondOptional"===O)for(;t.endsWith("0");)t=t.substring(0,t.length-1);else t.length<s&&(t+="0".repeat(s-t.length));if("fractionalSecondOptional"===O&&""===t){const D=0<T.length?T[T.length-1]:void 0;D?.endsWith(".")&&(T[T.length-1]=D.substring(0,D.length-1))}else T.push(t);break}case"dayPeriod":var i=new Intl.DateTimeFormat(e,{hourCycle:"h12",timeStyle:"short",timeZone:o}).formatToParts(r).find(t=>t.type===O);i&&T.push(i.value);break;case"era":var l=new Intl.DateTimeFormat(e,{era:"short"}).formatToParts(r).find(t=>t.type===O);l&&T.push(l.value);break;case"timeZoneName":var m=new Intl.DateTimeFormat(e,{timeZoneName:"short"}).formatToParts(r).find(t=>t.type===O);m&&T.push(m.value);break;case"literal":E&&T.push(E);break;case"offset":{var l="utc"===o?0:-1*r.getTimezoneOffset(),m=l/60,S=Math.trunc(m),_=l%60;let a=Math.abs(m).toString();switch(s){case 1:break;case 2:1===a.length&&(a="0"+a);break;default:{let t=Math.abs(S).toString(),e=Math.abs(_).toString();1===t.length&&(t="0"+t),1===e.length&&(e="0"+e),a=`${t}:${e}`;break}}a=0<=m?"+"+a:"-"+a,T.push(a);break}case"dateSeparator":{const F=new Intl.DateTimeFormat(e,{dateStyle:"short"}).formatToParts(r);var c=F.findIndex(t=>"day"===t.type),A=F.findIndex(t=>"month"===t.type);if(-1!==c&&-1!==A){var R=Math.min(c,A),u=Math.max(c,A);for(let t=R+1;t<u;t++){const d=F[t];if("literal"===d.type){T.push(d.value.repeat(s));break}}}break}case"timeSeparator":{const g=new Intl.DateTimeFormat(e,{timeStyle:"short"}).formatToParts(r);c=g.findIndex(t=>"hour"===t.type),A=g.findIndex(t=>"literal"===t.type),R=g.findIndex(t=>"minute"===t.type);0<=c&&c<A&&A<R&&T.push(g[A].value.repeat(s));break}}}return T.join("")}}var STANDARD_FORMAT_STRINGS,CUSTOM_FORMAT_CHARS;FormatDate.action="gcx:wf:core::FormatDate",FormatDate.suite="gcx:wf:builtin",function(t){t.DATE_SHORT="d",t.DATE_LONG="D",t.DATETIME_FULL_SHORT_TIME="f",t.DATETIME_FULL_LONG_TIME="F",t.DATETIME_GENERAL_SHORT_TIME="g",t.DATETIME_GENERAL_LONG_TIME="G",t.MONTH_DAY_1="m",t.MONTH_DAY_2="M",t.ROUND_TRIP_DATE_TIME_1="o",t.ROUND_TRIP_DATE_TIME_2="O",t.RFC1123_1="r",t.RFC1123_2="R",t.DATE_TIME_SORTABLE="s",t.TIME_SHORT="t",t.TIME_LONG="T",t.DATE_TIME_UNIVERSAL_SORTABLE="u",t.DATE_TIME_UNIVERSAL_FULL="U",t.YEAR_MONTH_1="y",t.YEAR_MONTH_2="Y"}(STANDARD_FORMAT_STRINGS=STANDARD_FORMAT_STRINGS||{}),function(t){t.CUSTOM_FORMAT_SPECIFIER="%",t.DATE_SEPARATOR="/",t.DAY="d",t.ERA="g",t.ESCAPE_CHARACTER="\\",t.HOURS_LOWER="h",t.HOURS_UPPER="H",t.LITERAL_DOUBLE_QUOTE='"',t.LITERAL_SINGLE_QUOTE="'",t.MERIDIEM="t",t.MINUTE="m",t.MONTH="M",t.OFFSET="z",t.SECONDS="s",t.SECONDS_FRACTION_LOWER="f",t.SECONDS_FRACTION_UPPPER="F",t.TIME_SEPARATOR=":",t.TIME_ZONE="K",t.YEAR="y"}(CUSTOM_FORMAT_CHARS=CUSTOM_FORMAT_CHARS||{});const maxLengths={[CUSTOM_FORMAT_CHARS.CUSTOM_FORMAT_SPECIFIER]:1,[CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_LOWER]:7,[CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_UPPPER]:7};function isLiteralChar(t){return[CUSTOM_FORMAT_CHARS.LITERAL_DOUBLE_QUOTE,CUSTOM_FORMAT_CHARS.LITERAL_SINGLE_QUOTE].includes(t)}export{FormatDate};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { IActivityHandler, IActivityContext, EmptyInputs } from "../../IActivityHandler";
|
|
3
3
|
/** Defines outputs to the GetWorkflowInputs activity. */
|
|
4
4
|
export interface GetWorkflowInputsOutputs {
|
|
5
|
-
inputs:
|
|
5
|
+
inputs: object;
|
|
6
6
|
}
|
|
7
7
|
/** Activity which gets the input parameters of the workflow. */
|
|
8
8
|
export declare class GetWorkflowInputs implements IActivityHandler {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class ParseUrl{execute(e){let r=e.url;if("string"!=typeof r){if("undefined"==typeof location||null===location)return{};r=location.href}const t={};var n=r.match(/^([
|
|
1
|
+
class ParseUrl{execute(e){let r=e.url;if("string"!=typeof r){if("undefined"==typeof location||null===location)return{};r=location.href}const t={};var n=r.match(/^([^?#]+?)?(\?.*?)?(#.*)?$/),e=n[1];const o=n[2];n=n[3];if(o){var l,c,s=/(.*?)=(.*)/;for(const a of o.substring(1).split("&")){const i=a.match(s);i&&0<i.length&&(l=i[1],c=decodeURIComponent(i[2].replace(/\+/g," ")),t[l]=c)}}return{url:r,query:t,request:e,queryString:o,fragment:n}}}ParseUrl.action="gcx:wf:core::ParseUrl",ParseUrl.suite="gcx:wf:builtin";export{ParseUrl};
|
|
@@ -2,7 +2,7 @@ import type { IActivityHandler, EmptyOutputs } from "../../IActivityHandler";
|
|
|
2
2
|
/** Defines inputs for the SetProperty activity. */
|
|
3
3
|
export interface SetPropertyInputs {
|
|
4
4
|
/** The object to set the property on. */
|
|
5
|
-
object:
|
|
5
|
+
object: object;
|
|
6
6
|
/** The name of the property to set. */
|
|
7
7
|
propertyName: string;
|
|
8
8
|
/** The value of the property. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validation}from"../../Validation.js";class TextReplace{execute(e){const a=validation.string("text",e.text,validation.never),t=validation.string("oldValue",e.oldValue,validation.never);var i=validation.string("newValue",e.newValue,""),l=validation.boolean("ignoreCase",e.ignoreCase,!1),e=t.replace(/([.*+?^=!:${}()
|
|
1
|
+
import{validation}from"../../Validation.js";class TextReplace{execute(e){const a=validation.string("text",e.text,validation.never),t=validation.string("oldValue",e.oldValue,validation.never);var i=validation.string("newValue",e.newValue,""),l=validation.boolean("ignoreCase",e.ignoreCase,!1),e=t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),l=new RegExp(e,"g"+(l?"i":""));return{result:a.replace(l,i)}}}TextReplace.action="gcx:wf:core::TextReplace",TextReplace.suite="gcx:wf:builtin";export{TextReplace};
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
* @product This is intended for internal use only within VertiGIS Studio products.
|
|
7
7
|
* @param query The object to be sent using an esri.request.
|
|
8
8
|
*/
|
|
9
|
-
export declare function jsonToQueryObject(contentObject: Record<string, any>):
|
|
9
|
+
export declare function jsonToQueryObject(contentObject: Record<string, any>): Record<string, any>;
|
|
10
10
|
export declare function jsonToFormData(contentObject: Record<string, any>): FormData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate}from"tslib";import Bluebird from"bluebird";import{GenericActivityError}from"../../Errors.js";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{ChannelProvider}from"../core/ChannelProvider.js";class WorkflowSchema{constructor(){this.inputs={}}}let RunEssentialsWorkflow=class{async execute(e,t,r){var n=validation.string("url",e.url,validation.never),
|
|
1
|
+
import{__decorate}from"tslib";import Bluebird from"bluebird";import{GenericActivityError}from"../../Errors.js";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{ChannelProvider}from"../core/ChannelProvider.js";class WorkflowSchema{constructor(){this.inputs={}}}let RunEssentialsWorkflow=class{async execute(e,t,r){var n=validation.string("url",e.url,validation.never),s=await this.getWorkflowSchema(n,r),o=this.validateInputs(e.arguments,s);if(o)return Bluebird.reject(o);const i=r.create(void 0,"geocortex");i.request.url=n+"/run",i.timeout=validation.number("timeout",e.timeout,6e4),i.request.method="POST",i.request.headers["Content-Type"]="application/x-www-form-urlencoded",i.request.json={inargs:this.constructInArgs(e.arguments,s),f:"json"},t.cancellationToken.finally(function(){i.cancel()});s=(new Date).valueOf(),t=await i.send(),s=(new Date).valueOf()-s;const a={result:{}};if(t){t=i.getResponseData(i.response.payload);if("Completed"===t.status){t=t.outputs;if(t)for(const f of t){var l=f.name,u=f.value;a.result[l]=u}return a}}const c=new GenericActivityError(void 0,"Error running Essentials Workflow activity.");throw c.timedOut=s>=i.timeout,c.elapsed=s,c.error=i.response.error,c.partialResult=a,c}isString(e){return"string"==typeof e}async getWorkflowSchema(e,t){const r=t.create(void 0,"geocortex");if(r.request.url=e,r.request.json={f:"json",deep:!0},await r.send()){const o=new WorkflowSchema;e=r.getResponseData(r.response.payload).inputs;if(e)for(const i of e){var n=i.name,s=i.typeName;this.isString(n)&&this.isString(s)&&(o.inputs[n]={name:n,typeName:s})}return o}throw new GenericActivityError(void 0,"Error running Essentials Workflow activity. Error retrieving workflow schema.")}validateInputs(r,e){const n=[],s=[],t=Object.keys(r);for(const i in e.inputs)t.includes(i)||n.push(i);const o=Object.keys(e.inputs);for(const a in r)o.includes(a)||s.push(a);if(0<n.length+s.length){let e="",t="";n.length&&(e=" Missing parameters: "+n),s.length&&(t=" Unexpected parameters: "+s);r="Invalid parameters supplied to Essentials Workflow activity."+e+t;return new GenericActivityError(void 0,r)}}constructInArgs(e,t){const r=[];for(const n in e)r.push({name:n,typeName:t.inputs[n].typeName,value:e[n]});return r}};RunEssentialsWorkflow.action="gcx:wf:essentials::RunEssentialsWorkflow",RunEssentialsWorkflow.suite="gcx:wf:builtin",RunEssentialsWorkflow=__decorate([activate(ChannelProvider)],RunEssentialsWorkflow);export{RunEssentialsWorkflow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ActivityAbortedError}from"../../Errors.js";import{FormHost,defs}from"../../forms/FormHost.js";import{FormElementTypes}from"../../forms/constants.js";import{getContent}from"../../forms/textUtilities.js";import{text}from"../../forms/utils.js";import{FormElementNotFoundError,NoFormElementAvailableError}from"./Errors.js";function toMarkdownRef(e,t){return"string"!=typeof t?t:{markdown:t}}const guid="F889738A-EBE2-4D52-8B46-3E24CC6E30F6:";class FormRenderer extends FormHost{static create(){return new this}static createCustom(){const e=new this;return e.custom=!0,e}static register(e){e.factories.push(e=>e===this.type?this:void 0)}addElement(e,r,t,o){if(r===FormElementTypes.HEADER)throw new Error("A form cannot contain more than one header element.");const n=this.form["elements"];if(n
|
|
1
|
+
import{ActivityAbortedError}from"../../Errors.js";import{FormHost,defs}from"../../forms/FormHost.js";import{FormElementTypes}from"../../forms/constants.js";import{getContent}from"../../forms/textUtilities.js";import{text}from"../../forms/utils.js";import{FormElementNotFoundError,NoFormElementAvailableError}from"./Errors.js";function toMarkdownRef(e,t){return"string"!=typeof t?t:{markdown:t}}const guid="F889738A-EBE2-4D52-8B46-3E24CC6E30F6:";class FormRenderer extends FormHost{static create(){return new this}static createCustom(){const e=new this;return e.custom=!0,e}static register(e){e.factories.push(e=>e===this.type?this:void 0)}addElement(e,r,t,o){if(r===FormElementTypes.HEADER)throw new Error("A form cannot contain more than one header element.");const n=this.form["elements"];if(n[e])throw new Error(`Element already present: ${e}`);const s={};if("object"==typeof t)for(const E in t)s[E]=t[E];s.type=r;var i=o?.targetElementName;let m=o?.relativePosition,a=!0;o=()=>{let e=-1;for(const t of Object.values(n))void 0!==t.rowNumber&&(e=Math.max(e,t.rowNumber));return e};let l,f;if(i&&m&&n[i]){let e=0,t=0;i=n[i];switch("header"===i.section?m="above":"footer"===i.section?(m="below",e=o()):(e=i.rowNumber,t=i.rowIndex,i.type!==FormElementTypes.SECTION&&r!==FormElementTypes.SECTION||(t=0,"before"===m?m="above":"after"===m&&(m="below"))),m){case"before":a=!1,l=e,f=t;break;case"after":a=!1,l=e,f=t+1;break;case"above":a=!0,l=e,f=0;break;default:a=!0,l=e+1,f=0}}else f=void 0!==s.rowNumber&&void 0!==s.rowIndex?(l=s.rowNumber||0,s.rowIndex||0):(l=o()+1,0);s.rowNumber=l,s.rowIndex=f;for(const t of Object.values(n)){var{rowNumber:c,rowIndex:u}=t;void 0!==c&&void 0!==u&&(a?c>=l&&t.rowNumber++:c===l&&u>=f&&t.rowIndex++)}n[e]=s;const d=[];for(const e of Object.keys(n)){const t=n[e];t.type===FormElementTypes.SECTION&&(d[t.rowNumber]={name:e})}for(const t of Object.values(n))void 0===t.rowNumber||t.rowNumber<l||t.type!==FormElementTypes.SECTION&&(t.section=(e=>{for(;0<=e;){var t=d[e];if(t)return t;e--}})(t.rowNumber));return this.invalidate(),s}assignElementProperty(t,r,o,e=!1,n=!0){e&&(o=toMarkdownRef(r,o));const s=this.getElement(t);if(s[r]!==o){const i={},m=this.getElementRegistration(s);if(m?.onPropertyChange)try{const a=(e,t)=>{i[e]!==t&&(i[e]=t,m.onPropertyChange({properties:{...s,...i},property:e,setProperty:a}))};a(r,o)}catch(e){throw console.error(`Error setting element property.\nElement: "${t}"\nProperty: "${r}"\nValue: ${o}\n`,e),e}else i[r]=o;for(const l of Object.keys(i))s[l]=i[l];m&&"value"in i&&!1!==n&&(t={..."object"==typeof n?n:{},name:t,value:i.value},this.post("changed",t)),this.refresh()}}assignElementItemProperty(e,t,r,o,n){const s=this.getElement(e),i=s.items||{};if(i[t][r]=n?toMarkdownRef(r,o):o,"checked"===r&&[FormElementTypes.CHECKGROUP,FormElementTypes.ITEMPICKER,FormElementTypes.LISTBOX].includes(s.type)){const a=[];for(const t in i){var m=i[t];m.checked&&a.push(m)}s.value=0===a.length?void 0:{refValueType:"items",items:a}}this.refresh(e)}assignItemsToElement(e,t,r){const o=this.getElement(e);let n=o.items||{};!1!==r&&(n={});for(const s in t)n[s]=t[s];o.items=n,o.type!==FormElementTypes.GEOMETRYPICKER&&o.type!==FormElementTypes.ITEMPICKER||delete o.state,this.invalidate(e)}cancelTool(){}deriveLocale(){return this.state?.locale||super.deriveLocale()}dispose(){if(super.dispose()){const e=this.state;return void 0!==e&&null!==e&&e.completion.isPending()&&e.reject(new ActivityAbortedError),!0}return!1}filterItems(e,t){const r=this.find(e);if(void 0===r||null===r)return!1;var o=r.items;if(null==o)return!1;if("string"!=typeof t)return t;let n=!1;const s={};var i=t.toLowerCase().split(/\s+/);for(const l in o){var m=o[l];const f=this.renderText(m.label);var a=f.toLowerCase().split(/\s+/);for(const c of i)if(0<c.length)for(const u of a)0<u.length&&0===u.indexOf(c)&&(n=!0,s[l]=m)}return r.items=s,this.invalidate(e),n}getElement(e,t){let r;if(e){if("string"!=typeof e)return e;r=e}else t?.name&&(r=t.name);if(r){t=this.form.elements[r];if(!t)throw new FormElementNotFoundError(r);return t}throw new NoFormElementAvailableError}getElementName(e,t){if(e){if("string"==typeof e)return e;for(const r in this.form.elements)if(this.form.elements[r]===e)return r;throw new FormElementNotFoundError(e)}if(t?.name)return t.name;throw new NoFormElementAvailableError}getElementRegistration(e){return this.state?.trivia?.getFormElementRegistration?.(e.customType??e.type)}getText(e){var t=this.state;if(void 0!==t){const r=t.environment.getText;if("function"==typeof r){if(text.isMarkdown(e))return{markdown:r(e.markdown)};if(text.isStatus(e))return{markdown:r(`@form-element-status-${e.status}`)};if(e&&"@"===e[0]){t=r(e);if(t)return t}}}return e}hideElement(e){e.visible=!1,this.invalidate()}isRelated(e){return this.state?.trivia?.isDescendantOf?.(e.state)}load(e,t){t=super.load(e,t);if(t&&this.form?.elements)for(const o in this.form.elements){var r=this.form.elements[o];const n=this.getElementRegistration(r);n&&n.getInitialProperties&&(r={...r,...n.getInitialProperties()},this.form.elements[o]=r)}return t}renderText(e){return super.renderText(this.getText(e))}setCurrentItem(e,t,r){const n=this.getElement(e);if(!n||!n.items)return!1;let o;switch(r){case"index":o=(e,t,r)=>{var o=Object.keys(n.items);return 0<o.length&&e===o[r]};break;case"item":o=(e,t,r)=>r===t;break;case"key":o=(e,t,r)=>r===e;break;case"label":o=(e,t,r)=>getContent(r)===getContent(t.label);break;case"value":o=(e,t,r)=>r===t.value;break;default:throw new Error("Unsupported value for itemMatchType: "+r)}for(const s in n.items)if(o(s,n.items[s],t))return n.current=s,[FormElementTypes.AUTOCOMPLETE,FormElementTypes.DROPDOWNLIST,FormElementTypes.RADIOGROUP].includes(n.type)&&(n.label=n.items[s].label,n.value=n.items[s].value),this.invalidate(e),this.cascade(e),!0;return!1}setElementError(e,t,r=!1){this.errors[e]=r?toMarkdownRef("error",t):t}showElement(e){e.visible=!0,this.invalidate()}spinNoBlock(){return this.spin()}translateText(e){return super.translateText(this.getText(e))}}FormRenderer.type=guid+"FormRenderer";export{defs,FormRenderer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as TemplateUtils from"../../TemplateUtils.js";import{validation}from"../../Validation.js";import{text}from"../../forms/utils.js";class GetFormElementItemsFromCollection{_isLabelFieldName(e,t){return null!=e&&0!==t.length&&e===this._getPropertyName(e,t)}_getPropertyName(e,t){return t.includes(e)?e:void 0}_getPropertyValue(e,t,l){t=this._getPropertyName(e,t);return t?TemplateUtils.valueOrEmptyString(l[t]):void 0}_getTokenValues(e,t,l){const o={};for(const i of e){var r,a=i.token;o.
|
|
1
|
+
import*as TemplateUtils from"../../TemplateUtils.js";import{validation}from"../../Validation.js";import{text}from"../../forms/utils.js";class GetFormElementItemsFromCollection{_isLabelFieldName(e,t){return null!=e&&0!==t.length&&e===this._getPropertyName(e,t)}_getPropertyName(e,t){return t.includes(e)?e:void 0}_getPropertyValue(e,t,l){t=this._getPropertyName(e,t);return t?TemplateUtils.valueOrEmptyString(l[t]):void 0}_getTokenValues(e,t,l){const o={};for(const i of e){var r,a=i.token;const n=Object.keys(o);n.includes(a)||(r=this._getPropertyValue(a,t,l),r=TemplateUtils.getTokenValueString(a,r),o[a]=text.escapeTextForMarkdown(r))}return o}getPropertyNames(e){const t=[];if(!e)return t;for(const l in e)"function"!=typeof e[l]&&t.push(l);return t}execute(l){var o=l.labelFieldName||void 0,r=validation.array("collection",l.collection,validation.never);const a={};var i=0<r.length?this.getPropertyNames(r[0]):[],n=this._isLabelFieldName(o,i),s=n?[]:TemplateUtils.findTokenInstances(o);for(let t=0;t<r.length;++t){var m,c=r[t];let e;e=n?c[l.labelFieldName]:o?(m=this._getTokenValues(s,i,c),TemplateUtils.replacePlaceholders(o,s,m)):c,void 0!==e&&null!==e||(e="");const u={};l.valueFieldName?u.value=c[l.valueFieldName]:u.value={refValueType:"data",type:"object",data:c},text.isMarkdown(e)?u.label=e:u.label=e.toString(),a[t]=u}return{items:a}}}GetFormElementItemsFromCollection.action="gcx:wf:forms::GetFormElementItemsFromCollection",GetFormElementItemsFromCollection.suite="gcx:wf:builtin";export{GetFormElementItemsFromCollection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ActivityInputError}from"../../Errors.js";import{validation}from"../../Validation.js";import{getFormForElement}from"./FormElementMap.js";class SetCurrentFormElementItem{execute(e){var{
|
|
1
|
+
import{ActivityInputError}from"../../Errors.js";import{validation}from"../../Validation.js";import{getFormForElement}from"./FormElementMap.js";class SetCurrentFormElementItem{execute(e){var{elementName:t,matchType:r,value:m}=e;let a=e["form"];switch("object"==typeof t&&(a=getFormForElement(t)),validation.exists("form",a),validation.string("matchType",r,validation.never),validation.exists("value",m),r){case"index":case"item":case"key":case"label":case"value":break;default:throw new ActivityInputError("matchOn",'The `matchOn` input must be "index", "item", "key", "label" or "value".')}t=a.actor.getElementName(t,a.event);return{result:a.actor.setCurrentItem(t,m,r)}}}SetCurrentFormElementItem.action="gcx:wf:forms::SetCurrentFormElementItem",SetCurrentFormElementItem.suite="gcx:wf:builtin";export{SetCurrentFormElementItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{GenericActivityError}from"../../Errors.js";import{validation}from"../../Validation.js";class SetFormElementEvent{execute(e,t){
|
|
1
|
+
import{GenericActivityError}from"../../Errors.js";import{validation}from"../../Validation.js";class SetFormElementEvent{execute(e,t){const{eventName:i,form:r}=e;let{displayFormId:n,elementName:o,targetActivityId:m}=e;if(n=validation.string("displayFormId",n),o=validation.string("elementName",o),m=validation.string("targetActivityId",m,validation.never),n&&"$"===n[0]&&(n=n.substring(1)),n=n||t.ambient.activityContexts.$$form.activity.id,!n)throw new GenericActivityError(`No form could be found. displayFormId=${e.displayFormId}`);if(!(o=r.actor.getElementName(o,r.event)))throw new GenericActivityError(`No form element could be found to assign the event to. elementName=${e.elementName}`);return"$"===m[0]&&(m=m.substring(1)),t.ambient.trivia.setFormElementEvent(n,m,o,i),{}}}SetFormElementEvent.action="gcx:wf:forms::SetFormElementEvent",SetFormElementEvent.suite="gcx:wf:builtin";export{SetFormElementEvent};
|