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*\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RollupType = exports.QueueItem = exports.WebAPIExt = void 0;\nclass WebAPIExt {\n    /**\n     * Constructor\n     * @param context The context passed into the component. Both WebApi and Utils features must be enabled and included in the context\n    */\n    constructor(context) {\n        //TODO: Constructor should throw an error if context does not include both WebAPI and Utils\n        this.options = {\n            get: {\n                method: \"GET\",\n                headers: {\n                    \"OData-MaxVersion\": \"4.0\",\n                    \"OData-Version\": \"4.0\",\n                    \"Accept\": \"application/json\",\n                    \"Content-Type\": \"application/json; charset=utf-8\",\n                    \"Prefer\": \"odata.include-annotations=\\\"*\\\"\"\n                }\n            },\n            delete: {\n                method: \"DELETE\",\n                headers: {\n                    \"Content-Type\": \"application/json; charset=utf-8\",\n                    \"Accept\": \"application/json\",\n                    \"OData-MaxVersion\": \"4.0\",\n                    \"OData-Version\": \"4.0\",\n                },\n            },\n            post: (body) => {\n                return {\n                    method: \"POST\",\n                    headers: {\n                        \"OData-Version\": \"4.0\",\n                        \"OData-MaxVersion\": \"4.0\",\n                        \"Accept\": \"application/json\",\n                        \"Content-Type\": \"application/json; charset=utf-8\",\n                    },\n                    body: JSON.stringify(body)\n                };\n            }\n        };\n        /**\n         * Implements the base Utils GetEntityMetadata method\n         */\n        this.getEntityMetadata = (entityName, properties) => __awaiter(this, void 0, void 0, function* () {\n            return this.context.utils.getEntityMetadata(entityName, properties);\n        });\n        this.getEntitySetName = (entityName) => __awaiter(this, void 0, void 0, function* () {\n            const res = yield this.context.utils.getEntityMetadata(entityName, [\"EntitySetName\"]).then((metadata) => {\n                return metadata[\"EntitySetName\"];\n            });\n            return res;\n        });\n        this.getWebAPIPathForEntitySet = (entityName) => __awaiter(this, void 0, void 0, function* () {\n            let setName = yield this.getEntitySetName(entityName);\n            return this.getWebAPIPath() + setName;\n        });\n        this.getWebAPIPathForEntityRecord = (entityName, recordId) => __awaiter(this, void 0, void 0, function* () {\n            let path = (yield this.getWebAPIPathForEntitySet(entityName)) + \"(\" + recordId + \")\";\n            return path;\n        });\n        this.associateRecordsWithStrings = (entityName, recordId, relationship, relatedEntityName, relatedRecordId) => __awaiter(this, void 0, void 0, function* () {\n            const payload = this.getWebAPIPathForEntityRecord(relatedEntityName, relatedRecordId) + \"/\" + relationship + \"/$ref\";\n            const res = yield window.fetch((yield this.getWebAPIPathForEntityRecord(entityName, recordId)) + \"/\" + relationship + \"/$ref\", this.options.post(payload)).then((response) => {\n                if (response.ok) {\n                    return response.json();\n                }\n                else {\n                    throw new Error(\"Error associating records\");\n                }\n            });\n            return res;\n        });\n        this.associateRecordsWithReferences = (entityReference, relationship, relatedEntityReference) => __awaiter(this, void 0, void 0, function* () {\n            if (relatedEntityReference.etn === undefined) {\n                throw new Error(\"Related entity reference is not valid. an Entity Type Name must be provided.\");\n            }\n            if (entityReference.etn === undefined) {\n                throw new Error(\"Entity reference is not valid. an Entity Type Name must be provided.\");\n            }\n            const payload = this.getWebAPIPathForEntityRecord(relatedEntityReference.etn, relatedEntityReference.id.guid) + \"/\" + relationship + \"/$ref\";\n            const res = yield window.fetch((yield this.getWebAPIPathForEntityRecord(entityReference.etn, entityReference.id.guid)) + \"/\" + relationship + \"/$ref\", this.options.post(payload)).then((response) => {\n                if (response.ok) {\n                    return response.json();\n                }\n                else {\n                    throw new Error(\"Error associating records\");\n                }\n            });\n            return res;\n        });\n        this.disassociateRecordsWithStrings = (entityName, recordId, relationship, relatedEntityName, relatedRecordId) => __awaiter(this, void 0, void 0, function* () {\n            const res = yield window.fetch(`${yield this.getWebAPIPathForEntityRecord(entityName, recordId)}/${relationship}(${relatedRecordId})/$ref`, this.options.delete).then((response) => {\n                if (response.ok) {\n                    return response.json();\n                }\n                else {\n                    throw new Error(\"Error disassociating records\");\n                }\n            });\n            return res;\n        });\n        this.disassociateRecordsWithReferences = (entityReference, relationship, relatedEntityReference) => __awaiter(this, void 0, void 0, function* () {\n            if (relatedEntityReference.etn === undefined) {\n                throw new Error(\"Related entity reference is not valid. an Entity Type Name must be provided.\");\n            }\n            if (entityReference.etn === undefined) {\n                throw new Error(\"Entity reference is not valid. an Entity Type Name must be provided.\");\n            }\n            const res = yield window.fetch(`${yield this.getWebAPIPathForEntityRecord(entityReference.etn, entityReference.id.guid)}/${relationship}(${relatedEntityReference.id})/$ref`, this.options.delete).then((response) => {\n                if (response.ok) {\n                    return response.json();\n                }\n                else {\n                    throw new Error(\"Error disassociating records\");\n                }\n            });\n            return res;\n        });\n        // #endregion\n        // #region Functions\n        this.functions = {\n            /**\n             * calculateRollupField - calculate the value of a rollup field for a record\n             * NOT YET FULLY IMPLEMENTED\n             * @param entityName - the logical name of the entity\n             * @param entityId - the GUID of the record\n             * @param fieldName - the logical name of the rollup field to calculate\n             * @returns\n             */\n            calculateRollupField: (entityName, entityId, fieldName) => __awaiter(this, void 0, void 0, function* () {\n                const url = encodeURI(`${this.getWebAPIPath()}${entityName}(${entityId})/Microsoft.Dynamics.CRM.CalculateRollupField(Target=@p1,FieldName=@p2)?@p1={'@odata.id':'${entityName}(${entityId})'}&@p2='${fieldName}'`);\n                const response = yield fetch(url, this.options.get);\n                const data = yield response.json();\n                return data;\n            }),\n            /**\n             * whoAmI - Perform a basic WhoAmI request to the database\n             * @returns An object containg the current user's Id, BU, and Org\n             */\n            whoAmI: () => __awaiter(this, void 0, void 0, function* () {\n                //Tests passed\n                const url = `${this.getWebAPIPath()}WhoAmI`;\n                const response = yield fetch(url, this.options.get);\n                const data = yield response.json();\n                return data;\n            }),\n            /**\n             * retrieveEnvironmentVariableValue - Retrieve the currently applied value of an environment variable.\n             * @param environmentVariableDefinitionId - The unique name of the environment variable definition\n             * @returns an object containing the current value of the environment variable\n             */\n            retrieveEnvironmentVariableValue: (environmentVariableDefinitionId) => __awaiter(this, void 0, void 0, function* () {\n                //Tests passed\n                const url = encodeURI(`${this.getWebAPIPath()}RetrieveEnvironmentVariableValue(DefinitionSchemaName=@p1)?@p1='${environmentVariableDefinitionId}'`);\n                const response = yield fetch(url, this.options.get);\n                const data = yield response.json();\n                return data;\n            }),\n            /**\n             * fetchXmlToQueryExpression - Convert a FetchXML query to a QueryExpression\n             * @param fetchXml - a valid Fetch XML query\n             * @returns a complex, deserialized version of the fetch query in QueryExpression format\n             */\n            fetchXmlToQueryExpression: (fetchXml) => __awaiter(this, void 0, void 0, function* () {\n                //Tests passed\n                const url = encodeURI(`${this.getWebAPIPath()}FetchXmlToQueryExpression(FetchXml=@p1)?@p1='${fetchXml}'`);\n                const response = yield fetch(url, this.options.get);\n                const data = yield response.json();\n                return data;\n            }),\n            /**\n             * validateFetchXmlExpression - Validate a FetchXML query\n             * NOT YET FULLY IMPLEMENTED\n             * @param fetchXml - a Fetch XML query to test\n             * @returns an object containing the result of the validation - errors, if any, and suggestions to improve, if available\n             */\n            validateFetchXmlExpression: (fetchXml) => __awaiter(this, void 0, void 0, function* () {\n                const url = encodeURI(`${this.getWebAPIPath()}ValidateFetchXmlExpression(FetchXml=@p1)?@p1='${fetchXml}'`);\n                const response = yield fetch(url, this.options.get);\n                const data = yield response.json();\n                return data;\n            }),\n            /**\n             * rollup - Perform a rollup operation on a query. Rollup provides aggregation of a single query on a target record and its child or descendant records.\n             * NOT YET FULLY IMPLEMENTED\n             * @param target - the target record to perform the rollup operation on\n             * @param FetchXml - the FetchXML query to use for the rollup operation\n             * @param RollupType - the depth of the rollup operation\n             * @returns an object containing the results of the rollup operation\n             */\n            rollup: (target, FetchXml, RollupType) => __awaiter(this, void 0, void 0, function* () {\n                const qe = yield this.functions.fetchXmlToQueryExpression(FetchXml);\n                const url = `${this.getWebAPIPath()}Rollup(Target=@p1,Query=@p2,RollupType=@p3)?@p1=${JSON.stringify(target)}&@p2=${JSON.stringify(qe)}&@p3=${RollupType}`;\n                const response = yield fetch(url, this.options.get);\n                const data = yield response.json();\n                return data;\n            })\n        };\n        // #endregion\n        // #region Actions\n        this.actions = {\n            /**\n             * addToQueue - Add a record to a queue\n             * @param queueId - the GUID of the queue to add the record to\n             * @param target - the entity reference of the record to add to the queue\n             * @param QueueItemProperties - optional properties to set on the queue item at create time\n             * @returns an object containing the results of the addToQueue operation, including the QueueItemId\n             */\n            addToQueue: (queueId, target, QueueItemProperties) => __awaiter(this, void 0, void 0, function* () {\n                //Tests passed\n                if (target.etn === undefined) {\n                    throw new Error(\"Target entity reference is not valid. an Entity Type Name must be provided.\");\n                }\n                const url = `${yield this.getWebAPIPathForEntityRecord(target.etn, target.id.guid)}/Microsoft.Dynamics.CRM.AddToQueue`;\n                const body = {\n                    \"Target\": {\n                        \"@odata.type\": `Microsoft.Dynamics.CRM.Queue`,\n                        [`queueid`]: queueId\n                    },\n                    \"QueueItemProperties\": QueueItemProperties ? Object.assign({ \"@odata.type\": `Microsoft.Dynamics.CRM.QueueItem` }, QueueItemProperties) : undefined\n                };\n                const response = yield fetch(url, this.options.post(body));\n                const data = yield response.json();\n                return data;\n            }),\n            /**\n             * pickFromQueue - Assign a queue item to a given user and (optionally) remove it from the queue\n             * NOT YET FULLY IMPLEMENTED\n             * @param queueItemId - the GUID of the queue item to remove from the queue\n             * @param user - the user to assign the queue item to\n             * @param removefromQueue - whether or not to remove the item from the queue\n             * @returns an object containing the results of the removeFromQueue operation\n             */\n            pickFromQueue: (queueItemId, user, removefromQueue) => __awaiter(this, void 0, void 0, function* () {\n                throw new Error(\"Not yet implemented\");\n                const url = `${this.getWebAPIPath()}QueueItem(${queueItemId})/Microsoft.Dynamics.CRM.PickFromQueue`;\n                const body = {\n                    \"SystemUser\": user,\n                    \"RemoveQueueItem\": removefromQueue\n                };\n                const response = yield fetch(url, this.options.post(body));\n                const data = yield response.json();\n                return data;\n            })\n        };\n        this.context = context;\n        this.clientUrl = context.page.getClientUrl();\n    }\n    // #region OOB methods\n    /**\n     * Implements the base WebAPI CreateRecord method\n     */\n    createRecord(entityName, record) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.context.webAPI.createRecord(entityName, record);\n        });\n    }\n    /**\n     * Implements the base WebAPI RetrieveRecord method\n     */\n    retrieveRecord(entityName, recordId, query) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.context.webAPI.retrieveRecord(entityName, recordId, query);\n        });\n    }\n    /**\n     * Implements the base WebAPI RetrieveMultipleRecords method\n     */\n    retrieveMultipleRecords(entityName, query) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.context.webAPI.retrieveMultipleRecords(entityName, query);\n        });\n    }\n    /**\n     * Implements the base WebAPI UpdateRecord method\n     */\n    updateRecord(entityName, recordId, record) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.context.webAPI.updateRecord(entityName, recordId, record);\n        });\n    }\n    /**\n     * Implements the base WebAPI DeleteRecord method\n     */\n    deleteRecord(entityName, recordId) {\n        return __awaiter(this, void 0, void 0, function* () {\n            return this.context.webAPI.deleteRecord(entityName, recordId);\n        });\n    }\n    // #endregion\n    // #region Helper Methods\n    getWebAPIPath() {\n        return this.clientUrl + \"/api/data/v9.2/\";\n    }\n    associateRecords(entityReferenceOrName, relationshipOrRecordId, relatedEntityReferenceOrRelationship, relatedEntityName, relatedRecordId) {\n        if (typeof entityReferenceOrName === \"string\") {\n            return this.associateRecordsWithStrings(entityReferenceOrName, relationshipOrRecordId, relatedEntityReferenceOrRelationship, relatedEntityName, relatedRecordId);\n        }\n        else {\n            return this.associateRecordsWithReferences(entityReferenceOrName, relationshipOrRecordId, relatedEntityReferenceOrRelationship);\n        }\n    }\n    disassociateRecords(entityReferenceOrName, relationshipOrRecordId, relatedEntityReferenceOrRelationship, relatedEntityName, relatedRecordId) {\n        if (typeof entityReferenceOrName === \"string\") {\n            return this.disassociateRecordsWithStrings(entityReferenceOrName, relationshipOrRecordId, relatedEntityReferenceOrRelationship, relatedEntityName, relatedRecordId);\n        }\n        else {\n            return this.disassociateRecordsWithReferences(entityReferenceOrName, relationshipOrRecordId, relatedEntityReferenceOrRelationship);\n        }\n    }\n}\nexports.WebAPIExt = WebAPIExt;\n// #region Interfaces\nclass QueueItem {\n    constructor(id, importsequencenumber, overriddencreatedon, statecode, statuscode, title, timezoneruleversionnumber, utcconversiontimezonecode) {\n        this.queueitemid = id;\n        this.importsequencenumber = importsequencenumber;\n        this.overriddencreatedon = overriddencreatedon;\n        this.statecode = statecode;\n        this.statuscode = statuscode;\n        this.title = title;\n        this.timezoneruleversionnumber = timezoneruleversionnumber;\n        this.utcconversiontimezonecode = utcconversiontimezonecode;\n    }\n}\nexports.QueueItem = QueueItem;\n/**\n * RollupType: used for Rollup function to designate the depth of the rollup operation\n */\nvar RollupType;\n(function (RollupType) {\n    /**\n     * No rollup is performed: only records directly related to the target record are considered.\n     */\n    RollupType[RollupType[\"none\"] = 0] = \"none\";\n    /**\n     * The target record and direct children of the target are used to rollup query results.\n     */\n    RollupType[RollupType[\"related\"] = 1] = \"related\";\n    /**\n     * The target record and all of its descendants are used to rollup query results.\n     */\n    RollupType[RollupType[\"extended\"] = 2] = \"extended\";\n})(RollupType || (exports.RollupType = RollupType = {}));\n// #endregion\n"]}