@axiom-lattice/client-sdk 8.0.2 → 8.2.0

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.mjs CHANGED
@@ -3459,6 +3459,48 @@ var AbstractClient = class {
3459
3459
  return response.data;
3460
3460
  }
3461
3461
  };
3462
+ this.personalMcpServers = {
3463
+ list: async () => {
3464
+ const response = await this.makeRequest("/api/personal-mcp-servers");
3465
+ return response.data.records;
3466
+ },
3467
+ get: async (keyOrId) => {
3468
+ const response = await this.makeRequest(`/api/personal-mcp-servers/${keyOrId}`);
3469
+ if (!response.data)
3470
+ throw new ApiError("Personal MCP server config not found", 404);
3471
+ return response.data;
3472
+ },
3473
+ create: async (data) => {
3474
+ const response = await this.makeRequest("/api/personal-mcp-servers", { method: "POST", body: data });
3475
+ if (!response.data)
3476
+ throw new ApiError("Failed to create personal MCP server config", 500);
3477
+ return response.data;
3478
+ },
3479
+ update: async (keyOrId, data) => {
3480
+ const response = await this.makeRequest(`/api/personal-mcp-servers/${keyOrId}`, { method: "PUT", body: data });
3481
+ if (!response.data)
3482
+ throw new ApiError("Failed to update personal MCP server config", 500);
3483
+ return response.data;
3484
+ },
3485
+ delete: async (keyOrId) => {
3486
+ await this.makeRequest(`/api/personal-mcp-servers/${keyOrId}`, { method: "DELETE" });
3487
+ },
3488
+ test: async (keyOrId) => {
3489
+ return await this.makeRequest(`/api/personal-mcp-servers/${keyOrId}/test`, { method: "POST" });
3490
+ },
3491
+ connect: async (keyOrId) => {
3492
+ const response = await this.makeRequest(`/api/personal-mcp-servers/${keyOrId}/connect`, { method: "POST" });
3493
+ if (!response.data)
3494
+ throw new ApiError("Failed to connect personal MCP server", 500);
3495
+ return response.data;
3496
+ },
3497
+ disconnect: async (keyOrId) => {
3498
+ const response = await this.makeRequest(`/api/personal-mcp-servers/${keyOrId}/disconnect`, { method: "POST" });
3499
+ if (!response.data)
3500
+ throw new ApiError("Failed to disconnect personal MCP server", 500);
3501
+ return response.data;
3502
+ }
3503
+ };
3462
3504
  this.connections = {
3463
3505
  list: async (type) => {
3464
3506
  const response = await this.makeRequest(`/api/connections?type=${encodeURIComponent(type)}`);
@@ -4643,6 +4685,1091 @@ var RoomEventsClient = class {
4643
4685
  }
4644
4686
  };
4645
4687
 
4688
+ // src/oidc-providers.ts
4689
+ var OidcProviderClientError = class extends Error {
4690
+ constructor(message, status, code, retryable = false, details) {
4691
+ super(message);
4692
+ this.status = status;
4693
+ this.code = code;
4694
+ this.retryable = retryable;
4695
+ this.details = details;
4696
+ this.name = "OidcProviderClientError";
4697
+ }
4698
+ };
4699
+ var isRecord4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
4700
+ function invalidResponse(message) {
4701
+ return new OidcProviderClientError(message, 500, "INVALID_RESPONSE", false);
4702
+ }
4703
+ function requiredString4(row, field) {
4704
+ if (typeof row[field] !== "string")
4705
+ throw invalidResponse(`Invalid ${field}`);
4706
+ return row[field];
4707
+ }
4708
+ function hydrateSummary(value) {
4709
+ if (!isRecord4(value))
4710
+ throw invalidResponse("Invalid OIDC provider summary");
4711
+ const source = value.source;
4712
+ if (source !== "env" && source !== "store") {
4713
+ throw invalidResponse("Invalid OIDC provider source");
4714
+ }
4715
+ return {
4716
+ id: requiredString4(value, "id"),
4717
+ displayName: requiredString4(value, "displayName"),
4718
+ issuer: requiredString4(value, "issuer"),
4719
+ clientId: requiredString4(value, "clientId"),
4720
+ hasClientSecret: value.hasClientSecret === true,
4721
+ scopes: requiredString4(value, "scopes"),
4722
+ enabled: value.enabled === true,
4723
+ jitProvisioning: value.jitProvisioning === true,
4724
+ autoLinkEmail: value.autoLinkEmail === true,
4725
+ ...typeof value.defaultTenantId === "string" ? { defaultTenantId: value.defaultTenantId } : {},
4726
+ ...Array.isArray(value.allowedPrivateHosts) ? {
4727
+ allowedPrivateHosts: value.allowedPrivateHosts.filter(
4728
+ (host) => typeof host === "string"
4729
+ )
4730
+ } : {},
4731
+ redirectUri: requiredString4(value, "redirectUri"),
4732
+ source,
4733
+ updatedAt: typeof value.updatedAt === "string" ? value.updatedAt : null
4734
+ };
4735
+ }
4736
+ function hydrateTestResult(value) {
4737
+ if (!isRecord4(value))
4738
+ throw invalidResponse("Invalid OIDC test result");
4739
+ const scopesSupported = Array.isArray(value.scopesSupported) ? value.scopesSupported.filter(
4740
+ (scope) => typeof scope === "string"
4741
+ ) : void 0;
4742
+ return {
4743
+ issuer: requiredString4(value, "issuer"),
4744
+ authorizationEndpoint: requiredString4(value, "authorizationEndpoint"),
4745
+ tokenEndpoint: requiredString4(value, "tokenEndpoint"),
4746
+ jwksUri: requiredString4(value, "jwksUri"),
4747
+ ...typeof value.userinfoEndpoint === "string" ? { userinfoEndpoint: value.userinfoEndpoint } : {},
4748
+ ...scopesSupported ? { scopesSupported } : {}
4749
+ };
4750
+ }
4751
+ function errorFromEnvelope(payload, response) {
4752
+ const raw = payload?.error;
4753
+ if (typeof raw === "string") {
4754
+ return new OidcProviderClientError(raw, response.status, raw, false);
4755
+ }
4756
+ if (isRecord4(raw)) {
4757
+ const code = typeof raw.code === "string" ? raw.code : response.ok ? "INVALID_RESPONSE" : "HTTP_ERROR";
4758
+ return new OidcProviderClientError(
4759
+ typeof raw.message === "string" ? raw.message : "OIDC provider request failed",
4760
+ response.status,
4761
+ code,
4762
+ raw.retryable === true,
4763
+ raw.details
4764
+ );
4765
+ }
4766
+ return new OidcProviderClientError(
4767
+ "OIDC provider request failed",
4768
+ response.status,
4769
+ response.ok ? "INVALID_RESPONSE" : "HTTP_ERROR",
4770
+ false
4771
+ );
4772
+ }
4773
+ var OidcProvidersClient = class {
4774
+ constructor(baseURL, getHeaders) {
4775
+ this.baseURL = baseURL;
4776
+ this.getHeaders = getHeaders;
4777
+ }
4778
+ async list() {
4779
+ const data = await this.request("/api/oidc-providers");
4780
+ if (!Array.isArray(data))
4781
+ throw invalidResponse("Invalid provider list");
4782
+ return data.map(hydrateSummary);
4783
+ }
4784
+ async create(input) {
4785
+ const data = await this.request("/api/oidc-providers", {
4786
+ method: "POST",
4787
+ body: JSON.stringify(input)
4788
+ });
4789
+ return hydrateSummary(data);
4790
+ }
4791
+ async update(id, input) {
4792
+ const data = await this.request(
4793
+ `/api/oidc-providers/${encodeURIComponent(id)}`,
4794
+ { method: "PATCH", body: JSON.stringify(input) }
4795
+ );
4796
+ return hydrateSummary(data);
4797
+ }
4798
+ async delete(id) {
4799
+ await this.request(
4800
+ `/api/oidc-providers/${encodeURIComponent(id)}`,
4801
+ { method: "DELETE" }
4802
+ );
4803
+ }
4804
+ async test(input) {
4805
+ const data = await this.request("/api/oidc-providers/test", {
4806
+ method: "POST",
4807
+ body: JSON.stringify(input)
4808
+ });
4809
+ return hydrateTestResult(data);
4810
+ }
4811
+ async testStored(id, overrides) {
4812
+ const data = await this.request(
4813
+ `/api/oidc-providers/${encodeURIComponent(id)}/test`,
4814
+ {
4815
+ method: "POST",
4816
+ ...overrides ? { body: JSON.stringify(overrides) } : {}
4817
+ }
4818
+ );
4819
+ return hydrateTestResult(data);
4820
+ }
4821
+ async request(path, init = {}) {
4822
+ const headers = { ...this.getHeaders() };
4823
+ if (init.body !== void 0) {
4824
+ headers["Content-Type"] = "application/json";
4825
+ }
4826
+ const response = await fetch(`${this.baseURL}${path}`, {
4827
+ ...init,
4828
+ headers
4829
+ });
4830
+ const payload = await response.json().catch(() => void 0);
4831
+ if (!response.ok || payload?.success !== true) {
4832
+ throw errorFromEnvelope(payload, response);
4833
+ }
4834
+ return payload.data;
4835
+ }
4836
+ };
4837
+
4838
+ // src/platform.ts
4839
+ var PlatformClientError = class extends Error {
4840
+ constructor(message, status, code, retryable = false, details) {
4841
+ super(message);
4842
+ this.status = status;
4843
+ this.code = code;
4844
+ this.retryable = retryable;
4845
+ this.details = details;
4846
+ this.name = "PlatformClientError";
4847
+ }
4848
+ };
4849
+ var PLATFORM_ROLES = ["owner", "admin", "auditor"];
4850
+ var TENANT_ROLES = ["owner", "admin", "member"];
4851
+ var isRecord5 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
4852
+ function invalidResponse2(message) {
4853
+ return new PlatformClientError(message, 500, "INVALID_RESPONSE", false);
4854
+ }
4855
+ function requiredString5(row, field) {
4856
+ if (typeof row[field] !== "string")
4857
+ throw invalidResponse2(`Invalid ${field}`);
4858
+ return row[field];
4859
+ }
4860
+ function optionalNullableString(row, field) {
4861
+ const value = row[field];
4862
+ if (value === null || value === void 0)
4863
+ return null;
4864
+ if (typeof value !== "string")
4865
+ throw invalidResponse2(`Invalid ${field}`);
4866
+ return value;
4867
+ }
4868
+ function hydrateSettingsSnapshot(value) {
4869
+ if (!isRecord5(value) || typeof value.version !== "number" || !isRecord5(value.effective) || !isRecord5(value.sources) || !isRecord5(value.fallbacks)) {
4870
+ throw invalidResponse2("Invalid platform settings");
4871
+ }
4872
+ return {
4873
+ version: value.version,
4874
+ effective: value.effective,
4875
+ sources: value.sources,
4876
+ fallbacks: value.fallbacks,
4877
+ ...typeof value.updatedBy === "string" ? { updatedBy: value.updatedBy } : {},
4878
+ ...typeof value.updatedAt === "string" ? { updatedAt: value.updatedAt } : {},
4879
+ ...typeof value.refreshedAt === "string" ? { refreshedAt: value.refreshedAt } : {}
4880
+ };
4881
+ }
4882
+ function hydrateEnvironment(value) {
4883
+ if (!isRecord5(value) || !isRecord5(value.runtime) || !isRecord5(value.publicEndpoints) || !isRecord5(value.dependencies) || !isRecord5(value.settings) || !isRecord5(value.diagnostics)) {
4884
+ throw invalidResponse2("Invalid platform environment");
4885
+ }
4886
+ return value;
4887
+ }
4888
+ var BRANDING_TEXT_KEYS = [
4889
+ "brandName",
4890
+ "logoUrl",
4891
+ "faviconUrl",
4892
+ "primaryColor",
4893
+ "backgroundColor",
4894
+ "loginTitle",
4895
+ "loginSubtitle"
4896
+ ];
4897
+ function hydrateBranding(value) {
4898
+ if (!isRecord5(value))
4899
+ throw invalidResponse2("Invalid branding");
4900
+ const branding = {};
4901
+ for (const key of BRANDING_TEXT_KEYS) {
4902
+ const field = value[key];
4903
+ if (field === void 0)
4904
+ continue;
4905
+ if (typeof field !== "string") {
4906
+ throw invalidResponse2(`Invalid branding.${key}`);
4907
+ }
4908
+ branding[key] = field;
4909
+ }
4910
+ return branding;
4911
+ }
4912
+ function hydrateBrandingDomain(value) {
4913
+ if (!isRecord5(value))
4914
+ throw invalidResponse2("Invalid branding domain");
4915
+ const domain = { host: requiredString5(value, "host") };
4916
+ if (value.status !== void 0) {
4917
+ if (value.status !== "active" && value.status !== "pending") {
4918
+ throw invalidResponse2("Invalid branding domain status");
4919
+ }
4920
+ domain.status = value.status;
4921
+ }
4922
+ const publicGatewayUrl = optionalString(value, "publicGatewayUrl");
4923
+ if (publicGatewayUrl !== void 0) {
4924
+ domain.publicGatewayUrl = publicGatewayUrl;
4925
+ }
4926
+ const publicConsoleUrl = optionalString(value, "publicConsoleUrl");
4927
+ if (publicConsoleUrl !== void 0) {
4928
+ domain.publicConsoleUrl = publicConsoleUrl;
4929
+ }
4930
+ if (value.branding !== void 0) {
4931
+ domain.branding = hydrateBranding(value.branding);
4932
+ }
4933
+ return domain;
4934
+ }
4935
+ function hydrateBrandingSettings(value) {
4936
+ if (!isRecord5(value))
4937
+ throw invalidResponse2("Invalid branding settings");
4938
+ const settings = {};
4939
+ if (value.default !== void 0) {
4940
+ settings.default = hydrateBranding(value.default);
4941
+ }
4942
+ if (value.domains !== void 0) {
4943
+ if (!Array.isArray(value.domains)) {
4944
+ throw invalidResponse2("Invalid branding domains");
4945
+ }
4946
+ settings.domains = value.domains.map(hydrateBrandingDomain);
4947
+ }
4948
+ return settings;
4949
+ }
4950
+ function hydrateBrandingSettingsView(value) {
4951
+ if (!isRecord5(value) || typeof value.version !== "number") {
4952
+ throw invalidResponse2("Invalid platform branding settings");
4953
+ }
4954
+ return {
4955
+ version: value.version,
4956
+ branding: hydrateBrandingSettings(value.branding),
4957
+ ...typeof value.updatedBy === "string" ? { updatedBy: value.updatedBy } : {},
4958
+ ...typeof value.updatedAt === "string" ? { updatedAt: value.updatedAt } : {}
4959
+ };
4960
+ }
4961
+ function hydrateResolvedBranding(value) {
4962
+ if (!isRecord5(value) || value.source !== "domain" && value.source !== "default") {
4963
+ throw invalidResponse2("Invalid resolved branding");
4964
+ }
4965
+ return {
4966
+ branding: hydrateBranding(value.branding),
4967
+ source: value.source,
4968
+ ...typeof value.host === "string" ? { host: value.host } : {},
4969
+ ...typeof value.publicGatewayUrl === "string" ? { publicGatewayUrl: value.publicGatewayUrl } : {},
4970
+ ...typeof value.publicConsoleUrl === "string" ? { publicConsoleUrl: value.publicConsoleUrl } : {}
4971
+ };
4972
+ }
4973
+ function hydratePlatformRole(value) {
4974
+ if (typeof value === "string" && PLATFORM_ROLES.includes(value)) {
4975
+ return value;
4976
+ }
4977
+ throw invalidResponse2("Invalid platform role");
4978
+ }
4979
+ function hydrateTenantRole(value) {
4980
+ if (typeof value === "string" && TENANT_ROLES.includes(value)) {
4981
+ return value;
4982
+ }
4983
+ throw invalidResponse2("Invalid tenant role");
4984
+ }
4985
+ function hydrateStatus(value) {
4986
+ if (value === null || value === void 0)
4987
+ return null;
4988
+ if (value === "active" || value === "pending" || value === "suspended") {
4989
+ return value;
4990
+ }
4991
+ throw invalidResponse2("Invalid user status");
4992
+ }
4993
+ function optionalString(row, field) {
4994
+ const value = row[field];
4995
+ if (value === null || value === void 0)
4996
+ return void 0;
4997
+ if (typeof value !== "string")
4998
+ throw invalidResponse2(`Invalid ${field}`);
4999
+ return value;
5000
+ }
5001
+ function hydrateInvitation(value) {
5002
+ if (!isRecord5(value))
5003
+ throw invalidResponse2("Invalid invitation");
5004
+ const invitedBy = optionalString(value, "invitedBy");
5005
+ const expiresAt = optionalString(value, "expiresAt");
5006
+ const consumedAt = optionalString(value, "consumedAt");
5007
+ return {
5008
+ email: requiredString5(value, "email"),
5009
+ role: hydratePlatformRole(value.role),
5010
+ createdAt: requiredString5(value, "createdAt"),
5011
+ ...invitedBy ? { invitedBy } : {},
5012
+ ...expiresAt ? { expiresAt } : {},
5013
+ ...consumedAt ? { consumedAt } : {}
5014
+ };
5015
+ }
5016
+ function hydrateMember3(value) {
5017
+ if (!isRecord5(value))
5018
+ throw invalidResponse2("Invalid platform member");
5019
+ return {
5020
+ id: requiredString5(value, "id"),
5021
+ email: optionalNullableString(value, "email"),
5022
+ name: optionalNullableString(value, "name"),
5023
+ status: hydrateStatus(value.status),
5024
+ role: hydratePlatformRole(value.role),
5025
+ grantedAt: requiredString5(value, "grantedAt"),
5026
+ ...typeof value.grantedBy === "string" ? { grantedBy: value.grantedBy } : {}
5027
+ };
5028
+ }
5029
+ function hydrateTenantMember(value) {
5030
+ if (!isRecord5(value))
5031
+ throw invalidResponse2("Invalid tenant member");
5032
+ return {
5033
+ userId: requiredString5(value, "userId"),
5034
+ tenantId: requiredString5(value, "tenantId"),
5035
+ role: hydrateTenantRole(value.role),
5036
+ joinedAt: requiredString5(value, "joinedAt"),
5037
+ email: optionalNullableString(value, "email"),
5038
+ name: optionalNullableString(value, "name"),
5039
+ status: hydrateStatus(value.status)
5040
+ };
5041
+ }
5042
+ function hydrateOidcIdentityClaimStatus(value) {
5043
+ if (value === "pending" || value === "approved" || value === "rejected" || value === "expired") {
5044
+ return value;
5045
+ }
5046
+ throw invalidResponse2("Invalid SSO claim status");
5047
+ }
5048
+ function hydrateOidcIdentityClaim(value) {
5049
+ if (!isRecord5(value))
5050
+ throw invalidResponse2("Invalid SSO claim");
5051
+ const name = optionalString(value, "name");
5052
+ const picture = optionalString(value, "picture");
5053
+ const reviewedBy = optionalString(value, "reviewedBy");
5054
+ const reviewedAt = optionalString(value, "reviewedAt");
5055
+ const linkedUserId = optionalString(value, "linkedUserId");
5056
+ const inviteLinkId = optionalString(value, "inviteLinkId");
5057
+ const requestedUserId = optionalString(value, "requestedUserId");
5058
+ const requestedPlatformRole = value.requestedPlatformRole !== void 0 ? hydratePlatformRole(value.requestedPlatformRole) : void 0;
5059
+ const requestedTenantId = optionalString(value, "requestedTenantId");
5060
+ const requestedTenantRole = value.requestedTenantRole !== void 0 ? hydrateTenantRole(value.requestedTenantRole) : void 0;
5061
+ const source = value.source === "email_completion" || value.source === "invite_link" ? value.source : void 0;
5062
+ const existing = value.existingUser;
5063
+ let existingUser;
5064
+ if (existing !== void 0 && existing !== null) {
5065
+ if (!isRecord5(existing))
5066
+ throw invalidResponse2("Invalid existing user");
5067
+ const platformRole = existing.role !== void 0 ? hydratePlatformRole(existing.role) : existing.platformRole !== void 0 ? hydratePlatformRole(existing.platformRole) : void 0;
5068
+ existingUser = {
5069
+ id: requiredString5(existing, "id"),
5070
+ email: requiredString5(existing, "email"),
5071
+ name: requiredString5(existing, "name"),
5072
+ status: hydrateStatus(existing.status) ?? "pending",
5073
+ ...platformRole ? { platformRole } : {}
5074
+ };
5075
+ }
5076
+ return {
5077
+ id: requiredString5(value, "id"),
5078
+ providerId: requiredString5(value, "providerId"),
5079
+ issuer: requiredString5(value, "issuer"),
5080
+ email: requiredString5(value, "email"),
5081
+ ...name ? { name } : {},
5082
+ ...picture ? { picture } : {},
5083
+ status: hydrateOidcIdentityClaimStatus(value.status),
5084
+ createdAt: requiredString5(value, "createdAt"),
5085
+ updatedAt: requiredString5(value, "updatedAt"),
5086
+ expiresAt: requiredString5(value, "expiresAt"),
5087
+ ...reviewedBy ? { reviewedBy } : {},
5088
+ ...reviewedAt ? { reviewedAt } : {},
5089
+ ...linkedUserId ? { linkedUserId } : {},
5090
+ ...source ? { source } : {},
5091
+ ...inviteLinkId ? { inviteLinkId } : {},
5092
+ ...requestedUserId ? { requestedUserId } : {},
5093
+ ...requestedPlatformRole ? { requestedPlatformRole } : {},
5094
+ ...requestedTenantId ? { requestedTenantId } : {},
5095
+ ...requestedTenantRole ? { requestedTenantRole } : {},
5096
+ expired: value.expired === true,
5097
+ ...existingUser ? { existingUser } : {}
5098
+ };
5099
+ }
5100
+ function hydrateTenantStatus(value) {
5101
+ if (value === "active" || value === "inactive" || value === "suspended") {
5102
+ return value;
5103
+ }
5104
+ throw invalidResponse2("Invalid tenant status");
5105
+ }
5106
+ function optionalRecord(row, field) {
5107
+ const value = row[field];
5108
+ if (value === void 0 || value === null)
5109
+ return void 0;
5110
+ if (!isRecord5(value))
5111
+ throw invalidResponse2(`Invalid ${field}`);
5112
+ return value;
5113
+ }
5114
+ function hydrateInviteLink(value) {
5115
+ if (!isRecord5(value))
5116
+ throw invalidResponse2("Invalid invite link");
5117
+ const scope = value.scope;
5118
+ if (scope !== "platform" && scope !== "tenant") {
5119
+ throw invalidResponse2("Invalid invite scope");
5120
+ }
5121
+ const platformRole = value.platformRole !== void 0 ? hydratePlatformRole(value.platformRole) : void 0;
5122
+ const tenantRole = value.tenantRole !== void 0 ? hydrateTenantRole(value.tenantRole) : void 0;
5123
+ return {
5124
+ id: requiredString5(value, "id"),
5125
+ scope,
5126
+ ...optionalString(value, "email") ? { email: optionalString(value, "email") } : {},
5127
+ ...platformRole ? { platformRole } : {},
5128
+ ...optionalString(value, "tenantId") ? { tenantId: optionalString(value, "tenantId") } : {},
5129
+ ...tenantRole ? { tenantRole } : {},
5130
+ ...optionalString(value, "createdBy") ? { createdBy: optionalString(value, "createdBy") } : {},
5131
+ createdAt: requiredString5(value, "createdAt"),
5132
+ updatedAt: requiredString5(value, "updatedAt"),
5133
+ expiresAt: requiredString5(value, "expiresAt"),
5134
+ maxUses: Number(value.maxUses),
5135
+ usedCount: Number(value.usedCount),
5136
+ ...optionalString(value, "revokedAt") ? { revokedAt: optionalString(value, "revokedAt") } : {},
5137
+ active: value.active === true,
5138
+ url: requiredString5(value, "url")
5139
+ };
5140
+ }
5141
+ function hydrateTenant(value) {
5142
+ if (!isRecord5(value))
5143
+ throw invalidResponse2("Invalid tenant");
5144
+ const metadata = optionalRecord(value, "metadata");
5145
+ return {
5146
+ id: requiredString5(value, "id"),
5147
+ name: requiredString5(value, "name"),
5148
+ description: optionalNullableString(value, "description"),
5149
+ status: hydrateTenantStatus(value.status),
5150
+ ...metadata ? { metadata } : {},
5151
+ createdAt: requiredString5(value, "createdAt"),
5152
+ updatedAt: requiredString5(value, "updatedAt")
5153
+ };
5154
+ }
5155
+ function hydrateUser(value) {
5156
+ if (!isRecord5(value))
5157
+ throw invalidResponse2("Invalid user");
5158
+ const status = value.status;
5159
+ if (status !== "active" && status !== "pending" && status !== "suspended") {
5160
+ throw invalidResponse2("Invalid user status");
5161
+ }
5162
+ const metadata = optionalRecord(value, "metadata");
5163
+ return {
5164
+ id: requiredString5(value, "id"),
5165
+ email: requiredString5(value, "email"),
5166
+ name: requiredString5(value, "name"),
5167
+ status,
5168
+ ...metadata ? { metadata } : {},
5169
+ ...typeof value.createdAt === "string" ? { createdAt: value.createdAt } : {},
5170
+ ...typeof value.updatedAt === "string" ? { updatedAt: value.updatedAt } : {}
5171
+ };
5172
+ }
5173
+ function hydrateAuditInitiator(value) {
5174
+ if (!isRecord5(value) || typeof value.type !== "string") {
5175
+ throw invalidResponse2("Invalid platform audit initiator");
5176
+ }
5177
+ if (value.type === "human") {
5178
+ if (typeof value.userId !== "string" || value.role !== "owner" && value.role !== "admin" && value.role !== "auditor") {
5179
+ throw invalidResponse2("Invalid platform audit human initiator");
5180
+ }
5181
+ return { type: "human", userId: value.userId, role: value.role };
5182
+ }
5183
+ if (value.type === "bootstrap") {
5184
+ return { type: "bootstrap" };
5185
+ }
5186
+ if (value.type === "system") {
5187
+ if (typeof value.component !== "string") {
5188
+ throw invalidResponse2("Invalid platform audit system initiator");
5189
+ }
5190
+ return { type: "system", component: value.component };
5191
+ }
5192
+ throw invalidResponse2("Invalid platform audit initiator");
5193
+ }
5194
+ function hydrateAuditExecutor(value) {
5195
+ if (!isRecord5(value) || typeof value.type !== "string") {
5196
+ throw invalidResponse2("Invalid platform audit executor");
5197
+ }
5198
+ if (value.type === "admin_center") {
5199
+ if (typeof value.route !== "string") {
5200
+ throw invalidResponse2("Invalid platform audit admin center executor");
5201
+ }
5202
+ return { type: "admin_center", route: value.route };
5203
+ }
5204
+ if (value.type === "ops_agent") {
5205
+ if (value.agentId !== "platform-ops" || typeof value.threadId !== "string" || typeof value.runId !== "string" || typeof value.toolName !== "string") {
5206
+ throw invalidResponse2("Invalid platform audit ops agent executor");
5207
+ }
5208
+ return {
5209
+ type: "ops_agent",
5210
+ agentId: "platform-ops",
5211
+ threadId: value.threadId,
5212
+ runId: value.runId,
5213
+ toolName: value.toolName
5214
+ };
5215
+ }
5216
+ if (value.type === "bootstrap") {
5217
+ return { type: "bootstrap" };
5218
+ }
5219
+ if (value.type === "system") {
5220
+ if (typeof value.component !== "string") {
5221
+ throw invalidResponse2("Invalid platform audit system executor");
5222
+ }
5223
+ return { type: "system", component: value.component };
5224
+ }
5225
+ throw invalidResponse2("Invalid platform audit executor");
5226
+ }
5227
+ function hydrateAuditSource(value) {
5228
+ if (value === "admin_center" || value === "ops_agent" || value === "bootstrap" || value === "system") {
5229
+ return value;
5230
+ }
5231
+ throw invalidResponse2("Invalid platform audit source");
5232
+ }
5233
+ function hydrateAuditAction(value) {
5234
+ if (value === "write" || value === "playbook")
5235
+ return value;
5236
+ throw invalidResponse2("Invalid platform audit action");
5237
+ }
5238
+ function hydrateAuditStatus(value) {
5239
+ if (value === "ok" || value === "error" || value === "cancelled") {
5240
+ return value;
5241
+ }
5242
+ throw invalidResponse2("Invalid platform audit status");
5243
+ }
5244
+ function hydratePlatformAudit(value) {
5245
+ if (!isRecord5(value) || typeof value.id !== "string") {
5246
+ throw invalidResponse2("Invalid platform audit record");
5247
+ }
5248
+ const initiator = hydrateAuditInitiator(value.initiator);
5249
+ const executor = hydrateAuditExecutor(value.executor);
5250
+ const source = hydrateAuditSource(value.source);
5251
+ const action = hydrateAuditAction(value.action);
5252
+ const status = hydrateAuditStatus(value.status);
5253
+ const createdAt = new Date(requiredString5(value, "createdAt"));
5254
+ if (Number.isNaN(createdAt.getTime())) {
5255
+ throw invalidResponse2("Invalid platform audit timestamp");
5256
+ }
5257
+ if (!isRecord5(value.summary)) {
5258
+ throw invalidResponse2("Invalid platform audit summary");
5259
+ }
5260
+ if (typeof value.durationMs !== "number" || !Number.isFinite(value.durationMs)) {
5261
+ throw invalidResponse2("Invalid platform audit duration");
5262
+ }
5263
+ const tenantId = optionalString(value, "tenantId");
5264
+ const before = optionalRecord(value, "before");
5265
+ const after = optionalRecord(value, "after");
5266
+ const errorCode = optionalString(value, "errorCode");
5267
+ return {
5268
+ id: value.id,
5269
+ initiator,
5270
+ source,
5271
+ executor,
5272
+ ...tenantId !== void 0 ? { tenantId } : {},
5273
+ action,
5274
+ status,
5275
+ summary: value.summary,
5276
+ ...before !== void 0 ? { before } : {},
5277
+ ...after !== void 0 ? { after } : {},
5278
+ ...errorCode !== void 0 ? { errorCode } : {},
5279
+ durationMs: value.durationMs,
5280
+ createdAt
5281
+ };
5282
+ }
5283
+ function requireRecordValue(value, message) {
5284
+ if (!isRecord5(value))
5285
+ throw invalidResponse2(message);
5286
+ return value;
5287
+ }
5288
+ function hydrateModelCatalog(value) {
5289
+ if (!isRecord5(value) || !Array.isArray(value.providers) || !Array.isArray(value.models)) {
5290
+ throw invalidResponse2("Invalid platform model catalog");
5291
+ }
5292
+ return value;
5293
+ }
5294
+ function hydrateOpsConfig(value) {
5295
+ if (!isRecord5(value) || typeof value.enabled !== "boolean" || typeof value.modelConfigured !== "boolean") {
5296
+ throw invalidResponse2("Invalid platform ops config");
5297
+ }
5298
+ return {
5299
+ enabled: value.enabled,
5300
+ modelKey: requiredString5(value, "modelKey"),
5301
+ modelConfigured: value.modelConfigured
5302
+ };
5303
+ }
5304
+ function errorFromEnvelope2(payload, response) {
5305
+ const raw = payload?.error;
5306
+ if (typeof raw === "string") {
5307
+ return new PlatformClientError(raw, response.status, raw, false);
5308
+ }
5309
+ if (isRecord5(raw)) {
5310
+ const code = typeof raw.code === "string" ? raw.code : response.ok ? "INVALID_RESPONSE" : "HTTP_ERROR";
5311
+ return new PlatformClientError(
5312
+ typeof raw.message === "string" ? raw.message : "Platform request failed",
5313
+ response.status,
5314
+ code,
5315
+ raw.retryable === true,
5316
+ raw.details
5317
+ );
5318
+ }
5319
+ return new PlatformClientError(
5320
+ "Platform request failed",
5321
+ response.status,
5322
+ response.ok ? "INVALID_RESPONSE" : "HTTP_ERROR",
5323
+ false
5324
+ );
5325
+ }
5326
+ var PlatformClient = class {
5327
+ constructor(baseURL, getHeaders) {
5328
+ this.baseURL = baseURL;
5329
+ this.getHeaders = getHeaders;
5330
+ const providerPath = (providerId) => `/api/platform/model-providers/${encodeURIComponent(providerId)}`;
5331
+ this.ops = {
5332
+ getConfig: async () => {
5333
+ const data = await this.request("/api/platform/ops/config");
5334
+ return hydrateOpsConfig(data);
5335
+ }
5336
+ };
5337
+ this.modelProviders = {
5338
+ list: async () => {
5339
+ const data = await this.request("/api/platform/model-providers");
5340
+ if (!isRecord5(data) || !Array.isArray(data.records)) {
5341
+ throw invalidResponse2("Invalid platform model provider list");
5342
+ }
5343
+ return data.records;
5344
+ },
5345
+ get: async (providerId) => {
5346
+ const data = await this.request(providerPath(providerId));
5347
+ return requireRecordValue(
5348
+ data,
5349
+ "Invalid platform model provider"
5350
+ );
5351
+ },
5352
+ create: async (input) => {
5353
+ const data = await this.request("/api/platform/model-providers", {
5354
+ method: "POST",
5355
+ body: JSON.stringify(input)
5356
+ });
5357
+ return requireRecordValue(
5358
+ data,
5359
+ "Invalid platform model provider"
5360
+ );
5361
+ },
5362
+ update: async (providerId, input) => {
5363
+ const data = await this.request(providerPath(providerId), {
5364
+ method: "PUT",
5365
+ body: JSON.stringify(input)
5366
+ });
5367
+ return requireRecordValue(
5368
+ data,
5369
+ "Invalid platform model provider"
5370
+ );
5371
+ },
5372
+ delete: async (providerId) => {
5373
+ await this.request(providerPath(providerId), { method: "DELETE" });
5374
+ },
5375
+ probe: async (input) => {
5376
+ const data = await this.request(
5377
+ "/api/platform/model-providers/probe",
5378
+ { method: "POST", body: JSON.stringify(input) }
5379
+ );
5380
+ return requireRecordValue(
5381
+ data,
5382
+ "Invalid platform model provider probe"
5383
+ );
5384
+ },
5385
+ setModels: async (providerId, models) => {
5386
+ const data = await this.request(
5387
+ `${providerPath(providerId)}/models`,
5388
+ { method: "PUT", body: JSON.stringify({ models }) }
5389
+ );
5390
+ return requireRecordValue(
5391
+ data,
5392
+ "Invalid platform model provider"
5393
+ );
5394
+ },
5395
+ discover: async (providerId) => {
5396
+ const data = await this.request(
5397
+ `${providerPath(providerId)}/discover`,
5398
+ { method: "POST", body: JSON.stringify({}) }
5399
+ );
5400
+ return requireRecordValue(
5401
+ data,
5402
+ "Invalid platform model discovery result"
5403
+ );
5404
+ },
5405
+ setModelEnabled: async (providerId, modelId, enabled) => {
5406
+ const data = await this.request(
5407
+ `${providerPath(providerId)}/models/enabled`,
5408
+ { method: "POST", body: JSON.stringify({ modelId, enabled }) }
5409
+ );
5410
+ return requireRecordValue(
5411
+ data,
5412
+ "Invalid platform model provider"
5413
+ );
5414
+ }
5415
+ };
5416
+ }
5417
+ /**
5418
+ * Reads the platform-owned model catalog (providers plus visible models).
5419
+ *
5420
+ * This is the platform-scoped counterpart of `client.tenantModels.list()`.
5421
+ */
5422
+ async modelCatalog() {
5423
+ const data = await this.request("/api/platform/model-catalog");
5424
+ return hydrateModelCatalog(data);
5425
+ }
5426
+ async rateLimits() {
5427
+ const data = await this.request("/api/platform/rate-limits");
5428
+ if (!isRecord5(data) || !Array.isArray(data.policies)) {
5429
+ throw invalidResponse2("Invalid platform rate-limit view");
5430
+ }
5431
+ return data;
5432
+ }
5433
+ async me() {
5434
+ const data = await this.request("/api/platform/me");
5435
+ if (!isRecord5(data))
5436
+ throw invalidResponse2("Invalid platform identity");
5437
+ if (data.role === null || data.role === void 0)
5438
+ return null;
5439
+ return hydratePlatformRole(data.role);
5440
+ }
5441
+ /**
5442
+ * Reads the platform-guarded gateway identity and capability surface.
5443
+ *
5444
+ * @returns The same `GatewayInfo` payload as the legacy public `/info`.
5445
+ */
5446
+ async getInfo() {
5447
+ return this.request("/api/platform/system/info");
5448
+ }
5449
+ /**
5450
+ * Reads the platform-guarded JSON runtime metrics for this replica.
5451
+ *
5452
+ * @returns The same `SystemMetrics` payload as legacy `/metrics?format=json`.
5453
+ */
5454
+ async getSystemMetrics() {
5455
+ return this.request("/api/platform/system/metrics");
5456
+ }
5457
+ /**
5458
+ * Reads the effective platform settings, provenance, and version.
5459
+ *
5460
+ * @returns The current snapshot with ISO-string `updatedAt`.
5461
+ */
5462
+ async getSettings() {
5463
+ const data = await this.request("/api/platform/settings");
5464
+ return hydrateSettingsSnapshot(data);
5465
+ }
5466
+ /**
5467
+ * Applies a partial settings patch and/or resets existing overrides.
5468
+ *
5469
+ * @param input Version guard plus the patch and reset paths.
5470
+ * @returns The committed snapshot after the update.
5471
+ */
5472
+ async updateSettings(input) {
5473
+ const data = await this.request("/api/platform/settings", {
5474
+ method: "PATCH",
5475
+ body: JSON.stringify(input)
5476
+ });
5477
+ return hydrateSettingsSnapshot(data);
5478
+ }
5479
+ /**
5480
+ * Reads the safe runtime environment projection.
5481
+ *
5482
+ * @returns Runtime identity, public endpoints, dependency presence, and
5483
+ * diagnostics. Secret values are never included.
5484
+ */
5485
+ async getEnvironment() {
5486
+ const data = await this.request("/api/platform/environment");
5487
+ return hydrateEnvironment(data);
5488
+ }
5489
+ /**
5490
+ * Reads platform audit records, newest first.
5491
+ *
5492
+ * @param query Optional filters and pagination. Undefined values are omitted
5493
+ * from the request.
5494
+ * @returns Hydrated records with `createdAt` as a `Date`.
5495
+ */
5496
+ async listAudit(query = {}) {
5497
+ const search = new URLSearchParams();
5498
+ for (const [key, value] of Object.entries(query)) {
5499
+ if (value !== void 0)
5500
+ search.set(key, String(value));
5501
+ }
5502
+ const suffix = search.toString();
5503
+ const data = await this.request(
5504
+ `/api/platform/audit${suffix ? `?${suffix}` : ""}`
5505
+ );
5506
+ if (!Array.isArray(data)) {
5507
+ throw invalidResponse2("Invalid platform audit list");
5508
+ }
5509
+ return data.map(hydratePlatformAudit);
5510
+ }
5511
+ /**
5512
+ * Reads a single platform audit record by id.
5513
+ *
5514
+ * @param auditId Audit record id.
5515
+ * @returns The hydrated record with `createdAt` as a `Date`.
5516
+ */
5517
+ async getAudit(auditId) {
5518
+ const data = await this.request(
5519
+ `/api/platform/audit/${encodeURIComponent(auditId)}`
5520
+ );
5521
+ return hydratePlatformAudit(data);
5522
+ }
5523
+ /**
5524
+ * Resolves the public branding for the current gateway host.
5525
+ *
5526
+ * The public `/api/branding` route does not require a session, but this
5527
+ * method reuses the normal request helper and headers.
5528
+ */
5529
+ async getBranding() {
5530
+ const data = await this.request("/api/branding");
5531
+ return hydrateResolvedBranding(data);
5532
+ }
5533
+ /** Reads the platform default and host-scoped branding settings. */
5534
+ async getBrandingSettings() {
5535
+ const data = await this.request("/api/platform/branding");
5536
+ return hydrateBrandingSettingsView(data);
5537
+ }
5538
+ /**
5539
+ * Replaces the full branding configuration with versioning.
5540
+ *
5541
+ * @param input Version guard plus the complete branding settings document.
5542
+ * @returns The committed branding settings after the update.
5543
+ */
5544
+ async updateBrandingSettings(input) {
5545
+ const data = await this.request("/api/platform/branding", {
5546
+ method: "PATCH",
5547
+ body: JSON.stringify(input)
5548
+ });
5549
+ return hydrateBrandingSettingsView(data);
5550
+ }
5551
+ async listTenants() {
5552
+ const data = await this.request("/api/tenants");
5553
+ if (!Array.isArray(data))
5554
+ throw invalidResponse2("Invalid tenant list");
5555
+ return data.map(hydrateTenant);
5556
+ }
5557
+ async createTenant(input) {
5558
+ const data = await this.request("/api/tenants", {
5559
+ method: "POST",
5560
+ body: JSON.stringify(input)
5561
+ });
5562
+ return hydrateTenant(data);
5563
+ }
5564
+ async updateTenant(tenantId, input) {
5565
+ const data = await this.request(
5566
+ `/api/tenants/${encodeURIComponent(tenantId)}`,
5567
+ { method: "PATCH", body: JSON.stringify(input) }
5568
+ );
5569
+ return hydrateTenant(data);
5570
+ }
5571
+ async deleteTenant(tenantId) {
5572
+ await this.request(
5573
+ `/api/tenants/${encodeURIComponent(tenantId)}`,
5574
+ { method: "DELETE" }
5575
+ );
5576
+ }
5577
+ async listUsers() {
5578
+ const data = await this.request("/api/users");
5579
+ if (!Array.isArray(data))
5580
+ throw invalidResponse2("Invalid user list");
5581
+ return data.map(hydrateUser);
5582
+ }
5583
+ async createUser(input) {
5584
+ const data = await this.request("/api/platform/users", {
5585
+ method: "POST",
5586
+ body: JSON.stringify(input)
5587
+ });
5588
+ return hydrateUser(data);
5589
+ }
5590
+ async updateUser(userId, input) {
5591
+ const data = await this.request(
5592
+ `/api/users/${encodeURIComponent(userId)}`,
5593
+ { method: "PATCH", body: JSON.stringify(input) }
5594
+ );
5595
+ return hydrateUser(data);
5596
+ }
5597
+ async deleteUser(userId) {
5598
+ await this.request(`/api/users/${encodeURIComponent(userId)}`, {
5599
+ method: "DELETE"
5600
+ });
5601
+ }
5602
+ async listMembers() {
5603
+ const data = await this.request("/api/platform/members");
5604
+ if (!Array.isArray(data))
5605
+ throw invalidResponse2("Invalid member list");
5606
+ return data.map(hydrateMember3);
5607
+ }
5608
+ async grantMember(input) {
5609
+ const data = await this.request("/api/platform/members", {
5610
+ method: "POST",
5611
+ body: JSON.stringify(input)
5612
+ });
5613
+ if (!isRecord5(data))
5614
+ throw invalidResponse2("Invalid platform grant");
5615
+ const member = data.member !== void 0 ? hydrateMember3(data.member) : void 0;
5616
+ const invitation = data.invitation !== void 0 ? hydrateInvitation(data.invitation) : void 0;
5617
+ if (!member && !invitation) {
5618
+ throw invalidResponse2("Invalid platform grant");
5619
+ }
5620
+ return {
5621
+ ...member ? { member } : {},
5622
+ ...invitation ? { invitation } : {}
5623
+ };
5624
+ }
5625
+ async listInvitations() {
5626
+ const data = await this.request("/api/platform/invitations");
5627
+ if (!Array.isArray(data))
5628
+ throw invalidResponse2("Invalid invitation list");
5629
+ return data.map(hydrateInvitation);
5630
+ }
5631
+ async revokeInvitation(email) {
5632
+ await this.request(
5633
+ `/api/platform/invitations/${encodeURIComponent(email)}`,
5634
+ { method: "DELETE" }
5635
+ );
5636
+ }
5637
+ async updateMember(userId, role) {
5638
+ const data = await this.request(
5639
+ `/api/platform/members/${encodeURIComponent(userId)}`,
5640
+ { method: "PATCH", body: JSON.stringify({ role }) }
5641
+ );
5642
+ return hydrateMember3(data);
5643
+ }
5644
+ async revokeMember(userId) {
5645
+ await this.request(
5646
+ `/api/platform/members/${encodeURIComponent(userId)}`,
5647
+ { method: "DELETE" }
5648
+ );
5649
+ }
5650
+ async listTenantMembers(tenantId) {
5651
+ const query = new URLSearchParams({ tenantId }).toString();
5652
+ const data = await this.request(
5653
+ `/api/platform/tenant-members?${query}`
5654
+ );
5655
+ if (!Array.isArray(data))
5656
+ throw invalidResponse2("Invalid tenant member list");
5657
+ return data.map(hydrateTenantMember);
5658
+ }
5659
+ async addTenantMember(input) {
5660
+ const data = await this.request("/api/platform/tenant-members", {
5661
+ method: "POST",
5662
+ body: JSON.stringify(input)
5663
+ });
5664
+ return hydrateTenantMember(data);
5665
+ }
5666
+ async listInviteLinks() {
5667
+ const data = await this.request("/api/platform/invite-links");
5668
+ if (!Array.isArray(data))
5669
+ throw invalidResponse2("Invalid invite link list");
5670
+ return data.map(hydrateInviteLink);
5671
+ }
5672
+ async createInviteLink(input) {
5673
+ const data = await this.request("/api/platform/invite-links", {
5674
+ method: "POST",
5675
+ body: JSON.stringify(input)
5676
+ });
5677
+ return hydrateInviteLink(data);
5678
+ }
5679
+ async revokeInviteLink(id) {
5680
+ const data = await this.request(
5681
+ `/api/platform/invite-links/${encodeURIComponent(id)}`,
5682
+ { method: "DELETE" }
5683
+ );
5684
+ return hydrateInviteLink(data);
5685
+ }
5686
+ async getInviteLink(token) {
5687
+ const data = await this.request(
5688
+ `/api/invites/${encodeURIComponent(token)}`
5689
+ );
5690
+ return hydrateInviteLink(data);
5691
+ }
5692
+ async claimInviteLink(token) {
5693
+ const data = await this.request(
5694
+ `/api/invites/${encodeURIComponent(token)}/claim`,
5695
+ { method: "POST", body: JSON.stringify({}) }
5696
+ );
5697
+ if (!isRecord5(data) || data.status !== "joined" && data.status !== "pending_approval") {
5698
+ throw invalidResponse2("Invalid invite claim result");
5699
+ }
5700
+ const scope = data.scope;
5701
+ if (scope !== "platform" && scope !== "tenant") {
5702
+ throw invalidResponse2("Invalid invite claim scope");
5703
+ }
5704
+ return {
5705
+ status: data.status,
5706
+ scope,
5707
+ ...optionalString(data, "tenantId") ? { tenantId: optionalString(data, "tenantId") } : {},
5708
+ ...data.tenantRole !== void 0 ? { tenantRole: hydrateTenantRole(data.tenantRole) } : {},
5709
+ ...data.platformRole !== void 0 ? { platformRole: hydratePlatformRole(data.platformRole) } : {}
5710
+ };
5711
+ }
5712
+ async updateTenantMemberRole(tenantId, userId, role) {
5713
+ const data = await this.request(
5714
+ `/api/platform/tenant-members/${encodeURIComponent(tenantId)}/${encodeURIComponent(userId)}`,
5715
+ { method: "PATCH", body: JSON.stringify({ role }) }
5716
+ );
5717
+ return hydrateTenantMember(data);
5718
+ }
5719
+ async removeTenantMember(tenantId, userId) {
5720
+ await this.request(
5721
+ `/api/platform/tenant-members/${encodeURIComponent(tenantId)}/${encodeURIComponent(userId)}`,
5722
+ { method: "DELETE" }
5723
+ );
5724
+ }
5725
+ async listOidcClaims(status = "pending") {
5726
+ const query = new URLSearchParams({ status }).toString();
5727
+ const data = await this.request(`/api/platform/oidc-claims?${query}`);
5728
+ if (!Array.isArray(data))
5729
+ throw invalidResponse2("Invalid SSO claim list");
5730
+ return data.map(hydrateOidcIdentityClaim);
5731
+ }
5732
+ async updateOidcClaimEmail(id, email) {
5733
+ const data = await this.request(
5734
+ `/api/platform/oidc-claims/${encodeURIComponent(id)}`,
5735
+ { method: "PATCH", body: JSON.stringify({ email }) }
5736
+ );
5737
+ return hydrateOidcIdentityClaim(data);
5738
+ }
5739
+ async approveOidcClaim(id, input = {}) {
5740
+ const data = await this.request(
5741
+ `/api/platform/oidc-claims/${encodeURIComponent(id)}/approve`,
5742
+ { method: "POST", body: JSON.stringify(input) }
5743
+ );
5744
+ return hydrateOidcIdentityClaim(data);
5745
+ }
5746
+ async rejectOidcClaim(id) {
5747
+ const data = await this.request(
5748
+ `/api/platform/oidc-claims/${encodeURIComponent(id)}/reject`,
5749
+ { method: "POST", body: JSON.stringify({}) }
5750
+ );
5751
+ return hydrateOidcIdentityClaim(data);
5752
+ }
5753
+ async request(path, init = {}) {
5754
+ const headers = {
5755
+ ...this.getHeaders(),
5756
+ ...init.headers
5757
+ };
5758
+ if (init.body !== void 0) {
5759
+ headers["Content-Type"] = "application/json";
5760
+ }
5761
+ const response = await fetch(`${this.baseURL}${path}`, {
5762
+ ...init,
5763
+ headers
5764
+ });
5765
+ const payload = await response.json().catch(() => void 0);
5766
+ if (!response.ok || payload?.success !== true) {
5767
+ throw errorFromEnvelope2(payload, response);
5768
+ }
5769
+ return payload.data;
5770
+ }
5771
+ };
5772
+
4646
5773
  // src/client.ts
4647
5774
  var _Client = class extends AbstractClient {
4648
5775
  /**
@@ -4664,6 +5791,8 @@ var _Client = class extends AbstractClient {
4664
5791
  this.workspaceRooms = new WorkspaceRoomsClient(this.config.baseURL, () => this.getAllHeaders());
4665
5792
  this.workspaceMembers = new WorkspaceMembersClient(this.config.baseURL, () => this.getAllHeaders());
4666
5793
  this.roomEvents = new RoomEventsClient(this.config.baseURL, () => this.getAllHeaders());
5794
+ this.oidcProviders = new OidcProvidersClient(this.config.baseURL, () => this.getAllHeaders());
5795
+ this.platform = new PlatformClient(this.config.baseURL, () => this.getAllHeaders());
4667
5796
  }
4668
5797
  /**
4669
5798
  * Helper method to handle fetch responses and errors
@@ -6214,6 +7343,10 @@ export {
6214
7343
  ExportImportClient,
6215
7344
  McpAppShareRuntimeClient,
6216
7345
  NetworkError,
7346
+ OidcProviderClientError,
7347
+ OidcProvidersClient,
7348
+ PlatformClient,
7349
+ PlatformClientError,
6217
7350
  ProjectRoomClientError,
6218
7351
  ProjectRoomsClient,
6219
7352
  ResourcesClient,