-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathcollections.ts
287 lines (274 loc) · 6.28 KB
/
collections.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
const app: string[] = [
"Application",
"City Engine Web Scene",
"CityEngine Web Scene",
"Dashboard",
"Insights Page",
"Insights Workbook",
"Operation View",
"Web Mapping Application",
"StoryMap",
"Web Experience",
"Urban Model",
];
const dataset: string[] = [
"CSV Collection",
"CSV",
"Feature Collection Template",
"Feature Collection",
"Feature Layer",
"Feature Service",
"File Geodatabase",
"GeoJSON",
"GeoJson",
"KML Collection",
"KML",
"Microsoft Excel",
"Raster Layer",
"Shapefile",
"Stream Service",
"Table",
];
const document: string[] = [
"CAD Drawing",
"Document Link",
"Hub Page",
"Site Page",
"Image",
"iWork Keynote",
"iWork Numbers",
"iWork Pages",
"Microsoft Powerpoint",
"Microsoft Visio",
"Microsoft Word",
"Notebook",
"PDF",
"Pro Map",
"Report Template",
];
const event: string[] = ["Hub Event"];
const feedback: string[] = ["Form", "Quick Capture Project"];
const initiative: string[] = ["Hub Initiative"];
const solution: string[] = ["Solution"];
const template: string[] = ["Hub Initiative Template"];
const map: string[] = [
"Image Collection",
"Image Service",
"Map Service Layer",
"Map Service",
"Scene Service",
"Scene Layer",
"Vector Tile Service",
"Web Map Service",
"Web Map Tile Service",
"Web Map",
"Web Scene",
"WFS",
"WMS",
"WMTS",
];
const other: string[] = [
"360 VR Experience",
"3DTiles Package",
"3DTiles Service",
"API Key",
"Activity",
"Addin Package",
"Administrative Report",
"AllSource Project",
"Analysis Model",
"Apache Parquet",
"App Bundle",
"AppBuilder Extension",
"AppBuilder Widget Package",
"Application Configuration",
"Application SDK",
"ArcGIS Pro Add In",
"ArcGIS Pro Configuration",
"ArcPad Package",
"Arcade Module",
"Basemap Package",
"Big Data Analytic",
"Big Data File Share",
"Code Attachment",
"Code Sample",
"Color Set",
"Compact Tile Package",
"Content Category Set",
"Data Package Collection",
"Data Pipeline",
"Data Store",
"Deep Learning Package",
"Deep Learning Studio Project",
"Desktop Add In",
"Desktop Application",
"Desktop Application Template",
"Desktop Style",
"Earth Configuration",
"Esri Classification Schema",
"Esri Classifier Definition",
"Excalibur Imagery Project",
"Experience Builder Widget",
"Experience Builder Widget Package",
"Explorer Add In",
"Explorer Layer",
"Explorer Map",
"Export Package",
"Featured Items",
"Feed",
"GML",
"GeoBIM Application",
"GeoBIM Project",
"GeoPackage",
"Geocoding Service",
"Geodata Service",
"Geoenrichment Service",
"Geometry Service",
"Geoprocessing Package",
"Geoprocessing Sample",
"Geoprocessing Service",
"Globe Document",
"Globe Service",
"Group Layer",
"IPS Configuration",
"Indoors Map Configuration",
"Insights Data Engineering Model",
"Insights Data Engineering Workbook",
"Insights Model",
"Insights Script",
"Insights Theme",
"Insights Workbook Package",
"Kernel Gateway Connection",
"Knowledge Graph",
"Knowledge Graph Layer",
"Knowledge Graph Web Investigation",
"Knowledge Studio Project",
"Layer",
"Layer File",
"Layer Package",
"Layer Template",
"Layout",
"Legend",
"Living Atlas Export Package",
"Locator Package",
"Map Area",
"Map Document",
"Map Package",
"Map Service Definition",
"Map Template",
"Media Layer",
"Mission",
"Mission Report",
"Mission Template",
"Mobile Application",
"Mobile Basemap Package",
"Mobile Map Package",
"Mobile Scene Package",
"Native Application",
"Native Application Installer",
"Native Application Template",
"Network Analysis Service",
"Notebook Code Snippet Library",
"Notebook Code Snippets",
"OGCFeatureServer",
"Operations Dashboard Add In",
"Operations Dashboard Extension",
"Oriented Imagery Catalog",
"Ortho Mapping Project",
"Ortho Mapping Template",
"Pro Presentation",
"Pro Project",
"Pro Report",
"Pro Report Template",
"Project Package",
"Project Template",
"Published Map",
"QuickCapture Project",
"Raster Function Template",
"Real Time Analytic",
"Reality Mapping Project",
"Reality Studio Project",
"Relational Database Connection",
"Replication Package",
"Rule Package",
"SMX Item",
"SMX Map",
"SMX Theme",
"SQLite Geodatabase",
"Scene Document",
"Scene Package",
"Scene Package Part",
"Server",
"Service Definition",
"Statistical Data Collection",
"StoryMap Theme",
"Style",
"Suitability Model",
"Survey123 Add In",
"Symbol Service",
"Symbol Set",
"Task File",
"Tile Package",
"Urban Project",
"User License Type Extension",
"Vector Tile Package",
"Video Service",
"Viewer Configuration",
"Visio Document",
"WCS",
"Web AppBuilder Widget",
"Web Experience Template",
"Web Link Chart",
"Windows Mobile Package",
"Windows Viewer Add In",
"Workflow",
"Workflow Manager Package",
"Workflow Manager Service",
"Workforce Project",
"netCDF",
];
const site: string[] = ["Hub Site Application", "Site Application"];
/**
* Get the Hub collection for a given item type
* @param itemType The ArcGIS [item type](https://developers.arcgis.com/rest/users-groups-and-items/items-and-item-types.htm).
* @returns the Hub collection of a given item type.
* @private
*/
export const getCollection = (type?: string) => {
if (!type) {
return;
}
const lowerCaseType = type.toLocaleLowerCase();
return Object.keys(collections).find((key) => {
const collectionTypes = collections[key];
return collectionTypes.some((t) => t.toLocaleLowerCase() === lowerCaseType);
});
};
/**
* The converse of getCollection, returns associated types of provided collection
* @param collection The Hub collection
* @returns An array of types, or undefined if collection is not found
* @private
*/
export const getCollectionTypes = (collection?: string) => {
if (!collection) {
return;
}
const lowerCaseCollection = collection.toLocaleLowerCase();
return collections[lowerCaseCollection];
};
// TODO: remove this when we remove the deprecated categories
// and then move the above arrays and getCollection() logic to get-family
export const collections: { [key: string]: string[] } = {
app,
dataset,
document,
event,
feedback,
initiative,
template,
solution,
map,
other,
site,
};