@aappddeevv/dynamics-client-ui
Version:
## What is it? A library to help you create great dynamics applications.
31 lines • 1.08 kB
JavaScript
;
/** Client access to dynamics data */
Object.defineProperty(exports, "__esModule", { value: true });
const CRMWebAPI_1 = require("./CRMWebAPI");
/**
* Create a new client based on an XRM and a postfix. This function does
* not use the discovery service and hence is synchronous. postfix should
* have a leading and trailing slash.
*/
function mkClient(xrm, postfix) {
const config = { APIUrl: xrm.Utility.getGlobalContext().getClientUrl() + postfix };
return fromConfig(config);
}
exports.mkClient = mkClient;
/**
* Create a new client based on a full data API URL that you would find
* from the discovery services or from the Developer Resources page in Dynamics.
*/
function mkClientForURL(url, config) {
const combined = Object.assign({ APIUrl: url }, config);
return fromConfig(combined);
}
exports.mkClientForURL = mkClientForURL;
/**
* Create a new client based on a full Config object.
*/
function fromConfig(config) {
return new CRMWebAPI_1.CRMWebAPI(config);
}
exports.fromConfig = fromConfig;
//# sourceMappingURL=client.js.map