@esri/hub-common 28.4.1 → 28.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/core/_internal/getBasePropertyMap.js +4 -0
- package/dist/esm/core/_internal/getBasePropertyMap.js.map +1 -1
- package/dist/esm/core/schemas/internal/getThumbnailUiSchemaElement.js +9 -2
- package/dist/esm/core/schemas/internal/getThumbnailUiSchemaElement.js.map +1 -1
- package/dist/esm/core/traits/IWithVersions.js +2 -0
- package/dist/esm/core/traits/IWithVersions.js.map +1 -0
- package/dist/esm/events/HubEvent.js +38 -3
- package/dist/esm/events/HubEvent.js.map +1 -1
- package/dist/esm/events/_internal/EventUiSchemaEdit.js +1 -1
- package/dist/esm/events/_internal/EventUiSchemaEdit.js.map +1 -1
- package/dist/esm/events/_internal/PropertyMapper.js +3 -1
- package/dist/esm/events/_internal/PropertyMapper.js.map +1 -1
- package/dist/esm/events/fetch.js +3 -5
- package/dist/esm/events/fetch.js.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/layouts/fetchHubEntityLayouts.js +30 -0
- package/dist/esm/layouts/fetchHubEntityLayouts.js.map +1 -0
- package/dist/esm/layouts/internal/upsertLayoutAssetResource.js +72 -0
- package/dist/esm/layouts/internal/upsertLayoutAssetResource.js.map +1 -0
- package/dist/esm/layouts/publishHubEntityLayout.js +82 -0
- package/dist/esm/layouts/publishHubEntityLayout.js.map +1 -0
- package/dist/esm/layouts/types.js +1 -1
- package/dist/esm/layouts/types.js.map +1 -1
- package/dist/esm/permissions/HubPermissionPolicies.js +6 -0
- package/dist/esm/permissions/HubPermissionPolicies.js.map +1 -1
- package/dist/esm/permissions/_internal/constants.js +1 -0
- package/dist/esm/permissions/_internal/constants.js.map +1 -1
- package/dist/esm/projects/edit.js +0 -2
- package/dist/esm/projects/edit.js.map +1 -1
- package/dist/esm/resources/addHubEntityResource.js +36 -0
- package/dist/esm/resources/addHubEntityResource.js.map +1 -0
- package/dist/esm/resources/addResource.js +37 -0
- package/dist/esm/resources/addResource.js.map +1 -0
- package/dist/esm/resources/fetchHubEntityResource.js +37 -0
- package/dist/esm/resources/fetchHubEntityResource.js.map +1 -0
- package/dist/esm/resources/fetchHubEntityResources.js +37 -0
- package/dist/esm/resources/fetchHubEntityResources.js.map +1 -0
- package/dist/esm/resources/removeHubEntityResource.js +33 -0
- package/dist/esm/resources/removeHubEntityResource.js.map +1 -0
- package/dist/esm/resources/upsertHubEntityResource.js +34 -0
- package/dist/esm/resources/upsertHubEntityResource.js.map +1 -0
- package/dist/node/core/_internal/getBasePropertyMap.js +4 -0
- package/dist/node/core/_internal/getBasePropertyMap.js.map +1 -1
- package/dist/node/core/schemas/internal/getThumbnailUiSchemaElement.js +9 -2
- package/dist/node/core/schemas/internal/getThumbnailUiSchemaElement.js.map +1 -1
- package/dist/node/core/traits/IWithVersions.js +3 -0
- package/dist/node/core/traits/IWithVersions.js.map +1 -0
- package/dist/node/events/HubEvent.js +37 -2
- package/dist/node/events/HubEvent.js.map +1 -1
- package/dist/node/events/_internal/EventUiSchemaEdit.js +1 -1
- package/dist/node/events/_internal/EventUiSchemaEdit.js.map +1 -1
- package/dist/node/events/_internal/PropertyMapper.js +3 -1
- package/dist/node/events/_internal/PropertyMapper.js.map +1 -1
- package/dist/node/events/fetch.js +3 -5
- package/dist/node/events/fetch.js.map +1 -1
- package/dist/node/index.js +7 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/layouts/fetchHubEntityLayouts.js +33 -0
- package/dist/node/layouts/fetchHubEntityLayouts.js.map +1 -0
- package/dist/node/layouts/internal/upsertLayoutAssetResource.js +75 -0
- package/dist/node/layouts/internal/upsertLayoutAssetResource.js.map +1 -0
- package/dist/node/layouts/publishHubEntityLayout.js +85 -0
- package/dist/node/layouts/publishHubEntityLayout.js.map +1 -0
- package/dist/node/layouts/types.js +2 -0
- package/dist/node/layouts/types.js.map +1 -1
- package/dist/node/permissions/HubPermissionPolicies.js +6 -0
- package/dist/node/permissions/HubPermissionPolicies.js.map +1 -1
- package/dist/node/permissions/_internal/constants.js +1 -0
- package/dist/node/permissions/_internal/constants.js.map +1 -1
- package/dist/node/projects/edit.js +0 -2
- package/dist/node/projects/edit.js.map +1 -1
- package/dist/node/resources/addHubEntityResource.js +39 -0
- package/dist/node/resources/addHubEntityResource.js.map +1 -0
- package/dist/node/resources/addResource.js +40 -0
- package/dist/node/resources/addResource.js.map +1 -0
- package/dist/node/resources/fetchHubEntityResource.js +40 -0
- package/dist/node/resources/fetchHubEntityResource.js.map +1 -0
- package/dist/node/resources/fetchHubEntityResources.js +40 -0
- package/dist/node/resources/fetchHubEntityResources.js.map +1 -0
- package/dist/node/resources/removeHubEntityResource.js +36 -0
- package/dist/node/resources/removeHubEntityResource.js.map +1 -0
- package/dist/node/resources/upsertHubEntityResource.js +37 -0
- package/dist/node/resources/upsertHubEntityResource.js.map +1 -0
- package/dist/types/content/_internal/internalContentUtils.d.ts +1 -1
- package/dist/types/core/schemas/internal/getThumbnailUiSchemaElement.d.ts +1 -1
- package/dist/types/core/traits/IWithVersions.d.ts +5 -0
- package/dist/types/core/types/IHubEvent.d.ts +4 -0
- package/dist/types/core/types/IHubItemEntity.d.ts +2 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/layouts/fetchHubEntityLayouts.d.ts +16 -0
- package/dist/types/layouts/internal/upsertLayoutAssetResource.d.ts +27 -0
- package/dist/types/layouts/layout-event-types.d.ts +2 -1
- package/dist/types/layouts/migrations/types/ILayoutV2.d.ts +3 -0
- package/dist/types/layouts/publishHubEntityLayout.d.ts +29 -0
- package/dist/types/layouts/types.d.ts +5 -0
- package/dist/types/permissions/_internal/constants.d.ts +2 -2
- package/dist/types/resources/addHubEntityResource.d.ts +19 -0
- package/dist/types/resources/addResource.d.ts +18 -0
- package/dist/types/resources/fetchHubEntityResource.d.ts +15 -0
- package/dist/types/resources/fetchHubEntityResources.d.ts +17 -0
- package/dist/types/resources/removeHubEntityResource.d.ts +18 -0
- package/dist/types/resources/upsertHubEntityResource.d.ts +20 -0
- package/dist/types/versioning/types/IVersion.d.ts +6 -2
- package/dist/types/versioning/types/IVersionMetadata.d.ts +10 -0
- package/package.json +3 -3
- package/dist/esm/layouts/updateLayout.js +0 -33
- package/dist/esm/layouts/updateLayout.js.map +0 -1
- package/dist/esm/layouts/upsertLayoutResource.js +0 -78
- package/dist/esm/layouts/upsertLayoutResource.js.map +0 -1
- package/dist/node/layouts/updateLayout.js +0 -36
- package/dist/node/layouts/updateLayout.js.map +0 -1
- package/dist/node/layouts/upsertLayoutResource.js +0 -81
- package/dist/node/layouts/upsertLayoutResource.js.map +0 -1
- package/dist/types/layouts/updateLayout.d.ts +0 -4
- package/dist/types/layouts/upsertLayoutResource.d.ts +0 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/projects/edit.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../src/projects/edit.ts"],"names":[],"mappings":";;AA6BA,sCAsCC;AAQD,sCAoCC;AAQD,sCAOC;AA5HD,4EAA4E;AAC5E,0CAA+C;AAC/C,iEAAwE;AACxE,qEAAkE;AAClE,yCAAoE;AACpE,2DAAwD;AACxD,+DAA4D;AAC5D,kCAAsC;AAEtC,qFAAkF;AAClF,sFAAmF;AAGnF,gDAA6D;AAC7D,uDAAoD;AACpD,iDAA8C;AAC9C,uDAAoD;AAEpD;;;;;;;;GAQG;AACI,KAAK,UAAU,aAAa,CACjC,cAAoC,EACpC,cAAmC;IAEnC,kCAAkC;IAClC,2CAA2C;IAC3C,MAAM,OAAO,mCAAQ,0BAAe,GAAK,cAAc,CAAE,CAAC;IAC1D,6BAA6B;IAC7B,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;IAEpD,uDAAuD;IACvD,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QAClB,OAAO,CAAC,IAAI,GAAG,IAAA,qBAAa,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAChE,CAAC;IACD,yBAAyB;IACzB,MAAM,IAAA,+CAAsB,EAAC,OAAyB,EAAE,cAAc,CAAC,CAAC;IACxE,yBAAyB;IACzB,OAAO,CAAC,YAAY,GAAG,IAAA,+CAAsB,EAC3C,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,MAAM,CACf,CAAC;IACF,OAAO,CAAC,YAAY,GAAG,IAAA,6BAAqB,EAC1C,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,aAAa,CACtB,CAAC;IACF,kDAAkD;IAClD,MAAM,MAAM,GAAG,IAAI,+BAAc,CAC/B,IAAA,+BAAc,GAAE,CACjB,CAAC;IACF,wEAAwE;IACxE,IAAI,KAAK,GAAG,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,IAAA,kBAAW,EAAC,gCAAqB,CAAC,CAAC,CAAC;IAC9E,kBAAkB;IAClB,KAAK,GAAG,MAAM,IAAA,yBAAW,EAAC,KAAK,EAAE,cAAc,CAAC,CAAC;IACjD,wCAAwC;IACxC,IAAI,UAAU,GAAG,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACjD,UAAU,GAAG,IAAA,2BAAY,EAAC,KAAK,EAAE,UAAU,EAAE,cAAc,CAAC,CAAC;IAC7D,gBAAgB;IAChB,OAAO,UAAyB,CAAC;AACnC,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,aAAa,CACjC,OAAoB,EACpB,cAAmC;IAEnC,gEAAgE;IAChE,MAAM,IAAA,+CAAsB,EAAC,OAAyB,EAAE,cAAc,CAAC,CAAC;IACxE,4BAA4B;IAC5B,OAAO,CAAC,YAAY,GAAG,IAAA,+CAAsB,EAC3C,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,MAAM,CACf,CAAC;IACF,OAAO,CAAC,YAAY,GAAG,IAAA,6BAAqB,EAC1C,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,aAAa,CACtB,CAAC;IAEF,8BAA8B;IAC9B,MAAM,KAAK,GAAG,MAAM,IAAA,mBAAQ,EAAC,OAAO,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;IACzD,4BAA4B;IAC5B,MAAM,MAAM,GAAG,IAAI,+BAAc,CAC/B,IAAA,+BAAc,GAAE,CACjB,CAAC;IAEF,mEAAmE;IACnE,0EAA0E;IAC1E,wEAAwE;IACxE,sDAAsD;IACtD,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC3D,0BAA0B;IAC1B,MAAM,YAAY,GAAG,MAAM,IAAA,yBAAW,EAAC,aAAa,EAAE,cAAc,CAAC,CAAC;IACtE,8CAA8C;IAC9C,IAAI,cAAc,GAAG,MAAM,CAAC,aAAa,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACjE,cAAc,GAAG,IAAA,2BAAY,EAAC,KAAK,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;IACrE,qEAAqE;IACrE,uCAAuC;IACvC,OAAO,cAA6B,CAAC;AACvC,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,aAAa,CACjC,EAAU,EACV,cAAmC;IAEnC,MAAM,EAAE,GAAG,gCAAK,cAAc,GAAK,EAAE,EAAE,EAAE,CAAsB,CAAC;IAChE,MAAM,IAAA,+BAAU,EAAC,EAAE,CAAC,CAAC;IACrB,OAAO;AACT,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addHubEntityResource = addHubEntityResource;
|
|
4
|
+
const HubError_1 = require("../HubError");
|
|
5
|
+
const addResource_1 = require("./addResource");
|
|
6
|
+
/**
|
|
7
|
+
* Adds a Hub entity resource. This util handles delegating
|
|
8
|
+
* to the correct resource add logic based on the entity type.
|
|
9
|
+
*
|
|
10
|
+
* @param type - type of the entity to add the resource for
|
|
11
|
+
* @param identifier - id of the entity to add the resource for
|
|
12
|
+
* @param resource - the resource to add
|
|
13
|
+
* @param name - name of the new resource file
|
|
14
|
+
* @param context - contextual portal and auth information
|
|
15
|
+
* @param opts.owner - (optional) owner of the resource to add, defaults to the current user if not provided
|
|
16
|
+
* @param opts.prefix - (optional) folder in which to store the new resource
|
|
17
|
+
* @throws {HubError} if there is an error during the add process or if adding is not yet implemented for the entity type
|
|
18
|
+
*/
|
|
19
|
+
async function addHubEntityResource(type, identifier, resource, name, context, opts) {
|
|
20
|
+
var _a;
|
|
21
|
+
if (type === "event") {
|
|
22
|
+
// TODO: add logic to add event resource
|
|
23
|
+
throw new HubError_1.default("addHubEntityResource", "adding event resources is not yet implemented");
|
|
24
|
+
}
|
|
25
|
+
else if (type === "group") {
|
|
26
|
+
// TODO: add logic to add group resource once
|
|
27
|
+
// supported by portal
|
|
28
|
+
throw new HubError_1.default("addHubEntityResource", "adding group resources is not yet supported");
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
// default logic for item-backed entities
|
|
32
|
+
const owner = (opts === null || opts === void 0 ? void 0 : opts.owner) || ((_a = context === null || context === void 0 ? void 0 : context.currentUser) === null || _a === void 0 ? void 0 : _a.username);
|
|
33
|
+
await (0, addResource_1.addResource)(identifier, name, resource, context, {
|
|
34
|
+
owner,
|
|
35
|
+
prefix: opts === null || opts === void 0 ? void 0 : opts.prefix,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=addHubEntityResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addHubEntityResource.js","sourceRoot":"","sources":["../../../src/resources/addHubEntityResource.ts"],"names":[],"mappings":";;AAkBA,oDAgCC;AAjDD,0CAAmC;AAEnC,+CAA4C;AAE5C;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,oBAAoB,CACxC,IAAmB,EACnB,UAAkB,EAClB,QAAiB,EACjB,IAAY,EACZ,OAAuB,EACvB,IAGC;;IAED,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,wCAAwC;QACxC,MAAM,IAAI,kBAAQ,CAChB,sBAAsB,EACtB,+CAA+C,CAChD,CAAC;IACJ,CAAC;SAAM,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QAC5B,6CAA6C;QAC7C,sBAAsB;QACtB,MAAM,IAAI,kBAAQ,CAChB,sBAAsB,EACtB,6CAA6C,CAC9C,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,yCAAyC;QACzC,MAAM,KAAK,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,MAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,0CAAE,QAAQ,CAAA,CAAC;QAC5D,MAAM,IAAA,yBAAW,EAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE;YACrD,KAAK;YACL,MAAM,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addResource = addResource;
|
|
4
|
+
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
5
|
+
const HubError_1 = require("../HubError");
|
|
6
|
+
/**
|
|
7
|
+
* Thin wrapper around addItemResource to add a resource
|
|
8
|
+
* to a portal item and provide Hub-specific error
|
|
9
|
+
* handling.
|
|
10
|
+
*
|
|
11
|
+
* @param id - id of the item to add the resource to
|
|
12
|
+
* @param name - name of the resource file
|
|
13
|
+
* @param owner - owner of the item to add the resource to
|
|
14
|
+
* @param context - contextual portal and auth information
|
|
15
|
+
* @throws {HubError} if there is an error during the add process
|
|
16
|
+
*/
|
|
17
|
+
async function addResource(id, name, resource, context, opts) {
|
|
18
|
+
var _a;
|
|
19
|
+
try {
|
|
20
|
+
// Add the item resource
|
|
21
|
+
const owner = (opts === null || opts === void 0 ? void 0 : opts.owner) || ((_a = context === null || context === void 0 ? void 0 : context.currentUser) === null || _a === void 0 ? void 0 : _a.username);
|
|
22
|
+
const response = await (0, arcgis_rest_portal_1.addItemResource)(Object.assign({ id,
|
|
23
|
+
owner,
|
|
24
|
+
resource, name: name, prefix: opts === null || opts === void 0 ? void 0 : opts.prefix }, context.userRequestOptions));
|
|
25
|
+
// If error, throw
|
|
26
|
+
if (!response.success) {
|
|
27
|
+
throw new HubError_1.default("Add Item Resource", `Error adding resource ${name} to item ${id}.`);
|
|
28
|
+
}
|
|
29
|
+
return response;
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
if (err instanceof Error) {
|
|
33
|
+
throw new HubError_1.default("Add Item Resource", err.message, err);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
throw new HubError_1.default("Add Item Resource", `Error adding resource ${name} to item ${id}.`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=addResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addResource.js","sourceRoot":"","sources":["../../../src/resources/addResource.ts"],"names":[],"mappings":";;AAeA,kCAwCC;AAvDD,iEAA2D;AAC3D,0CAAmC;AAGnC;;;;;;;;;;GAUG;AACI,KAAK,UAAU,WAAW,CAC/B,EAAU,EACV,IAAY,EACZ,QAAiB,EACjB,OAAuB,EACvB,IAGC;;IAED,IAAI,CAAC;QACH,wBAAwB;QACxB,MAAM,KAAK,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,MAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,0CAAE,QAAQ,CAAA,CAAC;QAC5D,MAAM,QAAQ,GAAG,MAAM,IAAA,oCAAe,kBACpC,EAAE;YACF,KAAK;YACL,QAAQ,EACR,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,IACjB,OAAO,CAAC,kBAAkB,EAC7B,CAAC;QAEH,kBAAkB;QAClB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,MAAM,IAAI,kBAAQ,CAChB,mBAAmB,EACnB,yBAAyB,IAAI,YAAY,EAAE,GAAG,CAC/C,CAAC;QACJ,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;YACzB,MAAM,IAAI,kBAAQ,CAAC,mBAAmB,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;QAC5D,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,kBAAQ,CAChB,mBAAmB,EACnB,yBAAyB,IAAI,YAAY,EAAE,GAAG,CAC/C,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchHubEntityResource = fetchHubEntityResource;
|
|
4
|
+
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
5
|
+
const HubError_1 = require("../HubError");
|
|
6
|
+
/**
|
|
7
|
+
* Fetches a Hub entity resource. This util handles
|
|
8
|
+
* delegating to the correct resource fetching logic
|
|
9
|
+
* based on the entity type.
|
|
10
|
+
*
|
|
11
|
+
* @param type - type of the entity to fetch the resource for
|
|
12
|
+
* @param identifier - id of the entity to fetch the resource for
|
|
13
|
+
* @param fileName - name of the info file (including the optional folder path) to fetch
|
|
14
|
+
* @param context - contextual portal and auth information
|
|
15
|
+
* @returns the fetched resource
|
|
16
|
+
* @throws {HubError} if there is an error during the fetch process or if fetching is not yet implemented for the entity type
|
|
17
|
+
*/
|
|
18
|
+
async function fetchHubEntityResource(type, identifier, fileName, context) {
|
|
19
|
+
let resource;
|
|
20
|
+
if (type === "event") {
|
|
21
|
+
// TODO: add logic to fetch event resource
|
|
22
|
+
throw new HubError_1.default("fetchHubEntityResource", "Fetching event resources is not yet implemented");
|
|
23
|
+
}
|
|
24
|
+
else if (type === "group") {
|
|
25
|
+
// TODO: add logic to fetch group resource once
|
|
26
|
+
// supported by portal
|
|
27
|
+
throw new HubError_1.default("fetchHubEntityResource", "Fetching group resources is not yet supported");
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
// default to item-based resource fetching for item-backed entities
|
|
31
|
+
try {
|
|
32
|
+
resource = await (0, arcgis_rest_portal_1.getItemResource)(identifier, Object.assign(Object.assign({}, context.requestOptions), { fileName }));
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
throw new HubError_1.default("Get Item Resource", `Failed to fetch resource ${fileName} for ${type} with identifier ${identifier}`, error);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return resource;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=fetchHubEntityResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchHubEntityResource.js","sourceRoot":"","sources":["../../../src/resources/fetchHubEntityResource.ts"],"names":[],"mappings":";;AAiBA,wDAqCC;AAtDD,iEAA2D;AAG3D,0CAAmC;AAEnC;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,sBAAsB,CAC1C,IAAmB,EACnB,UAAkB,EAClB,QAAgB,EAChB,OAAuB;IAEvB,IAAI,QAAiB,CAAC;IACtB,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,0CAA0C;QAC1C,MAAM,IAAI,kBAAQ,CAChB,wBAAwB,EACxB,iDAAiD,CAClD,CAAC;IACJ,CAAC;SAAM,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QAC5B,+CAA+C;QAC/C,sBAAsB;QACtB,MAAM,IAAI,kBAAQ,CAChB,wBAAwB,EACxB,+CAA+C,CAChD,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,mEAAmE;QACnE,IAAI,CAAC;YACH,QAAQ,GAAG,MAAM,IAAA,oCAAe,EAAC,UAAU,kCACtC,OAAO,CAAC,cAAc,KACzB,QAAQ,IACR,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,kBAAQ,CAChB,mBAAmB,EACnB,4BAA4B,QAAQ,QAAQ,IAAI,oBAAoB,UAAU,EAAE,EAChF,KAAc,CACf,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fetchHubEntityResources = fetchHubEntityResources;
|
|
4
|
+
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
5
|
+
const HubError_1 = require("../HubError");
|
|
6
|
+
/**
|
|
7
|
+
* Fetches a Hub entity's resources. This util handles
|
|
8
|
+
* delegating to the correct resource fetching logic
|
|
9
|
+
* based on the entity type.
|
|
10
|
+
*
|
|
11
|
+
* @param type - type of the entity to fetch the resources for
|
|
12
|
+
* @param identifier - id of the entity to fetch the resources for
|
|
13
|
+
* @param context - contextual portal and auth information
|
|
14
|
+
* @returns the fetched resources
|
|
15
|
+
* @throws {HubError} if there is an error during the fetch process or if fetching is not yet implemented for the entity type
|
|
16
|
+
*/
|
|
17
|
+
async function fetchHubEntityResources(type, identifier, context) {
|
|
18
|
+
let resources = [];
|
|
19
|
+
if (type === "event") {
|
|
20
|
+
// TODO: add logic to fetch event resources
|
|
21
|
+
throw new HubError_1.default("fetchHubEntityResource", "Fetching event resources is not yet implemented");
|
|
22
|
+
}
|
|
23
|
+
else if (type === "group") {
|
|
24
|
+
// TODO: add logic to fetch group resources once
|
|
25
|
+
// supported by portal
|
|
26
|
+
throw new HubError_1.default("fetchHubEntityResource", "Fetching group resources is not yet supported");
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
// default to item-based resource fetching for item-backed entities
|
|
30
|
+
try {
|
|
31
|
+
const res = await (0, arcgis_rest_portal_1.getItemResources)(identifier, context.requestOptions);
|
|
32
|
+
resources = res.resources.map((resource) => (Object.assign(Object.assign({}, resource), { name: resource.resource })));
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
throw new HubError_1.default("Get Item Resources", `Failed to fetch resources for ${type} with identifier ${identifier}`, error);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return resources;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=fetchHubEntityResources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetchHubEntityResources.js","sourceRoot":"","sources":["../../../src/resources/fetchHubEntityResources.ts"],"names":[],"mappings":";;AAgBA,0DAqCC;AArDD,iEAA4D;AAG5D,0CAAmC;AAEnC;;;;;;;;;;GAUG;AACI,KAAK,UAAU,uBAAuB,CAC3C,IAAmB,EACnB,UAAkB,EAClB,OAAuB;IAEvB,IAAI,SAAS,GAAG,EAAE,CAAC;IACnB,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,2CAA2C;QAC3C,MAAM,IAAI,kBAAQ,CAChB,wBAAwB,EACxB,iDAAiD,CAClD,CAAC;IACJ,CAAC;SAAM,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QAC5B,gDAAgD;QAChD,sBAAsB;QACtB,MAAM,IAAI,kBAAQ,CAChB,wBAAwB,EACxB,+CAA+C,CAChD,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,mEAAmE;QACnE,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,IAAA,qCAAgB,EAAC,UAAU,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;YACvE,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,iCACvC,QAAQ,KACX,IAAI,EAAE,QAAQ,CAAC,QAAQ,IACvB,CAAC,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,kBAAQ,CAChB,oBAAoB,EACpB,iCAAiC,IAAI,oBAAoB,UAAU,EAAE,EACrE,KAAc,CACf,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeHubEntityResource = removeHubEntityResource;
|
|
4
|
+
const HubError_1 = require("../HubError");
|
|
5
|
+
const removeResource_1 = require("./removeResource");
|
|
6
|
+
/**
|
|
7
|
+
* Removes a Hub entity resource. This util handles delegating
|
|
8
|
+
* to the correct resource remove logic based on the entity type.
|
|
9
|
+
*
|
|
10
|
+
* @param type - type of the entity to remove the resource for
|
|
11
|
+
* @param identifier - id of the entity to remove the resource for
|
|
12
|
+
* @param name - name of the new/existing resource file
|
|
13
|
+
* @param context - contextual portal and auth information
|
|
14
|
+
* @param opts.owner - (optional) owner of the resource to add, defaults to the current user if not provided
|
|
15
|
+
* @param opts.prefix - (optional) folder in which to store the new resource
|
|
16
|
+
* @throws {HubError} if there is an error during the remove process or if removeing is not yet implemented for the entity type
|
|
17
|
+
*/
|
|
18
|
+
async function removeHubEntityResource(type, identifier, name, context, opts) {
|
|
19
|
+
var _a;
|
|
20
|
+
if (type === "event") {
|
|
21
|
+
// TODO: add logic to remove event resource
|
|
22
|
+
throw new HubError_1.default("removeHubEntityResource", "removing event resources is not yet implemented");
|
|
23
|
+
}
|
|
24
|
+
else if (type === "group") {
|
|
25
|
+
// TODO: add logic to remove group resource once
|
|
26
|
+
// supported by portal
|
|
27
|
+
throw new HubError_1.default("removeHubEntityResource", "removing group resources is not yet supported");
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
// default logic for item-backed entities
|
|
31
|
+
const owner = (opts === null || opts === void 0 ? void 0 : opts.owner) || ((_a = context === null || context === void 0 ? void 0 : context.currentUser) === null || _a === void 0 ? void 0 : _a.username);
|
|
32
|
+
const fileName = (opts === null || opts === void 0 ? void 0 : opts.prefix) ? `${opts.prefix}/${name}` : name;
|
|
33
|
+
await (0, removeResource_1.removeResource)(identifier, fileName, owner, context.userRequestOptions);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=removeHubEntityResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeHubEntityResource.js","sourceRoot":"","sources":["../../../src/resources/removeHubEntityResource.ts"],"names":[],"mappings":";;AAiBA,0DAkCC;AAlDD,0CAAmC;AAEnC,qDAAkD;AAElD;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,uBAAuB,CAC3C,IAAmB,EACnB,UAAkB,EAClB,IAAY,EACZ,OAAuB,EACvB,IAGC;;IAED,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,2CAA2C;QAC3C,MAAM,IAAI,kBAAQ,CAChB,yBAAyB,EACzB,iDAAiD,CAClD,CAAC;IACJ,CAAC;SAAM,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QAC5B,gDAAgD;QAChD,sBAAsB;QACtB,MAAM,IAAI,kBAAQ,CAChB,yBAAyB,EACzB,+CAA+C,CAChD,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,yCAAyC;QACzC,MAAM,KAAK,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,MAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,0CAAE,QAAQ,CAAA,CAAC;QAC5D,MAAM,QAAQ,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,EAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAChE,MAAM,IAAA,+BAAc,EAClB,UAAU,EACV,QAAQ,EACR,KAAK,EACL,OAAO,CAAC,kBAAkB,CAC3B,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.upsertHubEntityResource = upsertHubEntityResource;
|
|
4
|
+
const HubError_1 = require("../HubError");
|
|
5
|
+
const upsertResource_1 = require("./upsertResource");
|
|
6
|
+
/**
|
|
7
|
+
* Adds or updates a Hub entity resource depending on whether it
|
|
8
|
+
* already exists. This util handles delegating to the correct
|
|
9
|
+
* resource upsert logic based on the entity type.
|
|
10
|
+
*
|
|
11
|
+
* @param type - type of the entity to upsert the resource for
|
|
12
|
+
* @param identifier - id of the entity to upsert the resource for
|
|
13
|
+
* @param resource - the resource to upsert
|
|
14
|
+
* @param name - name of the new/existing resource file
|
|
15
|
+
* @param context - contextual portal and auth information
|
|
16
|
+
* @param opts.owner - (optional) owner of the resource to add, defaults to the current user if not provided
|
|
17
|
+
* @param opts.prefix - (optional) folder in which to store the new resource
|
|
18
|
+
* @throws {HubError} if there is an error during the upsert process or if upserting is not yet implemented for the entity type
|
|
19
|
+
*/
|
|
20
|
+
async function upsertHubEntityResource(type, identifier, resource, name, context, opts) {
|
|
21
|
+
var _a;
|
|
22
|
+
if (type === "event") {
|
|
23
|
+
// TODO: add logic to upsert event resource
|
|
24
|
+
throw new HubError_1.default("upsertHubEntityResource", "Upserting event resources is not yet implemented");
|
|
25
|
+
}
|
|
26
|
+
else if (type === "group") {
|
|
27
|
+
// TODO: add logic to upsert group resource once
|
|
28
|
+
// supported by portal
|
|
29
|
+
throw new HubError_1.default("upsertHubEntityResource", "Upserting group resources is not yet supported");
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
// default logic for item-backed entities
|
|
33
|
+
const owner = (opts === null || opts === void 0 ? void 0 : opts.owner) || ((_a = context === null || context === void 0 ? void 0 : context.currentUser) === null || _a === void 0 ? void 0 : _a.username);
|
|
34
|
+
await (0, upsertResource_1.upsertResource)(identifier, owner, resource, name, context.userRequestOptions, opts === null || opts === void 0 ? void 0 : opts.prefix);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=upsertHubEntityResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upsertHubEntityResource.js","sourceRoot":"","sources":["../../../src/resources/upsertHubEntityResource.ts"],"names":[],"mappings":";;AAmBA,0DAoCC;AAtDD,0CAAmC;AAEnC,qDAAkD;AAElD;;;;;;;;;;;;;GAaG;AACI,KAAK,UAAU,uBAAuB,CAC3C,IAAmB,EACnB,UAAkB,EAClB,QAAiB,EACjB,IAAY,EACZ,OAAuB,EACvB,IAGC;;IAED,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QACrB,2CAA2C;QAC3C,MAAM,IAAI,kBAAQ,CAChB,yBAAyB,EACzB,kDAAkD,CACnD,CAAC;IACJ,CAAC;SAAM,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC;QAC5B,gDAAgD;QAChD,sBAAsB;QACtB,MAAM,IAAI,kBAAQ,CAChB,yBAAyB,EACzB,gDAAgD,CACjD,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,yCAAyC;QACzC,MAAM,KAAK,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,MAAI,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,0CAAE,QAAQ,CAAA,CAAC;QAC5D,MAAM,IAAA,+BAAc,EAClB,UAAU,EACV,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,OAAO,CAAC,kBAAkB,EAC1B,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CACb,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -221,7 +221,7 @@ export declare function getValueFromMetadata(metadata: any, identifier: keyof IM
|
|
|
221
221
|
*/
|
|
222
222
|
export declare function parseISODateString(isoString: string): {
|
|
223
223
|
date: Date;
|
|
224
|
-
precision: "
|
|
224
|
+
precision: "time" | "year" | "month" | "day";
|
|
225
225
|
};
|
|
226
226
|
/**
|
|
227
227
|
* Get the spatial reference as an object for an item
|
|
@@ -26,4 +26,4 @@ export declare const getDefaultImageEntityThumbnail: (options: Partial<IHubEdita
|
|
|
26
26
|
* @param defaultThumbnailUrl optional default thumbnail url to use instead of the standard one
|
|
27
27
|
* @returns the UI schema element for thumbnail editing
|
|
28
28
|
*/
|
|
29
|
-
export declare function getThumbnailUiSchemaElement(i18nScope: string, thumbnail: string, thumbnailUrl: string, entityType: HubEntityType, requestOptions: IRequestOptions, defaultThumbnailUrl?: string): IUiSchemaElement[];
|
|
29
|
+
export declare function getThumbnailUiSchemaElement(i18nScope: string, thumbnail: string, thumbnailUrl: string, entityType: HubEntityType, requestOptions: IRequestOptions, defaultThumbnailUrl?: string, context?: IArcGISContext): IUiSchemaElement[];
|
|
@@ -132,6 +132,10 @@ export interface IHubEvent extends IHubItemEntity, IWithPermissions, IWithSlug,
|
|
|
132
132
|
entityId: string;
|
|
133
133
|
entityType: string;
|
|
134
134
|
}>;
|
|
135
|
+
/**
|
|
136
|
+
* reference to an event's uploaded thumbnail
|
|
137
|
+
*/
|
|
138
|
+
resourceId?: string;
|
|
135
139
|
/**
|
|
136
140
|
* The start date of the event
|
|
137
141
|
*/
|
|
@@ -10,10 +10,11 @@ import { IWithDiscussions } from "../traits/IWithDiscussions";
|
|
|
10
10
|
import { IWithViewSettings } from "../traits/IWithViewSettings";
|
|
11
11
|
import { IWithAssistant } from "../traits/IWithAssistant";
|
|
12
12
|
import { ICatalogSetup } from "../../search/types/types";
|
|
13
|
+
import { IWithVersions } from "../traits/IWithVersions";
|
|
13
14
|
/**
|
|
14
15
|
* Properties exposed by Entities that are backed by Items
|
|
15
16
|
*/
|
|
16
|
-
export interface IHubItemEntity extends IHubEntityBase, IWithPermissions, IWithDiscussions, IWithFollowers, IWithAssociations, IWithAssistant {
|
|
17
|
+
export interface IHubItemEntity extends IHubEntityBase, IWithPermissions, IWithDiscussions, IWithFollowers, IWithAssociations, IWithAssistant, IWithVersions {
|
|
17
18
|
/**
|
|
18
19
|
* Access level of the item ("private" | "org" | "public")
|
|
19
20
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -106,6 +106,7 @@ export { IWithLayout, IWithLayoutStore } from "./core/traits/IWithLayout";
|
|
|
106
106
|
export { IWithPermissions } from "./core/traits/IWithPermissions";
|
|
107
107
|
export { IWithSlug } from "./core/traits/IWithSlug";
|
|
108
108
|
export { IWithViewSettings } from "./core/traits/IWithViewSettings";
|
|
109
|
+
export { IWithVersions } from "./core/traits/IWithVersions";
|
|
109
110
|
export { HubActionLink, IHubActionLinkSection, IHubContentActionLink, IHubExternalActionLink, IHubWellKnownActionLink, } from "./core/types/ActionLinks";
|
|
110
111
|
export { CountByValue, DynamicAggregation, DynamicValue, DynamicValueDefinition, DynamicValueResult, DynamicValues, DynamicValueType, IDynamicItemQueryDefinition, IDynamicPortalSelfDefinition, IDynamicServiceQueryDefinition, IStaticValueDefinition, } from "./core/types/DynamicValues";
|
|
111
112
|
export { HubEmbed, IHubEmbed, IHubEmbedApp, IHubEmbedExternal, IHubEmbedMap, IHubEmbedSurvey, } from "./core/types/Embeds";
|
|
@@ -540,6 +541,8 @@ export { HubError, OperationError, OperationStack };
|
|
|
540
541
|
export { IMigratableSchema, MigratableSchemaTransformMap, } from "./migrations/types";
|
|
541
542
|
export { Breakpoint, ColumnWidth, HTMLConfigurableLayoutNodeElement, IColumn, IColumnProps, IConfigurableLayoutNode, ITranslationMap, ILayoutNode, ILayoutNodeConfig, IProcessLayoutOptions, IRow, IRowProps, ISection, ISectionProps, LayoutColumnChild, LayoutNodeTag, layoutNodeTags, LayoutEditorTag, LayoutNode, Ref, SectionOrRef, ResponsiveValue, } from "./layouts/layout-system-types";
|
|
542
543
|
export { ILayoutNodeChangeEventDetail, ILayoutPublishEventDetail, ILayoutResetEventDetail, ILayoutNodeRepositionEventDetail, } from "./layouts/layout-event-types";
|
|
543
|
-
export { ILayout, Layout, LayoutUtils } from "./layouts/types";
|
|
544
|
+
export { ILayout, Layout, LayoutUtils, TLayoutType, TLayouts, LAYOUT_SCHEMA_VERSION, } from "./layouts/types";
|
|
544
545
|
export { ILayoutV1 } from "./layouts/migrations/types/ILayoutV1";
|
|
545
546
|
export { ILayoutV2 } from "./layouts/migrations/types/ILayoutV2";
|
|
547
|
+
export { fetchHubEntityLayouts } from "./layouts/fetchHubEntityLayouts";
|
|
548
|
+
export { publishHubEntityLayout } from "./layouts/publishHubEntityLayout";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IArcGISContext } from "../types/IArcGISContext";
|
|
2
|
+
import { Layout, TLayouts } from "./types";
|
|
3
|
+
import { HubEntity } from "../core/types/HubEntity";
|
|
4
|
+
import { IWithVersions } from "../core/traits/IWithVersions";
|
|
5
|
+
/**
|
|
6
|
+
* Fetches the "current version" layouts for a given Hub entity.
|
|
7
|
+
*
|
|
8
|
+
* Note: this function assumes that layout versions are stored
|
|
9
|
+
* as resources on the underlying entity and that pointers to
|
|
10
|
+
* these resources are stored somewhere on the entity (e.g.
|
|
11
|
+
* properties.currentVersions for portal-backed entities).
|
|
12
|
+
*
|
|
13
|
+
* @param entity - the Hub entity for which to fetch layouts
|
|
14
|
+
* @param context - contextual portal and auth information
|
|
15
|
+
*/
|
|
16
|
+
export declare function fetchHubEntityLayouts(entity: HubEntity & IWithVersions, context: IArcGISContext): Promise<TLayouts<Layout>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HubEntityType } from "../../core/types/HubEntityType";
|
|
2
|
+
import { IArcGISContext } from "../../types/IArcGISContext";
|
|
3
|
+
/**
|
|
4
|
+
* Adds or updates a layout asset resource (image, video,
|
|
5
|
+
* etc.) and returns the URL reference to the resource.
|
|
6
|
+
*
|
|
7
|
+
* Note that layout resources are typically stored with:
|
|
8
|
+
* - an "assets/" prefix (so we can find them)
|
|
9
|
+
* - a name that starts with the cardId
|
|
10
|
+
* - and a -{timestamp} suffix (to bust the cache)
|
|
11
|
+
* Thus, 'update' is not really an update, it is:
|
|
12
|
+
* 1. upload the new one
|
|
13
|
+
* 2. find the old one (which has a different suffix)
|
|
14
|
+
* and delete it.
|
|
15
|
+
*
|
|
16
|
+
* This is why we cannot simply use upsertHubEntityResource
|
|
17
|
+
*
|
|
18
|
+
* @param type - type of the entity to upsert the resource for
|
|
19
|
+
* @param id - id of the entity to upsert the resource for
|
|
20
|
+
* @param owner - owner of the resource to add/update
|
|
21
|
+
* @param resource - the resource to add/update
|
|
22
|
+
* @param name - name of the new/existing resource file
|
|
23
|
+
* @param extension - file extension of the resource (e.g. 'png', 'json', etc.)
|
|
24
|
+
* @param context - contextual portal and auth information
|
|
25
|
+
* @returns a URL reference to the newly added/updated resource
|
|
26
|
+
*/
|
|
27
|
+
export declare function upsertLayoutAssetResource(type: HubEntityType, identifier: string, owner: string, resource: unknown, name: string, extension: string, context: IArcGISContext): Promise<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IChangeEventDetail } from "../core/schemas/types";
|
|
2
2
|
import { ILayoutNodeConfig, LayoutNode } from "./layout-system-types";
|
|
3
|
-
import { ILayout } from "./types";
|
|
3
|
+
import { ILayout, TLayoutType } from "./types";
|
|
4
4
|
/**
|
|
5
5
|
* Interface representing the information emitted when
|
|
6
6
|
* a layout node is changed in the layout editor.
|
|
@@ -22,6 +22,7 @@ export interface ILayoutPublishEventDetail {
|
|
|
22
22
|
* a layout is reset to its default
|
|
23
23
|
*/
|
|
24
24
|
export interface ILayoutResetEventDetail {
|
|
25
|
+
type: TLayoutType;
|
|
25
26
|
successCallback?: () => void | Promise<void>;
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { IMigratableSchema } from "../../../migrations/types";
|
|
2
2
|
import type { IHistoryEntry, INodeOverrides, ITranslationMap, SectionOrRef } from "../../layout-system-types";
|
|
3
|
+
import { TLayoutType } from "../../types";
|
|
3
4
|
/** Interface representing a V2 layout object. */
|
|
4
5
|
export interface ILayoutV2 extends IMigratableSchema {
|
|
5
6
|
/** Schema version for the layout. */
|
|
6
7
|
schemaVersion: 2;
|
|
8
|
+
/** The type of layout, e.g. "header", "body", etc.*/
|
|
9
|
+
type: TLayoutType;
|
|
7
10
|
/** If true, the entire layout is read-only. */
|
|
8
11
|
readOnly?: boolean;
|
|
9
12
|
/** Array of sections in the layout. */
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { HubEntity } from "../core/types/HubEntity";
|
|
2
|
+
import { IArcGISContext } from "../types/IArcGISContext";
|
|
3
|
+
import { ILayout } from "./types";
|
|
4
|
+
import { IWithVersions } from "../core/traits/IWithVersions";
|
|
5
|
+
/**
|
|
6
|
+
* Publishes a Hub entity layout by:
|
|
7
|
+
* 1. Uploading any layout asset resources and updating the
|
|
8
|
+
* layout variables to point to the resource urls
|
|
9
|
+
* 2. Upserting the layout as a resource on the entity
|
|
10
|
+
* 3. Updating the entity's currentVersions to point to the
|
|
11
|
+
* new layout resource
|
|
12
|
+
* 4. Updating the entity
|
|
13
|
+
*
|
|
14
|
+
* TODO: in the future, we'll add layout versioning support, so
|
|
15
|
+
* we'll want this to work with the existing versioning utils.
|
|
16
|
+
* For now, we'll keep it simple and just directly upsert the
|
|
17
|
+
* single published version
|
|
18
|
+
*
|
|
19
|
+
* @param entity - the Hub entity of the layout to publish
|
|
20
|
+
* @param layout - the layout to publish
|
|
21
|
+
* @param versionName - the name of the version to publish
|
|
22
|
+
* @param context - contextual portal and auth information
|
|
23
|
+
* @returns the published layout
|
|
24
|
+
* @throws {HubError} if there is an error during the publish process
|
|
25
|
+
*/
|
|
26
|
+
export declare function publishHubEntityLayout(entity: HubEntity & IWithVersions, layout: ILayout, versionName: string, context: IArcGISContext): Promise<{
|
|
27
|
+
entity: HubEntity;
|
|
28
|
+
layout: ILayout;
|
|
29
|
+
}>;
|
|
@@ -2,6 +2,7 @@ import type { ILayoutV1 } from "./migrations/types/ILayoutV1";
|
|
|
2
2
|
import type { ILayoutV2 } from "./migrations/types/ILayoutV2";
|
|
3
3
|
/** Union type of all layout schema versions. */
|
|
4
4
|
export type Layout = ILayoutV1 | ILayoutV2;
|
|
5
|
+
export declare const LAYOUT_SCHEMA_VERSION = 2;
|
|
5
6
|
/**
|
|
6
7
|
* The latest supported layout schema. This should be
|
|
7
8
|
* updated whenever a new schema version is released.
|
|
@@ -14,3 +15,7 @@ export type ILayout = ILayoutV2;
|
|
|
14
15
|
export type LayoutUtils = {
|
|
15
16
|
processLayout: (layout: ILayout) => Promise<ILayout>;
|
|
16
17
|
};
|
|
18
|
+
/** Type representing the different types of Hub entity layouts */
|
|
19
|
+
export type TLayoutType = "body" | "header" | "footer" | "search" | "404";
|
|
20
|
+
/** Type representing a collection of layouts for different layout types */
|
|
21
|
+
export type TLayouts<T = ILayout> = Partial<Record<TLayoutType, T>>;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* It's critical that the arrays defined in the modules use `as const`
|
|
4
4
|
* otherwise Permission devolves into just a string type
|
|
5
5
|
*/
|
|
6
|
-
export declare const SystemPermissions: readonly ["hub:release:2025R3", "hub:release:2026R1", "hub:release:2026R2", "hub:release:2026R3", "hub:gating:workspace:released", "hub:gating:configurableViews:released", "hub:gating:entity:slugs", "hub:feature:ai-assistant", "hub:platform:ai-assistant", "hub:feature:privacy", "hub:feature:workspace", "hub:feature:configurableViews", "hub:feature:user:preferences", "hub:card:follow", "hub:feature:workspace:user", "hub:feature:workspace:org", "hub:feature:keyboardshortcuts", "hub:feature:newentityview", "hub:feature:history", "hub:feature:catalogs", "hub:feature:catalogs:edit:appearance", "hub:feature:gallery-card:enterprise", "hub:feature:inline-workspace", "hub:feature:pagescatalog", "hub:feature:discussions:subscription", "hub:license:hub-premium", "hub:license:hub-basic", "hub:license:enterprise-sites", "hub:availability:alpha", "hub:availability:beta", "hub:availability:general", "hub:environment:qaext", "hub:environment:devext", "hub:environment:production", "hub:environment:enterprise", "hub:card:embed", "hub:feature:search:portal", "hub:feature:search:portal:crossOrg", "hub:feature:translations:14700", "hub:feature:translations:14701"];
|
|
6
|
+
export declare const SystemPermissions: readonly ["hub:release:2025R3", "hub:release:2026R1", "hub:release:2026R2", "hub:release:2026R3", "hub:gating:workspace:released", "hub:gating:configurableViews:released", "hub:gating:entity:slugs", "hub:feature:ai-assistant", "hub:platform:ai-assistant", "hub:feature:privacy", "hub:feature:workspace", "hub:feature:configurableViews", "hub:feature:user:preferences", "hub:card:follow", "hub:feature:workspace:user", "hub:feature:workspace:org", "hub:feature:keyboardshortcuts", "hub:feature:newentityview", "hub:feature:history", "hub:feature:catalogs", "hub:feature:catalogs:edit:appearance", "hub:feature:gallery-card:enterprise", "hub:feature:inline-workspace", "hub:feature:pagescatalog", "hub:feature:discussions:subscription", "hub:feature:event:thumbnail:upload", "hub:license:hub-premium", "hub:license:hub-basic", "hub:license:enterprise-sites", "hub:availability:alpha", "hub:availability:beta", "hub:availability:general", "hub:environment:qaext", "hub:environment:devext", "hub:environment:production", "hub:environment:enterprise", "hub:card:embed", "hub:feature:search:portal", "hub:feature:search:portal:crossOrg", "hub:feature:translations:14700", "hub:feature:translations:14701"];
|
|
7
7
|
/**
|
|
8
8
|
* An array of all valid/supported permissions
|
|
9
9
|
*/
|
|
10
|
-
export declare const ValidPermissions: readonly ["hub:site", "hub:site:create", "hub:site:delete", "hub:site:edit", "hub:site:view", "hub:site:owner", "hub:site:canChangeAccess", "hub:site:events", "hub:site:content", "hub:site:discussions", "hub:site:feature:follow", "hub:site:feature:discussions", "hub:site:workspace", "hub:site:workspace:overview", "hub:site:workspace:dashboard", "hub:site:workspace:details", "hub:site:workspace:settings", "hub:site:workspace:collaborators", "hub:site:workspace:catalog", "hub:site:workspace:catalog:content", "hub:site:workspace:catalog:events", "hub:site:workspace:catalog:upgrade", "hub:site:workspace:metrics", "hub:site:workspace:followers", "hub:site:workspace:followers:member", "hub:site:workspace:followers:manager", "hub:site:workspace:followers:create", "hub:site:workspace:pages", "hub:site:workspace:events", "hub:site:workspace:projects", "hub:site:workspace:initiatives", "hub:site:manage", "hub:site:workspace:feeds", "hub:site:workspace:assistant", "hub:site:workspace:settings:discussions", "hub:site:assistant:access", "hub:project", "hub:project:create", "hub:project:delete", "hub:project:edit", "hub:project:view", "hub:project:owner", "hub:project:canChangeAccess", "hub:project:events", "hub:project:content", "hub:project:discussions", "hub:project:associations", "hub:project:workspace", "hub:project:workspace:overview", "hub:project:workspace:dashboard", "hub:project:workspace:details", "hub:project:workspace:initiatives", "hub:project:workspace:settings", "hub:project:workspace:collaborators", "hub:project:workspace:events", "hub:project:workspace:metrics", "hub:project:workspace:catalog", "hub:project:workspace:catalog:content", "hub:project:workspace:catalog:events", "hub:project:manage", "hub:project:workspace:edit:cardProps", "hub:initiative", "hub:initiative:create", "hub:initiative:delete", "hub:initiative:edit", "hub:initiative:view", "hub:initiative:owner", "hub:initiative:canChangeAccess", "hub:initiative:events", "hub:initiative:content", "hub:initiative:discussions", "hub:initiative:workspace", "hub:initiative:workspace:overview", "hub:initiative:workspace:dashboard", "hub:initiative:workspace:details", "hub:initiative:workspace:metrics", "hub:initiative:workspace:projects", "hub:initiative:workspace:projects:member", "hub:initiative:workspace:projects:manager", "hub:initiative:workspace:settings", "hub:initiative:workspace:collaborators", "hub:initiative:workspace:metrics", "hub:initiative:workspace:catalogs", "hub:initiative:workspace:catalog", "hub:initiative:workspace:catalog:content", "hub:initiative:workspace:catalog:events", "hub:initiative:workspace:associationGroup:create", "hub:initiative:manage", "hub:content", "hub:content:create", "hub:content:delete", "hub:content:edit", "hub:content:view", "hub:content:view:related", "hub:content:view:connected", "hub:content:canChangeAccess", "hub:content:workspace", "hub:content:workspace:overview", "hub:content:workspace:dashboard", "hub:content:workspace:details", "hub:content:workspace:settings", "hub:content:workspace:settings:schedule", "hub:content:workspace:settings:discussions", "hub:content:workspace:collaborators", "hub:content:manage", "hub:content:canRecordDownloadErrors", "hub:content:downloads:displayErrors", "hub:content:document:create", "hub:content:fetch:portal", "hub:group", "hub:group:messaging", "hub:group:create", "hub:group:create:view", "hub:group:create:edit", "hub:group:delete", "hub:group:edit", "hub:group:view", "hub:group:view:messaging", "hub:group:owner", "hub:group:canChangeAccess", "hub:group:canAssignMembers", "hub:group:workspace", "hub:group:workspace:overview", "hub:group:workspace:dashboard", "hub:group:workspace:details", "hub:group:workspace:settings", "hub:group:settings:discussions", "hub:group:workspace:collaborators", "hub:group:workspace:content", "hub:group:workspace:members", "hub:group:workspace:members:messaging", "hub:group:workspace:events", "hub:group:shareContent", "hub:group:manage", "hub:group:opendata", "hub:page", "hub:page:create", "hub:page:delete", "hub:page:edit", "hub:page:view", "hub:page:canChangeAccess", "hub:page:workspace", "hub:page:workspace:overview", "hub:page:workspace:dashboard", "hub:page:workspace:details", "hub:page:workspace:settings", "hub:page:workspace:collaborators", "hub:page:manage", "platform:features:user:edit", "platform:features:user:fullEdit", "platform:features:user:manageVersions", "platform:marketplace:admin:manage", "platform:marketplace:admin:purchase", "platform:marketplace:admin:startTrial", "platform:opendata:user:designateGroup", "platform:opendata:user:openDataAdmin", "platform:portal:admin:assignToGroups", "platform:portal:admin:categorizeItems", "platform:portal:admin:changeUserRoles", "platform:portal:admin:createGPWebhook", "platform:portal:admin:createUpdateCapableGroup", "platform:portal:admin:createLeavingDisallowedGroup", "platform:portal:admin:deleteGroups", "platform:portal:admin:deleteItems", "platform:portal:admin:deleteUsers", "platform:portal:admin:disableUsers", "platform:portal:admin:inviteUsers", "platform:portal:admin:manageCollaborations", "platform:portal:admin:manageCredits", "platform:portal:admin:manageEnterpriseGroups", "platform:portal:admin:manageLicenses", "platform:portal:admin:manageRoles", "platform:portal:admin:manageSecurity", "platform:portal:admin:manageServers", "platform:portal:admin:manageUtilityServices", "platform:portal:admin:manageWebhooks", "platform:portal:admin:manageWebsite", "platform:portal:admin:reassignGroups", "platform:portal:admin:reassignItems", "platform:portal:admin:reassignUsers", "platform:portal:admin:shareToGroup", "platform:portal:admin:shareToOrg", "platform:portal:admin:shareToPublic", "platform:portal:admin:updateGroups", "platform:portal:admin:updateItemCategorySchema", "platform:portal:admin:updateItems", "platform:portal:admin:updateMemberCategorySchema", "platform:portal:admin:updateUsers", "platform:portal:admin:viewGroups", "platform:portal:admin:viewItems", "platform:portal:admin:viewUsers", "platform:portal:publisher:bulkPublishFromDataStores", "platform:portal:publisher:createDataPipelines", "platform:portal:publisher:createFeatureWebhook", "platform:portal:publisher:publishBigDataAnalytics", "platform:portal:publisher:publishDynamicImagery", "platform:portal:publisher:publishFeatures", "platform:portal:publisher:publishFeeds", "platform:portal:publisher:publishKnowledgeGraph", "platform:portal:publisher:publishRealTimeAnalytics", "platform:portal:publisher:publishScenes", "platform:portal:publisher:publishServerGPServices", "platform:portal:publisher:publishServerServices", "platform:portal:publisher:publishTiledImagery", "platform:portal:publisher:publishTiles", "platform:portal:publisher:registerDataStores", "platform:portal:user:addExternalMembersToGroup", "platform:portal:user:categorizeItems", "platform:portal:user:createGroup", "platform:portal:user:createItem", "platform:portal:user:invitePartneredCollaborationMembers", "platform:portal:user:joinGroup", "platform:portal:user:joinNonOrgGroup", "platform:portal:user:reassignItems", "platform:portal:user:receiveItems", "platform:portal:user:runWebTool", "platform:portal:user:shareGroupToOrg", "platform:portal:user:shareGroupToPublic", "platform:portal:user:shareToGroup", "platform:portal:user:shareToOrg", "platform:portal:user:shareToPublic", "platform:portal:user:viewHostedFeatureServices", "platform:portal:user:viewHostedTileServices", "platform:portal:user:viewOrgGroups", "platform:portal:user:viewOrgItems", "platform:portal:user:viewOrgUsers", "platform:portal:user:viewTracks", "platform:portal:user:useAIAssistants", "platform:premium:publisher:createAdvancedNotebooks", "platform:premium:publisher:createNotebooks", "platform:premium:publisher:geoanalytics", "platform:premium:publisher:rasteranalysis", "platform:premium:publisher:scheduleNotebooks", "platform:premium:user:demographics", "platform:premium:user:elevation", "platform:premium:user:featurereport", "platform:premium:user:geocode:stored", "platform:premium:user:geocode:temporary", "platform:premium:user:geocode", "platform:premium:user:geoenrichment", "platform:premium:user:networkanalysis:closestfacility", "platform:premium:user:networkanalysis:locationallocation", "platform:premium:user:networkanalysis:optimizedrouting", "platform:premium:user:networkanalysis:origindestinationcostmatrix", "platform:premium:user:networkanalysis:routing", "platform:premium:user:networkanalysis:servicearea", "platform:premium:user:networkanalysis:vehiclerouting", "platform:premium:user:networkanalysis", "platform:premium:user:places", "platform:premium:user:spatialanalysis", "hub:discussion", "hub:discussion:create", "hub:discussion:delete", "hub:discussion:edit", "hub:discussion:view", "hub:discussion:owner", "hub:discussion:canChangeAccess", "hub:discussion:workspace:overview", "hub:discussion:workspace:dashboard", "hub:discussion:workspace:details", "hub:discussion:workspace:settings", "hub:discussion:workspace:collaborators", "hub:discussion:workspace:metrics", "hub:discussion:workspace:settings:discussions", "hub:discussion:manage", "temp:hub:discussion:create", "hub:discussion:workspace:catalog", "hub:discussion:workspace:catalog:content", "hub:discussion:workspace:catalog:events", "hub:initiativeTemplate", "hub:initiativeTemplate:create", "hub:initiativeTemplate:delete", "hub:initiativeTemplate:edit", "hub:initiativeTemplate:view", "hub:initiativeTemplate:view:related", "hub:initiativeTemplate:canChangeAccess", "hub:initiativeTemplate:workspace", "hub:initiativeTemplate:workspace:dashboard", "hub:initiativeTemplate:workspace:details", "hub:initiativeTemplate:workspace:collaborators", "hub:initiativeTemplate:workspace:settings", "hub:initiativeTemplate:manage", "hub:template", "hub:template:create", "hub:template:delete", "hub:template:edit", "hub:template:manage", "hub:template:view", "hub:template:view:related", "hub:template:canChangeAccess", "hub:template:workspace", "hub:template:workspace:details", "hub:template:workspace:dashboard", "hub:template:workspace:collaborators", "hub:template:workspace:settings", "hub:release:2025R3", "hub:release:2026R1", "hub:release:2026R2", "hub:release:2026R3", "hub:gating:workspace:released", "hub:gating:configurableViews:released", "hub:gating:entity:slugs", "hub:feature:ai-assistant", "hub:platform:ai-assistant", "hub:feature:privacy", "hub:feature:workspace", "hub:feature:configurableViews", "hub:feature:user:preferences", "hub:card:follow", "hub:feature:workspace:user", "hub:feature:workspace:org", "hub:feature:keyboardshortcuts", "hub:feature:newentityview", "hub:feature:history", "hub:feature:catalogs", "hub:feature:catalogs:edit:appearance", "hub:feature:gallery-card:enterprise", "hub:feature:inline-workspace", "hub:feature:pagescatalog", "hub:feature:discussions:subscription", "hub:license:hub-premium", "hub:license:hub-basic", "hub:license:enterprise-sites", "hub:availability:alpha", "hub:availability:beta", "hub:availability:general", "hub:environment:qaext", "hub:environment:devext", "hub:environment:production", "hub:environment:enterprise", "hub:card:embed", "hub:feature:search:portal", "hub:feature:search:portal:crossOrg", "hub:feature:translations:14700", "hub:feature:translations:14701", "hub:event", "hub:event:create", "hub:event:edit", "hub:event:delete", "hub:event:view", "hub:event:owner", "hub:event:canChangeAccess", "hub:event:workspace", "hub:event:workspace:dashboard", "hub:event:workspace:details", "hub:event:workspace:settings", "hub:event:workspace:collaborators", "hub:event:workspace:manage", "hub:event:workspace:registrants", "hub:event:workspace:content", "hub:event:workspace:catalog", "hub:event:workspace:catalog:content", "hub:event:workspace:catalog:events", "hub:event:manage", "hub:user", "hub:user:view", "hub:user:edit", "hub:user:owner", "hub:user:workspace", "hub:user:workspace:overview", "hub:user:workspace:settings", "hub:user:workspace:content", "hub:user:workspace:groups", "hub:user:workspace:events", "hub:user:workspace:shared-with-me", "hub:user:workspace:members", "hub:user:manage", "hub:channel", "hub:channel:create", "hub:channel:delete", "hub:channel:edit", "hub:channel:view", "hub:channel:owner", "hub:channel:manage", "hub:channel:read", "hub:channel:write", "hub:channel:readWrite", "hub:channel:moderate"];
|
|
10
|
+
export declare const ValidPermissions: readonly ["hub:site", "hub:site:create", "hub:site:delete", "hub:site:edit", "hub:site:view", "hub:site:owner", "hub:site:canChangeAccess", "hub:site:events", "hub:site:content", "hub:site:discussions", "hub:site:feature:follow", "hub:site:feature:discussions", "hub:site:workspace", "hub:site:workspace:overview", "hub:site:workspace:dashboard", "hub:site:workspace:details", "hub:site:workspace:settings", "hub:site:workspace:collaborators", "hub:site:workspace:catalog", "hub:site:workspace:catalog:content", "hub:site:workspace:catalog:events", "hub:site:workspace:catalog:upgrade", "hub:site:workspace:metrics", "hub:site:workspace:followers", "hub:site:workspace:followers:member", "hub:site:workspace:followers:manager", "hub:site:workspace:followers:create", "hub:site:workspace:pages", "hub:site:workspace:events", "hub:site:workspace:projects", "hub:site:workspace:initiatives", "hub:site:manage", "hub:site:workspace:feeds", "hub:site:workspace:assistant", "hub:site:workspace:settings:discussions", "hub:site:assistant:access", "hub:project", "hub:project:create", "hub:project:delete", "hub:project:edit", "hub:project:view", "hub:project:owner", "hub:project:canChangeAccess", "hub:project:events", "hub:project:content", "hub:project:discussions", "hub:project:associations", "hub:project:workspace", "hub:project:workspace:overview", "hub:project:workspace:dashboard", "hub:project:workspace:details", "hub:project:workspace:initiatives", "hub:project:workspace:settings", "hub:project:workspace:collaborators", "hub:project:workspace:events", "hub:project:workspace:metrics", "hub:project:workspace:catalog", "hub:project:workspace:catalog:content", "hub:project:workspace:catalog:events", "hub:project:manage", "hub:project:workspace:edit:cardProps", "hub:initiative", "hub:initiative:create", "hub:initiative:delete", "hub:initiative:edit", "hub:initiative:view", "hub:initiative:owner", "hub:initiative:canChangeAccess", "hub:initiative:events", "hub:initiative:content", "hub:initiative:discussions", "hub:initiative:workspace", "hub:initiative:workspace:overview", "hub:initiative:workspace:dashboard", "hub:initiative:workspace:details", "hub:initiative:workspace:metrics", "hub:initiative:workspace:projects", "hub:initiative:workspace:projects:member", "hub:initiative:workspace:projects:manager", "hub:initiative:workspace:settings", "hub:initiative:workspace:collaborators", "hub:initiative:workspace:metrics", "hub:initiative:workspace:catalogs", "hub:initiative:workspace:catalog", "hub:initiative:workspace:catalog:content", "hub:initiative:workspace:catalog:events", "hub:initiative:workspace:associationGroup:create", "hub:initiative:manage", "hub:content", "hub:content:create", "hub:content:delete", "hub:content:edit", "hub:content:view", "hub:content:view:related", "hub:content:view:connected", "hub:content:canChangeAccess", "hub:content:workspace", "hub:content:workspace:overview", "hub:content:workspace:dashboard", "hub:content:workspace:details", "hub:content:workspace:settings", "hub:content:workspace:settings:schedule", "hub:content:workspace:settings:discussions", "hub:content:workspace:collaborators", "hub:content:manage", "hub:content:canRecordDownloadErrors", "hub:content:downloads:displayErrors", "hub:content:document:create", "hub:content:fetch:portal", "hub:group", "hub:group:messaging", "hub:group:create", "hub:group:create:view", "hub:group:create:edit", "hub:group:delete", "hub:group:edit", "hub:group:view", "hub:group:view:messaging", "hub:group:owner", "hub:group:canChangeAccess", "hub:group:canAssignMembers", "hub:group:workspace", "hub:group:workspace:overview", "hub:group:workspace:dashboard", "hub:group:workspace:details", "hub:group:workspace:settings", "hub:group:settings:discussions", "hub:group:workspace:collaborators", "hub:group:workspace:content", "hub:group:workspace:members", "hub:group:workspace:members:messaging", "hub:group:workspace:events", "hub:group:shareContent", "hub:group:manage", "hub:group:opendata", "hub:page", "hub:page:create", "hub:page:delete", "hub:page:edit", "hub:page:view", "hub:page:canChangeAccess", "hub:page:workspace", "hub:page:workspace:overview", "hub:page:workspace:dashboard", "hub:page:workspace:details", "hub:page:workspace:settings", "hub:page:workspace:collaborators", "hub:page:manage", "platform:features:user:edit", "platform:features:user:fullEdit", "platform:features:user:manageVersions", "platform:marketplace:admin:manage", "platform:marketplace:admin:purchase", "platform:marketplace:admin:startTrial", "platform:opendata:user:designateGroup", "platform:opendata:user:openDataAdmin", "platform:portal:admin:assignToGroups", "platform:portal:admin:categorizeItems", "platform:portal:admin:changeUserRoles", "platform:portal:admin:createGPWebhook", "platform:portal:admin:createUpdateCapableGroup", "platform:portal:admin:createLeavingDisallowedGroup", "platform:portal:admin:deleteGroups", "platform:portal:admin:deleteItems", "platform:portal:admin:deleteUsers", "platform:portal:admin:disableUsers", "platform:portal:admin:inviteUsers", "platform:portal:admin:manageCollaborations", "platform:portal:admin:manageCredits", "platform:portal:admin:manageEnterpriseGroups", "platform:portal:admin:manageLicenses", "platform:portal:admin:manageRoles", "platform:portal:admin:manageSecurity", "platform:portal:admin:manageServers", "platform:portal:admin:manageUtilityServices", "platform:portal:admin:manageWebhooks", "platform:portal:admin:manageWebsite", "platform:portal:admin:reassignGroups", "platform:portal:admin:reassignItems", "platform:portal:admin:reassignUsers", "platform:portal:admin:shareToGroup", "platform:portal:admin:shareToOrg", "platform:portal:admin:shareToPublic", "platform:portal:admin:updateGroups", "platform:portal:admin:updateItemCategorySchema", "platform:portal:admin:updateItems", "platform:portal:admin:updateMemberCategorySchema", "platform:portal:admin:updateUsers", "platform:portal:admin:viewGroups", "platform:portal:admin:viewItems", "platform:portal:admin:viewUsers", "platform:portal:publisher:bulkPublishFromDataStores", "platform:portal:publisher:createDataPipelines", "platform:portal:publisher:createFeatureWebhook", "platform:portal:publisher:publishBigDataAnalytics", "platform:portal:publisher:publishDynamicImagery", "platform:portal:publisher:publishFeatures", "platform:portal:publisher:publishFeeds", "platform:portal:publisher:publishKnowledgeGraph", "platform:portal:publisher:publishRealTimeAnalytics", "platform:portal:publisher:publishScenes", "platform:portal:publisher:publishServerGPServices", "platform:portal:publisher:publishServerServices", "platform:portal:publisher:publishTiledImagery", "platform:portal:publisher:publishTiles", "platform:portal:publisher:registerDataStores", "platform:portal:user:addExternalMembersToGroup", "platform:portal:user:categorizeItems", "platform:portal:user:createGroup", "platform:portal:user:createItem", "platform:portal:user:invitePartneredCollaborationMembers", "platform:portal:user:joinGroup", "platform:portal:user:joinNonOrgGroup", "platform:portal:user:reassignItems", "platform:portal:user:receiveItems", "platform:portal:user:runWebTool", "platform:portal:user:shareGroupToOrg", "platform:portal:user:shareGroupToPublic", "platform:portal:user:shareToGroup", "platform:portal:user:shareToOrg", "platform:portal:user:shareToPublic", "platform:portal:user:viewHostedFeatureServices", "platform:portal:user:viewHostedTileServices", "platform:portal:user:viewOrgGroups", "platform:portal:user:viewOrgItems", "platform:portal:user:viewOrgUsers", "platform:portal:user:viewTracks", "platform:portal:user:useAIAssistants", "platform:premium:publisher:createAdvancedNotebooks", "platform:premium:publisher:createNotebooks", "platform:premium:publisher:geoanalytics", "platform:premium:publisher:rasteranalysis", "platform:premium:publisher:scheduleNotebooks", "platform:premium:user:demographics", "platform:premium:user:elevation", "platform:premium:user:featurereport", "platform:premium:user:geocode:stored", "platform:premium:user:geocode:temporary", "platform:premium:user:geocode", "platform:premium:user:geoenrichment", "platform:premium:user:networkanalysis:closestfacility", "platform:premium:user:networkanalysis:locationallocation", "platform:premium:user:networkanalysis:optimizedrouting", "platform:premium:user:networkanalysis:origindestinationcostmatrix", "platform:premium:user:networkanalysis:routing", "platform:premium:user:networkanalysis:servicearea", "platform:premium:user:networkanalysis:vehiclerouting", "platform:premium:user:networkanalysis", "platform:premium:user:places", "platform:premium:user:spatialanalysis", "hub:discussion", "hub:discussion:create", "hub:discussion:delete", "hub:discussion:edit", "hub:discussion:view", "hub:discussion:owner", "hub:discussion:canChangeAccess", "hub:discussion:workspace:overview", "hub:discussion:workspace:dashboard", "hub:discussion:workspace:details", "hub:discussion:workspace:settings", "hub:discussion:workspace:collaborators", "hub:discussion:workspace:metrics", "hub:discussion:workspace:settings:discussions", "hub:discussion:manage", "temp:hub:discussion:create", "hub:discussion:workspace:catalog", "hub:discussion:workspace:catalog:content", "hub:discussion:workspace:catalog:events", "hub:initiativeTemplate", "hub:initiativeTemplate:create", "hub:initiativeTemplate:delete", "hub:initiativeTemplate:edit", "hub:initiativeTemplate:view", "hub:initiativeTemplate:view:related", "hub:initiativeTemplate:canChangeAccess", "hub:initiativeTemplate:workspace", "hub:initiativeTemplate:workspace:dashboard", "hub:initiativeTemplate:workspace:details", "hub:initiativeTemplate:workspace:collaborators", "hub:initiativeTemplate:workspace:settings", "hub:initiativeTemplate:manage", "hub:template", "hub:template:create", "hub:template:delete", "hub:template:edit", "hub:template:manage", "hub:template:view", "hub:template:view:related", "hub:template:canChangeAccess", "hub:template:workspace", "hub:template:workspace:details", "hub:template:workspace:dashboard", "hub:template:workspace:collaborators", "hub:template:workspace:settings", "hub:release:2025R3", "hub:release:2026R1", "hub:release:2026R2", "hub:release:2026R3", "hub:gating:workspace:released", "hub:gating:configurableViews:released", "hub:gating:entity:slugs", "hub:feature:ai-assistant", "hub:platform:ai-assistant", "hub:feature:privacy", "hub:feature:workspace", "hub:feature:configurableViews", "hub:feature:user:preferences", "hub:card:follow", "hub:feature:workspace:user", "hub:feature:workspace:org", "hub:feature:keyboardshortcuts", "hub:feature:newentityview", "hub:feature:history", "hub:feature:catalogs", "hub:feature:catalogs:edit:appearance", "hub:feature:gallery-card:enterprise", "hub:feature:inline-workspace", "hub:feature:pagescatalog", "hub:feature:discussions:subscription", "hub:feature:event:thumbnail:upload", "hub:license:hub-premium", "hub:license:hub-basic", "hub:license:enterprise-sites", "hub:availability:alpha", "hub:availability:beta", "hub:availability:general", "hub:environment:qaext", "hub:environment:devext", "hub:environment:production", "hub:environment:enterprise", "hub:card:embed", "hub:feature:search:portal", "hub:feature:search:portal:crossOrg", "hub:feature:translations:14700", "hub:feature:translations:14701", "hub:event", "hub:event:create", "hub:event:edit", "hub:event:delete", "hub:event:view", "hub:event:owner", "hub:event:canChangeAccess", "hub:event:workspace", "hub:event:workspace:dashboard", "hub:event:workspace:details", "hub:event:workspace:settings", "hub:event:workspace:collaborators", "hub:event:workspace:manage", "hub:event:workspace:registrants", "hub:event:workspace:content", "hub:event:workspace:catalog", "hub:event:workspace:catalog:content", "hub:event:workspace:catalog:events", "hub:event:manage", "hub:user", "hub:user:view", "hub:user:edit", "hub:user:owner", "hub:user:workspace", "hub:user:workspace:overview", "hub:user:workspace:settings", "hub:user:workspace:content", "hub:user:workspace:groups", "hub:user:workspace:events", "hub:user:workspace:shared-with-me", "hub:user:workspace:members", "hub:user:manage", "hub:channel", "hub:channel:create", "hub:channel:delete", "hub:channel:edit", "hub:channel:view", "hub:channel:owner", "hub:channel:manage", "hub:channel:read", "hub:channel:write", "hub:channel:readWrite", "hub:channel:moderate"];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HubEntityType } from "../core/types/HubEntityType";
|
|
2
|
+
import { IArcGISContext } from "../types/IArcGISContext";
|
|
3
|
+
/**
|
|
4
|
+
* Adds a Hub entity resource. This util handles delegating
|
|
5
|
+
* to the correct resource add logic based on the entity type.
|
|
6
|
+
*
|
|
7
|
+
* @param type - type of the entity to add the resource for
|
|
8
|
+
* @param identifier - id of the entity to add the resource for
|
|
9
|
+
* @param resource - the resource to add
|
|
10
|
+
* @param name - name of the new resource file
|
|
11
|
+
* @param context - contextual portal and auth information
|
|
12
|
+
* @param opts.owner - (optional) owner of the resource to add, defaults to the current user if not provided
|
|
13
|
+
* @param opts.prefix - (optional) folder in which to store the new resource
|
|
14
|
+
* @throws {HubError} if there is an error during the add process or if adding is not yet implemented for the entity type
|
|
15
|
+
*/
|
|
16
|
+
export declare function addHubEntityResource(type: HubEntityType, identifier: string, resource: unknown, name: string, context: IArcGISContext, opts?: {
|
|
17
|
+
owner?: string;
|
|
18
|
+
prefix?: string;
|
|
19
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IArcGISContext } from "../types/IArcGISContext";
|
|
2
|
+
/**
|
|
3
|
+
* Thin wrapper around addItemResource to add a resource
|
|
4
|
+
* to a portal item and provide Hub-specific error
|
|
5
|
+
* handling.
|
|
6
|
+
*
|
|
7
|
+
* @param id - id of the item to add the resource to
|
|
8
|
+
* @param name - name of the resource file
|
|
9
|
+
* @param owner - owner of the item to add the resource to
|
|
10
|
+
* @param context - contextual portal and auth information
|
|
11
|
+
* @throws {HubError} if there is an error during the add process
|
|
12
|
+
*/
|
|
13
|
+
export declare function addResource(id: string, name: string, resource: unknown, context: IArcGISContext, opts?: {
|
|
14
|
+
owner?: string;
|
|
15
|
+
prefix?: string;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
success: boolean;
|
|
18
|
+
}>;
|