@amerged/ohmyhost-mcp 0.1.47 → 0.1.49

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.
@@ -6105,11 +6105,12 @@ export const streamOperationEvents = <ThrowOnError extends boolean = true>(
6105
6105
  /**
6106
6106
  * List audit events
6107
6107
  *
6108
- * Returns events visible to the authenticated organization in stable descending order.
6108
+ * Returns events visible in an authorized workspace in stable descending order. Select a workspace when the credential has multiple workspaces and no active workspace context.
6109
6109
  */
6110
6110
  export const listAuditEvents = <ThrowOnError extends boolean = true>(
6111
6111
  parameters?: {
6112
6112
  "X-Request-Id"?: string;
6113
+ organization_id?: Ulid;
6113
6114
  project_id?: Ulid;
6114
6115
  operation_id?: Ulid;
6115
6116
  cursor?: string;
@@ -6123,6 +6124,7 @@ export const listAuditEvents = <ThrowOnError extends boolean = true>(
6123
6124
  {
6124
6125
  args: [
6125
6126
  { in: "headers", key: "X-Request-Id" },
6127
+ { in: "query", key: "organization_id" },
6126
6128
  { in: "query", key: "project_id" },
6127
6129
  { in: "query", key: "operation_id" },
6128
6130
  { in: "query", key: "cursor" },
@@ -10188,6 +10188,10 @@ export type ListAuditEventsData = {
10188
10188
  };
10189
10189
  path?: never;
10190
10190
  query?: {
10191
+ /**
10192
+ * Authorized workspace to query; defaults to the active or only workspace.
10193
+ */
10194
+ organization_id?: Ulid;
10191
10195
  /**
10192
10196
  * Restricts the page to one visible project.
10193
10197
  */
@@ -56,6 +56,7 @@ export interface WorkosConnectUserClaims {
56
56
  readonly issuedAt: number;
57
57
  readonly notBefore?: number;
58
58
  readonly scopes: readonly string[];
59
+ readonly authorizationRestriction?: Readonly<Record<string, readonly string[]>>;
59
60
  }
60
61
 
61
62
  export interface WorkosRsaJwk {
@@ -186,6 +187,26 @@ export function parseWorkosTokenClaims(
186
187
  throw new WorkosContractError("invalid_consent", "Connect consent identifier is invalid");
187
188
  }
188
189
  const tokenId = expectString(input["jti"], "jti", { optional: true });
190
+ const restriction = input["ohmyhost_authorization"];
191
+ let authorizationRestriction: Record<string, readonly string[]> | undefined;
192
+ if (restriction !== undefined) {
193
+ const raw = expectRecord(restriction, "invalid_claim");
194
+ const keys = ["actions", "organizationIds", "projectIds", "mailDomainIds"];
195
+ authorizationRestriction = {};
196
+ for (const [key, value] of Object.entries(raw)) {
197
+ if (
198
+ !keys.includes(key) ||
199
+ !Array.isArray(value) ||
200
+ value.length > 1000 ||
201
+ !value.every((item) => typeof item === "string" && item.length > 0 && item.length <= 128)
202
+ )
203
+ throw new WorkosContractError(
204
+ "invalid_claim",
205
+ "Token authorization restriction is invalid",
206
+ );
207
+ authorizationRestriction[key] = [...new Set(value as string[])].sort();
208
+ }
209
+ }
189
210
  return {
190
211
  kind,
191
212
  ...common,
@@ -196,6 +217,7 @@ export function parseWorkosTokenClaims(
196
217
  ...(tokenId === undefined ? {} : { tokenId }),
197
218
  ...(notBefore === undefined ? {} : { notBefore }),
198
219
  scopes: parseScopes(input["scope"]),
220
+ ...(authorizationRestriction === undefined ? {} : { authorizationRestriction }),
199
221
  };
200
222
  }
201
223
  if (kind === "m2m") {