@mcesystems/mdm-client-g4 1.0.87 → 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.js
CHANGED
|
@@ -37109,20 +37109,20 @@ var MdmClient = class {
|
|
|
37109
37109
|
}
|
|
37110
37110
|
}
|
|
37111
37111
|
};
|
|
37112
|
-
async function createMDMClient() {
|
|
37113
|
-
const endpoint = process.env.MDM_ENDPOINT;
|
|
37114
|
-
const credPath = process.env.CREDENTIALS_PATH;
|
|
37112
|
+
async function createMDMClient(options) {
|
|
37113
|
+
const endpoint = options?.endpoint ?? process.env.MDM_ENDPOINT;
|
|
37114
|
+
const credPath = options?.credentialsPath ?? process.env.CREDENTIALS_PATH;
|
|
37115
37115
|
if (!endpoint || !credPath) {
|
|
37116
37116
|
logWarning("MDM endpoint or credentials path is not set");
|
|
37117
37117
|
logDataObject("Environment variables", { endpoint, credPath });
|
|
37118
37118
|
return void 0;
|
|
37119
37119
|
}
|
|
37120
37120
|
const credentials = await readCredentialsFromFile(credPath);
|
|
37121
|
-
const tokenResponse = await getAuthToken(credentials);
|
|
37121
|
+
const tokenResponse = await getAuthToken(credentials, options?.authApiUrl);
|
|
37122
37122
|
return new MdmClient({
|
|
37123
37123
|
endpoint,
|
|
37124
37124
|
authToken: tokenResponse.accessToken,
|
|
37125
|
-
timeout: 6e4
|
|
37125
|
+
timeout: options?.timeoutMs ?? 6e4
|
|
37126
37126
|
});
|
|
37127
37127
|
}
|
|
37128
37128
|
// Annotate the CommonJS export names for ESM import in node:
|