@vertigis/workflow 5.48.2 → 5.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/Collections.d.ts +27 -27
  2. package/Collections.js +1 -1
  3. package/EnumUtils.d.ts +5 -5
  4. package/EnumUtils.js +1 -1
  5. package/Errors.d.ts +27 -27
  6. package/Hooks.d.ts +2 -2
  7. package/IActivityHandler.d.ts +14 -14
  8. package/LanguageStringUtils.js +1 -1
  9. package/ProgramInspectorFacility.d.ts +1 -1
  10. package/ProgramInspectorFacility.js +1 -1
  11. package/Task.d.ts +3 -3
  12. package/Task.js +1 -1
  13. package/TemplateUtils.d.ts +2 -2
  14. package/Validation.d.ts +10 -1
  15. package/Validation.js +1 -1
  16. package/activities/app/GetApplicationData.d.ts +1 -1
  17. package/activities/app/GetApplicationData.js +1 -1
  18. package/activities/app/RemoveApplicationData.d.ts +1 -1
  19. package/activities/app/RemoveApplicationData.js +1 -1
  20. package/activities/app/SetApplicationData.d.ts +1 -1
  21. package/activities/app/SetApplicationData.js +1 -1
  22. package/activities/arcgis/AddFeatures.d.ts +7 -4
  23. package/activities/arcgis/AddFeatures.js +1 -1
  24. package/activities/arcgis/AreaEngineTask.d.ts +1 -1
  25. package/activities/arcgis/AreaEngineTask.js +1 -1
  26. package/activities/arcgis/BufferEngineTask.d.ts +1 -1
  27. package/activities/arcgis/BufferEngineTask.js +1 -1
  28. package/activities/arcgis/CastGeometry.d.ts +4 -4
  29. package/activities/arcgis/CompareGeometries.d.ts +1 -1
  30. package/activities/arcgis/CompareGeometries.js +1 -1
  31. package/activities/arcgis/DeleteFeatures.d.ts +7 -3
  32. package/activities/arcgis/DeleteFeatures.js +1 -1
  33. package/activities/arcgis/DifferenceEngineTask.d.ts +1 -1
  34. package/activities/arcgis/DifferenceEngineTask.js +1 -1
  35. package/activities/arcgis/FlipEngineTask.d.ts +1 -1
  36. package/activities/arcgis/FlipEngineTask.js +1 -1
  37. package/activities/arcgis/GenerateArcGisToken.d.ts +2 -2
  38. package/activities/arcgis/GeoprocessingAsync.d.ts +2 -2
  39. package/activities/arcgis/GetAttributeValue.d.ts +1 -0
  40. package/activities/arcgis/GetAttributeValues.d.ts +1 -0
  41. package/activities/arcgis/GetCurrentPosition.d.ts +28 -28
  42. package/activities/arcgis/GetFeatureGeometries.d.ts +2 -2
  43. package/activities/arcgis/GetFeatureSetExtent.d.ts +2 -2
  44. package/activities/arcgis/GetFormElementItemsFromFeatures.d.ts +2 -2
  45. package/activities/arcgis/GetFormElementItemsFromFeatures.js +1 -1
  46. package/activities/arcgis/GetGeometryExtent.d.ts +2 -2
  47. package/activities/arcgis/LengthEngineTask.d.ts +1 -1
  48. package/activities/arcgis/LengthEngineTask.js +1 -1
  49. package/activities/arcgis/MapProvider.d.ts +92 -92
  50. package/activities/arcgis/MapProvider.js +1 -1
  51. package/activities/arcgis/NearestCoordinateEngineTask.d.ts +6 -6
  52. package/activities/arcgis/NearestVertexEngineTask.d.ts +6 -6
  53. package/activities/arcgis/NearestVerticesEngineTask.d.ts +6 -6
  54. package/activities/arcgis/ProjectServiceTask.js +1 -1
  55. package/activities/arcgis/ResetLayerDefinitionExpression.d.ts +2 -2
  56. package/activities/arcgis/RunPrint.d.ts +2 -2
  57. package/activities/arcgis/RunPrint.js +1 -1
  58. package/activities/arcgis/RunReport.js +1 -1
  59. package/activities/arcgis/RunWorkflow.d.ts +4 -4
  60. package/activities/arcgis/RunWorkflow.js +1 -1
  61. package/activities/arcgis/SetImageryLayerOptions.d.ts +2 -2
  62. package/activities/arcgis/SetLayerDefinitionExpression.d.ts +2 -2
  63. package/activities/arcgis/SetLayerProperty.d.ts +2 -2
  64. package/activities/arcgis/SetLayerVisibility.d.ts +2 -2
  65. package/activities/arcgis/SetViewExtent.d.ts +4 -4
  66. package/activities/arcgis/SetViewpoint.d.ts +2 -2
  67. package/activities/arcgis/TypeChecking.d.ts +3 -3
  68. package/activities/arcgis/UpdateFeatures.d.ts +6 -3
  69. package/activities/arcgis/UpdateFeatures.js +1 -1
  70. package/activities/arcgis/libs/arcGisRestApi.d.ts +4 -4
  71. package/activities/arcgis/libs/shared.d.ts +9 -0
  72. package/activities/arcgis/libs/shared.js +1 -0
  73. package/activities/arcgis/printing.d.ts +14 -14
  74. package/activities/arcgis/runUtils.d.ts +2 -2
  75. package/activities/arcgis/runUtils.js +1 -1
  76. package/activities/arcgis/shared.d.ts +9 -2
  77. package/activities/arcgis/shared.js +1 -1
  78. package/activities/core/CalculateDate.d.ts +1 -1
  79. package/activities/core/CalculateDate.js +1 -1
  80. package/activities/core/ChannelProvider.d.ts +42 -42
  81. package/activities/core/ChannelProvider.js +1 -1
  82. package/activities/core/ForEach.d.ts +4 -4
  83. package/activities/core/FormatDate.d.ts +21 -21
  84. package/activities/core/FormatDate.js +1 -1
  85. package/activities/core/GetFirstItem.d.ts +1 -0
  86. package/activities/core/GetItemAtIndex.d.ts +1 -0
  87. package/activities/core/GetLastItem.d.ts +1 -0
  88. package/activities/core/GetWorkflowInputs.d.ts +6 -2
  89. package/activities/core/Log.d.ts +1 -1
  90. package/activities/core/Log.js +1 -1
  91. package/activities/core/Loop.d.ts +2 -2
  92. package/activities/core/ParseJson.d.ts +1 -0
  93. package/activities/core/WebRequest.d.ts +2 -2
  94. package/activities/csv/ParseCsv.d.ts +1 -0
  95. package/activities/essentials/GetEssentialsSite.d.ts +2 -2
  96. package/activities/essentials/RunEssentialsWorkflow.d.ts +2 -2
  97. package/activities/essentials/RunEssentialsWorkflow.js +1 -1
  98. package/activities/forms/DisplayForm.d.ts +6 -6
  99. package/activities/forms/DisplayForm.js +1 -1
  100. package/activities/forms/FormActor.d.ts +22 -22
  101. package/activities/forms/FormRenderer.d.ts +2 -2
  102. package/activities/forms/FormRenderer.js +1 -1
  103. package/activities/forms/GetFormElementItemsFromCollection.d.ts +7 -7
  104. package/activities/forms/GetFormElementItemsFromCollection.js +1 -1
  105. package/activities/forms/SetFormElementProperty.d.ts +1 -1
  106. package/activities/math/Max.d.ts +1 -1
  107. package/activities/math/Max.js +1 -1
  108. package/activities/math/Min.d.ts +1 -1
  109. package/activities/math/Min.js +1 -1
  110. package/activities/server/RunApplication.d.ts +2 -2
  111. package/activities/server/RunPython.d.ts +4 -4
  112. package/activities/ui/DialogContent.d.ts +6 -6
  113. package/activities/ui/DialogProvider.d.ts +5 -5
  114. package/activities/ui/DialogProvider.js +1 -1
  115. package/definition/ActivityInput.d.ts +6 -6
  116. package/definition/ProgramInspector.d.ts +118 -118
  117. package/definition/ProgramInspector.js +1 -1
  118. package/definition/Reference.d.ts +2 -2
  119. package/definition/Resource.d.ts +15 -15
  120. package/definition/Transition.d.ts +4 -4
  121. package/diagnostics/ConsoleDebugLogger.d.ts +2 -2
  122. package/diagnostics/ConsoleDebugLogger.js +1 -1
  123. package/execution/ActivityContext.d.ts +35 -35
  124. package/execution/ActivityContext.js +1 -1
  125. package/execution/ActivityContextProxy.d.ts +7 -7
  126. package/execution/ActivityContextProxy.js +1 -1
  127. package/execution/AmbientState.d.ts +29 -29
  128. package/execution/AmbientState.js +1 -1
  129. package/execution/AmbientStateProxy.d.ts +10 -10
  130. package/execution/AmbientStateProxy.js +1 -1
  131. package/execution/AsyncContext.d.ts +1 -1
  132. package/execution/AsyncContext.js +1 -1
  133. package/execution/Engine.d.ts +27 -28
  134. package/execution/Engine.js +1 -1
  135. package/execution/IDebugSession.d.ts +10 -10
  136. package/execution/MonikerFrame.d.ts +2 -2
  137. package/execution/MonikerFrame.js +1 -1
  138. package/execution/Proxy.d.ts +1 -1
  139. package/execution/Proxy.js +1 -1
  140. package/execution/StepContext.d.ts +1 -1
  141. package/execution/StepContext.js +1 -1
  142. package/execution/TransitionContext.d.ts +1 -1
  143. package/execution/TransitionContext.js +1 -1
  144. package/forms/ExclusiveTimer.d.ts +2 -2
  145. package/forms/ExclusiveTimer.js +1 -1
  146. package/forms/FormComponent.d.ts +7 -7
  147. package/forms/FormComponent.js +1 -1
  148. package/forms/FormDefinition.d.ts +50 -42
  149. package/forms/FormHost.d.ts +161 -146
  150. package/forms/FormHost.js +1 -1
  151. package/forms/FormPresenterHost.d.ts +42 -42
  152. package/forms/MutuallyExclusiveSectionGroup.d.ts +6 -6
  153. package/forms/MutuallyExclusiveSectionGroup.js +1 -1
  154. package/forms/NumberParser.d.ts +2 -2
  155. package/forms/branding/WorkflowColor.d.ts +5 -5
  156. package/forms/branding/WorkflowColor.js +1 -1
  157. package/forms/components/AutoComplete.js +1 -1
  158. package/forms/components/Button.js +1 -1
  159. package/forms/components/DateTimePicker.js +1 -1
  160. package/forms/components/Form.js +1 -1
  161. package/forms/components/FormLabelNumberField.d.ts +4 -4
  162. package/forms/components/GeometryPickerListItem.d.ts +4 -4
  163. package/forms/components/ItemPicker.js +1 -1
  164. package/forms/components/NumberRangeSlider.js +1 -1
  165. package/forms/components/NumberSlider.js +1 -1
  166. package/forms/components/Scanner.js +1 -1
  167. package/forms/components/SignatureDialog.d.ts +2 -2
  168. package/forms/components/SketchDialog.d.ts +5 -5
  169. package/forms/components/common.js +1 -1
  170. package/forms/dateUtilities.d.ts +2 -2
  171. package/forms/elements/types.d.ts +2 -2
  172. package/forms/index.d.ts +2 -2
  173. package/forms/numberFormatter.d.ts +8 -8
  174. package/forms/numberUtilities.d.ts +1 -1
  175. package/forms/utils.d.ts +6 -12
  176. package/libs/version.d.ts +1 -1
  177. package/libs/version.js +1 -1
  178. package/package.json +1 -1
  179. package/ui/UIService.d.ts +2 -2
  180. package/ui/UIService.js +1 -1
