@zyphr-dev/node-sdk 0.1.41 → 0.1.42
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 +84 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +88 -13
- package/dist/index.d.ts +88 -13
- package/dist/index.js +74 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +2 -0
- package/src/client.ts +4 -0
- package/src/src/apis/AuthUserDirectoryApi.ts +14 -10
- package/src/src/apis/InboxApi.ts +4 -4
- package/src/src/models/SetEndUserClaims200Response.ts +73 -0
- package/src/src/models/SetEndUserClaims200ResponseData.ts +73 -0
- package/src/src/models/index.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -10732,6 +10732,62 @@ function SetDomainInboundRequestToJSONTyped(value, ignoreDiscriminator = false)
|
|
|
10732
10732
|
};
|
|
10733
10733
|
}
|
|
10734
10734
|
|
|
10735
|
+
// src/src/models/SetEndUserClaims200ResponseData.ts
|
|
10736
|
+
function instanceOfSetEndUserClaims200ResponseData(value) {
|
|
10737
|
+
return true;
|
|
10738
|
+
}
|
|
10739
|
+
function SetEndUserClaims200ResponseDataFromJSON(json) {
|
|
10740
|
+
return SetEndUserClaims200ResponseDataFromJSONTyped(json, false);
|
|
10741
|
+
}
|
|
10742
|
+
function SetEndUserClaims200ResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
10743
|
+
if (json == null) {
|
|
10744
|
+
return json;
|
|
10745
|
+
}
|
|
10746
|
+
return {
|
|
10747
|
+
"claims": json["claims"] == null ? void 0 : json["claims"],
|
|
10748
|
+
"claimsVersion": json["claims_version"] == null ? void 0 : json["claims_version"]
|
|
10749
|
+
};
|
|
10750
|
+
}
|
|
10751
|
+
function SetEndUserClaims200ResponseDataToJSON(json) {
|
|
10752
|
+
return SetEndUserClaims200ResponseDataToJSONTyped(json, false);
|
|
10753
|
+
}
|
|
10754
|
+
function SetEndUserClaims200ResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
10755
|
+
if (value == null) {
|
|
10756
|
+
return value;
|
|
10757
|
+
}
|
|
10758
|
+
return {
|
|
10759
|
+
"claims": value["claims"],
|
|
10760
|
+
"claims_version": value["claimsVersion"]
|
|
10761
|
+
};
|
|
10762
|
+
}
|
|
10763
|
+
|
|
10764
|
+
// src/src/models/SetEndUserClaims200Response.ts
|
|
10765
|
+
function instanceOfSetEndUserClaims200Response(value) {
|
|
10766
|
+
return true;
|
|
10767
|
+
}
|
|
10768
|
+
function SetEndUserClaims200ResponseFromJSON(json) {
|
|
10769
|
+
return SetEndUserClaims200ResponseFromJSONTyped(json, false);
|
|
10770
|
+
}
|
|
10771
|
+
function SetEndUserClaims200ResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
10772
|
+
if (json == null) {
|
|
10773
|
+
return json;
|
|
10774
|
+
}
|
|
10775
|
+
return {
|
|
10776
|
+
"data": json["data"] == null ? void 0 : SetEndUserClaims200ResponseDataFromJSON(json["data"])
|
|
10777
|
+
};
|
|
10778
|
+
}
|
|
10779
|
+
function SetEndUserClaims200ResponseToJSON(json) {
|
|
10780
|
+
return SetEndUserClaims200ResponseToJSONTyped(json, false);
|
|
10781
|
+
}
|
|
10782
|
+
function SetEndUserClaims200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
10783
|
+
if (value == null) {
|
|
10784
|
+
return value;
|
|
10785
|
+
}
|
|
10786
|
+
return {
|
|
10787
|
+
"data": SetEndUserClaims200ResponseDataToJSON(value["data"])
|
|
10788
|
+
};
|
|
10789
|
+
}
|
|
10790
|
+
|
|
10735
10791
|
// src/src/models/SetEndUserClaimsRequest.ts
|
|
10736
10792
|
function instanceOfSetEndUserClaimsRequest(value) {
|
|
10737
10793
|
return true;
|
|
@@ -18049,7 +18105,7 @@ var AuthUserDirectoryApi = class extends BaseAPI {
|
|
|
18049
18105
|
await this.listEndUsersRaw({ page, perPage, search, environment }, initOverrides);
|
|
18050
18106
|
}
|
|
18051
18107
|
/**
|
|
18052
|
-
* Secret-key-scoped upsert of the authoritative custom_claims for an end user. Set server-side only — clients cannot write these, which is what makes them safe for authorization (e.g. an account-type/admin flag). Claims are embedded into the user\'s JWTs on the next login/refresh. Max 4KB; reserved JWT/Zyphr claim names are rejected.
|
|
18108
|
+
* Secret-key-scoped upsert of the authoritative custom_claims for an end user. Set server-side only — clients cannot write these, which is what makes them safe for authorization (e.g. an account-type/admin flag). Claims are embedded into the user\'s JWTs on the next login/refresh. Max 4KB; reserved JWT/Zyphr claim names are rejected. Each write bumps a monotonic `claims_version` (returned in the response). The change applies seamlessly on the user\'s next login or token refresh — a token carrying an older `claims_version` is rejected on verification and the client silently re-mints with the new claims, without a forced logout. For a hard cut-off (log the user out of all sessions immediately), call POST /auth/sessions/revoke-all after updating claims.
|
|
18053
18109
|
* Set an end user\'s stored custom claims (server-side admin)
|
|
18054
18110
|
*/
|
|
18055
18111
|
async setEndUserClaimsRaw(requestParameters, initOverrides) {
|
|
@@ -18081,14 +18137,15 @@ var AuthUserDirectoryApi = class extends BaseAPI {
|
|
|
18081
18137
|
query: queryParameters,
|
|
18082
18138
|
body: SetEndUserClaimsRequestToJSON(requestParameters["setEndUserClaimsRequest"])
|
|
18083
18139
|
}, initOverrides);
|
|
18084
|
-
return new
|
|
18140
|
+
return new JSONApiResponse(response, (jsonValue) => SetEndUserClaims200ResponseFromJSON(jsonValue));
|
|
18085
18141
|
}
|
|
18086
18142
|
/**
|
|
18087
|
-
* Secret-key-scoped upsert of the authoritative custom_claims for an end user. Set server-side only — clients cannot write these, which is what makes them safe for authorization (e.g. an account-type/admin flag). Claims are embedded into the user\'s JWTs on the next login/refresh. Max 4KB; reserved JWT/Zyphr claim names are rejected.
|
|
18143
|
+
* Secret-key-scoped upsert of the authoritative custom_claims for an end user. Set server-side only — clients cannot write these, which is what makes them safe for authorization (e.g. an account-type/admin flag). Claims are embedded into the user\'s JWTs on the next login/refresh. Max 4KB; reserved JWT/Zyphr claim names are rejected. Each write bumps a monotonic `claims_version` (returned in the response). The change applies seamlessly on the user\'s next login or token refresh — a token carrying an older `claims_version` is rejected on verification and the client silently re-mints with the new claims, without a forced logout. For a hard cut-off (log the user out of all sessions immediately), call POST /auth/sessions/revoke-all after updating claims.
|
|
18088
18144
|
* Set an end user\'s stored custom claims (server-side admin)
|
|
18089
18145
|
*/
|
|
18090
18146
|
async setEndUserClaims(userId, setEndUserClaimsRequest, initOverrides) {
|
|
18091
|
-
await this.setEndUserClaimsRaw({ userId, setEndUserClaimsRequest }, initOverrides);
|
|
18147
|
+
const response = await this.setEndUserClaimsRaw({ userId, setEndUserClaimsRequest }, initOverrides);
|
|
18148
|
+
return await response.value();
|
|
18092
18149
|
}
|
|
18093
18150
|
/**
|
|
18094
18151
|
* Secret-key-scoped update of an arbitrary end user in the authenticating application. Updatable fields: email, name, avatar_url, metadata, status. Scoped to the application — a caller can never modify a user belonging to another application.
|
|
@@ -19566,7 +19623,7 @@ var InboxApi = class extends BaseAPI {
|
|
|
19566
19623
|
await this.deleteSubscriberNotificationRaw({ id }, initOverrides);
|
|
19567
19624
|
}
|
|
19568
19625
|
/**
|
|
19569
|
-
* Generate a JWT token for client-side inbox authentication. This is a server-side call that requires your API key. Pass the returned token to `@zyphr/inbox-react`\'s `<ZyphrProvider subscriberToken=\"...\">` or use it as `Authorization: Bearer <token>` for client-side inbox API calls and WebSocket connections. The token expires in 7 days.
|
|
19626
|
+
* Generate a JWT token for client-side inbox authentication. This is a server-side call that requires your API key. Pass the returned token to `@zyphr-dev/inbox-react`\'s `<ZyphrProvider subscriberToken=\"...\">` or use it as `Authorization: Bearer <token>` for client-side inbox API calls and WebSocket connections. The token expires in 7 days.
|
|
19570
19627
|
* Generate a subscriber token
|
|
19571
19628
|
*/
|
|
19572
19629
|
async generateSubscriberTokenRaw(requestParameters, initOverrides) {
|
|
@@ -19592,7 +19649,7 @@ var InboxApi = class extends BaseAPI {
|
|
|
19592
19649
|
return new JSONApiResponse(response, (jsonValue) => GenerateSubscriberToken200ResponseFromJSON(jsonValue));
|
|
19593
19650
|
}
|
|
19594
19651
|
/**
|
|
19595
|
-
* Generate a JWT token for client-side inbox authentication. This is a server-side call that requires your API key. Pass the returned token to `@zyphr/inbox-react`\'s `<ZyphrProvider subscriberToken=\"...\">` or use it as `Authorization: Bearer <token>` for client-side inbox API calls and WebSocket connections. The token expires in 7 days.
|
|
19652
|
+
* Generate a JWT token for client-side inbox authentication. This is a server-side call that requires your API key. Pass the returned token to `@zyphr-dev/inbox-react`\'s `<ZyphrProvider subscriberToken=\"...\">` or use it as `Authorization: Bearer <token>` for client-side inbox API calls and WebSocket connections. The token expires in 7 days.
|
|
19596
19653
|
* Generate a subscriber token
|
|
19597
19654
|
*/
|
|
19598
19655
|
async generateSubscriberToken(generateSubscriberTokenRequest, initOverrides) {
|
|
@@ -24697,6 +24754,7 @@ var Zyphr = class {
|
|
|
24697
24754
|
phone: new AuthPhoneApi(config),
|
|
24698
24755
|
emailOtp: new AuthEmailOTPApi(config),
|
|
24699
24756
|
profile: new AuthUserProfileApi(config),
|
|
24757
|
+
userDirectory: new AuthUserDirectoryApi(config),
|
|
24700
24758
|
webauthn: new AuthWebAuthnApi(config)
|
|
24701
24759
|
};
|
|
24702
24760
|
}
|
|
@@ -26065,6 +26123,14 @@ export {
|
|
|
26065
26123
|
SetDomainInboundRequestFromJSONTyped,
|
|
26066
26124
|
SetDomainInboundRequestToJSON,
|
|
26067
26125
|
SetDomainInboundRequestToJSONTyped,
|
|
26126
|
+
SetEndUserClaims200ResponseDataFromJSON,
|
|
26127
|
+
SetEndUserClaims200ResponseDataFromJSONTyped,
|
|
26128
|
+
SetEndUserClaims200ResponseDataToJSON,
|
|
26129
|
+
SetEndUserClaims200ResponseDataToJSONTyped,
|
|
26130
|
+
SetEndUserClaims200ResponseFromJSON,
|
|
26131
|
+
SetEndUserClaims200ResponseFromJSONTyped,
|
|
26132
|
+
SetEndUserClaims200ResponseToJSON,
|
|
26133
|
+
SetEndUserClaims200ResponseToJSONTyped,
|
|
26068
26134
|
SetEndUserClaimsRequestFromJSON,
|
|
26069
26135
|
SetEndUserClaimsRequestFromJSONTyped,
|
|
26070
26136
|
SetEndUserClaimsRequestToJSON,
|
|
@@ -27072,6 +27138,8 @@ export {
|
|
|
27072
27138
|
instanceOfSessionListResponseData,
|
|
27073
27139
|
instanceOfSessionListResponseDataSessionInfo,
|
|
27074
27140
|
instanceOfSetDomainInboundRequest,
|
|
27141
|
+
instanceOfSetEndUserClaims200Response,
|
|
27142
|
+
instanceOfSetEndUserClaims200ResponseData,
|
|
27075
27143
|
instanceOfSetEndUserClaimsRequest,
|
|
27076
27144
|
instanceOfSetPreferencesRequest,
|
|
27077
27145
|
instanceOfSetPreferencesRequestPreferencesInner,
|