@esri/hub-common 14.74.1 → 14.75.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/associations/addAssociation.js +3 -0
- package/dist/esm/associations/addAssociation.js.map +1 -1
- package/dist/esm/associations/breakAssociation.js +54 -0
- package/dist/esm/associations/breakAssociation.js.map +1 -0
- package/dist/esm/associations/getAssociatedEntitiesQuery.js +33 -0
- package/dist/esm/associations/getAssociatedEntitiesQuery.js.map +1 -0
- package/dist/esm/associations/getAssociationStats.js +49 -0
- package/dist/esm/associations/getAssociationStats.js.map +1 -0
- package/dist/esm/associations/getAvailableToRequestEntitiesQuery.js +65 -0
- package/dist/esm/associations/getAvailableToRequestEntitiesQuery.js.map +1 -0
- package/dist/esm/associations/getPendingEntitiesQuery.js +41 -0
- package/dist/esm/associations/getPendingEntitiesQuery.js.map +1 -0
- package/dist/esm/associations/getRequestingEntitiesQuery.js +41 -0
- package/dist/esm/associations/getRequestingEntitiesQuery.js.map +1 -0
- package/dist/esm/associations/getWellKnownAssociationsCatalog.js +72 -0
- package/dist/esm/associations/getWellKnownAssociationsCatalog.js.map +1 -0
- package/dist/esm/associations/index.js +12 -0
- package/dist/esm/associations/index.js.map +1 -1
- package/dist/esm/associations/internal/getAssociationHierarchy.js +33 -0
- package/dist/esm/associations/internal/getAssociationHierarchy.js.map +1 -0
- package/dist/esm/associations/internal/getIdsFromAssociationGroups.js +25 -0
- package/dist/esm/associations/internal/getIdsFromAssociationGroups.js.map +1 -0
- package/dist/esm/associations/internal/getIdsFromKeywords.js +22 -0
- package/dist/esm/associations/internal/getIdsFromKeywords.js.map +1 -0
- package/dist/esm/associations/internal/getIncludesAndReferencesQuery.js +58 -0
- package/dist/esm/associations/internal/getIncludesAndReferencesQuery.js.map +1 -0
- package/dist/esm/associations/internal/getIncludesDoesNotReferenceQuery.js +58 -0
- package/dist/esm/associations/internal/getIncludesDoesNotReferenceQuery.js.map +1 -0
- package/dist/esm/associations/internal/getReferencesDoesNotIncludeQuery.js +62 -0
- package/dist/esm/associations/internal/getReferencesDoesNotIncludeQuery.js.map +1 -0
- package/dist/esm/associations/internal/getTypeByIdsQuery.js +13 -15
- package/dist/esm/associations/internal/getTypeByIdsQuery.js.map +1 -1
- package/dist/esm/associations/internal/getTypeByNotIdsQuery.js +26 -0
- package/dist/esm/associations/internal/getTypeByNotIdsQuery.js.map +1 -0
- package/dist/esm/associations/internal/getTypeWithKeywordQuery.js +11 -6
- package/dist/esm/associations/internal/getTypeWithKeywordQuery.js.map +1 -1
- package/dist/esm/associations/internal/getTypeWithoutKeywordQuery.js +10 -5
- package/dist/esm/associations/internal/getTypeWithoutKeywordQuery.js.map +1 -1
- package/dist/esm/associations/internal/isAssociationSupported.js +29 -0
- package/dist/esm/associations/internal/isAssociationSupported.js.map +1 -0
- package/dist/esm/associations/internal/removeAssociationKeyword.js +16 -0
- package/dist/esm/associations/internal/removeAssociationKeyword.js.map +1 -0
- package/dist/esm/associations/internal/setAssociationKeyword.js +18 -0
- package/dist/esm/associations/internal/setAssociationKeyword.js.map +1 -0
- package/dist/esm/associations/listAssociations.js +4 -0
- package/dist/esm/associations/listAssociations.js.map +1 -1
- package/dist/esm/associations/removeAssociation.js +3 -0
- package/dist/esm/associations/removeAssociation.js.map +1 -1
- package/dist/esm/associations/requestAssociation.js +57 -0
- package/dist/esm/associations/requestAssociation.js.map +1 -0
- package/dist/esm/associations/types.js +0 -1
- package/dist/esm/associations/types.js.map +1 -1
- package/dist/esm/core/HubItemEntity.js +33 -10
- package/dist/esm/core/HubItemEntity.js.map +1 -1
- package/dist/esm/core/_internal/getBasePropertyMap.js +1 -1
- package/dist/esm/core/_internal/getBasePropertyMap.js.map +1 -1
- package/dist/esm/core/getTypesFromEntityType.js +39 -0
- package/dist/esm/core/getTypesFromEntityType.js.map +1 -0
- package/dist/esm/core/index.js +1 -0
- package/dist/esm/core/index.js.map +1 -1
- package/dist/esm/core/processActionLinks.js +1 -1
- package/dist/esm/core/processActionLinks.js.map +1 -1
- package/dist/esm/core/updateHubEntity.js +4 -0
- package/dist/esm/core/updateHubEntity.js.map +1 -1
- package/dist/esm/initiatives/HubInitiatives.js +15 -42
- package/dist/esm/initiatives/HubInitiatives.js.map +1 -1
- package/dist/esm/initiatives/_internal/InitiativeAssociationHierarchies.js +5 -0
- package/dist/esm/initiatives/_internal/InitiativeAssociationHierarchies.js.map +1 -0
- package/dist/esm/initiatives/_internal/InitiativeBusinessRules.js +29 -0
- package/dist/esm/initiatives/_internal/InitiativeBusinessRules.js.map +1 -1
- package/dist/esm/projects/_internal/ProjectAssociationHierarchies.js +5 -0
- package/dist/esm/projects/_internal/ProjectAssociationHierarchies.js.map +1 -0
- package/dist/esm/projects/_internal/ProjectBusinessRules.js +6 -0
- package/dist/esm/projects/_internal/ProjectBusinessRules.js.map +1 -1
- package/dist/esm/projects/_internal/computeProps.js +4 -2
- package/dist/esm/projects/_internal/computeProps.js.map +1 -1
- package/dist/esm/projects/fetch.js +3 -0
- package/dist/esm/projects/fetch.js.map +1 -1
- package/dist/esm/search/_internal/buildCatalog.js +25 -0
- package/dist/esm/search/_internal/buildCatalog.js.map +1 -0
- package/dist/esm/search/wellKnownCatalog.js +29 -43
- package/dist/esm/search/wellKnownCatalog.js.map +1 -1
- package/dist/node/associations/addAssociation.js +3 -0
- package/dist/node/associations/addAssociation.js.map +1 -1
- package/dist/node/associations/breakAssociation.js +57 -0
- package/dist/node/associations/breakAssociation.js.map +1 -0
- package/dist/node/associations/getAssociatedEntitiesQuery.js +36 -0
- package/dist/node/associations/getAssociatedEntitiesQuery.js.map +1 -0
- package/dist/node/associations/getAssociationStats.js +52 -0
- package/dist/node/associations/getAssociationStats.js.map +1 -0
- package/dist/node/associations/getAvailableToRequestEntitiesQuery.js +68 -0
- package/dist/node/associations/getAvailableToRequestEntitiesQuery.js.map +1 -0
- package/dist/node/associations/getPendingEntitiesQuery.js +44 -0
- package/dist/node/associations/getPendingEntitiesQuery.js.map +1 -0
- package/dist/node/associations/getRequestingEntitiesQuery.js +44 -0
- package/dist/node/associations/getRequestingEntitiesQuery.js.map +1 -0
- package/dist/node/associations/getWellKnownAssociationsCatalog.js +76 -0
- package/dist/node/associations/getWellKnownAssociationsCatalog.js.map +1 -0
- package/dist/node/associations/index.js +14 -0
- package/dist/node/associations/index.js.map +1 -1
- package/dist/node/associations/internal/getAssociationHierarchy.js +36 -0
- package/dist/node/associations/internal/getAssociationHierarchy.js.map +1 -0
- package/dist/node/associations/internal/getIdsFromAssociationGroups.js +28 -0
- package/dist/node/associations/internal/getIdsFromAssociationGroups.js.map +1 -0
- package/dist/node/associations/internal/getIdsFromKeywords.js +25 -0
- package/dist/node/associations/internal/getIdsFromKeywords.js.map +1 -0
- package/dist/node/associations/internal/getIncludesAndReferencesQuery.js +61 -0
- package/dist/node/associations/internal/getIncludesAndReferencesQuery.js.map +1 -0
- package/dist/node/associations/internal/getIncludesDoesNotReferenceQuery.js +61 -0
- package/dist/node/associations/internal/getIncludesDoesNotReferenceQuery.js.map +1 -0
- package/dist/node/associations/internal/getReferencesDoesNotIncludeQuery.js +65 -0
- package/dist/node/associations/internal/getReferencesDoesNotIncludeQuery.js.map +1 -0
- package/dist/node/associations/internal/getTypeByIdsQuery.js +13 -15
- package/dist/node/associations/internal/getTypeByIdsQuery.js.map +1 -1
- package/dist/node/associations/internal/getTypeByNotIdsQuery.js +30 -0
- package/dist/node/associations/internal/getTypeByNotIdsQuery.js.map +1 -0
- package/dist/node/associations/internal/getTypeWithKeywordQuery.js +11 -6
- package/dist/node/associations/internal/getTypeWithKeywordQuery.js.map +1 -1
- package/dist/node/associations/internal/getTypeWithoutKeywordQuery.js +10 -5
- package/dist/node/associations/internal/getTypeWithoutKeywordQuery.js.map +1 -1
- package/dist/node/associations/internal/isAssociationSupported.js +32 -0
- package/dist/node/associations/internal/isAssociationSupported.js.map +1 -0
- package/dist/node/associations/internal/removeAssociationKeyword.js +20 -0
- package/dist/node/associations/internal/removeAssociationKeyword.js.map +1 -0
- package/dist/node/associations/internal/setAssociationKeyword.js +22 -0
- package/dist/node/associations/internal/setAssociationKeyword.js.map +1 -0
- package/dist/node/associations/listAssociations.js +4 -0
- package/dist/node/associations/listAssociations.js.map +1 -1
- package/dist/node/associations/removeAssociation.js +3 -0
- package/dist/node/associations/removeAssociation.js.map +1 -1
- package/dist/node/associations/requestAssociation.js +60 -0
- package/dist/node/associations/requestAssociation.js.map +1 -0
- package/dist/node/associations/types.js +0 -1
- package/dist/node/associations/types.js.map +1 -1
- package/dist/node/core/HubItemEntity.js +33 -10
- package/dist/node/core/HubItemEntity.js.map +1 -1
- package/dist/node/core/_internal/getBasePropertyMap.js +1 -1
- package/dist/node/core/_internal/getBasePropertyMap.js.map +1 -1
- package/dist/node/core/getTypesFromEntityType.js +42 -0
- package/dist/node/core/getTypesFromEntityType.js.map +1 -0
- package/dist/node/core/index.js +1 -0
- package/dist/node/core/index.js.map +1 -1
- package/dist/node/core/processActionLinks.js +2 -2
- package/dist/node/core/processActionLinks.js.map +1 -1
- package/dist/node/core/updateHubEntity.js +4 -0
- package/dist/node/core/updateHubEntity.js.map +1 -1
- package/dist/node/initiatives/HubInitiatives.js +15 -42
- package/dist/node/initiatives/HubInitiatives.js.map +1 -1
- package/dist/node/initiatives/_internal/InitiativeAssociationHierarchies.js +8 -0
- package/dist/node/initiatives/_internal/InitiativeAssociationHierarchies.js.map +1 -0
- package/dist/node/initiatives/_internal/InitiativeBusinessRules.js +29 -0
- package/dist/node/initiatives/_internal/InitiativeBusinessRules.js.map +1 -1
- package/dist/node/projects/_internal/ProjectAssociationHierarchies.js +8 -0
- package/dist/node/projects/_internal/ProjectAssociationHierarchies.js.map +1 -0
- package/dist/node/projects/_internal/ProjectBusinessRules.js +6 -0
- package/dist/node/projects/_internal/ProjectBusinessRules.js.map +1 -1
- package/dist/node/projects/_internal/computeProps.js +4 -2
- package/dist/node/projects/_internal/computeProps.js.map +1 -1
- package/dist/node/projects/fetch.js +3 -0
- package/dist/node/projects/fetch.js.map +1 -1
- package/dist/node/search/_internal/buildCatalog.js +29 -0
- package/dist/node/search/_internal/buildCatalog.js.map +1 -0
- package/dist/node/search/wellKnownCatalog.js +29 -43
- package/dist/node/search/wellKnownCatalog.js.map +1 -1
- package/dist/types/associations/addAssociation.d.ts +3 -0
- package/dist/types/associations/breakAssociation.d.ts +20 -0
- package/dist/types/associations/getAssociatedEntitiesQuery.d.ts +21 -0
- package/dist/types/associations/getAssociationStats.d.ts +13 -0
- package/dist/types/associations/getAvailableToRequestEntitiesQuery.d.ts +21 -0
- package/dist/types/associations/getPendingEntitiesQuery.d.ts +26 -0
- package/dist/types/associations/getRequestingEntitiesQuery.d.ts +26 -0
- package/dist/types/associations/getWellKnownAssociationsCatalog.d.ts +34 -0
- package/dist/types/associations/index.d.ts +9 -0
- package/dist/types/associations/internal/getAssociationHierarchy.d.ts +15 -0
- package/dist/types/associations/internal/getIdsFromAssociationGroups.d.ts +15 -0
- package/dist/types/associations/internal/getIdsFromKeywords.d.ts +13 -0
- package/dist/types/associations/internal/getIncludesAndReferencesQuery.d.ts +14 -0
- package/dist/types/associations/internal/getIncludesDoesNotReferenceQuery.d.ts +14 -0
- package/dist/types/associations/internal/getReferencesDoesNotIncludeQuery.d.ts +14 -0
- package/dist/types/associations/internal/getTypeByIdsQuery.d.ts +8 -6
- package/dist/types/associations/internal/getTypeByNotIdsQuery.d.ts +12 -0
- package/dist/types/associations/internal/getTypeWithKeywordQuery.d.ts +8 -5
- package/dist/types/associations/internal/getTypeWithoutKeywordQuery.d.ts +8 -5
- package/dist/types/associations/internal/isAssociationSupported.d.ts +11 -0
- package/dist/types/associations/internal/removeAssociationKeyword.d.ts +12 -0
- package/dist/types/associations/internal/setAssociationKeyword.d.ts +12 -0
- package/dist/types/associations/listAssociations.d.ts +4 -0
- package/dist/types/associations/removeAssociation.d.ts +3 -0
- package/dist/types/associations/requestAssociation.d.ts +23 -0
- package/dist/types/associations/types.d.ts +53 -0
- package/dist/types/core/HubItemEntity.d.ts +10 -1
- package/dist/types/core/behaviors/IWIthAssociationBehavior.d.ts +9 -0
- package/dist/types/core/behaviors/IWithFeaturedImageBehavior.d.ts +2 -2
- package/dist/types/core/getTypesFromEntityType.d.ts +10 -0
- package/dist/types/core/index.d.ts +1 -0
- package/dist/types/core/traits/IWithAssociations.d.ts +13 -0
- package/dist/types/initiatives/HubInitiatives.d.ts +12 -0
- package/dist/types/initiatives/_internal/InitiativeAssociationHierarchies.d.ts +2 -0
- package/dist/types/initiatives/_internal/InitiativeBusinessRules.d.ts +1 -1
- package/dist/types/projects/_internal/ProjectAssociationHierarchies.d.ts +2 -0
- package/dist/types/projects/_internal/ProjectBusinessRules.d.ts +1 -1
- package/dist/types/projects/fetch.d.ts +3 -0
- package/dist/types/search/_internal/buildCatalog.d.ts +12 -0
- package/package.json +1 -1
- package/dist/esm/associations/internal/getTargetEntityFromAssociationType.js +0 -18
- package/dist/esm/associations/internal/getTargetEntityFromAssociationType.js.map +0 -1
- package/dist/esm/associations/internal/getTypeFromAssociationType.js +0 -18
- package/dist/esm/associations/internal/getTypeFromAssociationType.js.map +0 -1
- package/dist/node/associations/internal/getTargetEntityFromAssociationType.js +0 -22
- package/dist/node/associations/internal/getTargetEntityFromAssociationType.js.map +0 -1
- package/dist/node/associations/internal/getTypeFromAssociationType.js +0 -22
- package/dist/node/associations/internal/getTypeFromAssociationType.js.map +0 -1
- package/dist/types/associations/internal/getTargetEntityFromAssociationType.d.ts +0 -8
- package/dist/types/associations/internal/getTypeFromAssociationType.d.ts +0 -7
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIncludesDoesNotReferenceQuery = void 0;
|
|
4
|
+
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
5
|
+
const getTypesFromEntityType_1 = require("../../core/getTypesFromEntityType");
|
|
6
|
+
const get_prop_1 = require("../../objects/get-prop");
|
|
7
|
+
const combineQueries_1 = require("../../search/_internal/combineQueries");
|
|
8
|
+
const getTypeWithoutKeywordQuery_1 = require("./getTypeWithoutKeywordQuery");
|
|
9
|
+
const getTypeByIdsQuery_1 = require("./getTypeByIdsQuery");
|
|
10
|
+
const getTypeFromEntity_1 = require("../../core/getTypeFromEntity");
|
|
11
|
+
const getIdsFromKeywords_1 = require("./getIdsFromKeywords");
|
|
12
|
+
const getIdsFromAssociationGroups_1 = require("./getIdsFromAssociationGroups");
|
|
13
|
+
/**
|
|
14
|
+
* builds a query that will return entities that are
|
|
15
|
+
* "included" but NOT "referenced"
|
|
16
|
+
*
|
|
17
|
+
* @param entity - Hub entity
|
|
18
|
+
* @param associationType - entity type to query for
|
|
19
|
+
* @param isParent - whether the provided Hub entity is the parent in the association relationship
|
|
20
|
+
* @param context - contextual auth and portal information
|
|
21
|
+
* @returns {IQuery}
|
|
22
|
+
*/
|
|
23
|
+
exports.getIncludesDoesNotReferenceQuery = async (entity, associationType, isParent, context) => {
|
|
24
|
+
if (isParent) {
|
|
25
|
+
/**
|
|
26
|
+
* 1. build query that returns child entities WITHOUT a
|
|
27
|
+
* typeKeyword reference to the parent
|
|
28
|
+
*/
|
|
29
|
+
const parentType = getTypeFromEntity_1.getTypeFromEntity(entity);
|
|
30
|
+
const referencedQuery = getTypeWithoutKeywordQuery_1.getTypeWithoutKeywordQuery(getTypesFromEntityType_1.getTypesFromEntityType(associationType), `ref|${parentType}|${entity.id}`);
|
|
31
|
+
/** 2. grab the parent entity's association query */
|
|
32
|
+
const includedQuery = get_prop_1.getProp(entity, "associations.rules.query");
|
|
33
|
+
/** 3. combine queries - will remove null/undefined entries */
|
|
34
|
+
return combineQueries_1.combineQueries([referencedQuery, includedQuery]);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
/** 1. fetch the groups a child has been shared with */
|
|
38
|
+
const { admin, member, other } = await arcgis_rest_portal_1.getItemGroups(entity.id, context.requestOptions);
|
|
39
|
+
const groupsChildIsSharedWith = [...admin, ...member, ...other];
|
|
40
|
+
/**
|
|
41
|
+
* 2. filter the child's groups down to association groups
|
|
42
|
+
* (by checking if they have a typeKeyword of the form
|
|
43
|
+
* <associationType>|<id>) and extract parent ids
|
|
44
|
+
*/
|
|
45
|
+
const parentIdsThatIncludeChild = getIdsFromAssociationGroups_1.getIdsFromAssociationGroups(groupsChildIsSharedWith, associationType);
|
|
46
|
+
/**
|
|
47
|
+
* 3. iterate over the child's typeKeywords and grab the parent
|
|
48
|
+
* ids it references (typeKeyword = <associationType>|<id>)
|
|
49
|
+
*/
|
|
50
|
+
const parentIdsChildReferences = getIdsFromKeywords_1.getIdsFromKeywords(entity, associationType);
|
|
51
|
+
/**
|
|
52
|
+
* 4. filter the parent ids down to those that include the
|
|
53
|
+
* child, but that the child does NOT reference
|
|
54
|
+
*/
|
|
55
|
+
const parentIds = parentIdsThatIncludeChild.filter((id) => !parentIdsChildReferences.includes(id));
|
|
56
|
+
/** 5. return a query for the filtered parent ids */
|
|
57
|
+
const type = getTypesFromEntityType_1.getTypesFromEntityType(associationType);
|
|
58
|
+
return parentIds.length ? getTypeByIdsQuery_1.getTypeByIdsQuery(type, parentIds) : null;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=getIncludesDoesNotReferenceQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getIncludesDoesNotReferenceQuery.js","sourceRoot":"","sources":["../../../../src/associations/internal/getIncludesDoesNotReferenceQuery.ts"],"names":[],"mappings":";;;AAAA,iEAAyD;AAEzD,8EAA2E;AAC3E,qDAAiD;AAEjD,0EAAuE;AACvE,6EAA0E;AAE1E,2DAAwD;AACxD,oEAAiE;AACjE,6DAA0D;AAC1D,+EAA4E;AAE5E;;;;;;;;;GASG;AACU,QAAA,gCAAgC,GAAG,KAAK,EACnD,MAAiB,EACjB,eAA8B,EAC9B,QAAiB,EACjB,OAAuB,EACN,EAAE;IACnB,IAAI,QAAQ,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Module", { value: true });
|
|
3
|
+
exports.getReferencesDoesNotIncludeQuery = void 0;
|
|
4
|
+
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
5
|
+
const getTypesFromEntityType_1 = require("../../core/getTypesFromEntityType");
|
|
6
|
+
const get_prop_1 = require("../../objects/get-prop");
|
|
7
|
+
const combineQueries_1 = require("../../search/_internal/combineQueries");
|
|
8
|
+
const getTypeWithKeywordQuery_1 = require("./getTypeWithKeywordQuery");
|
|
9
|
+
const negateGroupPredicates_1 = require("../../search/_internal/negateGroupPredicates");
|
|
10
|
+
const getTypeByIdsQuery_1 = require("./getTypeByIdsQuery");
|
|
11
|
+
const getTypeFromEntity_1 = require("../../core/getTypeFromEntity");
|
|
12
|
+
const getIdsFromKeywords_1 = require("./getIdsFromKeywords");
|
|
13
|
+
const getIdsFromAssociationGroups_1 = require("./getIdsFromAssociationGroups");
|
|
14
|
+
/**
|
|
15
|
+
* builds a query that will return entities that are
|
|
16
|
+
* "referenced" but NOT "included"
|
|
17
|
+
*
|
|
18
|
+
* @param entity - Hub entity
|
|
19
|
+
* @param associationType - entity type to query for
|
|
20
|
+
* @param isParent - whether the provided Hub entity is the parent in the association relationship
|
|
21
|
+
* @param context - contextual auth and portal information
|
|
22
|
+
* @returns {IQuery}
|
|
23
|
+
*/
|
|
24
|
+
exports.getReferencesDoesNotIncludeQuery = async (entity, associationType, isParent, context) => {
|
|
25
|
+
if (isParent) {
|
|
26
|
+
/**
|
|
27
|
+
* 1. build query that returns child entities WITH a
|
|
28
|
+
* typeKeyword reference to the parent
|
|
29
|
+
*/
|
|
30
|
+
const parentType = getTypeFromEntity_1.getTypeFromEntity(entity);
|
|
31
|
+
const referencedQuery = getTypeWithKeywordQuery_1.getTypeWithKeywordQuery(getTypesFromEntityType_1.getTypesFromEntityType(associationType), `ref|${parentType}|${entity.id}`);
|
|
32
|
+
/**
|
|
33
|
+
* 2. grab the parent's association query and negate
|
|
34
|
+
* the group predicate
|
|
35
|
+
*/
|
|
36
|
+
const notIncludedQuery = negateGroupPredicates_1.negateGroupPredicates(get_prop_1.getProp(entity, "associations.rules.query"));
|
|
37
|
+
/** 3. combine queries - will remove null/undefined entries */
|
|
38
|
+
return combineQueries_1.combineQueries([referencedQuery, notIncludedQuery]);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
/** 1. fetch the groups a child has been shared with */
|
|
42
|
+
const { admin, member, other } = await arcgis_rest_portal_1.getItemGroups(entity.id, context.requestOptions);
|
|
43
|
+
const groupsChildIsSharedWith = [...admin, ...member, ...other];
|
|
44
|
+
/**
|
|
45
|
+
* 2. filter the child's groups down to association groups
|
|
46
|
+
* (by checking if they have a typeKeyword of the form
|
|
47
|
+
* <associationType>|<id>) and extract parent ids
|
|
48
|
+
*/
|
|
49
|
+
const parentIdsThatIncludeChild = getIdsFromAssociationGroups_1.getIdsFromAssociationGroups(groupsChildIsSharedWith, associationType);
|
|
50
|
+
/**
|
|
51
|
+
* 3. iterate over the child's typeKeywords and grab the parent
|
|
52
|
+
* ids it references (typeKeyword = <associationType>|<id>)
|
|
53
|
+
*/
|
|
54
|
+
const parentIdsChildReferences = getIdsFromKeywords_1.getIdsFromKeywords(entity, associationType);
|
|
55
|
+
/**
|
|
56
|
+
* 4. filter the parent ids down to those that the child
|
|
57
|
+
* references but that the parent does NOT include
|
|
58
|
+
*/
|
|
59
|
+
const parentIds = parentIdsChildReferences.filter((id) => !parentIdsThatIncludeChild.includes(id));
|
|
60
|
+
/** 5. return a query for the filtered parent ids */
|
|
61
|
+
const type = getTypesFromEntityType_1.getTypesFromEntityType(associationType);
|
|
62
|
+
return parentIds.length ? getTypeByIdsQuery_1.getTypeByIdsQuery(type, parentIds) : null;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=getReferencesDoesNotIncludeQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getReferencesDoesNotIncludeQuery.js","sourceRoot":"","sources":["../../../../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AU,EAAE,EAAE,CAAC,CAAC,yBAAyB,CAAC,QAAQ,CAAC,EAAE,CAAC,CACxD,CAAC;QAEF,oDAAoD;QACpD,MAAM,IAAI,GAAG,+CAAsB,CAAC,eAAe,CAAC,CAAC;QACrD,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,qCAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;KACrE;AACH,CAAC,CAAC"}
|
|
@@ -3,27 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getTypeByIdsQuery = void 0;
|
|
4
4
|
const getEntityTypeFromType_1 = require("../../search/_internal/getEntityTypeFromType");
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* @private
|
|
7
|
+
* Construct an IQuery to fetch a specified set of item id(s)
|
|
8
|
+
* by type(s). Note: if an array of types is provided, they
|
|
9
|
+
* must be the same underlying target entity type.
|
|
8
10
|
*
|
|
9
|
-
* @param
|
|
10
|
-
* @param
|
|
11
|
-
* @returns
|
|
11
|
+
* @param itemType - a single item type or an array of item types
|
|
12
|
+
* @param ids - an array of ids
|
|
13
|
+
* @returns {IQuery}
|
|
12
14
|
*/
|
|
13
15
|
function getTypeByIdsQuery(itemType, ids) {
|
|
14
|
-
const targetEntity =
|
|
16
|
+
const targetEntity = typeof itemType === "string"
|
|
17
|
+
? getEntityTypeFromType_1.getEntityTypeFromType(itemType)
|
|
18
|
+
: getEntityTypeFromType_1.getEntityTypeFromType(itemType[0]);
|
|
15
19
|
const qry = {
|
|
16
20
|
targetEntity,
|
|
17
21
|
filters: [
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
type: itemType,
|
|
23
|
-
id: [...ids],
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
},
|
|
22
|
+
Object.assign(Object.assign({}, (ids.length && { operation: "AND" })), { predicates: [
|
|
23
|
+
Object.assign({ type: itemType }, (ids.length && { id: ids })),
|
|
24
|
+
] }),
|
|
27
25
|
],
|
|
28
26
|
};
|
|
29
27
|
return qry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTypeByIdsQuery.js","sourceRoot":"","sources":["../../../../src/associations/internal/getTypeByIdsQuery.ts"],"names":[],"mappings":";;;AAAA,wFAAqF;AAGrF
|
|
1
|
+
{"version":3,"file":"getTypeByIdsQuery.js","sourceRoot":"","sources":["../../../../src/associations/internal/getTypeByIdsQuery.ts"],"names":[],"mappings":";;;AAAA,wFAAqF;AAGrF;;;;;;;;;GASG;AACH,SAAgB,iBAAiB,CAC/B,QAA2B,EAC3B,GAAa;IAEb,MAAM,YAAY,GAChB,OAAO,QAAQ,KAAK,QAAQ;QAC1B,CAAC,CAAC,6CAAqB,CAAC,QAAQ,CAAC;QACjC,CAAC,CAAC,6CAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzC,MAAM,GAAG,GAAW;QAClB,YAAY;QACZ,OAAO,EAAE;4CAEF,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,KACvC,UAAU,EAAE;oCAER,IAAI,EAAE,QAAQ,IACX,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC;iBAEjC;SAEJ;KACF,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC;AAxBD,8CAwBC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTypeByNotIdsQuery = void 0;
|
|
4
|
+
const getEntityTypeFromType_1 = require("../../search/_internal/getEntityTypeFromType");
|
|
5
|
+
/**
|
|
6
|
+
* @private
|
|
7
|
+
* Construct an IQuery to fetch the inverse of a specified set
|
|
8
|
+
* of item id(s) by type(s). Note: if an array of types is provided,
|
|
9
|
+
* they must be the same underlying target entity type.
|
|
10
|
+
*
|
|
11
|
+
* @param itemType - a single item type or an array of item types
|
|
12
|
+
* @param ids - an array of ids
|
|
13
|
+
* @returns {IQuery}
|
|
14
|
+
*/
|
|
15
|
+
function getTypeByNotIdsQuery(itemType, ids) {
|
|
16
|
+
const targetEntity = typeof itemType === "string"
|
|
17
|
+
? getEntityTypeFromType_1.getEntityTypeFromType(itemType)
|
|
18
|
+
: getEntityTypeFromType_1.getEntityTypeFromType(itemType[0]);
|
|
19
|
+
const qry = {
|
|
20
|
+
targetEntity,
|
|
21
|
+
filters: [
|
|
22
|
+
Object.assign(Object.assign({}, (ids.length && { operation: "AND" })), { predicates: [
|
|
23
|
+
Object.assign({ type: itemType }, (ids.length && { id: { not: ids } })),
|
|
24
|
+
] }),
|
|
25
|
+
],
|
|
26
|
+
};
|
|
27
|
+
return qry;
|
|
28
|
+
}
|
|
29
|
+
exports.getTypeByNotIdsQuery = getTypeByNotIdsQuery;
|
|
30
|
+
//# sourceMappingURL=getTypeByNotIdsQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTypeByNotIdsQuery.js","sourceRoot":"","sources":["../../../../src/associations/internal/getTypeByNotIdsQuery.ts"],"names":[],"mappings":";;;AAAA,wFAAqF;AAGrF;;;;;;;;;GASG;AACH,SAAgB,oBAAoB,CAClC,QAA2B,EAC3B,GAAa;IAEb,MAAM,YAAY,GAChB,OAAO,QAAQ,KAAK,QAAQ;QAC1B,CAAC,CAAC,6CAAqB,CAAC,QAAQ,CAAC;QACjC,CAAC,CAAC,6CAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzC,MAAM,GAAG,GAAW;QAClB,YAAY;QACZ,OAAO,EAAE;4CAEF,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,KACvC,UAAU,EAAE;oCAER,IAAI,EAAE,QAAQ,IACX,CAAC,GAAG,CAAC,MAAM,IAAI,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;iBAE1C;SAEJ;KACF,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC;AAxBD,oDAwBC"}
|
|
@@ -4,14 +4,19 @@ exports.getTypeWithKeywordQuery = void 0;
|
|
|
4
4
|
const getEntityTypeFromType_1 = require("../../search/_internal/getEntityTypeFromType");
|
|
5
5
|
/**
|
|
6
6
|
* @private
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Construct an IQuery to fetch a set of items by type(s)
|
|
8
|
+
* with a specified typeKeyword. Note: if an array of types
|
|
9
|
+
* is provided, they must be the same underlying target
|
|
10
|
+
* entity type.
|
|
11
|
+
*
|
|
12
|
+
* @param itemType - The type(s) of item to fetch
|
|
13
|
+
* @param keyword - The typeKeyword to filter by
|
|
11
14
|
* @returns
|
|
12
15
|
*/
|
|
13
16
|
function getTypeWithKeywordQuery(itemType, keyword) {
|
|
14
|
-
const targetEntity =
|
|
17
|
+
const targetEntity = typeof itemType === "string"
|
|
18
|
+
? getEntityTypeFromType_1.getEntityTypeFromType(itemType)
|
|
19
|
+
: getEntityTypeFromType_1.getEntityTypeFromType(itemType[0]);
|
|
15
20
|
return {
|
|
16
21
|
targetEntity,
|
|
17
22
|
filters: [
|
|
@@ -20,7 +25,7 @@ function getTypeWithKeywordQuery(itemType, keyword) {
|
|
|
20
25
|
predicates: [
|
|
21
26
|
{
|
|
22
27
|
type: itemType,
|
|
23
|
-
typekeywords: keyword,
|
|
28
|
+
typekeywords: [keyword],
|
|
24
29
|
},
|
|
25
30
|
],
|
|
26
31
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTypeWithKeywordQuery.js","sourceRoot":"","sources":["../../../../src/associations/internal/getTypeWithKeywordQuery.ts"],"names":[],"mappings":";;;AAAA,wFAAqF;AAGrF
|
|
1
|
+
{"version":3,"file":"getTypeWithKeywordQuery.js","sourceRoot":"","sources":["../../../../src/associations/internal/getTypeWithKeywordQuery.ts"],"names":[],"mappings":";;;AAAA,wFAAqF;AAGrF;;;;;;;;;;GAUG;AACH,SAAgB,uBAAuB,CACrC,QAA2B,EAC3B,OAAe;IAEf,MAAM,YAAY,GAChB,OAAO,QAAQ,KAAK,QAAQ;QAC1B,CAAC,CAAC,6CAAqB,CAAC,QAAQ,CAAC;QACjC,CAAC,CAAC,6CAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzC,OAAO;QACL,YAAY;QACZ,OAAO,EAAE;YACP;gBACE,SAAS,EAAE,KAAK;gBAChB,UAAU,EAAE;oBACV;wBACE,IAAI,EAAE,QAAQ;wBACd,YAAY,EAAE,CAAC,OAAO,CAAC;qBACxB;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC;AAvBD,0DAuBC"}
|
|
@@ -4,14 +4,19 @@ exports.getTypeWithoutKeywordQuery = void 0;
|
|
|
4
4
|
const getEntityTypeFromType_1 = require("../../search/_internal/getEntityTypeFromType");
|
|
5
5
|
/**
|
|
6
6
|
* @private
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Construct an IQuery to fetch a set of items by type(s)
|
|
8
|
+
* withOUT a specified typeKeyword. Note: if an array of
|
|
9
|
+
* types is provided, they must be the same underlying target
|
|
10
|
+
* entity type.
|
|
11
|
+
*
|
|
12
|
+
* @param itemType - The type(s) of item to fetch
|
|
13
|
+
* @param keyword - The typeKeyword to filter by
|
|
11
14
|
* @returns
|
|
12
15
|
*/
|
|
13
16
|
function getTypeWithoutKeywordQuery(itemType, keyword) {
|
|
14
|
-
const targetEntity =
|
|
17
|
+
const targetEntity = typeof itemType === "string"
|
|
18
|
+
? getEntityTypeFromType_1.getEntityTypeFromType(itemType)
|
|
19
|
+
: getEntityTypeFromType_1.getEntityTypeFromType(itemType[0]);
|
|
15
20
|
return {
|
|
16
21
|
targetEntity,
|
|
17
22
|
filters: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTypeWithoutKeywordQuery.js","sourceRoot":"","sources":["../../../../src/associations/internal/getTypeWithoutKeywordQuery.ts"],"names":[],"mappings":";;;AAAA,wFAAqF;AAGrF
|
|
1
|
+
{"version":3,"file":"getTypeWithoutKeywordQuery.js","sourceRoot":"","sources":["../../../../src/associations/internal/getTypeWithoutKeywordQuery.ts"],"names":[],"mappings":";;;AAAA,wFAAqF;AAGrF;;;;;;;;;;GAUG;AACH,SAAgB,0BAA0B,CACxC,QAA2B,EAC3B,OAAe;IAEf,MAAM,YAAY,GAChB,OAAO,QAAQ,KAAK,QAAQ;QAC1B,CAAC,CAAC,6CAAqB,CAAC,QAAQ,CAAC;QACjC,CAAC,CAAC,6CAAqB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAEzC,OAAO;QACL,YAAY;QACZ,OAAO,EAAE;YACP;gBACE,SAAS,EAAE,KAAK;gBAChB,UAAU,EAAE;oBACV;wBACE,IAAI,EAAE,QAAQ;wBACd,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE;qBACjC;iBACF;aACF;SACF;KACF,CAAC;AACJ,CAAC;AAvBD,gEAuBC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isAssociationSupported = void 0;
|
|
4
|
+
const getAssociationHierarchy_1 = require("./getAssociationHierarchy");
|
|
5
|
+
/**
|
|
6
|
+
* given two entity types, this util returns
|
|
7
|
+
* whether or not associations are supported
|
|
8
|
+
* between the two
|
|
9
|
+
*
|
|
10
|
+
* @param type1 - first entity type
|
|
11
|
+
* @param type2 - second entity type
|
|
12
|
+
* @returns {boolean}
|
|
13
|
+
*/
|
|
14
|
+
exports.isAssociationSupported = (type1, type2) => {
|
|
15
|
+
try {
|
|
16
|
+
const hierarchy1 = getAssociationHierarchy_1.getAssociationHierarchy(type1);
|
|
17
|
+
const hierarchy2 = getAssociationHierarchy_1.getAssociationHierarchy(type2);
|
|
18
|
+
if (hierarchy1.children.includes(type2)) {
|
|
19
|
+
return hierarchy2.parents.includes(type1);
|
|
20
|
+
}
|
|
21
|
+
else if (hierarchy1.parents.includes(type2)) {
|
|
22
|
+
return hierarchy2.children.includes(type1);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=isAssociationSupported.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isAssociationSupported.js","sourceRoot":"","sources":["../../../../src/associations/internal/isAssociationSupported.ts"],"names":[],"mappings":";;;AACA,uEAAoE;AAEpE;;;;;;;;GAQG;AACU,QAAA,sBAAsB,GAAG,CACpC,KAAoB,EACpB,KAAoB,EACX,EAAE;IACX,IAAI;QACF,MAAM,UAAU,GAAG,iDAAuB,CAAC,KAAK,CAAC,CAAC;QAClD,MAAM,UAAU,GAAG,iDAAuB,CAAC,KAAK,CAAC,CAAC;QAElD,IAAI,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACvC,OAAO,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC3C;aAAM,IAAI,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YAC7C,OAAO,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;SAC5C;aAAM;YACL,OAAO,KAAK,CAAC;SACd;KACF;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,KAAK,CAAC;KACd;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.removeAssociationKeyword = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* when a child decides it wants to "disconnect" itself from
|
|
6
|
+
* an existing association, the child removes the typeKeyword
|
|
7
|
+
* (ref|<type>|<id>) that "references" the parent
|
|
8
|
+
*
|
|
9
|
+
* @param typeKeywords - the child entity's typeKeywords
|
|
10
|
+
* @param type - the parent entity's type
|
|
11
|
+
* @param id - the parent entity's id
|
|
12
|
+
* @returns {string[]}
|
|
13
|
+
*/
|
|
14
|
+
function removeAssociationKeyword(typeKeywords, type, id) {
|
|
15
|
+
const associationKeyword = `ref|${type}|${id}`;
|
|
16
|
+
const filteredKeywords = typeKeywords.filter((keyword) => keyword !== associationKeyword);
|
|
17
|
+
return filteredKeywords;
|
|
18
|
+
}
|
|
19
|
+
exports.removeAssociationKeyword = removeAssociationKeyword;
|
|
20
|
+
//# sourceMappingURL=removeAssociationKeyword.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removeAssociationKeyword.js","sourceRoot":"","sources":["../../../../src/associations/internal/removeAssociationKeyword.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;GASG;AACH,SAAgB,wBAAwB,CACtC,YAAsB,EACtB,IAAmB,EACnB,EAAU;IAEV,MAAM,kBAAkB,GAAG,OAAO,IAAI,IAAI,EAAE,EAAE,CAAC;IAC/C,MAAM,gBAAgB,GAAG,YAAY,CAAC,MAAM,CAC1C,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,kBAAkB,CAC5C,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAXD,4DAWC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setAssociationKeyword = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* when a child sends an "outgoing" request or accepts an
|
|
6
|
+
* "incoming" request for association, the child "references"
|
|
7
|
+
* the parent via a typeKeyword (ref|<type>|<id>)
|
|
8
|
+
*
|
|
9
|
+
* @param typeKeywords - the child entity's typeKeywords
|
|
10
|
+
* @param type - the parent entity's type
|
|
11
|
+
* @param id - the parent entity's id
|
|
12
|
+
* @returns {string[]}
|
|
13
|
+
*/
|
|
14
|
+
function setAssociationKeyword(typeKeywords, type, id) {
|
|
15
|
+
const keyword = `ref|${type}|${id}`;
|
|
16
|
+
if (!typeKeywords.includes(keyword)) {
|
|
17
|
+
typeKeywords = [...typeKeywords, keyword];
|
|
18
|
+
}
|
|
19
|
+
return typeKeywords;
|
|
20
|
+
}
|
|
21
|
+
exports.setAssociationKeyword = setAssociationKeyword;
|
|
22
|
+
//# sourceMappingURL=setAssociationKeyword.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setAssociationKeyword.js","sourceRoot":"","sources":["../../../../src/associations/internal/setAssociationKeyword.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;GASG;AACH,SAAgB,qBAAqB,CACnC,YAAsB,EACtB,IAAmB,EACnB,EAAU;IAEV,MAAM,OAAO,GAAG,OAAO,IAAI,IAAI,EAAE,EAAE,CAAC;IACpC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACnC,YAAY,GAAG,CAAC,GAAG,YAAY,EAAE,OAAO,CAAC,CAAC;KAC3C;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAXD,sDAWC"}
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.listAssociations = void 0;
|
|
4
4
|
/**
|
|
5
|
+
* ** DEPRECATED: please use getAssociatedEntitiesQuery
|
|
6
|
+
* to get a query for an entity's associations instead.
|
|
7
|
+
* This will be removed in the next breaking version **
|
|
8
|
+
*
|
|
5
9
|
* Return a list of all associations on an entity for a type
|
|
6
10
|
* @param entity
|
|
7
11
|
* @returns
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listAssociations.js","sourceRoot":"","sources":["../../../src/associations/listAssociations.ts"],"names":[],"mappings":";;;AAGA
|
|
1
|
+
{"version":3,"file":"listAssociations.js","sourceRoot":"","sources":["../../../src/associations/listAssociations.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;GAQG;AACH,SAAgB,gBAAgB,CAC9B,MAAyB,EACzB,IAAqB;IAErB,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;QACxB,OAAO,EAAE,CAAC;KACX;IACD,OAAO,MAAM,CAAC,YAAY;SACvB,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;SAC3C,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QACV,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9B,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,EAAsB,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC;AAbD,4CAaC"}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.removeAssociation = void 0;
|
|
4
4
|
/**
|
|
5
|
+
* ** DEPRECATED: please use breakAssociation instead.
|
|
6
|
+
* This will be removed in the next breaking version **
|
|
7
|
+
*
|
|
5
8
|
* Remove an association from an entity
|
|
6
9
|
* @param info
|
|
7
10
|
* @param entity
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"removeAssociation.js","sourceRoot":"","sources":["../../../src/associations/removeAssociation.ts"],"names":[],"mappings":";;;AAGA
|
|
1
|
+
{"version":3,"file":"removeAssociation.js","sourceRoot":"","sources":["../../../src/associations/removeAssociation.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;GAQG;AACH,SAAgB,iBAAiB,CAC/B,MAAyB,EACzB,IAAsB;IAEtB,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE;QACxB,OAAO;KACR;IACD,MAAM,WAAW,GAAG,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC;IAC9C,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACvD,IAAI,KAAK,GAAG,CAAC,CAAC,EAAE;QACd,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;KACtC;AACH,CAAC;AAZD,8CAYC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.requestAssociation = void 0;
|
|
4
|
+
const arcgis_rest_portal_1 = require("@esri/arcgis-rest-portal");
|
|
5
|
+
const getTypeFromEntity_1 = require("../core/getTypeFromEntity");
|
|
6
|
+
const fetchHubEntity_1 = require("../core/fetchHubEntity");
|
|
7
|
+
const getAssociationHierarchy_1 = require("./internal/getAssociationHierarchy");
|
|
8
|
+
const isAssociationSupported_1 = require("./internal/isAssociationSupported");
|
|
9
|
+
const setAssociationKeyword_1 = require("./internal/setAssociationKeyword");
|
|
10
|
+
const objects_1 = require("../objects");
|
|
11
|
+
const updateHubEntity_1 = require("../core/updateHubEntity");
|
|
12
|
+
/**
|
|
13
|
+
* When an entity sends an "outgoing" association request
|
|
14
|
+
* or accepts an "incoming" association request, half of
|
|
15
|
+
* the association "connection" is made.
|
|
16
|
+
*
|
|
17
|
+
* from the parent's perspective: the parent "includes"
|
|
18
|
+
* the child in its association group
|
|
19
|
+
*
|
|
20
|
+
* From the child's perspective: the child "references"
|
|
21
|
+
* the parent via a typeKeyword of the form ref|<parentType>|<parentId>
|
|
22
|
+
*
|
|
23
|
+
* Note: we export this function under 2 names - requestAssociation
|
|
24
|
+
* and acceptAssociation. These actions are functionally equivalent,
|
|
25
|
+
* but we want to make the intent more clear to the consumer.
|
|
26
|
+
*
|
|
27
|
+
* @param entity - entity requesting association
|
|
28
|
+
* @param type - type of the entity the requesting entity wants to associate with
|
|
29
|
+
* @param id - id of the entity the requesting entity wants to associate with
|
|
30
|
+
* @param context - contextual portal and auth information
|
|
31
|
+
*/
|
|
32
|
+
exports.requestAssociation = async (entity, associationType, id, context) => {
|
|
33
|
+
const entityType = getTypeFromEntity_1.getTypeFromEntity(entity);
|
|
34
|
+
const isSupported = isAssociationSupported_1.isAssociationSupported(entityType, associationType);
|
|
35
|
+
if (!isSupported) {
|
|
36
|
+
throw new Error(`requestAssociation: Association between ${entityType} and ${associationType} is not supported.`);
|
|
37
|
+
}
|
|
38
|
+
const associationHierarchy = getAssociationHierarchy_1.getAssociationHierarchy(entityType);
|
|
39
|
+
const isParent = associationHierarchy.children.includes(associationType);
|
|
40
|
+
if (isParent) {
|
|
41
|
+
const associationGroupId = objects_1.getProp(entity, "associations.groupId");
|
|
42
|
+
const { owner } = await fetchHubEntity_1.fetchHubEntity(associationType, id, context);
|
|
43
|
+
try {
|
|
44
|
+
await arcgis_rest_portal_1.shareItemWithGroup({
|
|
45
|
+
id,
|
|
46
|
+
owner,
|
|
47
|
+
groupId: associationGroupId,
|
|
48
|
+
authentication: context.session,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
throw new Error(`requestAssociation: there was an error sharing ${id} to ${associationGroupId}: ${error}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
entity.typeKeywords = setAssociationKeyword_1.setAssociationKeyword(entity.typeKeywords, associationType, id);
|
|
57
|
+
await updateHubEntity_1.updateHubEntity(entityType, entity, context);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=requestAssociation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestAssociation.js","sourceRoot":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AE,CACH,CAAC;QACF,MAAM,iCAAe,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;KACpD;AACH,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/associations/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/associations/types.ts"],"names":[],"mappings":""}
|
|
@@ -269,18 +269,32 @@ class HubItemEntity {
|
|
|
269
269
|
* to keep the number of resources in control
|
|
270
270
|
* @param file
|
|
271
271
|
*/
|
|
272
|
-
async setFeaturedImage(file) {
|
|
272
|
+
async setFeaturedImage(file, clearExisting = false) {
|
|
273
273
|
var _a;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
274
|
+
try {
|
|
275
|
+
// If we have a featured image then clear it out.
|
|
276
|
+
if (((_a = this.entity.view) === null || _a === void 0 ? void 0 : _a.featuredImageUrl) || clearExisting) {
|
|
277
|
+
await this.clearFeaturedImage();
|
|
278
|
+
}
|
|
279
|
+
// add the new featured image
|
|
280
|
+
const featuredImageUrl = await items_1.uploadImageResource(this.entity.id, this.entity.owner, file, FEATURED_IMAGE_FILENAME, this.context.userRequestOptions);
|
|
281
|
+
// If successful, update the entity
|
|
282
|
+
this.entity.view = Object.assign(Object.assign({}, this.entity.view), { featuredImageUrl });
|
|
283
|
+
// save the entity
|
|
284
|
+
await this.save();
|
|
285
|
+
}
|
|
286
|
+
catch (err) {
|
|
287
|
+
// If the featured image url has been cleared, but the resource hasn't
|
|
288
|
+
// Been removed then we'll get the following error message.
|
|
289
|
+
// In that case, we'll try again with clearExisting set to true.
|
|
290
|
+
if (err instanceof Error &&
|
|
291
|
+
err.message === "CONT_00942: Resource already present") {
|
|
292
|
+
return this.setFeaturedImage(file, true);
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
throw err;
|
|
296
|
+
}
|
|
277
297
|
}
|
|
278
|
-
// add the new featured image
|
|
279
|
-
const featuredImageUrl = await items_1.uploadImageResource(this.entity.id, this.entity.owner, file, FEATURED_IMAGE_FILENAME, this.context.userRequestOptions);
|
|
280
|
-
// If successful, update the entity
|
|
281
|
-
this.entity.view = Object.assign(Object.assign({}, this.entity.view), { featuredImageUrl });
|
|
282
|
-
// save the entity
|
|
283
|
-
await this.save();
|
|
284
298
|
}
|
|
285
299
|
/**
|
|
286
300
|
* Remove the featured image from the item
|
|
@@ -317,6 +331,9 @@ class HubItemEntity {
|
|
|
317
331
|
this.update({ typeKeywords, isDiscussable });
|
|
318
332
|
}
|
|
319
333
|
/**
|
|
334
|
+
* ** DEPRECATED: This will be removed in the next
|
|
335
|
+
* breaking version **
|
|
336
|
+
*
|
|
320
337
|
* Return a list of IAssociationInfo objects representing
|
|
321
338
|
* the associations this entity has, to the specified type
|
|
322
339
|
* @param type
|
|
@@ -326,6 +343,9 @@ class HubItemEntity {
|
|
|
326
343
|
return listAssociations_1.listAssociations(this.entity, type);
|
|
327
344
|
}
|
|
328
345
|
/**
|
|
346
|
+
* ** DEPRECATED: please use requestAssociation instead.
|
|
347
|
+
* This will be removed in the next breaking version **
|
|
348
|
+
*
|
|
329
349
|
* Add an association to this entity
|
|
330
350
|
* @param info
|
|
331
351
|
* @returns
|
|
@@ -334,6 +354,9 @@ class HubItemEntity {
|
|
|
334
354
|
return addAssociation_1.addAssociation(this.entity, info);
|
|
335
355
|
}
|
|
336
356
|
/**
|
|
357
|
+
* ** DEPRECATED: please use breakAssociation instead.
|
|
358
|
+
* This will be removed in the next breaking version **
|
|
359
|
+
*
|
|
337
360
|
* Remove an association from this entity
|
|
338
361
|
* @param info
|
|
339
362
|
* @returns
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HubItemEntity.js","sourceRoot":"","sources":["../../../src/core/HubItemEntity.ts"],"names":[],"mappings":";;;AAAA,iEASkC;AAElC,0CAAmC;AACnC,oCAA+C;AAC/C,sEAAmE;AACnE,gEAA6D;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O,EAAE,GAAG,CAAC,CAAC;aACnE;iBAAM;gBACL,MAAM,IAAI,kBAAQ,CAChB,2BAA2B,EAC3B,wCAAwC,CACzC,CAAC;aACH;SACF;IACH,CAAC;IACD,uCAAuC;IAEvC;;;OAGG;IACH,mBAAmB,CAAC,aAAsB;QACxC,MAAM,YAAY,GAAG,mCAAqB,CACxC,IAAI,CAAC,MAAM,CAAC,YAAY,EACxB,aAAa,CACd,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,aAAa,EAAgB,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;OAQG;IACH,gBAAgB,CAAC,IAAqB;QACpC,OAAO,mCAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;;;OAOG;IACH,cAAc,CAAC,IAAsB;QACnC,OAAO,+BAAc,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED;;;;;;;OAOG;IACH,iBAAiB,CAAC,IAAsB;QACtC,OAAO,qCAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC;CACF;AA3bD,sCA2bC"}
|
|
@@ -27,7 +27,7 @@ function getBasePropertyMap() {
|
|
|
27
27
|
"orgId",
|
|
28
28
|
"protected",
|
|
29
29
|
];
|
|
30
|
-
const dataProps = ["display", "geometry", "view"];
|
|
30
|
+
const dataProps = ["display", "geometry", "view", "associations"];
|
|
31
31
|
const resourceProps = Object.keys(types_1.EntityResourceMap);
|
|
32
32
|
const map = [];
|
|
33
33
|
itemProps.forEach((entry) => {
|