@zyphr-dev/node-sdk 0.1.14 → 0.1.16
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.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +12 -2
package/dist/index.d.cts
CHANGED
|
@@ -22505,12 +22505,16 @@ declare class Zyphr {
|
|
|
22505
22505
|
readonly profile: AuthUserProfileApi;
|
|
22506
22506
|
readonly webauthn: AuthWebAuthnApi;
|
|
22507
22507
|
};
|
|
22508
|
+
private readonly options;
|
|
22508
22509
|
constructor(options: ZyphrOptions);
|
|
22509
22510
|
/**
|
|
22510
22511
|
* Create request overrides that authenticate as an end user.
|
|
22511
22512
|
* Use this when calling profile, session, or MFA endpoints that
|
|
22512
22513
|
* require the end user's access token instead of the API key.
|
|
22513
22514
|
*
|
|
22515
|
+
* Includes both the end-user Bearer token and the application
|
|
22516
|
+
* public key (X-Application-Key) required by user-scoped endpoints.
|
|
22517
|
+
*
|
|
22514
22518
|
* @example
|
|
22515
22519
|
* ```ts
|
|
22516
22520
|
* const login = await zyphr.auth.login.loginEndUser({ ... });
|
package/dist/index.d.ts
CHANGED
|
@@ -22505,12 +22505,16 @@ declare class Zyphr {
|
|
|
22505
22505
|
readonly profile: AuthUserProfileApi;
|
|
22506
22506
|
readonly webauthn: AuthWebAuthnApi;
|
|
22507
22507
|
};
|
|
22508
|
+
private readonly options;
|
|
22508
22509
|
constructor(options: ZyphrOptions);
|
|
22509
22510
|
/**
|
|
22510
22511
|
* Create request overrides that authenticate as an end user.
|
|
22511
22512
|
* Use this when calling profile, session, or MFA endpoints that
|
|
22512
22513
|
* require the end user's access token instead of the API key.
|
|
22513
22514
|
*
|
|
22515
|
+
* Includes both the end-user Bearer token and the application
|
|
22516
|
+
* public key (X-Application-Key) required by user-scoped endpoints.
|
|
22517
|
+
*
|
|
22514
22518
|
* @example
|
|
22515
22519
|
* ```ts
|
|
22516
22520
|
* const login = await zyphr.auth.login.loginEndUser({ ... });
|
package/dist/index.js
CHANGED
|
@@ -17878,7 +17878,9 @@ var Zyphr = class {
|
|
|
17878
17878
|
devices;
|
|
17879
17879
|
waas;
|
|
17880
17880
|
auth;
|
|
17881
|
+
options;
|
|
17881
17882
|
constructor(options) {
|
|
17883
|
+
this.options = options;
|
|
17882
17884
|
const config = new Configuration({
|
|
17883
17885
|
basePath: options.baseUrl,
|
|
17884
17886
|
apiKey: (name) => {
|
|
@@ -17924,6 +17926,9 @@ var Zyphr = class {
|
|
|
17924
17926
|
* Use this when calling profile, session, or MFA endpoints that
|
|
17925
17927
|
* require the end user's access token instead of the API key.
|
|
17926
17928
|
*
|
|
17929
|
+
* Includes both the end-user Bearer token and the application
|
|
17930
|
+
* public key (X-Application-Key) required by user-scoped endpoints.
|
|
17931
|
+
*
|
|
17927
17932
|
* @example
|
|
17928
17933
|
* ```ts
|
|
17929
17934
|
* const login = await zyphr.auth.login.loginEndUser({ ... });
|
|
@@ -17935,9 +17940,13 @@ var Zyphr = class {
|
|
|
17935
17940
|
* ```
|
|
17936
17941
|
*/
|
|
17937
17942
|
asEndUser(accessToken) {
|
|
17938
|
-
|
|
17939
|
-
|
|
17943
|
+
const headers = {
|
|
17944
|
+
Authorization: `Bearer ${accessToken}`
|
|
17940
17945
|
};
|
|
17946
|
+
if (this.options.applicationKey) {
|
|
17947
|
+
headers["X-Application-Key"] = this.options.applicationKey;
|
|
17948
|
+
}
|
|
17949
|
+
return { headers };
|
|
17941
17950
|
}
|
|
17942
17951
|
};
|
|
17943
17952
|
|