@@ -1 +1 @@
1
- import esriId from"@arcgis/core/identity/IdentityManager";export function getAuthenticationToken(e){const t=esriId.findCredential(e);return t?.token||""}export function parsePortalItemUrl(e){const t=e.match(/^(.*?)\/home\/item\.html\?id=(.*?)(#.*)?$/);if(t)return{portalUrl:t[1],itemId:t[2]}}export function getPortalDataUrl(e,t){return`${e.portalUrl}/sharing/rest/content/items/${e.itemId}?f=json&token=${t}`}export async function getPortalItem(e,t,n){const r=t.create(void 0,"arcgis");n.finally(function(){r.cancel()}),r.request.url=e;if(!await r.send())throw console.error("Unable to get portal item.",r.response.message),new Error("Unable to get portal item.");return r.getResponseData(r.response.payload)}export function formatGlobalId(e){return"{"!=e[0]&&(e="{"+e),"}"!=e[e.length-1]&&(e+="}"),e}export function combineGlobalIds(e){return`[${e.map(e=>`"${formatGlobalId(e)}"`).join(",")}]`}export function equalsIgnoreCase(e,t){return e===t||null!=e&&(null!=t&&e.toLowerCase()===t.toLowerCase())}export function getFieldName(e,t){return Object.keys(t).find(t=>equalsIgnoreCase(e,t))}export function containsIgnoreCase(e,t){return e.some(e=>equalsIgnoreCase(e,t))}export function calculateOrigin(e,t){if(t)return t;switch(e.type){case"extent":return e.center;case"point":return e;case"mesh":case"multipoint":case"polygon":case"polyline":return e.extent.center}}
1
+ import esriId from"@arcgis/core/identity/IdentityManager";export async function getAuthenticationToken(e,t){const n=esriId.findCredential(e);return t&&await handleOAuthForIWA(n),n?.token||""}async function handleOAuthForIWA(e){let t,n;if(null!=e&&"portal"===e.scope&&null==e.token&&(t=esriId.findServerInfo(e.server))?.webTierAuth&&null!=(n=esriId.findOAuthInfo(e.server)))if(null==esriId.oAuthSignIn)console.warn("IWA portal token fetch failed: oAuthSignIn method not found.");else{const r=await esriId.oAuthSignIn(e.server,t,n,{oAuthPopupConfirmation:!1});null!=r&&(e.token=r.token,e.oAuthState=r.oAuthState,e.expires=r.expires,e._oAuthCred=r._oAuthCred)}}export function parsePortalItemUrl(e){const t=e.match(/^(.*?)\/home\/item\.html\?id=(.*?)(#.*)?$/);if(t)return{portalUrl:t[1],itemId:t[2]}}export function getPortalDataUrl(e,t){return`${e.portalUrl}/sharing/rest/content/items/${e.itemId}?f=json&token=${t}`}export async function getPortalItem(e,t,n){const r=t.create(void 0,"arcgis");n.finally(function(){r.cancel()}),r.request.url=e;if(!await r.send())throw console.error("Unable to get portal item.",r.response.message),new Error("Unable to get portal item.");return r.getResponseData(r.response.payload)}export function formatGlobalId(e){return"{"!=e[0]&&(e="{"+e),"}"!=e[e.length-1]&&(e+="}"),e}export function combineGlobalIds(e){return`[${e.map(e=>`"${formatGlobalId(e)}"`).join(",")}]`}export function equalsIgnoreCase(e,t){return e===t||null!=e&&(null!=t&&e.toLowerCase()===t.toLowerCase())}export function getFieldName(e,t){return Object.keys(t).find(t=>equalsIgnoreCase(e,t))}export function containsIgnoreCase(e,t){return e.some(e=>equalsIgnoreCase(e,t))}export function calculateOrigin(e,t){if(t)return t;switch(e.type){case"extent":return e.center;case"point":return e;case"mesh":case"multipoint":case"polygon":case"polyline":return e.extent.center}}
@@ -19,7 +19,6 @@ export declare class CalculateDate implements IActivityHandler {
19
19
  static readonly suite = "gcx:wf:builtin";
20
20
  execute(inputs: CalculateDateInputs): CalculateDateOutputs;
21
21
  getStartDate(startDate: string, utc: boolean): Date | UTCDate;
22
- private offsetDate;
23
22
  private getMonthString;
24
23
  /**
25
24
  * Gets the time zone string for creating a new Date from a string.
@@ -30,6 +29,7 @@ export declare class CalculateDate implements IActivityHandler {
30
29
  * @returns The time zone string.
31
30
  */
32
31
  private getTimeZone;
32
+ private offsetDate;
33
33
  /**
34
34
  * Removes the time from the supplied date, leaving the year, month and date intact.
35
35
  * @param date The date to be altered.
@@ -1 +1 @@
1
- import{UTCDate}from"@date-fns/utc";import{addDays,addMonths,addWeeks,addYears}from"date-fns";import{ActivityInputError}from"../../Errors.js";import{validation}from"../../Validation.js";export class CalculateDate{execute(t){const e=validation.string("date",t.date,validation.never),a=validation.boolean("utc",t.useUtc,!1),s=validation.number("offsetAmount",t.offsetAmount,0),n=validation.string("offsetUnits",t.offsetUnits,"day"),r=this.getStartDate(e,a),i=this.offsetDate(r,s,n),o=new Date(i);return{date:o,value:o.valueOf()}}getStartDate(t,e){const a=e?new UTCDate:new Date;switch(t){case"today":return this.removeTime(a),a;case"this-week":{this.removeTime(a);const t=a.getDay();return t>0?addDays(a,0-t):a}case"this-month":{const t=`${a.getFullYear()}-${this.getMonthString(a)}-01T00:00:00.000${this.getTimeZone(e)}`;return e?new UTCDate(t):new Date(t)}case"this-year":{const t=`${a.getFullYear()}-01-01T00:00:00.000${this.getTimeZone(e)}`;return e?new UTCDate(t):new Date(t)}default:throw new ActivityInputError("date",'The `date` input must be "today", "this-week", "this-month" or "this-year".')}}offsetDate(t,e,a){if(0===e)return t;switch(a){default:case"day":return addDays(t,e);case"week":return addWeeks(t,e);case"month":return addMonths(t,e);case"year":return addYears(t,e)}}getMonthString(t){const e=t.getMonth()+1;return e>9?`${e}`:`0${e}`}getTimeZone(t){return t?"Z":""}removeTime(t){t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}}CalculateDate.action="gcx:wf:core::CalculateDate",CalculateDate.suite="gcx:wf:builtin";
1
+ import{UTCDate}from"@date-fns/utc";import{addDays,addMonths,addWeeks,addYears}from"date-fns";import{ActivityInputError}from"../../Errors.js";import{validation}from"../../Validation.js";export class CalculateDate{execute(t){const e=validation.string("date",t.date,validation.never),a=validation.boolean("utc",t.useUtc,!1),s=validation.number("offsetAmount",t.offsetAmount,0),n=validation.string("offsetUnits",t.offsetUnits,"day"),r=this.getStartDate(e,a),i=this.offsetDate(r,s,n),o=new Date(i);return{date:o,value:o.valueOf()}}getStartDate(t,e){const a=e?new UTCDate:new Date;switch(t){case"today":return this.removeTime(a),a;case"this-week":{this.removeTime(a);const t=a.getDay();return t>0?addDays(a,0-t):a}case"this-month":{const t=`${a.getFullYear()}-${this.getMonthString(a)}-01T00:00:00.000${this.getTimeZone(e)}`;return e?new UTCDate(t):new Date(t)}case"this-year":{const t=`${a.getFullYear()}-01-01T00:00:00.000${this.getTimeZone(e)}`;return e?new UTCDate(t):new Date(t)}default:throw new ActivityInputError("date",'The `date` input must be "today", "this-week", "this-month" or "this-year".')}}getMonthString(t){const e=t.getMonth()+1;return e>9?`${e}`:`0${e}`}getTimeZone(t){return t?"Z":""}offsetDate(t,e,a){if(0===e)return t;switch(a){default:case"day":return addDays(t,e);case"week":return addWeeks(t,e);case"month":return addMonths(t,e);case"year":return addYears(t,e)}}removeTime(t){t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}}CalculateDate.action="gcx:wf:core::CalculateDate",CalculateDate.suite="gcx:wf:builtin";
@@ -1,30 +1,30 @@
1
1
  import Bluebird from "bluebird";
2
2
  import type { Activator } from "../../Activator";
3
3
  interface Request {
4
- /** The URL of the request. */
5
- url?: string;
6
- /** The request method. For example, GET, POST, PUT, DELETE, etc. */
7
- method?: string;
8
- /** The headers of the request. */
9
- headers: Record<string, string | string[]>;
10
4
  /** The content of the request. */
11
5
  content?: ArrayBuffer | FormData | string;
6
+ /** The headers of the request. */
7
+ headers: Record<string, string | string[]>;
12
8
  /** The content of the request as JSON. */
13
9
  json?: any;
10
+ /** The request method. For example, GET, POST, PUT, DELETE, etc. */
11
+ method?: string;
12
+ /** The URL of the request. */
13
+ url?: string;
14
14
  }
15
15
  interface Response {
16
+ /** The content for the current request/response. */
17
+ content?: ArrayBuffer | string;
16
18
  /** The error for the current request/response. */
17
19
  error?: Error;
18
- /** The status for the current request/response. */
19
- status?: number;
20
- /** The message for the current request/response. */
21
- message?: string;
22
20
  /** The headers for the current request/response. */
23
21
  headers: Record<string, string | string[]>;
24
- /** The content for the current request/response. */
25
- content?: ArrayBuffer | string;
22
+ /** The message for the current request/response. */
23
+ message?: string;
26
24
  /** The payload for the current request/response. */
27
25
  payload?: object;
26
+ /** The status for the current request/response. */
27
+ status?: number;
28
28
  }
29
29
  export interface ChannelInfo {
30
30
  /** The request. */
@@ -35,48 +35,41 @@ export interface ChannelInfo {
35
35
  /** @public */
36
36
  export declare class ChannelProvider implements ChannelInfo {
37
37
  static type: string;
38
- static register(activator: Activator): void;
39
- /**
40
- * Creates a new channel.
41
- * @param channel The previous channel.
42
- * @param name The channel by name.
43
- */
44
- static create(channel?: ChannelProvider, name?: string): ChannelProvider;
45
- constructor(ChannelProviderType: typeof ChannelProvider, name?: string);
46
- /** Indicates the channel name. */
47
- protected name: string | undefined;
48
- /** Indicates the channel type. */
49
- protected type: typeof ChannelProvider;
50
- /** Indicates the current XHR. */
51
- protected xhr: XMLHttpRequest | undefined;
52
- protected resolve: ((result: boolean) => void) | undefined;
38
+ /** Indicates if the request is binary. */
39
+ binary: boolean;
40
+ /** Indicate whether to send credentials with CORS */
41
+ corsWithCredentials: boolean;
42
+ /** Indicates the request. */
43
+ request: Request;
44
+ /** Indicates the response for the current request/response. */
45
+ response: Response;
46
+ /** Indicates the timeout. */
47
+ timeout: number;
53
48
  /**
54
49
  * The base promise is one that we create in advance but don't use until `send()` is called.
55
50
  * We add `timeout()` and `catch()` clauses and assign the result to `promise`, which is
56
51
  * subsequently used externally.
57
52
  */
58
53
  protected basePromise: Bluebird<boolean>;
54
+ /** Indicates the channel name. */
55
+ protected name: string | undefined;
59
56
  /** Indicates the promise. */
60
57
  protected promise: Bluebird<boolean> | undefined;
58
+ protected resolve: ((result: boolean) => void) | undefined;
59
+ /** Indicates the channel type. */
60
+ protected type: typeof ChannelProvider;
61
+ /** Indicates the current XHR. */
62
+ protected xhr: XMLHttpRequest | undefined;
63
+ constructor(ChannelProviderType: typeof ChannelProvider, name?: string);
61
64
  /**
62
- * Attempts to conclude the request.
63
- * @param error
65
+ * Creates a new channel.
66
+ * @param channel The previous channel.
67
+ * @param name The channel by name.
64
68
  */
65
- protected tryConclude(error?: Error): void;
66
- /** Indicates the request. */
67
- request: Request;
68
- /** Indicates the response for the current request/response. */
69
- response: Response;
70
- /** Indicates if the request is binary. */
71
- binary: boolean;
72
- /** Indicates the timeout. */
73
- timeout: number;
74
- /** Indicate whether to send credentials with CORS */
75
- corsWithCredentials: boolean;
69
+ static create(channel?: ChannelProvider, name?: string): ChannelProvider;
70
+ static register(activator: Activator): void;
76
71
  /** Cancels the request. */
77
72
  cancel(): void;
78
- /** Sends the request. */
79
- send(): Bluebird<boolean>;
80
73
  /**
81
74
  * This method appears redundant, but it's needed because esri 4
82
75
  * puts the interesting stuff in the payload within a "data" element,
@@ -86,5 +79,12 @@ export declare class ChannelProvider implements ChannelInfo {
86
79
  getResponseData(payload: object | undefined): object | undefined;
87
80
  /** Constructs a new request from this channel. */
88
81
  new(): ChannelProvider;
82
+ /** Sends the request. */
83
+ send(): Bluebird<boolean>;
84
+ /**
85
+ * Attempts to conclude the request.
86
+ * @param error
87
+ */
88
+ protected tryConclude(error?: Error): void;
89
89
  }
90
90
  export {};
@@ -1 +1 @@
1
- import Bluebird from"bluebird";function parseResponseHeaders(e){const s={};if("string"!=typeof e)return s;for(const t of e.split(/\r?\n/)){const e=t.indexOf(":");if(e>=0){const r=t.substring(0,e).trim(),i=t.substring(e+1).trim(),n=s[r];n instanceof Array?n.push(i):s[r]="string"==typeof n?[n,i]:i}}return s}export class ChannelProvider{static register(e){e.factories.push(e=>e===this.type?this:void 0)}static create(e,s){return e instanceof this?e.new():new this(this,s)}constructor(e,s){this.basePromise=new Bluebird(e=>{this.resolve=e}),this.binary=!1,this.timeout=6e4,this.corsWithCredentials=!1,this.name=s,this.type=e,this.request={headers:{}},this.response={headers:{}}}tryConclude(e){const s=this.xhr;if(s.readyState===s.DONE){this.response.status=s.status,this.response.message=s.statusText,this.response.headers=parseResponseHeaders(s.getAllResponseHeaders());const e=s.response;("string"==typeof e||e instanceof ArrayBuffer)&&(this.response.content=e),this.resolve(!0)}null!=e&&(this.response.error=e,this.resolve(!1))}cancel(){this.resolve(!1)}send(){let e=this.promise;if(void 0===e){if(e=this.promise=this.basePromise.timeout(this.timeout).catch(()=>!1),e.isResolved())return e;const s=this.xhr=new XMLHttpRequest;e.finally(()=>s.abort());try{s.open(this.request.method||"GET",this.request.url,!0),s.onreadystatechange=()=>this.tryConclude(),s.onerror=e=>this.tryConclude(e.error),this.corsWithCredentials&&(s.withCredentials=!0),this.binary?s.responseType="arraybuffer":s.responseType="text";const e=this.request.headers;for(const t in e){const r=e[t];if(r instanceof Array)for(const e of r)s.setRequestHeader(t,"string"==typeof e?e:JSON.stringify(e));else s.setRequestHeader(t,"string"==typeof r?r:JSON.stringify(r))}const t=this.request.json,r=void 0!==t?JSON.stringify(t):this.request.content;s.send(r)}catch(e){this.response.error=e,this.resolve(!1)}}return e}getResponseData(e){return e}new(){return new this.type(this.type,this.name)}}ChannelProvider.type="59378113-D159-4E5C-A4AB-292F6E52620E:ChannelProvider";
1
+ import Bluebird from"bluebird";function parseResponseHeaders(e){const s={};if("string"!=typeof e)return s;for(const t of e.split(/\r?\n/)){const e=t.indexOf(":");if(e>=0){const r=t.substring(0,e).trim(),i=t.substring(e+1).trim(),n=s[r];n instanceof Array?n.push(i):s[r]="string"==typeof n?[n,i]:i}}return s}export class ChannelProvider{constructor(e,s){this.binary=!1,this.corsWithCredentials=!1,this.timeout=6e4,this.name=s,this.type=e,this.request={headers:{}},this.response={headers:{}},this.basePromise=new Bluebird(e=>{this.resolve=e})}static create(e,s){return e instanceof this?e.new():new this(this,s)}static register(e){e.factories.push(e=>e===this.type?this:void 0)}cancel(){this.resolve(!1)}getResponseData(e){return e}new(){return new this.type(this.type,this.name)}send(){let e=this.promise;if(void 0===e){if(e=this.promise=this.basePromise.timeout(this.timeout).catch(()=>!1),e.isResolved())return e;const s=this.xhr=new XMLHttpRequest;e.finally(()=>s.abort());try{s.open(this.request.method||"GET",this.request.url,!0),s.onreadystatechange=()=>this.tryConclude(),s.onerror=e=>this.tryConclude(e.error),this.corsWithCredentials&&(s.withCredentials=!0),this.binary?s.responseType="arraybuffer":s.responseType="text";const e=this.request.headers;for(const t in e){const r=e[t];if(r instanceof Array)for(const e of r)s.setRequestHeader(t,"string"==typeof e?e:JSON.stringify(e));else s.setRequestHeader(t,"string"==typeof r?r:JSON.stringify(r))}const t=this.request.json,r=void 0!==t?JSON.stringify(t):this.request.content;s.send(r)}catch(e){this.response.error=e,this.resolve(!1)}}return e}tryConclude(e){const s=this.xhr;if(s.readyState===s.DONE){this.response.status=s.status,this.response.message=s.statusText,this.response.headers=parseResponseHeaders(s.getAllResponseHeaders());const e=s.response;("string"==typeof e||e instanceof ArrayBuffer)&&(this.response.content=e),this.resolve(!0)}null!=e&&(this.response.error=e,this.resolve(!1))}}ChannelProvider.type="59378113-D159-4E5C-A4AB-292F6E52620E:ChannelProvider";
@@ -7,14 +7,14 @@ export interface ForEachInputs {
7
7
  }
8
8
  /** Defines outputs to the ForEach activity. */
9
9
  export interface ForEachOutputs {
10
- /** @description The key of the item currently being processed. */
11
- key?: string;
12
- /** @description The pass that the loop is on. */
13
- pass?: number;
14
10
  /** @description The count of the items. */
15
11
  count?: number;
16
12
  /** @description The current item from the items collection. */
17
13
  item?: any;
14
+ /** @description The key of the item currently being processed. */
15
+ key?: string;
16
+ /** @description The pass that the loop is on. */
17
+ pass?: number;
18
18
  }
19
19
  export declare class ForEach implements IActivityHandler {
20
20
  static readonly action = "gcx:wf:core:loop:ForEach";
@@ -23,16 +23,18 @@ export declare class FormatDate implements IActivityHandler {
23
23
  execute(inputs: FormatDateInputs, context: IActivityContext): FormatDateOutputs;
24
24
  private getFormattedDate;
25
25
  /**
26
- * This is used for a subset of the standard date and time format strings
27
- * which do not relate to an explicit custom equivalent.
28
- * With these constraints in mind, we can make some assumptions to simplify the code.
29
- * 1. The "abbreviated month" is never present.
30
- * 2. The "abbreviated day" is never present.
31
- * 3. The "full day" is never present.
32
- * @param dateTimeFormatParts The results of formatting a test date (2000-05-01 14:00:00) to parts.
33
- * @returns Our own details of the parts, for formatting the date from the activity inputs.
26
+ * This method inspects a multi-character Custom date and time format string.
27
+ * These are all described on this page:
28
+ *
29
+ * https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings
30
+ *
31
+ * We use the `CUSTOM_FORMAT_CHARS` namespace to describe the supported characters.
32
+ *
33
+ * @param customFormatString The format string to be inspected.
34
+ * @param locale The locale to be used for localized characters, like separators.
35
+ * @returns Details about how to format a date from the specified format string.
34
36
  */
35
- private toCustomDateFormatParts;
37
+ private inspectCustomFormat;
36
38
  /**
37
39
  * This method inspects a single-character Custom date and time format string which is assumed to be
38
40
  * a Standard date and time format string. These are all described on this page:
@@ -46,18 +48,16 @@ export declare class FormatDate implements IActivityHandler {
46
48
  * @returns Details to be used to format the date and time.
47
49
  */
48
50
  private inspectStandardFormatString;
51
+ private renderCustom;
49
52
  /**
50
- * This method inspects a multi-character Custom date and time format string.
51
- * These are all described on this page:
52
- *
53
- * https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings
54
- *
55
- * We use the `CUSTOM_FORMAT_CHARS` namespace to describe the supported characters.
56
- *
57
- * @param customFormatString The format string to be inspected.
58
- * @param locale The locale to be used for localized characters, like separators.
59
- * @returns Details about how to format a date from the specified format string.
53
+ * This is used for a subset of the standard date and time format strings
54
+ * which do not relate to an explicit custom equivalent.
55
+ * With these constraints in mind, we can make some assumptions to simplify the code.
56
+ * 1. The "abbreviated month" is never present.
57
+ * 2. The "abbreviated day" is never present.
58
+ * 3. The "full day" is never present.
59
+ * @param dateTimeFormatParts The results of formatting a test date (2000-05-01 14:00:00) to parts.
60
+ * @returns Our own details of the parts, for formatting the date from the activity inputs.
60
61
  */
61
- private inspectCustomFormat;
62
- private renderCustom;
62
+ private toCustomDateFormatParts;
63
63
  }
@@ -1 +1 @@
1
- import{ActivityInputError}from"../../Errors.js";import{DEFAULT_LOCALE}from"../../constants.js";export class FormatDate{execute(t,e){const a=new Date(t.date);return{formatted:this.getFormattedDate(a,t.format,e.ambient.locale),iso:a.toISOString(),local:a.toString(),unix:a.valueOf(),utc:a.toUTCString()}}getFormattedDate(t,e,a){switch(a=a||DEFAULT_LOCALE,e){case"LT":return new Intl.DateTimeFormat(a,{timeStyle:"short"}).format(t);case"LTS":return new Intl.DateTimeFormat(a,{timeStyle:"medium"}).format(t);case"L":return new Intl.DateTimeFormat(a,{month:"2-digit",day:"2-digit",year:"numeric"}).format(t);case"l":return new Intl.DateTimeFormat(a,{month:"numeric",day:"numeric",year:"numeric"}).format(t);case"LL":return new Intl.DateTimeFormat(a,{dateStyle:"long"}).format(t);case"ll":return new Intl.DateTimeFormat(a,{dateStyle:"medium"}).format(t);case"LLL":return new Intl.DateTimeFormat(a,{dateStyle:"long",timeStyle:"short"}).format(t);case"lll":return new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short"}).format(t);case"LLLL":return`${new Intl.DateTimeFormat(a,{weekday:"long"}).format(t)}, ${new Intl.DateTimeFormat(a,{dateStyle:"long",timeStyle:"short"}).format(t)}`;case"llll":return`${new Intl.DateTimeFormat(a,{weekday:"short"}).format(t)}, ${new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short"}).format(t)}`;case void 0:case"":return t.toISOString();default:return this.renderCustom(t,e,a)}}toCustomDateFormatParts(t){const e=[];for(const a of t){const t=a.value;let r,n=a.type;switch(n){case"day":case"fractionalSecond":case"hour":case"minute":case"month":if(!/\d/i.test(t)){r=4;break}case"second":case"year":r=t.length;break;case"weekday":n="day",r=4}"hour"===n&&parseInt(t)>12&&(n="hour24"),e.push({length:r,type:n,value:"literal"===n?t:void 0})}return e}inspectStandardFormatString(t,e){const a="current";let r,n="local";switch(t){case STANDARD_FORMAT_STRINGS.DATE_SHORT:r={};break;case STANDARD_FORMAT_STRINGS.DATE_LONG:r={weekday:"long",year:"numeric",month:"long",day:"numeric"};break;case STANDARD_FORMAT_STRINGS.DATETIME_FULL_SHORT_TIME:{const t=[...new Intl.DateTimeFormat(e,{weekday:"long",year:"numeric",month:"long",day:"numeric"}).formatToParts(new Date(2e3,0,5)),{type:"literal",value:" "},...new Intl.DateTimeFormat(e,{timeStyle:"short"}).formatToParts(new Date(2e3,0,5,1,2,3))];return{dateTimeKind:n,culture:a,customDateFormatParts:this.toCustomDateFormatParts(t)}}case STANDARD_FORMAT_STRINGS.DATE_TIME_UNIVERSAL_FULL:n="utc";case STANDARD_FORMAT_STRINGS.DATETIME_FULL_LONG_TIME:{const t=[...new Intl.DateTimeFormat(e,{weekday:"long",year:"numeric",month:"long",day:"numeric"}).formatToParts(new Date(2e3,0,5)),{type:"literal",value:" "},...new Intl.DateTimeFormat(e,{timeStyle:"medium"}).formatToParts(new Date(2e3,0,5,1,2,3))];return{dateTimeKind:n,culture:a,customDateFormatParts:this.toCustomDateFormatParts(t)}}case STANDARD_FORMAT_STRINGS.DATETIME_GENERAL_SHORT_TIME:r={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1};break;case STANDARD_FORMAT_STRINGS.DATETIME_GENERAL_LONG_TIME:r={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1};break;case STANDARD_FORMAT_STRINGS.MONTH_DAY_1:case STANDARD_FORMAT_STRINGS.MONTH_DAY_2:{const t=new Intl.DateTimeFormat(e,{dateStyle:"short"}).formatToParts(new Date(2e3,0,5)).find(t=>"day"===t.type);r={month:"long",day:t&&1===t.value.length?"numeric":"2-digit"};break}case STANDARD_FORMAT_STRINGS.ROUND_TRIP_DATE_TIME_1:case STANDARD_FORMAT_STRINGS.ROUND_TRIP_DATE_TIME_2:return{dateTimeKind:n,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.RFC1123_1:case STANDARD_FORMAT_STRINGS.RFC1123_2:return{dateTimeKind:n,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.DATE_TIME_SORTABLE:return{dateTimeKind:n,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.TIME_SHORT:r={timeStyle:"short"};break;case STANDARD_FORMAT_STRINGS.TIME_LONG:r={timeStyle:"long"};break;case STANDARD_FORMAT_STRINGS.DATE_TIME_UNIVERSAL_SORTABLE:return{dateTimeKind:n,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("yyyy'-'MM'-'dd HH':'mm':'ss'Z'",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.YEAR_MONTH_1:case STANDARD_FORMAT_STRINGS.YEAR_MONTH_2:r={month:"long",year:"numeric"}}return{dateTimeKind:n,culture:a,customDateFormatParts:this.toCustomDateFormatParts(new Intl.DateTimeFormat(e,r).formatToParts(new Date(2e3,0,5,14)))}}inspectCustomFormat(t,e){if(1===t.length)return this.inspectStandardFormatString(t,e);const a=[];let r="",n=!1,o=!1,s="";for(let e=0;e<=t.length;e++){const T=t[e];if(o){T===s?(a.push({type:"literal",value:r}),r="",o=!1,s=""):T&&(r+=T);continue}if(n){if(e===t.length)throw new ActivityInputError("format","Escape character without subsequent character.");a.push({type:"literal",value:T}),n=!1;continue}let i=e>0?t[e-1]:"";if(t[e-2]===CUSTOM_FORMAT_CHARS.ESCAPE_CHARACTER&&(i=""),T===i){r+=T;continue}const c=maxLengths[i];if(void 0!==c&&r.length>c)throw new ActivityInputError("format",`Too many occurrences of the '${i}' character in a sequence.`);switch(i){case"":break;case CUSTOM_FORMAT_CHARS.CUSTOM_FORMAT_SPECIFIER:if(e===t.length)throw new ActivityInputError("format","In a custom format string, the '%' character must be followed by another character.");continue;case CUSTOM_FORMAT_CHARS.DATE_SEPARATOR:a.push({type:"dateSeparator",length:r.length});break;case CUSTOM_FORMAT_CHARS.DAY:a.push({type:"day",length:r.length});break;case CUSTOM_FORMAT_CHARS.ERA:a.push({type:"era",length:r.length});break;case CUSTOM_FORMAT_CHARS.ESCAPE_CHARACTER:break;case CUSTOM_FORMAT_CHARS.HOURS_LOWER:a.push({type:"hour",length:r.length});break;case CUSTOM_FORMAT_CHARS.HOURS_UPPER:a.push({type:"hour24",length:r.length});break;case CUSTOM_FORMAT_CHARS.LITERAL_DOUBLE_QUOTE:case CUSTOM_FORMAT_CHARS.LITERAL_SINGLE_QUOTE:break;case CUSTOM_FORMAT_CHARS.MERIDIEM:a.push({type:"dayPeriod",length:r.length});break;case CUSTOM_FORMAT_CHARS.MINUTE:a.push({type:"minute",length:r.length});break;case CUSTOM_FORMAT_CHARS.MONTH:a.push({type:"month",length:r.length});break;case CUSTOM_FORMAT_CHARS.OFFSET:a.push({type:"offset",length:r.length});break;case CUSTOM_FORMAT_CHARS.SECONDS:a.push({type:"second",length:r.length});break;case CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_LOWER:a.push({type:"fractionalSecond",length:r.length});break;case CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_UPPPER:a.push({type:"fractionalSecondOptional",length:r.length});break;case CUSTOM_FORMAT_CHARS.TIME_SEPARATOR:a.push({type:"timeSeparator",length:r.length});break;case CUSTOM_FORMAT_CHARS.TIME_ZONE:a.push({type:"offset",length:3});break;case CUSTOM_FORMAT_CHARS.YEAR:a.push({type:"year",length:r.length});break;default:a.push({type:"literal",value:r})}T&&(T===CUSTOM_FORMAT_CHARS.ESCAPE_CHARACTER?n=!0:isLiteralChar(T)?(o=!0,s=T,r=""):r=T)}if(o)throw new ActivityInputError("format",`Unterminated literal: ${s}${r}`);return{customDateFormatParts:a,culture:"current",dateTimeKind:"local"}}renderCustom(t,e,a){if(e.length<1)return"";const{culture:r,customDateFormatParts:n,dateTimeKind:o}=this.inspectCustomFormat(e,a);let s;"invariant"===r&&(a="inv"),"utc"===o&&(s="utc");const T=[];for(const e of n){const{type:r,value:n}=e,i=e.length??1;switch(r){case"day":{let e="";switch(i){case 1:case 2:e=("utc"===o?t.getUTCDate():t.getDate()).toString(),2===i&&1===e.length&&(e="0"+e);break;default:e=new Intl.DateTimeFormat(a,{timeZone:s,weekday:3===i?"short":"long"}).format(t)}T.push(e);break}case"month":{let e="";switch(i){case 1:case 2:e=(("utc"===o?t.getUTCMonth():t.getMonth())+1).toString(),2===i&&1===e.length&&(e="0"+e);break;default:e=new Intl.DateTimeFormat(a,{month:3===i?"short":"long",timeZone:s}).format(t)}T.push(e);break}case"year":{let e=("utc"===o?t.getUTCFullYear():t.getFullYear()).toString();switch(i){case 1:case 2:e.length>2&&(e=e.substring(e.length-2,e.length)),1===i&&2===e.length&&"0"===e[0]&&(e=e.substring(1,2));break;default:e.length<i&&(e="0".repeat(i-e.length)+e)}T.push(e)}break;case"hour":case"hour24":{let e="utc"===o?t.getUTCHours():t.getHours();"hour"===r&&(e>12&&(e-=12),0===e&&(e=12));let a=e.toString();i>1&&1===a.length&&(a="0"+a),T.push(a);break}case"minute":{let e=("utc"===o?t.getUTCMinutes():t.getMinutes()).toString();i>1&&1===e.length&&(e="0"+e),T.push(e);break}case"second":{let e=("utc"===o?t.getUTCSeconds():t.getSeconds()).toString();i>1&&1===e.length&&(e="0"+e),T.push(e);break}case"fractionalSecond":case"fractionalSecondOptional":{const e="utc"===s?t.getUTCMilliseconds():t.getMilliseconds();let a=e.toString();if(e<10?a="00"+e:e<100&&(a="0"+e),a.length>i&&(a=a.substring(0,i)),"fractionalSecondOptional"===r)for(;a.endsWith("0");)a=a.substring(0,a.length-1);else a.length<i&&(a+="0".repeat(i-a.length));if("fractionalSecondOptional"===r&&""===a){const t=T.length>0?T[T.length-1]:void 0;t?.endsWith(".")&&(T[T.length-1]=t.substring(0,t.length-1))}else T.push(a);break}case"dayPeriod":{const e=new Intl.DateTimeFormat(a,{hourCycle:"h12",timeStyle:"short",timeZone:s}).formatToParts(t).find(t=>t.type===r);e&&T.push(e.value);break}case"era":{const e=new Intl.DateTimeFormat(a,{era:"short"}).formatToParts(t).find(t=>t.type===r);e&&T.push(e.value);break}case"timeZoneName":{const e=new Intl.DateTimeFormat(a,{timeZoneName:"short"}).formatToParts(t).find(t=>t.type===r);e&&T.push(e.value);break}case"literal":n&&T.push(n);break;case"offset":{const e="utc"===s?0:-1*t.getTimezoneOffset(),a=e/60,r=Math.trunc(a),n=e%60;let o=Math.abs(a).toString();switch(i){case 1:break;case 2:1===o.length&&(o="0"+o);break;default:{let t=Math.abs(r).toString(),e=Math.abs(n).toString();1===t.length&&(t="0"+t),1===e.length&&(e="0"+e),o=`${t}:${e}`;break}}o=a>=0?"+"+o:"-"+o,T.push(o);break}case"dateSeparator":{const e=new Intl.DateTimeFormat(a,{dateStyle:"short"}).formatToParts(t),r=e.findIndex(t=>"day"===t.type),n=e.findIndex(t=>"month"===t.type);if(-1!==r&&-1!==n){const t=Math.min(r,n),a=Math.max(r,n);for(let r=t+1;r<a;r++){const t=e[r];if("literal"===t.type){T.push(t.value.repeat(i));break}}}break}case"timeSeparator":{const e=new Intl.DateTimeFormat(a,{timeStyle:"short"}).formatToParts(t),r=e.findIndex(t=>"hour"===t.type),n=e.findIndex(t=>"literal"===t.type),o=e.findIndex(t=>"minute"===t.type);r>=0&&n>r&&o>n&&T.push(e[n].value.repeat(i));break}}}return T.join("")}}var STANDARD_FORMAT_STRINGS,CUSTOM_FORMAT_CHARS;FormatDate.action="gcx:wf:core::FormatDate",FormatDate.suite="gcx:wf:builtin",function(t){t.DATE_SHORT="d",t.DATE_LONG="D",t.DATETIME_FULL_SHORT_TIME="f",t.DATETIME_FULL_LONG_TIME="F",t.DATETIME_GENERAL_SHORT_TIME="g",t.DATETIME_GENERAL_LONG_TIME="G",t.MONTH_DAY_1="m",t.MONTH_DAY_2="M",t.ROUND_TRIP_DATE_TIME_1="o",t.ROUND_TRIP_DATE_TIME_2="O",t.RFC1123_1="r",t.RFC1123_2="R",t.DATE_TIME_SORTABLE="s",t.TIME_SHORT="t",t.TIME_LONG="T",t.DATE_TIME_UNIVERSAL_SORTABLE="u",t.DATE_TIME_UNIVERSAL_FULL="U",t.YEAR_MONTH_1="y",t.YEAR_MONTH_2="Y"}(STANDARD_FORMAT_STRINGS||(STANDARD_FORMAT_STRINGS={})),function(t){t.CUSTOM_FORMAT_SPECIFIER="%",t.DATE_SEPARATOR="/",t.DAY="d",t.ERA="g",t.ESCAPE_CHARACTER="\\",t.HOURS_LOWER="h",t.HOURS_UPPER="H",t.LITERAL_DOUBLE_QUOTE='"',t.LITERAL_SINGLE_QUOTE="'",t.MERIDIEM="t",t.MINUTE="m",t.MONTH="M",t.OFFSET="z",t.SECONDS="s",t.SECONDS_FRACTION_LOWER="f",t.SECONDS_FRACTION_UPPPER="F",t.TIME_SEPARATOR=":",t.TIME_ZONE="K",t.YEAR="y"}(CUSTOM_FORMAT_CHARS||(CUSTOM_FORMAT_CHARS={}));const maxLengths={[CUSTOM_FORMAT_CHARS.CUSTOM_FORMAT_SPECIFIER]:1,[CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_LOWER]:7,[CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_UPPPER]:7};function isLiteralChar(t){return[CUSTOM_FORMAT_CHARS.LITERAL_DOUBLE_QUOTE,CUSTOM_FORMAT_CHARS.LITERAL_SINGLE_QUOTE].includes(t)}
1
+ import{ActivityInputError}from"../../Errors.js";import{DEFAULT_LOCALE}from"../../constants.js";export class FormatDate{execute(t,e){const a=new Date(t.date);return{formatted:this.getFormattedDate(a,t.format,e.ambient.locale),iso:a.toISOString(),local:a.toString(),unix:a.valueOf(),utc:a.toUTCString()}}getFormattedDate(t,e,a){switch(a=a||DEFAULT_LOCALE,e){case"LT":return new Intl.DateTimeFormat(a,{timeStyle:"short"}).format(t);case"LTS":return new Intl.DateTimeFormat(a,{timeStyle:"medium"}).format(t);case"L":return new Intl.DateTimeFormat(a,{month:"2-digit",day:"2-digit",year:"numeric"}).format(t);case"l":return new Intl.DateTimeFormat(a,{month:"numeric",day:"numeric",year:"numeric"}).format(t);case"LL":return new Intl.DateTimeFormat(a,{dateStyle:"long"}).format(t);case"ll":return new Intl.DateTimeFormat(a,{dateStyle:"medium"}).format(t);case"LLL":return new Intl.DateTimeFormat(a,{dateStyle:"long",timeStyle:"short"}).format(t);case"lll":return new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short"}).format(t);case"LLLL":return`${new Intl.DateTimeFormat(a,{weekday:"long"}).format(t)}, ${new Intl.DateTimeFormat(a,{dateStyle:"long",timeStyle:"short"}).format(t)}`;case"llll":return`${new Intl.DateTimeFormat(a,{weekday:"short"}).format(t)}, ${new Intl.DateTimeFormat(a,{dateStyle:"medium",timeStyle:"short"}).format(t)}`;case void 0:case"":return t.toISOString();default:return this.renderCustom(t,e,a)}}inspectCustomFormat(t,e){if(1===t.length)return this.inspectStandardFormatString(t,e);const a=[];let r="",n=!1,o=!1,s="";for(let e=0;e<=t.length;e++){const T=t[e];if(o){T===s?(a.push({type:"literal",value:r}),r="",o=!1,s=""):T&&(r+=T);continue}if(n){if(e===t.length)throw new ActivityInputError("format","Escape character without subsequent character.");a.push({type:"literal",value:T}),n=!1;continue}let i=e>0?t[e-1]:"";if(t[e-2]===CUSTOM_FORMAT_CHARS.ESCAPE_CHARACTER&&(i=""),T===i){r+=T;continue}const c=maxLengths[i];if(void 0!==c&&r.length>c)throw new ActivityInputError("format",`Too many occurrences of the '${i}' character in a sequence.`);switch(i){case"":break;case CUSTOM_FORMAT_CHARS.CUSTOM_FORMAT_SPECIFIER:if(e===t.length)throw new ActivityInputError("format","In a custom format string, the '%' character must be followed by another character.");continue;case CUSTOM_FORMAT_CHARS.DATE_SEPARATOR:a.push({type:"dateSeparator",length:r.length});break;case CUSTOM_FORMAT_CHARS.DAY:a.push({type:"day",length:r.length});break;case CUSTOM_FORMAT_CHARS.ERA:a.push({type:"era",length:r.length});break;case CUSTOM_FORMAT_CHARS.ESCAPE_CHARACTER:break;case CUSTOM_FORMAT_CHARS.HOURS_LOWER:a.push({type:"hour",length:r.length});break;case CUSTOM_FORMAT_CHARS.HOURS_UPPER:a.push({type:"hour24",length:r.length});break;case CUSTOM_FORMAT_CHARS.LITERAL_DOUBLE_QUOTE:case CUSTOM_FORMAT_CHARS.LITERAL_SINGLE_QUOTE:break;case CUSTOM_FORMAT_CHARS.MERIDIEM:a.push({type:"dayPeriod",length:r.length});break;case CUSTOM_FORMAT_CHARS.MINUTE:a.push({type:"minute",length:r.length});break;case CUSTOM_FORMAT_CHARS.MONTH:a.push({type:"month",length:r.length});break;case CUSTOM_FORMAT_CHARS.OFFSET:a.push({type:"offset",length:r.length});break;case CUSTOM_FORMAT_CHARS.SECONDS:a.push({type:"second",length:r.length});break;case CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_LOWER:a.push({type:"fractionalSecond",length:r.length});break;case CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_UPPPER:a.push({type:"fractionalSecondOptional",length:r.length});break;case CUSTOM_FORMAT_CHARS.TIME_SEPARATOR:a.push({type:"timeSeparator",length:r.length});break;case CUSTOM_FORMAT_CHARS.TIME_ZONE:a.push({type:"offset",length:3});break;case CUSTOM_FORMAT_CHARS.YEAR:a.push({type:"year",length:r.length});break;default:a.push({type:"literal",value:r})}T&&(T===CUSTOM_FORMAT_CHARS.ESCAPE_CHARACTER?n=!0:isLiteralChar(T)?(o=!0,s=T,r=""):r=T)}if(o)throw new ActivityInputError("format",`Unterminated literal: ${s}${r}`);return{customDateFormatParts:a,culture:"current",dateTimeKind:"local"}}inspectStandardFormatString(t,e){const a="current";let r,n="local";switch(t){case STANDARD_FORMAT_STRINGS.DATE_SHORT:r={};break;case STANDARD_FORMAT_STRINGS.DATE_LONG:r={weekday:"long",year:"numeric",month:"long",day:"numeric"};break;case STANDARD_FORMAT_STRINGS.DATETIME_FULL_SHORT_TIME:{const t=[...new Intl.DateTimeFormat(e,{weekday:"long",year:"numeric",month:"long",day:"numeric"}).formatToParts(new Date(2e3,0,5)),{type:"literal",value:" "},...new Intl.DateTimeFormat(e,{timeStyle:"short"}).formatToParts(new Date(2e3,0,5,1,2,3))];return{dateTimeKind:n,culture:a,customDateFormatParts:this.toCustomDateFormatParts(t)}}case STANDARD_FORMAT_STRINGS.DATE_TIME_UNIVERSAL_FULL:n="utc";case STANDARD_FORMAT_STRINGS.DATETIME_FULL_LONG_TIME:{const t=[...new Intl.DateTimeFormat(e,{weekday:"long",year:"numeric",month:"long",day:"numeric"}).formatToParts(new Date(2e3,0,5)),{type:"literal",value:" "},...new Intl.DateTimeFormat(e,{timeStyle:"medium"}).formatToParts(new Date(2e3,0,5,1,2,3))];return{dateTimeKind:n,culture:a,customDateFormatParts:this.toCustomDateFormatParts(t)}}case STANDARD_FORMAT_STRINGS.DATETIME_GENERAL_SHORT_TIME:r={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1};break;case STANDARD_FORMAT_STRINGS.DATETIME_GENERAL_LONG_TIME:r={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1};break;case STANDARD_FORMAT_STRINGS.MONTH_DAY_1:case STANDARD_FORMAT_STRINGS.MONTH_DAY_2:{const t=new Intl.DateTimeFormat(e,{dateStyle:"short"}).formatToParts(new Date(2e3,0,5)).find(t=>"day"===t.type);r={month:"long",day:t&&1===t.value.length?"numeric":"2-digit"};break}case STANDARD_FORMAT_STRINGS.ROUND_TRIP_DATE_TIME_1:case STANDARD_FORMAT_STRINGS.ROUND_TRIP_DATE_TIME_2:return{dateTimeKind:n,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fffffffK",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.RFC1123_1:case STANDARD_FORMAT_STRINGS.RFC1123_2:return{dateTimeKind:n,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.DATE_TIME_SORTABLE:return{dateTimeKind:n,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("yyyy'-'MM'-'dd'T'HH':'mm':'ss",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.TIME_SHORT:r={timeStyle:"short"};break;case STANDARD_FORMAT_STRINGS.TIME_LONG:r={timeStyle:"long"};break;case STANDARD_FORMAT_STRINGS.DATE_TIME_UNIVERSAL_SORTABLE:return{dateTimeKind:n,culture:"invariant",customDateFormatParts:this.inspectCustomFormat("yyyy'-'MM'-'dd HH':'mm':'ss'Z'",e).customDateFormatParts};case STANDARD_FORMAT_STRINGS.YEAR_MONTH_1:case STANDARD_FORMAT_STRINGS.YEAR_MONTH_2:r={month:"long",year:"numeric"}}return{dateTimeKind:n,culture:a,customDateFormatParts:this.toCustomDateFormatParts(new Intl.DateTimeFormat(e,r).formatToParts(new Date(2e3,0,5,14)))}}renderCustom(t,e,a){if(e.length<1)return"";const{culture:r,customDateFormatParts:n,dateTimeKind:o}=this.inspectCustomFormat(e,a);let s;"invariant"===r&&(a="inv"),"utc"===o&&(s="utc");const T=[];for(const e of n){const{type:r,value:n}=e,i=e.length??1;switch(r){case"day":{let e="";switch(i){case 1:case 2:e=("utc"===o?t.getUTCDate():t.getDate()).toString(),2===i&&1===e.length&&(e="0"+e);break;default:e=new Intl.DateTimeFormat(a,{timeZone:s,weekday:3===i?"short":"long"}).format(t)}T.push(e);break}case"month":{let e="";switch(i){case 1:case 2:e=(("utc"===o?t.getUTCMonth():t.getMonth())+1).toString(),2===i&&1===e.length&&(e="0"+e);break;default:e=new Intl.DateTimeFormat(a,{month:3===i?"short":"long",timeZone:s}).format(t)}T.push(e);break}case"year":{let e=("utc"===o?t.getUTCFullYear():t.getFullYear()).toString();switch(i){case 1:case 2:e.length>2&&(e=e.substring(e.length-2,e.length)),1===i&&2===e.length&&"0"===e[0]&&(e=e.substring(1,2));break;default:e.length<i&&(e="0".repeat(i-e.length)+e)}T.push(e)}break;case"hour":case"hour24":{let e="utc"===o?t.getUTCHours():t.getHours();"hour"===r&&(e>12&&(e-=12),0===e&&(e=12));let a=e.toString();i>1&&1===a.length&&(a="0"+a),T.push(a);break}case"minute":{let e=("utc"===o?t.getUTCMinutes():t.getMinutes()).toString();i>1&&1===e.length&&(e="0"+e),T.push(e);break}case"second":{let e=("utc"===o?t.getUTCSeconds():t.getSeconds()).toString();i>1&&1===e.length&&(e="0"+e),T.push(e);break}case"fractionalSecond":case"fractionalSecondOptional":{const e="utc"===s?t.getUTCMilliseconds():t.getMilliseconds();let a=e.toString();if(e<10?a="00"+e:e<100&&(a="0"+e),a.length>i&&(a=a.substring(0,i)),"fractionalSecondOptional"===r)for(;a.endsWith("0");)a=a.substring(0,a.length-1);else a.length<i&&(a+="0".repeat(i-a.length));if("fractionalSecondOptional"===r&&""===a){const t=T.length>0?T[T.length-1]:void 0;t?.endsWith(".")&&(T[T.length-1]=t.substring(0,t.length-1))}else T.push(a);break}case"dayPeriod":{const e=new Intl.DateTimeFormat(a,{hourCycle:"h12",timeStyle:"short",timeZone:s}).formatToParts(t).find(t=>t.type===r);e&&T.push(e.value);break}case"era":{const e=new Intl.DateTimeFormat(a,{era:"short"}).formatToParts(t).find(t=>t.type===r);e&&T.push(e.value);break}case"timeZoneName":{const e=new Intl.DateTimeFormat(a,{timeZoneName:"short"}).formatToParts(t).find(t=>t.type===r);e&&T.push(e.value);break}case"literal":n&&T.push(n);break;case"offset":{const e="utc"===s?0:-1*t.getTimezoneOffset(),a=e/60,r=Math.trunc(a),n=e%60;let o=Math.abs(a).toString();switch(i){case 1:break;case 2:1===o.length&&(o="0"+o);break;default:{let t=Math.abs(r).toString(),e=Math.abs(n).toString();1===t.length&&(t="0"+t),1===e.length&&(e="0"+e),o=`${t}:${e}`;break}}o=a>=0?"+"+o:"-"+o,T.push(o);break}case"dateSeparator":{const e=new Intl.DateTimeFormat(a,{dateStyle:"short"}).formatToParts(t),r=e.findIndex(t=>"day"===t.type),n=e.findIndex(t=>"month"===t.type);if(-1!==r&&-1!==n){const t=Math.min(r,n),a=Math.max(r,n);for(let r=t+1;r<a;r++){const t=e[r];if("literal"===t.type){T.push(t.value.repeat(i));break}}}break}case"timeSeparator":{const e=new Intl.DateTimeFormat(a,{timeStyle:"short"}).formatToParts(t),r=e.findIndex(t=>"hour"===t.type),n=e.findIndex(t=>"literal"===t.type),o=e.findIndex(t=>"minute"===t.type);r>=0&&n>r&&o>n&&T.push(e[n].value.repeat(i));break}}}return T.join("")}toCustomDateFormatParts(t){const e=[];for(const a of t){const t=a.value;let r,n=a.type;switch(n){case"day":case"fractionalSecond":case"hour":case"minute":case"month":if(!/\d/i.test(t)){r=4;break}case"second":case"year":r=t.length;break;case"weekday":n="day",r=4}"hour"===n&&parseInt(t)>12&&(n="hour24"),e.push({length:r,type:n,value:"literal"===n?t:void 0})}return e}}var STANDARD_FORMAT_STRINGS,CUSTOM_FORMAT_CHARS;FormatDate.action="gcx:wf:core::FormatDate",FormatDate.suite="gcx:wf:builtin",function(t){t.DATE_SHORT="d",t.DATE_LONG="D",t.DATETIME_FULL_SHORT_TIME="f",t.DATETIME_FULL_LONG_TIME="F",t.DATETIME_GENERAL_SHORT_TIME="g",t.DATETIME_GENERAL_LONG_TIME="G",t.MONTH_DAY_1="m",t.MONTH_DAY_2="M",t.ROUND_TRIP_DATE_TIME_1="o",t.ROUND_TRIP_DATE_TIME_2="O",t.RFC1123_1="r",t.RFC1123_2="R",t.DATE_TIME_SORTABLE="s",t.TIME_SHORT="t",t.TIME_LONG="T",t.DATE_TIME_UNIVERSAL_SORTABLE="u",t.DATE_TIME_UNIVERSAL_FULL="U",t.YEAR_MONTH_1="y",t.YEAR_MONTH_2="Y"}(STANDARD_FORMAT_STRINGS||(STANDARD_FORMAT_STRINGS={})),function(t){t.CUSTOM_FORMAT_SPECIFIER="%",t.DATE_SEPARATOR="/",t.DAY="d",t.ERA="g",t.ESCAPE_CHARACTER="\\",t.HOURS_LOWER="h",t.HOURS_UPPER="H",t.LITERAL_DOUBLE_QUOTE='"',t.LITERAL_SINGLE_QUOTE="'",t.MERIDIEM="t",t.MINUTE="m",t.MONTH="M",t.OFFSET="z",t.SECONDS="s",t.SECONDS_FRACTION_LOWER="f",t.SECONDS_FRACTION_UPPPER="F",t.TIME_SEPARATOR=":",t.TIME_ZONE="K",t.YEAR="y"}(CUSTOM_FORMAT_CHARS||(CUSTOM_FORMAT_CHARS={}));const maxLengths={[CUSTOM_FORMAT_CHARS.CUSTOM_FORMAT_SPECIFIER]:1,[CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_LOWER]:7,[CUSTOM_FORMAT_CHARS.SECONDS_FRACTION_UPPPER]:7};function isLiteralChar(t){return[CUSTOM_FORMAT_CHARS.LITERAL_DOUBLE_QUOTE,CUSTOM_FORMAT_CHARS.LITERAL_SINGLE_QUOTE].includes(t)}
@@ -2,6 +2,7 @@ import type { IActivityHandler } from "../../IActivityHandler";
2
2
  /** Defines inputs for the GetFirstItem activity. */
3
3
  export interface GetFirstItemInputs {
4
4
  collection: any[];
5
+ itemType?: "any" | "ArrayBuffer" | "boolean" | "Date" | "Error" | "Function" | "number" | "number[]" | "Object" | "string" | "string[]" | "esri.Graphic" | "esri.Extent" | "esri.Geometry" | "esri.Multipoint" | "esri.Point" | "esri.Polygon" | "esri.Polyline" | "esri.PortalGroup" | "esri.PortalUser" | "esri.SpatialReference" | "esri.Layer" | "esri.Symbol" | "esri.AddressCandidate" | "esri.FeatureSet" | "{ id: number; name: string; location: esri.Point; }" | string;
5
6
  }
6
7
  /** Defines outputs from the GetFirstItem activity. */
7
8
  export interface GetFirstItemOutputs {
@@ -3,6 +3,7 @@ import type { IActivityHandler } from "../../IActivityHandler";
3
3
  export interface GetItemAtIndexInputs {
4
4
  collection: any[];
5
5
  index: number;
6
+ itemType?: "any" | "ArrayBuffer" | "boolean" | "Date" | "Error" | "Function" | "number" | "number[]" | "Object" | "string" | "string[]" | "esri.Graphic" | "esri.Extent" | "esri.Geometry" | "esri.Multipoint" | "esri.Point" | "esri.Polygon" | "esri.Polyline" | "esri.PortalGroup" | "esri.PortalUser" | "esri.SpatialReference" | "esri.Layer" | "esri.Symbol" | "esri.AddressCandidate" | "esri.FeatureSet" | "{ id: number; name: string; location: esri.Point; }" | string;
6
7
  }
7
8
  /** Defines outputs from the GetItemAtIndex activity. */
8
9
  export interface GetItemAtIndexOutputs {
@@ -2,6 +2,7 @@ import type { IActivityHandler } from "../../IActivityHandler";
2
2
  /** Defines inputs for the GetLastItem activity. */
3
3
  export interface GetLastItemInputs {
4
4
  collection: any[];
5
+ itemType?: "any" | "ArrayBuffer" | "boolean" | "Date" | "Error" | "Function" | "number" | "number[]" | "Object" | "string" | "string[]" | "esri.Graphic" | "esri.Extent" | "esri.Geometry" | "esri.Multipoint" | "esri.Point" | "esri.Polygon" | "esri.Polyline" | "esri.PortalGroup" | "esri.PortalUser" | "esri.SpatialReference" | "esri.Layer" | "esri.Symbol" | "esri.AddressCandidate" | "esri.FeatureSet" | "{ id: number; name: string; location: esri.Point; }" | string;
5
6
  }
6
7
  /** Defines outputs from the GetLastItem activity. */
7
8
  export interface GetLastItemOutputs {
@@ -1,5 +1,9 @@
1
1
  /** Standard imports. */
2
- import type { IActivityHandler, IActivityContext, EmptyInputs } from "../../IActivityHandler";
2
+ import type { IActivityHandler, IActivityContext } from "../../IActivityHandler";
3
+ /** Defines inputs to the GetWorkflowInputs activity. */
4
+ export interface GetWorkflowInputsInputs {
5
+ inputsType?: "any" | "Object" | "{ id: number; name: string; location: esri.Point; }" | string;
6
+ }
3
7
  /** Defines outputs to the GetWorkflowInputs activity. */
4
8
  export interface GetWorkflowInputsOutputs {
5
9
  /** @description The inputs to the workflow. */
@@ -8,5 +12,5 @@ export interface GetWorkflowInputsOutputs {
8
12
  export declare class GetWorkflowInputs implements IActivityHandler {
9
13
  static readonly action = "gcx:wf:core::GetWorkflowInputs";
10
14
  static readonly suite = "gcx:wf:builtin";
11
- execute(_inputs: EmptyInputs, context: IActivityContext): GetWorkflowInputsOutputs;
15
+ execute(_inputs: GetWorkflowInputsInputs, context: IActivityContext): GetWorkflowInputsOutputs;
12
16
  }
@@ -7,6 +7,6 @@ export interface LogInputs {
7
7
  export declare class Log implements IActivityHandler {
8
8
  static readonly action = "gcx:wf:core::Log";
9
9
  static readonly suite = "gcx:wf:builtin";
10
- protected _getConsole(): Pick<Console, "debug" | "error" | "info" | "log" | "warn">;
11
10
  execute(inputs: LogInputs, context: IActivityContext): EmptyOutputs;
11
+ protected _getConsole(): Pick<Console, "debug" | "error" | "info" | "log" | "warn">;
12
12
  }
@@ -1 +1 @@
1
- export class Log{_getConsole(){return console}execute(e,o){const{level:n,message:g}=e,r=this._getConsole();if(!r)return{};if((RankedLogLevel[o.ambient.logLevel]||RankedLogLevel.log)>=(RankedLogLevel[n]||RankedLogLevel.log))switch(n){case"debug":r.debug(g);break;case"info":r.info(g);break;case"warning":r.warn(g);break;case"error":r.error(g);break;default:r.log(g)}return{}}}var RankedLogLevel;Log.action="gcx:wf:core::Log",Log.suite="gcx:wf:builtin",function(e){e[e.error=1]="error",e[e.warning=2]="warning",e[e.log=3]="log",e[e.info=4]="info",e[e.debug=5]="debug"}(RankedLogLevel||(RankedLogLevel={}));
1
+ export class Log{execute(e,o){const{level:n,message:g}=e,r=this._getConsole();if(!r)return{};if((RankedLogLevel[o.ambient.logLevel]||RankedLogLevel.log)>=(RankedLogLevel[n]||RankedLogLevel.log))switch(n){case"debug":r.debug(g);break;case"info":r.info(g);break;case"warning":r.warn(g);break;case"error":r.error(g);break;default:r.log(g)}return{}}_getConsole(){return console}}var RankedLogLevel;Log.action="gcx:wf:core::Log",Log.suite="gcx:wf:builtin",function(e){e[e.error=1]="error",e[e.warning=2]="warning",e[e.log=3]="log",e[e.info=4]="info",e[e.debug=5]="debug"}(RankedLogLevel||(RankedLogLevel={}));
@@ -9,10 +9,10 @@ export interface LoopInputs {
9
9
  }
10
10
  /** Defines outputs to the Loop activity. */
11
11
  export interface LoopOutputs {
12
- /** @description The pass that the loop is on. */
13
- pass?: number;
14
12
  /** @description The item from the collection. This is only available if collection input was provided. */
15
13
  item?: any;
14
+ /** @description The pass that the loop is on. */
15
+ pass?: number;
16
16
  }
17
17
  export declare class Loop implements IActivityHandler {
18
18
  static readonly action = "gcx:wf:core:loop:Loop";
@@ -2,6 +2,7 @@ import type { IActivityHandler } from "../../IActivityHandler";
2
2
  /** Defines outputs for the ParseJson activity. */
3
3
  export interface ParseJsonInputs {
4
4
  json: string;
5
+ resultType?: "any" | "ArrayBuffer" | "boolean" | "Date" | "Error" | "Function" | "number" | "number[]" | "Object" | "string" | "string[]" | "esri.Graphic" | "esri.Extent" | "esri.Geometry" | "esri.Multipoint" | "esri.Point" | "esri.Polygon" | "esri.Polyline" | "esri.PortalGroup" | "esri.PortalUser" | "esri.SpatialReference" | "esri.Layer" | "esri.Symbol" | "esri.AddressCandidate" | "esri.FeatureSet" | "{ id: number; name: string; location: esri.Point; }" | string;
5
6
  }
6
7
  /** Defines outputs for the ParseJson activity. */
7
8
  export interface ParseJsonOutputs {
@@ -21,12 +21,12 @@ export interface WebRequestInputs {
21
21
  }
22
22
  /** Defines outputs for the WebRequest activity. */
23
23
  export interface WebRequestOutputs {
24
+ /** @description The binary/blob content of the response. */
25
+ blob?: ArrayBuffer;
24
26
  /** @description The channel that was used for the request. The channel provides access the raw request and response objects. */
25
27
  channel: ChannelInfo;
26
28
  /** @description The elapsed time (in milliseconds) of the request. */
27
29
  elapsed: number;
28
- /** @description The binary/blob content of the response. */
29
- blob?: ArrayBuffer;
30
30
  /** @description The JSON content of the response. */
31
31
  json?: any;
32
32
  /** @description The HTTP status code of the response. */
@@ -7,6 +7,7 @@ export interface ParseCsvInputs {
7
7
  headerPresent?: boolean;
8
8
  parseNumbers?: boolean;
9
9
  parseBooleans?: boolean;
10
+ itemType?: "any" | "Error" | "Object" | "{ id: number; name: string; location: esri.Point; }" | string;
10
11
  }
11
12
  /** Defines outputs for the ParseCsv activity. */
12
13
  export interface ParseCsvOutputs {
@@ -182,12 +182,12 @@ interface SearchTable {
182
182
  interface Site {
183
183
  /** The current version of Geocortex Essentials serving the Site. */
184
184
  currentVersion: string;
185
- /** The ID of the Site. */
186
- id: string;
187
185
  /** The display name of the Site. */
188
186
  displayName: string;
189
187
  /** The Essentials Map defined in the Site. */
190
188
  essentialsMap: Map;
189
+ /** The ID of the Site. */
190
+ id: string;
191
191
  /** Collection of NamedExtent objects associated with the Site. */
192
192
  namedExtents: NamedExtent[];
193
193
  /** Information about the connected user. */
@@ -15,8 +15,8 @@ export declare class RunEssentialsWorkflow implements IActivityHandler {
15
15
  static readonly action = "gcx:wf:essentials::RunEssentialsWorkflow";
16
16
  static readonly suite = "gcx:wf:builtin";
17
17
  execute(inputs: RunEssentialsWorkflowInputs, context: IActivityContext, ChannelProviderType: typeof ChannelProvider): Promise<RunEssentialsWorkflowOutputs>;
18
- private isString;
18
+ private constructInArgs;
19
19
  private getWorkflowSchema;
20
+ private isString;
20
21
  private validateInputs;
21
- private constructInArgs;
22
22
  }
@@ -1 +1 @@
1
- import{__decorate}from"tslib";import Bluebird from"bluebird";import{GenericActivityError}from"../../Errors.js";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{ChannelProvider}from"../core/ChannelProvider.js";class WorkflowSchema{constructor(){this.inputs={}}}let RunEssentialsWorkflow=class{async execute(e,t,r){const n=validation.string("url",e.url,validation.never),s=await this.getWorkflowSchema(n,r),o=this.validateInputs(e.arguments,s);if(o)return Bluebird.reject(o);const i=r.create(void 0,"geocortex");i.request.url=n+"/run",i.timeout=validation.number("timeout",e.timeout,6e4),i.request.method="POST",i.request.headers["Content-Type"]="application/x-www-form-urlencoded",i.request.json={inargs:this.constructInArgs(e.arguments,s),f:"json"},t.cancellationToken.finally(function(){i.cancel()});const a=(new Date).valueOf(),l=await i.send(),c=(new Date).valueOf()-a,u={result:{}};if(l){const e=i.getResponseData(i.response.payload);if("Completed"===e.status){const t=e.outputs;if(t)for(const e of t){const t=e.name,r=e.value;u.result[t]=r}return u}}const f=new GenericActivityError(void 0,"Error running Essentials Workflow activity.");throw f.timedOut=c>=i.timeout,f.elapsed=c,f.error=i.response.error,f.partialResult=u,f}isString(e){return"string"==typeof e}async getWorkflowSchema(e,t){const r=t.create(void 0,"geocortex");r.request.url=e,r.request.json={f:"json",deep:!0};if(await r.send()){const e=new WorkflowSchema,t=r.getResponseData(r.response.payload).inputs;if(t)for(const r of t){const t=r.name,n=r.typeName;this.isString(t)&&this.isString(n)&&(e.inputs[t]={name:t,typeName:n})}return e}throw new GenericActivityError(void 0,"Error running Essentials Workflow activity. Error retrieving workflow schema.")}validateInputs(e,t){const r=[],n=[],s=Object.keys(e);for(const e in t.inputs)s.includes(e)||r.push(e);const o=Object.keys(t.inputs);for(const t in e)o.includes(t)||n.push(t);if(r.length+n.length>0){let e="",t="";r.length&&(e=" Missing parameters: "+r),n.length&&(t=" Unexpected parameters: "+n);return new GenericActivityError(void 0,"Invalid parameters supplied to Essentials Workflow activity."+e+t)}}constructInArgs(e,t){const r=[];for(const n in e)r.push({name:n,typeName:t.inputs[n].typeName,value:e[n]});return r}};RunEssentialsWorkflow.action="gcx:wf:essentials::RunEssentialsWorkflow",RunEssentialsWorkflow.suite="gcx:wf:builtin",RunEssentialsWorkflow=__decorate([activate(ChannelProvider)],RunEssentialsWorkflow);export{RunEssentialsWorkflow};
1
+ import{__decorate}from"tslib";import Bluebird from"bluebird";import{GenericActivityError}from"../../Errors.js";import{activate}from"../../Hooks.js";import{validation}from"../../Validation.js";import{ChannelProvider}from"../core/ChannelProvider.js";class WorkflowSchema{constructor(){this.inputs={}}}let RunEssentialsWorkflow=class{async execute(e,t,r){const n=validation.string("url",e.url,validation.never),s=await this.getWorkflowSchema(n,r),o=this.validateInputs(e.arguments,s);if(o)return Bluebird.reject(o);const i=r.create(void 0,"geocortex");i.request.url=n+"/run",i.timeout=validation.number("timeout",e.timeout,6e4),i.request.method="POST",i.request.headers["Content-Type"]="application/x-www-form-urlencoded",i.request.json={inargs:this.constructInArgs(e.arguments,s),f:"json"},t.cancellationToken.finally(function(){i.cancel()});const a=(new Date).valueOf(),l=await i.send(),c=(new Date).valueOf()-a,u={result:{}};if(l){const e=i.getResponseData(i.response.payload);if("Completed"===e.status){const t=e.outputs;if(t)for(const e of t){const t=e.name,r=e.value;u.result[t]=r}return u}}const f=new GenericActivityError(void 0,"Error running Essentials Workflow activity.");throw f.timedOut=c>=i.timeout,f.elapsed=c,f.error=i.response.error,f.partialResult=u,f}constructInArgs(e,t){const r=[];for(const n in e)r.push({name:n,typeName:t.inputs[n].typeName,value:e[n]});return r}async getWorkflowSchema(e,t){const r=t.create(void 0,"geocortex");r.request.url=e,r.request.json={f:"json",deep:!0};if(await r.send()){const e=new WorkflowSchema,t=r.getResponseData(r.response.payload).inputs;if(t)for(const r of t){const t=r.name,n=r.typeName;this.isString(t)&&this.isString(n)&&(e.inputs[t]={name:t,typeName:n})}return e}throw new GenericActivityError(void 0,"Error running Essentials Workflow activity. Error retrieving workflow schema.")}isString(e){return"string"==typeof e}validateInputs(e,t){const r=[],n=[],s=Object.keys(e);for(const e in t.inputs)s.includes(e)||r.push(e);const o=Object.keys(t.inputs);for(const t in e)o.includes(t)||n.push(t);if(r.length+n.length>0){let e="",t="";r.length&&(e=" Missing parameters: "+r),n.length&&(t=" Unexpected parameters: "+n);return new GenericActivityError(void 0,"Invalid parameters supplied to Essentials Workflow activity."+e+t)}}};RunEssentialsWorkflow.action="gcx:wf:essentials::RunEssentialsWorkflow",RunEssentialsWorkflow.suite="gcx:wf:builtin",RunEssentialsWorkflow=__decorate([activate(ChannelProvider)],RunEssentialsWorkflow);export{RunEssentialsWorkflow};
@@ -20,13 +20,15 @@ export interface DisplayFormInputs {
20
20
  * @public
21
21
  */
22
22
  export interface DisplayFormOutputs {
23
- /** @description The state of the form. Use this to update or access the values of form elements. */
24
- state: Record<string, defs.Element>;
25
23
  /** @description The result of the form. */
26
24
  result?: string;
25
+ /** @description The state of the form. Use this to update or access the values of form elements. */
26
+ state: Record<string, defs.Element>;
27
27
  }
28
28
  export declare class DisplayForm implements IActivityHandler {
29
+ static readonly action = "gcx:wf:forms:form:DisplayForm";
29
30
  static renderers: Record<string, FormRenderer | undefined>;
31
+ static readonly suite = "gcx:wf:builtin";
30
32
  /**
31
33
  * Creates a form renderer if it does not exist.
32
34
  * @param inputs The inputs to create the renderer.
@@ -34,14 +36,12 @@ export declare class DisplayForm implements IActivityHandler {
34
36
  * @param FormRendererType The type of FormRenderer (subclass) to create.
35
37
  */
36
38
  static createRenderer(inputs: DisplayFormInputs, context: IActivityContext, FormRendererType: typeof FormRenderer): FormRenderer;
37
- static readonly action = "gcx:wf:forms:form:DisplayForm";
38
- static readonly suite = "gcx:wf:builtin";
39
- /** Performs the operation on behalf of the engine. */
40
- execute(inputs: DisplayFormInputs, context: IActivityContext, type: typeof FormRenderer): Promise<DisplayFormOutputs>;
41
39
  /**
42
40
  * Updates the references in the `ElementMap` for all of the elements
43
41
  * contained in `displayFormOutputs`.
44
42
  * @param displayFormOutputs The outputs of the `DisplayForm` activity.
45
43
  */
46
44
  private static updateElementMap;
45
+ /** Performs the operation on behalf of the engine. */
46
+ execute(inputs: DisplayFormInputs, context: IActivityContext, type: typeof FormRenderer): Promise<DisplayFormOutputs>;
47
47
  }
@@ -1 +1 @@
1
- var DisplayForm_1;import{__decorate}from"tslib";import Bluebird from"bluebird";import{activate}from"../../Hooks.js";import{setFormForElement}from"./FormElementMap.js";import{FormRenderer}from"./FormRenderer.js";function loop(e,t){let o,r;const n=new Bluebird((e,t)=>{o=e,r=t});let s=e();return function n(){for(;s.isFulfilled();){const r=s.value();if(void 0===r)break;const n=t(r);if(void 0!==n){o(n);break}s=e()}s.isPending()&&s.then(n),s.isRejected()&&r(s.reason())}(),n}let DisplayForm=DisplayForm_1=class{static createRenderer(e,t,o){let r=t.luid;const n=!1!==e.reset,s=e.name;"string"==typeof s&&(r=":"+s);const i=this.renderers;let l,a=i[r];if(a&&(!1===n&&(l=a.form),delete i[r],a=void 0),void 0===a){a=i[r]=o.create(),l&&(a.form=l);const e=function(){delete i[r],a.dispose()};(a.state=t.ambient).completion.then(e,e)}l?a.load():a.load(e.form,e.template);const u="string"==typeof e.container?e.container:"default",m="string"==typeof e.region?e.region:void 0;return a.form.defaults.container=void 0!==m||"default"!==u&&"modal"!==u?{name:u,region:m}:u,a}execute(e,t,o){let r=t.state;if(void 0!==r){const e=r.outputs,o=t.caught;if(void 0!==o){const n=e.event,s=n?`Error in ${n.name} element's ${n.type} event in`:"Error in a subworkflow of";return console.error(`${s} a Display Form activity: ${o.message}`,o),t.fork("catch"),r.busy(),r.outputs={actor:r,state:r.form.elements,event:e.event,route:!1,error:o},DisplayForm_1.updateElementMap(r.outputs),r.cancelTool(),Promise.resolve(r.outputs)}const n=e.result;if("string"==typeof n)return r.spinNoBlock(),r.outputs={actor:r,state:r.form.elements,event:e.event,route:!1,result:n,status:n},DisplayForm_1.updateElementMap(r.outputs),r.cancelTool(),Promise.resolve(r.outputs);if("object"==typeof n&&null!==n)return r.spinNoBlock(),Bluebird.reject(n);e.route&&r.route(e.event)}else r=DisplayForm_1.createRenderer(e,t,o),t.persist(r);t.ambient.setExternalEventHandler(r.enqueueExternalEvent);return r.outputs=void 0,loop(function(){const e=r.observe();return e.isFulfilled()&&void 0===e.value()&&(console.warn("Error detected observing form. Promise is fulfilled with no value."),r.dispose()),e},e=>{let o;const n=e.value,s=("submit"===e.type||"end"===e.type)&&"string"==typeof n?n:void 0,i=()=>(o=r.outputs={actor:r,state:r.form.elements,event:e,route:!1,result:s,status:s},DisplayForm_1.updateElementMap(r.outputs),r.cancelTool(),t.ambient.removeExternalEventHandler(r.enqueueExternalEvent),r.outputs);if(!r.trap(e)&&t.hasBranch(e.routingKey)){const n=e.cancellationToken;if(null!=n){if(Bluebird.resolve(n).isFulfilled())return void r.route(e);n.then(function(){r.outputs===o&&t.goto()})}else r.busy();return t.fork(e.routingKey),t.registerForErrors(),i()}if(void 0!==s)return r.spinNoBlock(),i();r.route(e)})}static updateElementMap(e){if(e&&e.state)for(const t in e.state)setFormForElement(e.state[t],e)}};DisplayForm.renderers={},DisplayForm.action="gcx:wf:forms:form:DisplayForm",DisplayForm.suite="gcx:wf:builtin",DisplayForm=DisplayForm_1=__decorate([activate(FormRenderer)],DisplayForm);export{DisplayForm};
1
+ var DisplayForm_1;import{__decorate}from"tslib";import Bluebird from"bluebird";import{activate}from"../../Hooks.js";import{setFormForElement}from"./FormElementMap.js";import{FormRenderer}from"./FormRenderer.js";function loop(e,t){let o,r;const n=new Bluebird((e,t)=>{o=e,r=t});let s=e();return function n(){for(;s.isFulfilled();){const r=s.value();if(void 0===r)break;const n=t(r);if(void 0!==n){o(n);break}s=e()}s.isPending()&&s.then(n),s.isRejected()&&r(s.reason())}(),n}let DisplayForm=DisplayForm_1=class{static createRenderer(e,t,o){let r=t.luid;const n=!1!==e.reset,s=e.name;"string"==typeof s&&(r=":"+s);const i=this.renderers;let l,a=i[r];if(a&&(!1===n&&(l=a.form),delete i[r],a=void 0),void 0===a){a=i[r]=o.create(),l&&(a.form=l);const e=function(){delete i[r],a.dispose()};(a.state=t.ambient).completion.then(e,e)}l?a.load():a.load(e.form,e.template);const u="string"==typeof e.container?e.container:"default",m="string"==typeof e.region?e.region:void 0;return a.form.defaults.container=void 0!==m||"default"!==u&&"modal"!==u?{name:u,region:m}:u,a}static updateElementMap(e){if(e&&e.state)for(const t in e.state)setFormForElement(e.state[t],e)}execute(e,t,o){let r=t.state;if(void 0!==r){const e=r.outputs,o=t.caught;if(void 0!==o){const n=e.event,s=n?`Error in ${n.name} element's ${n.type} event in`:"Error in a subworkflow of";return console.error(`${s} a Display Form activity: ${o.message}`,o),t.fork("catch"),r.busy(),r.outputs={actor:r,state:r.form.elements,event:e.event,route:!1,error:o},DisplayForm_1.updateElementMap(r.outputs),r.cancelTool(),Promise.resolve(r.outputs)}const n=e.result;if("string"==typeof n)return r.spinNoBlock(),r.outputs={actor:r,state:r.form.elements,event:e.event,route:!1,result:n,status:n},DisplayForm_1.updateElementMap(r.outputs),r.cancelTool(),Promise.resolve(r.outputs);if("object"==typeof n&&null!==n)return r.spinNoBlock(),Bluebird.reject(n);e.route&&r.route(e.event)}else r=DisplayForm_1.createRenderer(e,t,o),t.persist(r);t.ambient.setExternalEventHandler(r.enqueueExternalEvent);return r.applyPendingValues(),r.outputs=void 0,loop(function(){const e=r.observe();return e.isFulfilled()&&void 0===e.value()&&(console.warn("Error detected observing form. Promise is fulfilled with no value."),r.dispose()),e},e=>{let o;const n=e.value,s=("submit"===e.type||"end"===e.type)&&"string"==typeof n?n:void 0,i=()=>(o=r.outputs={actor:r,state:r.form.elements,event:e,route:!1,result:s,status:s},DisplayForm_1.updateElementMap(r.outputs),r.cancelTool(),t.ambient.removeExternalEventHandler(r.enqueueExternalEvent),r.outputs);if(!r.trap(e)&&t.hasBranch(e.routingKey)){const n=e.cancellationToken;if(null!=n){if(Bluebird.resolve(n).isFulfilled())return void r.route(e);n.then(function(){r.outputs===o&&t.goto()})}else r.busy();return t.fork(e.routingKey),t.registerForErrors(),i()}if(void 0!==s)return r.spinNoBlock(),i();r.route(e)})}};DisplayForm.action="gcx:wf:forms:form:DisplayForm",DisplayForm.renderers={},DisplayForm.suite="gcx:wf:builtin",DisplayForm=DisplayForm_1=__decorate([activate(FormRenderer)],DisplayForm);export{DisplayForm};
@@ -17,19 +17,15 @@ export interface ElementPosition {
17
17
  }
18
18
  /** Defines what the renderer exposes. */
19
19
  export default interface FormActor {
20
- /** Returns the element with the given name. If the element does not exist an error will be thrown. */
21
- getElement(element: string | defs.Element | undefined, event?: defs.Event): defs.Element;
22
- getElementRegistration(element: defs.Element): FormElementRegistration | undefined;
23
- /** Returns the name of the given element. If the element does not exist an error will be thrown. */
24
- getElementName(element: defs.Element | string | undefined, event?: defs.Event): string;
25
- /** Sets element visibility to false. */
26
- hideElement(element: defs.Element): void;
27
- /** Sets element visibility to true. */
28
- showElement(element: defs.Element): void;
29
- /** Assigns an error message to an element. */
30
- setElementError(elementName: string, error: string | undefined, markdown?: boolean): void;
31
- /** Finds the specified item and sets it as the current one. Returns true if a match was found, false otherwise. */
32
- setCurrentItem(elementName: string, value: defs.Value | defs.Text | defs.Item, matchType: defs.ItemMatchType): boolean;
20
+ /**
21
+ * Adds the supplied element to the form.
22
+ * @param elementName The unique name for the element.
23
+ * @param type The type of element to add.
24
+ * @param element The contents of the element to add.
25
+ */
26
+ addElement(elementName: string, type: string, element: defs.Element, elementPosition?: ElementPosition): defs.Element;
27
+ /** Assigns a property to an element item, or overwrites an existing property. */
28
+ assignElementItemProperty(elementName: string, itemKey: string, propertyName: string, propertyValue: any, markdown?: boolean): void;
33
29
  /**
34
30
  * Assigns a property to an element, or overwrites an existing property.
35
31
  * @param elementName The name of the element to be updated.
@@ -41,15 +37,19 @@ export default interface FormActor {
41
37
  assignElementProperty(elementName: string, propertyName: string, propertyValue: any, markdown?: boolean, event?: Partial<defs.Event> | boolean): void;
42
38
  /** Assigns an items property to an element. */
43
39
  assignItemsToElement(elementName: string, items: Record<string, defs.Item>, reset?: boolean): void;
44
- /** Assigns a property to an element item, or overwrites an existing property. */
45
- assignElementItemProperty(elementName: string, itemKey: string, propertyName: string, propertyValue: any, markdown?: boolean): void;
46
40
  /** Filters the items of an element based on heuristics. */
47
41
  filterItems(elementName: string, phrase: string): boolean;
48
- /**
49
- * Adds the supplied element to the form.
50
- * @param elementName The unique name for the element.
51
- * @param type The type of element to add.
52
- * @param element The contents of the element to add.
53
- */
54
- addElement(elementName: string, type: string, element: defs.Element, elementPosition?: ElementPosition): defs.Element;
42
+ /** Returns the element with the given name. If the element does not exist an error will be thrown. */
43
+ getElement(element: string | defs.Element | undefined, event?: defs.Event): defs.Element;
44
+ /** Returns the name of the given element. If the element does not exist an error will be thrown. */
45
+ getElementName(element: defs.Element | string | undefined, event?: defs.Event): string;
46
+ getElementRegistration(element: defs.Element): FormElementRegistration | undefined;
47
+ /** Sets element visibility to false. */
48
+ hideElement(element: defs.Element): void;
49
+ /** Finds the specified item and sets it as the current one. Returns true if a match was found, false otherwise. */
50
+ setCurrentItem(elementName: string, value: defs.Value | defs.Text | defs.Item, matchType: defs.ItemMatchType): boolean;
51
+ /** Assigns an error message to an element. */
52
+ setElementError(elementName: string, error: string | undefined, markdown?: boolean): void;
53
+ /** Sets element visibility to true. */
54
+ showElement(element: defs.Element): void;
55
55
  }