@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.
Files changed (104) hide show
  1. package/Activator.d.ts +1 -1
  2. package/Hooks.d.ts +2 -2
  3. package/IActivityHandler.d.ts +2 -2
  4. package/ProgramInspectorFacility.d.ts +1 -1
  5. package/ProgramInspectorFacility.js +1 -1
  6. package/TemplateUtils.js +1 -1
  7. package/Validation.d.ts +31 -31
  8. package/Validation.js +1 -1
  9. package/activities/arcgis/AddFeatureLayer.d.ts +1 -1
  10. package/activities/arcgis/AddFeatureLayer.js +1 -1
  11. package/activities/arcgis/AddFeatures.d.ts +1 -1
  12. package/activities/arcgis/ConvertValueToArcGisFieldType.d.ts +2 -2
  13. package/activities/arcgis/CreateGraphic.d.ts +1 -1
  14. package/activities/arcgis/DeleteFeatures.d.ts +1 -1
  15. package/activities/arcgis/FeatureSetFromJson.d.ts +1 -1
  16. package/activities/arcgis/GeometryFromJson.d.ts +1 -1
  17. package/activities/arcgis/GeoprocessingAsync.js +1 -1
  18. package/activities/arcgis/GetCurrentPosition.js +1 -1
  19. package/activities/arcgis/GetFormElementItemsFromFeatures.js +1 -1
  20. package/activities/arcgis/MapProvider.d.ts +40 -2
  21. package/activities/arcgis/MapProvider.js +1 -1
  22. package/activities/arcgis/ProjectServiceTask.d.ts +1 -1
  23. package/activities/arcgis/QueryTask.js +1 -1
  24. package/activities/arcgis/RelationServiceTask.js +1 -1
  25. package/activities/arcgis/RendererFromJson.d.ts +1 -1
  26. package/activities/arcgis/ResetAllLayerDefinitionExpressions.d.ts +10 -0
  27. package/activities/arcgis/ResetAllLayerDefinitionExpressions.js +1 -0
  28. package/activities/arcgis/ResetLayerDefinitionExpression.d.ts +24 -0
  29. package/activities/arcgis/ResetLayerDefinitionExpression.js +1 -0
  30. package/activities/arcgis/ReverseGeocode.d.ts +1 -1
  31. package/activities/arcgis/RunWorkflow.js +1 -1
  32. package/activities/arcgis/SetImageryLayerOptions.d.ts +2 -2
  33. package/activities/arcgis/SetMap.d.ts +1 -1
  34. package/activities/arcgis/SetMap.js +1 -1
  35. package/activities/arcgis/SymbolFromJson.d.ts +1 -1
  36. package/activities/arcgis/TypeChecking.d.ts +0 -7
  37. package/activities/arcgis/TypeChecking.js +1 -1
  38. package/activities/arcgis/UpdateFeatures.d.ts +1 -1
  39. package/activities/arcgis/libs/arcGisRestApi.d.ts +1 -1
  40. package/activities/arcgis/shared.d.ts +1 -1
  41. package/activities/arcgis/shared.js +1 -1
  42. package/activities/arcgis/tools.js +1 -1
  43. package/activities/constants.js +1 -1
  44. package/activities/core/ChannelProvider.d.ts +2 -2
  45. package/activities/core/ChannelProvider.js +1 -1
  46. package/activities/core/ConvertToJson.d.ts +1 -1
  47. package/activities/core/ExecuteFunction.js +1 -1
  48. package/activities/core/ForEach.d.ts +6 -5
  49. package/activities/core/FormatDate.d.ts +39 -1
  50. package/activities/core/FormatDate.js +1 -1
  51. package/activities/core/GetWorkflowInputs.d.ts +1 -1
  52. package/activities/core/ParseUrl.js +1 -1
  53. package/activities/core/SetProperty.d.ts +1 -1
  54. package/activities/core/TextReplace.js +1 -1
  55. package/activities/core/converters.d.ts +1 -1
  56. package/activities/essentials/RunEssentialsWorkflow.js +1 -1
  57. package/activities/forms/FormRenderer.js +1 -1
  58. package/activities/forms/GetFormElementItemsFromCollection.js +1 -1
  59. package/activities/forms/SetCurrentFormElementItem.js +1 -1
  60. package/activities/forms/SetFormElementEvent.js +1 -1
  61. package/activities/index.js +1 -1
  62. package/definition/ActivityInput.d.ts +1 -1
  63. package/definition/Program.d.ts +11 -6
  64. package/definition/ProgramInspector.d.ts +9 -2
  65. package/definition/ProgramInspector.js +1 -1
  66. package/execution/ActivityContext.js +1 -1
  67. package/execution/AmbientState.d.ts +5 -5
  68. package/execution/AmbientState.js +1 -1
  69. package/execution/AmbientStateProxy.d.ts +4 -4
  70. package/execution/Engine.d.ts +4 -4
  71. package/execution/Engine.js +1 -1
  72. package/execution/ModuleLoader.d.ts +1 -1
  73. package/forms/FormComponent.d.ts +1 -1
  74. package/forms/FormDefinition.d.ts +4 -4
  75. package/forms/FormHost.d.ts +2 -2
  76. package/forms/FormPresenterHost.d.ts +2 -2
  77. package/forms/components/AutoComplete.js +1 -1
  78. package/forms/components/ButtonBar.js +1 -1
  79. package/forms/components/CheckBox.js +1 -1
  80. package/forms/components/CheckGroup.js +1 -1
  81. package/forms/components/DateRangePicker.js +1 -1
  82. package/forms/components/DateTimePicker.js +1 -1
  83. package/forms/components/DateTimeTextField.js +1 -1
  84. package/forms/components/FormElement.js +1 -1
  85. package/forms/components/GeometryPicker.js +1 -1
  86. package/forms/components/ItemPicker.js +1 -1
  87. package/forms/components/Number.js +1 -1
  88. package/forms/components/NumberRangeSlider.js +1 -1
  89. package/forms/components/NumberSlider.js +1 -1
  90. package/forms/components/RadioGroup.js +1 -1
  91. package/forms/components/Scanner.js +1 -1
  92. package/forms/components/Section.js +1 -1
  93. package/forms/components/TextBox.js +1 -1
  94. package/forms/components/TimePicker.js +1 -1
  95. package/forms/customNumberFormat.js +1 -1
  96. package/forms/index.d.ts +2 -4
  97. package/forms/numberFormatter.js +1 -1
  98. package/forms/numberUtilities.js +1 -1
  99. package/forms/presenter.d.ts +3 -3
  100. package/forms/textUtilities.js +1 -1
  101. package/forms/utils.js +1 -1
  102. package/libs/version.d.ts +1 -1
  103. package/libs/version.js +1 -1
  104. package/package.json +8 -7
package/Activator.d.ts CHANGED
@@ -4,7 +4,7 @@ import Bluebird from "bluebird";
4
4
  */
5
5
  interface IFacilityFactory {
6
6
  /** Activates an instance. */
7
- (type: string): PromiseLike<{}> | {} | undefined;
7
+ (type: string): PromiseLike<object> | object | undefined;
8
8
  }
9
9
  /** Implemented by facilities to uniquely identify that facility. */
