@workos-inc/node 9.1.1 → 9.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.
@@ -4787,6 +4787,7 @@ const serializeListMembershipsForResourceOptions = (options) => ({
4787
4787
  const deserializeRoleAssignment = (response) => ({
4788
4788
  object: response.object,
4789
4789
  id: response.id,
4790
+ organizationMembershipId: response.organization_membership_id,
4790
4791
  role: response.role,
4791
4792
  resource: {
4792
4793
  id: response.resource.id,
@@ -5401,6 +5402,54 @@ var Authorization = class {
5401
5402
  return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, queryOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, params), queryOptions);
5402
5403
  }
5403
5404
  /**
5405
+ * List role assignments for a resource
5406
+ *
5407
+ * List all role assignments granted on a resource. This returns every role assignment scoped to the resource, regardless of which organization membership received it.
5408
+ * @param resourceId - The ID of the authorization resource.
5409
+ *
5410
+ * @example
5411
+ * "authz_resource_01HXYZ123456789ABCDEFGHIJ"
5412
+ *
5413
+ * @param options - Pagination and filter options.
5414
+ * @returns {Promise<AutoPaginatable<RoleAssignment>>}
5415
+ * @throws 403 response from the API.
5416
+ * @throws {NotFoundException} 404
5417
+ */
5418
+ async listRoleAssignmentsForResource(options) {
5419
+ const { resourceId, ...queryOptions } = options;
5420
+ const endpoint = `/authorization/resources/${resourceId}/role_assignments`;
5421
+ return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, queryOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, params), queryOptions);
5422
+ }
5423
+ /**
5424
+ * List role assignments for a resource by external ID
5425
+ *
5426
+ * List all role assignments granted on a resource identified by its external ID, organization, and resource type. This returns every role assignment scoped to the resource, regardless of which organization membership received it.
5427
+ * @param organizationId - The ID of the organization that owns the resource.
5428
+ *
5429
+ * @example
5430
+ * "org_01EHZNVPK3SFK441A1RGBFSHRT"
5431
+ *
5432
+ * @param resourceTypeSlug - The slug of the resource type this resource belongs to.
5433
+ *
5434
+ * @example
5435
+ * "project"
5436
+ *
5437
+ * @param externalId - An identifier you provide to reference the resource in your system.
5438
+ *
5439
+ * @example
5440
+ * "proj-456"
5441
+ *
5442
+ * @param options - Pagination and filter options.
5443
+ * @returns {Promise<AutoPaginatable<RoleAssignment>>}
5444
+ * @throws 403 response from the API.
5445
+ * @throws {NotFoundException} 404
5446
+ */
5447
+ async listResourceRoleAssignments(options) {
5448
+ const { organizationId, resourceTypeSlug, externalId, ...queryOptions } = options;
5449
+ const endpoint = `/authorization/organizations/${organizationId}/resources/${resourceTypeSlug}/${externalId}/role_assignments`;
5450
+ return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, queryOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, params), queryOptions);
5451
+ }
5452
+ /**
5404
5453
  * Assign a role
5405
5454
  *
5406
5455
  * Assign a role to an organization membership on a specific resource.
@@ -5858,7 +5907,7 @@ function extractBunVersionFromUserAgent() {
5858
5907
  }
5859
5908
  //#endregion
5860
5909
  //#region package.json
5861
- var version = "9.1.1";
5910
+ var version = "9.2.0";
5862
5911
  //#endregion
5863
5912
  //#region src/workos.ts
5864
5913
  const DEFAULT_HOSTNAME = "api.workos.com";
@@ -6243,4 +6292,4 @@ function createWorkOS(options) {
6243
6292
  //#endregion
6244
6293
  export { FetchHttpClient as A, NoApiKeyProvidedException as C, isAuthenticationErrorData as D, AuthenticationException as E, GenericServerException as O, NotFoundException as S, BadRequestException as T, UnprocessableEntityException as _, DomainDataState as a, RateLimitExceededException as b, FeatureFlagsRuntimeClient as c, serializeRevokeSessionOptions as d, AuthenticateWithSessionCookieFailureReason as f, Actions as g, Webhooks as h, OrganizationDomainVerificationStrategy as i, SubtleCryptoProvider as j, ApiKeyRequiredException as k, CookieSession as l, PKCE as m, ConnectionType as n, GenerateLinkIntent as o, AutoPaginatable as p, OrganizationDomainState as r, WorkOS as s, createWorkOS as t, RefreshSessionFailureReason as u, UnauthorizedException as v, ConflictException as w, OauthException as x, SignatureVerificationException as y };
6245
6294
 
6246
- //# sourceMappingURL=factory-BQ0MwKRy.mjs.map
6295
+ //# sourceMappingURL=factory-CdcF5208.mjs.map