@esri/solution-workflow 5.2.1 → 5.2.3

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 (53) hide show
  1. package/README.md +3 -6
  2. package/dist/esm/index.js.map +1 -0
  3. package/dist/esm/{workflow/src/workflow.d.ts → workflow.d.ts} +12 -3
  4. package/dist/esm/workflow.js +112 -0
  5. package/dist/esm/workflow.js.map +1 -0
  6. package/package.json +3 -3
  7. package/dist/cjs/common/src/generalHelpers.d.ts +0 -400
  8. package/dist/cjs/common/src/generalHelpers.js +0 -877
  9. package/dist/cjs/common/src/generalHelpers.js.map +0 -1
  10. package/dist/cjs/common/src/getItemTypeAbbrev.d.ts +0 -19
  11. package/dist/cjs/common/src/getItemTypeAbbrev.js +0 -186
  12. package/dist/cjs/common/src/getItemTypeAbbrev.js.map +0 -1
  13. package/dist/cjs/common/src/interfaces.d.ts +0 -1344
  14. package/dist/cjs/common/src/interfaces.js +0 -77
  15. package/dist/cjs/common/src/interfaces.js.map +0 -1
  16. package/dist/cjs/common/src/libConnectors.d.ts +0 -73
  17. package/dist/cjs/common/src/libConnectors.js +0 -115
  18. package/dist/cjs/common/src/libConnectors.js.map +0 -1
  19. package/dist/cjs/common/test/mocks/templates.d.ts +0 -71
  20. package/dist/cjs/common/test/mocks/templates.js +0 -1220
  21. package/dist/cjs/common/test/mocks/templates.js.map +0 -1
  22. package/dist/cjs/common/test/mocks/utils.d.ts +0 -605
  23. package/dist/cjs/common/test/mocks/utils.js +0 -1222
  24. package/dist/cjs/common/test/mocks/utils.js.map +0 -1
  25. package/dist/cjs/workflow/src/index.js +0 -25
  26. package/dist/cjs/workflow/src/index.js.map +0 -1
  27. package/dist/cjs/workflow/src/workflow.d.ts +0 -32
  28. package/dist/cjs/workflow/src/workflow.js +0 -51
  29. package/dist/cjs/workflow/src/workflow.js.map +0 -1
  30. package/dist/esm/common/src/generalHelpers.d.ts +0 -400
  31. package/dist/esm/common/src/generalHelpers.js +0 -829
  32. package/dist/esm/common/src/generalHelpers.js.map +0 -1
  33. package/dist/esm/common/src/getItemTypeAbbrev.d.ts +0 -19
  34. package/dist/esm/common/src/getItemTypeAbbrev.js +0 -182
  35. package/dist/esm/common/src/getItemTypeAbbrev.js.map +0 -1
  36. package/dist/esm/common/src/interfaces.d.ts +0 -1344
  37. package/dist/esm/common/src/interfaces.js +0 -72
  38. package/dist/esm/common/src/interfaces.js.map +0 -1
  39. package/dist/esm/common/src/libConnectors.d.ts +0 -73
  40. package/dist/esm/common/src/libConnectors.js +0 -105
  41. package/dist/esm/common/src/libConnectors.js.map +0 -1
  42. package/dist/esm/common/test/mocks/templates.d.ts +0 -71
  43. package/dist/esm/common/test/mocks/templates.js +0 -1195
  44. package/dist/esm/common/test/mocks/templates.js.map +0 -1
  45. package/dist/esm/common/test/mocks/utils.d.ts +0 -605
  46. package/dist/esm/common/test/mocks/utils.js +0 -1177
  47. package/dist/esm/common/test/mocks/utils.js.map +0 -1
  48. package/dist/esm/workflow/src/index.d.ts +0 -21
  49. package/dist/esm/workflow/src/index.js.map +0 -1
  50. package/dist/esm/workflow/src/workflow.js +0 -45
  51. package/dist/esm/workflow/src/workflow.js.map +0 -1
  52. /package/dist/{cjs/workflow/src → esm}/index.d.ts +0 -0
  53. /package/dist/esm/{workflow/src/index.js → index.js} +0 -0
