@esri/hub-common 9.13.2 → 9.16.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/es2017/ArcGISContext.js +215 -158
- package/dist/es2017/ArcGISContext.js.map +1 -1
- package/dist/es2017/ArcGISContextManager.js +171 -0
- package/dist/es2017/ArcGISContextManager.js.map +1 -0
- package/dist/es2017/Hub.js +70 -0
- package/dist/es2017/Hub.js.map +1 -0
- package/dist/es2017/HubError.js +34 -0
- package/dist/es2017/HubError.js.map +1 -0
- package/dist/es2017/collections.js +23 -0
- package/dist/es2017/collections.js.map +1 -1
- package/dist/es2017/content/_internal.js +12 -0
- package/dist/es2017/content/_internal.js.map +1 -1
- package/dist/es2017/content/index.js +42 -18
- package/dist/es2017/content/index.js.map +1 -1
- package/dist/es2017/core/helpers/PropertyMapper.js +95 -0
- package/dist/es2017/core/helpers/PropertyMapper.js.map +1 -0
- package/dist/es2017/core/index.js +3 -0
- package/dist/es2017/core/index.js.map +1 -0
- package/dist/es2017/core/traits/WithBannerImage.js +1 -0
- package/dist/es2017/core/traits/WithBannerImage.js.map +1 -0
- package/dist/es2017/core/traits/WithLayout.js +1 -0
- package/dist/es2017/core/traits/WithLayout.js.map +1 -0
- package/dist/es2017/core/traits/WithSlug.js +1 -0
- package/dist/es2017/core/traits/WithSlug.js.map +1 -0
- package/dist/es2017/core/traits/index.js +4 -0
- package/dist/es2017/core/traits/index.js.map +1 -0
- package/dist/es2017/core/types/IContentEnrichments.js +1 -0
- package/dist/es2017/core/types/IContentEnrichments.js.map +1 -0
- package/dist/es2017/core/types/IHubContent.js +1 -0
- package/dist/es2017/core/types/IHubContent.js.map +1 -0
- package/dist/es2017/core/types/IHubEntityBase.js +1 -0
- package/dist/es2017/core/types/IHubEntityBase.js.map +1 -0
- package/dist/es2017/core/types/IHubEntityManager.js +1 -0
- package/dist/es2017/core/types/IHubEntityManager.js.map +1 -0
- package/dist/es2017/core/types/IHubEvent.js +1 -0
- package/dist/es2017/core/types/IHubEvent.js.map +1 -0
- package/dist/es2017/core/types/IHubImage.js +1 -0
- package/dist/es2017/core/types/IHubImage.js.map +1 -0
- package/dist/es2017/core/types/IHubInitiative.js +1 -0
- package/dist/es2017/core/types/IHubInitiative.js.map +1 -0
- package/dist/es2017/core/types/IHubItemEntity.js +1 -0
- package/dist/es2017/core/types/IHubItemEntity.js.map +1 -0
- package/dist/es2017/core/types/IHubLayout.js +1 -0
- package/dist/es2017/core/types/IHubLayout.js.map +1 -0
- package/dist/es2017/core/types/IHubPage.js +1 -0
- package/dist/es2017/core/types/IHubPage.js.map +1 -0
- package/dist/es2017/core/types/IHubProject.js +1 -0
- package/dist/es2017/core/types/IHubProject.js.map +1 -0
- package/dist/es2017/core/types/IHubSite.js +1 -0
- package/dist/es2017/core/types/IHubSite.js.map +1 -0
- package/dist/es2017/core/types/IHubTimeline.js +1 -0
- package/dist/es2017/core/types/IHubTimeline.js.map +1 -0
- package/dist/es2017/core/types/IItemEnrichments.js +1 -0
- package/dist/es2017/core/types/IItemEnrichments.js.map +1 -0
- package/dist/es2017/core/types/index.js +15 -0
- package/dist/es2017/core/types/index.js.map +1 -0
- package/dist/es2017/index.js +11 -5
- package/dist/es2017/index.js.map +1 -1
- package/dist/es2017/items/fail-safe-update.js +2 -2
- package/dist/es2017/items/fail-safe-update.js.map +1 -1
- package/dist/es2017/items/get-model-from-options.js +2 -2
- package/dist/es2017/items/get-model-from-options.js.map +1 -1
- package/dist/es2017/items/index.js +2 -3
- package/dist/es2017/items/index.js.map +1 -1
- package/dist/es2017/items/slugs.js +92 -0
- package/dist/es2017/items/slugs.js.map +1 -0
- package/dist/es2017/models/index.js +98 -0
- package/dist/es2017/models/index.js.map +1 -0
- package/dist/es2017/{items/serialize-model.js → models/serializeModel.js} +1 -1
- package/dist/es2017/models/serializeModel.js.map +1 -0
- package/dist/es2017/projects/HubProjectManager.js +115 -0
- package/dist/es2017/projects/HubProjectManager.js.map +1 -0
- package/dist/es2017/projects/HubProjects.js +194 -0
- package/dist/es2017/projects/HubProjects.js.map +1 -0
- package/dist/es2017/projects/index.js +3 -0
- package/dist/es2017/projects/index.js.map +1 -0
- package/dist/es2017/search/_searchContent.js +18 -7
- package/dist/es2017/search/_searchContent.js.map +1 -1
- package/dist/es2017/search/_searchGroups.js +1 -11
- package/dist/es2017/search/_searchGroups.js.map +1 -1
- package/dist/es2017/search/utils.js +1 -1
- package/dist/es2017/urls/getHubApiFromPortalUrl.js +21 -0
- package/dist/es2017/urls/getHubApiFromPortalUrl.js.map +1 -0
- package/dist/es2017/urls/getPortalBaseFromOrgUrl.js +25 -0
- package/dist/es2017/urls/getPortalBaseFromOrgUrl.js.map +1 -0
- package/dist/es2017/urls/index.js +2 -0
- package/dist/es2017/urls/index.js.map +1 -1
- package/dist/es2017/utils/dasherize.js +25 -0
- package/dist/es2017/utils/dasherize.js.map +1 -0
- package/dist/es2017/utils/index.js +1 -0
- package/dist/es2017/utils/index.js.map +1 -1
- package/dist/esm/ArcGISContext.js +299 -200
- package/dist/esm/ArcGISContext.js.map +1 -1
- package/dist/esm/ArcGISContextManager.js +215 -0
- package/dist/esm/ArcGISContextManager.js.map +1 -0
- package/dist/esm/Hub.js +89 -0
- package/dist/esm/Hub.js.map +1 -0
- package/dist/esm/HubError.js +40 -0
- package/dist/esm/HubError.js.map +1 -0
- package/dist/esm/collections.js +23 -0
- package/dist/esm/collections.js.map +1 -1
- package/dist/esm/content/_internal.js +14 -0
- package/dist/esm/content/_internal.js.map +1 -1
- package/dist/esm/content/index.js +42 -18
- package/dist/esm/content/index.js.map +1 -1
- package/dist/esm/core/helpers/PropertyMapper.js +97 -0
- package/dist/esm/core/helpers/PropertyMapper.js.map +1 -0
- package/dist/esm/core/index.js +3 -0
- package/dist/esm/core/index.js.map +1 -0
- package/dist/esm/core/traits/WithBannerImage.js +1 -0
- package/dist/esm/core/traits/WithBannerImage.js.map +1 -0
- package/dist/esm/core/traits/WithLayout.js +1 -0
- package/dist/esm/core/traits/WithLayout.js.map +1 -0
- package/dist/esm/core/traits/WithSlug.js +1 -0
- package/dist/esm/core/traits/WithSlug.js.map +1 -0
- package/dist/esm/core/traits/index.js +4 -0
- package/dist/esm/core/traits/index.js.map +1 -0
- package/dist/esm/core/types/IContentEnrichments.js +1 -0
- package/dist/esm/core/types/IContentEnrichments.js.map +1 -0
- package/dist/esm/core/types/IHubContent.js +1 -0
- package/dist/esm/core/types/IHubContent.js.map +1 -0
- package/dist/esm/core/types/IHubEntityBase.js +1 -0
- package/dist/esm/core/types/IHubEntityBase.js.map +1 -0
- package/dist/esm/core/types/IHubEntityManager.js +1 -0
- package/dist/esm/core/types/IHubEntityManager.js.map +1 -0
- package/dist/esm/core/types/IHubEvent.js +1 -0
- package/dist/esm/core/types/IHubEvent.js.map +1 -0
- package/dist/esm/core/types/IHubImage.js +1 -0
- package/dist/esm/core/types/IHubImage.js.map +1 -0
- package/dist/esm/core/types/IHubInitiative.js +1 -0
- package/dist/esm/core/types/IHubInitiative.js.map +1 -0
- package/dist/esm/core/types/IHubItemEntity.js +1 -0
- package/dist/esm/core/types/IHubItemEntity.js.map +1 -0
- package/dist/esm/core/types/IHubLayout.js +1 -0
- package/dist/esm/core/types/IHubLayout.js.map +1 -0
- package/dist/esm/core/types/IHubPage.js +1 -0
- package/dist/esm/core/types/IHubPage.js.map +1 -0
- package/dist/esm/core/types/IHubProject.js +1 -0
- package/dist/esm/core/types/IHubProject.js.map +1 -0
- package/dist/esm/core/types/IHubSite.js +1 -0
- package/dist/esm/core/types/IHubSite.js.map +1 -0
- package/dist/esm/core/types/IHubTimeline.js +1 -0
- package/dist/esm/core/types/IHubTimeline.js.map +1 -0
- package/dist/esm/core/types/IItemEnrichments.js +1 -0
- package/dist/esm/core/types/IItemEnrichments.js.map +1 -0
- package/dist/esm/core/types/index.js +15 -0
- package/dist/esm/core/types/index.js.map +1 -0
- package/dist/esm/index.js +11 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/items/fail-safe-update.js +2 -2
- package/dist/esm/items/fail-safe-update.js.map +1 -1
- package/dist/esm/items/get-model-from-options.js +2 -2
- package/dist/esm/items/get-model-from-options.js.map +1 -1
- package/dist/esm/items/index.js +2 -3
- package/dist/esm/items/index.js.map +1 -1
- package/dist/esm/items/slugs.js +93 -0
- package/dist/esm/items/slugs.js.map +1 -0
- package/dist/esm/models/index.js +99 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/{items/serialize-model.js → models/serializeModel.js} +1 -1
- package/dist/esm/models/serializeModel.js.map +1 -0
- package/dist/esm/projects/HubProjectManager.js +142 -0
- package/dist/esm/projects/HubProjectManager.js.map +1 -0
- package/dist/esm/projects/HubProjects.js +225 -0
- package/dist/esm/projects/HubProjects.js.map +1 -0
- package/dist/esm/projects/index.js +3 -0
- package/dist/esm/projects/index.js.map +1 -0
- package/dist/esm/search/_searchContent.js +18 -7
- package/dist/esm/search/_searchContent.js.map +1 -1
- package/dist/esm/search/_searchGroups.js +3 -13
- package/dist/esm/search/_searchGroups.js.map +1 -1
- package/dist/esm/search/utils.js +1 -1
- package/dist/esm/urls/getHubApiFromPortalUrl.js +21 -0
- package/dist/esm/urls/getHubApiFromPortalUrl.js.map +1 -0
- package/dist/esm/urls/getPortalBaseFromOrgUrl.js +25 -0
- package/dist/esm/urls/getPortalBaseFromOrgUrl.js.map +1 -0
- package/dist/esm/urls/index.js +2 -0
- package/dist/esm/urls/index.js.map +1 -1
- package/dist/esm/utils/dasherize.js +25 -0
- package/dist/esm/utils/dasherize.js.map +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/node/ArcGISContext.js +215 -158
- package/dist/node/ArcGISContext.js.map +1 -1
- package/dist/node/ArcGISContextManager.js +175 -0
- package/dist/node/ArcGISContextManager.js.map +1 -0
- package/dist/node/Hub.js +74 -0
- package/dist/node/Hub.js.map +1 -0
- package/dist/node/HubError.js +37 -0
- package/dist/node/HubError.js.map +1 -0
- package/dist/node/collections.js +24 -1
- package/dist/node/collections.js.map +1 -1
- package/dist/node/content/_internal.js +13 -1
- package/dist/node/content/_internal.js.map +1 -1
- package/dist/node/content/index.js +42 -18
- package/dist/node/content/index.js.map +1 -1
- package/dist/node/core/helpers/PropertyMapper.js +101 -0
- package/dist/node/core/helpers/PropertyMapper.js.map +1 -0
- package/dist/node/core/index.js +6 -0
- package/dist/node/core/index.js.map +1 -0
- package/dist/node/core/traits/WithBannerImage.js +3 -0
- package/dist/node/core/traits/WithBannerImage.js.map +1 -0
- package/dist/node/core/traits/WithLayout.js +3 -0
- package/dist/node/core/traits/WithLayout.js.map +1 -0
- package/dist/node/core/traits/WithSlug.js +3 -0
- package/dist/node/core/traits/WithSlug.js.map +1 -0
- package/dist/node/core/traits/index.js +7 -0
- package/dist/node/core/traits/index.js.map +1 -0
- package/dist/node/core/types/IContentEnrichments.js +3 -0
- package/dist/node/core/types/IContentEnrichments.js.map +1 -0
- package/dist/node/core/types/IHubContent.js +3 -0
- package/dist/node/core/types/IHubContent.js.map +1 -0
- package/dist/node/core/types/IHubEntityBase.js +3 -0
- package/dist/node/core/types/IHubEntityBase.js.map +1 -0
- package/dist/node/core/types/IHubEntityManager.js +3 -0
- package/dist/node/core/types/IHubEntityManager.js.map +1 -0
- package/dist/node/core/types/IHubEvent.js +3 -0
- package/dist/node/core/types/IHubEvent.js.map +1 -0
- package/dist/node/core/types/IHubImage.js +3 -0
- package/dist/node/core/types/IHubImage.js.map +1 -0
- package/dist/node/core/types/IHubInitiative.js +3 -0
- package/dist/node/core/types/IHubInitiative.js.map +1 -0
- package/dist/node/core/types/IHubItemEntity.js +3 -0
- package/dist/node/core/types/IHubItemEntity.js.map +1 -0
- package/dist/node/core/types/IHubLayout.js +3 -0
- package/dist/node/core/types/IHubLayout.js.map +1 -0
- package/dist/node/core/types/IHubPage.js +3 -0
- package/dist/node/core/types/IHubPage.js.map +1 -0
- package/dist/node/core/types/IHubProject.js +3 -0
- package/dist/node/core/types/IHubProject.js.map +1 -0
- package/dist/node/core/types/IHubSite.js +3 -0
- package/dist/node/core/types/IHubSite.js.map +1 -0
- package/dist/node/core/types/IHubTimeline.js +3 -0
- package/dist/node/core/types/IHubTimeline.js.map +1 -0
- package/dist/node/core/types/IItemEnrichments.js +3 -0
- package/dist/node/core/types/IItemEnrichments.js.map +1 -0
- package/dist/node/core/types/index.js +18 -0
- package/dist/node/core/types/index.js.map +1 -0
- package/dist/node/index.js +12 -5
- package/dist/node/index.js.map +1 -1
- package/dist/node/items/fail-safe-update.js +3 -3
- package/dist/node/items/fail-safe-update.js.map +1 -1
- package/dist/node/items/get-model-from-options.js +3 -3
- package/dist/node/items/get-model-from-options.js.map +1 -1
- package/dist/node/items/index.js +2 -3
- package/dist/node/items/index.js.map +1 -1
- package/dist/node/items/slugs.js +99 -0
- package/dist/node/items/slugs.js.map +1 -0
- package/dist/node/models/index.js +106 -0
- package/dist/node/models/index.js.map +1 -0
- package/dist/node/{items/serialize-model.js → models/serializeModel.js} +1 -1
- package/dist/node/models/serializeModel.js.map +1 -0
- package/dist/node/projects/HubProjectManager.js +119 -0
- package/dist/node/projects/HubProjectManager.js.map +1 -0
- package/dist/node/projects/HubProjects.js +201 -0
- package/dist/node/projects/HubProjects.js.map +1 -0
- package/dist/node/projects/index.js +6 -0
- package/dist/node/projects/index.js.map +1 -0
- package/dist/node/search/_searchContent.js +17 -6
- package/dist/node/search/_searchContent.js.map +1 -1
- package/dist/node/search/_searchGroups.js +1 -11
- package/dist/node/search/_searchGroups.js.map +1 -1
- package/dist/node/search/utils.js +1 -1
- package/dist/node/urls/getHubApiFromPortalUrl.js +25 -0
- package/dist/node/urls/getHubApiFromPortalUrl.js.map +1 -0
- package/dist/node/urls/getPortalBaseFromOrgUrl.js +29 -0
- package/dist/node/urls/getPortalBaseFromOrgUrl.js.map +1 -0
- package/dist/node/urls/index.js +2 -0
- package/dist/node/urls/index.js.map +1 -1
- package/dist/node/utils/dasherize.js +29 -0
- package/dist/node/utils/dasherize.js.map +1 -0
- package/dist/node/utils/index.js +1 -0
- package/dist/node/utils/index.js.map +1 -1
- package/dist/types/ArcGISContext.d.ts +276 -66
- package/dist/types/ArcGISContextManager.d.ts +130 -0
- package/dist/types/Hub.d.ts +72 -0
- package/dist/types/HubError.d.ts +17 -0
- package/dist/types/collections.d.ts +12 -0
- package/dist/types/content/_internal.d.ts +66 -38
- package/dist/types/content/index.d.ts +17 -8
- package/dist/types/core/helpers/PropertyMapper.d.ts +69 -0
- package/dist/types/core/index.d.ts +2 -0
- package/dist/types/core/traits/WithBannerImage.d.ts +30 -0
- package/dist/types/core/traits/WithLayout.d.ts +54 -0
- package/dist/types/core/traits/WithSlug.d.ts +15 -0
- package/dist/types/core/traits/index.d.ts +3 -0
- package/dist/types/core/types/IContentEnrichments.d.ts +10 -0
- package/dist/types/core/types/IHubContent.d.ts +77 -0
- package/dist/types/core/types/IHubEntityBase.d.ts +41 -0
- package/dist/types/core/types/IHubEntityManager.d.ts +33 -0
- package/dist/types/core/types/IHubEvent.d.ts +10 -0
- package/dist/types/core/types/IHubImage.d.ts +25 -0
- package/dist/types/core/types/IHubInitiative.d.ts +8 -0
- package/dist/types/core/types/IHubItemEntity.d.ts +42 -0
- package/dist/types/core/types/IHubLayout.d.ts +20 -0
- package/dist/types/core/types/IHubPage.d.ts +8 -0
- package/dist/types/core/types/IHubProject.d.ts +15 -0
- package/dist/types/core/types/IHubSite.d.ts +11 -0
- package/dist/types/core/types/IHubTimeline.d.ts +41 -0
- package/dist/types/core/types/IItemEnrichments.d.ts +23 -0
- package/dist/types/core/types/index.d.ts +14 -0
- package/dist/types/index.d.ts +11 -5
- package/dist/types/items/index.d.ts +2 -3
- package/dist/types/items/slugs.d.ts +43 -0
- package/dist/types/models/index.d.ts +42 -0
- package/dist/types/{items/serialize-model.d.ts → models/serializeModel.d.ts} +0 -0
- package/dist/types/projects/HubProjectManager.d.ts +81 -0
- package/dist/types/projects/HubProjects.d.ts +31 -0
- package/dist/types/projects/index.d.ts +2 -0
- package/dist/types/search/utils.d.ts +1 -1
- package/dist/types/types.d.ts +2 -92
- package/dist/types/urls/getHubApiFromPortalUrl.d.ts +8 -0
- package/dist/types/urls/getPortalBaseFromOrgUrl.d.ts +9 -0
- package/dist/types/urls/index.d.ts +2 -0
- package/dist/types/utils/dasherize.d.ts +17 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/dist/umd/common.umd.js +2119 -1152
- package/dist/umd/common.umd.js.map +1 -1
- package/dist/umd/common.umd.min.js +1 -1
- package/dist/umd/common.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/dist/es2017/ArcGISContextState.js +0 -203
- package/dist/es2017/ArcGISContextState.js.map +0 -1
- package/dist/es2017/items/get-model.js +0 -19
- package/dist/es2017/items/get-model.js.map +0 -1
- package/dist/es2017/items/serialize-model.js.map +0 -1
- package/dist/esm/ArcGISContextState.js +0 -285
- package/dist/esm/ArcGISContextState.js.map +0 -1
- package/dist/esm/items/get-model.js +0 -19
- package/dist/esm/items/get-model.js.map +0 -1
- package/dist/esm/items/serialize-model.js.map +0 -1
- package/dist/node/ArcGISContextState.js +0 -207
- package/dist/node/ArcGISContextState.js.map +0 -1
- package/dist/node/items/get-model.js +0 -23
- package/dist/node/items/get-model.js.map +0 -1
- package/dist/node/items/serialize-model.js.map +0 -1
- package/dist/types/ArcGISContextState.d.ts +0 -129
- package/dist/types/items/get-model.d.ts +0 -8
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ArcGISContextManager, IArcGISContextManagerOptions } from "./ArcGISContextManager";
|
|
2
|
+
import { HubProjectManager } from "./projects/HubProjectManager";
|
|
3
|
+
/**
|
|
4
|
+
* Options for instantiating a Hub instance
|
|
5
|
+
*/
|
|
6
|
+
export interface IHubOptions {
|
|
7
|
+
contextManager?: ArcGISContextManager;
|
|
8
|
+
managerOptions?: IArcGISContextManagerOptions;
|
|
9
|
+
authOptions?: {
|
|
10
|
+
usename: string;
|
|
11
|
+
password: string;
|
|
12
|
+
portalUrl?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Hub class can be used as an entry point to managing
|
|
17
|
+
* content, teams, sites, projects etc, in an organization's Hub.
|
|
18
|
+
*
|
|
19
|
+
* ```js
|
|
20
|
+
* import {Hub} from '@esri/hub-common';
|
|
21
|
+
* // create a Hub instance, authenticating as a specific user
|
|
22
|
+
* // working against arcgis online
|
|
23
|
+
* const myHub = await Hub.create({authOptions: {username: "casey", password: "jones"}});
|
|
24
|
+
*
|
|
25
|
+
* myHub.context.currentUser //=> {username: "casey", ...} as IUser
|
|
26
|
+
*
|
|
27
|
+
* const projectStore = await myHub.getProjectStore();
|
|
28
|
+
*
|
|
29
|
+
* const pavingProject = await projectStore.create({name: "12th Street Paving"});
|
|
30
|
+
* pavingProject.summary = "This is the 2024 planned paving of 12th Street, between 8th and 11th Ave";
|
|
31
|
+
* await projectStore.update(pavingProject);
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* This is a convenience class. Hub Stores can be created
|
|
35
|
+
* directly, or the underlying functions can be imported an used
|
|
36
|
+
* as need for scenarios where these class structures introduce
|
|
37
|
+
* unwanted complexity
|
|
38
|
+
*/
|
|
39
|
+
export declare class Hub {
|
|
40
|
+
/**
|
|
41
|
+
* Hold a context manager, which should be a single instance for
|
|
42
|
+
* an application. When authentication changes, the .context
|
|
43
|
+
* property on the context manager will be replaced. As long as
|
|
44
|
+
* all the fns in this class leverage properties on .context
|
|
45
|
+
* everything be kept in sync.
|
|
46
|
+
*/
|
|
47
|
+
private _contextManager;
|
|
48
|
+
private _projectManager;
|
|
49
|
+
/**
|
|
50
|
+
* Private so we can employ a factory function should we need
|
|
51
|
+
* async work during creation
|
|
52
|
+
* @param contextManager
|
|
53
|
+
*/
|
|
54
|
+
private constructor();
|
|
55
|
+
/**
|
|
56
|
+
* Factory function to construct a new HubProjectStore instance.
|
|
57
|
+
*
|
|
58
|
+
* Note: Used so that we could do async actions in the ctor.
|
|
59
|
+
* @param contextManager
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
static create(options: IHubOptions): Promise<Hub>;
|
|
63
|
+
/**
|
|
64
|
+
* Getter to abstract the context manager
|
|
65
|
+
*/
|
|
66
|
+
get context(): import("./ArcGISContext").IArcGISContext;
|
|
67
|
+
/**
|
|
68
|
+
* Create a Project Store connected to the current Hub
|
|
69
|
+
* @returns
|
|
70
|
+
*/
|
|
71
|
+
get projects(): HubProjectManager;
|
|
72
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OperationError } from ".";
|
|
2
|
+
/**
|
|
3
|
+
* Generic Hub Error with an Error stack as well
|
|
4
|
+
* as an optional serialized OperationStack.
|
|
5
|
+
*
|
|
6
|
+
* Also accepts a `rootCause` Error object
|
|
7
|
+
*/
|
|
8
|
+
export default class HubError extends OperationError {
|
|
9
|
+
/**
|
|
10
|
+
* Creates an instance of HubError.
|
|
11
|
+
* @param {string} operation
|
|
12
|
+
* @param {string} [message]
|
|
13
|
+
* @param {Error} [rootCause]
|
|
14
|
+
* @memberof HubError
|
|
15
|
+
*/
|
|
16
|
+
constructor(operation: string, message?: string, rootCause?: Error);
|
|
17
|
+
}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { getCollection } from "@esri/hub-common";
|
|
4
|
+
* //
|
|
5
|
+
* getCollection('Feature Layer')
|
|
6
|
+
* > 'dataset'
|
|
7
|
+
* ```
|
|
8
|
+
* Get the Hub collection for a given item type
|
|
9
|
+
* @param itemType The ArcGIS [item type](https://developers.arcgis.com/rest/users-groups-and-items/items-and-item-types.htm).
|
|
10
|
+
* @returns the Hub collection of a given item type.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getCollection: (type?: string) => string;
|
|
1
13
|
export declare const collections: {
|
|
2
14
|
[key: string]: string[];
|
|
3
15
|
};
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* It's probably a good pattern to add functions here first and then
|
|
9
9
|
* move them to index.ts only when they are needed by a consumer.
|
|
10
10
|
*/
|
|
11
|
-
import {
|
|
11
|
+
import { IItem } from "@esri/arcgis-rest-types/dist/types/item";
|
|
12
|
+
import { BBox, IHubContent, IHubGeography, GeographyProvenance, IHubRequestOptions } from "..";
|
|
12
13
|
/**
|
|
13
14
|
* Create a new content with updated boundary properties
|
|
14
15
|
* @param content original content
|
|
@@ -17,70 +18,89 @@ import { BBox, IHubContent, IHubGeography, GeographyProvenance } from "../types"
|
|
|
17
18
|
*/
|
|
18
19
|
export declare const setContentBoundary: (content: IHubContent, boundary: GeographyProvenance) => {
|
|
19
20
|
boundary: IHubGeography;
|
|
20
|
-
item:
|
|
21
|
+
item: {
|
|
22
|
+
properties: any;
|
|
23
|
+
id: string;
|
|
24
|
+
owner: string;
|
|
25
|
+
tags: string[];
|
|
26
|
+
created: number;
|
|
27
|
+
modified: number;
|
|
28
|
+
numViews: number;
|
|
29
|
+
size: number;
|
|
30
|
+
protected?: boolean;
|
|
31
|
+
title: string;
|
|
32
|
+
type: string;
|
|
33
|
+
typeKeywords?: string[];
|
|
34
|
+
description?: string;
|
|
35
|
+
snippet?: string;
|
|
36
|
+
documentation?: string;
|
|
37
|
+
extent?: number[][];
|
|
38
|
+
categories?: string[];
|
|
39
|
+
spatialReference?: import("@esri/arcgis-rest-types").ISpatialReference;
|
|
40
|
+
culture?: string;
|
|
41
|
+
url?: string;
|
|
42
|
+
};
|
|
43
|
+
slug?: string;
|
|
21
44
|
hubId?: string;
|
|
45
|
+
identifier: string;
|
|
22
46
|
permissions: {
|
|
23
47
|
visibility: "private" | "public" | "org";
|
|
24
|
-
control?: import("
|
|
48
|
+
control?: import("..").AccessControl;
|
|
25
49
|
groups?: import("@esri/arcgis-rest-types").IGroup[];
|
|
26
50
|
};
|
|
27
|
-
family?: import("
|
|
28
|
-
|
|
29
|
-
|
|
51
|
+
family?: import("..").HubFamily;
|
|
52
|
+
categories?: string[];
|
|
53
|
+
isDownloadable: boolean;
|
|
54
|
+
structuredLicense?: import("..").IStructuredLicense;
|
|
30
55
|
publishedDate: Date;
|
|
31
56
|
publishedDateSource?: string;
|
|
32
57
|
updateFrequency?: string;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
metrics?: {
|
|
36
|
-
visibility: "private" | "public" | "org" | "updateGroups";
|
|
37
|
-
};
|
|
38
|
-
slug?: string;
|
|
58
|
+
portalHomeUrl?: string;
|
|
59
|
+
portalApiUrl?: string;
|
|
39
60
|
portalDataUrl?: string;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
data?: {
|
|
43
|
-
[propName: string]: any;
|
|
44
|
-
};
|
|
45
|
-
server?: Partial<import("@esri/arcgis-rest-types").IFeatureServiceDefinition>;
|
|
46
|
-
layers?: Partial<import("@esri/arcgis-rest-types").ILayerDefinition>[];
|
|
61
|
+
actionLinks?: import("..").IActionLink[];
|
|
62
|
+
hubActions?: object;
|
|
47
63
|
layer?: Partial<import("@esri/arcgis-rest-types").ILayerDefinition>;
|
|
48
|
-
|
|
64
|
+
itemCategories?: string[];
|
|
65
|
+
normalizedType?: string;
|
|
49
66
|
orgId?: string;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
67
|
+
thumbnailUrl?: string;
|
|
68
|
+
owner: string;
|
|
69
|
+
description?: string;
|
|
70
|
+
culture?: string;
|
|
71
|
+
tags: string[];
|
|
72
|
+
typeKeywords?: string[];
|
|
73
|
+
url?: string;
|
|
74
|
+
id: string;
|
|
53
75
|
name: string;
|
|
54
76
|
summary?: string;
|
|
55
|
-
hubType: import("../types").HubType;
|
|
56
77
|
createdDate: Date;
|
|
57
|
-
createdDateSource
|
|
78
|
+
createdDateSource: string;
|
|
58
79
|
updatedDate: Date;
|
|
59
|
-
updatedDateSource
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
80
|
+
updatedDateSource: string;
|
|
81
|
+
type: string;
|
|
82
|
+
server?: Partial<import("@esri/arcgis-rest-types").IFeatureServiceDefinition>;
|
|
83
|
+
layers?: Partial<import("@esri/arcgis-rest-types").ILayerDefinition>[];
|
|
84
|
+
recordCount?: number;
|
|
85
|
+
data?: {
|
|
86
|
+
[propName: string]: any;
|
|
87
|
+
};
|
|
63
88
|
metadata?: any;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
89
|
+
groupIds?: string[];
|
|
90
|
+
ownerUser?: import("@esri/arcgis-rest-types").IUser;
|
|
91
|
+
org?: Partial<import("@esri/arcgis-rest-portal").IPortal>;
|
|
92
|
+
errors?: import("..").IEnrichmentErrorInfo[];
|
|
67
93
|
created: number;
|
|
68
94
|
modified: number;
|
|
69
95
|
numViews: number;
|
|
70
96
|
size: number;
|
|
71
97
|
protected?: boolean;
|
|
72
98
|
title: string;
|
|
73
|
-
type: string;
|
|
74
|
-
typeKeywords?: string[];
|
|
75
|
-
description?: string;
|
|
76
99
|
snippet?: string;
|
|
77
100
|
documentation?: string;
|
|
78
101
|
extent?: number[][];
|
|
79
|
-
categories?: string[];
|
|
80
102
|
spatialReference?: import("@esri/arcgis-rest-types").ISpatialReference;
|
|
81
|
-
culture?: string;
|
|
82
103
|
properties?: any;
|
|
83
|
-
url?: string;
|
|
84
104
|
};
|
|
85
105
|
/**
|
|
86
106
|
* Create a new content with updated extent and derived properties like boundary
|
|
@@ -89,3 +109,11 @@ export declare const setContentBoundary: (content: IHubContent, boundary: Geogra
|
|
|
89
109
|
* @returns a new content with the updated extent and boundary
|
|
90
110
|
*/
|
|
91
111
|
export declare const setContentExtent: (content: IHubContent, extent: BBox) => IHubContent;
|
|
112
|
+
/**
|
|
113
|
+
* Returns whether or not an item is a proxied csv
|
|
114
|
+
*
|
|
115
|
+
* @param item
|
|
116
|
+
* @param requestOptions Hub Request Options (including whether we're in portal)
|
|
117
|
+
* @returns
|
|
118
|
+
*/
|
|
119
|
+
export declare const isProxiedCSV: (item: IItem, requestOptions: IHubRequestOptions) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ResourceObject } from "jsonapi-typescript";
|
|
2
2
|
import { IItem } from "@esri/arcgis-rest-portal";
|
|
3
|
-
import { HubType, HubFamily } from "../types";
|
|
4
|
-
import { IHubContent
|
|
3
|
+
import { HubType, HubFamily, IModel, IHubRequestOptions } from "../types";
|
|
4
|
+
import { IHubContent } from "..";
|
|
5
5
|
/**
|
|
6
6
|
* JSONAPI dataset resource returned by the Hub API
|
|
7
7
|
*/
|
|
@@ -204,25 +204,25 @@ export declare function datasetToContent(dataset: DatasetResource): IHubContent;
|
|
|
204
204
|
export declare function datasetToItem(dataset: DatasetResource): IItem;
|
|
205
205
|
/**
|
|
206
206
|
* returns a new content that has the specified type and
|
|
207
|
-
* and updated related properties like
|
|
207
|
+
* and updated related properties like, family, etc
|
|
208
208
|
* @param content orignal content
|
|
209
209
|
* @param type new type
|
|
210
210
|
* @returns new content
|
|
211
211
|
*/
|
|
212
212
|
export declare const setContentType: (content: IHubContent, type: string) => IHubContent;
|
|
213
213
|
/**
|
|
214
|
-
* Compute the content type icon based on the
|
|
215
|
-
* @param
|
|
214
|
+
* Compute the content type icon based on the content type
|
|
215
|
+
* @param content type
|
|
216
216
|
* @returns content type icon
|
|
217
217
|
*/
|
|
218
|
-
export declare const getContentTypeIcon: (
|
|
218
|
+
export declare const getContentTypeIcon: (contentType: string) => any;
|
|
219
219
|
/**
|
|
220
220
|
* Compute the content type label
|
|
221
|
-
* @param
|
|
221
|
+
* @param contentType
|
|
222
222
|
* @param isProxied
|
|
223
223
|
* @returns content type label
|
|
224
224
|
*/
|
|
225
|
-
export declare const getContentTypeLabel: (
|
|
225
|
+
export declare const getContentTypeLabel: (contentType: string, isProxied: boolean) => string;
|
|
226
226
|
/**
|
|
227
227
|
* returns a new content that has the specified hubId and updated identifier
|
|
228
228
|
* @param content orignal content
|
|
@@ -249,3 +249,12 @@ export declare const getContentSiteUrls: (content: IHubContent, siteModel: IMode
|
|
|
249
249
|
* @returns
|
|
250
250
|
*/
|
|
251
251
|
export declare const setContentSiteUrls: (content: IHubContent, siteModel: IModel) => IHubContent;
|
|
252
|
+
/**
|
|
253
|
+
* If an item is a proxied csv, returns the url for the proxying feature layer.
|
|
254
|
+
* If the item is not a proxied csv, returns undefined.
|
|
255
|
+
*
|
|
256
|
+
* @param item
|
|
257
|
+
* @param requestOptions Hub Request Options (including whether we're in portal)
|
|
258
|
+
* @returns
|
|
259
|
+
*/
|
|
260
|
+
export declare const getProxyUrl: (item: IItem, requestOptions: IHubRequestOptions) => string;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { IModel } from "../..";
|
|
2
|
+
/**
|
|
3
|
+
* Manage forward and backward property mappings to
|
|
4
|
+
* streamline conversion between the Hub entities, and
|
|
5
|
+
* the backing IModel
|
|
6
|
+
*/
|
|
7
|
+
export declare class PropertyMapper<T> {
|
|
8
|
+
mappings: IPropertyMap[];
|
|
9
|
+
/**
|
|
10
|
+
* Pass in the mappings between the Entity and
|
|
11
|
+
* it's backing structure (model or otherwise)
|
|
12
|
+
* @param mappings
|
|
13
|
+
*/
|
|
14
|
+
constructor(mappings: IPropertyMap[]);
|
|
15
|
+
/**
|
|
16
|
+
* Map properties from a model on to the entity object.
|
|
17
|
+
*
|
|
18
|
+
* Used when constructing an entity can from a fetched model,
|
|
19
|
+
* in which case the entity should be an empty object (`{}`).
|
|
20
|
+
*
|
|
21
|
+
* Can also be used to apply changes to an entity from a model,
|
|
22
|
+
* in which case an existing entity can be passed in.
|
|
23
|
+
* @param model
|
|
24
|
+
* @param object
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
modelToObject(model: IModel, object: T): T;
|
|
28
|
+
/**
|
|
29
|
+
* Map properties from an entity object onto a model.
|
|
30
|
+
*
|
|
31
|
+
* Typically the model will already exist, and this
|
|
32
|
+
* method is used to transfer changes to the model
|
|
33
|
+
* prior to storage.
|
|
34
|
+
* @param object
|
|
35
|
+
* @param model
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
objectToModel(object: T, model: IModel): IModel;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Property Map Entry that provides a cross-walk
|
|
42
|
+
* between a property path (`name`) on the "object"
|
|
43
|
+
* to a property path on a model (`item.title`).
|
|
44
|
+
*
|
|
45
|
+
* This enables autmatic mapping of properties between
|
|
46
|
+
* the two types of objects.
|
|
47
|
+
*/
|
|
48
|
+
export interface IPropertyMap {
|
|
49
|
+
objectKey: string;
|
|
50
|
+
modelKey: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Generic function to apply properties from an Object
|
|
54
|
+
* (i.e. IHubProject) onto a Model that can be persisted to an Item
|
|
55
|
+
* @param object
|
|
56
|
+
* @param model
|
|
57
|
+
* @param mappings
|
|
58
|
+
* @returns
|
|
59
|
+
*/
|
|
60
|
+
export declare function mapObjectToModel<T>(object: T, model: IModel, mappings: IPropertyMap[]): IModel;
|
|
61
|
+
/**
|
|
62
|
+
* Generic function to apply properties from a Model
|
|
63
|
+
* onto an Object (i.e. IHubProject etc)
|
|
64
|
+
* @param model
|
|
65
|
+
* @param object
|
|
66
|
+
* @param mappings
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
69
|
+
export declare function mapModelToObject<T>(model: IModel, object: T, mappings: IPropertyMap[]): T;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
|
|
2
|
+
import { IHubImage, IHubImageOptions } from "../types/IHubImage";
|
|
3
|
+
/**
|
|
4
|
+
* WithBannerImage Trait
|
|
5
|
+
* Adds a .bannerImage property
|
|
6
|
+
*/
|
|
7
|
+
export interface IWithBannerImage {
|
|
8
|
+
/**
|
|
9
|
+
* Banner Image as IHubImage
|
|
10
|
+
*/
|
|
11
|
+
bannerImage?: IHubImage;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Defines functions for working with Banner Images
|
|
15
|
+
*/
|
|
16
|
+
export interface IWithBannerImageStore {
|
|
17
|
+
/**
|
|
18
|
+
* Store a banner image
|
|
19
|
+
* @param id
|
|
20
|
+
* @param opts
|
|
21
|
+
* @param ro
|
|
22
|
+
*/
|
|
23
|
+
setBannerImage(id: string, opts: IHubImageOptions, ro: IUserRequestOptions): Promise<IHubImage>;
|
|
24
|
+
/**
|
|
25
|
+
* Clear a banner image
|
|
26
|
+
* @param id
|
|
27
|
+
* @param ro
|
|
28
|
+
*/
|
|
29
|
+
clearBannerImage(id: string, ro: IUserRequestOptions): Promise<void>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
|
|
2
|
+
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
3
|
+
import { IHubLayout } from "../types/IHubLayout";
|
|
4
|
+
/**
|
|
5
|
+
* Properties associated with a Layout
|
|
6
|
+
*/
|
|
7
|
+
export interface IWithLayout {
|
|
8
|
+
/**
|
|
9
|
+
* Layout property
|
|
10
|
+
*/
|
|
11
|
+
layout?: IHubLayout;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Defined layout related functions that a module
|
|
15
|
+
* working with IWithLayout objects must implement
|
|
16
|
+
*/
|
|
17
|
+
export interface IWithLayoutStore {
|
|
18
|
+
/**
|
|
19
|
+
* Given a version name, copy that into the item's /data
|
|
20
|
+
* making it the "active version"
|
|
21
|
+
* @param id
|
|
22
|
+
* @param ro
|
|
23
|
+
*/
|
|
24
|
+
setActiveVersion(id: string, ro: IUserRequestOptions): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Return a list of all the versions by name
|
|
27
|
+
* @param id
|
|
28
|
+
* @param ro
|
|
29
|
+
*/
|
|
30
|
+
listVersions(id: string, ro: IRequestOptions): Promise<string[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Destroy the resource backing a version
|
|
33
|
+
* @param id
|
|
34
|
+
* @param name
|
|
35
|
+
* @param ro
|
|
36
|
+
*/
|
|
37
|
+
destroyVersion(id: string, name: string, ro: IUserRequestOptions): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Store a version as a resource, with the given name
|
|
40
|
+
* @param id
|
|
41
|
+
* @param name
|
|
42
|
+
* @param layout
|
|
43
|
+
* @param ro
|
|
44
|
+
*/
|
|
45
|
+
saveVersion(id: string, name: string, layout: IHubLayout, ro: IUserRequestOptions): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Fetch the layout from a specific version.
|
|
48
|
+
* Used when editing a specific version.
|
|
49
|
+
* @param id
|
|
50
|
+
* @param name
|
|
51
|
+
* @param ro
|
|
52
|
+
*/
|
|
53
|
+
loadVersion(id: string, name: string, ro: IRequestOptions): Promise<IHubLayout>;
|
|
54
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds slug and related properties
|
|
3
|
+
*/
|
|
4
|
+
export interface IWithSlug {
|
|
5
|
+
/**
|
|
6
|
+
* Slug that can be used to lookup an entity
|
|
7
|
+
* by something other than it's id
|
|
8
|
+
*/
|
|
9
|
+
slug?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Organization urlKey used to construct the
|
|
12
|
+
* slug
|
|
13
|
+
*/
|
|
14
|
+
orgUrlKey: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IFeatureServiceDefinition, ILayerDefinition } from "@esri/arcgis-rest-feature-layer";
|
|
2
|
+
import { IItemEnrichments } from "./IItemEnrichments";
|
|
3
|
+
export interface IContentEnrichments extends IItemEnrichments {
|
|
4
|
+
/** Information about the service referenced by this content (currentVersion, capabilities, maxRecordCount etc) */
|
|
5
|
+
server?: Partial<IFeatureServiceDefinition>;
|
|
6
|
+
/** Detailed information about the service's layers (geometryType, fields, etc) for related layers in the service */
|
|
7
|
+
layers?: Array<Partial<ILayerDefinition>>;
|
|
8
|
+
/** The count of records for the layer referenced by this content */
|
|
9
|
+
recordCount?: number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { IItem, IGroup } from "@esri/arcgis-rest-portal";
|
|
2
|
+
import { ILayerDefinition } from "@esri/arcgis-rest-feature-layer";
|
|
3
|
+
import { Visibility, AccessControl, HubFamily, IActionLink, IStructuredLicense } from "../..";
|
|
4
|
+
import { IHubItemEntity } from ".";
|
|
5
|
+
import { IContentEnrichments } from "./IContentEnrichments";
|
|
6
|
+
/**
|
|
7
|
+
* Data model for content
|
|
8
|
+
*/
|
|
9
|
+
export interface IHubContent extends IHubItemEntity, IContentEnrichments, IItem {
|
|
10
|
+
/**
|
|
11
|
+
* The underlying portal item referenced by this content
|
|
12
|
+
*/
|
|
13
|
+
item: IItem;
|
|
14
|
+
/**
|
|
15
|
+
* Slug that can be used to lookup an entity
|
|
16
|
+
* by something other than it's id
|
|
17
|
+
*/
|
|
18
|
+
slug?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The content's ID for use with the Hub API
|
|
21
|
+
* For most content this will be the item's id
|
|
22
|
+
* For layers this will be `<itemId>_<layerId>`
|
|
23
|
+
* This will be undefined for private items and in enterprise
|
|
24
|
+
* because only public online items are included in the Hub API
|
|
25
|
+
*/
|
|
26
|
+
hubId?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The preferred identifier to use for Hub URLs.
|
|
29
|
+
* This will be either the slug, hubId, or item id.
|
|
30
|
+
*/
|
|
31
|
+
identifier: string;
|
|
32
|
+
/**
|
|
33
|
+
* Content visibility and access control, including groups
|
|
34
|
+
*/
|
|
35
|
+
permissions: {
|
|
36
|
+
/** Visibility of the content */
|
|
37
|
+
visibility: Visibility;
|
|
38
|
+
/** Current user's control over the content */
|
|
39
|
+
control?: AccessControl;
|
|
40
|
+
/** The groups that have access to the item (as far as you know) */
|
|
41
|
+
groups?: IGroup[];
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* The the family of related types that this content belongs to.
|
|
45
|
+
*/
|
|
46
|
+
family?: HubFamily;
|
|
47
|
+
/** Parsed item categories (see parseItemCategories) */
|
|
48
|
+
categories?: string[];
|
|
49
|
+
/** Whether the content is downloadable in the Hub app */
|
|
50
|
+
isDownloadable: boolean;
|
|
51
|
+
/** The content's structured license info */
|
|
52
|
+
structuredLicense?: IStructuredLicense;
|
|
53
|
+
/**
|
|
54
|
+
* Date the content was published (formal metadata),
|
|
55
|
+
* defaults to the date the content was created
|
|
56
|
+
*/
|
|
57
|
+
publishedDate: Date;
|
|
58
|
+
/** Description of the source of the published date */
|
|
59
|
+
publishedDateSource?: string;
|
|
60
|
+
/** Frequency at which the content is updated */
|
|
61
|
+
updateFrequency?: string;
|
|
62
|
+
/** URL of the resource's page in the Portal Home application */
|
|
63
|
+
portalHomeUrl?: string;
|
|
64
|
+
/** URL of the Portal API endpoint for the resource */
|
|
65
|
+
portalApiUrl?: string;
|
|
66
|
+
/** URL of the Portal API data endpoint for the resource */
|
|
67
|
+
portalDataUrl?: string;
|
|
68
|
+
/** Optional links to show in the Hub application for this content */
|
|
69
|
+
actionLinks?: IActionLink[];
|
|
70
|
+
/** Configure which Hub application actions (i.e. create web map) are available for this content */
|
|
71
|
+
hubActions?: object;
|
|
72
|
+
/** Information about the layer referenced by this content (geometryType, fields, etc) */
|
|
73
|
+
layer?: Partial<ILayerDefinition>;
|
|
74
|
+
itemCategories?: string[];
|
|
75
|
+
normalizedType?: string;
|
|
76
|
+
orgId?: string;
|
|
77
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base properties for Hub Entities
|
|
3
|
+
* This is a subset of `IItem`, that can apply to
|
|
4
|
+
* models that are not backed by items.
|
|
5
|
+
*/
|
|
6
|
+
export interface IHubEntityBase {
|
|
7
|
+
/**
|
|
8
|
+
* Id of the entity as a string
|
|
9
|
+
*/
|
|
10
|
+
id: string;
|
|
11
|
+
/**
|
|
12
|
+
* Name of the Entity
|
|
13
|
+
* For Entities backed by items, this is typically the title
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* Simple summary of the Entity.
|
|
18
|
+
* For items, this is typically the `snippet` property.
|
|
19
|
+
*/
|
|
20
|
+
summary?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Date the entity was created
|
|
23
|
+
*/
|
|
24
|
+
createdDate: Date;
|
|
25
|
+
/**
|
|
26
|
+
* Source of the creation date
|
|
27
|
+
*/
|
|
28
|
+
createdDateSource: string;
|
|
29
|
+
/**
|
|
30
|
+
* Date the entity was last updated
|
|
31
|
+
*/
|
|
32
|
+
updatedDate: Date;
|
|
33
|
+
/**
|
|
34
|
+
* Source of the updated date
|
|
35
|
+
*/
|
|
36
|
+
updatedDateSource: string;
|
|
37
|
+
/**
|
|
38
|
+
* Type of entity
|
|
39
|
+
*/
|
|
40
|
+
type: string;
|
|
41
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
|
|
2
|
+
import { IRequestOptions } from "@esri/arcgis-rest-request";
|
|
3
|
+
/**
|
|
4
|
+
* Baseline CRUD+Search functions required for all Store classes
|
|
5
|
+
*/
|
|
6
|
+
export interface IHubEntityManager<T> {
|
|
7
|
+
/**
|
|
8
|
+
* Create and Store a new Entity
|
|
9
|
+
* @param obj
|
|
10
|
+
* @param requestOptions
|
|
11
|
+
*/
|
|
12
|
+
create(obj: T, requestOptions: IUserRequestOptions): Promise<T>;
|
|
13
|
+
/**
|
|
14
|
+
* Update an existing Entity
|
|
15
|
+
* @param obj
|
|
16
|
+
* @param requestOptions
|
|
17
|
+
*/
|
|
18
|
+
update(obj: T, requestOptions: IUserRequestOptions): Promise<T>;
|
|
19
|
+
/**
|
|
20
|
+
* Destroy an Entity
|
|
21
|
+
* @param id
|
|
22
|
+
* @param requestOptions
|
|
23
|
+
*/
|
|
24
|
+
destroy(id: string, requestOptions: IUserRequestOptions): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Get an entity by an identifier. Implementations can handle this
|
|
27
|
+
* differently as needed. i.e. a HubProject can be fetched by item id (guid)
|
|
28
|
+
* or by a slug.
|
|
29
|
+
* @param identifier
|
|
30
|
+
* @param requestOptions
|
|
31
|
+
*/
|
|
32
|
+
fetch(identifier: string, requestOptions: IRequestOptions): Promise<T>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IHubEntityBase } from "./IHubEntityBase";
|
|
2
|
+
/**
|
|
3
|
+
* DRAFT: Under development and more properties will likely be added
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export interface IHubEvent extends IHubEntityBase {
|
|
7
|
+
location: string;
|
|
8
|
+
startDate: Date;
|
|
9
|
+
readonly owner: string;
|
|
10
|
+
}
|