@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 CHANGED
@@ -1260,6 +1260,14 @@ __export(index_exports, {
1260
1260
  SetDomainInboundRequestFromJSONTyped: () => SetDomainInboundRequestFromJSONTyped,
1261
1261
  SetDomainInboundRequestToJSON: () => SetDomainInboundRequestToJSON,
1262
1262
  SetDomainInboundRequestToJSONTyped: () => SetDomainInboundRequestToJSONTyped,
1263
+ SetEndUserClaims200ResponseDataFromJSON: () => SetEndUserClaims200ResponseDataFromJSON,
1264
+ SetEndUserClaims200ResponseDataFromJSONTyped: () => SetEndUserClaims200ResponseDataFromJSONTyped,
1265
+ SetEndUserClaims200ResponseDataToJSON: () => SetEndUserClaims200ResponseDataToJSON,
1266
+ SetEndUserClaims200ResponseDataToJSONTyped: () => SetEndUserClaims200ResponseDataToJSONTyped,
1267
+ SetEndUserClaims200ResponseFromJSON: () => SetEndUserClaims200ResponseFromJSON,
1268
+ SetEndUserClaims200ResponseFromJSONTyped: () => SetEndUserClaims200ResponseFromJSONTyped,
1269
+ SetEndUserClaims200ResponseToJSON: () => SetEndUserClaims200ResponseToJSON,
1270
+ SetEndUserClaims200ResponseToJSONTyped: () => SetEndUserClaims200ResponseToJSONTyped,
1263
1271
  SetEndUserClaimsRequestFromJSON: () => SetEndUserClaimsRequestFromJSON,
1264
1272
  SetEndUserClaimsRequestFromJSONTyped: () => SetEndUserClaimsRequestFromJSONTyped,
1265
1273
  SetEndUserClaimsRequestToJSON: () => SetEndUserClaimsRequestToJSON,
@@ -2267,6 +2275,8 @@ __export(index_exports, {
2267
2275
  instanceOfSessionListResponseData: () => instanceOfSessionListResponseData,
2268
2276
  instanceOfSessionListResponseDataSessionInfo: () => instanceOfSessionListResponseDataSessionInfo,
2269
2277
  instanceOfSetDomainInboundRequest: () => instanceOfSetDomainInboundRequest,
2278
+ instanceOfSetEndUserClaims200Response: () => instanceOfSetEndUserClaims200Response,
2279
+ instanceOfSetEndUserClaims200ResponseData: () => instanceOfSetEndUserClaims200ResponseData,
2270
2280
  instanceOfSetEndUserClaimsRequest: () => instanceOfSetEndUserClaimsRequest,
2271
2281
  instanceOfSetPreferencesRequest: () => instanceOfSetPreferencesRequest,
2272
2282
  instanceOfSetPreferencesRequestPreferencesInner: () => instanceOfSetPreferencesRequestPreferencesInner,
@@ -13172,6 +13182,62 @@ function SetDomainInboundRequestToJSONTyped(value, ignoreDiscriminator = false)
13172
13182
  };
13173
13183
  }
13174
13184
 
13185
+ // src/src/models/SetEndUserClaims200ResponseData.ts
13186
+ function instanceOfSetEndUserClaims200ResponseData(value) {
13187
+ return true;
13188
+ }
13189
+ function SetEndUserClaims200ResponseDataFromJSON(json) {
13190
+ return SetEndUserClaims200ResponseDataFromJSONTyped(json, false);
13191
+ }
13192
+ function SetEndUserClaims200ResponseDataFromJSONTyped(json, ignoreDiscriminator) {
13193
+ if (json == null) {
13194
+ return json;
13195
+ }
13196
+ return {
13197
+ "claims": json["claims"] == null ? void 0 : json["claims"],
13198
+ "claimsVersion": json["claims_version"] == null ? void 0 : json["claims_version"]
13199
+ };
13200
+ }
13201
+ function SetEndUserClaims200ResponseDataToJSON(json) {
13202
+ return SetEndUserClaims200ResponseDataToJSONTyped(json, false);
13203
+ }
13204
+ function SetEndUserClaims200ResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
13205
+ if (value == null) {
13206
+ return value;
13207
+ }
13208
+ return {
13209
+ "claims": value["claims"],
13210
+ "claims_version": value["claimsVersion"]
13211
+ };
13212
+ }
13213
+
13214
+ // src/src/models/SetEndUserClaims200Response.ts
13215
+ function instanceOfSetEndUserClaims200Response(value) {
13216
+ return true;
13217
+ }
13218
+ function SetEndUserClaims200ResponseFromJSON(json) {
13219
+ return SetEndUserClaims200ResponseFromJSONTyped(json, false);
13220
+ }
13221
+ function SetEndUserClaims200ResponseFromJSONTyped(json, ignoreDiscriminator) {
13222
+ if (json == null) {
13223
+ return json;
13224
+ }
13225
+ return {
13226
+ "data": json["data"] == null ? void 0 : SetEndUserClaims200ResponseDataFromJSON(json["data"])
13227
+ };
13228
+ }
13229
+ function SetEndUserClaims200ResponseToJSON(json) {
13230
+ return SetEndUserClaims200ResponseToJSONTyped(json, false);
13231
+ }
13232
+ function SetEndUserClaims200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
13233
+ if (value == null) {
13234
+ return value;
13235
+ }
13236
+ return {
13237
+ "data": SetEndUserClaims200ResponseDataToJSON(value["data"])
13238
+ };
13239
+ }
13240
+
13175
13241
  // src/src/models/SetEndUserClaimsRequest.ts
