@esri/hub-common 12.5.0 → 12.5.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/ArcGISContext.js +1 -1
- package/dist/esm/ArcGISContext.js.map +1 -1
- package/dist/esm/capabilities/checkCapability.js +6 -1
- package/dist/esm/capabilities/checkCapability.js.map +1 -1
- package/dist/esm/content/_fetch.js.map +1 -1
- package/dist/esm/content/compose.js.map +1 -1
- package/dist/esm/core/_internal/deepContains.js +2 -2
- package/dist/esm/core/_internal/deepContains.js.map +1 -1
- package/dist/esm/core/fetchHubEntity.js +3 -3
- package/dist/esm/core/fetchHubEntity.js.map +1 -1
- package/dist/esm/core/getTypeFromEntity.js +2 -0
- package/dist/esm/core/getTypeFromEntity.js.map +1 -1
- package/dist/esm/core/types/IHubProject.js.map +1 -1
- package/dist/esm/initiatives/HubInitiative.js.map +1 -1
- package/dist/esm/initiatives/HubInitiatives.js.map +1 -1
- package/dist/esm/initiatives/index.js +1 -1
- package/dist/esm/initiatives/index.js.map +1 -1
- package/dist/esm/projects/HubProject.js.map +1 -1
- package/dist/esm/projects/edit.js +2 -1
- package/dist/esm/projects/edit.js.map +1 -1
- package/dist/esm/projects/fetch.js +7 -4
- package/dist/esm/projects/fetch.js.map +1 -1
- package/dist/esm/search/wellKnownCatalog.js +3 -5
- package/dist/esm/search/wellKnownCatalog.js.map +1 -1
- package/dist/esm/sites/HubSites.js +15 -2
- package/dist/esm/sites/HubSites.js.map +1 -1
- package/dist/node/ArcGISContext.js +5 -5
- package/dist/node/ArcGISContext.js.map +1 -1
- package/dist/node/capabilities/checkCapability.js +7 -2
- package/dist/node/capabilities/checkCapability.js.map +1 -1
- package/dist/node/content/_fetch.js.map +1 -1
- package/dist/node/content/compose.js.map +1 -1
- package/dist/node/core/_internal/deepContains.js +5 -5
- package/dist/node/core/_internal/deepContains.js.map +1 -1
- package/dist/node/core/fetchHubEntity.js +6 -6
- package/dist/node/core/fetchHubEntity.js.map +1 -1
- package/dist/node/core/getTypeFromEntity.js +2 -0
- package/dist/node/core/getTypeFromEntity.js.map +1 -1
- package/dist/node/core/types/IHubProject.js.map +1 -1
- package/dist/node/initiatives/HubInitiative.js.map +1 -1
- package/dist/node/initiatives/HubInitiatives.js.map +1 -1
- package/dist/node/initiatives/index.js +1 -1
- package/dist/node/initiatives/index.js.map +1 -1
- package/dist/node/projects/HubProject.js.map +1 -1
- package/dist/node/projects/edit.js +7 -6
- package/dist/node/projects/edit.js.map +1 -1
- package/dist/node/projects/fetch.js +12 -9
- package/dist/node/projects/fetch.js.map +1 -1
- package/dist/node/search/wellKnownCatalog.js +4 -5
- package/dist/node/search/wellKnownCatalog.js.map +1 -1
- package/dist/node/sites/HubSites.js +41 -28
- package/dist/node/sites/HubSites.js.map +1 -1
- package/dist/types/ArcGISContext.d.ts +2 -1
- package/dist/types/capabilities/checkCapability.d.ts +1 -1
- package/dist/types/content/_fetch.d.ts +2 -7
- package/dist/types/content/_internal.d.ts +6 -6
- package/dist/types/content/compose.d.ts +7 -2
- package/dist/types/core/getTypeFromEntity.d.ts +1 -2
- package/dist/types/core/types/IHubProject.d.ts +2 -1
- package/dist/types/initiatives/HubInitiative.d.ts +2 -2
- package/dist/types/initiatives/index.d.ts +1 -1
- package/dist/types/projects/HubProject.d.ts +2 -2
- package/dist/types/projects/edit.d.ts +2 -1
- package/dist/types/projects/fetch.d.ts +1 -1
- package/dist/types/search/wellKnownCatalog.d.ts +8 -0
- package/dist/types/sites/HubSites.d.ts +3 -1
- package/package.json +1 -1
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.enrichSiteSearchResult = exports.convertItemToSite = exports.convertModelToSite = exports.fetchSite = exports.deleteSite = exports.destroySite = exports.updateSite = exports.createSite = exports.ENTERPRISE_SITE_ITEM_TYPE = exports.HUB_SITE_ITEM_TYPE = void 0;
|
|
4
4
|
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
5
|
-
const
|
|
6
|
-
// having a separate import is important for testing
|
|
5
|
+
const get_family_1 = require("../content/get-family");
|
|
7
6
|
const fetchSiteModel_1 = require("./fetchSiteModel");
|
|
8
7
|
const PropertyMapper_1 = require("../core/_internal/PropertyMapper");
|
|
9
8
|
const _internal_1 = require("./_internal");
|
|
@@ -13,6 +12,20 @@ const _internal_2 = require("../content/_internal");
|
|
|
13
12
|
const applyPermissionMigration_1 = require("./_internal/applyPermissionMigration");
|
|
14
13
|
const computeProps_1 = require("./_internal/computeProps");
|
|
15
14
|
const getPropertyMap_1 = require("./_internal/getPropertyMap");
|
|
15
|
+
const slugs_1 = require("../items/slugs");
|
|
16
|
+
const slugify_1 = require("../utils/slugify");
|
|
17
|
+
const ensure_unique_domain_name_1 = require("./domains/ensure-unique-domain-name");
|
|
18
|
+
const strip_protocol_1 = require("../urls/strip-protocol");
|
|
19
|
+
const api_1 = require("../api");
|
|
20
|
+
const themes_1 = require("./themes");
|
|
21
|
+
const util_1 = require("../util");
|
|
22
|
+
const models_1 = require("../models");
|
|
23
|
+
const registerSiteAsApplication_1 = require("./registerSiteAsApplication");
|
|
24
|
+
const addSiteDomains_1 = require("./domains/addSiteDomains");
|
|
25
|
+
const remove_domains_by_site_id_1 = require("./domains/remove-domains-by-site-id");
|
|
26
|
+
const utils_1 = require("../utils");
|
|
27
|
+
const objects_1 = require("../objects");
|
|
28
|
+
const get_item_thumbnail_url_1 = require("../resources/get-item-thumbnail-url");
|
|
16
29
|
exports.HUB_SITE_ITEM_TYPE = "Hub Site Application";
|
|
17
30
|
exports.ENTERPRISE_SITE_ITEM_TYPE = "Site Application";
|
|
18
31
|
/**
|
|
@@ -172,20 +185,20 @@ async function createSite(partialSite, requestOptions) {
|
|
|
172
185
|
: exports.HUB_SITE_ITEM_TYPE;
|
|
173
186
|
// Create a slug from the title if one is not passed in
|
|
174
187
|
if (!site.slug) {
|
|
175
|
-
site.slug =
|
|
188
|
+
site.slug = slugs_1.constructSlug(site.name, site.orgUrlKey);
|
|
176
189
|
}
|
|
177
190
|
// Ensure slug is unique
|
|
178
191
|
// site.slug = await getUniqueSlug({ slug: site.slug }, requestOptions);
|
|
179
192
|
// add slug to keywords
|
|
180
|
-
site.typeKeywords =
|
|
193
|
+
site.typeKeywords = slugs_1.setSlugKeyword(site.typeKeywords, site.slug);
|
|
181
194
|
if (!site.subdomain) {
|
|
182
|
-
site.subdomain =
|
|
195
|
+
site.subdomain = slugify_1.slugify(site.name);
|
|
183
196
|
}
|
|
184
|
-
site.subdomain = await
|
|
197
|
+
site.subdomain = await ensure_unique_domain_name_1.ensureUniqueDomainName(site.subdomain, requestOptions);
|
|
185
198
|
// Domains
|
|
186
199
|
if (!requestOptions.isPortal) {
|
|
187
200
|
// now that we know the subdomain is available, set the defaultHostname
|
|
188
|
-
site.defaultHostname = `${site.subdomain}-${portal.urlKey}.${
|
|
201
|
+
site.defaultHostname = `${site.subdomain}-${portal.urlKey}.${strip_protocol_1.stripProtocol(api_1.getHubApiUrl(requestOptions))}`;
|
|
189
202
|
// set the url
|
|
190
203
|
site.url = `https://${site.customHostname ? site.customHostname : site.defaultHostname}`;
|
|
191
204
|
}
|
|
@@ -201,7 +214,7 @@ async function createSite(partialSite, requestOptions) {
|
|
|
201
214
|
site.orgUrlKey = portal.urlKey;
|
|
202
215
|
// override only if not set...
|
|
203
216
|
if (!site.theme) {
|
|
204
|
-
site.theme =
|
|
217
|
+
site.theme = themes_1.getOrgDefaultTheme(portal);
|
|
205
218
|
}
|
|
206
219
|
if (!site.defaultExtent) {
|
|
207
220
|
site.defaultExtent = portal.defaultExtent;
|
|
@@ -210,25 +223,25 @@ async function createSite(partialSite, requestOptions) {
|
|
|
210
223
|
site.culture = portal.culture;
|
|
211
224
|
}
|
|
212
225
|
// pull the basemap from portalSelf
|
|
213
|
-
if (!
|
|
214
|
-
|
|
226
|
+
if (!objects_1.getProp(site, "map.basemaps.primary")) {
|
|
227
|
+
objects_1.setProp("map.basemaps.primary", portal.defaultBasemap, site);
|
|
215
228
|
}
|
|
216
229
|
// Put the title into the header
|
|
217
|
-
if (!
|
|
218
|
-
|
|
230
|
+
if (!objects_1.getProp(site, "layout.header.component.settings.title")) {
|
|
231
|
+
objects_1.setProp("layout.header.component.settings.title", site.name, site);
|
|
219
232
|
}
|
|
220
233
|
// Now convert the IHubSite into an IModel
|
|
221
234
|
const mapper = new PropertyMapper_1.PropertyMapper(getPropertyMap_1.getPropertyMap());
|
|
222
|
-
let model = mapper.objectToModel(site,
|
|
235
|
+
let model = mapper.objectToModel(site, util_1.cloneObject(DEFAULT_SITE_MODEL));
|
|
223
236
|
// create the backing item
|
|
224
|
-
model = await
|
|
237
|
+
model = await models_1.createModel(model, requestOptions);
|
|
225
238
|
// Register as an app
|
|
226
|
-
const registration = await
|
|
239
|
+
const registration = await registerSiteAsApplication_1.registerSiteAsApplication(model, requestOptions);
|
|
227
240
|
model.data.values.clientId = registration.client_id;
|
|
228
241
|
// Register domains
|
|
229
|
-
await
|
|
242
|
+
await addSiteDomains_1.addSiteDomains(model, requestOptions);
|
|
230
243
|
// update the model
|
|
231
|
-
const updatedModel = await
|
|
244
|
+
const updatedModel = await models_1.updateModel(model, requestOptions);
|
|
232
245
|
// convert the model into a IHubSite and return
|
|
233
246
|
return mapper.modelToObject(updatedModel, {});
|
|
234
247
|
}
|
|
@@ -248,19 +261,19 @@ async function updateSite(site, requestOptions) {
|
|
|
248
261
|
// applying the site onto the default model ensures that a minimum
|
|
249
262
|
// set of properties exist, regardless what may have been done to
|
|
250
263
|
// the site pojo
|
|
251
|
-
const updatedModel = mapper.objectToModel(site,
|
|
264
|
+
const updatedModel = mapper.objectToModel(site, util_1.cloneObject(DEFAULT_SITE_MODEL));
|
|
252
265
|
// Fetch backing model from the portal
|
|
253
|
-
const currentModel = await
|
|
266
|
+
const currentModel = await models_1.getModel(site.id, requestOptions);
|
|
254
267
|
// handle any domain changes
|
|
255
268
|
await _internal_1.handleDomainChanges(updatedModel, currentModel, requestOptions);
|
|
256
269
|
if (updatedModel.item.properties.slug !== currentModel.item.properties.slug) {
|
|
257
270
|
// ensure slug to keywords
|
|
258
|
-
updatedModel.item.typeKeywords =
|
|
271
|
+
updatedModel.item.typeKeywords = slugs_1.setSlugKeyword(updatedModel.item.typeKeywords, updatedModel.item.properties.slug);
|
|
259
272
|
}
|
|
260
273
|
// merge the updated site onto the current model
|
|
261
274
|
const modelToStore = mapper.objectToModel(site, currentModel);
|
|
262
275
|
// update the model
|
|
263
|
-
const updatedSiteModel = await
|
|
276
|
+
const updatedSiteModel = await models_1.updateModel(modelToStore, requestOptions);
|
|
264
277
|
// fetch updated model
|
|
265
278
|
const updatedSite = mapper.modelToObject(updatedSiteModel, site);
|
|
266
279
|
return updatedSite;
|
|
@@ -296,7 +309,7 @@ exports.destroySite = destroySite;
|
|
|
296
309
|
async function deleteSite(id, requestOptions) {
|
|
297
310
|
// For AGO we need to remove the domain records for the site
|
|
298
311
|
if (!requestOptions.isPortal) {
|
|
299
|
-
await
|
|
312
|
+
await remove_domains_by_site_id_1.removeDomainsBySiteId(id, requestOptions);
|
|
300
313
|
}
|
|
301
314
|
// now we can remove the item
|
|
302
315
|
const ro = Object.assign(Object.assign({}, requestOptions), { id });
|
|
@@ -344,7 +357,7 @@ exports.convertModelToSite = convertModelToSite;
|
|
|
344
357
|
* @returns
|
|
345
358
|
*/
|
|
346
359
|
async function convertItemToSite(item, requestOptions) {
|
|
347
|
-
const model = await
|
|
360
|
+
const model = await models_1.fetchModelFromItem(item, requestOptions);
|
|
348
361
|
return convertModelToSite(model, requestOptions);
|
|
349
362
|
}
|
|
350
363
|
exports.convertItemToSite = convertItemToSite;
|
|
@@ -371,7 +384,7 @@ async function enrichSiteSearchResult(item, include, requestOptions) {
|
|
|
371
384
|
createdDateSource: "item.created",
|
|
372
385
|
updatedDate: new Date(item.modified),
|
|
373
386
|
updatedDateSource: "item.modified",
|
|
374
|
-
family:
|
|
387
|
+
family: get_family_1.getFamily(item.type),
|
|
375
388
|
links: {
|
|
376
389
|
self: "not-implemented",
|
|
377
390
|
siteRelative: "not-implemented",
|
|
@@ -381,11 +394,11 @@ async function enrichSiteSearchResult(item, include, requestOptions) {
|
|
|
381
394
|
// default includes
|
|
382
395
|
const DEFAULTS = [];
|
|
383
396
|
// merge includes
|
|
384
|
-
include = [...DEFAULTS, ...include].filter(
|
|
397
|
+
include = [...DEFAULTS, ...include].filter(util_1.unique);
|
|
385
398
|
// Parse the includes into a valid set of enrichments
|
|
386
399
|
const specs = include.map(parseInclude_1.parseInclude);
|
|
387
400
|
// Extract out the low-level enrichments needed
|
|
388
|
-
const enrichments =
|
|
401
|
+
const enrichments = utils_1.mapBy("enrichment", specs).filter(util_1.unique);
|
|
389
402
|
// fetch the enrichments
|
|
390
403
|
let enriched = {};
|
|
391
404
|
if (enrichments.length) {
|
|
@@ -394,10 +407,10 @@ async function enrichSiteSearchResult(item, include, requestOptions) {
|
|
|
394
407
|
}
|
|
395
408
|
// map the enriched props onto the result
|
|
396
409
|
specs.forEach((spec) => {
|
|
397
|
-
result[spec.prop] =
|
|
410
|
+
result[spec.prop] = objects_1.getProp(enriched, spec.path);
|
|
398
411
|
});
|
|
399
412
|
// Handle links
|
|
400
|
-
result.links.thumbnail =
|
|
413
|
+
result.links.thumbnail = get_item_thumbnail_url_1.getItemThumbnailUrl(item, requestOptions);
|
|
401
414
|
result.links.self = item.url;
|
|
402
415
|
result.links.siteRelative = _internal_2.getHubRelativeUrl(result.type, result.id, item.typeKeywords);
|
|
403
416
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HubSites.js","sourceRoot":"","sources":["../../../src/sites/HubSites.ts"],"names":[],"mappings":";;;AACA,iEAA+E;
|
|
1
|
+
{"version":3,"file":"HubSites.js","sourceRoot":"","sources":["../../../src/sites/HubSites.ts"],"names":[],"mappings":";;;AACA,iEAA+E;AAC/E,sDAAkD;AAClD,qDAAkD;AAClD,qEAAkE;AAClE,2CAAkD;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AAM,mCAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;KAC1E;IAED,yCAAyC;IACzC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,iBAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,eAAe;IACf,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,4CAAmB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IACnE,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC;IAC7B,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,6BAAiB,CAC3C,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,EAAE,EACT,IAAI,CAAC,YAAY,CAClB,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC;AA1DD,wDA0DC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IUser, IUserRequestOptions, UserSession } from "@esri/arcgis-rest-auth";
|
|
2
2
|
import { IPortal } from "@esri/arcgis-rest-portal";
|
|
3
3
|
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
4
|
-
import { HubSystemStatus
|
|
4
|
+
import { HubSystemStatus } from "./core";
|
|
5
5
|
import { HubLicense } from "./permissions/types";
|
|
6
|
+
import { IHubRequestOptions } from "./types";
|
|
6
7
|
/**
|
|
7
8
|
* Defines the properties of the ArcGISContext.
|
|
8
9
|
* Typically components or functions will get an instance
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HubEntity, IArcGISContext } from "../index";
|
|
2
1
|
import { Capability, ICapabilityAccessResponse } from "./types";
|
|
2
|
+
import { IArcGISContext, HubEntity } from "../index";
|
|
3
3
|
/**
|
|
4
4
|
* Check if a capability is enabled for a given entity and if the current user has necessary permissions to access it
|
|
5
5
|
* @param capability
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IItem } from "@esri/arcgis-rest-portal";
|
|
2
2
|
import { ItemOrServerEnrichment } from "../items/_enrichments";
|
|
3
|
-
import {
|
|
3
|
+
import { IHubRequestOptions, IHubGeography, IEnrichmentErrorInfo } from "../types";
|
|
4
|
+
import { IHubExtent } from "./compose";
|
|
4
5
|
/**
|
|
5
6
|
* get the default list of enrichments to fetch for content
|
|
6
7
|
* @param item
|
|
@@ -8,12 +9,6 @@ import { BBox, IHubRequestOptions, IHubGeography, IEnrichmentErrorInfo } from ".
|
|
|
8
9
|
* @private
|
|
9
10
|
*/
|
|
10
11
|
export declare const getContentEnrichments: (item: IItem) => ItemOrServerEnrichment[];
|
|
11
|
-
/**
|
|
12
|
-
* The extent returned by the Hub API
|
|
13
|
-
*/
|
|
14
|
-
export interface IHubExtent {
|
|
15
|
-
coordinates?: BBox;
|
|
16
|
-
}
|
|
17
12
|
/**
|
|
18
13
|
* The set of enrichments that we fetch from the Hub API
|
|
19
14
|
*/
|
|
@@ -73,26 +73,26 @@ export declare const setContentBoundary: (content: IHubContent, boundary: Geogra
|
|
|
73
73
|
summary?: string;
|
|
74
74
|
view?: import("../core").IWithViewSettings;
|
|
75
75
|
owner: string;
|
|
76
|
+
url?: string;
|
|
76
77
|
id: string;
|
|
77
78
|
itemControl: string;
|
|
78
79
|
access?: import("../core").AccessLevel;
|
|
79
|
-
url?: string;
|
|
80
|
-
capabilities?: import("..").EntityCapabilities;
|
|
81
|
-
description?: string;
|
|
82
|
-
name: string;
|
|
83
|
-
tags: string[];
|
|
84
|
-
type: string;
|
|
85
80
|
culture?: string;
|
|
81
|
+
description?: string;
|
|
86
82
|
extent?: number[][];
|
|
83
|
+
tags: string[];
|
|
87
84
|
thumbnailUrl?: string;
|
|
88
85
|
thumbnail?: string;
|
|
89
86
|
typeKeywords?: string[];
|
|
90
87
|
canEdit: boolean;
|
|
91
88
|
canDelete: boolean;
|
|
89
|
+
name: string;
|
|
92
90
|
createdDate: Date;
|
|
93
91
|
createdDateSource: string;
|
|
94
92
|
updatedDate: Date;
|
|
95
93
|
updatedDateSource: string;
|
|
94
|
+
type: string;
|
|
95
|
+
capabilities?: import("..").EntityCapabilities;
|
|
96
96
|
statistics?: any;
|
|
97
97
|
data?: {
|
|
98
98
|
[propName: string]: any;
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { IItem } from "@esri/arcgis-rest-portal";
|
|
2
2
|
import { ILayerDefinition } from "@esri/arcgis-rest-feature-layer";
|
|
3
|
-
import { IHubRequestOptions } from "../types";
|
|
3
|
+
import { BBox, IHubRequestOptions } from "../types";
|
|
4
4
|
import { IHubContentEnrichments, IHubContent } from "../core";
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The extent returned by the Hub API
|
|
7
|
+
*/
|
|
8
|
+
export interface IHubExtent {
|
|
9
|
+
coordinates?: BBox;
|
|
10
|
+
}
|
|
6
11
|
/**
|
|
7
12
|
* The possible values for updateFrequency
|
|
8
13
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { IHubTimeline, IHubItemEntity } from "./index";
|
|
2
1
|
import { IWithLayout, IWithPermissions, IWithSlug, IWithCatalog } from "../traits/index";
|
|
2
|
+
import { IHubItemEntity } from "./IHubItemEntity";
|
|
3
|
+
import { IHubTimeline } from "./IHubTimeline";
|
|
3
4
|
/**
|
|
4
5
|
* Defines the properties of a Hub Project object
|
|
5
6
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { IHubInitiative,
|
|
1
|
+
import { IHubInitiative, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior } from "../core";
|
|
2
2
|
import { Catalog } from "../search";
|
|
3
3
|
import { IArcGISContext } from "../ArcGISContext";
|
|
4
4
|
import { HubItemEntity } from "../core/HubItemEntity";
|
|
5
5
|
/**
|
|
6
6
|
* Hub Initiative Class
|
|
7
7
|
*/
|
|
8
|
-
export declare class HubInitiative extends HubItemEntity<IHubInitiative> implements IWithStoreBehavior<IHubInitiative>,
|
|
8
|
+
export declare class HubInitiative extends HubItemEntity<IHubInitiative> implements IWithStoreBehavior<IHubInitiative>, IWithCatalogBehavior, IWithSharingBehavior {
|
|
9
9
|
private _catalog;
|
|
10
10
|
/**
|
|
11
11
|
* Private constructor so we don't have `new` all over the place. Allows for
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IHubProject,
|
|
1
|
+
import { IHubProject, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, UiSchemaElementOptions } from "../core";
|
|
2
2
|
import { Catalog } from "../search";
|
|
3
3
|
import { IArcGISContext } from "../ArcGISContext";
|
|
4
4
|
import { HubItemEntity } from "../core/HubItemEntity";
|
|
@@ -6,7 +6,7 @@ import { EditorConfigType, IEditorConfig } from "../core/behaviors/IWithEditorBe
|
|
|
6
6
|
/**
|
|
7
7
|
* Hub Project Class
|
|
8
8
|
*/
|
|
9
|
-
export declare class HubProject extends HubItemEntity<IHubProject> implements IWithStoreBehavior<IHubProject>,
|
|
9
|
+
export declare class HubProject extends HubItemEntity<IHubProject> implements IWithStoreBehavior<IHubProject>, IWithCatalogBehavior, IWithSharingBehavior {
|
|
10
10
|
private _catalog;
|
|
11
11
|
/**
|
|
12
12
|
* Private constructor so we don't have `new` all over the place. Allows for
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
|
|
2
|
-
import { EditorConfigType, UiSchemaElementOptions, IEditorConfig } from "../index";
|
|
3
2
|
import { IHubProject } from "../core/types";
|
|
3
|
+
import { UiSchemaElementOptions } from "../core/schemas";
|
|
4
|
+
import { EditorConfigType, IEditorConfig } from "../core/behaviors/IWithEditorBehavior";
|
|
4
5
|
/**
|
|
5
6
|
* @private
|
|
6
7
|
* Create a new Hub Project item
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
2
2
|
import { IItem } from "@esri/arcgis-rest-portal";
|
|
3
|
-
import { IHubProject } from "../core";
|
|
3
|
+
import { IHubProject } from "../core/types";
|
|
4
4
|
import { IHubSearchResult } from "../search";
|
|
5
5
|
import { IHubRequestOptions } from "../types";
|
|
6
6
|
/**
|
|
@@ -22,6 +22,14 @@ export interface IGetWellKnownCatalogOptions {
|
|
|
22
22
|
user?: IUser;
|
|
23
23
|
collectionNames?: WellKnownCollection[];
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if i18nScope is defined and not ending with a ".", if so add a "." at the end.
|
|
27
|
+
* e.g. if the i18nScope is 'project.edit', the path is `${i18nScope}catalog.organization`,
|
|
28
|
+
* we will want "project.edit.catalog.organization" instead of "project.editcatalog.organization"
|
|
29
|
+
* @param i18nScope
|
|
30
|
+
* @returns i18nScope with a "." at the end if it is defined
|
|
31
|
+
*/
|
|
32
|
+
export declare function dotifyString(i18nScope: string): string;
|
|
25
33
|
/** Get a single catalog based on the name, entity type and optional requests
|
|
26
34
|
* @param i18nScope Translation scope to be interpolated into the catalog
|
|
27
35
|
* @param name Name of the catalog requested
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { IItem } from "@esri/arcgis-rest-portal";
|
|
2
|
-
import { IHubRequestOptions, IHubSearchResult, IHubSite, IModel } from "../index";
|
|
3
2
|
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
3
|
+
import { IHubSite } from "../core/types/IHubSite";
|
|
4
|
+
import { IHubRequestOptions, IModel } from "../types";
|
|
5
|
+
import { IHubSearchResult } from "../search/types/IHubSearchResult";
|
|
4
6
|
export declare const HUB_SITE_ITEM_TYPE = "Hub Site Application";
|
|
5
7
|
export declare const ENTERPRISE_SITE_ITEM_TYPE = "Site Application";
|
|
6
8
|
/**
|