@factorialco/api-client 1.1.0 → 1.1.1
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/README.md +2 -2
- package/dist/cjs/sdk.d.ts +1 -1
- package/dist/cjs/sdk.js +2 -2
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.d.ts +1 -1
- package/dist/esm/sdk.js +2 -2
- package/dist/esm/sdk.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/sdk.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type FactorialClientConfig = Omit<Partial<Config<ClientOptions>>, "baseUr
|
|
|
20
20
|
/**
|
|
21
21
|
* OAuth2 bearer token — sent as `Authorization: Bearer <token>`.
|
|
22
22
|
* Use this when authenticating via OAuth2 instead of an API key.
|
|
23
|
-
* Falls back to the `
|
|
23
|
+
* Falls back to the `FACTORIAL_TOKEN` env var when omitted.
|
|
24
24
|
*/
|
|
25
25
|
token?: string;
|
|
26
26
|
};
|
package/dist/esm/sdk.js
CHANGED
|
@@ -5312,10 +5312,10 @@ export class FactorialClient {
|
|
|
5312
5312
|
globalThis.process.env
|
|
5313
5313
|
: {};
|
|
5314
5314
|
const resolvedApiKey = apiKey ?? env.FACTORIAL_API_KEY;
|
|
5315
|
-
const resolvedToken = token ?? env.
|
|
5315
|
+
const resolvedToken = token ?? env.FACTORIAL_TOKEN;
|
|
5316
5316
|
const resolvedBaseUrl = baseUrl ?? env.FACTORIAL_BASE_URL ?? "https://api.factorialhr.com";
|
|
5317
5317
|
if (!resolvedApiKey && !resolvedToken) {
|
|
5318
|
-
throw new Error("FactorialClient: provide either apiKey or token (or set FACTORIAL_API_KEY /
|
|
5318
|
+
throw new Error("FactorialClient: provide either apiKey or token (or set FACTORIAL_API_KEY / FACTORIAL_TOKEN)");
|
|
5319
5319
|
}
|
|
5320
5320
|
// hey-api calls the auth callback once per security scheme in spec order:
|
|
5321
5321
|
// 1. { type: 'http', scheme: 'bearer' } → Authorization: Bearer <token>
|