@blimu/backend 1.2.1 → 1.2.2

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.
Files changed (46) hide show
  1. package/README.md +9 -0
  2. package/dist/client.cjs +43 -0
  3. package/dist/client.cjs.map +1 -1
  4. package/dist/client.d.mts +3 -1
  5. package/dist/client.d.ts +3 -1
  6. package/dist/client.mjs +43 -0
  7. package/dist/client.mjs.map +1 -1
  8. package/dist/index.cjs +101 -92
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.mts +31 -18
  11. package/dist/index.d.ts +31 -18
  12. package/dist/index.mjs +99 -92
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/{schema-CGYqiv8k.d.mts → schema-CdEZKE7E.d.mts} +17 -2
  15. package/dist/{schema-CGYqiv8k.d.ts → schema-CdEZKE7E.d.ts} +17 -2
  16. package/dist/schema.cjs.map +1 -1
  17. package/dist/schema.d.mts +1 -1
  18. package/dist/schema.d.ts +1 -1
  19. package/dist/services/auth_jwks.cjs +69 -0
  20. package/dist/services/auth_jwks.cjs.map +1 -0
  21. package/dist/services/auth_jwks.d.mts +13 -0
  22. package/dist/services/auth_jwks.d.ts +13 -0
  23. package/dist/services/auth_jwks.mjs +44 -0
  24. package/dist/services/auth_jwks.mjs.map +1 -0
  25. package/dist/services/bulk_resources.d.mts +1 -1
  26. package/dist/services/bulk_resources.d.ts +1 -1
  27. package/dist/services/bulk_roles.d.mts +1 -1
  28. package/dist/services/bulk_roles.d.ts +1 -1
  29. package/dist/services/entitlements.d.mts +1 -1
  30. package/dist/services/entitlements.d.ts +1 -1
  31. package/dist/services/oauth.d.mts +1 -1
  32. package/dist/services/oauth.d.ts +1 -1
  33. package/dist/services/plans.d.mts +1 -1
  34. package/dist/services/plans.d.ts +1 -1
  35. package/dist/services/resource_members.d.mts +1 -1
  36. package/dist/services/resource_members.d.ts +1 -1
  37. package/dist/services/resources.d.mts +1 -1
  38. package/dist/services/resources.d.ts +1 -1
  39. package/dist/services/roles.d.mts +1 -1
  40. package/dist/services/roles.d.ts +1 -1
  41. package/dist/services/usage.d.mts +1 -1
  42. package/dist/services/usage.d.ts +1 -1
  43. package/dist/services/users.d.mts +1 -1
  44. package/dist/services/users.d.ts +1 -1
  45. package/dist/tsconfig.tsbuildinfo +1 -1
  46. package/package.json +1 -1
package/README.md CHANGED
@@ -34,6 +34,14 @@ const client = new BlimuClient({
34
34
  ],
35
35
  });
36
36
 
37
+ // Example: Get JSON Web Key Set for environment (Public)
38
+ try {
39
+ const result = await client.authJwks.getJwks();
40
+ console.log('Result:', result);
41
+ } catch (error) {
42
+ // FetchError with structured data
43
+ console.error(error);
44
+ }
37
45
  // Example: Bulk create resources
