@mcesystems/mdm-client-g4 1.0.86 → 1.0.90
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/index.js +5 -5
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +2 -2
- package/dist/types/index.d.ts +14 -1
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -37100,20 +37100,20 @@ var MdmClient = class {
|
|
|
37100
37100
|
}
|
|
37101
37101
|
}
|
|
37102
37102
|
};
|
|
37103
|
-
async function createMDMClient() {
|
|
37104
|
-
const endpoint = process.env.MDM_ENDPOINT;
|
|
37105
|
-
const credPath = process.env.CREDENTIALS_PATH;
|
|
37103
|
+
async function createMDMClient(options) {
|
|
37104
|
+
const endpoint = options?.endpoint ?? process.env.MDM_ENDPOINT;
|
|
37105
|
+
const credPath = options?.credentialsPath ?? process.env.CREDENTIALS_PATH;
|
|
37106
37106
|
if (!endpoint || !credPath) {
|
|
37107
37107
|
logWarning("MDM endpoint or credentials path is not set");
|
|
37108
37108
|
logDataObject("Environment variables", { endpoint, credPath });
|
|
37109
37109
|
return void 0;
|
|
37110
37110
|
}
|
|
37111
37111
|
const credentials = await readCredentialsFromFile(credPath);
|
|
37112
|
-
const tokenResponse = await getAuthToken(credentials);
|
|
37112
|
+
const tokenResponse = await getAuthToken(credentials, options?.authApiUrl);
|
|
37113
37113
|
return new MdmClient({
|
|
37114
37114
|
endpoint,
|
|
37115
37115
|
authToken: tokenResponse.accessToken,
|
|
37116
|
-
timeout: 6e4
|
|
37116
|
+
timeout: options?.timeoutMs ?? 6e4
|
|
37117
37117
|
});
|
|
37118
37118
|
}
|
|
37119
37119
|
export {
|