@@ -1,1195 +0,0 @@
1
- /** @license
2
- * Copyright 2018 Esri
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- // This file contains examples of templates of AGOL items.
17
- import * as generalHelpers from "../../src/generalHelpers";
18
- import * as getItemTypeAbbrev from "../../src/getItemTypeAbbrev";
19
- import * as utils from "./utils";
20
- // -- Exports -------------------------------------------------------------------------------------------------------//
21
- export function getEmptyGeneralizedItem() {
22
- return {
23
- id: "",
24
- type: ""
25
- };
26
- }
27
- export function getEmptyItem() {
28
- return {
29
- created: 0,
30
- id: "",
31
- modified: 0,
32
- numViews: 0,
33
- owner: "",
34
- size: 0,
35
- tags: [],
36
- title: "",
37
- type: ""
38
- };
39
- }
40
- export function getFailedDeployment(failedItemIds = []) {
41
- return {
42
- success: false,
43
- itemIds: failedItemIds,
44
- error: "One or more items cannot be deployed"
45
- };
46
- }
47
- export function getFailedItem(itemType) {
48
- return {
49
- item: null,
50
- id: "",
51
- type: itemType,
52
- postProcess: false
53
- };
54
- }
55
- export function getSolutionTemplateItem(templates = []) {
56
- return {
57
- item: {
58
- commentsEnabled: false,
59
- id: "sln1234567890",
60
- itemType: "text",
61
- name: null,
62
- title: "title",
63
- type: "Solution",
64
- typeKeywords: ["Solution", "Template"],
65
- url: utils.PORTAL_SUBSET.portalUrl + "/home/item.html?id=sln1234567890"
66
- },
67
- data: {
68
- metadata: {
69
- version: "x",
70
- resourceStorageItemId: "sln1234567890"
71
- },
72
- templates
73
- }
74
- };
75
- }
76
- export function getItemTemplateSkeleton() {
77
- return {
78
- itemId: "",
79
- type: "",
80
- key: "",
81
- item: {
82
- id: "",
83
- type: "",
84
- typeKeywords: []
85
- },
86
- data: {},
87
- resources: [],
88
- properties: {},
89
- dependencies: [],
90
- relatedItems: [],
91
- groups: [],
92
- estimatedDeploymentCostFactor: 0
93
- };
94
- }
95
- export function getDeployedItemTemplate(itemId, type, dependencies = []) {
96
- return {
97
- itemId,
98
- type,
99
- dependencies,
100
- groups: []
101
- };
102
- }
103
- export function getItemTemplate(type, dependencies = [], url = "") {
104
- let templatePart = {};
105
- // Supported item types
106
- switch (type) {
107
- case "ArcGIS Pro Add In":
108
- break;
109
- case "Code Attachment":
110
- break;
111
- case "Code Sample":
112
- break;
113
- case "Dashboard":
114
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url);
115
- templatePart.data = getItemTemplateData(type);
116
- templatePart.resources = [];
117
- break;
118
- case "Desktop Add In":
119
- break;
120
- case "Desktop Application Template":
121
- break;
122
- case "Document Link":
123
- break;
124
- case "Feature Collection":
125
- break;
126
- case "Feature Service":
127
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url || "{{svc1234567890.itemId}}");
128
- templatePart.item.url = url || "{{svc1234567890.url}}";
129
- templatePart.data = getItemTemplateData(type);
130
- templatePart.resources = [];
131
- templatePart.estimatedDeploymentCostFactor = 10;
132
- const layer0 = getLayerOrTableTemplate(
133
- // removeEditFieldsInfoField(
134
- 0, "ROW Permits", "Feature Layer", [createItemTemplateRelationship(0, 1, "esriRelRoleOrigin")]);
135
- // );
136
- const table1 = getLayerOrTableTemplate(
137
- // removeEditFieldsInfoField(
138
- 1, "ROW Permit Comment", "Table", [createItemTemplateRelationship(0, 1, "esriRelRoleDestination")]);
139
- // );
140
- const properties = {
141
- service: getServiceTemplate(),
142
- layers: [layer0],
143
- tables: [table1]
144
- };
145
- templatePart.properties = properties;
146
- break;
147
- case "Form":
148
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url);
149
- break;
150
- case "Geoprocessing Package":
151
- break;
152
- case "Geoprocessing Sample":
153
- break;
154
- case "Group":
155
- templatePart = getGroupTemplatePart(dependencies);
156
- break;
157
- case "Hub Site Application":
158
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url);
159
- break;
160
- case "Layer Package":
161
- break;
162
- case "Map Template": // // ??? temporary definition
163
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url);
164
- templatePart.resources = [];
165
- break;
166
- case "Notebook":
167
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url);
168
- templatePart.data = getItemTemplateData(type);
169
- templatePart.resources = [];
170
- break;
171
- case "Operation View":
172
- break;
173
- case "Oriented Imagery Catalog":
174
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url);
175
- templatePart.data = getItemTemplateData(type);
176
- templatePart.resources = [];
177
- break;
178
- case "Pro Map":
179
- break;
180
- case "Project Package":
181
- break;
182
- case "Project Template":
183
- break;
184
- case "QuickCapture Project":
185
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url);
186
- templatePart.data = getItemTemplateData(type);
187
- break;
188
- case "Real Time Analytic":
189
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url);
190
- templatePart.data = getItemTemplateData(type);
191
- break;
192
- case "StoryMap":
193
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url || "https://storymaps.arcgis.com/stories/{{sto1234567890.itemId}}");
194
- templatePart.data = getItemTemplateData(type);
195
- templatePart.resources = [];
196
- break;
197
- case "Vector Tile Service":
198
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url ||
199
- "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer");
200
- templatePart.resources = getItemTemplateResources(type, templatePart.itemId);
201
- break;
202
- case "Web Map":
203
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url ||
204
- "{{portalBaseUrl}}/home/webmap/viewer.html?webmap={{map1234567890.itemId}}");
205
- templatePart.data = getItemTemplateData(type);
206
- templatePart.resources = [];
207
- break;
208
- case "Web Mapping Application":
209
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url ||
210
- "{{portalBaseUrl}}/apps/CrowdsourcePolling/index.html?appid={{wma1234567890.itemId}}");
211
- templatePart.data = getItemTemplateData(type);
212
- templatePart.resources = [];
213
- break;
214
- case "Workflow":
215
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url);
216
- break;
217
- case "Workforce Project":
218
- templatePart = getItemTemplateFundamentals(type, getItemTypeAbbrev.getItemTypeAbbrev(type), dependencies, url);
219
- templatePart.data = getItemTemplateData(type);
220
- templatePart.resources = [];
221
- break;
222
- case "Undefined":
223
- templatePart = getItemTemplateFundamentals(type, "und", dependencies, url);
224
- templatePart.data = getItemTemplateData(type);
225
- templatePart.resources = [];
226
- break;
227
- case "Unsupported":
228
- templatePart = getItemTemplateFundamentals(type, "unk", dependencies, url);
229
- templatePart.data = getItemTemplateData(type);
230
- templatePart.resources = [];
231
- break;
232
- default:
233
- fail("Unsupported template item type");
234
- break;
235
- }
236
- return templatePart;
237
- }
238
- export function getDashboardTemplatePartNoWidgets() {
239
- const templatePart = getItemTemplate("Dashboard");
240
- templatePart.data.widgets = [];
241
- return templatePart;
242
- }
243
- export function getTemplatePartNoData(type) {
244
- const templatePart = getItemTemplate(type);
245
- templatePart.data = null;
246
- return templatePart;
247
- }
248
- export function getTemplatePartNoExtent(type) {
249
- const templatePart = getItemTemplate(type);
250
- templatePart.item.extent = null;
251
- return templatePart;
252
- }
253
- export function getFeatureServiceTemplatePartNoRelationships() {
254
- const templatePart = getItemTemplate("Feature Service");
255
- templatePart.properties.layers[0].relationships = [];
256
- templatePart.properties.tables[0].relationships = [];
257
- return templatePart;
258
- }
259
- /* export function getFourItemFeatureServiceTemplatePart(): any {
260
- const templatePart: any = getItemTemplate("Feature Service");
261
-
262
- // Update data section
263
- templatePart.data.layers.push({
264
- id: 2,
265
- popupInfo: {
266
- title: "layer 2"
267
- },
268
- layerDefinition: {
269
- defaultVisibility: true
270
- }
271
- });
272
- templatePart.data.layers.push({
273
- id: 3,
274
- popupInfo: {
275
- title: "layer 3"
276
- },
277
- layerDefinition: {
278
- defaultVisibility: true
279
- }
280
- });
281
-
282
- // Update service properties
283
- const layer2: any = getLayerOrTableTemplate(
284
- // removeEditFieldsInfoField(
285
- 2,
286
- "ROW Permits layer 2",
287
- "Feature Layer"
288
- );
289
- // );
290
- const layer3: any = getLayerOrTableTemplate(
291
- // removeEditFieldsInfoField(
292
- 3,
293
- "ROW Permits layer 3",
294
- "Feature Layer"
295
- );
296
- // );
297
- addCondensedFormOfLayer(
298
- [layer2, layer3],
299
- templatePart.properties.service.layers
300
- );
301
-
302
- // Update layers section
303
- templatePart.properties.layers.push(layer2);
304
- templatePart.properties.layers.push(layer3);
305
-
306
- return templatePart;
307
- } */
308
- export function getGroupTemplatePart(dependencies = []) {
309
- return {
310
- itemId: "grp1234567890",
311
- type: "Group",
312
- key: "i1a2b3c4",
313
- item: {
314
- id: "{{grp1234567890.itemId}}",
315
- title: "An AGOL group",
316
- isInvitationOnly: true,
317
- description: "Description of an AGOL group",
318
- snippet: "Snippet of an AGOL group",
319
- tags: ["JavaScript"],
320
- typeKeywords: [],
321
- phone: null,
322
- sortField: "title",
323
- sortOrder: "asc",
324
- isViewOnly: true,
325
- thumbnail: utils.PORTAL_SUBSET.restUrl +
326
- "/community/groups/grp1234567890/info/ROWPermitManager.png",
327
- access: "public",
328
- capabilities: [],
329
- isFav: false,
330
- isReadOnly: false,
331
- protected: false,
332
- autoJoin: false,
333
- notificationsEnabled: false,
334
- provider: null,
335
- providerGroupName: null,
336
- userMembership: {
337
- username: "casey",
338
- memberType: "none"
339
- },
340
- collaborationInfo: {},
341
- type: "Group"
342
- },
343
- groups: [],
344
- dependencies: dependencies,
345
- estimatedDeploymentCostFactor: 2
346
- };
347
- }
348
- export function getWebMappingApplicationTemplate() {
349
- const template = [
350
- getItemTemplate("Web Mapping Application", ["map1234567890"], "{{portalBaseUrl}}/apps/CrowdsourcePolling/index.html?appid={{wma1234567890.itemId}}"),
351
- getItemTemplate("Web Map", ["svc1234567890"], "{{portalBaseUrl}}/home/webmap/viewer.html?webmap={{map1234567890.itemId}}"),
352
- getItemTemplate("Feature Service")
353
- ];
354
- return template;
355
- }
356
- export function getWebMappingApplicationTemplateGroup() {
357
- const template = [
358
- getItemTemplate("Web Mapping Application", ["map1234567890"], "{{portalBaseUrl}}/apps/CrowdsourcePolling/index.html?appid={{wma1234567890.itemId}}"),
359
- getItemTemplate("Web Map", ["svc1234567890"], "{{portalBaseUrl}}/home/webmap/viewer.html?webmap={{map1234567890.itemId}}"),
360
- getItemTemplate("Feature Service", [])
361
- ];
362
- // Switch from webmap to group
363
- template[0].data.values.group = template[0].data.values.webmap;
364
- delete template[0].data.values.webmap;
365
- // Give the WMA a resource
366
- template[0].resources = [
367
- utils.PORTAL_SUBSET.restUrl +
368
- "/content/items/wma1234567890/resources/anImage.png"
369
- ];
370
- return template;
371
- }
372
- export function getWebMappingApplicationTemplateNoWebmapOrGroup() {
373
- const template = [
374
- getItemTemplate("Web Mapping Application", undefined, "{{portalBaseUrl}}/apps/CrowdsourcePolling/index.html?appid={{wma1234567890.itemId}}")
375
- ];
376
- // Change the dependencies from null to an empty array
377
- template[0].dependencies = [];
378
- // Remove folderId & values.webmap
379
- delete template[0].data.folderId;
380
- delete template[0].data.values.webmap;
381
- return template;
382
- }
383
- // -- Internals ------------------------------------------------------------------------------------------------------//
384
- function createItemTemplateRelationship(id, relatedTableId, role) {
385
- const relationship = {
386
- id: id,
387
- name: "",
388
- relatedTableId: relatedTableId,
389
- cardinality: "esriRelCardinalityOneToMany",
390
- role: role,
391
- "": "globalid",
392
- composite: true
393
- };
394
- relationship.keyField =
395
- role === "esriRelRoleOrigin"
396
- ? "{{svc1234567890.layer" + id + ".fields.globalid.name}}"
397
- : "{{svc1234567890.layer" + relatedTableId + ".fields.globalid.name}}";
398
- return relationship;
399
- }
400
- function getServiceTemplate() {
401
- const service = {
402
- currentVersion: 10.61,
403
- serviceItemId: "{{svc1234567890.itemId}}",
404
- isView: true,
405
- isUpdatableView: true,
406
- sourceSchemaChangesAllowed: true,
407
- serviceDescription: "",
408
- hasVersionedData: false,
409
- supportsDisconnectedEditing: false,
410
- hasStaticData: false,
411
- maxRecordCount: 1000,
412
- supportedQueryFormats: "JSON",
413
- supportsVCSProjection: false,
414
- capabilities: "Create,Query,Editing",
415
- description: "",
416
- copyrightText: "",
417
- spatialReference: {
418
- wkid: 102100,
419
- latestWkid: 3857
420
- },
421
- initialExtent: {
422
- xmin: -14999999.999989873,
423
- ymin: 2699999.9999980442,
424
- xmax: -6199999.9999958146,
425
- ymax: 6499999.99999407,
426
- spatialReference: {
427
- wkid: 102100,
428
- latestWkid: 3857
429
- }
430
- },
431
- fullExtent: {
432
- xmin: -14999999.999989873,
433
- ymin: 2699999.9999980442,
434
- xmax: -6199999.9999958146,
435
- ymax: 6499999.99999407,
436
- spatialReference: {
437
- wkid: 102100,
438
- latestWkid: 3857
439
- }
440
- },
441
- allowGeometryUpdates: true,
442
- units: "esriMeters",
443
- supportsAppend: true,
444
- syncEnabled: false,
445
- supportsApplyEditsWithGlobalIds: true,
446
- editorTrackingInfo: {
447
- enableEditorTracking: true,
448
- enableOwnershipAccessControl: false,
449
- allowOthersToQuery: true,
450
- allowOthersToUpdate: true,
451
- allowOthersToDelete: true,
452
- allowAnonymousToQuery: true,
453
- allowAnonymousToUpdate: true,
454
- allowAnonymousToDelete: true
455
- },
456
- xssPreventionInfo: {
457
- xssPreventionEnabled: true,
458
- xssPreventionRule: "InputOnly",
459
- xssInputRule: "rejectInvalid"
460
- }
461
- };
462
- return service;
463
- }
464
- function getLayerOrTableTemplate(id, name, type, relationships = []) {
465
- return {
466
- currentVersion: 10.61,
467
- id: id,
468
- name: name,
469
- type: type,
470
- serviceItemId: "{{svc1234567890.itemId}}",
471
- isView: true,
472
- isUpdatableView: true,
473
- sourceSchemaChangesAllowed: true,
474
- displayField: "appname",
475
- description: "PermitApplication",
476
- copyrightText: "",
477
- defaultVisibility: true,
478
- editFieldsInfo: {
479
- creationDateField: "CreationDate",
480
- creatorField: "Creator",
481
- editDateField: "EditDate",
482
- editorField: "Editor"
483
- },
484
- editingInfo: {
485
- lastEditDate: 1538579807130
486
- },
487
- fields: [
488
- {
489
- name: "appname",
490
- type: "esriFieldTypeString",
491
- alias: "appname",
492
- sqlType: "sqlTypeOther",
493
- length: 0,
494
- nullable: true,
495
- editable: true,
496
- visible: true,
497
- domain: null,
498
- defaultValue: null
499
- },
500
- {
501
- name: "BoardReview",
502
- type: "esriFieldTypeString",
503
- alias: "Board Review",
504
- sqlType: "sqlTypeOther",
505
- length: 0,
506
- nullable: true,
507
- editable: true,
508
- visible: true,
509
- domain: null,
510
- defaultValue: null
511
- },
512
- {
513
- name: "globalid",
514
- type: "esriFieldTypeGlobalID",
515
- alias: "globalid",
516
- sqlType: "sqlTypeOther",
517
- length: 0,
518
- nullable: false,
519
- editable: true,
520
- visible: true,
521
- domain: null,
522
- defaultValue: null
523
- },
524
- {
525
- name: "CreationDate",
526
- type: "esriFieldTypeDate",
527
- alias: "CreationDate",
528
- sqlType: "sqlTypeOther",
529
- length: 0,
530
- nullable: true,
531
- editable: true,
532
- visible: true,
533
- domain: null,
534
- defaultValue: null
535
- },
536
- {
537
- name: "Creator",
538
- type: "esriFieldTypeString",
539
- alias: "Creator",
540
- sqlType: "sqlTypeOther",
541
- length: 0,
542
- nullable: true,
543
- editable: true,
544
- visible: true,
545
- domain: null,
546
- defaultValue: null
547
- },
548
- {
549
- name: "EditDate",
550
- type: "esriFieldTypeDate",
551
- alias: "EditDate",
552
- sqlType: "sqlTypeOther",
553
- length: 0,
554
- nullable: true,
555
- editable: true,
556
- visible: true,
557
- domain: null,
558
- defaultValue: null
559
- },
560
- {
561
- name: "Editor",
562
- type: "esriFieldTypeString",
563
- alias: "Editor",
564
- sqlType: "sqlTypeOther",
565
- length: 0,
566
- nullable: true,
567
- editable: true,
568
- visible: true,
569
- domain: null,
570
- defaultValue: null
571
- },
572
- {
573
- name: "OBJECTID",
574
- type: "esriFieldTypeOID",
575
- alias: "OBJECTID",
576
- sqlType: "sqlTypeOther",
577
- length: 8,
578
- nullable: false,
579
- editable: false,
580
- visible: true,
581
- domain: null,
582
- defaultValue: null
583
- }
584
- ],
585
- relationships: relationships,
586
- geometryType: "esriGeometryPoint",
587
- minScale: 0,
588
- maxScale: 0,
589
- extent: {
590
- xmin: -14999999.999989873,
591
- ymin: -13315943.826968452,
592
- xmax: 1604565.8194646926,
593
- ymax: 6499999.99999407,
594
- spatialReference: {
595
- wkid: 102100,
596
- latestWkid: 3857
597
- }
598
- },
599
- allowGeometryUpdates: true,
600
- hasAttachments: true,
601
- viewSourceHasAttachments: false,
602
- attachmentProperties: [
603
- {
604
- name: "name",
605
- isEnabled: true
606
- },
607
- {
608
- name: "size",
609
- isEnabled: true
610
- },
611
- {
612
- name: "contentType",
613
- isEnabled: true
614
- },
615
- {
616
- name: "keywords",
617
- isEnabled: true
618
- }
619
- ],
620
- objectIdField: "OBJECTID",
621
- uniqueIdField: {
622
- name: "OBJECTID",
623
- isSystemMaintained: true
624
- },
625
- globalIdField: "globalid",
626
- capabilities: "Create,Query,Editing",
627
- viewDefinitionQuery: "status = '{{svc1234567890.layer" + id + ".fields.boardreview.name}}'",
628
- definitionQuery: "status = 'BoardReview'"
629
- };
630
- }
631
- function getItemTemplateFundamentals(type, typePrefix, dependencies = [], url = "", groups = []) {
632
- return {
633
- itemId: typePrefix + "1234567890",
634
- type: type,
635
- key: "i1a2b3c4",
636
- item: {
637
- id: "{{" + typePrefix + "1234567890.itemId}}",
638
- name: "Name of an AGOL item",
639
- title: "An AGOL item",
640
- type: type,
641
- typeKeywords: ["JavaScript"],
642
- description: "Description of an AGOL item",
643
- tags: ["test"],
644
- snippet: "Snippet of an AGOL item",
645
- thumbnail: utils.PORTAL_SUBSET.restUrl +
646
- "/content/items/" +
647
- typePrefix +
648
- "1234567890/info/thumbnail/ago_downloaded.png",
649
- extent: "{{solutionItemExtent}}",
650
- categories: [],
651
- contentStatus: null,
652
- spatialReference: undefined,
653
- accessInformation: "Esri, Inc.",
654
- licenseInfo: null,
655
- origUrl: url && url.length > 0 ? url : undefined,
656
- properties: null,
657
- culture: "en-us",
658
- url: url,
659
- created: 1520968147000,
660
- modified: 1522178539000
661
- },
662
- data: undefined,
663
- resources: [],
664
- dependencies: dependencies,
665
- relatedItems: [],
666
- groups: groups,
667
- properties: {},
668
- estimatedDeploymentCostFactor: 2
669
- };
670
- }
671
- export function getItemTemplateData(type) {
672
- let data = {
673
- error: {
674
- code: 400,
675
- messageCode: "CONT_0001",
676
- message: "Item does not exist or is inaccessible.",
677
- details: []
678
- }
679
- };
680
- // Supported item types
681
- switch (type) {
682
- case "ArcGIS Pro Add In":
683
- break;
684
- case "Code Attachment":
685
- break;
686
- case "Code Sample":
687
- break;
688
- case "Dashboard":
689
- data = {
690
- version: 24,
691
- layout: {
692
- rootElement: {
693
- type: "stackLayoutElement",
694
- orientation: "col",
695
- elements: []
696
- }
697
- },
698
- headerPanel: {
699
- type: "headerPanel"
700
- },
701
- leftPanel: {
702
- type: "leftPanel",
703
- title: "<p>left panel description</p>\n",
704
- selectors: []
705
- },
706
- widgets: [
707
- {
708
- showNavigation: true,
709
- events: [],
710
- flashRepeats: 3,
711
- itemId: "{{map1234567890.itemId}}",
712
- mapTools: [
713
- {
714
- type: "bookmarksTool"
715
- }
716
- ],
717
- type: "mapWidget",
718
- showPopup: true,
719
- layers: [
720
- {
721
- type: "featureLayerDataSource",
722
- layerId: "ROWPermitApplication_4605",
723
- name: "ROW Permits"
724
- }
725
- ],
726
- id: "1200f3f1-8f72-4ea6-af16-14f19e9a4517",
727
- name: "ROW Permit Map"
728
- },
729
- {
730
- type: "indicatorWidget",
731
- id: "3e796f16-722b-437f-89a4-e3787e105b24",
732
- name: "ROW Permit Count"
733
- },
734
- {
735
- type: "listWidget",
736
- id: "0f994268-e553-4d11-b8d1-afecf0818841",
737
- name: "ROW Permit List"
738
- },
739
- {
740
- type: "serialChartWidget",
741
- id: "ff698ea5-2812-4ba5-a0ba-d89fc302f8f4",
742
- name: "Permit Type"
743
- },
744
- {
745
- type: "serialChartWidget",
746
- id: "d2e11f43-8d61-422c-b7fe-00dc8a9c2b14",
747
- name: "Submission Date"
748
- }
749
- ],
750
- settings: {
751
- maxPaginationRecords: 50000
752
- },
753
- theme: "light"
754
- };
755
- break;
756
- case "Desktop Add In":
757
- break;
758
- case "Desktop Application Template":
759
- break;
760
- case "Document Link":
761
- break;
762
- case "Feature Collection":
763
- break;
764
- case "Feature Service":
765
- data = {
766
- tables: [
767
- {
768
- id: 1,
769
- popupInfo: {
770
- title: "table 1"
771
- }
772
- }
773
- ],
774
- layers: [
775
- {
776
- id: 0,
777
- popupInfo: {
778
- title: "layer 0"
779
- },
780
- layerDefinition: {
781
- defaultVisibility: true
782
- }
783
- }
784
- ]
785
- };
786
- break;
787
- case "Form":
788
- break;
789
- case "Geoprocessing Package":
790
- break;
791
- case "Geoprocessing Sample":
792
- break;
793
- case "Layer Package":
794
- break;
795
- case "Map Template":
796
- break;
797
- case "Notebook":
798
- data = {
799
- metadata: {
800
- kernelspec: {
801
- name: "python3",
802
- display_name: "Python 3",
803
- language: "python"
804
- },
805
- esriNotebookRuntime: {
806
- notebookRuntimeName: "ArcGIS Notebook Python 3 Advanced",
807
- notebookRuntimeVersion: "3.0"
808
- },
809
- language_info: {
810
- name: "python",
811
- version: "3.6.9",
812
- mimetype: "text/x-python",
813
- codemirror_mode: {
814
- name: "ipython",
815
- version: 3
816
- },
817
- pygments_lexer: "ipython3",
818
- nbconvert_exporter: "python",
819
- file_extension: ".py"
820
- }
821
- },
822
- cells: [
823
- {
824
- metadata: {
825
- trusted: true
826
- },
827
- cell_type: "code",
828
- source: "{{3b927de78a784a5aa3981469d85cf45d.itemId}}",
829
- execution_count: null,
830
- outputs: []
831
- }
832
- ],
833
- nbformat: 4,
834
- nbformat_minor: 2
835
- };
836
- break;
837
- case "Operation View":
838
- break;
839
- case "Oriented Imagery Catalog":
840
- data = {
841
- type: "OIC",
842
- version: "1.0",
843
- properties: {
844
- Name: "OIC_002",
845
- Description: "OIC_002",
846
- Tags: "OIC",
847
- ServiceURL: "{{svc1234567890.layer0.url}}",
848
- OverviewURL: "{{svc1234567890.layer0.url}}",
849
- DefaultAttributes: {
850
- CamHeading: "",
851
- CamPitch: "90",
852
- CamRoll: "0",
853
- HFOV: "60",
854
- VFOV: "40",
855
- AvgHtAG: "1.7",
856
- FarDist: "50",
857
- NearDist: "0.1",
858
- OIType: "I",
859
- SortOrder: "",
860
- CamOffset: "",
861
- Accuracy: "",
862
- ImgPyramids: "",
863
- DepthImg: "",
864
- ExternalViewer: "",
865
- ImgRot: ""
866
- },
867
- About: "",
868
- ImageField: "image_",
869
- ImagePrefix: "",
870
- VideoPrefix: "",
871
- DepthImagePrefix: "",
872
- SourceImagePrefix: "",
873
- MaxDistance: "100",
874
- DEMPrefix: "",
875
- Credentials: {
876
- Username: "",
877
- Password: ""
878
- },
879
- Variables: {},
880
- Filters: {},
881
- Copyright: {
882
- text: "",
883
- url: ""
884
- },
885
- PointsSource: "",
886
- CoverageSource: "",
887
- imageField: "Image_"
888
- }
889
- };
890
- break;
891
- case "Pro Map":
892
- break;
893
- case "Project Package":
894
- break;
895
- case "Project Template":
896
- break;
897
- case "StoryMap":
898
- data = {
899
- root: "n-guGGJg",
900
- nodes: {},
901
- resources: {}
902
- };
903
- break;
904
- case "Real Time Analytic":
905
- data = {
906
- id: "aaaaf0cf8bdc4fb19749cc1cbad1651b",
907
- label: type,
908
- description: "",
909
- sources: [
910
- {
911
- id: "40d18a22-9927-97d1-e573-44f197bddfe7",
912
- name: "feature-layer",
913
- label: "Active_Snowplow_Driver",
914
- schemaTransformation: {},
915
- properties: {
916
- "feature-layer.portalItemId": "{{aaaaf0cf8bdc4fb19749cc1cbad1651b.itemId}}",
917
- "feature-layer.outSR": "4326"
918
- }
919
- }
920
- ],
921
- feeds: [
922
- {
923
- id: "{{bbb9398bcf8c4dc5a50cceaa59baf513.itemId}}",
924
- label: "WWO Simulation Provider AVL Feed",
925
- name: "simulator",
926
- properties: {}
927
- },
928
- {
929
- id: "{{ccc6347e0c4f4dc8909da399418cafbe.itemId}}",
930
- label: "WWO Simulation ArcGIS Tracking Feed",
931
- name: "simulator",
932
- properties: {}
933
- }
934
- ],
935
- outputs: [
936
- {
937
- id: "01aacfd0-754d-3ac0-bb8d-aa3814b32fbf",
938
- name: "feat-lyr-new",
939
- label: "Custom Velocity Update",
940
- properties: {
941
- "feat-lyr-new.editorTrackingEnabled": false,
942
- "feat-lyr-new.updateExistingFeatures": true,
943
- "feat-lyr-new.name": "Custom Velocity Update",
944
- "feat-lyr-new.useSpatiotemporal": true
945
- }
946
- }
947
- ]
948
- };
949
- break;
950
- case "Web Map":
951
- data = {
952
- operationalLayers: [
953
- {
954
- id: "ROWPermitApplication_4605",
955
- layerType: "ArcGISFeatureLayer",
956
- url: "{{svc1234567890.layer0.url}}",
957
- title: "ROW Permits",
958
- itemId: "{{svc1234567890.itemId}}",
959
- popupInfo: {},
960
- capabilities: "Query"
961
- }
962
- ],
963
- baseMap: {
964
- baseMapLayers: [
965
- {
966
- id: "World_Hillshade_3689",
967
- layerType: "ArcGISTiledMapServiceLayer",
968
- url: "http://services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",
969
- title: "World Hillshade"
970
- },
971
- {
972
- id: "VectorTile_6451",
973
- type: "VectorTileLayer",
974
- layerType: "VectorTileLayer",
975
- title: "World Topographic Map",
976
- styleUrl: utils.PORTAL_SUBSET.restUrl +
977
- "/content/items/" +
978
- "vts1234567980/resources/styles/root.json",
979
- itemId: "7dc6cea0b1764a1f9af2e679f642f0f5"
980
- }
981
- ],
982
- title: "Topographic"
983
- },
984
- spatialReference: {
985
- wkid: 102100,
986
- latestWkid: 3857
987
- },
988
- tables: [
989
- {
990
- url: "{{svc1234567890.layer1.url}}",
991
- id: "ROWPermitApplication_4404",
992
- title: "ROW Permit Comment",
993
- layerDefinition: {},
994
- itemId: "{{svc1234567890.itemId}}",
995
- popupInfo: {}
996
- }
997
- ]
998
- };
999
- break;
1000
- case "Web Mapping Application":
1001
- data = {
1002
- source: "tpl1234567890",
1003
- folderId: "{{folderId}}",
1004
- values: {
1005
- webmap: "{{map1234567890.itemId}}",
1006
- title: "A web mapping application",
1007
- titleIcon: "images/banner.png",
1008
- displayText: "<b>Welcome</p>",
1009
- featureLayer: {
1010
- id: "ROWPermitApplication_4605",
1011
- fields: [
1012
- {
1013
- id: "sortField",
1014
- fields: ["submitdt"]
1015
- }
1016
- ]
1017
- },
1018
- showAllFeatures: "true",
1019
- customUrlLayer: {
1020
- id: "ROWPermitApplication_4605",
1021
- fields: [
1022
- {
1023
- id: "urlField",
1024
- fields: ["OBJECTID"]
1025
- }
1026
- ]
1027
- },
1028
- customUrlParam: "id"
1029
- }
1030
- };
1031
- break;
1032
- case "Workforce Project":
1033
- data = {
1034
- workerWebMapId: "{{abc116555b16437f8435e079033128d0.itemId}}",
1035
- dispatcherWebMapId: "{{abc26a244163430590151395821fb845.itemId}}",
1036
- dispatchers: {
1037
- serviceItemId: "{{abc302ec12b74d2f9f2b3cc549420086.layer0.itemId}}",
1038
- url: "{{abc302ec12b74d2f9f2b3cc549420086.layer0.url}}"
1039
- },
1040
- assignments: {
1041
- serviceItemId: "{{abc4494043c3459faabcfd0e1ab557fc.layer0.itemId}}",
1042
- url: "{{abc4494043c3459faabcfd0e1ab557fc.layer0.url}}"
1043
- },
1044
- workers: {
1045
- serviceItemId: "{{abc5dd4bdd18437f8d5ff1aa2d25fd7c.layer0.itemId}}",
1046
- url: "{{abc5dd4bdd18437f8d5ff1aa2d25fd7c.layer0.url}}"
1047
- },
1048
- tracks: {
1049
- serviceItemId: "{{abc64329e69144c59f69f3f3e0d45269.layer0.itemId}}",
1050
- url: "{{abc64329e69144c59f69f3f3e0d45269.layer0.url}}",
1051
- enabled: true,
1052
- updateInterval: 300
1053
- },
1054
- version: "1.2.0",
1055
- groupId: "{{abc715c2df2b466da05577776e82d044.itemId}}",
1056
- folderId: "{{folderId}}",
1057
- assignmentIntegrations: [
1058
- {
1059
- id: "default-navigator",
1060
- prompt: "Navigate to Assignment",
1061
- urlTemplate: "arcgis-navigator://?stop=${assignment.latitude},{itemID={{cad3483e025c47338d43df308c117308.itemId}}},${assignment.longitude}&stopname=${assignment.location}&callback=arcgis-workforce://&callbackprompt={itemID={{bad3483e025c47338d43df308c117308.itemId}}}://Workforce",
1062
- assignmentTypes: [
1063
- {
1064
- urlTemplate: "arcgis-navigator://?stop=${assignment.latitude},{itemID={{cad3483e025c47338d43df308c117308.itemId}}},${assignment.longitude}&stopname=${assignment.location}&callback=arcgis-workforce://&callbackprompt={itemID={{bad3483e025c47338d43df308c117308.itemId}}}://Workforce"
1065
- }
1066
- ]
1067
- }
1068
- ]
1069
- };
1070
- break;
1071
- default:
1072
- data = {};
1073
- break;
1074
- }
1075
- return data;
1076
- }
1077
- export function getItemTemplateResources(type, itemId) {
1078
- let resources = [];
1079
- // Supported item types
1080
- switch (type) {
1081
- case "Vector Tile Service":
1082
- resources = [
1083
- itemId + "/info/root.json",
1084
- itemId + "/styles/root.json",
1085
- itemId + "_info_thumbnail/ago_downloaded.png"
1086
- ];
1087
- break;
1088
- }
1089
- return resources;
1090
- }
1091
- export function getItemTemplateResourcesAsSourceFiles(type, itemId) {
1092
- let resources = [];
1093
- // Supported item types
1094
- switch (type) {
1095
- case "Vector Tile Service":
1096
- resources = [{
1097
- itemId,
1098
- file: generalHelpers.jsonToFile(sampleInfoRootJson, "root.json"),
1099
- folder: itemId + "/info",
1100
- filename: "root.json"
1101
- }, {
1102
- itemId,
1103
- file: generalHelpers.jsonToFile(sampleStylesRootJson, "root.json"),
1104
- folder: itemId + "/styles",
1105
- filename: "root.json"
1106
- }, {
1107
- itemId,
1108
- file: utils.getSampleImageAsFile("ago_downloaded.png"),
1109
- folder: "_info_thumbnail",
1110
- filename: "ago_downloaded.png"
1111
- }];
1112
- break;
1113
- }
1114
- return resources;
1115
- }
1116
- export function getItemTemplateResourcesAsTemplatizedFiles(type) {
1117
- let resources = [];
1118
- // Supported item types
1119
- switch (type) {
1120
- case "Vector Tile Service":
1121
- resources = [{
1122
- filename: "root.json",
1123
- folder: "info",
1124
- url: "https://www.arcgis.com/sharing/rest/content/items/sln1234567890/resources/vts1234567890/info/root.json"
1125
- }, {
1126
- filename: "root.json",
1127
- folder: "styles",
1128
- url: "https://www.arcgis.com/sharing/rest/content/items/sln1234567890/resources/vts1234567890/styles/root.json"
1129
- }, {
1130
- filename: "ago_downloaded.png",
1131
- folder: "_info_thumbnail",
1132
- url: "https://www.arcgis.com/sharing/rest/content/items/sln1234567890/resources/vts1234567890/ago_downloaded.png"
1133
- }];
1134
- break;
1135
- }
1136
- return resources;
1137
- }
1138
- export function removeEditFieldsInfoField(layerOrTable) {
1139
- layerOrTable.editFieldsInfo = null;
1140
- return layerOrTable;
1141
- }
1142
- // ------------------------------------------------------------------------------------------------------------------ //
1143
- export const sampleInfoRootJson = {
1144
- "resourceInfo": [
1145
- "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/resources/fonts/Arial%20Regular/0-255.pbf",
1146
- "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/resources/fonts/Arial%20Regular/256-511.pbf",
1147
- "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/resources/fonts/Palatino%20Linotype%20Regular/64512-64767.pbf",
1148
- "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/resources/fonts/Palatino%20Linotype%20Regular/64768-65023.pbf",
1149
- "https://myorg.maps.arcgis.com/sharing/rest/content/items/vts1234567890/resources/sprites/sprite-1682528799750@2x.json",
1150
- "https://myorg.maps.arcgis.com/sharing/rest/content/items/vts1234567890/resources/sprites/sprite-1682528799750@2x.png"
1151
- ]
1152
- };
1153
- export const sampleStylesRootJson = {
1154
- "version": 8,
1155
- "sprite": "https://myorg.maps.arcgis.com/sharing/rest/content/items/vts1234567890/resources/sprites/sprite-1682528799750",
1156
- "glyphs": "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/resources/fonts/{fontstack}/{range}.pbf",
1157
- "sources": {
1158
- "esri": {
1159
- "type": "vector",
1160
- "url": "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer",
1161
- "tiles": [
1162
- "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/tile/{z}/{y}/{x}.pbf"
1163
- ]
1164
- }
1165
- },
1166
- "layers": [],
1167
- "metadata": {}
1168
- };
1169
- export const sampleInfoRootTemplatizedJson = {
1170
- "resourceInfo": [
1171
- "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/resources/fonts/Arial%20Regular/0-255.pbf",
1172
- "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/resources/fonts/Arial%20Regular/256-511.pbf",
1173
- "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/resources/fonts/Palatino%20Linotype%20Regular/64512-64767.pbf",
1174
- "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/resources/fonts/Palatino%20Linotype%20Regular/64768-65023.pbf",
1175
- "{{vts1234567890.url}}/resources/sprites/sprite-1682528799750@2x.json",
1176
- "{{vts1234567890.url}}/resources/sprites/sprite-1682528799750@2x.png"
1177
- ]
1178
- };
1179
- export const sampleStylesRootTemplatizedJson = {
1180
- "version": 8,
1181
- "sprite": "{{vts1234567890.url}}/resources/sprites/sprite-1682528799750",
1182
- "glyphs": "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/resources/fonts/{fontstack}/{range}.pbf",
1183
- "sources": {
1184
- "esri": {
1185
- "type": "vector",
1186
- "url": "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer",
1187
- "tiles": [
1188
- "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_v2/VectorTileServer/tile/{z}/{y}/{x}.pbf"
1189
- ]
1190
- }
1191
- },
1192
- "layers": [],
1193
- "metadata": {}
1194
- };
1195
- //# sourceMappingURL=templates.js.map