13176
13242
  function instanceOfSetEndUserClaimsRequest(value) {
13177
13243
  return true;
@@ -20489,7 +20555,7 @@ var AuthUserDirectoryApi = class extends BaseAPI {
20489
20555
  await this.listEndUsersRaw({ page, perPage, search, environment }, initOverrides);
20490
20556
  }
20491
20557
  /**
20492
- * 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. To make a change take effect immediately on already-issued tokens (e.g. revoking admin), call POST /auth/sessions/revoke-all for the user after updating claims — that bumps the revocation epoch so outstanding access tokens stop verifying.
20558
+ * 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.
20493
20559
  * Set an end user\'s stored custom claims (server-side admin)
20494
20560
  */
20495
20561
  async setEndUserClaimsRaw(requestParameters, initOverrides) {
@@ -20521,14 +20587,15 @@ var AuthUserDirectoryApi = class extends BaseAPI {
20521
20587
  query: queryParameters,
20522
20588
  body: SetEndUserClaimsRequestToJSON(requestParameters["setEndUserClaimsRequest"])
20523
20589
  }, initOverrides);
20524
- return new VoidApiResponse(response);
20590
+ return new JSONApiResponse(response, (jsonValue) => SetEndUserClaims200ResponseFromJSON(jsonValue));
20525
20591
  }
20526
20592
  /**
20527
- * 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. To make a change take effect immediately on already-issued tokens (e.g. revoking admin), call POST /auth/sessions/revoke-all for the user after updating claims — that bumps the revocation epoch so outstanding access tokens stop verifying.
20593
+ * 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.
20528
20594
  * Set an end user\'s stored custom claims (server-side admin)
20529
20595
  */
20530
20596
  async setEndUserClaims(userId, setEndUserClaimsRequest, initOverrides) {
20531
- await this.setEndUserClaimsRaw({ userId, setEndUserClaimsRequest }, initOverrides);
20597
+ const response = await this.setEndUserClaimsRaw({ userId, setEndUserClaimsRequest }, initOverrides);
20598
+ return await response.value();
20532
20599
  }
20533
20600
  /**
20534
20601
  * 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.
@@ -22006,7 +22073,7 @@ var InboxApi = class extends BaseAPI {
22006
22073
  await this.deleteSubscriberNotificationRaw({ id }, initOverrides);
22007
22074
  }
22008
22075
  /**
22009
- * 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.
22076
+ * 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.
22010
22077
  * Generate a subscriber token
22011
22078
  */
22012
22079
  async generateSubscriberTokenRaw(requestParameters, initOverrides) {
@@ -22032,7 +22099,7 @@ var InboxApi = class extends BaseAPI {
22032
22099
  return new JSONApiResponse(response, (jsonValue) => GenerateSubscriberToken200ResponseFromJSON(jsonValue));
22033
22100
  }
22034
22101
  /**
22035
- * 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.
22102
+ * 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.
22036
22103
  * Generate a subscriber token
22037
22104
  */
22038
22105
  async generateSubscriberToken(generateSubscriberTokenRequest, initOverrides) {
@@ -27137,6 +27204,7 @@ var Zyphr = class {
27137
27204
  phone: new AuthPhoneApi(config),
27138
27205
  emailOtp: new AuthEmailOTPApi(config),
27139
27206
  profile: new AuthUserProfileApi(config),
27207
+ userDirectory: new AuthUserDirectoryApi(config),
27140
27208
  webauthn: new AuthWebAuthnApi(config)
27141
27209
  };
27142
27210
  }
@@ -28506,6 +28574,14 @@ var SDK_VERSION = "0.1.0";
28506
28574
  SetDomainInboundRequestFromJSONTyped,
28507
28575
  SetDomainInboundRequestToJSON,
28508
28576
  SetDomainInboundRequestToJSONTyped,
28577
+ SetEndUserClaims200ResponseDataFromJSON,
28578
+ SetEndUserClaims200ResponseDataFromJSONTyped,
28579
+ SetEndUserClaims200ResponseDataToJSON,
28580
+ SetEndUserClaims200ResponseDataToJSONTyped,
28581
+ SetEndUserClaims200ResponseFromJSON,
28582
+ SetEndUserClaims200ResponseFromJSONTyped,
28583
+ SetEndUserClaims200ResponseToJSON,
28584
+ SetEndUserClaims200ResponseToJSONTyped,
28509
28585
  SetEndUserClaimsRequestFromJSON,
28510
28586
  SetEndUserClaimsRequestFromJSONTyped,
28511
28587
  SetEndUserClaimsRequestToJSON,
@@ -29513,6 +29589,8 @@ var SDK_VERSION = "0.1.0";
29513
29589
  instanceOfSessionListResponseData,
29514
29590
  instanceOfSessionListResponseDataSessionInfo,
29515
29591
  instanceOfSetDomainInboundRequest,
29592
+ instanceOfSetEndUserClaims200Response,
29593
+ instanceOfSetEndUserClaims200ResponseData,
29516
29594
  instanceOfSetEndUserClaimsRequest,
29517
29595
  instanceOfSetPreferencesRequest,
29518
29596
  instanceOfSetPreferencesRequestPreferencesInner,