@vertigis/workflow 5.49.0 → 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.
- package/Collections.d.ts +27 -27
- package/Collections.js +1 -1
- package/EnumUtils.d.ts +5 -5
- package/EnumUtils.js +1 -1
- package/Errors.d.ts +27 -27
- package/Hooks.d.ts +2 -2
- package/IActivityHandler.d.ts +14 -14
- package/ProgramInspectorFacility.d.ts +1 -1
- package/ProgramInspectorFacility.js +1 -1
- package/Task.d.ts +3 -3
- package/Task.js +1 -1
- package/TemplateUtils.d.ts +2 -2
- package/Validation.d.ts +10 -1
- package/Validation.js +1 -1
- package/activities/app/GetApplicationData.d.ts +1 -1
- package/activities/app/GetApplicationData.js +1 -1
- package/activities/app/RemoveApplicationData.d.ts +1 -1
- package/activities/app/RemoveApplicationData.js +1 -1
- package/activities/app/SetApplicationData.d.ts +1 -1
- package/activities/app/SetApplicationData.js +1 -1
- package/activities/arcgis/AddFeatures.d.ts +7 -4
- package/activities/arcgis/AddFeatures.js +1 -1
- package/activities/arcgis/AreaEngineTask.d.ts +1 -1
- package/activities/arcgis/AreaEngineTask.js +1 -1
- package/activities/arcgis/BufferEngineTask.d.ts +1 -1
- package/activities/arcgis/BufferEngineTask.js +1 -1
- package/activities/arcgis/CastGeometry.d.ts +4 -4
- package/activities/arcgis/CompareGeometries.d.ts +1 -1
- package/activities/arcgis/CompareGeometries.js +1 -1
- package/activities/arcgis/DeleteFeatures.d.ts +7 -3
- package/activities/arcgis/DeleteFeatures.js +1 -1
- package/activities/arcgis/DifferenceEngineTask.d.ts +1 -1
- package/activities/arcgis/DifferenceEngineTask.js +1 -1
- package/activities/arcgis/FlipEngineTask.d.ts +1 -1
- package/activities/arcgis/FlipEngineTask.js +1 -1
- package/activities/arcgis/GenerateArcGisToken.d.ts +2 -2
- package/activities/arcgis/GeoprocessingAsync.d.ts +2 -2
- package/activities/arcgis/GetAttributeValue.d.ts +1 -0
- package/activities/arcgis/GetAttributeValues.d.ts +1 -0
- package/activities/arcgis/GetCurrentPosition.d.ts +28 -28
- package/activities/arcgis/GetFeatureGeometries.d.ts +2 -2
- package/activities/arcgis/GetFeatureSetExtent.d.ts +2 -2
- package/activities/arcgis/GetFormElementItemsFromFeatures.d.ts +2 -2
- package/activities/arcgis/GetFormElementItemsFromFeatures.js +1 -1
- package/activities/arcgis/GetGeometryExtent.d.ts +2 -2
- package/activities/arcgis/LengthEngineTask.d.ts +1 -1
- package/activities/arcgis/LengthEngineTask.js +1 -1
- package/activities/arcgis/MapProvider.d.ts +92 -92
- package/activities/arcgis/MapProvider.js +1 -1
- package/activities/arcgis/NearestCoordinateEngineTask.d.ts +6 -6
- package/activities/arcgis/NearestVertexEngineTask.d.ts +6 -6
- package/activities/arcgis/NearestVerticesEngineTask.d.ts +6 -6
- package/activities/arcgis/ProjectServiceTask.js +1 -1
- package/activities/arcgis/ResetLayerDefinitionExpression.d.ts +2 -2
- package/activities/arcgis/RunPrint.d.ts +1 -1
- package/activities/arcgis/RunPrint.js +1 -1
- package/activities/arcgis/RunReport.js +1 -1
- package/activities/arcgis/RunWorkflow.d.ts +4 -4
- package/activities/arcgis/RunWorkflow.js +1 -1
- package/activities/arcgis/SetImageryLayerOptions.d.ts +2 -2
- package/activities/arcgis/SetLayerDefinitionExpression.d.ts +2 -2
- package/activities/arcgis/SetLayerProperty.d.ts +2 -2
- package/activities/arcgis/SetLayerVisibility.d.ts +2 -2
- package/activities/arcgis/SetViewExtent.d.ts +4 -4
- package/activities/arcgis/SetViewpoint.d.ts +2 -2
- package/activities/arcgis/TypeChecking.d.ts +3 -3
- package/activities/arcgis/UpdateFeatures.d.ts +6 -3
- package/activities/arcgis/UpdateFeatures.js +1 -1
- package/activities/arcgis/libs/arcGisRestApi.d.ts +4 -4
- package/activities/arcgis/libs/shared.d.ts +9 -0
- package/activities/arcgis/libs/shared.js +1 -0
- package/activities/arcgis/printing.d.ts +14 -14
- package/activities/arcgis/runUtils.d.ts +2 -2
- package/activities/arcgis/runUtils.js +1 -1
- package/activities/arcgis/shared.d.ts +9 -2
- package/activities/arcgis/shared.js +1 -1
- package/activities/core/CalculateDate.d.ts +1 -1
- package/activities/core/CalculateDate.js +1 -1
- package/activities/core/ChannelProvider.d.ts +42 -42
- package/activities/core/ChannelProvider.js +1 -1
- package/activities/core/ForEach.d.ts +4 -4
- package/activities/core/FormatDate.d.ts +21 -21
- package/activities/core/FormatDate.js +1 -1
- package/activities/core/GetFirstItem.d.ts +1 -0
- package/activities/core/GetItemAtIndex.d.ts +1 -0
- package/activities/core/GetLastItem.d.ts +1 -0
- package/activities/core/GetWorkflowInputs.d.ts +6 -2
- package/activities/core/Log.d.ts +1 -1
- package/activities/core/Log.js +1 -1
- package/activities/core/Loop.d.ts +2 -2
- package/activities/core/ParseJson.d.ts +1 -0
- package/activities/core/WebRequest.d.ts +2 -2
- package/activities/csv/ParseCsv.d.ts +1 -0
- package/activities/essentials/GetEssentialsSite.d.ts +2 -2
- package/activities/essentials/RunEssentialsWorkflow.d.ts +2 -2
- package/activities/essentials/RunEssentialsWorkflow.js +1 -1
- package/activities/forms/DisplayForm.d.ts +6 -6
- package/activities/forms/DisplayForm.js +1 -1
- package/activities/forms/FormActor.d.ts +22 -22
- package/activities/forms/FormRenderer.d.ts +2 -2
- package/activities/forms/FormRenderer.js +1 -1
- package/activities/forms/GetFormElementItemsFromCollection.d.ts +7 -7
- package/activities/forms/GetFormElementItemsFromCollection.js +1 -1
- package/activities/math/Max.d.ts +1 -1
- package/activities/math/Max.js +1 -1
- package/activities/math/Min.d.ts +1 -1
- package/activities/math/Min.js +1 -1
- package/activities/server/RunApplication.d.ts +2 -2
- package/activities/server/RunPython.d.ts +4 -4
- package/activities/ui/DialogContent.d.ts +6 -6
- package/activities/ui/DialogProvider.d.ts +5 -5
- package/activities/ui/DialogProvider.js +1 -1
- package/definition/ActivityInput.d.ts +6 -6
- package/definition/ProgramInspector.d.ts +118 -118
- package/definition/ProgramInspector.js +1 -1
- package/definition/Reference.d.ts +2 -2
- package/definition/Resource.d.ts +15 -15
- package/definition/Transition.d.ts +4 -4
- package/diagnostics/ConsoleDebugLogger.d.ts +2 -2
- package/diagnostics/ConsoleDebugLogger.js +1 -1
- package/execution/ActivityContext.d.ts +35 -35
- package/execution/ActivityContext.js +1 -1
- package/execution/ActivityContextProxy.d.ts +7 -7
- package/execution/ActivityContextProxy.js +1 -1
- package/execution/AmbientState.d.ts +29 -29
- package/execution/AmbientState.js +1 -1
- package/execution/AmbientStateProxy.d.ts +10 -10
- package/execution/AmbientStateProxy.js +1 -1
- package/execution/AsyncContext.d.ts +1 -1
- package/execution/AsyncContext.js +1 -1
- package/execution/Engine.d.ts +27 -28
- package/execution/Engine.js +1 -1
- package/execution/IDebugSession.d.ts +10 -10
- package/execution/MonikerFrame.d.ts +2 -2
- package/execution/MonikerFrame.js +1 -1
- package/execution/Proxy.d.ts +1 -1
- package/execution/Proxy.js +1 -1
- package/execution/StepContext.d.ts +1 -1
- package/execution/StepContext.js +1 -1
- package/execution/TransitionContext.d.ts +1 -1
- package/execution/TransitionContext.js +1 -1
- package/forms/ExclusiveTimer.d.ts +2 -2
- package/forms/ExclusiveTimer.js +1 -1
- package/forms/FormComponent.d.ts +7 -7
- package/forms/FormComponent.js +1 -1
- package/forms/FormDefinition.d.ts +42 -42
- package/forms/FormHost.d.ts +148 -148
- package/forms/FormHost.js +1 -1
- package/forms/FormPresenterHost.d.ts +42 -42
- package/forms/MutuallyExclusiveSectionGroup.d.ts +6 -6
- package/forms/MutuallyExclusiveSectionGroup.js +1 -1
- package/forms/NumberParser.d.ts +2 -2
- package/forms/branding/WorkflowColor.d.ts +5 -5
- package/forms/branding/WorkflowColor.js +1 -1
- package/forms/components/Button.js +1 -1
- package/forms/components/DateTimePicker.js +1 -1
- package/forms/components/FormLabelNumberField.d.ts +4 -4
- package/forms/components/GeometryPickerListItem.d.ts +4 -4
- package/forms/components/SignatureDialog.d.ts +2 -2
- package/forms/components/SketchDialog.d.ts +5 -5
- package/forms/components/common.js +1 -1
- package/forms/dateUtilities.d.ts +2 -2
- package/forms/elements/types.d.ts +2 -2
- package/forms/index.d.ts +2 -2
- package/forms/numberFormatter.d.ts +8 -8
- package/forms/numberUtilities.d.ts +1 -1
- package/forms/utils.d.ts +6 -12
- package/libs/version.d.ts +1 -1
- package/libs/version.js +1 -1
- package/package.json +1 -1
- package/ui/UIService.d.ts +2 -2
- package/ui/UIService.js +1 -1
package/Collections.d.ts
CHANGED
|
@@ -4,57 +4,57 @@ export interface PropertySet {
|
|
|
4
4
|
}
|
|
5
5
|
/** Provides a means to iterate over a collection efficiently. */
|
|
6
6
|
export declare class Iterator<T> {
|
|
7
|
-
|
|
7
|
+
/** Returns an empty iterable. */
|
|
8
|
+
static empty: Iterator<any>;
|
|
8
9
|
current: T | undefined;
|
|
10
|
+
key: string | number | undefined;
|
|
11
|
+
/** Wraps the items or item as an iterable. */
|
|
12
|
+
static from<T>(items: Iterable<T>): Iterator<T>;
|
|
13
|
+
/** Returns an iterable which represents the concatenation of two iterables. */
|
|
14
|
+
concat(items: Iterable<T>): Iterator<T>;
|
|
15
|
+
/** Returns an iterable which filters. */
|
|
16
|
+
filter(predicate: (item: T, key: string | number) => boolean): Iterator<T>;
|
|
9
17
|
/** Exposes the remaining assets of the collection as an array. */
|
|
10
18
|
list(): T[];
|
|
19
|
+
/** Maps the iterator to another collection. */
|
|
20
|
+
map<TResult>(itemSelector: (item: T) => Iterable<TResult>, keySelector?: (result: TResult, key: string | number) => string | number): Iterator<TResult>;
|
|
11
21
|
/** Selects the next asset of the collection. */
|
|
12
22
|
next(): boolean;
|
|
13
23
|
/** Peeks at the next item. */
|
|
14
24
|
peek(): T | undefined;
|
|
15
|
-
/** Maps the iterator to another collection. */
|
|
16
|
-
map<TResult>(itemSelector: (item: T) => Iterable<TResult>, keySelector?: (result: TResult, key: string | number) => string | number): Iterator<TResult>;
|
|
17
|
-
/** Returns an iterable which filters. */
|
|
18
|
-
filter(predicate: (item: T, key: string | number) => boolean): Iterator<T>;
|
|
19
|
-
/** Returns an iterable which represents the concatenation of two iterables. */
|
|
20
|
-
concat(items: Iterable<T>): Iterator<T>;
|
|
21
|
-
/** Returns an empty iterable. */
|
|
22
|
-
static empty: Iterator<any>;
|
|
23
|
-
/** Wraps the items or item as an iterable. */
|
|
24
|
-
static from<T>(items: Iterable<T>): Iterator<T>;
|
|
25
25
|
}
|
|
26
26
|
/** Used internally by Dictionary to track items. */
|
|
27
27
|
interface DictionaryEntry<T> {
|
|
28
|
-
/** Used to track the key of the entry. */
|
|
29
|
-
key: string;
|
|
30
28
|
/** Used to track the index of the entry. */
|
|
31
29
|
index: number;
|
|
30
|
+
/** Used to track the key of the entry. */
|
|
31
|
+
key: string;
|
|
32
32
|
/** Used to track the value of the entry. */
|
|
33
33
|
value: T;
|
|
34
34
|
}
|
|
35
35
|
export declare class Dictionary<T> {
|
|
36
|
-
/** Assign the value to the given key. */
|
|
37
|
-
protected iterating: boolean;
|
|
38
36
|
/** Assign the value to the given key. */
|
|
39
37
|
protected array: DictionaryEntry<T>[];
|
|
40
38
|
/** Assign the value to the given key. */
|
|
39
|
+
protected iterating: boolean;
|
|
40
|
+
/** Assign the value to the given key. */
|
|
41
41
|
protected lookup: Record<string, DictionaryEntry<T>>;
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
/** Performs an iteration of the items. */
|
|
45
|
-
iterate(): Iterator<T>;
|
|
42
|
+
/** Gets the length. */
|
|
43
|
+
get length(): number;
|
|
46
44
|
/** Assigns the value to the given key. */
|
|
47
45
|
assign(key: any, value: T): T | undefined;
|
|
48
|
-
/**
|
|
49
|
-
|
|
46
|
+
/** Clears the collection. */
|
|
47
|
+
clear(): void;
|
|
50
48
|
/** Tests if the key exists. */
|
|
51
49
|
exists(key: any): boolean;
|
|
52
50
|
/** Finds the specific item given the key. */
|
|
53
51
|
find(key: any): T | undefined;
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
|
|
52
|
+
/** Performs an iteration of the items. */
|
|
53
|
+
iterate(): Iterator<T>;
|
|
54
|
+
/** Removes an item given the key. */
|
|
55
|
+
remove(key: any): boolean;
|
|
56
|
+
/** Ensures the array internal array is mutable so that iterators are not corrupted. */
|
|
57
|
+
protected ensureMutable(): DictionaryEntry<T>[];
|
|
58
58
|
}
|
|
59
59
|
/** Offers a means to tie an item to a result. */
|
|
60
60
|
interface Thunk {
|
|
@@ -72,12 +72,12 @@ interface ThunkArray extends Array<Thunk> {
|
|
|
72
72
|
export declare class Stash {
|
|
73
73
|
/** Structure for managing the internal state. */
|
|
74
74
|
protected lookup: Record<string, Thunk | ThunkArray>;
|
|
75
|
-
/** Indicates if the thunk(s) is a singleton or a provisioned array. */
|
|
76
|
-
protected isArray(thunks: Thunk | ThunkArray): thunks is ThunkArray;
|
|
77
75
|
/** Reads the result for a particular key/item. */
|
|
78
76
|
read(key: any, item: any): any;
|
|
79
77
|
/** Writes the result for a particular key/item. */
|
|
80
78
|
write(key: any, item: any, result: any): any;
|
|
79
|
+
/** Indicates if the thunk(s) is a singleton or a provisioned array. */
|
|
80
|
+
protected isArray(thunks: Thunk | ThunkArray): thunks is ThunkArray;
|
|
81
81
|
}
|
|
82
82
|
/** Convenience for specifying an iterable type. */
|
|
83
83
|
export type Iterable<T> = T | T[] | Iterator<T>;
|
package/Collections.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export class Iterator{
|
|
1
|
+
export class Iterator{static from(t){if(Array.isArray(t)){const r=new Iterator,e=r.next;return r.next=function(){let n=0;return r.next=function(){return n<t.length?(r.key=n,r.current=t[n++],!0):(r.key=n,r.current=void 0,r.next=e,!1)},r.next()},r}if(t instanceof Iterator)return t;const r=new Iterator,e=r.next;return r.next=function(){return r.current=t,r.next=function(){return r.current=void 0,r.next=e,!1},!0},r}concat(t){const r=new Iterator,e=r.next;return r.next=()=>{if(this.next())return r.key=this.key,r.current=this.current,!0;const n=Iterator.from(t);return r.next=function(){return n.next()?(r.key=n.key,r.current=n.current,!0):(r.key=void 0,r.current=void 0,r.next=e,!1)},r.next()},r}filter(t){const r=new Iterator,e=r.next;return r.next=()=>{for(;this.next();)if(t(this.current,this.key))return r.key=this.key,r.current=this.current,!0;return r.key=void 0,r.current=void 0,r.next=e,!1},r}list(){const t=[];for(;this.next();)t.push(this.current);return t}map(t,r){null==r&&(r=function(t,r){return r});const e=new Iterator,n=e.next;return e.next=()=>{for(;this.next();){const n=Iterator.from(t(this.current));if(n.next()){const t=e.next;return e.next=function(){return n.next()?(e.key=r(n.current,n.key),e.current=n.current,!0):(e.next=t,e.next())},e.key=r(n.current,n.key),e.current=n.current,!0}}return e.key=void 0,e.current=void 0,e.next=n,!1},e}next(){return!1}peek(){return this.next()?this.current:void 0}}Iterator.empty=new Iterator;export class Dictionary{constructor(){this.array=[],this.iterating=!1,this.lookup={}}get length(){return this.array.length}assign(t,r){t=String(t);const e=this.lookup,n=e[t];if(void 0!==n){const i=n.index,s=n.value;return this.ensureMutable()[i]=e[t]={key:t,index:i,value:r},s}const i=this.ensureMutable();i.push(e[t]={key:t,index:i.length,value:r})}clear(){this.array.length>0&&(this.array=[],this.lookup={})}exists(t){return void 0!==this.lookup[String(t)]}find(t){const r=this.lookup[String(t)];return void 0!==r?r.value:void 0}iterate(){const t=new Iterator,r=t.next;return t.next=()=>{this.iterating?this.array=[...this.array]:this.iterating=!0;let e=0;const n=this.array;return t.next=()=>{for(;e<n.length;){const r=n[e++],i=r.key;if(this.lookup[i]===r)return t.key=i,t.current=r.value,!0}return this.array===n&&(this.iterating=!1),t.key=void 0,t.current=void 0,t.next=r,!1},t.next()},t}remove(t){t=String(t);const r=this.lookup,e=r[t];if(void 0!==e&&delete r[t]){const t=e.index,r=this.ensureMutable(),n=r.length-1;if(t!==n){const e=r[n];r[e.index=t]=e}r.length=n}return!1}ensureMutable(){let t=this.array;return this.iterating&&(t=this.array=[...t],this.iterating=!1),t}}export class Stash{constructor(){this.lookup={}}read(t,r){const e=this.lookup[String(t)];if(void 0!==e){if(!this.isArray(e))return e.item===r?e.result:void 0;for(const t of e)if(t.item===r)return t.result}}write(t,r,e){t=String(t);const n=this.lookup;let i=n[t];if(void 0!==i)if(this.isArray(i)){for(const t of i)if(t.item===r){const r=t.result;return t.result=e,r}i.push({item:r,result:e})}else{if(i.item===r){const t=i.result;return i.result=e,t}n[t]=i=[i,{item:r,result:e}],i.owner=n}else n[t]={item:r,result:e}}isArray(t){return Array.isArray(t)&&t.owner===this.lookup}}
|
package/EnumUtils.d.ts
CHANGED
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class EnumUtils {
|
|
7
7
|
/**
|
|
8
|
-
* Returns all the names
|
|
9
|
-
* of name/value pairs.
|
|
8
|
+
* Returns an array of all the names defined in an enumeration.
|
|
10
9
|
* @param enumeration An enumeration
|
|
11
10
|
*/
|
|
12
|
-
static
|
|
11
|
+
static getNames(enumeration: any): string[];
|
|
13
12
|
/**
|
|
14
|
-
* Returns
|
|
13
|
+
* Returns all the names and values defined in an enumeration as an array
|
|
14
|
+
* of name/value pairs.
|
|
15
15
|
* @param enumeration An enumeration
|
|
16
16
|
*/
|
|
17
|
-
static
|
|
17
|
+
static getNamesAndValues<T extends number>(enumeration: any): any[];
|
|
18
18
|
/**
|
|
19
19
|
* Returns an array of all the numeric values defined in an enumeration.
|
|
20
20
|
* @param enumeration An enumeration
|
package/EnumUtils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export class EnumUtils{static
|
|
1
|
+
export class EnumUtils{static getNames(t){return EnumUtils.getObjValues(t).filter(t=>"string"==typeof t)}static getNamesAndValues(t){return EnumUtils.getNames(t).map(e=>({name:e,value:t[e]}))}static getValues(t){return EnumUtils.getObjValues(t).filter(t=>"number"==typeof t)}static getObjValues(t){return Object.keys(t).map(e=>t[e])}}
|
package/Errors.d.ts
CHANGED
|
@@ -23,21 +23,21 @@ export declare class ActivityCancellationError extends ActivityError {
|
|
|
23
23
|
}
|
|
24
24
|
/** Defines an error that occurs when there is an error executing an activity. */
|
|
25
25
|
export declare class GenericActivityError extends ActivityError {
|
|
26
|
-
constructor(code?: string, text?: string);
|
|
27
26
|
/** Indicates the activity that failed. */
|
|
28
27
|
activityId: number | undefined;
|
|
29
28
|
/** Indicates the inner error. */
|
|
30
29
|
code: string;
|
|
31
30
|
/** Indicates the amount of time taken. */
|
|
32
31
|
elapsed: number | undefined;
|
|
33
|
-
/** Indicates the error was a result of a timeout. */
|
|
34
|
-
timedOut: boolean | undefined;
|
|
35
32
|
/** Indicates the inner error. */
|
|
36
33
|
error: any;
|
|
37
34
|
/** Indicates the inner errors. */
|
|
38
35
|
errors: Error[] | undefined;
|
|
39
36
|
/** Indicates the partial result. */
|
|
40
37
|
partialResult: any;
|
|
38
|
+
/** Indicates the error was a result of a timeout. */
|
|
39
|
+
timedOut: boolean | undefined;
|
|
40
|
+
constructor(code?: string, text?: string);
|
|
41
41
|
}
|
|
42
42
|
declare const ProgramStartError_base: {
|
|
43
43
|
new (): Error;
|
|
@@ -45,8 +45,8 @@ declare const ProgramStartError_base: {
|
|
|
45
45
|
};
|
|
46
46
|
/** Defines an error that occurs when there is no starting step given or available. */
|
|
47
47
|
export declare class ProgramStartError extends ProgramStartError_base {
|
|
48
|
-
constructor();
|
|
49
48
|
code: string | undefined;
|
|
49
|
+
constructor();
|
|
50
50
|
}
|
|
51
51
|
declare const UnspecifiedError_base: {
|
|
52
52
|
new (): Error;
|
|
@@ -54,18 +54,18 @@ declare const UnspecifiedError_base: {
|
|
|
54
54
|
};
|
|
55
55
|
/** Defines an error that occurs when there is no starting step given or available. */
|
|
56
56
|
export declare class UnspecifiedError extends UnspecifiedError_base {
|
|
57
|
-
constructor();
|
|
58
57
|
code: string | undefined;
|
|
58
|
+
constructor();
|
|
59
59
|
}
|
|
60
60
|
/** Defines an error that occurs when there is a problem with instantiating an activity handler. */
|
|
61
61
|
export declare class ActivityBindingError extends ActivityError {
|
|
62
|
-
constructor(id: number, action: string, error?: any);
|
|
63
|
-
/** Indicates the activity that failed. */
|
|
64
|
-
activityId: number | undefined;
|
|
65
62
|
/** Indicates the action that failed. */
|
|
66
63
|
action: string;
|
|
64
|
+
/** Indicates the activity that failed. */
|
|
65
|
+
activityId: number | undefined;
|
|
67
66
|
/** Indicates the underlying error that occurred. */
|
|
68
67
|
error: any;
|
|
68
|
+
constructor(id: number, action: string, error?: any);
|
|
69
69
|
}
|
|
70
70
|
declare const EngineRuntimeError_base: {
|
|
71
71
|
new (): Error;
|
|
@@ -73,71 +73,71 @@ declare const EngineRuntimeError_base: {
|
|
|
73
73
|
};
|
|
74
74
|
/** Defines an error that occurs when there is a problem with the workflow engine. */
|
|
75
75
|
export declare class EngineRuntimeError extends EngineRuntimeError_base {
|
|
76
|
-
constructor(error: any);
|
|
77
76
|
code: string | undefined;
|
|
78
77
|
error: any;
|
|
78
|
+
constructor(error: any);
|
|
79
79
|
}
|
|
80
80
|
/** Defines an error that occurs when there is a problem evaluating an expression during the execution of a workflow. */
|
|
81
81
|
export declare class ExpressionEvaluationError extends ActivityError {
|
|
82
|
-
constructor(id: number, inputName: string, expression: string, error?: any);
|
|
83
82
|
/** Indicates the identifier the failed activity. */
|
|
84
83
|
activityId: number;
|
|
85
|
-
/** Indicates the input name of the failed expression. */
|
|
86
|
-
inputName: string;
|
|
87
|
-
/** Indicates the expression that failed. */
|
|
88
|
-
expression: string;
|
|
89
84
|
/** Indicates the error that failed. */
|
|
90
85
|
error: any;
|
|
86
|
+
/** Indicates the expression that failed. */
|
|
87
|
+
expression: string;
|
|
88
|
+
/** Indicates the input name of the failed expression. */
|
|
89
|
+
inputName: string;
|
|
90
|
+
constructor(id: number, inputName: string, expression: string, error?: any);
|
|
91
91
|
}
|
|
92
92
|
/** Defines an error that occurs when there is a problem parsing an expression during the execution of a workflow. */
|
|
93
93
|
export declare class ExpressionSyntaxError extends ActivityError {
|
|
94
|
-
constructor(id: number, inputName: string, expression: string, error?: any);
|
|
95
94
|
/** Indicates the identifier the failed activity. */
|
|
96
95
|
activityId: number;
|
|
97
|
-
/** Indicates the input name of the failed expression. */
|
|
98
|
-
inputName: string;
|
|
99
|
-
/** Indicates the expression that failed. */
|
|
100
|
-
expression: string;
|
|
101
96
|
/** Indicates the error that failed. */
|
|
102
97
|
error: any;
|
|
98
|
+
/** Indicates the expression that failed. */
|
|
99
|
+
expression: string;
|
|
100
|
+
/** Indicates the input name of the failed expression. */
|
|
101
|
+
inputName: string;
|
|
102
|
+
constructor(id: number, inputName: string, expression: string, error?: any);
|
|
103
103
|
}
|
|
104
104
|
/** Defines an error that occurs when there is a problem accesssing the workflow or global scope. */
|
|
105
105
|
export declare class ExpressionAccessorError extends ActivityError {
|
|
106
|
-
constructor(id: number, accessorName: string, error: any, errors?: Error[]);
|
|
107
|
-
/** Indicates the identifier the failed activity. */
|
|
108
|
-
activityId: number;
|
|
109
106
|
/** Indicates the accessor name within the failed expression. */
|
|
110
107
|
accessorName: string;
|
|
108
|
+
/** Indicates the identifier the failed activity. */
|
|
109
|
+
activityId: number;
|
|
111
110
|
/** Indicates the error that failed. */
|
|
112
111
|
error?: any;
|
|
113
112
|
/** Indicates the error that failed. */
|
|
114
113
|
errors?: Error[];
|
|
114
|
+
constructor(id: number, accessorName: string, error: any, errors?: Error[]);
|
|
115
115
|
}
|
|
116
116
|
/** Defines an error that occurs when there is a problem accessing the workflow or global scope. */
|
|
117
117
|
export declare class ActivityActivationError extends ActivityError {
|
|
118
|
-
constructor(id: number, type: string, error: any);
|
|
119
118
|
/** Indicates the identifier the failed activity. */
|
|
120
119
|
activityId: number;
|
|
121
|
-
/** Indicates the type of the . */
|
|
122
|
-
type: string;
|
|
123
120
|
/** Indicates the error that failed. */
|
|
124
121
|
error?: any;
|
|
122
|
+
/** Indicates the type of the . */
|
|
123
|
+
type: string;
|
|
124
|
+
constructor(id: number, type: string, error: any);
|
|
125
125
|
}
|
|
126
126
|
/** Defines an error that occurs when there is a failure with an activity. */
|
|
127
127
|
export declare class AggregateActivityError extends ActivityError {
|
|
128
|
-
constructor(id: number, errors?: Error[]);
|
|
129
128
|
/** Indicates the identifier the failed activity. */
|
|
130
129
|
activityId: number;
|
|
131
130
|
/** Indicates the error that failed. */
|
|
132
131
|
errors?: Error[];
|
|
132
|
+
constructor(id: number, errors?: Error[]);
|
|
133
133
|
}
|
|
134
134
|
/** Defines an error that occurs when there is a problem with an input. */
|
|
135
135
|
export declare class ActivityInputError extends ActivityError {
|
|
136
|
-
constructor(inputName: string, assertion: string);
|
|
137
136
|
/** Indicates the assertion for which the input failed. */
|
|
138
137
|
assertion: string;
|
|
139
138
|
/** Indicates the input that there was a problem with. */
|
|
140
139
|
inputName: string;
|
|
140
|
+
constructor(inputName: string, assertion: string);
|
|
141
141
|
}
|
|
142
142
|
/**
|
|
143
143
|
* Defines an error that occurs when an attempt was made to execute an activity
|
package/Hooks.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import type { IFacility } from "./Activator";
|
|
|
2
2
|
import type { IActivityHandler, IActivityContext } from "./IActivityHandler";
|
|
3
3
|
/** Do not reference. */
|
|
4
4
|
interface IActivityHandlerConstructorWithFacility<T> {
|
|
5
|
-
new (): IActivityHandlerWithFacility<T>;
|
|
6
5
|
prototype: IActivityHandlerWithFacility<T>;
|
|
6
|
+
new (): IActivityHandlerWithFacility<T>;
|
|
7
7
|
}
|
|
8
8
|
/** Do not reference. */
|
|
9
9
|
interface IActivityHandlerConstructorWithTwoFacilities<T1, T2> {
|
|
10
|
-
new (): IActivityHandlerWithTwoFacilities<T1, T2>;
|
|
11
10
|
prototype: IActivityHandlerWithTwoFacilities<T1, T2>;
|
|
11
|
+
new (): IActivityHandlerWithTwoFacilities<T1, T2>;
|
|
12
12
|
}
|
|
13
13
|
/** Do not reference. */
|
|
14
14
|
interface IActivityHandlerWithFacility<T> {
|
package/IActivityHandler.d.ts
CHANGED
|
@@ -21,8 +21,6 @@ export interface IAmbientState {
|
|
|
21
21
|
completion: Bluebird<object>;
|
|
22
22
|
/** Indicates the environment for expressions evaluation. */
|
|
23
23
|
environment: Record<string, any>;
|
|
24
|
-
/** Indicates the resources for expression evaluation. */
|
|
25
|
-
resources?: Record<string, any>;
|
|
26
24
|
/** Indicates the error given to the workflow consumer. */
|
|
27
25
|
error?: Error;
|
|
28
26
|
/** Indicates the inputs given to the workflow consumer. */
|
|
@@ -35,6 +33,8 @@ export interface IAmbientState {
|
|
|
35
33
|
outputs: Record<string, any>;
|
|
36
34
|
/** The printing engine URL used for sending print requests. */
|
|
37
35
|
printingServiceUrl?: string;
|
|
36
|
+
/** Indicates the resources for expression evaluation. */
|
|
37
|
+
resources?: Record<string, any>;
|
|
38
38
|
/** Indicates the trivia for storing ambient-level state. */
|
|
39
39
|
trivia?: Record<string, any>;
|
|
40
40
|
/** Immediately completes the workflow. */
|
|
@@ -57,36 +57,36 @@ export interface Abortable {
|
|
|
57
57
|
* @public
|
|
58
58
|
*/
|
|
59
59
|
export interface IActivityContext {
|
|
60
|
-
/** Indicates the locally-unique identifier that changes per-run per-activity. */
|
|
61
|
-
luid: any;
|
|
62
|
-
/** Indicates the ambient state. */
|
|
63
|
-
ambient: IAmbientState;
|
|
64
60
|
/** Indicates the action being executed. */
|
|
65
61
|
action?: string;
|
|
62
|
+
/** Indicates the ambient state. */
|
|
63
|
+
ambient: IAmbientState;
|
|
66
64
|
/** Indicates the branch being executed. */
|
|
67
65
|
branch?: boolean | number | string;
|
|
68
66
|
/** Indicates the cancellation token. */
|
|
69
67
|
cancellationToken: Task<void> & Abortable;
|
|
68
|
+
/** Indicates the error that was caught. */
|
|
69
|
+
caught?: Error;
|
|
70
|
+
/** Indicates the locally-unique identifier that changes per-run per-activity. */
|
|
71
|
+
luid: any;
|
|
70
72
|
/** Indicates the number of passes on the current step. */
|
|
71
73
|
passes: number;
|
|
72
74
|
/** Indicates the state that was persisted. */
|
|
73
75
|
state: any;
|
|
74
|
-
/** Indicates the error that was caught. */
|
|
75
|
-
caught?: Error;
|
|
76
76
|
/** Attempts to call on a transition chain. */
|
|
77
77
|
call(branch?: boolean | number | string): void;
|
|
78
78
|
/** Attempts to fork to a transition chain. */
|
|
79
79
|
fork(branch?: boolean | number | string): void;
|
|
80
|
-
/** Attempts to
|
|
81
|
-
|
|
82
|
-
/** Instructs the engine to allow the activity to handle errors. */
|
|
83
|
-
registerForErrors(): void;
|
|
80
|
+
/** Attempts to restart the workflow at the context. */
|
|
81
|
+
goto(): void;
|
|
84
82
|
/** Indicates if any transitions are available for the given branch. */
|
|
85
83
|
hasBranch(branch?: boolean | number | string): boolean;
|
|
84
|
+
/** Attempts to jump to a transition chain. */
|
|
85
|
+
jump(branch?: boolean | number | string): void;
|
|
86
86
|
/** Persists state across invocations. */
|
|
87
87
|
persist(state: any): void;
|
|
88
|
-
/**
|
|
89
|
-
|
|
88
|
+
/** Instructs the engine to allow the activity to handle errors. */
|
|
89
|
+
registerForErrors(): void;
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
92
92
|
* Indicates an activity has no inputs. Should only be used in
|
|
@@ -17,8 +17,8 @@ export declare class ProgramInspectorFacility {
|
|
|
17
17
|
* This is useful on hosts like GVH where special processing may be required before downloading resources.
|
|
18
18
|
*/
|
|
19
19
|
resolveInspector(args: ResolveArgs | string, useCache?: boolean, workflowDownloader?: (url: string) => Promise<any>): Promise<ProgramInspector>;
|
|
20
|
+
private createInspector;
|
|
20
21
|
private downloadAndResolveInspector;
|
|
21
22
|
private loadWorkflow;
|
|
22
|
-
private createInspector;
|
|
23
23
|
}
|
|
24
24
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import esriRequest from"@arcgis/core/request";import Bluebird from"bluebird";import{Dictionary}from"./Collections.js";import{ProgramInspector}from"./definition/ProgramInspector.js";export class ProgramInspectorFacility{constructor(){this._cache=new Dictionary}resolveInspector(e,r=!0,t){return Bluebird.attempt(()=>{if(!e)return this.downloadAndResolveInspector(void 0,t);const o="string"==typeof e?e:e.program||e.url;if(r){const r="string"==typeof e?e:e.id||e.url;if(null!=r){const e=this._cache.find(r);return void 0!==e?e:(this._cache.assign(r,this.downloadAndResolveInspector(o,t).catch(e=>(this._cache.remove(r),Bluebird.reject(e)))),this._cache.find(r))}}return this.downloadAndResolveInspector(o,t)})}downloadAndResolveInspector(e,r){if(e instanceof ProgramInspector)return Bluebird.resolve(e);if("object"==typeof e)return this.createInspector(e);return(r||this.loadWorkflow)(e).then(this.createInspector).catch(e=>Bluebird.reject(e))}loadWorkflow(e){const r=e.match(/^(.*?)\/home\/item\.html\?id=(.*?)(#.*)?$/);if(null!=r){e=`${r[1]}/sharing/rest/content/items/${r[2]}/data?f=json`}return Bluebird.resolve(esriRequest(e)).then(e=>Bluebird.resolve(e.data))}
|
|
1
|
+
import esriRequest from"@arcgis/core/request";import Bluebird from"bluebird";import{Dictionary}from"./Collections.js";import{ProgramInspector}from"./definition/ProgramInspector.js";export class ProgramInspectorFacility{constructor(){this._cache=new Dictionary}resolveInspector(e,r=!0,t){return Bluebird.attempt(()=>{if(!e)return this.downloadAndResolveInspector(void 0,t);const o="string"==typeof e?e:e.program||e.url;if(r){const r="string"==typeof e?e:e.id||e.url;if(null!=r){const e=this._cache.find(r);return void 0!==e?e:(this._cache.assign(r,this.downloadAndResolveInspector(o,t).catch(e=>(this._cache.remove(r),Bluebird.reject(e)))),this._cache.find(r))}}return this.downloadAndResolveInspector(o,t)})}createInspector(e){return Bluebird.attempt(function(){if(e instanceof ProgramInspector)return e;const r=new ProgramInspector;return r.import(e),r})}downloadAndResolveInspector(e,r){if(e instanceof ProgramInspector)return Bluebird.resolve(e);if("object"==typeof e)return this.createInspector(e);return(r||this.loadWorkflow)(e).then(this.createInspector).catch(e=>Bluebird.reject(e))}loadWorkflow(e){const r=e.match(/^(.*?)\/home\/item\.html\?id=(.*?)(#.*)?$/);if(null!=r){e=`${r[1]}/sharing/rest/content/items/${r[2]}/data?f=json`}return Bluebird.resolve(esriRequest(e)).then(e=>Bluebird.resolve(e.data))}}
|
package/Task.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** @product This is intended for internal use only within VertiGIS Studio products. */
|
|
2
2
|
export declare class Task<T> implements PromiseLike<T> {
|
|
3
|
+
private _promise;
|
|
4
|
+
private _reason;
|
|
3
5
|
private _state;
|
|
4
6
|
private _value;
|
|
5
|
-
private _reason;
|
|
6
|
-
private _promise;
|
|
7
7
|
constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void);
|
|
8
8
|
static attempt<T>(myFunction: () => T | Task<T>): Task<T>;
|
|
9
9
|
/**
|
|
@@ -23,7 +23,6 @@ export declare class Task<T> implements PromiseLike<T> {
|
|
|
23
23
|
* @returns A Promise for the completion of the callback.
|
|
24
24
|
*/
|
|
25
25
|
finally(onfinally: () => void): Task<T>;
|
|
26
|
-
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Task<TResult1 | TResult2>;
|
|
27
26
|
/**
|
|
28
27
|
* Returns `true` if the task succeeded, `false` otherwise.
|
|
29
28
|
*/
|
|
@@ -47,6 +46,7 @@ export declare class Task<T> implements PromiseLike<T> {
|
|
|
47
46
|
* that a Task failed prior to calling this method.
|
|
48
47
|
*/
|
|
49
48
|
reason(): any;
|
|
49
|
+
then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Task<TResult1 | TResult2>;
|
|
50
50
|
/**
|
|
51
51
|
* Returns the value (if any) if the task is resolved.
|
|
52
52
|
* Otherwise throws an error. Call the `isResolved()` method to confirm
|
package/Task.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const TaskStates={FULFILLED:"fulfilled",PENDING:"pending",REJECTED:"rejected"};export class Task{constructor(t){this._promise=new Promise(t),this._state="pending"}static attempt(t){return new Task(e=>{e(t())})}static race(t){return new Task((e,s)=>{for(const a of t)"object"==typeof a&&"function"==typeof a.then?a.then(e,s):e(a)})}finally(t){const e=e=>Promise.resolve(t()).then(e);return this.then(t=>e(()=>t),t=>e(()=>Promise.reject(t)))}
|
|
1
|
+
const TaskStates={FULFILLED:"fulfilled",PENDING:"pending",REJECTED:"rejected"};export class Task{constructor(t){this._promise=new Promise(t),this._state="pending"}static attempt(t){return new Task(e=>{e(t())})}static race(t){return new Task((e,s)=>{for(const a of t)"object"==typeof a&&"function"==typeof a.then?a.then(e,s):e(a)})}finally(t){const e=e=>Promise.resolve(t()).then(e);return this.then(t=>e(()=>t),t=>e(()=>Promise.reject(t)))}isFulfilled(){return this._state===TaskStates.FULFILLED}isPending(){return this._state===TaskStates.PENDING}isRejected(){return this._state===TaskStates.REJECTED}isResolved(){return this._state!==TaskStates.PENDING}reason(){if(this._state!==TaskStates.REJECTED)throw new Error(`Attempting to read failure reason from a Task that is not rejected. This Task is ${this._state}.`);return this._reason}then(t,e){const s=e=>(this._state="fulfilled",this._value=e,t(e)),a=t=>(this._state="rejected",this._reason=t,e(t));return new Task(t=>t(this._promise.then(s,a)))}value(){if(this._state!==TaskStates.FULFILLED)throw new Error(`Attempting to read value from a Task that is not resolved. This Task is ${this._state}.`);return this._value}}
|
package/TemplateUtils.d.ts
CHANGED
package/Validation.d.ts
CHANGED
|
@@ -148,10 +148,19 @@ export declare namespace validation {
|
|
|
148
148
|
* @param defaultValue The value to return if `value` is not a string.
|
|
149
149
|
*/
|
|
150
150
|
function string(inputName: string, value: any, defaultValue: string | TNever): string;
|
|
151
|
+
/**
|
|
152
|
+
* Checks if an input object contains a url or an esri layer with a url.
|
|
153
|
+
* @param inputs The inputs to an activity.
|
|
154
|
+
* @returns The supplied layer, or a new FeatureLayer using the supplied url.
|
|
155
|
+
*/
|
|
156
|
+
function layer(inputs: {
|
|
157
|
+
layer?: __esri.Layer | __esri.SubtypeSublayer;
|
|
158
|
+
url?: string;
|
|
159
|
+
}): __esri.Layer | __esri.SubtypeSublayer;
|
|
151
160
|
/** Checks if an input object contains a url or an esri layer with a url. */
|
|
152
161
|
function urlOrLayer(inputs: {
|
|
153
|
-
url?: string;
|
|
154
162
|
layer?: __esri.Layer | __esri.SubtypeSublayer;
|
|
163
|
+
url?: string;
|
|
155
164
|
}): string;
|
|
156
165
|
}
|
|
157
166
|
export {};
|
package/Validation.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import SubtypeSublayer from"@arcgis/core/layers/support/SubtypeSublayer";import{ActivityInputError}from"./Errors.js";function isNever(r){return r===validation.never}export var validation;!function(r){function t(r){return"boolean"==typeof r}r.never={neverType:"TNever"},r.array=function(r,t,e){if(null==t){if(isNever(e))throw new ActivityInputError(r,"array");return arguments.length>2?e:void 0}return t instanceof Array?t:[t]},r.isBoolean=t,r.boolean=function(r,e,n){if(null==e){if(isNever(n))throw new ActivityInputError(r,"boolean");return arguments.length>2?n:void 0}if(t(e))return e;if(arguments.length>2){if(isNever(n))throw new ActivityInputError(r,"boolean");return n}throw new ActivityInputError(r,"boolean")},r.exists=function(r,t,e){if(null!=t)return t;if(arguments.length>2&&!isNever(e))return e;throw new ActivityInputError(r,"exists")},r.id=function(r,t,e){if(null==t){if(isNever(e))throw new ActivityInputError(r,"id");return arguments.length>2?e:void 0}if("string"==typeof t)return t;if("number"==typeof t&&0*t==0)return t;if(arguments.length>2){if(isNever(e))throw new ActivityInputError(r,"id");return e}throw new ActivityInputError(r,"id")},r.number=function(r,t,e){if(null==t){if(isNever(e))throw new ActivityInputError(r,"number");return arguments.length>2?e:void 0}const n=t.valueOf();if("number"==typeof n)return n;if("boolean"==typeof n)return n?1:0;if("string"==typeof n){const r=parseFloat(t);if(!isNaN(r))return r}if(arguments.length>2){if(isNever(e))throw new ActivityInputError(r,"number");return e}throw new ActivityInputError(r,"number")},r.string=function(r,t,e){if(null==t){if(isNever(e))throw new ActivityInputError(r,"string");return arguments.length>2?e:void 0}if("string"==typeof t)return t;if(arguments.length>2){if(isNever(e))throw new ActivityInputError(r,"string");return e}throw new ActivityInputError(r,"string")},r.urlOrLayer=function(r){if(null!=r){let t=r.url,e=r.layer;if(!t&&e?.url&&(e instanceof SubtypeSublayer&&(e=e.parent),t=void 0!==e.layerId&&null!==e.layerId?`${e.url}/${e.layerId}`:e.url),t)return t}throw new ActivityInputError("url or layer","url or layer input is required. layer must have a valid url property.")}}(validation||(validation={}));
|
|
1
|
+
import FeatureLayer from"@arcgis/core/layers/FeatureLayer";import SubtypeSublayer from"@arcgis/core/layers/support/SubtypeSublayer";import{ActivityInputError}from"./Errors.js";function isNever(r){return r===validation.never}export var validation;!function(r){function t(r){return"boolean"==typeof r}r.never={neverType:"TNever"},r.array=function(r,t,e){if(null==t){if(isNever(e))throw new ActivityInputError(r,"array");return arguments.length>2?e:void 0}return t instanceof Array?t:[t]},r.isBoolean=t,r.boolean=function(r,e,n){if(null==e){if(isNever(n))throw new ActivityInputError(r,"boolean");return arguments.length>2?n:void 0}if(t(e))return e;if(arguments.length>2){if(isNever(n))throw new ActivityInputError(r,"boolean");return n}throw new ActivityInputError(r,"boolean")},r.exists=function(r,t,e){if(null!=t)return t;if(arguments.length>2&&!isNever(e))return e;throw new ActivityInputError(r,"exists")},r.id=function(r,t,e){if(null==t){if(isNever(e))throw new ActivityInputError(r,"id");return arguments.length>2?e:void 0}if("string"==typeof t)return t;if("number"==typeof t&&0*t==0)return t;if(arguments.length>2){if(isNever(e))throw new ActivityInputError(r,"id");return e}throw new ActivityInputError(r,"id")},r.number=function(r,t,e){if(null==t){if(isNever(e))throw new ActivityInputError(r,"number");return arguments.length>2?e:void 0}const n=t.valueOf();if("number"==typeof n)return n;if("boolean"==typeof n)return n?1:0;if("string"==typeof n){const r=parseFloat(t);if(!isNaN(r))return r}if(arguments.length>2){if(isNever(e))throw new ActivityInputError(r,"number");return e}throw new ActivityInputError(r,"number")},r.string=function(r,t,e){if(null==t){if(isNever(e))throw new ActivityInputError(r,"string");return arguments.length>2?e:void 0}if("string"==typeof t)return t;if(arguments.length>2){if(isNever(e))throw new ActivityInputError(r,"string");return e}throw new ActivityInputError(r,"string")},r.layer=function(r){if(null!=r){const{layer:t,url:e}=r;if(t)return t;if(e)return new FeatureLayer({url:e})}throw new ActivityInputError("url or layer","url or layer input is required. url must be the url of a FeatureLayer.")},r.urlOrLayer=function(r){if(null!=r){let t=r.url,e=r.layer;if(!t&&e?.url&&(e instanceof SubtypeSublayer&&(e=e.parent),t=void 0!==e.layerId&&null!==e.layerId?`${e.url}/${e.layerId}`:e.url),t)return t}throw new ActivityInputError("url or layer","url or layer input is required. layer must have a valid url property.")}}(validation||(validation={}));
|
|
@@ -10,7 +10,7 @@ export interface GetApplicationDataOutputs {
|
|
|
10
10
|
export declare class GetApplicationData implements IActivityHandler {
|
|
11
11
|
static readonly action = "gcx:wf:app::GetApplicationData";
|
|
12
12
|
static readonly suite = "gcx:wf:builtin";
|
|
13
|
+
execute(inputs: GetApplicationDataInputs): Promise<GetApplicationDataOutputs>;
|
|
13
14
|
protected getAppId(): string;
|
|
14
15
|
private getValueFromLocalStorage;
|
|
15
|
-
execute(inputs: GetApplicationDataInputs): Promise<GetApplicationDataOutputs>;
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validation}from"../../Validation.js";import{ApplicationDataDocumentProperty,getLocalStorageKey}from"./applicationData.js";export class GetApplicationData{
|
|
1
|
+
import{validation}from"../../Validation.js";import{ApplicationDataDocumentProperty,getLocalStorageKey}from"./applicationData.js";export class GetApplicationData{async execute(t){const a=validation.string("key",t.key,validation.never);let i,e;switch(validation.string("visibility",t.visibility)){case"application":i=this.getAppId();case"global":{const t=getLocalStorageKey(a,i);e=this.getValueFromLocalStorage(t);break}default:{const t=document;t[ApplicationDataDocumentProperty]&&(e=t[ApplicationDataDocumentProperty][a]);break}}return{value:e}}getAppId(){throw new Error("This version of the activity does not support application visibility.")}getValueFromLocalStorage(t){let a;if(localStorage[t])try{a=JSON.parse(localStorage[t])}catch(a){console.warn(`Failed to deserialize "${t}" from Local Storage.`,a.message)}return a}}GetApplicationData.action="gcx:wf:app::GetApplicationData",GetApplicationData.suite="gcx:wf:builtin";
|
|
@@ -10,7 +10,7 @@ export interface RemoveApplicationDataOutputs {
|
|
|
10
10
|
export declare class RemoveApplicationData implements IActivityHandler {
|
|
11
11
|
static readonly action = "gcx:wf:app::RemoveApplicationData";
|
|
12
12
|
static readonly suite = "gcx:wf:builtin";
|
|
13
|
+
execute(inputs: RemoveApplicationDataInputs): Promise<RemoveApplicationDataOutputs>;
|
|
13
14
|
protected getAppId(): string;
|
|
14
15
|
private removeValueFromLocalStorage;
|
|
15
|
-
execute(inputs: RemoveApplicationDataInputs): Promise<RemoveApplicationDataOutputs>;
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validation}from"../../Validation.js";import{ApplicationDataDocumentProperty,getLocalStorageKey}from"./applicationData.js";export class RemoveApplicationData{
|
|
1
|
+
import{validation}from"../../Validation.js";import{ApplicationDataDocumentProperty,getLocalStorageKey}from"./applicationData.js";export class RemoveApplicationData{async execute(t){const a=validation.string("key",t.key,validation.never);let e,o=!1;switch(validation.string("visibility",t.visibility)){case"application":e=this.getAppId();case"global":{const t=getLocalStorageKey(a,e);o=this.removeValueFromLocalStorage(t);break}default:{const t=document;t[ApplicationDataDocumentProperty]&&void 0!==t[ApplicationDataDocumentProperty][a]&&(delete t[ApplicationDataDocumentProperty][a],o=!0);break}}return{removed:o}}getAppId(){throw new Error("This version of the activity does not support application visibility.")}removeValueFromLocalStorage(t){let a=!1;return localStorage[t]&&(delete localStorage[t],a=!0),a}}RemoveApplicationData.action="gcx:wf:app::RemoveApplicationData",RemoveApplicationData.suite="gcx:wf:builtin";
|
|
@@ -7,7 +7,7 @@ export interface SetApplicationDataInputs {
|
|
|
7
7
|
export declare class SetApplicationData implements IActivityHandler {
|
|
8
8
|
static readonly action = "gcx:wf:app::SetApplicationData";
|
|
9
9
|
static readonly suite = "gcx:wf:builtin";
|
|
10
|
+
execute(inputs: SetApplicationDataInputs): EmptyOutputs;
|
|
10
11
|
protected getAppId(): string;
|
|
11
12
|
private setValueInLocalStorage;
|
|
12
|
-
execute(inputs: SetApplicationDataInputs): EmptyOutputs;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validation}from"../../Validation.js";import{ApplicationDataDocumentProperty,getLocalStorageKey}from"./applicationData.js";export class SetApplicationData{
|
|
1
|
+
import{validation}from"../../Validation.js";import{ApplicationDataDocumentProperty,getLocalStorageKey}from"./applicationData.js";export class SetApplicationData{execute(t){const a=validation.string("key",t.key,validation.never),i=validation.string("visibility",t.visibility),o=t.value;let e;switch(i){case"application":e=this.getAppId();case"global":{const t=getLocalStorageKey(a,e);this.setValueInLocalStorage(t,o);break}default:{const t=document;t[ApplicationDataDocumentProperty]||(t[ApplicationDataDocumentProperty]={}),t[ApplicationDataDocumentProperty][a]=o;break}}return{}}getAppId(){throw new Error("This version of the activity does not support application visibility.")}setValueInLocalStorage(t,a){localStorage[t]=JSON.stringify(a)}}SetApplicationData.action="gcx:wf:app::SetApplicationData",SetApplicationData.suite="gcx:wf:builtin";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { ApplyEditsResponse } from "./libs/arcGisRestApi";
|
|
2
|
+
import type { EditResult } from "./libs/shared";
|
|
3
|
+
import type { IActivityContext, IActivityHandler } from "../../IActivityHandler";
|
|
3
4
|
/** Defines inputs for the AddFeatures activity. */
|
|
4
5
|
export interface AddFeaturesInputs {
|
|
5
6
|
url?: string;
|
|
@@ -10,7 +11,7 @@ export interface AddFeaturesInputs {
|
|
|
10
11
|
}
|
|
11
12
|
export interface AddFeaturesOutputs {
|
|
12
13
|
/** @description The results that were returned. */
|
|
13
|
-
results:
|
|
14
|
+
results: EditResult[];
|
|
14
15
|
/** @description Whether the add operation completed successfully. */
|
|
15
16
|
success: boolean;
|
|
16
17
|
}
|
|
@@ -19,5 +20,7 @@ export declare class AddFeatures implements IActivityHandler {
|
|
|
19
20
|
static readonly suite = "gcx:wf:builtin";
|
|
20
21
|
execute(inputs: AddFeaturesInputs, context: IActivityContext): Promise<AddFeaturesOutputs>;
|
|
21
22
|
/** Called after the apply edit operation completes. */
|
|
22
|
-
protected onApplyEditsComplete(
|
|
23
|
+
protected onApplyEditsComplete(result: __esri.EditsResult | ApplyEditsResponse): void;
|
|
24
|
+
private addUsingLayer;
|
|
25
|
+
private addUsingRestEndpoint;
|
|
23
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{validation}from"../../Validation.js";import{addToPath,post}from"./tools.js";export class AddFeatures{async execute(
|
|
1
|
+
import FeatureLayer from"@arcgis/core/layers/FeatureLayer";import SubtypeGroupLayer from"@arcgis/core/layers/SubtypeGroupLayer";import SubtypeSublayer from"@arcgis/core/layers/support/SubtypeSublayer";import{ActivityInputError}from"../../Errors.js";import{validation}from"../../Validation.js";import{addToPath,post}from"./tools.js";export class AddFeatures{async execute(e,r){const a=validation.layer(e),t=validation.string("gdbVersion",e.gdbVersion),s=validation.array("features",e.features,validation.never);if(a instanceof FeatureLayer||a instanceof SubtypeGroupLayer||a instanceof SubtypeSublayer)return await a.load({signal:r.cancellationToken.signal}),a.capabilities?.operations?.supportsAdd?this.addUsingLayer(a,s,t):this.addUsingRestEndpoint(e,t,r);throw new ActivityInputError("layer","Layer is not a supported type.")}onApplyEditsComplete(e){}async addUsingLayer(e,r,a){const t=await e.applyEdits({addFeatures:r},{gdbVersion:a,globalIdUsed:!1}),{addFeatureResults:s}=t,o=s.map(e=>({error:e.error?{message:e.error.message,name:e.error.name}:void 0,globalId:e.globalId??void 0,objectId:e.objectId??void 0,success:!e.error}));return this.onApplyEditsComplete(t),{results:o,success:o.every(e=>e.success)}}async addUsingRestEndpoint(e,r,a){let t=validation.urlOrLayer(e);t=addToPath(t,"applyEdits");const s=validation.number("timeout",e.timeout),o=validation.array("features",e.features,validation.never).map(e=>{if(e.geometry)return e;{const r=e.toJSON();return delete r.geometry,r}}),i=post(t,{adds:o,gdbVersion:r},s,a.cancellationToken.signal),d=await i;this.onApplyEditsComplete(d);const n=!!d.addResults?.every(e=>e.success);return{results:d.addResults.map(e=>({error:e.error?{message:e.error.description,name:e.error.code+""}:void 0,globalId:e.globalId??void 0,objectId:e.objectId??void 0,success:!e.error})),success:n}}}AddFeatures.action="gcx:wf:arcgis::AddFeatures",AddFeatures.suite="gcx:wf:builtin";
|
|
@@ -13,6 +13,6 @@ export interface AreaEngineTaskOutputs {
|
|
|
13
13
|
export declare class AreaEngineTask implements IActivityHandler {
|
|
14
14
|
static readonly action = "gcx:wf:arcgis::AreaEngineTask";
|
|
15
15
|
static readonly suite = "gcx:wf:builtin";
|
|
16
|
-
private executeUsing;
|
|
17
16
|
execute(inputs: AreaEngineTaskInputs): Promise<AreaEngineTaskOutputs>;
|
|
17
|
+
private executeUsing;
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{execute as executePlanarArea}from"@arcgis/core/geometry/operators/areaOperator";import{execute as executeGeodeticArea,isLoaded,load}from"@arcgis/core/geometry/operators/geodeticAreaOperator";import{validation}from"../../Validation.js";export class AreaEngineTask{async
|
|
1
|
+
import{execute as executePlanarArea}from"@arcgis/core/geometry/operators/areaOperator";import{execute as executeGeodeticArea,isLoaded,load}from"@arcgis/core/geometry/operators/geodeticAreaOperator";import{validation}from"../../Validation.js";export class AreaEngineTask{async execute(e){const a=validation.exists("geometry",e.geometry),r=validation.boolean("geodesic",e.geodesic,!1);return{area:await this.executeUsing(r,a,e.unit)}}async executeUsing(e,a,r){return e?(isLoaded()||await load(),executeGeodeticArea(a,{unit:r})):executePlanarArea(a,{unit:r})}}AreaEngineTask.action="gcx:wf:arcgis::AreaEngineTask",AreaEngineTask.suite="gcx:wf:builtin";
|
|
@@ -17,6 +17,6 @@ export interface BufferEngineTaskOutputs {
|
|
|
17
17
|
export declare class BufferEngineTask implements IActivityHandler {
|
|
18
18
|
static readonly action = "gcx:wf:arcgis::BufferEngineTask";
|
|
19
19
|
static readonly suite = "gcx:wf:builtin";
|
|
20
|
-
private executeUsing;
|
|
21
20
|
execute(inputs: BufferEngineTaskInputs): Promise<BufferEngineTaskOutputs>;
|
|
21
|
+
private executeUsing;
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{executeMany as executeManyBuffer}from"@arcgis/core/geometry/operators/bufferOperator";import{executeMany as executeManyGeodesicBuffer,isLoaded,load}from"@arcgis/core/geometry/operators/geodesicBufferOperator";import{validation}from"../../Validation.js";export class BufferEngineTask{async
|
|
1
|
+
import{executeMany as executeManyBuffer}from"@arcgis/core/geometry/operators/bufferOperator";import{executeMany as executeManyGeodesicBuffer,isLoaded,load}from"@arcgis/core/geometry/operators/geodesicBufferOperator";import{validation}from"../../Validation.js";export class BufferEngineTask{async execute(e){const a=validation.array("geometry",e.geometry,validation.never),i=validation.array("distance",e.distance,validation.never),r=validation.boolean("geodesic",e.geodesic,!1),n=validation.boolean("union",e.union,!1),o=await this.executeUsing(r,a,i,e.unit,n),t=Array.isArray(o)?o:[o];return{geometry:t[0],results:t}}async executeUsing(e,a,i,r,n){return e?(isLoaded()||await load(),executeManyGeodesicBuffer(a,i,{union:n,unit:r})):executeManyBuffer(a,i,{union:n,unit:r})}}BufferEngineTask.action="gcx:wf:arcgis::BufferEngineTask",BufferEngineTask.suite="gcx:wf:builtin";
|