@esri/hub-common 11.23.0 → 11.23.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/core/schemas/hubproject.js +3 -0
- package/dist/esm/core/schemas/hubproject.js.map +1 -1
- package/dist/esm/projects/HubProject.js +5 -1
- package/dist/esm/projects/HubProject.js.map +1 -1
- package/dist/esm/projects/_internal.js +43 -0
- package/dist/esm/projects/_internal.js.map +1 -0
- package/dist/esm/projects/edit.js +115 -0
- package/dist/esm/projects/edit.js.map +1 -0
- package/dist/esm/projects/fetch.js +104 -0
- package/dist/esm/projects/fetch.js.map +1 -0
- package/dist/esm/projects/index.js +2 -1
- package/dist/esm/projects/index.js.map +1 -1
- package/dist/esm/util.js +3 -1
- package/dist/esm/util.js.map +1 -1
- package/dist/node/core/schemas/hubproject.js +3 -0
- package/dist/node/core/schemas/hubproject.js.map +1 -1
- package/dist/node/projects/HubProject.js +10 -6
- package/dist/node/projects/HubProject.js.map +1 -1
- package/dist/node/projects/_internal.js +48 -0
- package/dist/node/projects/_internal.js.map +1 -0
- package/dist/node/projects/edit.js +122 -0
- package/dist/node/projects/edit.js.map +1 -0
- package/dist/node/projects/fetch.js +110 -0
- package/dist/node/projects/fetch.js.map +1 -0
- package/dist/node/projects/index.js +2 -1
- package/dist/node/projects/index.js.map +1 -1
- package/dist/node/util.js +3 -1
- package/dist/node/util.js.map +1 -1
- package/dist/types/projects/_internal.d.ts +20 -0
- package/dist/types/projects/{HubProjects.d.ts → edit.d.ts} +1 -29
- package/dist/types/projects/fetch.d.ts +30 -0
- package/dist/types/projects/index.d.ts +2 -1
- package/package.json +1 -1
- package/dist/esm/projects/HubProjects.js +0 -248
- package/dist/esm/projects/HubProjects.js.map +0 -1
- package/dist/node/projects/HubProjects.js +0 -258
- package/dist/node/projects/HubProjects.js.map +0 -1
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
// Note - we separate these imports so we can cleanly spy on things in tests
|
|
2
|
-
import { createModel, fetchModelFromItem, getModel, updateModel, } from "../models";
|
|
3
|
-
import { constructSlug, getItemBySlug, getUniqueSlug, setSlugKeyword, } from "../items/slugs";
|
|
4
|
-
import { isGuid, cloneObject, getItemThumbnailUrl, unique, mapBy, getProp, getFamily, getItemHomeUrl, interpolate, } from "../index";
|
|
5
|
-
import { removeItem, getItem, } from "@esri/arcgis-rest-portal";
|
|
6
|
-
import { PropertyMapper } from "../core/_internal/PropertyMapper";
|
|
7
|
-
import { parseInclude } from "../search/_internal/parseInclude";
|
|
8
|
-
import { fetchItemEnrichments } from "../items/_enrichments";
|
|
9
|
-
import { getHubRelativeUrl } from "../content/_internal";
|
|
10
|
-
import { DEFAULT_PROJECT, DEFAULT_PROJECT_MODEL } from "./defaults";
|
|
11
|
-
import { getBasePropertyMap } from "../core/_internal/getBasePropertyMap";
|
|
12
|
-
import { HubProjectEditUiSchema, HubProjectCreateUiSchema, HubProjectSchema, } from "../core/schemas";
|
|
13
|
-
import { filterSchemaToUiSchema } from "../core/schemas/internal";
|
|
14
|
-
import { applyUiSchemaElementOptions } from "../core/schemas/internal/applyUiSchemaElementOptions";
|
|
15
|
-
/**
|
|
16
|
-
* Returns an Array of IPropertyMap objects
|
|
17
|
-
* that define the projection of properties from a IModel to an IHubProject
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
function getPropertyMap() {
|
|
21
|
-
const map = getBasePropertyMap();
|
|
22
|
-
// Type specific mappings
|
|
23
|
-
map.push({ objectKey: "status", modelKey: "data.status" });
|
|
24
|
-
map.push({ objectKey: "catalog", modelKey: "data.catalog" });
|
|
25
|
-
map.push({ objectKey: "permissions", modelKey: "data.permissions" });
|
|
26
|
-
map.push({ objectKey: "contacts", modelKey: "data.contacts" });
|
|
27
|
-
map.push({ objectKey: "timeline", modelKey: "data.timeline" });
|
|
28
|
-
return map;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* @private
|
|
32
|
-
* Create a new Hub Project item
|
|
33
|
-
*
|
|
34
|
-
* Minimal properties are name and org
|
|
35
|
-
*
|
|
36
|
-
* @param project
|
|
37
|
-
* @param requestOptions
|
|
38
|
-
*/
|
|
39
|
-
export async function createProject(partialProject, requestOptions) {
|
|
40
|
-
// merge incoming with the default
|
|
41
|
-
// this expansion solves the typing somehow
|
|
42
|
-
const project = Object.assign(Object.assign({}, DEFAULT_PROJECT), partialProject);
|
|
43
|
-
// Create a slug from the title if one is not passed in
|
|
44
|
-
if (!project.slug) {
|
|
45
|
-
project.slug = constructSlug(project.name, project.orgUrlKey);
|
|
46
|
-
}
|
|
47
|
-
// Ensure slug is unique
|
|
48
|
-
project.slug = await getUniqueSlug({ slug: project.slug }, requestOptions);
|
|
49
|
-
// add slug to keywords
|
|
50
|
-
project.typeKeywords = setSlugKeyword(project.typeKeywords, project.slug);
|
|
51
|
-
// Map project object onto a default project Model
|
|
52
|
-
const mapper = new PropertyMapper(getPropertyMap());
|
|
53
|
-
// create model from object, using the default model as a starting point
|
|
54
|
-
let model = mapper.objectToModel(project, cloneObject(DEFAULT_PROJECT_MODEL));
|
|
55
|
-
// create the item
|
|
56
|
-
model = await createModel(model, requestOptions);
|
|
57
|
-
// map the model back into a IHubProject
|
|
58
|
-
let newProject = mapper.modelToObject(model, {});
|
|
59
|
-
newProject = computeProps(model, newProject, requestOptions);
|
|
60
|
-
// and return it
|
|
61
|
-
return newProject;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* @private
|
|
65
|
-
* Update a Hub Project
|
|
66
|
-
* @param project
|
|
67
|
-
* @param requestOptions
|
|
68
|
-
*/
|
|
69
|
-
export async function updateProject(project, requestOptions) {
|
|
70
|
-
// verify that the slug is unique, excluding the current project
|
|
71
|
-
project.slug = await getUniqueSlug({ slug: project.slug, existingId: project.id }, requestOptions);
|
|
72
|
-
// get the backing item & data
|
|
73
|
-
const model = await getModel(project.id, requestOptions);
|
|
74
|
-
// create the PropertyMapper
|
|
75
|
-
const mapper = new PropertyMapper(getPropertyMap());
|
|
76
|
-
// Note: Although we are fetching the model, and applying changes onto it,
|
|
77
|
-
// we are not attempting to handle "concurrent edit" conflict resolution
|
|
78
|
-
// but this is where we would apply that sort of logic
|
|
79
|
-
const modelToUpdate = mapper.objectToModel(project, model);
|
|
80
|
-
// update the backing item
|
|
81
|
-
const updatedModel = await updateModel(modelToUpdate, requestOptions);
|
|
82
|
-
// now map back into a project and return that
|
|
83
|
-
let updatedProject = mapper.modelToObject(updatedModel, project);
|
|
84
|
-
updatedProject = computeProps(model, updatedProject, requestOptions);
|
|
85
|
-
// the casting is needed because modelToObject returns a `Partial<T>`
|
|
86
|
-
// where as this function returns a `T`
|
|
87
|
-
return updatedProject;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* @private
|
|
91
|
-
* Get a Hub Project by id or slug
|
|
92
|
-
* @param identifier item id or slug
|
|
93
|
-
* @param requestOptions
|
|
94
|
-
*/
|
|
95
|
-
export function fetchProject(identifier, requestOptions) {
|
|
96
|
-
let getPrms;
|
|
97
|
-
if (isGuid(identifier)) {
|
|
98
|
-
// get item by id
|
|
99
|
-
getPrms = getItem(identifier, requestOptions);
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
getPrms = getItemBySlug(identifier, requestOptions);
|
|
103
|
-
}
|
|
104
|
-
return getPrms.then((item) => {
|
|
105
|
-
if (!item)
|
|
106
|
-
return null;
|
|
107
|
-
return convertItemToProject(item, requestOptions);
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* @private
|
|
112
|
-
* Remove a Hub Project
|
|
113
|
-
* @param id
|
|
114
|
-
* @param requestOptions
|
|
115
|
-
*/
|
|
116
|
-
export async function deleteProject(id, requestOptions) {
|
|
117
|
-
const ro = Object.assign(Object.assign({}, requestOptions), { id });
|
|
118
|
-
await removeItem(ro);
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* @private
|
|
123
|
-
* Convert an Hub Project Item into a Hub Project, fetching any additional
|
|
124
|
-
* information that may be required
|
|
125
|
-
* @param item
|
|
126
|
-
* @param auth
|
|
127
|
-
* @returns
|
|
128
|
-
*/
|
|
129
|
-
export async function convertItemToProject(item, requestOptions) {
|
|
130
|
-
const model = await fetchModelFromItem(item, requestOptions);
|
|
131
|
-
// TODO: In the future we will handle the boundary fetching from resource
|
|
132
|
-
const mapper = new PropertyMapper(getPropertyMap());
|
|
133
|
-
const prj = mapper.modelToObject(model, {});
|
|
134
|
-
return computeProps(model, prj, requestOptions);
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Given a model and a project, set various computed properties that can't be directly mapped
|
|
138
|
-
* @param model
|
|
139
|
-
* @param project
|
|
140
|
-
* @param requestOptions
|
|
141
|
-
* @returns
|
|
142
|
-
*/
|
|
143
|
-
function computeProps(model, project, requestOptions) {
|
|
144
|
-
let token;
|
|
145
|
-
if (requestOptions.authentication) {
|
|
146
|
-
const session = requestOptions.authentication;
|
|
147
|
-
token = session.token;
|
|
148
|
-
}
|
|
149
|
-
// thumbnail url
|
|
150
|
-
project.thumbnailUrl = getItemThumbnailUrl(model.item, requestOptions, token);
|
|
151
|
-
// Handle Dates
|
|
152
|
-
project.createdDate = new Date(model.item.created);
|
|
153
|
-
project.createdDateSource = "item.created";
|
|
154
|
-
project.updatedDate = new Date(model.item.modified);
|
|
155
|
-
project.updatedDateSource = "item.modified";
|
|
156
|
-
// cast b/c this takes a partial but returns a full project
|
|
157
|
-
return project;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* @private
|
|
161
|
-
* Fetch project specific enrichments
|
|
162
|
-
* @param item
|
|
163
|
-
* @param include
|
|
164
|
-
* @param requestOptions
|
|
165
|
-
* @returns
|
|
166
|
-
*/
|
|
167
|
-
export async function enrichProjectSearchResult(item, include, requestOptions) {
|
|
168
|
-
// Create the basic structure
|
|
169
|
-
const result = {
|
|
170
|
-
access: item.access,
|
|
171
|
-
id: item.id,
|
|
172
|
-
type: item.type,
|
|
173
|
-
name: item.title,
|
|
174
|
-
owner: item.owner,
|
|
175
|
-
typeKeywords: item.typeKeywords,
|
|
176
|
-
tags: item.tags,
|
|
177
|
-
categories: item.categories,
|
|
178
|
-
summary: item.snippet || item.description,
|
|
179
|
-
createdDate: new Date(item.created),
|
|
180
|
-
createdDateSource: "item.created",
|
|
181
|
-
updatedDate: new Date(item.modified),
|
|
182
|
-
updatedDateSource: "item.modified",
|
|
183
|
-
family: getFamily(item.type),
|
|
184
|
-
links: {
|
|
185
|
-
self: "not-implemented",
|
|
186
|
-
siteRelative: "not-implemented",
|
|
187
|
-
thumbnail: "not-implemented",
|
|
188
|
-
},
|
|
189
|
-
};
|
|
190
|
-
// default includes
|
|
191
|
-
const DEFAULTS = [];
|
|
192
|
-
// merge includes
|
|
193
|
-
include = [...DEFAULTS, ...include].filter(unique);
|
|
194
|
-
// Parse the includes into a valid set of enrichments
|
|
195
|
-
const specs = include.map(parseInclude);
|
|
196
|
-
// Extract out the low-level enrichments needed
|
|
197
|
-
const enrichments = mapBy("enrichment", specs).filter(unique);
|
|
198
|
-
// fetch the enrichments
|
|
199
|
-
let enriched = {};
|
|
200
|
-
if (enrichments.length) {
|
|
201
|
-
// TODO: Look into caching for the requests in fetchItemEnrichments
|
|
202
|
-
enriched = await fetchItemEnrichments(item, enrichments, requestOptions);
|
|
203
|
-
}
|
|
204
|
-
// map the enriched props onto the result
|
|
205
|
-
specs.forEach((spec) => {
|
|
206
|
-
result[spec.prop] = getProp(enriched, spec.path);
|
|
207
|
-
});
|
|
208
|
-
// Handle links
|
|
209
|
-
// TODO: Link handling should be an enrichment
|
|
210
|
-
result.links.thumbnail = getItemThumbnailUrl(item, requestOptions);
|
|
211
|
-
result.links.self = getItemHomeUrl(result.id, requestOptions);
|
|
212
|
-
result.links.siteRelative = getHubRelativeUrl(result.type, result.id, item.typeKeywords);
|
|
213
|
-
return result;
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Get the editor config for for the HubProject entity.
|
|
217
|
-
* @param i18nScope Translation scope to be interpolated into the schemas
|
|
218
|
-
* @param type
|
|
219
|
-
* @param options Optional hash of Element component options
|
|
220
|
-
* @returns
|
|
221
|
-
*/
|
|
222
|
-
export async function getHubProjectEditorConfig(i18nScope, type, options = []) {
|
|
223
|
-
// schema is always the entire schema
|
|
224
|
-
let schema = cloneObject(HubProjectSchema);
|
|
225
|
-
// uiSchema is the complete (edit) schema, unless otherwise specified
|
|
226
|
-
let uiSchema = cloneObject(HubProjectEditUiSchema);
|
|
227
|
-
// by default we don't need to filter the schema b/c it's the entire schema
|
|
228
|
-
let filterSchema = false;
|
|
229
|
-
// if another schema is requested, we need to use that UI schema
|
|
230
|
-
// and the subset the overall schema down to just the properties
|
|
231
|
-
// used in the UI schema
|
|
232
|
-
switch (type) {
|
|
233
|
-
case "create":
|
|
234
|
-
uiSchema = cloneObject(HubProjectCreateUiSchema);
|
|
235
|
-
filterSchema = true;
|
|
236
|
-
break;
|
|
237
|
-
}
|
|
238
|
-
if (filterSchema) {
|
|
239
|
-
// filter out properties not used in the UI schema
|
|
240
|
-
schema = filterSchemaToUiSchema(schema, uiSchema);
|
|
241
|
-
}
|
|
242
|
-
// interpolate the i18n scope into the uiSchema
|
|
243
|
-
uiSchema = interpolate(uiSchema, { i18nScope });
|
|
244
|
-
// apply the options
|
|
245
|
-
uiSchema = applyUiSchemaElementOptions(uiSchema, options);
|
|
246
|
-
return Promise.resolve({ schema, uiSchema });
|
|
247
|
-
}
|
|
248
|
-
//# sourceMappingURL=HubProjects.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HubProjects.js","sourceRoot":"","sources":["../../../src/projects/HubProjects.ts"],"names":[],"mappings":"AAEA,4EAA4E;AAC5E,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,QAAQ,EACR,WAAW,GACZ,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,cAAc,GAC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IAAI,EAAE;QACZ,KAAK,QAAQ;YACX,QAAQ,GAAG,WAAW,CAAC,wBAAwB,CAAC,CAAC;YACjD,YAAY,GAAG,IAAI,CAAC;YACpB,MAAM;KACT;IAED,IAAI,YAAY,EAAE;QAChB,kDAAkD;QAClD,MAAM,GAAG,sBAAsB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KACnD;IAED,+CAA+C;IAC/C,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;IAChD,oBAAoB;IACpB,QAAQ,GAAG,2BAA2B,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAE1D,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHubProjectEditorConfig = exports.enrichProjectSearchResult = exports.convertItemToProject = exports.deleteProject = exports.fetchProject = exports.updateProject = exports.createProject = void 0;
|
|
4
|
-
// Note - we separate these imports so we can cleanly spy on things in tests
|
|
5
|
-
const models_1 = require("../models");
|
|
6
|
-
const slugs_1 = require("../items/slugs");
|
|
7
|
-
const index_1 = require("../index");
|
|
8
|
-
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
9
|
-
const PropertyMapper_1 = require("../core/_internal/PropertyMapper");
|
|
10
|
-
const parseInclude_1 = require("../search/_internal/parseInclude");
|
|
11
|
-
const _enrichments_1 = require("../items/_enrichments");
|
|
12
|
-
const _internal_1 = require("../content/_internal");
|
|
13
|
-
const defaults_1 = require("./defaults");
|
|
14
|
-
const getBasePropertyMap_1 = require("../core/_internal/getBasePropertyMap");
|
|
15
|
-
const schemas_1 = require("../core/schemas");
|
|
16
|
-
const internal_1 = require("../core/schemas/internal");
|
|
17
|
-
const applyUiSchemaElementOptions_1 = require("../core/schemas/internal/applyUiSchemaElementOptions");
|
|
18
|
-
/**
|
|
19
|
-
* Returns an Array of IPropertyMap objects
|
|
20
|
-
* that define the projection of properties from a IModel to an IHubProject
|
|
21
|
-
* @returns
|
|
22
|
-
*/
|
|
23
|
-
function getPropertyMap() {
|
|
24
|
-
const map = getBasePropertyMap_1.getBasePropertyMap();
|
|
25
|
-
// Type specific mappings
|
|
26
|
-
map.push({ objectKey: "status", modelKey: "data.status" });
|
|
27
|
-
map.push({ objectKey: "catalog", modelKey: "data.catalog" });
|
|
28
|
-
map.push({ objectKey: "permissions", modelKey: "data.permissions" });
|
|
29
|
-
map.push({ objectKey: "contacts", modelKey: "data.contacts" });
|
|
30
|
-
map.push({ objectKey: "timeline", modelKey: "data.timeline" });
|
|
31
|
-
return map;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @private
|
|
35
|
-
* Create a new Hub Project item
|
|
36
|
-
*
|
|
37
|
-
* Minimal properties are name and org
|
|
38
|
-
*
|
|
39
|
-
* @param project
|
|
40
|
-
* @param requestOptions
|
|
41
|
-
*/
|
|
42
|
-
async function createProject(partialProject, requestOptions) {
|
|
43
|
-
// merge incoming with the default
|
|
44
|
-
// this expansion solves the typing somehow
|
|
45
|
-
const project = Object.assign(Object.assign({}, defaults_1.DEFAULT_PROJECT), partialProject);
|
|
46
|
-
// Create a slug from the title if one is not passed in
|
|
47
|
-
if (!project.slug) {
|
|
48
|
-
project.slug = slugs_1.constructSlug(project.name, project.orgUrlKey);
|
|
49
|
-
}
|
|
50
|
-
// Ensure slug is unique
|
|
51
|
-
project.slug = await slugs_1.getUniqueSlug({ slug: project.slug }, requestOptions);
|
|
52
|
-
// add slug to keywords
|
|
53
|
-
project.typeKeywords = slugs_1.setSlugKeyword(project.typeKeywords, project.slug);
|
|
54
|
-
// Map project object onto a default project Model
|
|
55
|
-
const mapper = new PropertyMapper_1.PropertyMapper(getPropertyMap());
|
|
56
|
-
// create model from object, using the default model as a starting point
|
|
57
|
-
let model = mapper.objectToModel(project, index_1.cloneObject(defaults_1.DEFAULT_PROJECT_MODEL));
|
|
58
|
-
// create the item
|
|
59
|
-
model = await models_1.createModel(model, requestOptions);
|
|
60
|
-
// map the model back into a IHubProject
|
|
61
|
-
let newProject = mapper.modelToObject(model, {});
|
|
62
|
-
newProject = computeProps(model, newProject, requestOptions);
|
|
63
|
-
// and return it
|
|
64
|
-
return newProject;
|
|
65
|
-
}
|
|
66
|
-
exports.createProject = createProject;
|
|
67
|
-
/**
|
|
68
|
-
* @private
|
|
69
|
-
* Update a Hub Project
|
|
70
|
-
* @param project
|
|
71
|
-
* @param requestOptions
|
|
72
|
-
*/
|
|
73
|
-
async function updateProject(project, requestOptions) {
|
|
74
|
-
// verify that the slug is unique, excluding the current project
|
|
75
|
-
project.slug = await slugs_1.getUniqueSlug({ slug: project.slug, existingId: project.id }, requestOptions);
|
|
76
|
-
// get the backing item & data
|
|
77
|
-
const model = await models_1.getModel(project.id, requestOptions);
|
|
78
|
-
// create the PropertyMapper
|
|
79
|
-
const mapper = new PropertyMapper_1.PropertyMapper(getPropertyMap());
|
|
80
|
-
// Note: Although we are fetching the model, and applying changes onto it,
|
|
81
|
-
// we are not attempting to handle "concurrent edit" conflict resolution
|
|
82
|
-
// but this is where we would apply that sort of logic
|
|
83
|
-
const modelToUpdate = mapper.objectToModel(project, model);
|
|
84
|
-
// update the backing item
|
|
85
|
-
const updatedModel = await models_1.updateModel(modelToUpdate, requestOptions);
|
|
86
|
-
// now map back into a project and return that
|
|
87
|
-
let updatedProject = mapper.modelToObject(updatedModel, project);
|
|
88
|
-
updatedProject = computeProps(model, updatedProject, requestOptions);
|
|
89
|
-
// the casting is needed because modelToObject returns a `Partial<T>`
|
|
90
|
-
// where as this function returns a `T`
|
|
91
|
-
return updatedProject;
|
|
92
|
-
}
|
|
93
|
-
exports.updateProject = updateProject;
|
|
94
|
-
/**
|
|
95
|
-
* @private
|
|
96
|
-
* Get a Hub Project by id or slug
|
|
97
|
-
* @param identifier item id or slug
|
|
98
|
-
* @param requestOptions
|
|
99
|
-
*/
|
|
100
|
-
function fetchProject(identifier, requestOptions) {
|
|
101
|
-
let getPrms;
|
|
102
|
-
if (index_1.isGuid(identifier)) {
|
|
103
|
-
// get item by id
|
|
104
|
-
getPrms = arcgis_rest_portal_1.getItem(identifier, requestOptions);
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
getPrms = slugs_1.getItemBySlug(identifier, requestOptions);
|
|
108
|
-
}
|
|
109
|
-
return getPrms.then((item) => {
|
|
110
|
-
if (!item)
|
|
111
|
-
return null;
|
|
112
|
-
return convertItemToProject(item, requestOptions);
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
exports.fetchProject = fetchProject;
|
|
116
|
-
/**
|
|
117
|
-
* @private
|
|
118
|
-
* Remove a Hub Project
|
|
119
|
-
* @param id
|
|
120
|
-
* @param requestOptions
|
|
121
|
-
*/
|
|
122
|
-
async function deleteProject(id, requestOptions) {
|
|
123
|
-
const ro = Object.assign(Object.assign({}, requestOptions), { id });
|
|
124
|
-
await arcgis_rest_portal_1.removeItem(ro);
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
exports.deleteProject = deleteProject;
|
|
128
|
-
/**
|
|
129
|
-
* @private
|
|
130
|
-
* Convert an Hub Project Item into a Hub Project, fetching any additional
|
|
131
|
-
* information that may be required
|
|
132
|
-
* @param item
|
|
133
|
-
* @param auth
|
|
134
|
-
* @returns
|
|
135
|
-
*/
|
|
136
|
-
async function convertItemToProject(item, requestOptions) {
|
|
137
|
-
const model = await models_1.fetchModelFromItem(item, requestOptions);
|
|
138
|
-
// TODO: In the future we will handle the boundary fetching from resource
|
|
139
|
-
const mapper = new PropertyMapper_1.PropertyMapper(getPropertyMap());
|
|
140
|
-
const prj = mapper.modelToObject(model, {});
|
|
141
|
-
return computeProps(model, prj, requestOptions);
|
|
142
|
-
}
|
|
143
|
-
exports.convertItemToProject = convertItemToProject;
|
|
144
|
-
/**
|
|
145
|
-
* Given a model and a project, set various computed properties that can't be directly mapped
|
|
146
|
-
* @param model
|
|
147
|
-
* @param project
|
|
148
|
-
* @param requestOptions
|
|
149
|
-
* @returns
|
|
150
|
-
*/
|
|
151
|
-
function computeProps(model, project, requestOptions) {
|
|
152
|
-
let token;
|
|
153
|
-
if (requestOptions.authentication) {
|
|
154
|
-
const session = requestOptions.authentication;
|
|
155
|
-
token = session.token;
|
|
156
|
-
}
|
|
157
|
-
// thumbnail url
|
|
158
|
-
project.thumbnailUrl = index_1.getItemThumbnailUrl(model.item, requestOptions, token);
|
|
159
|
-
// Handle Dates
|
|
160
|
-
project.createdDate = new Date(model.item.created);
|
|
161
|
-
project.createdDateSource = "item.created";
|
|
162
|
-
project.updatedDate = new Date(model.item.modified);
|
|
163
|
-
project.updatedDateSource = "item.modified";
|
|
164
|
-
// cast b/c this takes a partial but returns a full project
|
|
165
|
-
return project;
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* @private
|
|
169
|
-
* Fetch project specific enrichments
|
|
170
|
-
* @param item
|
|
171
|
-
* @param include
|
|
172
|
-
* @param requestOptions
|
|
173
|
-
* @returns
|
|
174
|
-
*/
|
|
175
|
-
async function enrichProjectSearchResult(item, include, requestOptions) {
|
|
176
|
-
// Create the basic structure
|
|
177
|
-
const result = {
|
|
178
|
-
access: item.access,
|
|
179
|
-
id: item.id,
|
|
180
|
-
type: item.type,
|
|
181
|
-
name: item.title,
|
|
182
|
-
owner: item.owner,
|
|
183
|
-
typeKeywords: item.typeKeywords,
|
|
184
|
-
tags: item.tags,
|
|
185
|
-
categories: item.categories,
|
|
186
|
-
summary: item.snippet || item.description,
|
|
187
|
-
createdDate: new Date(item.created),
|
|
188
|
-
createdDateSource: "item.created",
|
|
189
|
-
updatedDate: new Date(item.modified),
|
|
190
|
-
updatedDateSource: "item.modified",
|
|
191
|
-
family: index_1.getFamily(item.type),
|
|
192
|
-
links: {
|
|
193
|
-
self: "not-implemented",
|
|
194
|
-
siteRelative: "not-implemented",
|
|
195
|
-
thumbnail: "not-implemented",
|
|
196
|
-
},
|
|
197
|
-
};
|
|
198
|
-
// default includes
|
|
199
|
-
const DEFAULTS = [];
|
|
200
|
-
// merge includes
|
|
201
|
-
include = [...DEFAULTS, ...include].filter(index_1.unique);
|
|
202
|
-
// Parse the includes into a valid set of enrichments
|
|
203
|
-
const specs = include.map(parseInclude_1.parseInclude);
|
|
204
|
-
// Extract out the low-level enrichments needed
|
|
205
|
-
const enrichments = index_1.mapBy("enrichment", specs).filter(index_1.unique);
|
|
206
|
-
// fetch the enrichments
|
|
207
|
-
let enriched = {};
|
|
208
|
-
if (enrichments.length) {
|
|
209
|
-
// TODO: Look into caching for the requests in fetchItemEnrichments
|
|
210
|
-
enriched = await _enrichments_1.fetchItemEnrichments(item, enrichments, requestOptions);
|
|
211
|
-
}
|
|
212
|
-
// map the enriched props onto the result
|
|
213
|
-
specs.forEach((spec) => {
|
|
214
|
-
result[spec.prop] = index_1.getProp(enriched, spec.path);
|
|
215
|
-
});
|
|
216
|
-
// Handle links
|
|
217
|
-
// TODO: Link handling should be an enrichment
|
|
218
|
-
result.links.thumbnail = index_1.getItemThumbnailUrl(item, requestOptions);
|
|
219
|
-
result.links.self = index_1.getItemHomeUrl(result.id, requestOptions);
|
|
220
|
-
result.links.siteRelative = _internal_1.getHubRelativeUrl(result.type, result.id, item.typeKeywords);
|
|
221
|
-
return result;
|
|
222
|
-
}
|
|
223
|
-
exports.enrichProjectSearchResult = enrichProjectSearchResult;
|
|
224
|
-
/**
|
|
225
|
-
* Get the editor config for for the HubProject entity.
|
|
226
|
-
* @param i18nScope Translation scope to be interpolated into the schemas
|
|
227
|
-
* @param type
|
|
228
|
-
* @param options Optional hash of Element component options
|
|
229
|
-
* @returns
|
|
230
|
-
*/
|
|
231
|
-
async function getHubProjectEditorConfig(i18nScope, type, options = []) {
|
|
232
|
-
// schema is always the entire schema
|
|
233
|
-
let schema = index_1.cloneObject(schemas_1.HubProjectSchema);
|
|
234
|
-
// uiSchema is the complete (edit) schema, unless otherwise specified
|
|
235
|
-
let uiSchema = index_1.cloneObject(schemas_1.HubProjectEditUiSchema);
|
|
236
|
-
// by default we don't need to filter the schema b/c it's the entire schema
|
|
237
|
-
let filterSchema = false;
|
|
238
|
-
// if another schema is requested, we need to use that UI schema
|
|
239
|
-
// and the subset the overall schema down to just the properties
|
|
240
|
-
// used in the UI schema
|
|
241
|
-
switch (type) {
|
|
242
|
-
case "create":
|
|
243
|
-
uiSchema = index_1.cloneObject(schemas_1.HubProjectCreateUiSchema);
|
|
244
|
-
filterSchema = true;
|
|
245
|
-
break;
|
|
246
|
-
}
|
|
247
|
-
if (filterSchema) {
|
|
248
|
-
// filter out properties not used in the UI schema
|
|
249
|
-
schema = internal_1.filterSchemaToUiSchema(schema, uiSchema);
|
|
250
|
-
}
|
|
251
|
-
// interpolate the i18n scope into the uiSchema
|
|
252
|
-
uiSchema = index_1.interpolate(uiSchema, { i18nScope });
|
|
253
|
-
// apply the options
|
|
254
|
-
uiSchema = applyUiSchemaElementOptions_1.applyUiSchemaElementOptions(uiSchema, options);
|
|
255
|
-
return Promise.resolve({ schema, uiSchema });
|
|
256
|
-
}
|
|
257
|
-
exports.getHubProjectEditorConfig = getHubProjectEditorConfig;
|
|
258
|
-
//# sourceMappingURL=HubProjects.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HubProjects.js","sourceRoot":"","sources":["../../../src/projects/HubProjects.ts"],"names":[],"mappings":";;;AAEA,4EAA4E;AAC5E,sCAKmB;AACnB,0CAKwB;AACxB,oCAgBkB;AAClB,iEAKkC;AAGlC,qEAAgF;AAGhF,mEAAgE;AAChE,wDAA6D;AAC7D,oDAAyD;AACzD,yCAAoE;AACpE,6EAA0E;AAC1E,6CAIyB;AACzB,uDAAkE;AAClE,sGAAmG;AAEnG;;;;GAIG;AACH,SAAS,cAAc;IACrB,MAAM,GAAG,GAAG,uCAAkB,EAAE,CAAC;IAEjC,yBAAyB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