@zyphr-dev/node-sdk 0.1.37 → 0.1.38

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
@@ -163,6 +163,7 @@ __export(index_exports, {
163
163
  AuthTokensFromJSONTyped: () => AuthTokensFromJSONTyped,
164
164
  AuthTokensToJSON: () => AuthTokensToJSON,
165
165
  AuthTokensToJSONTyped: () => AuthTokensToJSONTyped,
166
+ AuthUserDirectoryApi: () => AuthUserDirectoryApi,
166
167
  AuthUserFromJSON: () => AuthUserFromJSON,
167
168
  AuthUserFromJSONTyped: () => AuthUserFromJSONTyped,
168
169
  AuthUserProfileApi: () => AuthUserProfileApi,
@@ -577,10 +578,16 @@ __export(index_exports, {
577
578
  InboxNotificationResponseFromJSONTyped: () => InboxNotificationResponseFromJSONTyped,
578
579
  InboxNotificationResponseToJSON: () => InboxNotificationResponseToJSON,
579
580
  InboxNotificationResponseToJSONTyped: () => InboxNotificationResponseToJSONTyped,
581
+ InviteEndUserRequestFromJSON: () => InviteEndUserRequestFromJSON,
582
+ InviteEndUserRequestFromJSONTyped: () => InviteEndUserRequestFromJSONTyped,
583
+ InviteEndUserRequestSendLinkEnum: () => InviteEndUserRequestSendLinkEnum,
584
+ InviteEndUserRequestToJSON: () => InviteEndUserRequestToJSON,
585
+ InviteEndUserRequestToJSONTyped: () => InviteEndUserRequestToJSONTyped,
580
586
  JSONApiResponse: () => JSONApiResponse,
581
587
  ListAllInboxStatusEnum: () => ListAllInboxStatusEnum,
582
588
  ListDevicesPlatformEnum: () => ListDevicesPlatformEnum,
583
589
  ListEmailsStatusEnum: () => ListEmailsStatusEnum,
590
+ ListEndUsersEnvironmentEnum: () => ListEndUsersEnvironmentEnum,
584
591
  ListInboundEmailsStatusEnum: () => ListInboundEmailsStatusEnum,
585
592
  ListPushStatusEnum: () => ListPushStatusEnum,
586
593
  ListSlackMessagesStatusEnum: () => ListSlackMessagesStatusEnum,
@@ -767,6 +774,11 @@ __export(index_exports, {
767
774
  OAuthProviderInfoFromJSONTyped: () => OAuthProviderInfoFromJSONTyped,
768
775
  OAuthProviderInfoToJSON: () => OAuthProviderInfoToJSON,
769
776
  OAuthProviderInfoToJSONTyped: () => OAuthProviderInfoToJSONTyped,
777
+ OAuthProviderName: () => OAuthProviderName,
778
+ OAuthProviderNameFromJSON: () => OAuthProviderNameFromJSON,
779
+ OAuthProviderNameFromJSONTyped: () => OAuthProviderNameFromJSONTyped,
780
+ OAuthProviderNameToJSON: () => OAuthProviderNameToJSON,
781
+ OAuthProviderNameToJSONTyped: () => OAuthProviderNameToJSONTyped,
770
782
  OAuthProviderToJSON: () => OAuthProviderToJSON,
771
783
  OAuthProviderToJSONTyped: () => OAuthProviderToJSONTyped,
772
784
  OAuthProvidersResponseDataFromJSON: () => OAuthProvidersResponseDataFromJSON,
@@ -1196,6 +1208,10 @@ __export(index_exports, {
1196
1208
  SetDomainInboundRequestFromJSONTyped: () => SetDomainInboundRequestFromJSONTyped,
1197
1209
  SetDomainInboundRequestToJSON: () => SetDomainInboundRequestToJSON,
1198
1210
  SetDomainInboundRequestToJSONTyped: () => SetDomainInboundRequestToJSONTyped,
1211
+ SetEndUserClaimsRequestFromJSON: () => SetEndUserClaimsRequestFromJSON,
1212
+ SetEndUserClaimsRequestFromJSONTyped: () => SetEndUserClaimsRequestFromJSONTyped,
1213
+ SetEndUserClaimsRequestToJSON: () => SetEndUserClaimsRequestToJSON,
1214
+ SetEndUserClaimsRequestToJSONTyped: () => SetEndUserClaimsRequestToJSONTyped,
1199
1215
  SetPreferencesRequestFromJSON: () => SetPreferencesRequestFromJSON,
1200
1216
  SetPreferencesRequestFromJSONTyped: () => SetPreferencesRequestFromJSONTyped,
1201
1217
  SetPreferencesRequestPreferencesInnerFromJSON: () => SetPreferencesRequestPreferencesInnerFromJSON,
@@ -1208,6 +1224,10 @@ __export(index_exports, {
1208
1224
  SignInAnonymouslyRequestFromJSONTyped: () => SignInAnonymouslyRequestFromJSONTyped,
1209
1225
  SignInAnonymouslyRequestToJSON: () => SignInAnonymouslyRequestToJSON,
1210
1226
  SignInAnonymouslyRequestToJSONTyped: () => SignInAnonymouslyRequestToJSONTyped,
1227
+ SignInWithGameCenterRequestFromJSON: () => SignInWithGameCenterRequestFromJSON,
1228
+ SignInWithGameCenterRequestFromJSONTyped: () => SignInWithGameCenterRequestFromJSONTyped,
1229
+ SignInWithGameCenterRequestToJSON: () => SignInWithGameCenterRequestToJSON,
1230
+ SignInWithGameCenterRequestToJSONTyped: () => SignInWithGameCenterRequestToJSONTyped,
1211
1231
  SlackApi: () => SlackApi,
1212
1232
  SlackMessageFromJSON: () => SlackMessageFromJSON,
1213
1233
  SlackMessageFromJSONTyped: () => SlackMessageFromJSONTyped,
@@ -1441,6 +1461,10 @@ __export(index_exports, {
1441
1461
  UpdateCategoryRequestFromJSONTyped: () => UpdateCategoryRequestFromJSONTyped,
1442
1462
  UpdateCategoryRequestToJSON: () => UpdateCategoryRequestToJSON,
1443
1463
  UpdateCategoryRequestToJSONTyped: () => UpdateCategoryRequestToJSONTyped,
1464
+ UpdateEndUserByApplicationRequestFromJSON: () => UpdateEndUserByApplicationRequestFromJSON,
1465
+ UpdateEndUserByApplicationRequestFromJSONTyped: () => UpdateEndUserByApplicationRequestFromJSONTyped,
1466
+ UpdateEndUserByApplicationRequestToJSON: () => UpdateEndUserByApplicationRequestToJSON,
1467
+ UpdateEndUserByApplicationRequestToJSONTyped: () => UpdateEndUserByApplicationRequestToJSONTyped,
1444
1468
  UpdateEndUserRequestFromJSON: () => UpdateEndUserRequestFromJSON,
1445
1469
  UpdateEndUserRequestFromJSONTyped: () => UpdateEndUserRequestFromJSONTyped,
1446
1470
  UpdateEndUserRequestToJSON: () => UpdateEndUserRequestToJSON,
@@ -1858,6 +1882,8 @@ __export(index_exports, {
1858
1882
  WorkflowStepExecutionToJSONTyped: () => WorkflowStepExecutionToJSONTyped,
1859
1883
  Zyphr: () => Zyphr,
1860
1884
  ZyphrAuthenticationError: () => ZyphrAuthenticationError,
1885
+ ZyphrClient: () => ZyphrClient,
1886
+ ZyphrClientCredentialError: () => ZyphrClientCredentialError,
1861
1887
  ZyphrError: () => ZyphrError,
1862
1888
  ZyphrNotFoundError: () => ZyphrNotFoundError,
1863
1889
  ZyphrPayloadTooLargeError: () => ZyphrPayloadTooLargeError,
@@ -1992,6 +2018,7 @@ __export(index_exports, {
1992
2018
  instanceOfInboxListMeta: () => instanceOfInboxListMeta,
1993
2019
  instanceOfInboxListResponse: () => instanceOfInboxListResponse,
1994
2020
  instanceOfInboxNotificationResponse: () => instanceOfInboxNotificationResponse,
2021
+ instanceOfInviteEndUserRequest: () => instanceOfInviteEndUserRequest,
1995
2022
  instanceOfListWaaSApplications200Response: () => instanceOfListWaaSApplications200Response,
1996
2023
  instanceOfListWaaSEndpointDeliveries200Response: () => instanceOfListWaaSEndpointDeliveries200Response,
1997
2024
  instanceOfListWaaSEndpoints200Response: () => instanceOfListWaaSEndpoints200Response,
@@ -2036,6 +2063,7 @@ __export(index_exports, {
2036
2063
  instanceOfOAuthConnectionsResponseData: () => instanceOfOAuthConnectionsResponseData,
2037
2064
  instanceOfOAuthProvider: () => instanceOfOAuthProvider,
2038
2065
  instanceOfOAuthProviderInfo: () => instanceOfOAuthProviderInfo,
2066
+ instanceOfOAuthProviderName: () => instanceOfOAuthProviderName,
2039
2067
  instanceOfOAuthProvidersResponse: () => instanceOfOAuthProvidersResponse,
2040
2068
  instanceOfOAuthProvidersResponseData: () => instanceOfOAuthProvidersResponseData,
2041
2069
  instanceOfOAuthTokensRefreshResponse: () => instanceOfOAuthTokensRefreshResponse,
@@ -2139,9 +2167,11 @@ __export(index_exports, {
2139
2167
  instanceOfSessionListResponseData: () => instanceOfSessionListResponseData,
2140
2168
  instanceOfSessionListResponseDataSessionInfo: () => instanceOfSessionListResponseDataSessionInfo,
2141
2169
  instanceOfSetDomainInboundRequest: () => instanceOfSetDomainInboundRequest,
2170
+ instanceOfSetEndUserClaimsRequest: () => instanceOfSetEndUserClaimsRequest,
2142
2171
  instanceOfSetPreferencesRequest: () => instanceOfSetPreferencesRequest,
2143
2172
  instanceOfSetPreferencesRequestPreferencesInner: () => instanceOfSetPreferencesRequestPreferencesInner,
2144
2173
  instanceOfSignInAnonymouslyRequest: () => instanceOfSignInAnonymouslyRequest,
2174
+ instanceOfSignInWithGameCenterRequest: () => instanceOfSignInWithGameCenterRequest,
2145
2175
  instanceOfSlackMessage: () => instanceOfSlackMessage,
2146
2176
  instanceOfSlackMessageListResponse: () => instanceOfSlackMessageListResponse,
2147
2177
  instanceOfSlackMessageListResponseMeta: () => instanceOfSlackMessageListResponseMeta,
@@ -2197,6 +2227,7 @@ __export(index_exports, {
2197
2227
  instanceOfUnsubscribeRequest: () => instanceOfUnsubscribeRequest,
2198
2228
  instanceOfUnsubscribeResponse: () => instanceOfUnsubscribeResponse,
2199
2229
  instanceOfUpdateCategoryRequest: () => instanceOfUpdateCategoryRequest,
2230
+ instanceOfUpdateEndUserByApplicationRequest: () => instanceOfUpdateEndUserByApplicationRequest,
2200
2231
  instanceOfUpdateEndUserRequest: () => instanceOfUpdateEndUserRequest,
2201
2232
  instanceOfUpdateOrganizationMemberRoleRequest: () => instanceOfUpdateOrganizationMemberRoleRequest,
2202
2233
  instanceOfUpdateOrganizationRequest: () => instanceOfUpdateOrganizationRequest,
@@ -7393,6 +7424,47 @@ function InboxNotificationResponseToJSONTyped(value, ignoreDiscriminator = false
7393
7424
  };
7394
7425
  }
7395
7426
 
7427
+ // src/src/models/InviteEndUserRequest.ts
7428
+ var InviteEndUserRequestSendLinkEnum = {
7429
+ MAGIC: "magic",
7430
+ PASSWORD_RESET: "password_reset",
7431
+ NONE: "none"
7432
+ };
7433
+ function instanceOfInviteEndUserRequest(value) {
7434
+ if (!("email" in value) || value["email"] === void 0) return false;
7435
+ return true;
7436
+ }
7437
+ function InviteEndUserRequestFromJSON(json) {
7438
+ return InviteEndUserRequestFromJSONTyped(json, false);
7439
+ }
7440
+ function InviteEndUserRequestFromJSONTyped(json, ignoreDiscriminator) {
7441
+ if (json == null) {
7442
+ return json;
7443
+ }
7444
+ return {
7445
+ "email": json["email"],
7446
+ "name": json["name"] == null ? void 0 : json["name"],
7447
+ "metadata": json["metadata"] == null ? void 0 : json["metadata"],
7448
+ "sendLink": json["send_link"] == null ? void 0 : json["send_link"],
7449
+ "redirectUrl": json["redirect_url"] == null ? void 0 : json["redirect_url"]
7450
+ };
7451
+ }
7452
+ function InviteEndUserRequestToJSON(json) {
7453
+ return InviteEndUserRequestToJSONTyped(json, false);
7454
+ }
7455
+ function InviteEndUserRequestToJSONTyped(value, ignoreDiscriminator = false) {
7456
+ if (value == null) {
7457
+ return value;
7458
+ }
7459
+ return {
7460
+ "email": value["email"],
7461
+ "name": value["name"],
7462
+ "metadata": value["metadata"],
7463
+ "send_link": value["sendLink"],
7464
+ "redirect_url": value["redirectUrl"]
7465
+ };
7466
+ }
7467
+
7396
7468
  // src/src/models/ListWaaSApplications200Response.ts
7397
7469
  function instanceOfListWaaSApplications200Response(value) {
7398
7470
  return true;
@@ -8772,6 +8844,37 @@ function OAuthProviderToJSONTyped(value, ignoreDiscriminator = false) {
8772
8844
  };
8773
8845
  }
8774
8846
 
8847
+ // src/src/models/OAuthProviderName.ts
8848
+ var OAuthProviderName = {
8849
+ GOOGLE: "google",
8850
+ APPLE: "apple",
8851
+ FACEBOOK: "facebook",
8852
+ GITHUB: "github",
8853
+ MICROSOFT: "microsoft"
8854
+ };
8855
+ function instanceOfOAuthProviderName(value) {
8856
+ for (const key in OAuthProviderName) {
8857
+ if (Object.prototype.hasOwnProperty.call(OAuthProviderName, key)) {
8858
+ if (OAuthProviderName[key] === value) {
8859
+ return true;
8860
+ }
8861
+ }
8862
+ }
8863
+ return false;
8864
+ }
8865
+ function OAuthProviderNameFromJSON(json) {
8866
+ return OAuthProviderNameFromJSONTyped(json, false);
8867
+ }
8868
+ function OAuthProviderNameFromJSONTyped(json, ignoreDiscriminator) {
8869
+ return json;
8870
+ }
8871
+ function OAuthProviderNameToJSON(value) {
8872
+ return value;
8873
+ }
8874
+ function OAuthProviderNameToJSONTyped(value, ignoreDiscriminator) {
8875
+ return value;
8876
+ }
8877
+
8775
8878
  // src/src/models/OAuthProvidersResponseData.ts
8776
8879
  function instanceOfOAuthProvidersResponseData(value) {
8777
8880
  return true;
@@ -12355,6 +12458,33 @@ function SetDomainInboundRequestToJSONTyped(value, ignoreDiscriminator = false)
12355
12458
  };
12356
12459
  }
12357
12460
 
12461
+ // src/src/models/SetEndUserClaimsRequest.ts
12462
+ function instanceOfSetEndUserClaimsRequest(value) {
12463
+ return true;
12464
+ }
12465
+ function SetEndUserClaimsRequestFromJSON(json) {
12466
+ return SetEndUserClaimsRequestFromJSONTyped(json, false);
12467
+ }
12468
+ function SetEndUserClaimsRequestFromJSONTyped(json, ignoreDiscriminator) {
12469
+ if (json == null) {
12470
+ return json;
12471
+ }
12472
+ return {
12473
+ "claims": json["claims"] == null ? void 0 : json["claims"]
12474
+ };
12475
+ }
12476
+ function SetEndUserClaimsRequestToJSON(json) {
12477
+ return SetEndUserClaimsRequestToJSONTyped(json, false);
12478
+ }
12479
+ function SetEndUserClaimsRequestToJSONTyped(value, ignoreDiscriminator = false) {
12480
+ if (value == null) {
12481
+ return value;
12482
+ }
12483
+ return {
12484
+ "claims": value["claims"]
12485
+ };
12486
+ }
12487
+
12358
12488
  // src/src/models/SetPreferencesRequestPreferencesInner.ts
12359
12489
  function instanceOfSetPreferencesRequestPreferencesInner(value) {
12360
12490
  return true;
@@ -12429,7 +12559,9 @@ function SignInAnonymouslyRequestFromJSONTyped(json, ignoreDiscriminator) {
12429
12559
  return {
12430
12560
  "deviceId": json["device_id"],
12431
12561
  "name": json["name"] == null ? void 0 : json["name"],
12432
- "metadata": json["metadata"] == null ? void 0 : json["metadata"]
12562
+ "metadata": json["metadata"] == null ? void 0 : json["metadata"],
12563
+ "organizationId": json["organization_id"] == null ? void 0 : json["organization_id"],
12564
+ "organizationRole": json["organization_role"] == null ? void 0 : json["organization_role"]
12433
12565
  };
12434
12566
  }
12435
12567
  function SignInAnonymouslyRequestToJSON(json) {
@@ -12442,7 +12574,52 @@ function SignInAnonymouslyRequestToJSONTyped(value, ignoreDiscriminator = false)
12442
12574
  return {
12443
12575
  "device_id": value["deviceId"],
12444
12576
  "name": value["name"],
12445
- "metadata": value["metadata"]
12577
+ "metadata": value["metadata"],
12578
+ "organization_id": value["organizationId"],
12579
+ "organization_role": value["organizationRole"]
12580
+ };
12581
+ }
12582
+
12583
+ // src/src/models/SignInWithGameCenterRequest.ts
12584
+ function instanceOfSignInWithGameCenterRequest(value) {
12585
+ if (!("playerId" in value) || value["playerId"] === void 0) return false;
12586
+ if (!("publicKeyUrl" in value) || value["publicKeyUrl"] === void 0) return false;
12587
+ if (!("signature" in value) || value["signature"] === void 0) return false;
12588
+ if (!("salt" in value) || value["salt"] === void 0) return false;
12589
+ if (!("timestamp" in value) || value["timestamp"] === void 0) return false;
12590
+ if (!("bundleId" in value) || value["bundleId"] === void 0) return false;
12591
+ return true;
12592
+ }
12593
+ function SignInWithGameCenterRequestFromJSON(json) {
12594
+ return SignInWithGameCenterRequestFromJSONTyped(json, false);
12595
+ }
12596
+ function SignInWithGameCenterRequestFromJSONTyped(json, ignoreDiscriminator) {
12597
+ if (json == null) {
12598
+ return json;
12599
+ }
12600
+ return {
12601
+ "playerId": json["playerId"],
12602
+ "publicKeyUrl": json["publicKeyUrl"],
12603
+ "signature": json["signature"],
12604
+ "salt": json["salt"],
12605
+ "timestamp": json["timestamp"],
12606
+ "bundleId": json["bundleId"]
12607
+ };
12608
+ }
12609
+ function SignInWithGameCenterRequestToJSON(json) {
12610
+ return SignInWithGameCenterRequestToJSONTyped(json, false);
12611
+ }
12612
+ function SignInWithGameCenterRequestToJSONTyped(value, ignoreDiscriminator = false) {
12613
+ if (value == null) {
12614
+ return value;
12615
+ }
12616
+ return {
12617
+ "playerId": value["playerId"],
12618
+ "publicKeyUrl": value["publicKeyUrl"],
12619
+ "signature": value["signature"],
12620
+ "salt": value["salt"],
12621
+ "timestamp": value["timestamp"],
12622
+ "bundleId": value["bundleId"]
12446
12623
  };
12447
12624
  }
12448
12625
 
@@ -14101,6 +14278,41 @@ function UpdateCategoryRequestToJSONTyped(value, ignoreDiscriminator = false) {
14101
14278
  };
14102
14279
  }
14103
14280
 
14281
+ // src/src/models/UpdateEndUserByApplicationRequest.ts
14282
+ function instanceOfUpdateEndUserByApplicationRequest(value) {
14283
+ return true;
14284
+ }
14285
+ function UpdateEndUserByApplicationRequestFromJSON(json) {
14286
+ return UpdateEndUserByApplicationRequestFromJSONTyped(json, false);
14287
+ }
14288
+ function UpdateEndUserByApplicationRequestFromJSONTyped(json, ignoreDiscriminator) {
14289
+ if (json == null) {
14290
+ return json;
14291
+ }
14292
+ return {
14293
+ "email": json["email"] == null ? void 0 : json["email"],
14294
+ "name": json["name"] == null ? void 0 : json["name"],
14295
+ "avatarUrl": json["avatar_url"] == null ? void 0 : json["avatar_url"],
14296
+ "metadata": json["metadata"] == null ? void 0 : json["metadata"],
14297
+ "status": json["status"] == null ? void 0 : json["status"]
14298
+ };
14299
+ }
14300
+ function UpdateEndUserByApplicationRequestToJSON(json) {
14301
+ return UpdateEndUserByApplicationRequestToJSONTyped(json, false);
14302
+ }
14303
+ function UpdateEndUserByApplicationRequestToJSONTyped(value, ignoreDiscriminator = false) {
14304
+ if (value == null) {
14305
+ return value;
14306
+ }
14307
+ return {
14308
+ "email": value["email"],
14309
+ "name": value["name"],
14310
+ "avatar_url": value["avatarUrl"],
14311
+ "metadata": value["metadata"],
14312
+ "status": value["status"]
14313
+ };
14314
+ }
14315
+
14104
14316
  // src/src/models/UpdateEndUserRequest.ts
14105
14317
  function instanceOfUpdateEndUserRequest(value) {
14106
14318
  return true;
@@ -18986,7 +19198,7 @@ var AuthRegistrationApi = class extends BaseAPI {
18986
19198
  return await response.value();
18987
19199
  }
18988
19200
  /**
18989
- * Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert.
19201
+ * Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert. Pass an optional `organization_id` to create the anonymous user directly in an organization; the returned access token then carries `org_id` (and `orgs`), matching the org-scoped register/login flow.
18990
19202
  * Sign in anonymously
18991
19203
  */
18992
19204
  async signInAnonymouslyRaw(requestParameters, initOverrides) {
@@ -19012,13 +19224,47 @@ var AuthRegistrationApi = class extends BaseAPI {
19012
19224
  return new JSONApiResponse(response, (jsonValue) => AuthResultResponseFromJSON(jsonValue));
19013
19225
  }
19014
19226
  /**
19015
- * Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert.
19227
+ * Issue an end-user identity to a device without email, password, OAuth, or any other credential. Idempotent per (application, environment, device_id): repeated calls with the same device_id return the same user but a fresh token pair. Prior sessions for the user remain valid until natural expiry. Anonymous users do not count toward MAU quota until their first authenticated request after sign-in (excluding /v1/auth/refresh). Convert an anonymous user to a full account via POST /v1/auth/users/convert. Pass an optional `organization_id` to create the anonymous user directly in an organization; the returned access token then carries `org_id` (and `orgs`), matching the org-scoped register/login flow.
19016
19228
  * Sign in anonymously
19017
19229
  */
19018
19230
  async signInAnonymously(signInAnonymouslyRequest, initOverrides) {
19019
19231
  const response = await this.signInAnonymouslyRaw({ signInAnonymouslyRequest }, initOverrides);
19020
19232
  return await response.value();
19021
19233
  }
19234
+ /**
19235
+ * Exchange an Apple Game Center identity-verification assertion for a Zyphr end-user session. Zyphr independently re-verifies the assertion server-side (Apple certificate chain, RSA-SHA256 signature, timestamp freshness, single-use replay guard, and bundle-id binding) before provisioning-or-looking-up the user and minting tokens. The user is keyed on the modern scoped `playerId` (gamePlayerID). ## Producing the assertion (Integration) The assertion is produced **on-device by the iOS app** — there is no server-side way to mint it. The app calls GameKit\'s `GKLocalPlayer.fetchItems(forIdentityVerificationSignature:)`, which returns `publicKeyURL`, `signature`, `salt`, and `timestamp`; combine those with the local player\'s `gamePlayerID` and the app\'s bundle identifier and submit them here. Two integration shapes are supported: - **client-direct** — the iOS app holds the Zyphr application public key and calls this endpoint itself. - **backend-relayed** — the app forwards the fetched assertion fields to the customer\'s own backend, which relays them to this endpoint; the app never holds Zyphr keys. (This is the common shape for games.) On any verification failure the response is a single opaque `401` `invalid_assertion` — the specific control that failed is never disclosed.
19236
+ * Sign in with Apple Game Center
19237
+ */
19238
+ async signInWithGameCenterRaw(requestParameters, initOverrides) {
19239
+ if (requestParameters["signInWithGameCenterRequest"] == null) {
19240
+ throw new RequiredError(
19241
+ "signInWithGameCenterRequest",
19242
+ 'Required parameter "signInWithGameCenterRequest" was null or undefined when calling signInWithGameCenter().'
19243
+ );
19244
+ }
19245
+ const queryParameters = {};
19246
+ const headerParameters = {};
19247
+ headerParameters["Content-Type"] = "application/json";
19248
+ if (this.configuration && this.configuration.apiKey) {
19249
+ headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
19250
+ }
19251
+ const response = await this.request({
19252
+ path: `/auth/game-center`,
19253
+ method: "POST",
19254
+ headers: headerParameters,
19255
+ query: queryParameters,
19256
+ body: SignInWithGameCenterRequestToJSON(requestParameters["signInWithGameCenterRequest"])
19257
+ }, initOverrides);
19258
+ return new JSONApiResponse(response, (jsonValue) => AuthResultResponseFromJSON(jsonValue));
19259
+ }
19260
+ /**
19261
+ * Exchange an Apple Game Center identity-verification assertion for a Zyphr end-user session. Zyphr independently re-verifies the assertion server-side (Apple certificate chain, RSA-SHA256 signature, timestamp freshness, single-use replay guard, and bundle-id binding) before provisioning-or-looking-up the user and minting tokens. The user is keyed on the modern scoped `playerId` (gamePlayerID). ## Producing the assertion (Integration) The assertion is produced **on-device by the iOS app** — there is no server-side way to mint it. The app calls GameKit\'s `GKLocalPlayer.fetchItems(forIdentityVerificationSignature:)`, which returns `publicKeyURL`, `signature`, `salt`, and `timestamp`; combine those with the local player\'s `gamePlayerID` and the app\'s bundle identifier and submit them here. Two integration shapes are supported: - **client-direct** — the iOS app holds the Zyphr application public key and calls this endpoint itself. - **backend-relayed** — the app forwards the fetched assertion fields to the customer\'s own backend, which relays them to this endpoint; the app never holds Zyphr keys. (This is the common shape for games.) On any verification failure the response is a single opaque `401` `invalid_assertion` — the specific control that failed is never disclosed.
19262
+ * Sign in with Apple Game Center
19263
+ */
19264
+ async signInWithGameCenter(signInWithGameCenterRequest, initOverrides) {
19265
+ const response = await this.signInWithGameCenterRaw({ signInWithGameCenterRequest }, initOverrides);
19266
+ return await response.value();
19267
+ }
19022
19268
  };
19023
19269
 
19024
19270
  // src/src/apis/AuthSessionsApi.ts
@@ -19168,50 +19414,88 @@ var AuthSessionsApi = class extends BaseAPI {
19168
19414
  }
19169
19415
  };
19170
19416
 
19171
- // src/src/apis/AuthUserProfileApi.ts
19172
- var AuthUserProfileApi = class extends BaseAPI {
19417
+ // src/src/apis/AuthUserDirectoryApi.ts
19418
+ var AuthUserDirectoryApi = class extends BaseAPI {
19173
19419
  /**
19174
- * Delete the current end user account (GDPR right to erasure). This is a soft delete — the account is marked as deleted but data is retained for a period to allow for recovery or legal requirements.
19175
- * Delete current end user account
19420
+ * Secret-key-scoped admin soft-delete for an arbitrary end user in the authenticating application. Works in both test and live environments. Scoped to the application via the application_id filter — a caller can never delete a user belonging to another application. Mirrors the self-service `DELETE /auth/users/me` flow: revokes all sessions, soft-deletes the row (status=\'deleted\'), and emits a `user.deleted` webhook with `method=\'application_admin\'`. The audit log row survives (no FK to end_users), so org-history queries still resolve.
19421
+ * Delete an end user (server-side admin)
19176
19422
  */
19177
- async deleteEndUserRaw(initOverrides) {
19423
+ async deleteEndUserByApplicationRaw(requestParameters, initOverrides) {
19424
+ if (requestParameters["userId"] == null) {
19425
+ throw new RequiredError(
19426
+ "userId",
19427
+ 'Required parameter "userId" was null or undefined when calling deleteEndUserByApplication().'
19428
+ );
19429
+ }
19178
19430
  const queryParameters = {};
19179
19431
  const headerParameters = {};
19180
- if (this.configuration && this.configuration.accessToken) {
19181
- const token = this.configuration.accessToken;
19182
- const tokenString = await token("EndUserToken", []);
19183
- if (tokenString) {
19184
- headerParameters["Authorization"] = `Bearer ${tokenString}`;
19185
- }
19432
+ if (this.configuration && this.configuration.apiKey) {
19433
+ headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret");
19186
19434
  }
19187
19435
  if (this.configuration && this.configuration.apiKey) {
19188
19436
  headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
19189
19437
  }
19190
19438
  const response = await this.request({
19191
- path: `/auth/users/me`,
19439
+ path: `/auth/users/{user_id}`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters["userId"]))),
19192
19440
  method: "DELETE",
19193
19441
  headers: headerParameters,
19194
19442
  query: queryParameters
19195
19443
  }, initOverrides);
19196
- return new JSONApiResponse(response, (jsonValue) => EndUserDeleteResponseFromJSON(jsonValue));
19444
+ return new VoidApiResponse(response);
19197
19445
  }
19198
19446
  /**
19199
- * Delete the current end user account (GDPR right to erasure). This is a soft delete — the account is marked as deleted but data is retained for a period to allow for recovery or legal requirements.
19200
- * Delete current end user account
19447
+ * Secret-key-scoped admin soft-delete for an arbitrary end user in the authenticating application. Works in both test and live environments. Scoped to the application via the application_id filter — a caller can never delete a user belonging to another application. Mirrors the self-service `DELETE /auth/users/me` flow: revokes all sessions, soft-deletes the row (status=\'deleted\'), and emits a `user.deleted` webhook with `method=\'application_admin\'`. The audit log row survives (no FK to end_users), so org-history queries still resolve.
19448
+ * Delete an end user (server-side admin)
19201
19449
  */
19202
- async deleteEndUser(initOverrides) {
19203
- const response = await this.deleteEndUserRaw(initOverrides);
19204
- return await response.value();
19450
+ async deleteEndUserByApplication(userId, initOverrides) {
19451
+ await this.deleteEndUserByApplicationRaw({ userId }, initOverrides);
19205
19452
  }
19206
19453
  /**
19207
- * App-credentialed soft-delete for an end user, scoped to the test environment only. Live-mode credentials receive 403 — this is the intentional safety guard against a misconfigured CI runner nuking production users. Mirrors the self-service `DELETE /auth/users/me` flow: revokes all sessions, soft-deletes the row (status=\'deleted\'), and emits a `user.deleted` webhook with `method=\'application_admin\'`. The audit log row survives (no FK to end_users), so org-history queries still resolve. Intended for smoke / test-fixture cleanup. Production deletes should continue to use `DELETE /auth/users/me` from the end-user\'s own session or the dashboard.
19208
- * Delete an end user (test environment only)
19454
+ * Secret-key-scoped lookup of a single end user by email address within the authenticating application. Scoped to the application — never resolves a user from another application. Does not return the password hash.
19455
+ * Look up an end user by email (server-side admin)
19209
19456
  */
19210
- async deleteEndUserByApplicationRaw(requestParameters, initOverrides) {
19457
+ async getEndUserByEmailRaw(requestParameters, initOverrides) {
19458
+ if (requestParameters["email"] == null) {
19459
+ throw new RequiredError(
19460
+ "email",
19461
+ 'Required parameter "email" was null or undefined when calling getEndUserByEmail().'
19462
+ );
19463
+ }
19464
+ const queryParameters = {};
19465
+ if (requestParameters["email"] != null) {
19466
+ queryParameters["email"] = requestParameters["email"];
19467
+ }
19468
+ const headerParameters = {};
19469
+ if (this.configuration && this.configuration.apiKey) {
19470
+ headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret");
19471
+ }
19472
+ if (this.configuration && this.configuration.apiKey) {
19473
+ headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
19474
+ }
19475
+ const response = await this.request({
19476
+ path: `/auth/users/by-email`,
19477
+ method: "GET",
19478
+ headers: headerParameters,
19479
+ query: queryParameters
19480
+ }, initOverrides);
19481
+ return new VoidApiResponse(response);
19482
+ }
19483
+ /**
19484
+ * Secret-key-scoped lookup of a single end user by email address within the authenticating application. Scoped to the application — never resolves a user from another application. Does not return the password hash.
19485
+ * Look up an end user by email (server-side admin)
19486
+ */
19487
+ async getEndUserByEmail(email, initOverrides) {
19488
+ await this.getEndUserByEmailRaw({ email }, initOverrides);
19489
+ }
19490
+ /**
19491
+ * Secret-key-scoped fetch of a single end user by id within the authenticating application. Scoped to the application — a caller can never read a user belonging to another application.
19492
+ * Get an end user by id (server-side admin)
19493
+ */
19494
+ async getEndUserByIdRaw(requestParameters, initOverrides) {
19211
19495
  if (requestParameters["userId"] == null) {
19212
19496
  throw new RequiredError(
19213
19497
  "userId",
19214
- 'Required parameter "userId" was null or undefined when calling deleteEndUserByApplication().'
19498
+ 'Required parameter "userId" was null or undefined when calling getEndUserById().'
19215
19499
  );
19216
19500
  }
19217
19501
  const queryParameters = {};
@@ -19224,18 +19508,253 @@ var AuthUserProfileApi = class extends BaseAPI {
19224
19508
  }
19225
19509
  const response = await this.request({
19226
19510
  path: `/auth/users/{user_id}`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters["userId"]))),
19227
- method: "DELETE",
19511
+ method: "GET",
19228
19512
  headers: headerParameters,
19229
19513
  query: queryParameters
19230
19514
  }, initOverrides);
19231
19515
  return new VoidApiResponse(response);
19232
19516
  }
19233
19517
  /**
19234
- * App-credentialed soft-delete for an end user, scoped to the test environment only. Live-mode credentials receive 403 — this is the intentional safety guard against a misconfigured CI runner nuking production users. Mirrors the self-service `DELETE /auth/users/me` flow: revokes all sessions, soft-deletes the row (status=\'deleted\'), and emits a `user.deleted` webhook with `method=\'application_admin\'`. The audit log row survives (no FK to end_users), so org-history queries still resolve. Intended for smoke / test-fixture cleanup. Production deletes should continue to use `DELETE /auth/users/me` from the end-user\'s own session or the dashboard.
19235
- * Delete an end user (test environment only)
19518
+ * Secret-key-scoped fetch of a single end user by id within the authenticating application. Scoped to the application — a caller can never read a user belonging to another application.
19519
+ * Get an end user by id (server-side admin)
19236
19520
  */
19237
- async deleteEndUserByApplication(userId, initOverrides) {
19238
- await this.deleteEndUserByApplicationRaw({ userId }, initOverrides);
19521
+ async getEndUserById(userId, initOverrides) {
19522
+ await this.getEndUserByIdRaw({ userId }, initOverrides);
19523
+ }
19524
+ /**
19525
+ * Secret-key-scoped read of the authoritative custom_claims stored for an end user. These are the TRUSTED claims embedded into the user\'s JWTs on login/refresh — use them (not the client-writable `metadata` field) for authorization decisions. Returns an empty object when none are set.
19526
+ * Get an end user\'s stored custom claims (server-side admin)
19527
+ */
19528
+ async getEndUserClaimsRaw(requestParameters, initOverrides) {
19529
+ if (requestParameters["userId"] == null) {
19530
+ throw new RequiredError(
19531
+ "userId",
19532
+ 'Required parameter "userId" was null or undefined when calling getEndUserClaims().'
19533
+ );
19534
+ }
19535
+ const queryParameters = {};
19536
+ const headerParameters = {};
19537
+ if (this.configuration && this.configuration.apiKey) {
19538
+ headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret");
19539
+ }
19540
+ if (this.configuration && this.configuration.apiKey) {
19541
+ headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
19542
+ }
19543
+ const response = await this.request({
19544
+ path: `/auth/users/{user_id}/claims`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters["userId"]))),
19545
+ method: "GET",
19546
+ headers: headerParameters,
19547
+ query: queryParameters
19548
+ }, initOverrides);
19549
+ return new VoidApiResponse(response);
19550
+ }
19551
+ /**
19552
+ * Secret-key-scoped read of the authoritative custom_claims stored for an end user. These are the TRUSTED claims embedded into the user\'s JWTs on login/refresh — use them (not the client-writable `metadata` field) for authorization decisions. Returns an empty object when none are set.
19553
+ * Get an end user\'s stored custom claims (server-side admin)
19554
+ */
19555
+ async getEndUserClaims(userId, initOverrides) {
19556
+ await this.getEndUserClaimsRaw({ userId }, initOverrides);
19557
+ }
19558
+ /**
19559
+ * Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"magic\"` sends a magic-link sign-in email. - `send_link: \"password_reset\"` sends a set-password email. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required when `send_link` is \"magic\" or \"password_reset\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
19560
+ * Pre-provision (invite) an end user (server-side admin)
19561
+ */
19562
+ async inviteEndUserRaw(requestParameters, initOverrides) {
19563
+ if (requestParameters["inviteEndUserRequest"] == null) {
19564
+ throw new RequiredError(
19565
+ "inviteEndUserRequest",
19566
+ 'Required parameter "inviteEndUserRequest" was null or undefined when calling inviteEndUser().'
19567
+ );
19568
+ }
19569
+ const queryParameters = {};
19570
+ const headerParameters = {};
19571
+ headerParameters["Content-Type"] = "application/json";
19572
+ if (this.configuration && this.configuration.apiKey) {
19573
+ headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret");
19574
+ }
19575
+ if (this.configuration && this.configuration.apiKey) {
19576
+ headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
19577
+ }
19578
+ const response = await this.request({
19579
+ path: `/auth/users/invite`,
19580
+ method: "POST",
19581
+ headers: headerParameters,
19582
+ query: queryParameters,
19583
+ body: InviteEndUserRequestToJSON(requestParameters["inviteEndUserRequest"])
19584
+ }, initOverrides);
19585
+ return new VoidApiResponse(response);
19586
+ }
19587
+ /**
19588
+ * Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"magic\"` sends a magic-link sign-in email. - `send_link: \"password_reset\"` sends a set-password email. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required when `send_link` is \"magic\" or \"password_reset\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
19589
+ * Pre-provision (invite) an end user (server-side admin)
19590
+ */
19591
+ async inviteEndUser(inviteEndUserRequest, initOverrides) {
19592
+ await this.inviteEndUserRaw({ inviteEndUserRequest }, initOverrides);
19593
+ }
19594
+ /**
19595
+ * Secret-key-scoped directory listing of end users in the authenticating application. Supports substring search over email, name, and phone, an optional environment filter (test/live), and pagination. Scoped to the application — never returns users from another application.
19596
+ * List / search end users (server-side admin)
19597
+ */
19598
+ async listEndUsersRaw(requestParameters, initOverrides) {
19599
+ const queryParameters = {};
19600
+ if (requestParameters["page"] != null) {
19601
+ queryParameters["page"] = requestParameters["page"];
19602
+ }
19603
+ if (requestParameters["perPage"] != null) {
19604
+ queryParameters["per_page"] = requestParameters["perPage"];
19605
+ }
19606
+ if (requestParameters["search"] != null) {
19607
+ queryParameters["search"] = requestParameters["search"];
19608
+ }
19609
+ if (requestParameters["environment"] != null) {
19610
+ queryParameters["environment"] = requestParameters["environment"];
19611
+ }
19612
+ const headerParameters = {};
19613
+ if (this.configuration && this.configuration.apiKey) {
19614
+ headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret");
19615
+ }
19616
+ if (this.configuration && this.configuration.apiKey) {
19617
+ headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
19618
+ }
19619
+ const response = await this.request({
19620
+ path: `/auth/users`,
19621
+ method: "GET",
19622
+ headers: headerParameters,
19623
+ query: queryParameters
19624
+ }, initOverrides);
19625
+ return new VoidApiResponse(response);
19626
+ }
19627
+ /**
19628
+ * Secret-key-scoped directory listing of end users in the authenticating application. Supports substring search over email, name, and phone, an optional environment filter (test/live), and pagination. Scoped to the application — never returns users from another application.
19629
+ * List / search end users (server-side admin)
19630
+ */
19631
+ async listEndUsers(page, perPage, search, environment, initOverrides) {
19632
+ await this.listEndUsersRaw({ page, perPage, search, environment }, initOverrides);
19633
+ }
19634
+ /**
19635
+ * 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.
19636
+ * Set an end user\'s stored custom claims (server-side admin)
19637
+ */
19638
+ async setEndUserClaimsRaw(requestParameters, initOverrides) {
19639
+ if (requestParameters["userId"] == null) {
19640
+ throw new RequiredError(
19641
+ "userId",
19642
+ 'Required parameter "userId" was null or undefined when calling setEndUserClaims().'
19643
+ );
19644
+ }
19645
+ if (requestParameters["setEndUserClaimsRequest"] == null) {
19646
+ throw new RequiredError(
19647
+ "setEndUserClaimsRequest",
19648
+ 'Required parameter "setEndUserClaimsRequest" was null or undefined when calling setEndUserClaims().'
19649
+ );
19650
+ }
19651
+ const queryParameters = {};
19652
+ const headerParameters = {};
19653
+ headerParameters["Content-Type"] = "application/json";
19654
+ if (this.configuration && this.configuration.apiKey) {
19655
+ headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret");
19656
+ }
19657
+ if (this.configuration && this.configuration.apiKey) {
19658
+ headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
19659
+ }
19660
+ const response = await this.request({
19661
+ path: `/auth/users/{user_id}/claims`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters["userId"]))),
19662
+ method: "PUT",
19663
+ headers: headerParameters,
19664
+ query: queryParameters,
19665
+ body: SetEndUserClaimsRequestToJSON(requestParameters["setEndUserClaimsRequest"])
19666
+ }, initOverrides);
19667
+ return new VoidApiResponse(response);
19668
+ }
19669
+ /**
19670
+ * 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.
19671
+ * Set an end user\'s stored custom claims (server-side admin)
19672
+ */
19673
+ async setEndUserClaims(userId, setEndUserClaimsRequest, initOverrides) {
19674
+ await this.setEndUserClaimsRaw({ userId, setEndUserClaimsRequest }, initOverrides);
19675
+ }
19676
+ /**
19677
+ * 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.
19678
+ * Update an end user (server-side admin)
19679
+ */
19680
+ async updateEndUserByApplicationRaw(requestParameters, initOverrides) {
19681
+ if (requestParameters["userId"] == null) {
19682
+ throw new RequiredError(
19683
+ "userId",
19684
+ 'Required parameter "userId" was null or undefined when calling updateEndUserByApplication().'
19685
+ );
19686
+ }
19687
+ if (requestParameters["updateEndUserByApplicationRequest"] == null) {
19688
+ throw new RequiredError(
19689
+ "updateEndUserByApplicationRequest",
19690
+ 'Required parameter "updateEndUserByApplicationRequest" was null or undefined when calling updateEndUserByApplication().'
19691
+ );
19692
+ }
19693
+ const queryParameters = {};
19694
+ const headerParameters = {};
19695
+ headerParameters["Content-Type"] = "application/json";
19696
+ if (this.configuration && this.configuration.apiKey) {
19697
+ headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret");
19698
+ }
19699
+ if (this.configuration && this.configuration.apiKey) {
19700
+ headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
19701
+ }
19702
+ const response = await this.request({
19703
+ path: `/auth/users/{user_id}`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters["userId"]))),
19704
+ method: "PATCH",
19705
+ headers: headerParameters,
19706
+ query: queryParameters,
19707
+ body: UpdateEndUserByApplicationRequestToJSON(requestParameters["updateEndUserByApplicationRequest"])
19708
+ }, initOverrides);
19709
+ return new VoidApiResponse(response);
19710
+ }
19711
+ /**
19712
+ * 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.
19713
+ * Update an end user (server-side admin)
19714
+ */
19715
+ async updateEndUserByApplication(userId, updateEndUserByApplicationRequest, initOverrides) {
19716
+ await this.updateEndUserByApplicationRaw({ userId, updateEndUserByApplicationRequest }, initOverrides);
19717
+ }
19718
+ };
19719
+ var ListEndUsersEnvironmentEnum = {
19720
+ TEST: "test",
19721
+ LIVE: "live"
19722
+ };
19723
+
19724
+ // src/src/apis/AuthUserProfileApi.ts
19725
+ var AuthUserProfileApi = class extends BaseAPI {
19726
+ /**
19727
+ * Delete the current end user account (GDPR right to erasure). This is a soft delete — the account is marked as deleted but data is retained for a period to allow for recovery or legal requirements.
19728
+ * Delete current end user account
19729
+ */
19730
+ async deleteEndUserRaw(initOverrides) {
19731
+ const queryParameters = {};
19732
+ const headerParameters = {};
19733
+ if (this.configuration && this.configuration.accessToken) {
19734
+ const token = this.configuration.accessToken;
19735
+ const tokenString = await token("EndUserToken", []);
19736
+ if (tokenString) {
19737
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
19738
+ }
19739
+ }
19740
+ if (this.configuration && this.configuration.apiKey) {
19741
+ headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
19742
+ }
19743
+ const response = await this.request({
19744
+ path: `/auth/users/me`,
19745
+ method: "DELETE",
19746
+ headers: headerParameters,
19747
+ query: queryParameters
19748
+ }, initOverrides);
19749
+ return new JSONApiResponse(response, (jsonValue) => EndUserDeleteResponseFromJSON(jsonValue));
19750
+ }
19751
+ /**
19752
+ * Delete the current end user account (GDPR right to erasure). This is a soft delete — the account is marked as deleted but data is retained for a period to allow for recovery or legal requirements.
19753
+ * Delete current end user account
19754
+ */
19755
+ async deleteEndUser(initOverrides) {
19756
+ const response = await this.deleteEndUserRaw(initOverrides);
19757
+ return await response.value();
19239
19758
  }
19240
19759
  /**
19241
19760
  * Retrieve the profile of the currently authenticated end user.
@@ -25406,34 +25925,34 @@ var ZyphrError = class extends Error {
25406
25925
  }
25407
25926
  };
25408
25927
  var ZyphrValidationError = class extends ZyphrError {
25409
- constructor(message, details) {
25410
- super({ message, status: 422, code: "validation_error", details });
25928
+ constructor(message, details, code = "validation_error") {
25929
+ super({ message, status: 422, code, details });
25411
25930
  this.name = "ZyphrValidationError";
25412
25931
  }
25413
25932
  };
25414
25933
  var ZyphrAuthenticationError = class extends ZyphrError {
25415
- constructor(message) {
25416
- super({ message, status: 401, code: "authentication_error" });
25934
+ constructor(message, code = "authentication_error") {
25935
+ super({ message, status: 401, code });
25417
25936
  this.name = "ZyphrAuthenticationError";
25418
25937
  }
25419
25938
  };
25420
25939
  var ZyphrRateLimitError = class extends ZyphrError {
25421
25940
  retryAfter;
25422
- constructor(message, retryAfter) {
25423
- super({ message, status: 429, code: "rate_limit_exceeded" });
25941
+ constructor(message, retryAfter, code = "rate_limit_exceeded") {
25942
+ super({ message, status: 429, code });
25424
25943
  this.name = "ZyphrRateLimitError";
25425
25944
  this.retryAfter = retryAfter;
25426
25945
  }
25427
25946
  };
25428
25947
  var ZyphrNotFoundError = class extends ZyphrError {
25429
- constructor(message) {
25430
- super({ message, status: 404, code: "not_found" });
25948
+ constructor(message, code = "not_found") {
25949
+ super({ message, status: 404, code });
25431
25950
  this.name = "ZyphrNotFoundError";
25432
25951
  }
25433
25952
  };
25434
25953
  var ZyphrPayloadTooLargeError = class extends ZyphrError {
25435
- constructor(message, details, requestId) {
25436
- super({ message, status: 413, code: "payload_too_large", details, requestId });
25954
+ constructor(message, details, requestId, code = "payload_too_large") {
25955
+ super({ message, status: 413, code, details, requestId });
25437
25956
  this.name = "ZyphrPayloadTooLargeError";
25438
25957
  }
25439
25958
  /** Maximum allowed request body size in bytes (server-enforced). */
@@ -25463,24 +25982,24 @@ async function parseErrorResponse(response) {
25463
25982
  const error = body.error ?? {};
25464
25983
  const meta = body.meta ?? {};
25465
25984
  const message = error.message ?? response.statusText ?? "Unknown error";
25466
- const code = error.code;
25985
+ const code = error.code || void 0;
25467
25986
  const requestId = meta.request_id;
25468
25987
  const details = error.details;
25469
25988
  switch (response.status) {
25470
25989
  case 400:
25471
25990
  case 422:
25472
- return new ZyphrValidationError(message, details);
25991
+ return new ZyphrValidationError(message, details, code);
25473
25992
  case 401:
25474
25993
  case 403:
25475
- return new ZyphrAuthenticationError(message);
25994
+ return new ZyphrAuthenticationError(message, code);
25476
25995
  case 404:
25477
- return new ZyphrNotFoundError(message);
25996
+ return new ZyphrNotFoundError(message, code);
25478
25997
  case 413:
25479
- return new ZyphrPayloadTooLargeError(message, details, requestId);
25998
+ return new ZyphrPayloadTooLargeError(message, details, requestId, code);
25480
25999
  case 429: {
25481
26000
  const retryAfterHeader = response.headers.get("Retry-After");
25482
26001
  const retryAfter = retryAfterHeader ? parseInt(retryAfterHeader, 10) : void 0;
25483
- return new ZyphrRateLimitError(message, retryAfter);
26002
+ return new ZyphrRateLimitError(message, retryAfter, code);
25484
26003
  }
25485
26004
  default:
25486
26005
  return new ZyphrError({ message, status: response.status, code, requestId, details });
@@ -25591,6 +26110,99 @@ var Zyphr = class {
25591
26110
  }
25592
26111
  };
25593
26112
 
26113
+ // src/clientAuth.ts
26114
+ var errorMiddleware2 = {
26115
+ async post(context) {
26116
+ if (context.response.status >= 200 && context.response.status < 300) {
26117
+ return;
26118
+ }
26119
+ throw await parseErrorResponse(context.response);
26120
+ }
26121
+ };
26122
+ var ZyphrClientCredentialError = class extends Error {
26123
+ constructor(message) {
26124
+ super(message);
26125
+ this.name = "ZyphrClientCredentialError";
26126
+ }
26127
+ };
26128
+ var SECRET_KEY_PREFIXES = ["za_sec_", "zy_live_", "zy_test_"];
26129
+ var ZyphrClient = class {
26130
+ auth;
26131
+ /** Device registration for push (takes an OS-acquired token). */
26132
+ devices;
26133
+ applicationKey;
26134
+ accessToken;
26135
+ constructor(options) {
26136
+ if (!options.applicationKey) {
26137
+ throw new ZyphrClientCredentialError("applicationKey (za_pub_*) is required");
26138
+ }
26139
+ if (SECRET_KEY_PREFIXES.some((p) => options.applicationKey.startsWith(p))) {
26140
+ throw new ZyphrClientCredentialError(
26141
+ "ZyphrClient must be constructed with a publishable application key (za_pub_*), never a secret key. Secret keys must stay server-side."
26142
+ );
26143
+ }
26144
+ if (!options.applicationKey.startsWith("za_pub_")) {
26145
+ throw new ZyphrClientCredentialError(
26146
+ "applicationKey must be a publishable application key (za_pub_*)."
26147
+ );
26148
+ }
26149
+ this.applicationKey = options.applicationKey;
26150
+ this.accessToken = options.accessToken;
26151
+ const config = new Configuration({
26152
+ basePath: options.baseUrl,
26153
+ // The only credential this client sends automatically is the publishable
26154
+ // application key. End-user Bearer tokens are attached per-request via
26155
+ // authedRequest() so token rotation doesn't require rebuilding the client.
26156
+ apiKey: (name) => name === "X-Application-Key" ? this.applicationKey : "",
26157
+ middleware: [errorMiddleware2]
26158
+ });
26159
+ this.auth = {
26160
+ login: new AuthLoginApi(config),
26161
+ registration: new AuthRegistrationApi(config),
26162
+ sessions: new AuthSessionsApi(config),
26163
+ emailVerification: new AuthEmailVerificationApi(config),
26164
+ passwordReset: new AuthPasswordResetApi(config),
26165
+ mfa: new AuthMFAApi(config),
26166
+ magicLinks: new AuthMagicLinksApi(config),
26167
+ oauth: new AuthOAuthApi(config),
26168
+ organizations: new AuthOrganizationsApi(config),
26169
+ phone: new AuthPhoneApi(config),
26170
+ emailOtp: new AuthEmailOTPApi(config),
26171
+ profile: new AuthUserProfileApi(config),
26172
+ webauthn: new AuthWebAuthnApi(config)
26173
+ };
26174
+ this.devices = new DevicesApi(config);
26175
+ }
26176
+ /** Store the end-user access token for subsequent authedRequest() calls. */
26177
+ setAccessToken(accessToken) {
26178
+ this.accessToken = accessToken;
26179
+ }
26180
+ /** True when an end-user access token is currently set. */
26181
+ get isAuthenticated() {
26182
+ return Boolean(this.accessToken);
26183
+ }
26184
+ /**
26185
+ * Build request overrides that authenticate as the current end user: the
26186
+ * stored Bearer token plus the publishable application key required by
26187
+ * user-scoped endpoints. Pass an explicit token to override the stored one.
26188
+ *
26189
+ * @example
26190
+ * ```ts
26191
+ * const me = await zyphr.auth.profile.getEndUser(zyphr.authedRequest());
26192
+ * ```
26193
+ */
26194
+ authedRequest(accessToken) {
26195
+ const token = accessToken ?? this.accessToken;
26196
+ const headers = {
26197
+ "X-Application-Key": this.applicationKey
26198
+ };
26199
+ if (token) {
26200
+ headers.Authorization = `Bearer ${token}`;
26201
+ }
26202
+ return { headers };
26203
+ }
26204
+ };
26205
+
25594
26206
  // src/index.ts
25595
26207
  var SDK_VERSION = "0.1.0";
25596
26208
  // Annotate the CommonJS export names for ESM import in node:
@@ -25738,6 +26350,7 @@ var SDK_VERSION = "0.1.0";
25738
26350
  AuthTokensFromJSONTyped,
25739
26351
  AuthTokensToJSON,
25740
26352
  AuthTokensToJSONTyped,
26353
+ AuthUserDirectoryApi,
25741
26354
  AuthUserFromJSON,
25742
26355
  AuthUserFromJSONTyped,
25743
26356
  AuthUserProfileApi,
@@ -26152,10 +26765,16 @@ var SDK_VERSION = "0.1.0";
26152
26765
  InboxNotificationResponseFromJSONTyped,
26153
26766
  InboxNotificationResponseToJSON,
26154
26767
  InboxNotificationResponseToJSONTyped,
26768
+ InviteEndUserRequestFromJSON,
26769
+ InviteEndUserRequestFromJSONTyped,
26770
+ InviteEndUserRequestSendLinkEnum,
26771
+ InviteEndUserRequestToJSON,
26772
+ InviteEndUserRequestToJSONTyped,
26155
26773
  JSONApiResponse,
26156
26774
  ListAllInboxStatusEnum,
26157
26775
  ListDevicesPlatformEnum,
26158
26776
  ListEmailsStatusEnum,
26777
+ ListEndUsersEnvironmentEnum,
26159
26778
  ListInboundEmailsStatusEnum,
26160
26779
  ListPushStatusEnum,
26161
26780
  ListSlackMessagesStatusEnum,
@@ -26342,6 +26961,11 @@ var SDK_VERSION = "0.1.0";
26342
26961
  OAuthProviderInfoFromJSONTyped,
26343
26962
  OAuthProviderInfoToJSON,
26344
26963
  OAuthProviderInfoToJSONTyped,
26964
+ OAuthProviderName,
26965
+ OAuthProviderNameFromJSON,
26966
+ OAuthProviderNameFromJSONTyped,
26967
+ OAuthProviderNameToJSON,
26968
+ OAuthProviderNameToJSONTyped,
26345
26969
  OAuthProviderToJSON,
26346
26970
  OAuthProviderToJSONTyped,
26347
26971
  OAuthProvidersResponseDataFromJSON,
@@ -26771,6 +27395,10 @@ var SDK_VERSION = "0.1.0";
26771
27395
  SetDomainInboundRequestFromJSONTyped,
26772
27396
  SetDomainInboundRequestToJSON,
26773
27397
  SetDomainInboundRequestToJSONTyped,
27398
+ SetEndUserClaimsRequestFromJSON,
27399
+ SetEndUserClaimsRequestFromJSONTyped,
27400
+ SetEndUserClaimsRequestToJSON,
27401
+ SetEndUserClaimsRequestToJSONTyped,
26774
27402
  SetPreferencesRequestFromJSON,
26775
27403
  SetPreferencesRequestFromJSONTyped,
26776
27404
  SetPreferencesRequestPreferencesInnerFromJSON,
@@ -26783,6 +27411,10 @@ var SDK_VERSION = "0.1.0";
26783
27411
  SignInAnonymouslyRequestFromJSONTyped,
26784
27412
  SignInAnonymouslyRequestToJSON,
26785
27413
  SignInAnonymouslyRequestToJSONTyped,
27414
+ SignInWithGameCenterRequestFromJSON,
27415
+ SignInWithGameCenterRequestFromJSONTyped,
27416
+ SignInWithGameCenterRequestToJSON,
27417
+ SignInWithGameCenterRequestToJSONTyped,
26786
27418
  SlackApi,
26787
27419
  SlackMessageFromJSON,
26788
27420
  SlackMessageFromJSONTyped,
@@ -27016,6 +27648,10 @@ var SDK_VERSION = "0.1.0";
27016
27648
  UpdateCategoryRequestFromJSONTyped,
27017
27649
  UpdateCategoryRequestToJSON,
27018
27650
  UpdateCategoryRequestToJSONTyped,
27651
+ UpdateEndUserByApplicationRequestFromJSON,
27652
+ UpdateEndUserByApplicationRequestFromJSONTyped,
27653
+ UpdateEndUserByApplicationRequestToJSON,
27654
+ UpdateEndUserByApplicationRequestToJSONTyped,
27019
27655
  UpdateEndUserRequestFromJSON,
27020
27656
  UpdateEndUserRequestFromJSONTyped,
27021
27657
  UpdateEndUserRequestToJSON,
@@ -27433,6 +28069,8 @@ var SDK_VERSION = "0.1.0";
27433
28069
  WorkflowStepExecutionToJSONTyped,
27434
28070
  Zyphr,
27435
28071
  ZyphrAuthenticationError,
28072
+ ZyphrClient,
28073
+ ZyphrClientCredentialError,
27436
28074
  ZyphrError,
27437
28075
  ZyphrNotFoundError,
27438
28076
  ZyphrPayloadTooLargeError,
@@ -27567,6 +28205,7 @@ var SDK_VERSION = "0.1.0";
27567
28205
  instanceOfInboxListMeta,
27568
28206
  instanceOfInboxListResponse,
27569
28207
  instanceOfInboxNotificationResponse,
28208
+ instanceOfInviteEndUserRequest,
27570
28209
  instanceOfListWaaSApplications200Response,
27571
28210
  instanceOfListWaaSEndpointDeliveries200Response,
27572
28211
  instanceOfListWaaSEndpoints200Response,
@@ -27611,6 +28250,7 @@ var SDK_VERSION = "0.1.0";
27611
28250
  instanceOfOAuthConnectionsResponseData,
27612
28251
  instanceOfOAuthProvider,
27613
28252
  instanceOfOAuthProviderInfo,
28253
+ instanceOfOAuthProviderName,
27614
28254
  instanceOfOAuthProvidersResponse,
27615
28255
  instanceOfOAuthProvidersResponseData,
27616
28256
  instanceOfOAuthTokensRefreshResponse,
@@ -27714,9 +28354,11 @@ var SDK_VERSION = "0.1.0";
27714
28354
  instanceOfSessionListResponseData,
27715
28355
  instanceOfSessionListResponseDataSessionInfo,
27716
28356
  instanceOfSetDomainInboundRequest,
28357
+ instanceOfSetEndUserClaimsRequest,
27717
28358
  instanceOfSetPreferencesRequest,
27718
28359
  instanceOfSetPreferencesRequestPreferencesInner,
27719
28360
  instanceOfSignInAnonymouslyRequest,
28361
+ instanceOfSignInWithGameCenterRequest,
27720
28362
  instanceOfSlackMessage,
27721
28363
  instanceOfSlackMessageListResponse,
27722
28364
  instanceOfSlackMessageListResponseMeta,
@@ -27772,6 +28414,7 @@ var SDK_VERSION = "0.1.0";
27772
28414
  instanceOfUnsubscribeRequest,
27773
28415
  instanceOfUnsubscribeResponse,
27774
28416
  instanceOfUpdateCategoryRequest,
28417
+ instanceOfUpdateEndUserByApplicationRequest,
27775
28418
  instanceOfUpdateEndUserRequest,
27776
28419
  instanceOfUpdateOrganizationMemberRoleRequest,
27777
28420
  instanceOfUpdateOrganizationRequest,