38
46
  try {
39
47
  const result = await client.bulkResources.create(
@@ -186,6 +194,7 @@ The SDK includes the following TypeScript interfaces:
186
194
  - **EntitlementsListResult**
187
195
  - **IntrospectionRequest**
188
196
  - **IntrospectionResponse**
197
+ - **JWK**
189
198
  - **PlanAssignBody**
190
199
  - **PlanDeleteResponse**
191
200
  - **PlanResponse**
package/dist/client.cjs CHANGED
@@ -42,6 +42,47 @@ function buildAuthStrategies(cfg) {
42
42
  return authStrategies;
43
43
  }
44
44
 
45
+ // src/services/auth_jwks.ts
46
+ var AuthJwksService = class {
47
+ constructor(core) {
48
+ this.core = core;
49
+ }
50
+ /**
51
+ * GET /v1/auth/.well-known/jwks.json*
52
+ * @summary Get JSON Web Key Set for environment (Public)*
53
+ * @description Returns the public keys used to verify JWT tokens issued by this environment. Authenticate using either x-api-key header (secretKey) or x-blimu-publishable-key header (publishableKey).*/
54
+ getJwks(init) {
55
+ return this.core.request({
56
+ method: "GET",
57
+ path: `/v1/auth/.well-known/jwks.json`,
58
+ ...init ?? {}
59
+ });
60
+ }
61
+ /**
62
+ * GET /v1/auth/.well-known/public-key.pem*
63
+ * @summary Get environment public key (PEM)*
64
+ * @description Returns the public key in PEM format for verifying JWT tokens. Authenticate with x-api-key or x-blimu-publishable-key.*/
65
+ getPublicKeyPem(init) {
66
+ return this.core.request({
67
+ method: "GET",
68
+ path: `/v1/auth/.well-known/public-key.pem`,
69
+ ...init ?? {}
70
+ });
71
+ }
72
+ /**
73
+ * GET /v1/auth/oauth/.well-known/jwks.json*
74
+ * @summary Get JSON Web Key Set for OAuth app (Public)*
75
+ * @description Returns the public key for a specific OAuth app to verify JWT tokens. This is a public endpoint following OAuth2/OIDC standards. Provide client_id to get keys for a specific OAuth app, or use authenticated endpoint for environment keys.*/
76
+ getOAuthAppJwks(query, init) {
77
+ return this.core.request({
78
+ method: "GET",
79
+ path: `/v1/auth/oauth/.well-known/jwks.json`,
80
+ query,
81
+ ...init ?? {}
82
+ });
83
+ }
84
+ };
85
+
45
86
  // src/services/bulk_resources.ts
46
87
  var BulkResourcesService = class {
47
88
  constructor(core) {
@@ -549,6 +590,7 @@ var UsersService = class {
549
590
 
550
591
  // src/client.ts
551
592
  var Blimu = class {
593
+ authJwks;
552
594
  bulkResources;
553
595
  bulkRoles;
554
596
  entitlements;
@@ -568,6 +610,7 @@ var Blimu = class {
568
610
  baseURL: options?.baseURL ?? "https://api.blimu.dev",
569
611
  ...authStrategies.length > 0 ? { authStrategies } : {}
570
612
  });
613
+ this.authJwks = new AuthJwksService(core);
571
614
  this.bulkResources = new BulkResourcesService(core);
572
615
  this.bulkRoles = new BulkRolesService(core);
573
616
  this.entitlements = new EntitlementsService(core);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client.ts","../src/auth-strategies.ts","../src/services/bulk_resources.ts","../src/services/bulk_roles.ts","../src/services/entitlements.ts","../src/services/oauth.ts","../src/services/plans.ts","../src/services/resource_members.ts","../src/services/resources.ts","../src/services/roles.ts","../src/services/usage.ts","../src/services/users.ts"],"sourcesContent":["import { FetchClient, FetchError } from '@blimu/fetch';\nimport { type FetchClientConfig, type ApiKeyAuthStrategy } from '@blimu/fetch';\nimport { buildAuthStrategies } from './auth-strategies';\nimport { BulkResourcesService } from './services/bulk_resources';\nimport { BulkRolesService } from './services/bulk_roles';\nimport { EntitlementsService } from './services/entitlements';\nimport { OauthService } from './services/oauth';\nimport { PlansService } from './services/plans';\nimport { ResourceMembersService } from './services/resource_members';\nimport { ResourcesService } from './services/resources';\nimport { RolesService } from './services/roles';\nimport { UsageService } from './services/usage';\nimport { UsersService } from './services/users';\n\nexport type ClientOption = FetchClientConfig & {\n apiKey?: ApiKeyAuthStrategy['key'];\n};\n\nexport class Blimu {\n readonly bulkResources: BulkResourcesService;\n readonly bulkRoles: BulkRolesService;\n readonly entitlements: EntitlementsService;\n readonly oauth: OauthService;\n readonly plans: PlansService;\n readonly resourceMembers: ResourceMembersService;\n readonly resources: ResourcesService;\n readonly roles: RolesService;\n readonly usage: UsageService;\n readonly users: UsersService;\n\n constructor(options?: ClientOption) {\n const restCfg = { ...(options ?? {}) };\n delete restCfg.apiKey;\n\n const authStrategies = buildAuthStrategies(options ?? {});\n\n const core = new FetchClient({\n ...restCfg,\n baseURL: options?.baseURL ?? 'https://api.blimu.dev',\n ...(authStrategies.length > 0 ? { authStrategies } : {}),\n });\n\n this.bulkResources = new BulkResourcesService(core);\n this.bulkRoles = new BulkRolesService(core);\n this.entitlements = new EntitlementsService(core);\n this.oauth = new OauthService(core);\n this.plans = new PlansService(core);\n this.resourceMembers = new ResourceMembersService(core);\n this.resources = new ResourcesService(core);\n this.roles = new RolesService(core);\n this.usage = new UsageService(core);\n this.users = new UsersService(core);\n }\n}\n\n// Re-export FetchError for backward compatibility\nexport { FetchError };\nexport const BlimuError = FetchError;\n","import type { AuthStrategy } from '@blimu/fetch';\nimport type { ClientOption } from './client';\n\nexport function buildAuthStrategies(cfg: ClientOption): AuthStrategy[] {\n const authStrategies: AuthStrategy[] = [...(cfg?.authStrategies ?? [])];\n\n if (cfg.apiKey) {\n authStrategies.push({\n type: 'apiKey',\n key: cfg.apiKey,\n location: 'header',\n name: 'X-API-KEY',\n });\n }\n return authStrategies;\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class BulkResourcesService {\n constructor(private core: FetchClient) {}\n\n /**\n * POST /v1/resources/{resourceType}/bulk*\n * @summary Bulk create resources*\n * @description Creates multiple resources of the specified type in a single request. This operation supports partial success - some resources may be created while others fail. The response includes details about successful creations and any errors encountered. Resources can have parent relationships and initial role assignments.*/\n create(\n resourceType: ResourceType,\n body: Schema.ResourceBulkCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceBulkResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/bulk`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class BulkRolesService {\n constructor(private core: FetchClient) {}\n\n /**\n * POST /v1/users/roles/bulk*\n * @summary Bulk create roles*\n * @description Assigns multiple roles to users on resources in a single request. This operation supports partial success - some role assignments may succeed while others fail. The response includes details about successful assignments and any errors encountered. All roles must be valid according to your resource definitions.*/\n create(\n body: Schema.RoleBulkCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.RoleBulkResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users/roles/bulk`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class EntitlementsService {\n constructor(private core: FetchClient) {}\n\n /**\n * POST /v1/entitlements/check*\n * @summary Check if a user has a specific entitlement on a resource*\n * @description Checks whether a user has permission to perform a specific action (entitlement) on a resource. This endpoint evaluates role-based access, plan gating, and usage limits. The response includes detailed information about why access was granted or denied, including which roles were checked, plan requirements, and usage limit status.*/\n checkEntitlement(\n body: Schema.EntitlementCheckBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementCheckResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/entitlements/check`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/entitlements/list-for-resource/{resourceType}/{resourceId}*\n * @summary List entitlements for a specific resource*\n * @description Returns entitlements for a specific resource and user. Only evaluates roles and plans (excludes limits). Provides detailed information about why entitlements are allowed or denied, including current roles, allowed roles, current plan, and allowed plans. Results are cached per resource for performance.*/\n listForResource(\n resourceType: ResourceType,\n resourceId: string,\n query?: Schema.EntitlementsListForResourceQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementsListResult> {\n return this.core.request({\n method: 'GET',\n path: `/v1/entitlements/list-for-resource/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/entitlements/list-for-tenant/{tenantResourceId}*\n * @summary List entitlements for a tenant and all its sub-resources*\n * @description Returns entitlements for a tenant resource and all its descendant resources. This endpoint scopes queries to a single tenant, preventing cross-tenant data access. Only evaluates roles and plans (excludes limits). Results are cached per resource for performance. The tenant resource type is automatically determined from the environment definition (resource marked as `is_tenant: true`).*/\n listForTenant(\n tenantResourceId: string,\n query?: Schema.EntitlementsListForTenantQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementsListResult> {\n return this.core.request({\n method: 'GET',\n path: `/v1/entitlements/list-for-tenant/${encodeURIComponent(tenantResourceId)}`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class OauthService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/oauth/authorize*\n * @summary Check consent requirement*\n * @description Checks if user consent is required for the OAuth2 app and requested scopes.*/\n checkConsentRequired(\n query?: Schema.OauthCheckConsentRequiredQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ConsentCheckResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/oauth/authorize`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/authorize*\n * @summary Authorize OAuth2 application*\n * @description Handles user consent approval/denial. Validates auto_approved flag against consent requirements.*/\n authorize(\n body: Schema.AuthorizeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/authorize`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/authorize*\n * @summary Authorize or deny device code*\n * @description Allows an authenticated user to authorize or deny a device code request. Requires valid user session.*/\n authorizeDeviceCode(\n body: Schema.DeviceAuthorizeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceAuthorizeResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/authorize`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/code*\n * @summary Request device authorization codes*\n * @description Initiates device authorization flow. Returns device_code (for polling) and user_code (for user entry).*/\n requestDeviceCode(\n body: Schema.DeviceCodeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceCodeResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/code`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/oauth/device/code/{user_code}*\n * @summary Get device code information*\n * @description Returns device code information including app name, scopes, and consent requirement status.*/\n getDeviceCodeInfo(\n user_code: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceCodeInfoResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/oauth/device/code/${encodeURIComponent(user_code)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/token*\n * @summary Poll for device authorization tokens*\n * @description Client polls this endpoint to exchange device_code for tokens once user has authorized.*/\n exchangeDeviceCode(\n body: Schema.DeviceTokenRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TokenResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/token`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/introspect*\n * @summary Introspect token*\n * @description Validates a token and returns metadata. Requires client authentication.*/\n introspect(\n body: Schema.IntrospectionRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.IntrospectionResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/introspect`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/revoke*\n * @summary Revoke token*\n * @description Revokes an access or refresh token. Requires client authentication.*/\n revoke(\n body: Schema.RevocationRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/revoke`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/token*\n * @summary Token endpoint*\n * @description Issues access and refresh tokens. Supports authorization_code and refresh_token (always available per OAuth2 spec).*/\n token(\n body: Schema.TokenRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TokenResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/token`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class PlansService {\n constructor(private core: FetchClient) {}\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Remove plan assignment from a tenant resource*\n * @description Removes the billing plan assignment from a tenant resource. After removal, the resource will have no plan and will be subject to default limits.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanDeleteResponse> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Get the plan assigned to a tenant resource*\n * @description Retrieves the billing plan currently assigned to a tenant resource, if any.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Assign a plan to a tenant resource*\n * @description Assigns a billing plan to a tenant resource. Plans control feature access and usage limits based on your plan definitions. The resource must be marked as a tenant in your resource definitions.*/\n assign(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.PlanAssignBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class ResourceMembersService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/members*\n * @summary List members for a resource*\n * @description Retrieves a paginated list of users who have roles (direct or inherited) on the specified resource. Supports search functionality to filter users by email or name.*/\n list(\n resourceType: ResourceType,\n resourceId: string,\n query?: Schema.ResourceMembersListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceMemberList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/members`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class ResourcesService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/resources/{resourceType}*\n * @summary List resources*\n * @description Retrieves a paginated list of resources of the specified type. Supports search and filtering. Resources are returned with their parent relationships and metadata.*/\n list(\n resourceType: ResourceType,\n query?: Schema.ResourcesListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}*\n * @summary Create a resource*\n * @description Creates a new resource of the specified type. Resources can have parent relationships to form hierarchies. You can optionally assign initial roles to users when creating the resource. Parent resources must already exist.*/\n create(\n resourceType: ResourceType,\n body: Schema.ResourceCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Resource> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}*\n * @summary Delete a resource*\n * @description Deletes a resource by its type and ID. This operation is permanent and cannot be undone. Deleting a resource may affect child resources that depend on it.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}*\n * @summary Read a resource*\n * @description Retrieves a single resource by its type and ID. Returns the resource with its parent relationships and metadata.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Resource> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * PUT /v1/resources/{resourceType}/{resourceId}*\n * @summary Update a resource*\n * @description Updates an existing resource. You can update the resource name and modify parent relationships. Parent resources must already exist.*/\n update(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.ResourceUpdateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'PUT',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class RolesService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/users/{userId}/roles*\n * @summary List user roles*\n * @description Retrieves a paginated list of roles assigned to a user. Supports filtering by resource type, resource ID, and role name. Returns both directly assigned roles and inherited roles.*/\n list(\n userId: string,\n query?: Schema.RolesListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.RoleList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}/roles`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/users/{userId}/roles*\n * @summary Create a role (assign role to user on resource)*\n * @description Assigns a role to a user on a specific resource. The role must be defined in your resource definitions for the specified resource type. Roles can be inherited from parent resources based on your resource configuration.*/\n create(\n userId: string,\n body: Schema.RoleCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Role> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users/${encodeURIComponent(userId)}/roles`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/users/{userId}/roles/{resourceType}/{resourceId}*\n * @summary Delete a role*\n * @description Removes a role assignment from a user on a specific resource. This only removes the direct role assignment and does not affect inherited roles from parent resources.*/\n delete(\n userId: string,\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/users/${encodeURIComponent(userId)}/roles/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class UsageService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/usage/balance/{resourceType}/{resourceId}/{limitType}*\n * @summary Get wallet balance*\n * @description Retrieves the current balance of a usage wallet for a specific resource and limit type within a given time period. The balance reflects all credits and consumption transactions.*/\n getBalance(\n resourceType: string,\n resourceId: string,\n limitType: string,\n query?: Schema.UsageGetBalanceQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.BalanceResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/usage/balance/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/check*\n * @summary Check if consumption is allowed*\n * @description Checks whether a specific amount of consumption is allowed for a resource and limit type within a given time period. Returns the current balance, requested amount, and remaining balance after the consumption.*/\n checkLimit(\n body: Schema.UsageCheckBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.CheckLimitResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/check`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/consume*\n * @summary Record consumption (inserts negative amount)*\n * @description Records consumption from a usage wallet for a specific resource and limit type. This decreases the available balance. Consumption can be tagged for tracking purposes.*/\n consume(\n body: Schema.UsageConsumeBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UsageWalletResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/consume`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/credit*\n * @summary Add credits to wallet (inserts positive amount)*\n * @description Adds credits to a usage wallet for a specific resource and limit type. This increases the available balance for usage-based limits. Credits can be tagged for tracking purposes.*/\n credit(\n body: Schema.UsageCreditBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UsageWalletResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/credit`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/usage/transactions/{resourceType}/{resourceId}/{limitType}*\n * @summary Get transaction history*\n * @description Retrieves the transaction history for a usage wallet, including all credits and consumption records. Supports filtering by time period and date range.*/\n getTransactionHistory(\n resourceType: string,\n resourceId: string,\n limitType: string,\n query?: Schema.UsageGetTransactionHistoryQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TransactionHistoryResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/usage/transactions/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class UsersService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/users*\n * @summary List users*\n * @description Retrieves a paginated list of users in your environment. Supports search functionality to filter users by email, name, or lookup key.*/\n list(\n query?: Schema.UsersListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UserList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/users*\n * @summary Create a user*\n * @description Creates a new user in your environment. The lookupKey is a unique identifier that you can use to reference the user in your system. It should be stable and not change over time.*/\n create(\n body: Schema.UserCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.User> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/users/{userId}*\n * @summary Delete a user*\n * @description Deletes a user by their ID or lookup key. This operation is permanent and cannot be undone. Deleting a user will also remove all role assignments for that user.*/\n delete(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/users/{userId}*\n * @summary Get a user by ID*\n * @description Retrieves a single user by their ID or lookup key. Returns user information including email, name, and metadata.*/\n read(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.User> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * PUT /v1/users/{userId}*\n * @summary Update a user*\n * @description Updates an existing user. You can modify email, name, and other user properties. The lookupKey can be updated but should remain stable.*/\n update(\n userId: string,\n body: Schema.UserUpdateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.User> {\n return this.core.request({\n method: 'PUT',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/users/{userId}/effective-user-resources-roles*\n * @summary List effective user resources roles*\n * @description Retrieves all resources and roles for a user, including inherited roles from parent resources. The response indicates whether each role is directly assigned or inherited through resource hierarchies.*/\n listEffectiveUserResourcesRoles(\n userId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UserResourceList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}/effective-user-resources-roles`,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwC;AACxC,IAAAA,gBAAgE;;;ACEzD,SAAS,oBAAoB,KAAmC;AACrE,QAAM,iBAAiC,CAAC,GAAI,KAAK,kBAAkB,CAAC,CAAE;AAEtE,MAAI,IAAI,QAAQ;AACd,mBAAe,KAAK;AAAA,MAClB,MAAM;AAAA,MACN,KAAK,IAAI;AAAA,MACT,UAAU;AAAA,MACV,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AACA,SAAO;AACT;;;ACXO,IAAM,uBAAN,MAA2B;AAAA,EAChC,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAA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,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,aAAa,mBAAmB,MAAM,CAAC;AAAA,MAC7C,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AACF;;;AX3EO,IAAM,QAAN,MAAY;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,SAAwB;AAClC,UAAM,UAAU,EAAE,GAAI,WAAW,CAAC,EAAG;AACrC,WAAO,QAAQ;AAEf,UAAM,iBAAiB,oBAAoB,WAAW,CAAC,CAAC;AAExD,UAAM,OAAO,IAAI,yBAAY;AAAA,MAC3B,GAAG;AAAA,MACH,SAAS,SAAS,WAAW;AAAA,MAC7B,GAAI,eAAe,SAAS,IAAI,EAAE,eAAe,IAAI,CAAC;AAAA,IACxD,CAAC;AAED,SAAK,gBAAgB,IAAI,qBAAqB,IAAI;AAClD,SAAK,YAAY,IAAI,iBAAiB,IAAI;AAC1C,SAAK,eAAe,IAAI,oBAAoB,IAAI;AAChD,SAAK,QAAQ,IAAI,aAAa,IAAI;AAClC,SAAK,QAAQ,IAAI,aAAa,IAAI;AAClC,SAAK,kBAAkB,IAAI,uBAAuB,IAAI;AACtD,SAAK,YAAY,IAAI,iBAAiB,IAAI;AAC1C,SAAK,QAAQ,IAAI,aAAa,IAAI;AAClC,SAAK,QAAQ,IAAI,aAAa,IAAI;AAClC,SAAK,QAAQ,IAAI,aAAa,IAAI;AAAA,EACpC;AACF;AAIO,IAAM,aAAa;","names":["import_fetch"]}
1
+ {"version":3,"sources":["../src/client.ts","../src/auth-strategies.ts","../src/services/auth_jwks.ts","../src/services/bulk_resources.ts","../src/services/bulk_roles.ts","../src/services/entitlements.ts","../src/services/oauth.ts","../src/services/plans.ts","../src/services/resource_members.ts","../src/services/resources.ts","../src/services/roles.ts","../src/services/usage.ts","../src/services/users.ts"],"sourcesContent":["import { FetchClient, FetchError } from '@blimu/fetch';\nimport { type FetchClientConfig, type ApiKeyAuthStrategy } from '@blimu/fetch';\nimport { buildAuthStrategies } from './auth-strategies';\nimport { AuthJwksService } from './services/auth_jwks';\nimport { BulkResourcesService } from './services/bulk_resources';\nimport { BulkRolesService } from './services/bulk_roles';\nimport { EntitlementsService } from './services/entitlements';\nimport { OauthService } from './services/oauth';\nimport { PlansService } from './services/plans';\nimport { ResourceMembersService } from './services/resource_members';\nimport { ResourcesService } from './services/resources';\nimport { RolesService } from './services/roles';\nimport { UsageService } from './services/usage';\nimport { UsersService } from './services/users';\n\nexport type ClientOption = FetchClientConfig & {\n apiKey?: ApiKeyAuthStrategy['key'];\n};\n\nexport class Blimu {\n readonly authJwks: AuthJwksService;\n readonly bulkResources: BulkResourcesService;\n readonly bulkRoles: BulkRolesService;\n readonly entitlements: EntitlementsService;\n readonly oauth: OauthService;\n readonly plans: PlansService;\n readonly resourceMembers: ResourceMembersService;\n readonly resources: ResourcesService;\n readonly roles: RolesService;\n readonly usage: UsageService;\n readonly users: UsersService;\n\n constructor(options?: ClientOption) {\n const restCfg = { ...(options ?? {}) };\n delete restCfg.apiKey;\n\n const authStrategies = buildAuthStrategies(options ?? {});\n\n const core = new FetchClient({\n ...restCfg,\n baseURL: options?.baseURL ?? 'https://api.blimu.dev',\n ...(authStrategies.length > 0 ? { authStrategies } : {}),\n });\n\n this.authJwks = new AuthJwksService(core);\n this.bulkResources = new BulkResourcesService(core);\n this.bulkRoles = new BulkRolesService(core);\n this.entitlements = new EntitlementsService(core);\n this.oauth = new OauthService(core);\n this.plans = new PlansService(core);\n this.resourceMembers = new ResourceMembersService(core);\n this.resources = new ResourcesService(core);\n this.roles = new RolesService(core);\n this.usage = new UsageService(core);\n this.users = new UsersService(core);\n }\n}\n\n// Re-export FetchError for backward compatibility\nexport { FetchError };\nexport const BlimuError = FetchError;\n","import type { AuthStrategy } from '@blimu/fetch';\nimport type { ClientOption } from './client';\n\nexport function buildAuthStrategies(cfg: ClientOption): AuthStrategy[] {\n const authStrategies: AuthStrategy[] = [...(cfg?.authStrategies ?? [])];\n\n if (cfg.apiKey) {\n authStrategies.push({\n type: 'apiKey',\n key: cfg.apiKey,\n location: 'header',\n name: 'X-API-KEY',\n });\n }\n return authStrategies;\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class AuthJwksService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/auth/.well-known/jwks.json*\n * @summary Get JSON Web Key Set for environment (Public)*\n * @description Returns the public keys used to verify JWT tokens issued by this environment. Authenticate using either x-api-key header (secretKey) or x-blimu-publishable-key header (publishableKey).*/\n getJwks(init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.JWK> {\n return this.core.request({\n method: 'GET',\n path: `/v1/auth/.well-known/jwks.json`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/auth/.well-known/public-key.pem*\n * @summary Get environment public key (PEM)*\n * @description Returns the public key in PEM format for verifying JWT tokens. Authenticate with x-api-key or x-blimu-publishable-key.*/\n getPublicKeyPem(init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown> {\n return this.core.request({\n method: 'GET',\n path: `/v1/auth/.well-known/public-key.pem`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/auth/oauth/.well-known/jwks.json*\n * @summary Get JSON Web Key Set for OAuth app (Public)*\n * @description Returns the public key for a specific OAuth app to verify JWT tokens. This is a public endpoint following OAuth2/OIDC standards. Provide client_id to get keys for a specific OAuth app, or use authenticated endpoint for environment keys.*/\n getOAuthAppJwks(\n query?: Schema.AuthJwksGetOAuthAppJwksQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.JWK> {\n return this.core.request({\n method: 'GET',\n path: `/v1/auth/oauth/.well-known/jwks.json`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class BulkResourcesService {\n constructor(private core: FetchClient) {}\n\n /**\n * POST /v1/resources/{resourceType}/bulk*\n * @summary Bulk create resources*\n * @description Creates multiple resources of the specified type in a single request. This operation supports partial success - some resources may be created while others fail. The response includes details about successful creations and any errors encountered. Resources can have parent relationships and initial role assignments.*/\n create(\n resourceType: ResourceType,\n body: Schema.ResourceBulkCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceBulkResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/bulk`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class BulkRolesService {\n constructor(private core: FetchClient) {}\n\n /**\n * POST /v1/users/roles/bulk*\n * @summary Bulk create roles*\n * @description Assigns multiple roles to users on resources in a single request. This operation supports partial success - some role assignments may succeed while others fail. The response includes details about successful assignments and any errors encountered. All roles must be valid according to your resource definitions.*/\n create(\n body: Schema.RoleBulkCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.RoleBulkResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users/roles/bulk`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class EntitlementsService {\n constructor(private core: FetchClient) {}\n\n /**\n * POST /v1/entitlements/check*\n * @summary Check if a user has a specific entitlement on a resource*\n * @description Checks whether a user has permission to perform a specific action (entitlement) on a resource. This endpoint evaluates role-based access, plan gating, and usage limits. The response includes detailed information about why access was granted or denied, including which roles were checked, plan requirements, and usage limit status.*/\n checkEntitlement(\n body: Schema.EntitlementCheckBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementCheckResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/entitlements/check`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/entitlements/list-for-resource/{resourceType}/{resourceId}*\n * @summary List entitlements for a specific resource*\n * @description Returns entitlements for a specific resource and user. Only evaluates roles and plans (excludes limits). Provides detailed information about why entitlements are allowed or denied, including current roles, allowed roles, current plan, and allowed plans. Results are cached per resource for performance.*/\n listForResource(\n resourceType: ResourceType,\n resourceId: string,\n query?: Schema.EntitlementsListForResourceQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementsListResult> {\n return this.core.request({\n method: 'GET',\n path: `/v1/entitlements/list-for-resource/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/entitlements/list-for-tenant/{tenantResourceId}*\n * @summary List entitlements for a tenant and all its sub-resources*\n * @description Returns entitlements for a tenant resource and all its descendant resources. This endpoint scopes queries to a single tenant, preventing cross-tenant data access. Only evaluates roles and plans (excludes limits). Results are cached per resource for performance. The tenant resource type is automatically determined from the environment definition (resource marked as `is_tenant: true`).*/\n listForTenant(\n tenantResourceId: string,\n query?: Schema.EntitlementsListForTenantQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementsListResult> {\n return this.core.request({\n method: 'GET',\n path: `/v1/entitlements/list-for-tenant/${encodeURIComponent(tenantResourceId)}`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class OauthService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/oauth/authorize*\n * @summary Check consent requirement*\n * @description Checks if user consent is required for the OAuth2 app and requested scopes.*/\n checkConsentRequired(\n query?: Schema.OauthCheckConsentRequiredQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ConsentCheckResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/oauth/authorize`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/authorize*\n * @summary Authorize OAuth2 application*\n * @description Handles user consent approval/denial. Validates auto_approved flag against consent requirements.*/\n authorize(\n body: Schema.AuthorizeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/authorize`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/authorize*\n * @summary Authorize or deny device code*\n * @description Allows an authenticated user to authorize or deny a device code request. Requires valid user session.*/\n authorizeDeviceCode(\n body: Schema.DeviceAuthorizeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceAuthorizeResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/authorize`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/code*\n * @summary Request device authorization codes*\n * @description Initiates device authorization flow. Returns device_code (for polling) and user_code (for user entry).*/\n requestDeviceCode(\n body: Schema.DeviceCodeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceCodeResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/code`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/oauth/device/code/{user_code}*\n * @summary Get device code information*\n * @description Returns device code information including app name, scopes, and consent requirement status.*/\n getDeviceCodeInfo(\n user_code: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceCodeInfoResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/oauth/device/code/${encodeURIComponent(user_code)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/token*\n * @summary Poll for device authorization tokens*\n * @description Client polls this endpoint to exchange device_code for tokens once user has authorized.*/\n exchangeDeviceCode(\n body: Schema.DeviceTokenRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TokenResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/token`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/introspect*\n * @summary Introspect token*\n * @description Validates a token and returns metadata. Requires client authentication.*/\n introspect(\n body: Schema.IntrospectionRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.IntrospectionResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/introspect`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/revoke*\n * @summary Revoke token*\n * @description Revokes an access or refresh token. Requires client authentication.*/\n revoke(\n body: Schema.RevocationRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/revoke`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/token*\n * @summary Token endpoint*\n * @description Issues access and refresh tokens. Supports authorization_code and refresh_token (always available per OAuth2 spec).*/\n token(\n body: Schema.TokenRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TokenResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/token`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class PlansService {\n constructor(private core: FetchClient) {}\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Remove plan assignment from a tenant resource*\n * @description Removes the billing plan assignment from a tenant resource. After removal, the resource will have no plan and will be subject to default limits.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanDeleteResponse> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Get the plan assigned to a tenant resource*\n * @description Retrieves the billing plan currently assigned to a tenant resource, if any.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Assign a plan to a tenant resource*\n * @description Assigns a billing plan to a tenant resource. Plans control feature access and usage limits based on your plan definitions. The resource must be marked as a tenant in your resource definitions.*/\n assign(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.PlanAssignBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class ResourceMembersService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/members*\n * @summary List members for a resource*\n * @description Retrieves a paginated list of users who have roles (direct or inherited) on the specified resource. Supports search functionality to filter users by email or name.*/\n list(\n resourceType: ResourceType,\n resourceId: string,\n query?: Schema.ResourceMembersListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceMemberList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/members`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class ResourcesService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/resources/{resourceType}*\n * @summary List resources*\n * @description Retrieves a paginated list of resources of the specified type. Supports search and filtering. Resources are returned with their parent relationships and metadata.*/\n list(\n resourceType: ResourceType,\n query?: Schema.ResourcesListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}*\n * @summary Create a resource*\n * @description Creates a new resource of the specified type. Resources can have parent relationships to form hierarchies. You can optionally assign initial roles to users when creating the resource. Parent resources must already exist.*/\n create(\n resourceType: ResourceType,\n body: Schema.ResourceCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Resource> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}*\n * @summary Delete a resource*\n * @description Deletes a resource by its type and ID. This operation is permanent and cannot be undone. Deleting a resource may affect child resources that depend on it.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}*\n * @summary Read a resource*\n * @description Retrieves a single resource by its type and ID. Returns the resource with its parent relationships and metadata.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Resource> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * PUT /v1/resources/{resourceType}/{resourceId}*\n * @summary Update a resource*\n * @description Updates an existing resource. You can update the resource name and modify parent relationships. Parent resources must already exist.*/\n update(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.ResourceUpdateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'PUT',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class RolesService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/users/{userId}/roles*\n * @summary List user roles*\n * @description Retrieves a paginated list of roles assigned to a user. Supports filtering by resource type, resource ID, and role name. Returns both directly assigned roles and inherited roles.*/\n list(\n userId: string,\n query?: Schema.RolesListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.RoleList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}/roles`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/users/{userId}/roles*\n * @summary Create a role (assign role to user on resource)*\n * @description Assigns a role to a user on a specific resource. The role must be defined in your resource definitions for the specified resource type. Roles can be inherited from parent resources based on your resource configuration.*/\n create(\n userId: string,\n body: Schema.RoleCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Role> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users/${encodeURIComponent(userId)}/roles`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/users/{userId}/roles/{resourceType}/{resourceId}*\n * @summary Delete a role*\n * @description Removes a role assignment from a user on a specific resource. This only removes the direct role assignment and does not affect inherited roles from parent resources.*/\n delete(\n userId: string,\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/users/${encodeURIComponent(userId)}/roles/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class UsageService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/usage/balance/{resourceType}/{resourceId}/{limitType}*\n * @summary Get wallet balance*\n * @description Retrieves the current balance of a usage wallet for a specific resource and limit type within a given time period. The balance reflects all credits and consumption transactions.*/\n getBalance(\n resourceType: string,\n resourceId: string,\n limitType: string,\n query?: Schema.UsageGetBalanceQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.BalanceResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/usage/balance/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/check*\n * @summary Check if consumption is allowed*\n * @description Checks whether a specific amount of consumption is allowed for a resource and limit type within a given time period. Returns the current balance, requested amount, and remaining balance after the consumption.*/\n checkLimit(\n body: Schema.UsageCheckBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.CheckLimitResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/check`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/consume*\n * @summary Record consumption (inserts negative amount)*\n * @description Records consumption from a usage wallet for a specific resource and limit type. This decreases the available balance. Consumption can be tagged for tracking purposes.*/\n consume(\n body: Schema.UsageConsumeBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UsageWalletResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/consume`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/credit*\n * @summary Add credits to wallet (inserts positive amount)*\n * @description Adds credits to a usage wallet for a specific resource and limit type. This increases the available balance for usage-based limits. Credits can be tagged for tracking purposes.*/\n credit(\n body: Schema.UsageCreditBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UsageWalletResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/credit`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/usage/transactions/{resourceType}/{resourceId}/{limitType}*\n * @summary Get transaction history*\n * @description Retrieves the transaction history for a usage wallet, including all credits and consumption records. Supports filtering by time period and date range.*/\n getTransactionHistory(\n resourceType: string,\n resourceId: string,\n limitType: string,\n query?: Schema.UsageGetTransactionHistoryQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TransactionHistoryResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/usage/transactions/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class UsersService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/users*\n * @summary List users*\n * @description Retrieves a paginated list of users in your environment. Supports search functionality to filter users by email, name, or lookup key.*/\n list(\n query?: Schema.UsersListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UserList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/users*\n * @summary Create a user*\n * @description Creates a new user in your environment. The lookupKey is a unique identifier that you can use to reference the user in your system. It should be stable and not change over time.*/\n create(\n body: Schema.UserCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.User> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/users/{userId}*\n * @summary Delete a user*\n * @description Deletes a user by their ID or lookup key. This operation is permanent and cannot be undone. Deleting a user will also remove all role assignments for that user.*/\n delete(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/users/{userId}*\n * @summary Get a user by ID*\n * @description Retrieves a single user by their ID or lookup key. Returns user information including email, name, and metadata.*/\n read(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.User> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * PUT /v1/users/{userId}*\n * @summary Update a user*\n * @description Updates an existing user. You can modify email, name, and other user properties. The lookupKey can be updated but should remain stable.*/\n update(\n userId: string,\n body: Schema.UserUpdateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.User> {\n return this.core.request({\n method: 'PUT',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/users/{userId}/effective-user-resources-roles*\n * @summary List effective user resources roles*\n * @description Retrieves all resources and roles for a user, including inherited roles from parent resources. The response indicates whether each role is directly assigned or inherited through resource hierarchies.*/\n listEffectiveUserResourcesRoles(\n userId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UserResourceList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}/effective-user-resources-roles`,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwC;AACxC,IAAAA,gBAAgE;;;ACEzD,SAAS,oBAAoB,KAAmC;AACrE,QAAM,iBAAiC,CAAC,GAAI,KAAK,kBAAkB,CAAC,CAAE;AAEtE,MAAI,IAAI,QAAQ;AACd,mBAAe,KAAK;AAAA,MAClB,MAAM;AAAA,MACN,KAAK,IAAI;AAAA,MACT,UAAU;AAAA,MACV,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AACA,SAAO;AACT;;;ACZO,IAAM,kBAAN,MAAsB;AAAA,EAC3B,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,QA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AAgB,IAAI;AACxC,SAAK,gBAAgB,IAAI,qBAAqB,IAAI;AAClD,SAAK,YAAY,IAAI,iBAAiB,IAAI;AAC1C,SAAK,eAAe,IAAI,oBAAoB,IAAI;AAChD,SAAK,QAAQ,IAAI,aAAa,IAAI;AAClC,SAAK,QAAQ,IAAI,aAAa,IAAI;AAClC,SAAK,kBAAkB,IAAI,uBAAuB,IAAI;AACtD,SAAK,YAAY,IAAI,iBAAiB,IAAI;AAC1C,SAAK,QAAQ,IAAI,aAAa,IAAI;AAClC,SAAK,QAAQ,IAAI,aAAa,IAAI;AAClC,SAAK,QAAQ,IAAI,aAAa,IAAI;AAAA,EACpC;AACF;AAIO,IAAM,aAAa;","names":["import_fetch"]}
package/dist/client.d.mts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { FetchClientConfig, ApiKeyAuthStrategy, FetchError } from '@blimu/fetch';
2
2
  export { FetchError } from '@blimu/fetch';
3
+ import { AuthJwksService } from './services/auth_jwks.mjs';
3
4
  import { BulkResourcesService } from './services/bulk_resources.mjs';
4
5
  import { BulkRolesService } from './services/bulk_roles.mjs';
5
6
  import { EntitlementsService } from './services/entitlements.mjs';
@@ -10,13 +11,14 @@ import { ResourcesService } from './services/resources.mjs';
10
11
  import { RolesService } from './services/roles.mjs';
11
12
  import { UsageService } from './services/usage.mjs';
12
13
  import { UsersService } from './services/users.mjs';
13
- import './schema-CGYqiv8k.mjs';
14
+ import './schema-CdEZKE7E.mjs';
14
15
  import '@blimu/types';
15
16
 
16
17
  type ClientOption = FetchClientConfig & {
17
18
  apiKey?: ApiKeyAuthStrategy['key'];
18
19
  };
19
20
  declare class Blimu {
21
+ readonly authJwks: AuthJwksService;
20
22
  readonly bulkResources: BulkResourcesService;
21
23
  readonly bulkRoles: BulkRolesService;
22
24
  readonly entitlements: EntitlementsService;
package/dist/client.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { FetchClientConfig, ApiKeyAuthStrategy, FetchError } from '@blimu/fetch';
2
2
  export { FetchError } from '@blimu/fetch';
3
+ import { AuthJwksService } from './services/auth_jwks.js';
3
4
  import { BulkResourcesService } from './services/bulk_resources.js';
4
5
  import { BulkRolesService } from './services/bulk_roles.js';
5
6
  import { EntitlementsService } from './services/entitlements.js';
@@ -10,13 +11,14 @@ import { ResourcesService } from './services/resources.js';
10
11
  import { RolesService } from './services/roles.js';
11
12
  import { UsageService } from './services/usage.js';
12
13
  import { UsersService } from './services/users.js';
13
- import './schema-CGYqiv8k.js';
14
+ import './schema-CdEZKE7E.js';
14
15
  import '@blimu/types';
15
16
 
16
17
  type ClientOption = FetchClientConfig & {
17
18
  apiKey?: ApiKeyAuthStrategy['key'];
18
19
  };
19
20
  declare class Blimu {
21
+ readonly authJwks: AuthJwksService;
20
22
  readonly bulkResources: BulkResourcesService;
21
23
  readonly bulkRoles: BulkRolesService;
22
24
  readonly entitlements: EntitlementsService;
package/dist/client.mjs CHANGED
@@ -16,6 +16,47 @@ function buildAuthStrategies(cfg) {
16
16
  return authStrategies;
17
17
  }
18
18
 
19
+ // src/services/auth_jwks.ts
20
+ var AuthJwksService = class {
21
+ constructor(core) {
22
+ this.core = core;
23
+ }
24
+ /**
25
+ * GET /v1/auth/.well-known/jwks.json*
26
+ * @summary Get JSON Web Key Set for environment (Public)*
27
+ * @description Returns the public keys used to verify JWT tokens issued by this environment. Authenticate using either x-api-key header (secretKey) or x-blimu-publishable-key header (publishableKey).*/
28
+ getJwks(init) {
29
+ return this.core.request({
30
+ method: "GET",
31
+ path: `/v1/auth/.well-known/jwks.json`,
32
+ ...init ?? {}
33
+ });
34
+ }
35
+ /**
36
+ * GET /v1/auth/.well-known/public-key.pem*
37
+ * @summary Get environment public key (PEM)*
38
+ * @description Returns the public key in PEM format for verifying JWT tokens. Authenticate with x-api-key or x-blimu-publishable-key.*/
39
+ getPublicKeyPem(init) {
40
+ return this.core.request({
41
+ method: "GET",
42
+ path: `/v1/auth/.well-known/public-key.pem`,
43
+ ...init ?? {}
44
+ });
45
+ }
46
+ /**
47
+ * GET /v1/auth/oauth/.well-known/jwks.json*
48
+ * @summary Get JSON Web Key Set for OAuth app (Public)*
49
+ * @description Returns the public key for a specific OAuth app to verify JWT tokens. This is a public endpoint following OAuth2/OIDC standards. Provide client_id to get keys for a specific OAuth app, or use authenticated endpoint for environment keys.*/
50
+ getOAuthAppJwks(query, init) {
51
+ return this.core.request({
52
+ method: "GET",
53
+ path: `/v1/auth/oauth/.well-known/jwks.json`,
54
+ query,
55
+ ...init ?? {}
56
+ });
57
+ }
58
+ };
59
+
19
60
  // src/services/bulk_resources.ts
20
61
  var BulkResourcesService = class {
21
62
  constructor(core) {
@@ -523,6 +564,7 @@ var UsersService = class {
523
564
 
524
565
  // src/client.ts
525
566
  var Blimu = class {
567
+ authJwks;
526
568
  bulkResources;
527
569
  bulkRoles;
528
570
  entitlements;
@@ -542,6 +584,7 @@ var Blimu = class {
542
584
  baseURL: options?.baseURL ?? "https://api.blimu.dev",
543
585
  ...authStrategies.length > 0 ? { authStrategies } : {}
544
586
  });
587
+ this.authJwks = new AuthJwksService(core);
545
588
  this.bulkResources = new BulkResourcesService(core);
546
589
  this.bulkRoles = new BulkRolesService(core);
547
590
  this.entitlements = new EntitlementsService(core);
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client.ts","../src/auth-strategies.ts","../src/services/bulk_resources.ts","../src/services/bulk_roles.ts","../src/services/entitlements.ts","../src/services/oauth.ts","../src/services/plans.ts","../src/services/resource_members.ts","../src/services/resources.ts","../src/services/roles.ts","../src/services/usage.ts","../src/services/users.ts"],"sourcesContent":["import { FetchClient, FetchError } from '@blimu/fetch';\nimport { type FetchClientConfig, type ApiKeyAuthStrategy } from '@blimu/fetch';\nimport { buildAuthStrategies } from './auth-strategies';\nimport { BulkResourcesService } from './services/bulk_resources';\nimport { BulkRolesService } from './services/bulk_roles';\nimport { EntitlementsService } from './services/entitlements';\nimport { OauthService } from './services/oauth';\nimport { PlansService } from './services/plans';\nimport { ResourceMembersService } from './services/resource_members';\nimport { ResourcesService } from './services/resources';\nimport { RolesService } from './services/roles';\nimport { UsageService } from './services/usage';\nimport { UsersService } from './services/users';\n\nexport type ClientOption = FetchClientConfig & {\n apiKey?: ApiKeyAuthStrategy['key'];\n};\n\nexport class Blimu {\n readonly bulkResources: BulkResourcesService;\n readonly bulkRoles: BulkRolesService;\n readonly entitlements: EntitlementsService;\n readonly oauth: OauthService;\n readonly plans: PlansService;\n readonly resourceMembers: ResourceMembersService;\n readonly resources: ResourcesService;\n readonly roles: RolesService;\n readonly usage: UsageService;\n readonly users: UsersService;\n\n constructor(options?: ClientOption) {\n const restCfg = { ...(options ?? {}) };\n delete restCfg.apiKey;\n\n const authStrategies = buildAuthStrategies(options ?? {});\n\n const core = new FetchClient({\n ...restCfg,\n baseURL: options?.baseURL ?? 'https://api.blimu.dev',\n ...(authStrategies.length > 0 ? { authStrategies } : {}),\n });\n\n this.bulkResources = new BulkResourcesService(core);\n this.bulkRoles = new BulkRolesService(core);\n this.entitlements = new EntitlementsService(core);\n this.oauth = new OauthService(core);\n this.plans = new PlansService(core);\n this.resourceMembers = new ResourceMembersService(core);\n this.resources = new ResourcesService(core);\n this.roles = new RolesService(core);\n this.usage = new UsageService(core);\n this.users = new UsersService(core);\n }\n}\n\n// Re-export FetchError for backward compatibility\nexport { FetchError };\nexport const BlimuError = FetchError;\n","import type { AuthStrategy } from '@blimu/fetch';\nimport type { ClientOption } from './client';\n\nexport function buildAuthStrategies(cfg: ClientOption): AuthStrategy[] {\n const authStrategies: AuthStrategy[] = [...(cfg?.authStrategies ?? [])];\n\n if (cfg.apiKey) {\n authStrategies.push({\n type: 'apiKey',\n key: cfg.apiKey,\n location: 'header',\n name: 'X-API-KEY',\n });\n }\n return authStrategies;\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class BulkResourcesService {\n constructor(private core: FetchClient) {}\n\n /**\n * POST /v1/resources/{resourceType}/bulk*\n * @summary Bulk create resources*\n * @description Creates multiple resources of the specified type in a single request. This operation supports partial success - some resources may be created while others fail. The response includes details about successful creations and any errors encountered. Resources can have parent relationships and initial role assignments.*/\n create(\n resourceType: ResourceType,\n body: Schema.ResourceBulkCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceBulkResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/bulk`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class BulkRolesService {\n constructor(private core: FetchClient) {}\n\n /**\n * POST /v1/users/roles/bulk*\n * @summary Bulk create roles*\n * @description Assigns multiple roles to users on resources in a single request. This operation supports partial success - some role assignments may succeed while others fail. The response includes details about successful assignments and any errors encountered. All roles must be valid according to your resource definitions.*/\n create(\n body: Schema.RoleBulkCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.RoleBulkResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users/roles/bulk`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class EntitlementsService {\n constructor(private core: FetchClient) {}\n\n /**\n * POST /v1/entitlements/check*\n * @summary Check if a user has a specific entitlement on a resource*\n * @description Checks whether a user has permission to perform a specific action (entitlement) on a resource. This endpoint evaluates role-based access, plan gating, and usage limits. The response includes detailed information about why access was granted or denied, including which roles were checked, plan requirements, and usage limit status.*/\n checkEntitlement(\n body: Schema.EntitlementCheckBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementCheckResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/entitlements/check`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/entitlements/list-for-resource/{resourceType}/{resourceId}*\n * @summary List entitlements for a specific resource*\n * @description Returns entitlements for a specific resource and user. Only evaluates roles and plans (excludes limits). Provides detailed information about why entitlements are allowed or denied, including current roles, allowed roles, current plan, and allowed plans. Results are cached per resource for performance.*/\n listForResource(\n resourceType: ResourceType,\n resourceId: string,\n query?: Schema.EntitlementsListForResourceQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementsListResult> {\n return this.core.request({\n method: 'GET',\n path: `/v1/entitlements/list-for-resource/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/entitlements/list-for-tenant/{tenantResourceId}*\n * @summary List entitlements for a tenant and all its sub-resources*\n * @description Returns entitlements for a tenant resource and all its descendant resources. This endpoint scopes queries to a single tenant, preventing cross-tenant data access. Only evaluates roles and plans (excludes limits). Results are cached per resource for performance. The tenant resource type is automatically determined from the environment definition (resource marked as `is_tenant: true`).*/\n listForTenant(\n tenantResourceId: string,\n query?: Schema.EntitlementsListForTenantQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementsListResult> {\n return this.core.request({\n method: 'GET',\n path: `/v1/entitlements/list-for-tenant/${encodeURIComponent(tenantResourceId)}`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class OauthService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/oauth/authorize*\n * @summary Check consent requirement*\n * @description Checks if user consent is required for the OAuth2 app and requested scopes.*/\n checkConsentRequired(\n query?: Schema.OauthCheckConsentRequiredQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ConsentCheckResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/oauth/authorize`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/authorize*\n * @summary Authorize OAuth2 application*\n * @description Handles user consent approval/denial. Validates auto_approved flag against consent requirements.*/\n authorize(\n body: Schema.AuthorizeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/authorize`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/authorize*\n * @summary Authorize or deny device code*\n * @description Allows an authenticated user to authorize or deny a device code request. Requires valid user session.*/\n authorizeDeviceCode(\n body: Schema.DeviceAuthorizeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceAuthorizeResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/authorize`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/code*\n * @summary Request device authorization codes*\n * @description Initiates device authorization flow. Returns device_code (for polling) and user_code (for user entry).*/\n requestDeviceCode(\n body: Schema.DeviceCodeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceCodeResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/code`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/oauth/device/code/{user_code}*\n * @summary Get device code information*\n * @description Returns device code information including app name, scopes, and consent requirement status.*/\n getDeviceCodeInfo(\n user_code: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceCodeInfoResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/oauth/device/code/${encodeURIComponent(user_code)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/token*\n * @summary Poll for device authorization tokens*\n * @description Client polls this endpoint to exchange device_code for tokens once user has authorized.*/\n exchangeDeviceCode(\n body: Schema.DeviceTokenRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TokenResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/token`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/introspect*\n * @summary Introspect token*\n * @description Validates a token and returns metadata. Requires client authentication.*/\n introspect(\n body: Schema.IntrospectionRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.IntrospectionResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/introspect`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/revoke*\n * @summary Revoke token*\n * @description Revokes an access or refresh token. Requires client authentication.*/\n revoke(\n body: Schema.RevocationRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/revoke`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/token*\n * @summary Token endpoint*\n * @description Issues access and refresh tokens. Supports authorization_code and refresh_token (always available per OAuth2 spec).*/\n token(\n body: Schema.TokenRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TokenResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/token`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class PlansService {\n constructor(private core: FetchClient) {}\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Remove plan assignment from a tenant resource*\n * @description Removes the billing plan assignment from a tenant resource. After removal, the resource will have no plan and will be subject to default limits.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanDeleteResponse> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Get the plan assigned to a tenant resource*\n * @description Retrieves the billing plan currently assigned to a tenant resource, if any.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Assign a plan to a tenant resource*\n * @description Assigns a billing plan to a tenant resource. Plans control feature access and usage limits based on your plan definitions. The resource must be marked as a tenant in your resource definitions.*/\n assign(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.PlanAssignBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class ResourceMembersService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/members*\n * @summary List members for a resource*\n * @description Retrieves a paginated list of users who have roles (direct or inherited) on the specified resource. Supports search functionality to filter users by email or name.*/\n list(\n resourceType: ResourceType,\n resourceId: string,\n query?: Schema.ResourceMembersListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceMemberList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/members`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class ResourcesService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/resources/{resourceType}*\n * @summary List resources*\n * @description Retrieves a paginated list of resources of the specified type. Supports search and filtering. Resources are returned with their parent relationships and metadata.*/\n list(\n resourceType: ResourceType,\n query?: Schema.ResourcesListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}*\n * @summary Create a resource*\n * @description Creates a new resource of the specified type. Resources can have parent relationships to form hierarchies. You can optionally assign initial roles to users when creating the resource. Parent resources must already exist.*/\n create(\n resourceType: ResourceType,\n body: Schema.ResourceCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Resource> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}*\n * @summary Delete a resource*\n * @description Deletes a resource by its type and ID. This operation is permanent and cannot be undone. Deleting a resource may affect child resources that depend on it.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}*\n * @summary Read a resource*\n * @description Retrieves a single resource by its type and ID. Returns the resource with its parent relationships and metadata.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Resource> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * PUT /v1/resources/{resourceType}/{resourceId}*\n * @summary Update a resource*\n * @description Updates an existing resource. You can update the resource name and modify parent relationships. Parent resources must already exist.*/\n update(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.ResourceUpdateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'PUT',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class RolesService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/users/{userId}/roles*\n * @summary List user roles*\n * @description Retrieves a paginated list of roles assigned to a user. Supports filtering by resource type, resource ID, and role name. Returns both directly assigned roles and inherited roles.*/\n list(\n userId: string,\n query?: Schema.RolesListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.RoleList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}/roles`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/users/{userId}/roles*\n * @summary Create a role (assign role to user on resource)*\n * @description Assigns a role to a user on a specific resource. The role must be defined in your resource definitions for the specified resource type. Roles can be inherited from parent resources based on your resource configuration.*/\n create(\n userId: string,\n body: Schema.RoleCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Role> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users/${encodeURIComponent(userId)}/roles`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/users/{userId}/roles/{resourceType}/{resourceId}*\n * @summary Delete a role*\n * @description Removes a role assignment from a user on a specific resource. This only removes the direct role assignment and does not affect inherited roles from parent resources.*/\n delete(\n userId: string,\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/users/${encodeURIComponent(userId)}/roles/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class UsageService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/usage/balance/{resourceType}/{resourceId}/{limitType}*\n * @summary Get wallet balance*\n * @description Retrieves the current balance of a usage wallet for a specific resource and limit type within a given time period. The balance reflects all credits and consumption transactions.*/\n getBalance(\n resourceType: string,\n resourceId: string,\n limitType: string,\n query?: Schema.UsageGetBalanceQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.BalanceResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/usage/balance/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/check*\n * @summary Check if consumption is allowed*\n * @description Checks whether a specific amount of consumption is allowed for a resource and limit type within a given time period. Returns the current balance, requested amount, and remaining balance after the consumption.*/\n checkLimit(\n body: Schema.UsageCheckBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.CheckLimitResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/check`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/consume*\n * @summary Record consumption (inserts negative amount)*\n * @description Records consumption from a usage wallet for a specific resource and limit type. This decreases the available balance. Consumption can be tagged for tracking purposes.*/\n consume(\n body: Schema.UsageConsumeBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UsageWalletResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/consume`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/credit*\n * @summary Add credits to wallet (inserts positive amount)*\n * @description Adds credits to a usage wallet for a specific resource and limit type. This increases the available balance for usage-based limits. Credits can be tagged for tracking purposes.*/\n credit(\n body: Schema.UsageCreditBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UsageWalletResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/credit`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/usage/transactions/{resourceType}/{resourceId}/{limitType}*\n * @summary Get transaction history*\n * @description Retrieves the transaction history for a usage wallet, including all credits and consumption records. Supports filtering by time period and date range.*/\n getTransactionHistory(\n resourceType: string,\n resourceId: string,\n limitType: string,\n query?: Schema.UsageGetTransactionHistoryQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TransactionHistoryResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/usage/transactions/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class UsersService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/users*\n * @summary List users*\n * @description Retrieves a paginated list of users in your environment. Supports search functionality to filter users by email, name, or lookup key.*/\n list(\n query?: Schema.UsersListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UserList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/users*\n * @summary Create a user*\n * @description Creates a new user in your environment. The lookupKey is a unique identifier that you can use to reference the user in your system. It should be stable and not change over time.*/\n create(\n body: Schema.UserCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.User> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/users/{userId}*\n * @summary Delete a user*\n * @description Deletes a user by their ID or lookup key. This operation is permanent and cannot be undone. Deleting a user will also remove all role assignments for that user.*/\n delete(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/users/{userId}*\n * @summary Get a user by ID*\n * @description Retrieves a single user by their ID or lookup key. Returns user information including email, name, and metadata.*/\n read(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.User> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * PUT /v1/users/{userId}*\n * @summary Update a user*\n * @description Updates an existing user. You can modify email, name, and other user properties. The lookupKey can be updated but should remain stable.*/\n update(\n userId: string,\n body: Schema.UserUpdateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.User> {\n return this.core.request({\n method: 'PUT',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/users/{userId}/effective-user-resources-roles*\n * @summary List effective user resources roles*\n * @description Retrieves all resources and roles for a user, including inherited roles from parent resources. The response indicates whether each role is directly assigned or inherited through resource hierarchies.*/\n listEffectiveUserResourcesRoles(\n userId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UserResourceList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}/effective-user-resources-roles`,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";AAAA,SAAS,aAAa,kBAAkB;AACxC,OAAgE;;;ACEzD,SAAS,oBAAoB,KAAmC;AACrE,QAAM,iBAAiC,CAAC,GAAI,KAAK,kBAAkB,CAAC,CAAE;AAEtE,MAAI,IAAI,QAAQ;AACd,mBAAe,KAAK;AAAA,MAClB,MAAM;AAAA,MACN,KAAK,IAAI;AAAA,MACT,UAAU;AAAA,MACV,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AACA,SAAO;AACT;;;ACXO,IAAM,uBAAN,MAA2B;AAAA,EAChC,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,OACE,cACA,MACA,MACoC;AACpC,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM,iBAAiB,mBAAmB,YAAY,CAAC;AAAA,MACvD;AAAA,MACA,GAAI,QAAQ,CAAC;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,MAAY;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,SAAwB;AAClC,UAAM,UAAU,EAAE,GAAI,WAAW,CAAC,EAAG;AACrC,WAAO,QAAQ;AAEf,UAAM,iBAAiB,oBAAoB,WAAW,CAAC,CAAC;AAExD,UAAM,OAAO,IAAI,YAAY;AAAA,MAC3B,GAAG;AAAA,MACH,SAAS,SAAS,WAAW;AAAA,MAC7B,GAAI,eAAe,SAAS,IAAI,EAAE,eAAe,IAAI,CAAC;AAAA,IACxD,CAAC;AAED,SAAK,gBAAgB,IAAI,qBAAqB,IAAI;AAClD,SAAK,YAAY,IAAI,iBAAiB,IAAI;AAC1C,SAAK,eAAe,IAAI,oBAAoB,IAAI;AAChD,SAAK,QAAQ,IAAI,aAAa,IAAI;AAClC,SAAK,QAAQ,IAAI,aAAa,IAAI;AAClC,SAAK,kBAAkB,IAAI,uBAAuB,IAAI;AACtD,SAAK,YAAY,IAAI,iBAAiB,IAAI;AAC1C,SAAK,QAAQ,IAAI,aAAa,IAAI;AAClC,SAAK,QAAQ,IAAI,aAAa,IAAI;AAClC,SAAK,QAAQ,IAAI,aAAa,IAAI;AAAA,EACpC;AACF;AAIO,IAAM,aAAa;","names":[]}
1
+ {"version":3,"sources":["../src/client.ts","../src/auth-strategies.ts","../src/services/auth_jwks.ts","../src/services/bulk_resources.ts","../src/services/bulk_roles.ts","../src/services/entitlements.ts","../src/services/oauth.ts","../src/services/plans.ts","../src/services/resource_members.ts","../src/services/resources.ts","../src/services/roles.ts","../src/services/usage.ts","../src/services/users.ts"],"sourcesContent":["import { FetchClient, FetchError } from '@blimu/fetch';\nimport { type FetchClientConfig, type ApiKeyAuthStrategy } from '@blimu/fetch';\nimport { buildAuthStrategies } from './auth-strategies';\nimport { AuthJwksService } from './services/auth_jwks';\nimport { BulkResourcesService } from './services/bulk_resources';\nimport { BulkRolesService } from './services/bulk_roles';\nimport { EntitlementsService } from './services/entitlements';\nimport { OauthService } from './services/oauth';\nimport { PlansService } from './services/plans';\nimport { ResourceMembersService } from './services/resource_members';\nimport { ResourcesService } from './services/resources';\nimport { RolesService } from './services/roles';\nimport { UsageService } from './services/usage';\nimport { UsersService } from './services/users';\n\nexport type ClientOption = FetchClientConfig & {\n apiKey?: ApiKeyAuthStrategy['key'];\n};\n\nexport class Blimu {\n readonly authJwks: AuthJwksService;\n readonly bulkResources: BulkResourcesService;\n readonly bulkRoles: BulkRolesService;\n readonly entitlements: EntitlementsService;\n readonly oauth: OauthService;\n readonly plans: PlansService;\n readonly resourceMembers: ResourceMembersService;\n readonly resources: ResourcesService;\n readonly roles: RolesService;\n readonly usage: UsageService;\n readonly users: UsersService;\n\n constructor(options?: ClientOption) {\n const restCfg = { ...(options ?? {}) };\n delete restCfg.apiKey;\n\n const authStrategies = buildAuthStrategies(options ?? {});\n\n const core = new FetchClient({\n ...restCfg,\n baseURL: options?.baseURL ?? 'https://api.blimu.dev',\n ...(authStrategies.length > 0 ? { authStrategies } : {}),\n });\n\n this.authJwks = new AuthJwksService(core);\n this.bulkResources = new BulkResourcesService(core);\n this.bulkRoles = new BulkRolesService(core);\n this.entitlements = new EntitlementsService(core);\n this.oauth = new OauthService(core);\n this.plans = new PlansService(core);\n this.resourceMembers = new ResourceMembersService(core);\n this.resources = new ResourcesService(core);\n this.roles = new RolesService(core);\n this.usage = new UsageService(core);\n this.users = new UsersService(core);\n }\n}\n\n// Re-export FetchError for backward compatibility\nexport { FetchError };\nexport const BlimuError = FetchError;\n","import type { AuthStrategy } from '@blimu/fetch';\nimport type { ClientOption } from './client';\n\nexport function buildAuthStrategies(cfg: ClientOption): AuthStrategy[] {\n const authStrategies: AuthStrategy[] = [...(cfg?.authStrategies ?? [])];\n\n if (cfg.apiKey) {\n authStrategies.push({\n type: 'apiKey',\n key: cfg.apiKey,\n location: 'header',\n name: 'X-API-KEY',\n });\n }\n return authStrategies;\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class AuthJwksService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/auth/.well-known/jwks.json*\n * @summary Get JSON Web Key Set for environment (Public)*\n * @description Returns the public keys used to verify JWT tokens issued by this environment. Authenticate using either x-api-key header (secretKey) or x-blimu-publishable-key header (publishableKey).*/\n getJwks(init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.JWK> {\n return this.core.request({\n method: 'GET',\n path: `/v1/auth/.well-known/jwks.json`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/auth/.well-known/public-key.pem*\n * @summary Get environment public key (PEM)*\n * @description Returns the public key in PEM format for verifying JWT tokens. Authenticate with x-api-key or x-blimu-publishable-key.*/\n getPublicKeyPem(init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown> {\n return this.core.request({\n method: 'GET',\n path: `/v1/auth/.well-known/public-key.pem`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/auth/oauth/.well-known/jwks.json*\n * @summary Get JSON Web Key Set for OAuth app (Public)*\n * @description Returns the public key for a specific OAuth app to verify JWT tokens. This is a public endpoint following OAuth2/OIDC standards. Provide client_id to get keys for a specific OAuth app, or use authenticated endpoint for environment keys.*/\n getOAuthAppJwks(\n query?: Schema.AuthJwksGetOAuthAppJwksQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.JWK> {\n return this.core.request({\n method: 'GET',\n path: `/v1/auth/oauth/.well-known/jwks.json`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class BulkResourcesService {\n constructor(private core: FetchClient) {}\n\n /**\n * POST /v1/resources/{resourceType}/bulk*\n * @summary Bulk create resources*\n * @description Creates multiple resources of the specified type in a single request. This operation supports partial success - some resources may be created while others fail. The response includes details about successful creations and any errors encountered. Resources can have parent relationships and initial role assignments.*/\n create(\n resourceType: ResourceType,\n body: Schema.ResourceBulkCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceBulkResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/bulk`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class BulkRolesService {\n constructor(private core: FetchClient) {}\n\n /**\n * POST /v1/users/roles/bulk*\n * @summary Bulk create roles*\n * @description Assigns multiple roles to users on resources in a single request. This operation supports partial success - some role assignments may succeed while others fail. The response includes details about successful assignments and any errors encountered. All roles must be valid according to your resource definitions.*/\n create(\n body: Schema.RoleBulkCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.RoleBulkResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users/roles/bulk`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class EntitlementsService {\n constructor(private core: FetchClient) {}\n\n /**\n * POST /v1/entitlements/check*\n * @summary Check if a user has a specific entitlement on a resource*\n * @description Checks whether a user has permission to perform a specific action (entitlement) on a resource. This endpoint evaluates role-based access, plan gating, and usage limits. The response includes detailed information about why access was granted or denied, including which roles were checked, plan requirements, and usage limit status.*/\n checkEntitlement(\n body: Schema.EntitlementCheckBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementCheckResult> {\n return this.core.request({\n method: 'POST',\n path: `/v1/entitlements/check`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/entitlements/list-for-resource/{resourceType}/{resourceId}*\n * @summary List entitlements for a specific resource*\n * @description Returns entitlements for a specific resource and user. Only evaluates roles and plans (excludes limits). Provides detailed information about why entitlements are allowed or denied, including current roles, allowed roles, current plan, and allowed plans. Results are cached per resource for performance.*/\n listForResource(\n resourceType: ResourceType,\n resourceId: string,\n query?: Schema.EntitlementsListForResourceQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementsListResult> {\n return this.core.request({\n method: 'GET',\n path: `/v1/entitlements/list-for-resource/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/entitlements/list-for-tenant/{tenantResourceId}*\n * @summary List entitlements for a tenant and all its sub-resources*\n * @description Returns entitlements for a tenant resource and all its descendant resources. This endpoint scopes queries to a single tenant, preventing cross-tenant data access. Only evaluates roles and plans (excludes limits). Results are cached per resource for performance. The tenant resource type is automatically determined from the environment definition (resource marked as `is_tenant: true`).*/\n listForTenant(\n tenantResourceId: string,\n query?: Schema.EntitlementsListForTenantQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.EntitlementsListResult> {\n return this.core.request({\n method: 'GET',\n path: `/v1/entitlements/list-for-tenant/${encodeURIComponent(tenantResourceId)}`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class OauthService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/oauth/authorize*\n * @summary Check consent requirement*\n * @description Checks if user consent is required for the OAuth2 app and requested scopes.*/\n checkConsentRequired(\n query?: Schema.OauthCheckConsentRequiredQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ConsentCheckResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/oauth/authorize`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/authorize*\n * @summary Authorize OAuth2 application*\n * @description Handles user consent approval/denial. Validates auto_approved flag against consent requirements.*/\n authorize(\n body: Schema.AuthorizeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/authorize`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/authorize*\n * @summary Authorize or deny device code*\n * @description Allows an authenticated user to authorize or deny a device code request. Requires valid user session.*/\n authorizeDeviceCode(\n body: Schema.DeviceAuthorizeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceAuthorizeResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/authorize`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/code*\n * @summary Request device authorization codes*\n * @description Initiates device authorization flow. Returns device_code (for polling) and user_code (for user entry).*/\n requestDeviceCode(\n body: Schema.DeviceCodeRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceCodeResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/code`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/oauth/device/code/{user_code}*\n * @summary Get device code information*\n * @description Returns device code information including app name, scopes, and consent requirement status.*/\n getDeviceCodeInfo(\n user_code: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.DeviceCodeInfoResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/oauth/device/code/${encodeURIComponent(user_code)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/device/token*\n * @summary Poll for device authorization tokens*\n * @description Client polls this endpoint to exchange device_code for tokens once user has authorized.*/\n exchangeDeviceCode(\n body: Schema.DeviceTokenRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TokenResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/device/token`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/introspect*\n * @summary Introspect token*\n * @description Validates a token and returns metadata. Requires client authentication.*/\n introspect(\n body: Schema.IntrospectionRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.IntrospectionResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/introspect`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/revoke*\n * @summary Revoke token*\n * @description Revokes an access or refresh token. Requires client authentication.*/\n revoke(\n body: Schema.RevocationRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/revoke`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/oauth/token*\n * @summary Token endpoint*\n * @description Issues access and refresh tokens. Supports authorization_code and refresh_token (always available per OAuth2 spec).*/\n token(\n body: Schema.TokenRequest,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TokenResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/oauth/token`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class PlansService {\n constructor(private core: FetchClient) {}\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Remove plan assignment from a tenant resource*\n * @description Removes the billing plan assignment from a tenant resource. After removal, the resource will have no plan and will be subject to default limits.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanDeleteResponse> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Get the plan assigned to a tenant resource*\n * @description Retrieves the billing plan currently assigned to a tenant resource, if any.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.PlanResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}/{resourceId}/plan*\n * @summary Assign a plan to a tenant resource*\n * @description Assigns a billing plan to a tenant resource. Plans control feature access and usage limits based on your plan definitions. The resource must be marked as a tenant in your resource definitions.*/\n assign(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.PlanAssignBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/plan`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class ResourceMembersService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}/members*\n * @summary List members for a resource*\n * @description Retrieves a paginated list of users who have roles (direct or inherited) on the specified resource. Supports search functionality to filter users by email or name.*/\n list(\n resourceType: ResourceType,\n resourceId: string,\n query?: Schema.ResourceMembersListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceMemberList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/members`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class ResourcesService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/resources/{resourceType}*\n * @summary List resources*\n * @description Retrieves a paginated list of resources of the specified type. Supports search and filtering. Resources are returned with their parent relationships and metadata.*/\n list(\n resourceType: ResourceType,\n query?: Schema.ResourcesListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.ResourceList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/resources/{resourceType}*\n * @summary Create a resource*\n * @description Creates a new resource of the specified type. Resources can have parent relationships to form hierarchies. You can optionally assign initial roles to users when creating the resource. Parent resources must already exist.*/\n create(\n resourceType: ResourceType,\n body: Schema.ResourceCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Resource> {\n return this.core.request({\n method: 'POST',\n path: `/v1/resources/${encodeURIComponent(resourceType)}`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/resources/{resourceType}/{resourceId}*\n * @summary Delete a resource*\n * @description Deletes a resource by its type and ID. This operation is permanent and cannot be undone. Deleting a resource may affect child resources that depend on it.*/\n delete(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/resources/{resourceType}/{resourceId}*\n * @summary Read a resource*\n * @description Retrieves a single resource by its type and ID. Returns the resource with its parent relationships and metadata.*/\n read(\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Resource> {\n return this.core.request({\n method: 'GET',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * PUT /v1/resources/{resourceType}/{resourceId}*\n * @summary Update a resource*\n * @description Updates an existing resource. You can update the resource name and modify parent relationships. Parent resources must already exist.*/\n update(\n resourceType: ResourceType,\n resourceId: string,\n body: Schema.ResourceUpdateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'PUT',\n path: `/v1/resources/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n body,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\nimport type { ResourceType } from '@blimu/types';\n\nexport class RolesService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/users/{userId}/roles*\n * @summary List user roles*\n * @description Retrieves a paginated list of roles assigned to a user. Supports filtering by resource type, resource ID, and role name. Returns both directly assigned roles and inherited roles.*/\n list(\n userId: string,\n query?: Schema.RolesListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.RoleList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}/roles`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/users/{userId}/roles*\n * @summary Create a role (assign role to user on resource)*\n * @description Assigns a role to a user on a specific resource. The role must be defined in your resource definitions for the specified resource type. Roles can be inherited from parent resources based on your resource configuration.*/\n create(\n userId: string,\n body: Schema.RoleCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.Role> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users/${encodeURIComponent(userId)}/roles`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/users/{userId}/roles/{resourceType}/{resourceId}*\n * @summary Delete a role*\n * @description Removes a role assignment from a user on a specific resource. This only removes the direct role assignment and does not affect inherited roles from parent resources.*/\n delete(\n userId: string,\n resourceType: ResourceType,\n resourceId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/users/${encodeURIComponent(userId)}/roles/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}`,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class UsageService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/usage/balance/{resourceType}/{resourceId}/{limitType}*\n * @summary Get wallet balance*\n * @description Retrieves the current balance of a usage wallet for a specific resource and limit type within a given time period. The balance reflects all credits and consumption transactions.*/\n getBalance(\n resourceType: string,\n resourceId: string,\n limitType: string,\n query?: Schema.UsageGetBalanceQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.BalanceResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/usage/balance/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/check*\n * @summary Check if consumption is allowed*\n * @description Checks whether a specific amount of consumption is allowed for a resource and limit type within a given time period. Returns the current balance, requested amount, and remaining balance after the consumption.*/\n checkLimit(\n body: Schema.UsageCheckBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.CheckLimitResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/check`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/consume*\n * @summary Record consumption (inserts negative amount)*\n * @description Records consumption from a usage wallet for a specific resource and limit type. This decreases the available balance. Consumption can be tagged for tracking purposes.*/\n consume(\n body: Schema.UsageConsumeBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UsageWalletResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/consume`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/usage/credit*\n * @summary Add credits to wallet (inserts positive amount)*\n * @description Adds credits to a usage wallet for a specific resource and limit type. This increases the available balance for usage-based limits. Credits can be tagged for tracking purposes.*/\n credit(\n body: Schema.UsageCreditBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UsageWalletResponse> {\n return this.core.request({\n method: 'POST',\n path: `/v1/usage/credit`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/usage/transactions/{resourceType}/{resourceId}/{limitType}*\n * @summary Get transaction history*\n * @description Retrieves the transaction history for a usage wallet, including all credits and consumption records. Supports filtering by time period and date range.*/\n getTransactionHistory(\n resourceType: string,\n resourceId: string,\n limitType: string,\n query?: Schema.UsageGetTransactionHistoryQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.TransactionHistoryResponse> {\n return this.core.request({\n method: 'GET',\n path: `/v1/usage/transactions/${encodeURIComponent(resourceType)}/${encodeURIComponent(resourceId)}/${encodeURIComponent(limitType)}`,\n query,\n ...(init ?? {}),\n });\n }\n}\n","import type { FetchClient } from '@blimu/fetch';\nimport type * as Schema from '../schema';\n\nexport class UsersService {\n constructor(private core: FetchClient) {}\n\n /**\n * GET /v1/users*\n * @summary List users*\n * @description Retrieves a paginated list of users in your environment. Supports search functionality to filter users by email, name, or lookup key.*/\n list(\n query?: Schema.UsersListQuery,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UserList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users`,\n query,\n ...(init ?? {}),\n });\n }\n\n /**\n * POST /v1/users*\n * @summary Create a user*\n * @description Creates a new user in your environment. The lookupKey is a unique identifier that you can use to reference the user in your system. It should be stable and not change over time.*/\n create(\n body: Schema.UserCreateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.User> {\n return this.core.request({\n method: 'POST',\n path: `/v1/users`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * DELETE /v1/users/{userId}*\n * @summary Delete a user*\n * @description Deletes a user by their ID or lookup key. This operation is permanent and cannot be undone. Deleting a user will also remove all role assignments for that user.*/\n delete(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<unknown> {\n return this.core.request({\n method: 'DELETE',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/users/{userId}*\n * @summary Get a user by ID*\n * @description Retrieves a single user by their ID or lookup key. Returns user information including email, name, and metadata.*/\n read(userId: string, init?: Omit<RequestInit, 'method' | 'body'>): Promise<Schema.User> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n ...(init ?? {}),\n });\n }\n\n /**\n * PUT /v1/users/{userId}*\n * @summary Update a user*\n * @description Updates an existing user. You can modify email, name, and other user properties. The lookupKey can be updated but should remain stable.*/\n update(\n userId: string,\n body: Schema.UserUpdateBody,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.User> {\n return this.core.request({\n method: 'PUT',\n path: `/v1/users/${encodeURIComponent(userId)}`,\n body,\n ...(init ?? {}),\n });\n }\n\n /**\n * GET /v1/users/{userId}/effective-user-resources-roles*\n * @summary List effective user resources roles*\n * @description Retrieves all resources and roles for a user, including inherited roles from parent resources. The response indicates whether each role is directly assigned or inherited through resource hierarchies.*/\n listEffectiveUserResourcesRoles(\n userId: string,\n init?: Omit<RequestInit, 'method' | 'body'>\n ): Promise<Schema.UserResourceList> {\n return this.core.request({\n method: 'GET',\n path: `/v1/users/${encodeURIComponent(userId)}/effective-user-resources-roles`,\n ...(init ?? {}),\n });\n }\n}\n"],"mappings":";AAAA,SAAS,aAAa,kBAAkB;AACxC,OAAgE;;;ACEzD,SAAS,oBAAoB,KAAmC;AACrE,QAAM,iBAAiC,CAAC,GAAI,KAAK,kBAAkB,CAAC,CAAE;AAEtE,MAAI,IAAI,QAAQ;AACd,mBAAe,KAAK;AAAA,MAClB,MAAM;AAAA,MACN,KAAK,IAAI;AAAA,MACT,UAAU;AAAA,MACV,MAAM;AAAA,IACR,CAAC;AAAA,EACH;AACA,SAAO;AACT;;;ACZO,IAAM,kBAAN,MAAsB;AAAA,EAC3B,YAAoB,MAAmB;AAAnB;AAAA,EAAoB;AAAA;AAAA;AAAA;AAAA;AAAA,EAMxC,QAAQ,MAAkE;AACxE,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,GAAI,QAAQ,CAAC;AAAA,IACf,CAAC;AAAA,EACH;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAgB,MAA+D;AAC7E,WAAO,KAAK,KAAK,QAAQ;AAAA,MACvB,QAAQ;AAA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