10
10
  export interface IFacility {
package/Hooks.d.ts CHANGED
@@ -13,14 +13,14 @@ interface IActivityHandlerConstructorWithTwoFacilities<T1, T2> {
13
13
  /** Do not reference. */
14
14
  interface IActivityHandlerWithFacility<T> {
15
15
  execute: {
16
- (inputs: any, context: IActivityContext, facility: T, ...args: any[]): Promise<{}> | {};
16
+ (inputs: any, context: IActivityContext, facility: T, ...args: any[]): Promise<object> | object;
17
17
  [basisPropertyName]?: IFacility;
18
18
  };
19
19
  }
20
20
  /** Do not reference. */
21
21
  interface IActivityHandlerWithTwoFacilities<T1, T2> {
22
22
  execute: {
23
- (inputs: any, context: IActivityContext, facility1: T1, facility2: T2, ...args: any[]): Promise<{}>;
23
+ (inputs: any, context: IActivityContext, facility1: T1, facility2: T2, ...args: any[]): Promise<object>;
24
24
  [basisPropertyName]?: IFacility;
25
25
  [basisTwoPropertyName]?: IFacility;
26
26
  };
@@ -7,7 +7,7 @@ import type Bluebird from "bluebird";
7
7
  */
8
8
  export interface IActivityHandler {
9
9
  /** Executes the logic for an activity. */
10
- execute(inputs: {}, context: IActivityContext, ...args: any[]): PromiseLike<{}> | {};
10
+ execute(inputs: object, context: IActivityContext, ...args: any[]): PromiseLike<object> | object;
11
11
  }
12
12
  /**
13
13
  * Describes ambient-level state.
@@ -17,7 +17,7 @@ export interface IAmbientState {
17
17
  /** Indicates the ActivityContexts with group name monikers that are in scope. */
18
18
  activityContexts: Record<string, any>;
19
19
  /** Indicates the completion object. */
20
- completion: Bluebird<{}>;
20
+ completion: Bluebird<object>;
21
21
  /** Indicates the environment for expressions evaluation. */
22
22
  environment: Record<string, any>;
23
23
  /** Indicates the resources for expression evaluation. */
@@ -1,7 +1,7 @@
1
1
  import { ProgramInspector } from "./definition/ProgramInspector";
2
2
  interface ResolveArgs {
3
3
  id?: string;
4
- program?: string | {};
4
+ program?: string | object;
5
5
  url?: string;
6
6
  }
7
7
  /** @product This is intended for internal use only within VertiGIS Studio products. */
@@ -1 +1 @@
1
- import esriRequest from"@arcgis/core/request";import Bluebird from"bluebird";import{Dictionary}from"./Collections.js";import{ProgramInspector}from"./definition/ProgramInspector.js";class ProgramInspectorFacility{constructor(){this._cache=new Dictionary}resolveInspector(o,n=!0,i){return Bluebird.attempt(()=>{if(!o)return this.downloadAndResolveInspector(void 0,i);var r="string"==typeof o?o:o.program||o.url;if(n){const t="string"==typeof o?o:o.id||o.url;if(void 0!==t&&null!==t){var e=this._cache.find(t);return void 0!==e?e:(this._cache.assign(t,this.downloadAndResolveInspector(r,i).catch(r=>(this._cache.remove(t),Bluebird.reject(r)))),this._cache.find(t))}}return this.downloadAndResolveInspector(r,i)})}downloadAndResolveInspector(r,e){if(r instanceof ProgramInspector)return Bluebird.resolve(r);if("object"==typeof r)return this.createInspector(r);const t=e||this.loadWorkflow;return t(r).then(this.createInspector).catch(r=>Bluebird.reject(r))}loadWorkflow(r){var e=r.match(/^(.*?)\/home\/item\.html\?id=(.*?)(\#.*)?$/);return null!=e&&(r=`${e[1]}/sharing/rest/content/items/${e[2]}/data?f=json`),Bluebird.resolve(esriRequest(r)).then(r=>Bluebird.resolve(r.data))}createInspector(e){return Bluebird.attempt(function(){if(e instanceof ProgramInspector)return e;const r=new ProgramInspector;return r.import(e),r})}}export{ProgramInspectorFacility};
1
+ import esriRequest from"@arcgis/core/request";import Bluebird from"bluebird";import{Dictionary}from"./Collections.js";import{ProgramInspector}from"./definition/ProgramInspector.js";class ProgramInspectorFacility{constructor(){this._cache=new Dictionary}resolveInspector(o,n=!0,i){return Bluebird.attempt(()=>{if(!o)return this.downloadAndResolveInspector(void 0,i);var r="string"==typeof o?o:o.program||o.url;if(n){const t="string"==typeof o?o:o.id||o.url;if(void 0!==t&&null!==t){var e=this._cache.find(t);return void 0!==e?e:(this._cache.assign(t,this.downloadAndResolveInspector(r,i).catch(r=>(this._cache.remove(t),Bluebird.reject(r)))),this._cache.find(t))}}return this.downloadAndResolveInspector(r,i)})}downloadAndResolveInspector(r,e){if(r instanceof ProgramInspector)return Bluebird.resolve(r);if("object"==typeof r)return this.createInspector(r);const t=e||this.loadWorkflow;return t(r).then(this.createInspector).catch(r=>Bluebird.reject(r))}loadWorkflow(r){var e=r.match(/^(.*?)\/home\/item\.html\?id=(.*?)(#.*)?$/);return null!=e&&(r=`${e[1]}/sharing/rest/content/items/${e[2]}/data?f=json`),Bluebird.resolve(esriRequest(r)).then(r=>Bluebird.resolve(r.data))}createInspector(e){return Bluebird.attempt(function(){if(e instanceof ProgramInspector)return e;const r=new ProgramInspector;return r.import(e),r})}}export{ProgramInspectorFacility};
package/TemplateUtils.js CHANGED
@@ -1 +1 @@
1
- function findTokenInstances(n){const t=[];if(!n)return t;const e=/{\s*([^\{\}]*[^\s\{\}])\s*}/gm;let r=e.exec(n);for(;r;){var o=r[1],s=e.lastIndex,a=s-r[0].length;t.push({token:o,start:a,end:s}),r=e.exec(n)}return t}function getTokenValueString(n,t){return void 0===t?`{${n}}`:null===t?"":String(t)}function replacePlaceholders(n,t,e){let r="",o=0;for(const a of t){var s=a.token;if(o>a.start){console.error("Invalid token data. Data must be supplied in order",t),r=n;break}o<a.start&&(r+=n.substring(o,a.start),o=a.start),r+=e[s],o=a.end}return r+=n.substring(o),{markdown:r}}function valueOrEmptyString(n){return null==n?"":n}export{findTokenInstances,getTokenValueString,replacePlaceholders,valueOrEmptyString};
1
+ function findTokenInstances(n){const t=[];if(!n)return t;const e=/{\s*([^{}]*[^\s{}])\s*}/gm;let r=e.exec(n);for(;r;){var o=r[1],s=e.lastIndex,a=s-r[0].length;t.push({token:o,start:a,end:s}),r=e.exec(n)}return t}function getTokenValueString(n,t){return void 0===t?`{${n}}`:null===t?"":String(t)}function replacePlaceholders(n,t,e){let r="",o=0;for(const a of t){var s=a.token;if(o>a.start){console.error("Invalid token data. Data must be supplied in order",t),r=n;break}o<a.start&&(r+=n.substring(o,a.start),o=a.start),r+=e[s],o=a.end}return r+=n.substring(o),{markdown:r}}function valueOrEmptyString(n){return null==n?"":n}export{findTokenInstances,getTokenValueString,replacePlaceholders,valueOrEmptyString};
package/Validation.d.ts CHANGED
@@ -1,34 +1,34 @@
1
+ type TNever = {
2
+ /**
3
+ * This property exists to stop TNever also including other types.
4
+ * At time of writing, it seems to affect all that we use: `T[]`, `boolean`, `string` and `number`.
5
+ */
6
+ neverType: string;
7
+ };
1
8
  /** An object used to facilitate activity input validation. */
2
9
  export declare namespace validation {
3
- type TNever = {
4
- /**
5
- * This property exists to stop TNever also including other types.
6
- * At time of writing, it seems to affect all that we use: `T[]`, `boolean`, `string` and `number`.
7
- */
8
- neverType: string;
9
- };
10
- export const never: TNever;
10
+ const never: TNever;
11
11
  /**
12
12
  * Coerces an array out of a value.
13
13
  * @param inputName The name of the input being checked.
14
14
  * @param value The value of the input.
15
15
  */
16
- export function array<T>(inputName: string, value: T | T[] | undefined | null): T[] | undefined;
16
+ function array<T>(inputName: string, value: T | T[] | undefined | null): T[] | undefined;
17
17
  /**
18
18
  * Coerces an array out of a value.
19
19
  * @param inputName The name of the input being checked.
20
20
  * @param value The value of the input.
21
21
  * @param defaultValue The value to use if `value` is `undefined` or `null`. When this is `validation.never` the function will throw an `ActivityInputError` instead.
22
22
  */
23
- export function array<T>(inputName: string, value: T | T[] | undefined | null, defaultValue: undefined): T[] | undefined;
23
+ function array<T>(inputName: string, value: T | T[] | undefined | null, defaultValue: undefined): T[] | undefined;
24
24
  /**
25
25
  * Coerces an array out of a value.
26
26
  * @param inputName The name of the input being checked.
27
27
  * @param value The value of the input.
28
28
  * @param defaultValue The value to use if `value` is `undefined` or `null`. When this is `validation.never` the function will throw an `ActivityInputError` instead.
29
29
  */
30
- export function array<T>(inputName: string, value: T | T[] | undefined | null, defaultValue: T | T[] | TNever): T[];
31
- export function isBoolean(value: boolean | TNever): value is boolean;
30
+ function array<T>(inputName: string, value: T | T[] | undefined | null, defaultValue: T | T[] | TNever): T[];
31
+ function isBoolean(value: boolean | TNever): value is boolean;
32
32
  /**
33
33
  * Checks if the given value is a boolean. If not a default value is returned instead.
34
34
  * When `defaultValue` is `validation.never`, an error is thrown instead.
@@ -37,7 +37,7 @@ export declare namespace validation {
37
37
  * @param defaultValue The value to use if `value` is `undefined` or `null`. When this is `validation.never` the function will throw an `ActivityInputError` instead.
38
38
  * @returns `value` if it is a boolean, `defaultValue` if it is a boolean. Otherwise an ActivityInputError is thrown.
39
39
  */
40
- export function boolean(inputName: string, value: any): boolean | undefined;
40
+ function boolean(inputName: string, value: any): boolean | undefined;
41
41
  /**
42
42
  * Checks if the given value is a boolean. If not a default value is returned instead.
43
43
  * When `defaultValue` is `validation.never`, an error is thrown instead.
@@ -46,7 +46,7 @@ export declare namespace validation {
46
46
  * @param defaultValue The value to use if `value` is `undefined` or `null`. When this is `validation.never` the function will throw an `ActivityInputError` instead.
47
47
  * @returns `value` if it is a boolean, `defaultValue` if it is a boolean. Otherwise an ActivityInputError is thrown.
48
48
  */
49
- export function boolean(inputName: string, value: any, defaultValue: undefined): boolean | undefined;
49
+ function boolean(inputName: string, value: any, defaultValue: undefined): boolean | undefined;
50
50
  /**
51
51
  * Checks if the given value is a boolean. If not a default value is returned instead.
52
52
  * When `defaultValue` is `validation.never`, an error is thrown instead.
@@ -55,7 +55,7 @@ export declare namespace validation {
55
55
  * @param defaultValue The value to use if `value` is `undefined` or `null`. When this is `validation.never` the function will throw an `ActivityInputError` instead.
56
56
  * @returns `value` if it is a boolean, `defaultValue` if it is a boolean. Otherwise an ActivityInputError is thrown.
57
57
  */
58
- export function boolean(inputName: string, value: any, defaultValue: boolean | TNever): boolean;
58
+ function boolean(inputName: string, value: any, defaultValue: boolean | TNever): boolean;
59
59
  /**
60
60
  * Checks if the given value is defined and throws an error if not.
61
61
  * @param inputName The name of the input being checked.
@@ -63,7 +63,7 @@ export declare namespace validation {
63
63
  * @returns The supplied value, if it is defined.
64
64
  * @throws An `ActivityInputError` if `value` is `undefined` or `null`.
65
65
  */
66
- export function exists<T>(inputName: string, value: T | undefined): T;
66
+ function exists<T>(inputName: string, value: T | undefined): T;
67
67
  /**
68
68
  * Checks if the given value is defined and throws an error if not.
69
69
  * @param inputName The name of the input being checked.
@@ -72,10 +72,10 @@ export declare namespace validation {
72
72
  * @returns The supplied value, if it is defined. Otherwise, `defaultValue` if it is not `validation.never`.
73
73
  * @throws An `ActivityInputError` if `value` is `undefined` or `null` and `defaultValue` is `validation.never`.
74
74
  */
75
- export function exists<T>(inputName: string, value: T | undefined, defaultValue: T | TNever): T;
76
- export function id(inputName: string, value: any): string | number | undefined;
77
- export function id(inputName: string, value: any, defaultValue: undefined): string | number | undefined;
78
- export function id(inputName: string, value: any, defaultValue: string | number | TNever): string | number;
75
+ function exists<T>(inputName: string, value: T | undefined, defaultValue: T | TNever): T;
76
+ function id(inputName: string, value: any): string | number | undefined;
77
+ function id(inputName: string, value: any, defaultValue: undefined): string | number | undefined;
78
+ function id(inputName: string, value: any, defaultValue: string | number | TNever): string | number;
79
79
  /**
80
80
  * Checks if the given value is a number or a type that can be converted into one.
81
81
  * If so, the numeric value is returned.
@@ -83,7 +83,7 @@ export declare namespace validation {
83
83
  * @param inputName The name of the input being checked.
84
84
  * @param value The value of the input.
85
85
  */
86
- export function number(inputName: string, value: number): number;
86
+ function number(inputName: string, value: number): number;
87
87
  /**
88
88
  * Checks if the given value is a number or a type that can be converted into one.
89
89
  * If so, the numeric value is returned.
@@ -91,7 +91,7 @@ export declare namespace validation {
91
91
  * @param inputName The name of the input being checked.
92
92
  * @param value The value of the input.
93
93
  */
94
- export function number(inputName: string, value: number | undefined): number | undefined;
94
+ function number(inputName: string, value: number | undefined): number | undefined;
95
95
  /**
96
96
  * Checks if the given value is a number or a type that can be converted into one.
97
97
  * If so, the numeric value is returned.
@@ -99,7 +99,7 @@ export declare namespace validation {
99
99
  * @param inputName The name of the input being checked.
100
100
  * @param value The value of the input.
101
101
  */
102
- export function number(inputName: string, value: any): number | undefined;
102
+ function number(inputName: string, value: any): number | undefined;
103
103
  /**
104
104
  * Checks if the given value is a number or a type that can be converted into one.
105
105
  * If so, the numeric value is returned.
@@ -108,7 +108,7 @@ export declare namespace validation {
108
108
  * @param value The value of the input.
109
109
  * @param defaultValue A value to return if `value` could not be converted to a number.
110
110
  */
111
- export function number(inputName: string, value: any, defaultValue: undefined): number | undefined;
111
+ function number(inputName: string, value: any, defaultValue: undefined): number | undefined;
112
112
  /**
113
113
  * Checks if the given value is a number or a type that can be converted into one.
114
114
  * If so, the numeric value is returned.
@@ -117,20 +117,20 @@ export declare namespace validation {
117
117
  * @param value The value of the input.
118
118
  * @param defaultValue A value to return if `value` could not be converted to a number. If `validation.never`, an `ActivityInputError` is thrown instead.
119
119
  */
120
- export function number(inputName: string, value: any, defaultValue: number | TNever): number;
120
+ function number(inputName: string, value: any, defaultValue: number | TNever): number;
121
121
  /**
122
122
  * Checks if the given value is a string.
123
123
  * @param inputName The name of the input being checked.
124
124
  * @param value The value of the input.
125
125
  */
126
- export function string(inputName: string, value: string): string;
126
+ function string(inputName: string, value: string): string;
127
127
  /**
128
128
  * Checks if the given value is a string.
129
129
  * If so, the value is returned. If not, undefined is returned.
130
130
  * @param inputName The name of the input being checked.
131
131
  * @param value The value of the input.
132
132
  */
133
- export function string(inputName: string, value: any): string | undefined;
133
+ function string(inputName: string, value: any): string | undefined;
134
134
  /**
135
135
  * Checks if the given value is a string.
136
136
  * If so, the value is returned. If not, the default value is returned.
@@ -138,7 +138,7 @@ export declare namespace validation {
138
138
  * @param value The value of the input.
139
139
  * @param defaultValue The value to return if `value` is not a string.
140
140
  */
141
- export function string(inputName: string, value: any, defaultValue: undefined): string | undefined;
141
+ function string(inputName: string, value: any, defaultValue: undefined): string | undefined;
142
142
  /**
143
143
  * Checks if the given value is a string.
144
144
  * If so, the value is returned. If not, the default value is returned
@@ -147,11 +147,11 @@ export declare namespace validation {
147
147
  * @param value The value of the input.
148
148
  * @param defaultValue The value to return if `value` is not a string.
149
149
  */
150
- export function string(inputName: string, value: any, defaultValue: string | TNever): string;
150
+ function string(inputName: string, value: any, defaultValue: string | TNever): string;
151
151
  /** Checks if an input object contains a url or an esri layer with a url. */
152
- export function urlOrLayer(inputs: {
152
+ function urlOrLayer(inputs: {
153
153
  url?: string;
154
154
  layer?: __esri.Layer | __esri.SubtypeSublayer;
155
155
  }): string;
156
- export {};
157
156
  }
157
+ export {};
package/Validation.js CHANGED
@@ -1 +1 @@
1
- import SubtypeSublayer from"@arcgis/core/layers/support/SubtypeSublayer";import{ActivityInputError}from"./Errors.js";var validation;!function(t){function e(r){return r===t.never}function i(r){return"boolean"==typeof r}t.never={neverType:"TNever"},t.array=function(r,t,n){if(null!=t)return t instanceof Array?t:[t];if(e(n))throw new ActivityInputError(r,"array");return 2<arguments.length?n:void 0},t.isBoolean=i,t.boolean=function(r,t,n){if(null==t){if(e(n))throw new ActivityInputError(r,"boolean");return 2<arguments.length?n:void 0}if(i(t))return t;if(2<arguments.length){if(e(n))throw new ActivityInputError(r,"boolean");return n}throw new ActivityInputError(r,"boolean")},t.exists=function(r,t,n){if(null!=t)return t;if(2<arguments.length&&!e(n))return n;throw new ActivityInputError(r,"exists")},t.id=function(r,t,n){if(null==t){if(e(n))throw new ActivityInputError(r,"id");return 2<arguments.length?n:void 0}if("string"==typeof t)return t;if("number"==typeof t&&0*t==0)return t;if(2<arguments.length){if(e(n))throw new ActivityInputError(r,"id");return n}throw new ActivityInputError(r,"id")},t.number=function(r,t,n){if(null==t){if(e(n))throw new ActivityInputError(r,"number");return 2<arguments.length?n:void 0}var i=t.valueOf();if("number"==typeof i)return i;if("boolean"==typeof i)return i?1:0;if("string"==typeof i){i=parseFloat(t);if(!isNaN(i))return i}if(2<arguments.length){if(e(n))throw new ActivityInputError(r,"number");return n}throw new ActivityInputError(r,"number")},t.string=function(r,t,n){if(null==t){if(e(n))throw new ActivityInputError(r,"string");return 2<arguments.length?n:void 0}if("string"==typeof t)return t;if(2<arguments.length){if(e(n))throw new ActivityInputError(r,"string");return n}throw new ActivityInputError(r,"string")},t.urlOrLayer=function(n){if(null!=n){let r=n.url,t=n.layer;if(!r&&t?.url&&(t instanceof SubtypeSublayer&&(t=t.parent),r=void 0!==t.layerId&&null!==t.layerId?`${t.url}/${t.layerId}`:t.url),r)return r}throw new ActivityInputError("url or layer","url or layer input is required. layer must have a valid url property.")}}(validation=validation||{});export{validation};
1
+ import SubtypeSublayer from"@arcgis/core/layers/support/SubtypeSublayer";import{ActivityInputError}from"./Errors.js";function isNever(r){return r===validation.never}var validation;!function(r){function n(r){return"boolean"==typeof r}r.never={neverType:"TNever"},r.array=function(r,t,e){if(null!=t)return t instanceof Array?t:[t];if(isNever(e))throw new ActivityInputError(r,"array");return 2<arguments.length?e:void 0},r.isBoolean=n,r.boolean=function(r,t,e){if(null==t){if(isNever(e))throw new ActivityInputError(r,"boolean");return 2<arguments.length?e:void 0}if(n(t))return t;if(2<arguments.length){if(isNever(e))throw new ActivityInputError(r,"boolean");return e}throw new ActivityInputError(r,"boolean")},r.exists=function(r,t,e){if(null!=t)return t;if(2<arguments.length&&!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 2<arguments.length?e:void 0}if("string"==typeof t)return t;if("number"==typeof t&&0*t==0)return t;if(2<arguments.length){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 2<arguments.length?e:void 0}var n=t.valueOf();if("number"==typeof n)return n;if("boolean"==typeof n)return n?1:0;if("string"==typeof n){n=parseFloat(t);if(!isNaN(n))return n}if(2<arguments.length){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 2<arguments.length?e:void 0}if("string"==typeof t)return t;if(2<arguments.length){if(isNever(e))throw new ActivityInputError(r,"string");return e}throw new ActivityInputError(r,"string")},r.urlOrLayer=function(e){if(null!=e){let r=e.url,t=e.layer;if(!r&&t?.url&&(t instanceof SubtypeSublayer&&(t=t.parent),r=void 0!==t.layerId&&null!==t.layerId?`${t.url}/${t.layerId}`:t.url),r)return r}throw new ActivityInputError("url or layer","url or layer input is required. layer must have a valid url property.")}}(validation=validation||{});export{validation};
@@ -19,5 +19,5 @@ export declare class AddFeatureLayer implements IActivityHandler {
19
19
  static readonly suite = "gcx:wf:builtin";
20
20
  execute(inputs: AddFeatureLayerInputs, _context: IActivityContext, MapProviderType: typeof MapProvider): Promise<AddFeatureLayerOutputs>;
21
21
  /** Override within a host implementation for custom behaviour. */
22
- protected addLayerToMap(map: MapProvider, layer: __esri.FeatureLayer): void;
22
+ protected addLayerToMap(mapProvider: MapProvider, layer: __esri.FeatureLayer): void;
23
23
  }
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import Collection from"@arcgis/core/core/Collection";import FeatureLayer from"@arcgis/core/layers/FeatureLayer";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{MapProvider}from"./MapProvider.js";import{featuresToArray}from"./tools.js";let AddFeatureLayer=class{async execute(e,a,r){var t=featuresToArray(validation.exists("features",e.features)),i=validation.string("displayName",e.displayName,validation.never);const o=validation.array("fields",e.fields,validation.never),d=r.create();await d.load();let l;r=o.filter(e=>"oid"===e.type)[0];return r?.name&&(t=new Collection(t),l=new FeatureLayer({fields:o,objectIdField:r.name,title:i,source:t}),this.addLayerToMap(d,l)),{layer:l}}addLayerToMap(e,a){e.view.map.add(a)}};AddFeatureLayer.action="gcx:wf:arcgis::AddFeatureLayer",AddFeatureLayer.suite="gcx:wf:builtin",AddFeatureLayer=__decorate([activate(MapProvider)],AddFeatureLayer);export{AddFeatureLayer};
1
+ import{__decorate}from"tslib";import Collection from"@arcgis/core/core/Collection";import FeatureLayer from"@arcgis/core/layers/FeatureLayer";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{MapProvider}from"./MapProvider.js";import{featuresToArray}from"./tools.js";let AddFeatureLayer=class{async execute(e,a,r){var i=featuresToArray(validation.exists("features",e.features)),t=validation.string("displayName",e.displayName,validation.never);const o=validation.array("fields",e.fields,validation.never),d=r.create();await d.load();let s;r=o.filter(e=>"oid"===e.type)[0];return r?.name&&(i=new Collection(i),s=new FeatureLayer({fields:o,objectIdField:r.name,title:t,source:i}),this.addLayerToMap(d,s)),{layer:s}}addLayerToMap(e,a){e.view.map.add(a),e.setInitialDefinitionExpression(a.id,void 0,a.definitionExpression)}};AddFeatureLayer.action="gcx:wf:arcgis::AddFeatureLayer",AddFeatureLayer.suite="gcx:wf:builtin",AddFeatureLayer=__decorate([activate(MapProvider)],AddFeatureLayer);export{AddFeatureLayer};
@@ -23,5 +23,5 @@ export declare class AddFeatures implements IActivityHandler {
23
23
  static readonly suite = "gcx:wf:builtin";
24
24
  execute(inputs: AddFeaturesInputs, context: IActivityContext): Promise<AddFeaturesOutputs>;
25
25
  /** Called after the apply edit operation completes. */
26
- protected onApplyEditsComplete(_results: ApplyEditsResponse): void;
26
+ protected onApplyEditsComplete(results: ApplyEditsResponse): void;
27
27
  }
@@ -1,10 +1,10 @@
1
1
  import type { IActivityHandler } from "../../IActivityHandler";
2
2
  export interface ConvertValueToArcGisFieldTypeInputs {
3
- value: Object;
3
+ value: object;
4
4
  type: "double" | "integer" | "long" | "oid" | "single" | "small-integer" | string;
5
5
  }
6
6
  export interface ConvertValueToArcGisFieldTypeOutputs {
7
- result: Object;
7
+ result: object;
8
8
  }
9
9
  export declare class ConvertValueToArcGisFieldType implements IActivityHandler {
10
10
  static readonly action = "gcx:wf:arcgis::ConvertValueToArcGisFieldType";
@@ -1,7 +1,7 @@
1
1
  import type { IActivityHandler } from "../../IActivityHandler";
2
2
  /** Defines inputs for the Create Graphic activity. */
3
3
  export interface CreateGraphicInputs {
4
- attributes?: Object;
4
+ attributes?: object;
5
5
  geometry?: __esri.Geometry;
6
6
  symbol?: __esri.Symbol;
7
7
  }
@@ -26,5 +26,5 @@ export declare class DeleteFeatures implements IActivityHandler {
26
26
  static readonly suite = "gcx:wf:builtin";
27
27
  execute(inputs: DeleteFeaturesInputs, context: IActivityContext): Promise<DeleteFeaturesOutputs>;
28
28
  /** Called after the apply edit operation completes. */
29
- protected onApplyEditsComplete(_results: ApplyEditsResponse): void;
29
+ protected onApplyEditsComplete(results: ApplyEditsResponse): void;
30
30
  }
@@ -2,7 +2,7 @@ import type { IActivityHandler } from "../../IActivityHandler";
2
2
  /** Defines inputs for the FeatureSet From JSON activity. */
3
3
  export interface FeatureSetFromJsonInputs {
4
4
  /** The FeatureSet JSON as a string or object. */
5
- json: string | Object;
5
+ json: string | object;
6
6
  }
7
7
  /** Defines outputs for the FeatureSet From JSON activity. */
8
8
  export interface FeatureSetFromJsonOutputs {
@@ -2,7 +2,7 @@ import type { IActivityHandler } from "../../IActivityHandler";
2
2
  /** Defines inputs for the Geometry From JSON activity. */
3
3
  export interface GeometryFromJsonInputs {
4
4
  /** The geometry JSON as a string or object. */
5
- json: string | Object;
5
+ json: string | object;
6
6
  }
7
7
  /** Defines outputs for the Geometry From JSON activity. */
8
8
  export interface GeometryFromJsonOutputs {
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import esriRequest from"@arcgis/core/request";import{submitJob}from"@arcgis/core/rest/geoprocessor";import Bluebird from"bluebird";import{activate}from"../../Hooks.js";import{Task}from"../../Task.js";import{validation}from"../../Validation.js";import{MapProvider}from"./MapProvider.js";function hasJobSucceeded(e){return"job-succeeded"===e}let GeoprocessingAsync=class{async execute(s,t,e){var a=validation.string("url",s.url,validation.never),o=e.getOutSR(s.outSpatialReference),r=e.getOutSR(s.processSpatialReference),e=validation.exists("arguments",s.arguments,{}),s={signal:t.cancellationToken.signal},r={outSpatialReference:o,processSpatialReference:r};let i=await submitJob(a,e,r,s);r=i.waitForJobCompletion();i=await r;let n;if(hasJobSucceeded(i.jobStatus)){n={};let e=await this.getResultNames(i,s);s=e.map(async e=>{var s=await i.fetchResultData(e);n[e]=s.value});const c=Bluebird.all(s);Task.race([c,t.cancellationToken]).finally(function(){c.isPending()&&i.cancelJob(i.jobId)}),await c}return{id:i.jobId,status:i.jobStatus,results:n,messages:i.messages}}async getResultNames(e,s){const t=e.sourceUrl;var a=t.indexOf("?");let o=t,r="";-1!==a&&(o=t.substring(0,a),r=t.substring(a)),r=r?`${r}&f=json`:"?f=json";e=`${o}/jobs/${e.jobId}${r}`,s=(await esriRequest(e,s))?.data?.results;return s?Object.keys(s):[]}};GeoprocessingAsync.action="gcx:wf:arcgis::GeoprocessingAsync",GeoprocessingAsync.suite="gcx:wf:builtin",GeoprocessingAsync=__decorate([activate(MapProvider)],GeoprocessingAsync);export{GeoprocessingAsync};
1
+ import{__decorate}from"tslib";import esriRequest from"@arcgis/core/request";import{submitJob}from"@arcgis/core/rest/geoprocessor";import Bluebird from"bluebird";import{activate}from"../../Hooks.js";import{Task}from"../../Task.js";import{validation}from"../../Validation.js";import{MapProvider}from"./MapProvider.js";function hasJobSucceeded(e){return"job-succeeded"===e}let GeoprocessingAsync=class{async execute(e,s,t){var a=validation.string("url",e.url,validation.never),o=t.getOutSR(e.outSpatialReference),r=t.getOutSR(e.processSpatialReference),t=validation.exists("arguments",e.arguments,{}),e={signal:s.cancellationToken.signal},r={outSpatialReference:o,processSpatialReference:r};let i=await submitJob(a,t,r,e);r=i.waitForJobCompletion();i=await r;let n;if(hasJobSucceeded(i.jobStatus)){n={};const c=await this.getResultNames(i,e);e=c.map(async e=>{var s=await i.fetchResultData(e);n[e]=s.value});const l=Bluebird.all(e);Task.race([l,s.cancellationToken]).finally(function(){l.isPending()&&i.cancelJob(i.jobId)}),await l}return{id:i.jobId,status:i.jobStatus,results:n,messages:i.messages}}async getResultNames(e,s){const t=e.sourceUrl;var a=t.indexOf("?");let o=t,r="";-1!==a&&(o=t.substring(0,a),r=t.substring(a)),r=r?`${r}&f=json`:"?f=json";e=`${o}/jobs/${e.jobId}${r}`,s=(await esriRequest(e,s))?.data?.results;return s?Object.keys(s):[]}};GeoprocessingAsync.action="gcx:wf:arcgis::GeoprocessingAsync",GeoprocessingAsync.suite="gcx:wf:builtin",GeoprocessingAsync=__decorate([activate(MapProvider)],GeoprocessingAsync);export{GeoprocessingAsync};
@@ -1 +1 @@
1
- import Point from"@arcgis/core/geometry/Point";import{GenericActivityError}from"../../Errors.js";import{validation}from"../../Validation.js";class GetCurrentPosition{constructor(){this.geolocation=navigator.geolocation}execute(u){return new Promise((e,r)=>{if(!this.geolocation)return r(new GenericActivityError("WF0016","Geolocation is not supported."));r={enableHighAccuracy:validation.boolean("enableHighAccuracy",u.enableHighAccuracy,void 0),maximumAge:validation.number("maximumAge",u.maximumAge,void 0),timeout:validation.number("timeout",u.timeout,2e4)};const c=o=>e({position:new Point({x:o.coords.longitude,y:o.coords.latitude,spatialReference:{wkid:4326}}),accuracy:o.coords.accuracy,altitude:o.coords.altitude,altitudeAccuracy:o.coords.altitudeAccuracy,heading:o.coords.heading,latitude:o.coords.latitude,longitude:o.coords.longitude,speed:o.coords.speed,timestamp:o.timestamp}),a=o=>e({errorCode:o.code,errorMessage:o.message});if(u.useMultipleReadings){let o,e,t;const n=validation.number("accuracyThreshold",u.accuracyThreshold,10);let i=!1;const s=()=>{i||(i=!0,this.geolocation.clearWatch(o),clearTimeout(e),t?c(t):a({code:3,message:"A geolocated position could not be obtained before the timeout."}))};e=setTimeout(()=>{s()},r.timeout),o=this.geolocation.watchPosition(o=>{(!t||o.coords.accuracy<=t.coords.accuracy)&&(t=o),t.coords.accuracy<=n&&s()},a,r)}else this.geolocation.getCurrentPosition(c,a,r)})}}GetCurrentPosition.action="gcx:wf:arcgis::GetCurrentPosition",GetCurrentPosition.suite="gcx:wf:builtin";export{GetCurrentPosition};
1
+ import Point from"@arcgis/core/geometry/Point";import{GenericActivityError}from"../../Errors.js";import{validation}from"../../Validation.js";class GetCurrentPosition{constructor(){this.geolocation=navigator.geolocation}execute(u){return new Promise((e,t)=>{if(!this.geolocation)return t(new GenericActivityError("WF0016","Geolocation is not supported."));t={enableHighAccuracy:validation.boolean("enableHighAccuracy",u.enableHighAccuracy,void 0),maximumAge:validation.number("maximumAge",u.maximumAge,void 0),timeout:validation.number("timeout",u.timeout,2e4)};const i=o=>e({position:new Point({x:o.coords.longitude,y:o.coords.latitude,spatialReference:{wkid:4326}}),accuracy:o.coords.accuracy,altitude:o.coords.altitude,altitudeAccuracy:o.coords.altitudeAccuracy,heading:o.coords.heading,latitude:o.coords.latitude,longitude:o.coords.longitude,speed:o.coords.speed,timestamp:o.timestamp}),r=o=>e({errorCode:o.code,errorMessage:o.message});if(u.useMultipleReadings){let e;const c=validation.number("accuracyThreshold",u.accuracyThreshold,10);let o=!1;const a=()=>{o||(o=!0,this.geolocation.clearWatch(s),clearTimeout(n),e?i(e):r({code:3,message:"A geolocated position could not be obtained before the timeout."}))},n=setTimeout(()=>{a()},t.timeout),s=this.geolocation.watchPosition(o=>{(!e||o.coords.accuracy<=e.coords.accuracy)&&(e=o),e.coords.accuracy<=c&&a()},r,t)}else this.geolocation.getCurrentPosition(i,r,t)})}}GetCurrentPosition.action="gcx:wf:arcgis::GetCurrentPosition",GetCurrentPosition.suite="gcx:wf:builtin";export{GetCurrentPosition};
@@ -1 +1 @@
1
- import*as TemplateUtils from"../../TemplateUtils.js";import{validation}from"../../Validation.js";import{text}from"../../forms/utils.js";import{getFieldName as getFieldNameIgnoreCase}from"./shared.js";class GetFormElementItemsFromFeatures{_getAttributeValue(e,t,a,r){if(e=this._getFieldName(e,t)){e=a[e];return r?TemplateUtils.valueOrEmptyString(e):e}}_getFieldName(e,t){return t[getFieldNameIgnoreCase(e,t)||e]}_isLabelFieldName(e,t){return null!=e&&!!getFieldNameIgnoreCase(e,t)}_getTokenValues(e,t,a){const r={};for(const i of e){var l,s=i.token;r.hasOwnProperty(s)||(l=this._getAttributeValue(s,a,t,!0),l=TemplateUtils.getTokenValueString(s,l),r[s]=text.escapeTextForMarkdown(l))}return r}execute(e){var r=e.features||[],t=e.fields||[],l=validation.string("labelFieldName",e.labelFieldName),s=e.valueFieldName||void 0;const i={},o={};for(const a of t)"string"==typeof a.alias&&"string"==typeof a.name&&(o[a.alias]=a.name);for(const d of 0<r.length?Object.keys(r[0].attributes):[])o[d]=d;var m=this._isLabelFieldName(l,o),n=m?[]:TemplateUtils.findTokenInstances(l);for(let a=0;a<r.length;++a){var u,F=r[a],g=F.attributes||{};const f={};let e;e=m?this._getAttributeValue(l,o,g,!0):(u=this._getTokenValues(n,g,o),TemplateUtils.replacePlaceholders(l,n,u));g=s?this._getAttributeValue(s,o,g,!1):void 0;let t;t=text.isMarkdown(e)?e:String(e),f.label=t,f.value=s?g:{refValueType:"data",type:"feature",data:F},f.index=a,i[a]=f}return{items:i}}}GetFormElementItemsFromFeatures.action="gcx:wf:forms::GetFormElementItemsFromFeatures",GetFormElementItemsFromFeatures.suite="gcx:wf:builtin";export{GetFormElementItemsFromFeatures};
1
+ import*as TemplateUtils from"../../TemplateUtils.js";import{validation}from"../../Validation.js";import{text}from"../../forms/utils.js";import{getFieldName as getFieldNameIgnoreCase}from"./shared.js";class GetFormElementItemsFromFeatures{_getAttributeValue(e,t,a,r){if(e=this._getFieldName(e,t)){e=a[e];return r?TemplateUtils.valueOrEmptyString(e):e}}_getFieldName(e,t){return t[getFieldNameIgnoreCase(e,t)||e]}_isLabelFieldName(e,t){return null!=e&&!!getFieldNameIgnoreCase(e,t)}_getTokenValues(e,t,a){const r={},l=Object.keys(r);for(const o of e){var s,i=o.token;l.includes(i)||(s=this._getAttributeValue(i,a,t,!0),s=TemplateUtils.getTokenValueString(i,s),r[i]=text.escapeTextForMarkdown(s))}return r}execute(e){var r=e.features||[],t=e.fields||[],l=validation.string("labelFieldName",e.labelFieldName),s=e.valueFieldName||void 0;const i={},o={};for(const a of t)"string"==typeof a.alias&&"string"==typeof a.name&&(o[a.alias]=a.name);for(const g of 0<r.length?Object.keys(r[0].attributes):[])o[g]=g;var m=this._isLabelFieldName(l,o),n=m?[]:TemplateUtils.findTokenInstances(l);for(let a=0;a<r.length;++a){var u,F=r[a],d=F.attributes||{};const f={};let e;e=m?this._getAttributeValue(l,o,d,!0):(u=this._getTokenValues(n,d,o),TemplateUtils.replacePlaceholders(l,n,u));d=s?this._getAttributeValue(s,o,d,!1):void 0;let t;t=text.isMarkdown(e)?e:String(e),f.label=t,f.value=s?d:{refValueType:"data",type:"feature",data:F},f.index=a,i[a]=f}return{items:i}}}GetFormElementItemsFromFeatures.action="gcx:wf:forms::GetFormElementItemsFromFeatures",GetFormElementItemsFromFeatures.suite="gcx:wf:builtin";export{GetFormElementItemsFromFeatures};
@@ -25,6 +25,8 @@ export interface MapInfo {
25
25
  /** Gets the spatial reference. */
26
26
  getSpatialReference(): __esri.SpatialReference | undefined;
27
27
  }
28
+ export declare function layerCanChangeDefinitionExpression(layer: __esri.Layer): boolean;
29
+ export declare function sublayerCanChangeDefinitionExpression(sublayer: __esri.Sublayer): boolean;
28
30
  /**
29
31
  * Provides functionality which affects the map.
30
32
  * @public
@@ -97,7 +99,7 @@ export declare class MapProvider implements MapInfo {
97
99
  getProperty(name: "mosaicRule"): __esri.MosaicRule;
98
100
  getProperty(name: "rasterFunction"): __esri.RasterFunction;
99
101
  getProperty(name: "renderingRule"): __esri.RasterFunction;
100
- getProperty(name: "pixelFilter"): Function;
102
+ getProperty(name: "pixelFilter"): __esri.PixelFilterFunction;
101
103
  getProperty(name: string): any;
102
104
  /** Sets the `mosaicRule` property on the current layer. */
103
105
  setProperty(name: "mosaicRule", value: __esri.MosaicRule): boolean;
@@ -106,13 +108,49 @@ export declare class MapProvider implements MapInfo {
106
108
  /** Sets the `renderingRule` property on the current layer. */
107
109
  setProperty(name: "renderingRule", value: __esri.RasterFunction): boolean;
108
110
  /** Sets the `pixelFilter` property on the current layer. */
109
- setProperty(name: "pixelFilter", value: Function): boolean;
111
+ setProperty(name: "pixelFilter", value: __esri.PixelFilterFunction): boolean;
110
112
  /** Sets the specified property on the current layer. */
111
113
  setProperty(name: string, value: any): boolean;
112
114
  /** Gets the definition expression for the map/layer. */
113
115
  getDefinitionExpression(): string | undefined;
114
116
  /** Sets the definition expression for the map/layer. */
115
117
  setDefinitionExpression(clause: string): boolean | undefined;
118
+ /**
119
+ * Resets the definition expression for all layers and sublayers
120
+ * to their initial state from when the map was loaded.
121
+ * @param onlyInitialLayers If true, only layers that were initially loaded with the map will be reset.
122
+ * Otherwise, all layers currently present in the map will be reset.
123
+ */
124
+ resetDefinitionExpressions: (onlyInitialLayers: boolean) => void;
125
+ /**
126
+ * Resets the definition expression for the layer or sublayer
127
+ * to its initial state from when the map was loaded.
128
+ */
129
+ resetDefinitionExpression(): string | undefined;
130
+ /**
131
+ * Gets the initial definition expressions for all layers and sublayers
132
+ * that were present when the map was first loaded.
133
+ * @param onlyInitialLayers If true, only layers that were initially loaded with the map will be returned.
134
+ * Otherwise, all layers currently present in the map will be returned.
135
+ * @returns The initial definition expressions for all layers and sublayers. The key is the layerId
136
+ * and sublayerId (if applicable) separated by a semicolon, and the value is the definition expression.
137
+ */
138
+ getInitialDefinitionExpressions(onlyInitialLayers: boolean): Record<string, string>;
139
+ /**
140
+ * Gets the definition expression for the layer/sublayer that was present when it was first loaded.
141
+ * @param layerId The unique id of the layer.
142
+ * @param sublayerId (optional) The unique id of the sublayer.
143
+ * @returns The definition expression for the layer/sublayer that was present when it was first loaded.
144
+ */
145
+ getInitialDefinitionExpression(layerId: string, sublayerId?: number): string;
146
+ /**
147
+ * Sets the definition expression for the layer/sublayer to be used as its initial state.
148
+ * This should only be used for layers/sublayers that were added after the map was loaded.
149
+ * @param layerId The unique id of the layer.
150
+ * @param sublayerId The unique id of the sublayer, or undefined if this is not for a sublayer.
151
+ * @param definitionExpression The initial definition expression to store for the layer/sublayer.
152
+ */
153
+ setInitialDefinitionExpression(layerId: string, sublayerId: number | undefined, definitionExpression: string): void;
116
154
  /** Clears features from the map/layer. */
117
155
  clearFeatures(): boolean;
118
156
  /** Removes features from the map/layer. */
@@ -1 +1 @@
1
- import PopupTemplate from"@arcgis/core/PopupTemplate";import SpatialReference from"@arcgis/core/geometry/SpatialReference";import GraphicsLayer from"@arcgis/core/layers/GraphicsLayer";import SubtypeGroupLayer from"@arcgis/core/layers/SubtypeGroupLayer";import*as TypeChecking from"./TypeChecking.js";import{extentOf}from"./tools.js";class MapProvider{static getOutSR(e){return"number"==typeof e?new SpatialReference({wkid:e}):"string"==typeof e?new SpatialReference({wkt:e}):e}static create(){return new this(this)}static register(e){e.factories.push(e=>this.type===e?this:void 0)}constructor(e,i,r){null!=i&&(this.map=i.map,this.view=i),this.mapName=r,this.type=e}loadMap(){}loadView(){const e=this.view;if(void 0!==e&&null!==e){if(e.isFulfilled())return Promise.resolve();return e.when(()=>{})}}loadLayer(){const e=this.layer||void 0;if(void 0!==e){if(e.loaded)return Promise.resolve();var i=e.loadError||void 0;return void 0!==i?Promise.reject(i):e.load().then(e=>{})}}load(){return this.loadLayer()||this.loadView()||this.loadMap()||Promise.resolve()}getExtent(){var e=this.view;if(null!=e){var i=e.extent;if(null!=i)return i}i=this.map;if(null!=i){i=i.extent;if(null!=i)return i}}getCenter(){var e=this.view;if(null!=e){var i=e.center;if(null!=i)return i}i=this.map||void 0;if(void 0!==i){i=i.extent;if(null!=i)return i.center}}getScale(){var e=this.view;if(null!=e){e=e.scale;if("number"==typeof e)return e}}getSpatialReference(){var e=this.view;if(null!=e)return e.spatialReference}getViewpoint(){var e=this.view;if(null!=e)return e.viewpoint}setExtent(e,i){let r;e=extentOf(e)||void 0;void 0!==e&&(r=e.center);const t=this.view||void 0;if(void 0!==t){if(void 0!==r&&"number"==typeof i)return t.goTo({center:r,scale:i});if(void 0!==e)return t.goTo(e);if(void 0!==r)return t.goTo(r)}return Promise.resolve()}setViewpoint(e,i){let r;e=extentOf(e)||void 0;void 0!==e&&(r=e.center);const t=this.view;if(void 0!==t&&null!==t){if(void 0!==r&&null!=i)return t.goTo(i).then(e=>t.goTo(r));if(void 0!==e)return t.goTo(e);if(void 0!==r)return t.goTo(r)}return Promise.resolve()}findLayer(i,r){if(null==r){const t=this.map;if(void 0!==t&&null!==t){const o=i.toString();let e=t.findLayerById(o)||void 0;if(void 0===e&&(e=t.allLayers.find(e=>e.title===o)||void 0),void 0!==e){const n=this.clone();return n.layer=e,n.sublayer=void 0,n}}}else{i=new Number(i).valueOf();let e;if(r instanceof SubtypeGroupLayer?e=r.findSublayerForSubtypeCode(i):TypeChecking.isLayerWithSublayers(r)&&(e=r.findSublayerById(i)),e){const s=this.clone();return s.layer=r,s.sublayer=e,s}}}findTable(e,i){if(e){const r=this.map;if(r){const t=e.toLowerCase();e=r.allTables.find(e=>void 0!==e.id&&null!==e.id&&e.id.toLowerCase()===t);if(e){const o=this.clone();return o.layer=e,o.sublayer=void 0,o}}}}formatSubLayerId(e){return e}getVisible(){var e=this.layer||void 0;if(void 0===e)return!1;var i=this.sublayer||void 0;return(void 0!==i?i:e).visible}setVisible(e){const i=this.layer||void 0;if(void 0===i)return!1;{const r=this.sublayer||void 0;return void 0!==r?(r.visible=!0===e,r.visible===(!0===e)):(i.visible=!0===e,i.visible===(!0===e))}}getProperty(e){var i=this.layer;if(null!=i)return i[e]}setProperty(e,i){const r=this.layer||void 0;return void 0!==r&&(r.set(e,i),this.getProperty(e)===i)}getDefinitionExpression(){var e=this.layer||void 0;if(void 0!==e){var i=this.sublayer||void 0;if(void 0!==i){if(TypeChecking.isSublayerWithDefinitionExpression(i)){i=i.definitionExpression;return"string"==typeof i?i:void 0}return}if(TypeChecking.isLayerWithDefinitionExpression(e))return e.definitionExpression}}setDefinitionExpression(e){const i=this.layer||void 0;if(void 0!==i){const r=this.sublayer||void 0;if(void 0!==r)return TypeChecking.isSublayerWithDefinitionExpression(r)?(r.definitionExpression=e,r.definitionExpression===e):void 0;if(TypeChecking.isLayerWithDefinitionExpression(i))return i.definitionExpression=e,i.definitionExpression===e}}clearFeatures(){const e=this.layer;return!(void 0===e||null===e||!TypeChecking.isGraphicsLayer(e))&&(e.removeAll(),!0)}removeFeatures(e){const i=this.layer;if(void 0!==i&&null!==i&&TypeChecking.isGraphicsLayer(i))return i.removeMany(e),!0}getFeatures(){const e=this.layer||void 0;if(void 0!==e&&TypeChecking.isGraphicsLayer(e))return e.graphics.toArray()}addFeatures(e,i){const r=this.map||void 0;if(void 0===r)return[];let t=this.layer||void 0;return void 0===t&&(t=new GraphicsLayer({id:i.toString()}),r.add(t)),TypeChecking.isGraphicsLayer(t)&&t.addMany(e),TypeChecking.isGraphicsLayer(t)?t.graphics.toArray():[]}removeLayer(){const e=this.map||void 0;if(void 0===e)return!1;var i=this.layer||void 0;return void 0!==i&&(e.remove(i),!0)}redraw(){const e=this.layer||void 0;void 0!==e&&TypeChecking.isLayerWithRedraw(e)&&e.redraw()}clone(){const e=new this.type(this.type,this.view||this.map,this.mapName);return e.layer=this.layer,e.sublayer=this.sublayer,e}static setPopup(e,i){if(i&&e){var r=new PopupTemplate(e);for(const t of i)t.popupTemplate=r}}setPopup(e){const i=this.layer;i&&e&&(e=new PopupTemplate(e),TypeChecking.isLayerWithPopupTemplate(i)&&(i.popupTemplate=e))}showPopup(e){if(e&&e.length){var i=e.filter(e=>e.geometry)[0],i=i?extentOf([i.geometry]):this.map.extent;const r=this.view?.popup;r&&r.open({features:e,location:i?.center})}}}MapProvider.type="5B3643D6-5FF4-4B30-B439-39C70AD68DE3:MapProvider";export{MapProvider};
1
+ import PopupTemplate from"@arcgis/core/PopupTemplate";import SpatialReference from"@arcgis/core/geometry/SpatialReference";import GraphicsLayer from"@arcgis/core/layers/GraphicsLayer";import SubtypeGroupLayer from"@arcgis/core/layers/SubtypeGroupLayer";import Sublayer from"@arcgis/core/layers/support/Sublayer";import*as TypeChecking from"./TypeChecking.js";import{extentOf}from"./tools.js";function layerCanChangeDefinitionExpression(e){return["csv","feature","geojson","imagery","scene","stream","subtype-group","wfs"].includes(e.type)}function sublayerCanChangeDefinitionExpression(e){return"building-component"===e.layer.type||"esri.layers.support.Sublayer"===e.declaredClass&&"tile"!==e.layer.type}class MapProvider{static getOutSR(e){return"number"==typeof e?new SpatialReference({wkid:e}):"string"==typeof e?new SpatialReference({wkt:e}):e}static create(){return new this(this)}static register(e){e.factories.push(e=>this.type===e?this:void 0)}constructor(e,i,r){this.resetDefinitionExpressions=e=>{e=this.getInitialDefinitionExpressions(e);for(const t of Object.entries(e)){const[n,o]=t;var[i,r]=n.split(";");const s=this.findLayer(i);if(s?.layer)if(r){const a=s.findLayer(r,s.layer);a?.sublayer&&"definitionExpression"in a.sublayer&&(a.sublayer.definitionExpression=o)}else"definitionExpression"in s.layer&&(s.layer.definitionExpression=o)}},null!=i&&(this.map=i.map,this.view=i),this.mapName=r,this.type=e}loadMap(){}loadView(){const e=this.view;if(void 0!==e&&null!==e){if(e.isFulfilled())return Promise.resolve();return e.when(()=>{})}}loadLayer(){const e=this.layer||void 0;if(void 0!==e){if(e.loaded)return Promise.resolve();var i=e.loadError||void 0;return void 0!==i?Promise.reject(i):e.load().then(()=>{})}}load(){return this.loadLayer()||this.loadView()||this.loadMap()||Promise.resolve()}getExtent(){var e=this.view;if(null!=e){var i=e.extent;if(null!=i)return i}i=this.map;if(null!=i){i=i.extent;if(null!=i)return i}}getCenter(){var e=this.view;if(null!=e){var i=e.center;if(null!=i)return i}i=this.map||void 0;if(void 0!==i){i=i.extent;if(null!=i)return i.center}}getScale(){var e=this.view;if(null!=e){e=e.scale;if("number"==typeof e)return e}}getSpatialReference(){var e=this.view;if(null!=e)return e.spatialReference}getViewpoint(){var e=this.view;if(null!=e)return e.viewpoint}setExtent(e,i){let r;e=extentOf(e)||void 0;void 0!==e&&(r=e.center);const t=this.view||void 0;if(void 0!==t){if(void 0!==r&&"number"==typeof i)return t.goTo({center:r,scale:i});if(void 0!==e)return t.goTo(e);if(void 0!==r)return t.goTo(r)}return Promise.resolve()}setViewpoint(e,i){let r;e=extentOf(e)||void 0;void 0!==e&&(r=e.center);const t=this.view;if(void 0!==t&&null!==t){if(void 0!==r&&null!=i)return t.goTo(i).then(()=>t.goTo(r));if(void 0!==e)return t.goTo(e);if(void 0!==r)return t.goTo(r)}return Promise.resolve()}findLayer(i,r){if(null==r){const t=this.map;if(void 0!==t&&null!==t){const n=i.toString();let e=t.findLayerById(n)||void 0;if(void 0===e&&(e=t.allLayers.find(e=>e.title===n)||void 0),void 0!==e){const o=this.clone();return o.layer=e,o.sublayer=void 0,o}}}else{i=new Number(i).valueOf();let e;if(r instanceof SubtypeGroupLayer?e=r.findSublayerForSubtypeCode(i):TypeChecking.isLayerWithSublayers(r)&&(e=r.findSublayerById(i)),e){const s=this.clone();return s.layer=r,s.sublayer=e,s}}}findTable(e,i){if(e){const r=this.map;if(r){const t=e.toLowerCase();e=r.allTables.find(e=>void 0!==e.id&&null!==e.id&&e.id.toLowerCase()===t);if(e){const n=this.clone();return n.layer=e,n.sublayer=void 0,n}}}}formatSubLayerId(e){return e}getVisible(){var e=this.layer||void 0;if(void 0===e)return!1;var i=this.sublayer||void 0;return(void 0!==i?i:e).visible}setVisible(e){const i=this.layer||void 0;if(void 0===i)return!1;{const r=this.sublayer||void 0;return void 0!==r?(r.visible=!0===e,r.visible===(!0===e)):(i.visible=!0===e,i.visible===(!0===e))}}getProperty(e){var i=this.layer;if(null!=i)return i[e]}setProperty(e,i){const r=this.layer||void 0;return void 0!==r&&(r.set(e,i),this.getProperty(e)===i)}getDefinitionExpression(){var{layer:e,sublayer:i}=this;if(e){if(i){if("definitionExpression"in i){i=i.definitionExpression;return"string"==typeof i?i:void 0}return}if("definitionExpression"in e){e=e.definitionExpression;return"string"==typeof e?e:void 0}}}setDefinitionExpression(e){const{layer:i,sublayer:r}=this;if(i){if(r)return r instanceof Sublayer&&sublayerCanChangeDefinitionExpression(r)&&"definitionExpression"in r?(r.definitionExpression=e,r.definitionExpression===e):void 0;if(layerCanChangeDefinitionExpression(i)&&"definitionExpression"in i)return i.definitionExpression=e,i.definitionExpression===e}}resetDefinitionExpression(){const{layer:e,sublayer:i}=this;if(e){if(i)return i instanceof Sublayer&&sublayerCanChangeDefinitionExpression(i)&&"definitionExpression"in i?(i.definitionExpression=this.getInitialDefinitionExpression(e.id,i.id),i.definitionExpression):void 0;if(layerCanChangeDefinitionExpression(e)&&"definitionExpression"in e)return e.definitionExpression=this.getInitialDefinitionExpression(e.id),e.definitionExpression}}getInitialDefinitionExpressions(e){return{}}getInitialDefinitionExpression(e,i){return""}setInitialDefinitionExpression(e,i,r){}clearFeatures(){const e=this.layer;return!(void 0===e||null===e||!TypeChecking.isGraphicsLayer(e))&&(e.removeAll(),!0)}removeFeatures(e){const i=this.layer;if(void 0!==i&&null!==i&&TypeChecking.isGraphicsLayer(i))return i.removeMany(e),!0}getFeatures(){const e=this.layer||void 0;if(void 0!==e&&TypeChecking.isGraphicsLayer(e))return e.graphics.toArray()}addFeatures(e,i){const r=this.map||void 0;if(void 0===r)return[];let t=this.layer||void 0;return void 0===t&&(t=new GraphicsLayer({id:i.toString()}),r.add(t)),TypeChecking.isGraphicsLayer(t)&&t.addMany(e),TypeChecking.isGraphicsLayer(t)?t.graphics.toArray():[]}removeLayer(){const e=this.map||void 0;if(void 0===e)return!1;var i=this.layer||void 0;return void 0!==i&&(e.remove(i),!0)}redraw(){const e=this.layer||void 0;void 0!==e&&TypeChecking.isLayerWithRedraw(e)&&e.redraw()}clone(){const e=new this.type(this.type,this.view||this.map,this.mapName);return e.layer=this.layer,e.sublayer=this.sublayer,e}static setPopup(e,i){if(i&&e){var r=new PopupTemplate(e);for(const t of i)t.popupTemplate=r}}setPopup(e){const i=this.layer;i&&e&&(e=new PopupTemplate(e),TypeChecking.isLayerWithPopupTemplate(i)&&(i.popupTemplate=e))}showPopup(e){if(e&&e.length){var i=e.filter(e=>e.geometry)[0],i=i?extentOf([i.geometry]):this.map.extent;const r=this.view?.popup;r&&r.open({features:e,location:i?.center})}}}MapProvider.type="5B3643D6-5FF4-4B30-B439-39C70AD68DE3:MapProvider";export{layerCanChangeDefinitionExpression,sublayerCanChangeDefinitionExpression,MapProvider};
@@ -9,7 +9,7 @@ export interface ProjectServiceTaskInputs {
9
9
  /** The spatial reference to which you are projecting the geometries. */
10
10
  outSpatialReference?: string | number | __esri.SpatialReference;
11
11
  /** The well-known id {wkid:number} or well-known text {wkt:string} of the datum transformation to be applied to the projected geometries. A list of valid IDs can be viewed at https://developers.arcgis.com/rest/services-reference/datum-transformations.htm. */
12
- transformation?: string | number | {};
12
+ transformation?: string | number | object;
13
13
  /** Indicates whether to transform forward or not. The forward or reverse direction of transformation is implied in the name of the transformation. */
14
14
  reverse?: boolean;
15
15
  }
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import SubtypeSublayer from"@arcgis/core/layers/support/SubtypeSublayer";import{executeQueryJSON}from"@arcgis/core/rest/query";import Query from"@arcgis/core/rest/support/Query";import StatisticDefinition from"@arcgis/core/rest/support/StatisticDefinition";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{MapProvider}from"./MapProvider.js";let QueryTask=class{static isToJSONMissing(t){return"object"==typeof t&&"function"!=typeof t.toJSON}async execute(t,i,e){var a=validation.urlOrLayer(t),r=validation.boolean("useGlobalIds",t.useGlobalIds,!1),o=validation.string("objectIdField",t.objectIdField,r?"GlobalID":"OBJECTID");let s=validation.array("ids",t.ids),n=validation.string("where",t.where,void 0);r&&s&&0<s.length&&(l=`${o} IN (${s.map(t=>`'${t}'`).join()})`,n=n?`${n} AND (${l})`:l,s=void 0);var l=t.layer;l instanceof SubtypeSublayer&&(l=`${l.subtypeField}=${l.subtypeCode}`,n=n?`${n} AND (${l})`:l);const u=new Query({distance:validation.number("distance",t.distance,void 0),gdbVersion:validation.string("gdbVersion",t.gdbVersion,void 0),geometry:t.geometry,geometryPrecision:t.geometryPrecision,groupByFieldsForStatistics:validation.array("groupByFieldsForStatistics",t.groupByFieldsForStatistics),maxAllowableOffset:validation.number("maxAllowableOffset",t.maxAllowableOffset,void 0),multipatchOption:validation.string("multipatchOption",t.multipatchOption,void 0),num:validation.number("count",t.count,void 0),objectIds:s,orderByFields:validation.array("orderByFields",t.orderByFields),outFields:validation.array("outFields",t.outFields),outSpatialReference:e.getOutSR(t.outSpatialReference),pixelSize:t.pixelSize,quantizationParameters:t.quantizationParameters,returnDistinctValues:validation.boolean("returnDistinctValues",t.returnDistinctValues,!1),returnGeometry:validation.boolean("returnGeometry",t.returnGeometry,!1),returnM:validation.boolean("returnM",t.returnM,!1),returnZ:validation.boolean("returnZ",t.returnZ,!1),start:validation.number("start",t.start,void 0),text:validation.string("text",t.text,void 0),where:n});e=validation.array("outStatistics",t.outStatistics);if(e){u.outStatistics=[];for(const c of e)u.outStatistics.push(new StatisticDefinition({onStatisticField:c.onStatisticField,outStatisticFieldName:c.outStatisticFieldName,statisticType:c.statisticType}))}const d=validation.string("spatialRelationship",t.spatialRelationship,void 0);void 0!==d&&(d.match(/^[TF012\*]{9}$/)?(u.spatialRelationship="relation",u.relationParameter=d):u.spatialRelationship=d);i={signal:i.cancellationToken.signal},i=await executeQueryJSON(a,u,i);return{feature:i.features[0],features:i.features,results:i}}};QueryTask.action="gcx:wf:arcgis:query:QueryTask",QueryTask.suite="gcx:wf:builtin",QueryTask=__decorate([activate(MapProvider)],QueryTask);export{QueryTask};
1
+ import{__decorate}from"tslib";import SubtypeSublayer from"@arcgis/core/layers/support/SubtypeSublayer";import{executeQueryJSON}from"@arcgis/core/rest/query";import Query from"@arcgis/core/rest/support/Query";import StatisticDefinition from"@arcgis/core/rest/support/StatisticDefinition";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{MapProvider}from"./MapProvider.js";let QueryTask=class{static isToJSONMissing(t){return"object"==typeof t&&"function"!=typeof t.toJSON}async execute(t,i,e){var a=validation.urlOrLayer(t),r=validation.boolean("useGlobalIds",t.useGlobalIds,!1),o=validation.string("objectIdField",t.objectIdField,r?"GlobalID":"OBJECTID");let s=validation.array("ids",t.ids),n=validation.string("where",t.where,void 0);r&&s&&0<s.length&&(l=`${o} IN (${s.map(t=>`'${t}'`).join()})`,n=n?`${n} AND (${l})`:l,s=void 0);var l=t.layer;l instanceof SubtypeSublayer&&(l=`${l.subtypeField}=${l.subtypeCode}`,n=n?`${n} AND (${l})`:l);const u=new Query({distance:validation.number("distance",t.distance,void 0),gdbVersion:validation.string("gdbVersion",t.gdbVersion,void 0),geometry:t.geometry,geometryPrecision:t.geometryPrecision,groupByFieldsForStatistics:validation.array("groupByFieldsForStatistics",t.groupByFieldsForStatistics),maxAllowableOffset:validation.number("maxAllowableOffset",t.maxAllowableOffset,void 0),multipatchOption:validation.string("multipatchOption",t.multipatchOption,void 0),num:validation.number("count",t.count,void 0),objectIds:s,orderByFields:validation.array("orderByFields",t.orderByFields),outFields:validation.array("outFields",t.outFields),outSpatialReference:e.getOutSR(t.outSpatialReference),pixelSize:t.pixelSize,quantizationParameters:t.quantizationParameters,returnDistinctValues:validation.boolean("returnDistinctValues",t.returnDistinctValues,!1),returnGeometry:validation.boolean("returnGeometry",t.returnGeometry,!1),returnM:validation.boolean("returnM",t.returnM,!1),returnZ:validation.boolean("returnZ",t.returnZ,!1),start:validation.number("start",t.start,void 0),text:validation.string("text",t.text,void 0),where:n});e=validation.array("outStatistics",t.outStatistics);if(e){u.outStatistics=[];for(const c of e)u.outStatistics.push(new StatisticDefinition({onStatisticField:c.onStatisticField,outStatisticFieldName:c.outStatisticFieldName,statisticType:c.statisticType}))}const d=validation.string("spatialRelationship",t.spatialRelationship,void 0);void 0!==d&&(d.match(/^[TF012*]{9}$/)?(u.spatialRelationship="relation",u.relationParameter=d):u.spatialRelationship=d);i={signal:i.cancellationToken.signal},i=await executeQueryJSON(a,u,i);return{feature:i.features[0],features:i.features,results:i}}};QueryTask.action="gcx:wf:arcgis:query:QueryTask",QueryTask.suite="gcx:wf:builtin",QueryTask=__decorate([activate(MapProvider)],QueryTask);export{QueryTask};
@@ -1 +1 @@
1
- import{relation}from"@arcgis/core/rest/geometryService";import RelationParameters from"@arcgis/core/rest/support/RelationParameters";import{validation}from"../../Validation.js";class RelationServiceTask{async execute(e,i){var t=validation.exists("url",e.url,validation.never);const a=validation.array("geometry1",e.geometry1,validation.never),r=validation.array("geometry2",e.geometry2,validation.never);e=validation.string("relation",e.relation,"intersection");const n=new RelationParameters({geometries1:a,geometries2:r});isDE9IM(e)?(n.relation="relation",n.relationParameter=`RELATE(G1,G2,"${e}")`):n.relation=e;i={signal:i.cancellationToken.signal};const o=await relation(t,n,i);i=o.map(e=>{return[a[e.geometry1Index],r[e.geometry2Index]]});return{incident:i[0],incidents:i}}}function isDE9IM(e){return/^[TF012\*]{9}$/.test(e)}RelationServiceTask.action="gcx:wf:arcgis::RelationServiceTask",RelationServiceTask.suite="gcx:wf:builtin";export{RelationServiceTask};
1
+ import{relation}from"@arcgis/core/rest/geometryService";import RelationParameters from"@arcgis/core/rest/support/RelationParameters";import{validation}from"../../Validation.js";class RelationServiceTask{async execute(e,i){var t=validation.exists("url",e.url,validation.never);const a=validation.array("geometry1",e.geometry1,validation.never),r=validation.array("geometry2",e.geometry2,validation.never);e=validation.string("relation",e.relation,"intersection");const n=new RelationParameters({geometries1:a,geometries2:r});isDE9IM(e)?(n.relation="relation",n.relationParameter=`RELATE(G1,G2,"${e}")`):n.relation=e;i={signal:i.cancellationToken.signal};const o=await relation(t,n,i);i=o.map(e=>{return[a[e.geometry1Index],r[e.geometry2Index]]});return{incident:i[0],incidents:i}}}function isDE9IM(e){return/^[TF012*]{9}$/.test(e)}RelationServiceTask.action="gcx:wf:arcgis::RelationServiceTask",RelationServiceTask.suite="gcx:wf:builtin";export{RelationServiceTask};
@@ -2,7 +2,7 @@ import type { IActivityHandler } from "../../IActivityHandler";
2
2
  /** Defines inputs for the Renderer From JSON activity. */
3
3
  export interface RendererFromJsonInputs {
4
4
  /** The renderer JSON as a string or object. */
5
- json: string | Object;
5
+ json: string | object;
6
6
  }
7
7
  /** Defines outputs for the Renderer From JSON activity. */
8
8
  export interface RendererFromJsonOutputs {
@@ -0,0 +1,10 @@
1
+ import { MapProvider } from "./MapProvider";
2
+ import type { IActivityHandler, IActivityContext, EmptyOutputs } from "../../IActivityHandler";
3
+ export interface ResetAllLayerDefinitionExpressionsInputs {
4
+ onlyInitialLayers?: boolean;
5
+ }
6
+ export declare class ResetAllLayerDefinitionExpressions implements IActivityHandler {
7
+ static readonly action = "gcx:wf:arcgis::ResetAllLayerDefinitionExpressions";
8
+ static readonly suite = "gcx:wf:builtin";
9
+ execute(inputs: ResetAllLayerDefinitionExpressionsInputs, _context: IActivityContext, MapProviderType: typeof MapProvider): Promise<EmptyOutputs>;
10
+ }
@@ -0,0 +1 @@
1
+ import{__decorate}from"tslib";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{MapProvider}from"./MapProvider.js";let ResetAllLayerDefinitionExpressions=class{async execute(e,i,s){e=validation.boolean("onlyInitialLayers",e.onlyInitialLayers,!1);const o=s.create();return await o.load(),o.resetDefinitionExpressions(e),{}}};ResetAllLayerDefinitionExpressions.action="gcx:wf:arcgis::ResetAllLayerDefinitionExpressions",ResetAllLayerDefinitionExpressions.suite="gcx:wf:builtin",ResetAllLayerDefinitionExpressions=__decorate([activate(MapProvider)],ResetAllLayerDefinitionExpressions);export{ResetAllLayerDefinitionExpressions};
@@ -0,0 +1,24 @@
1
+ import { MapProvider } from "./MapProvider";
2
+ import type { IActivityHandler, IActivityContext } from "../../IActivityHandler";
3
+ /** Defines inputs for the ResetLayerDefinitionExpressionInputs activity. */
4
+ export interface ResetLayerDefinitionExpressionInputs {
5
+ /**
6
+ * The ID of the layer whose definition is to be reset.
7
+ * In applications that use the 4.x ArcGIS Maps SDK for JavaScript, the title of the layer is also searched if no matching ID is found.
8
+ */
9
+ layerId: string | number;
10
+ /**
11
+ * The optional index of the sublayer whose definition is to be reset. Sublayers are associated with MapImageLayers.
12
+ */
13
+ sublayerId?: string | number;
14
+ }
15
+ /** Defines outputs for the SetLayerDefinitionExpression activity. */
16
+ export interface SetLayerDefinitionExpressionOutputs {
17
+ oldExpression?: string;
18
+ newExpression?: string;
19
+ }
20
+ export declare class ResetLayerDefinitionExpression implements IActivityHandler {
21
+ static readonly action = "gcx:wf:arcgis::ResetLayerDefinitionExpression";
22
+ static readonly suite = "gcx:wf:builtin";
23
+ execute(inputs: ResetLayerDefinitionExpressionInputs, _context: IActivityContext, MapProviderType: typeof MapProvider): Promise<SetLayerDefinitionExpressionOutputs>;
24
+ }
@@ -0,0 +1 @@
1
+ import{__decorate}from"tslib";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{MapProvider}from"./MapProvider.js";let ResetLayerDefinitionExpression=class{async execute(i,e,o){var n=validation.id("layerId",i.layerId,validation.never),i=validation.id("sublayerId",i.sublayerId,void 0);const r=o.create();await r.load();const s=r.findLayer(n);if(void 0===s||null===s)return{};{if(await s.load(),void 0===i)return{oldExpression:s.getDefinitionExpression(),newExpression:s.resetDefinitionExpression()};const t=r.findLayer(i,s.layer);return void 0===t||null===t?{}:{oldExpression:t.getDefinitionExpression(),newExpression:t.resetDefinitionExpression()}}}};ResetLayerDefinitionExpression.action="gcx:wf:arcgis::ResetLayerDefinitionExpression",ResetLayerDefinitionExpression.suite="gcx:wf:builtin",ResetLayerDefinitionExpression=__decorate([activate(MapProvider)],ResetLayerDefinitionExpression);export{ResetLayerDefinitionExpression};
@@ -21,7 +21,7 @@ export interface ReverseGeocodeInputs {
21
21
  }
22
22
  /** Defines outputs for the ReverseGeocode activity. */
23
23
  export interface ReverseGeocodeOutputs {
24
- address?: {};
24
+ address?: object;
25
25
  location?: __esri.Point;
26
26
  }
27
27
  export declare class ReverseGeocode implements IActivityHandler {