@omnibase/core-js 0.7.0 → 0.7.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.
@@ -1,5 +1,4 @@
1
- import { PermissionsClient } from '../permissions/index.cjs';
2
- import '@ory/client';
1
+ import { RelationshipApi, PermissionApi } from '@ory/client';
3
2
 
4
3
  /**
5
4
  * Base API Response structure for all operations
@@ -1016,6 +1015,607 @@ declare class PaymentHandler {
1016
1015
  readonly usage: UsageManager;
1017
1016
  }
1018
1017
 
1018
+ /**
1019
+ * Types for the Permissions and Roles API
1020
+ *
1021
+ * This module defines TypeScript types for interacting with the Omnibase
1022
+ * permissions system, including both Ory Keto relationships and the
1023
+ * role-based access control (RBAC) system.
1024
+ *
1025
+ * @module Permissions Types
1026
+ * @since 0.7.0
1027
+ */
1028
+ /**
1029
+ * Namespace definition from the database
1030
+ *
1031
+ * Represents a permission namespace (e.g., Tenant, Project) and its
1032
+ * available relations/permissions. Used for building role configuration UIs.
1033
+ *
1034
+ * @example
1035
+ * ```typescript
1036
+ * {
1037
+ * id: 'uuid-123',
1038
+ * namespace: 'Tenant',
1039
+ * relations: ['invite_user', 'delete_tenant', 'manage_billing'],
1040
+ * created_at: '2024-01-01T00:00:00Z',
1041
+ * updated_at: '2024-01-01T00:00:00Z'
1042
+ * }
1043
+ * ```
1044
+ *
1045
+ * @since 0.7.0
1046
+ * @public
1047
+ */
1048
+ interface NamespaceDefinition {
1049
+ /**
1050
+ * Unique identifier for the namespace definition
1051
+ */
1052
+ id: string;
1053
+ /**
1054
+ * Name of the namespace (e.g., 'Tenant', 'Project')
1055
+ */
1056
+ namespace: string;
1057
+ /**
1058
+ * Available relations/permissions for this namespace
1059
+ * @example ['invite_user', 'delete_tenant', 'manage_billing']
1060
+ */
1061
+ relations: string[];
1062
+ /**
1063
+ * Timestamp when the namespace definition was created
1064
+ */
1065
+ created_at: string;
1066
+ /**
1067
+ * Timestamp when the namespace definition was last updated
1068
+ */
1069
+ updated_at: string;
1070
+ }
1071
+ /**
1072
+ * Role model representing a collection of permissions
1073
+ *
1074
+ * Roles can be system-wide (tenant_id = null) or tenant-specific.
1075
+ * System roles are defined in roles.config.json and apply to all tenants.
1076
+ * Custom roles are created via the API and are specific to a tenant.
1077
+ *
1078
+ * @example
1079
+ * System role:
1080
+ * ```typescript
1081
+ * {
1082
+ * id: 'role_123',
1083
+ * tenant_id: null,
1084
+ * role_name: 'admin',
1085
+ * permissions: ['tenant#delete_all_projects', 'tenant#manage_billing'],
1086
+ * user_ids: ['user_456', 'user_789'],
1087
+ * created_at: '2024-01-01T00:00:00Z',
1088
+ * updated_at: '2024-01-01T00:00:00Z'
1089
+ * }
1090
+ * ```
1091
+ *
1092
+ * @example
1093
+ * Custom tenant role:
1094
+ * ```typescript
1095
+ * {
1096
+ * id: 'role_456',
1097
+ * tenant_id: 'tenant_123',
1098
+ * role_name: 'billing_manager',
1099
+ * permissions: ['tenant#manage_billing', 'tenant#view_invoices'],
1100
+ * user_ids: ['user_999'],
1101
+ * created_at: '2024-01-01T00:00:00Z',
1102
+ * updated_at: '2024-01-01T00:00:00Z'
1103
+ * }
1104
+ * ```
1105
+ *
1106
+ * @since 0.7.0
1107
+ * @public
1108
+ */
1109
+ interface Role {
1110
+ /**
1111
+ * Unique identifier for the role
1112
+ */
1113
+ id: string;
1114
+ /**
1115
+ * Tenant ID this role belongs to, or null for system roles
1116
+ *
1117
+ * - `null`: System role (applies to all tenants)
1118
+ * - `string`: Tenant-specific custom role
1119
+ */
1120
+ tenant_id: string | null;
1121
+ /**
1122
+ * Human-readable name for the role
1123
+ * @example 'admin', 'billing_manager', 'developer'
1124
+ */
1125
+ role_name: string;
1126
+ /**
1127
+ * Array of permission strings in format: namespace#relation or namespace:id#relation
1128
+ *
1129
+ * @example
1130
+ * Tenant-wide permissions:
1131
+ * - 'tenant#invite_user'
1132
+ * - 'tenant#delete_all_projects'
1133
+ *
1134
+ * Resource-specific permissions:
1135
+ * - 'project:proj_abc123#deploy'
1136
+ * - 'project:proj_abc123#view_logs'
1137
+ */
1138
+ permissions: string[];
1139
+ /**
1140
+ * Array of user IDs assigned to this role
1141
+ *
1142
+ * When a user is assigned to a role, their ID is added here and
1143
+ * corresponding Keto relationship tuples are created for each permission.
1144
+ */
1145
+ user_ids: string[];
1146
+ /**
1147
+ * Timestamp when the role was created
1148
+ */
1149
+ created_at: string;
1150
+ /**
1151
+ * Timestamp when the role was last updated
1152
+ */
1153
+ updated_at: string;
1154
+ }
1155
+ /**
1156
+ * Request body for creating a new role
1157
+ *
1158
+ * @example
1159
+ * ```typescript
1160
+ * {
1161
+ * role_name: 'billing_manager',
1162
+ * permissions: [
1163
+ * 'tenant#manage_billing',
1164
+ * 'tenant#view_invoices',
1165
+ * 'tenant#update_payment_methods'
1166
+ * ]
1167
+ * }
1168
+ * ```
1169
+ *
1170
+ * @since 0.7.0
1171
+ * @public
1172
+ */
1173
+ interface CreateRoleRequest {
1174
+ /**
1175
+ * Name for the new role
1176
+ * @example 'billing_manager', 'support_agent', 'developer'
1177
+ */
1178
+ role_name: string;
1179
+ /**
1180
+ * Array of permission strings to assign to the role
1181
+ * @example ['tenant#manage_billing', 'tenant#view_invoices']
1182
+ */
1183
+ permissions: string[];
1184
+ }
1185
+ /**
1186
+ * Request body for updating an existing role's permissions
1187
+ *
1188
+ * @example
1189
+ * ```typescript
1190
+ * {
1191
+ * permissions: [
1192
+ * 'tenant#manage_billing',
1193
+ * 'tenant#view_invoices',
1194
+ * 'tenant#manage_users' // Added new permission
1195
+ * ]
1196
+ * }
1197
+ * ```
1198
+ *
1199
+ * @since 0.7.0
1200
+ * @public
1201
+ */
1202
+ interface UpdateRoleRequest {
1203
+ /**
1204
+ * New array of permissions for the role
1205
+ *
1206
+ * This replaces all existing permissions. Old permissions are removed
1207
+ * from Keto and new ones are created for all assigned users.
1208
+ */
1209
+ permissions: string[];
1210
+ }
1211
+ /**
1212
+ * Request body for assigning a role to a user
1213
+ *
1214
+ * @example
1215
+ * ```typescript
1216
+ * {
1217
+ * role_id: 'role_456'
1218
+ * }
1219
+ * ```
1220
+ *
1221
+ * @since 0.7.0
1222
+ * @public
1223
+ */
1224
+ interface AssignRoleRequest {
1225
+ /**
1226
+ * ID of the role to assign to the user
1227
+ */
1228
+ role_id: string;
1229
+ }
1230
+
1231
+ /**
1232
+ * Handler for managing roles and role-based permissions
1233
+ *
1234
+ * Provides methods for creating custom roles, assigning permissions,
1235
+ * and managing role assignments. Works alongside the Keto-based
1236
+ * permissions system to provide dynamic RBAC capabilities.
1237
+ *
1238
+ * @example
1239
+ * ```typescript
1240
+ * // Create a custom role
1241
+ * const role = await omnibase.permissions.roles.create({
1242
+ * role_name: 'billing_manager',
1243
+ * permissions: ['tenant#manage_billing', 'tenant#view_invoices']
1244
+ * });
1245
+ *
1246
+ * // Assign role to user
1247
+ * await omnibase.permissions.roles.assign('user_123', {
1248
+ * role_id: role.id
1249
+ * });
1250
+ * ```
1251
+ *
1252
+ * @since 0.7.0
1253
+ * @public
1254
+ */
1255
+ declare class RolesHandler {
1256
+ private client;
1257
+ constructor(client: OmnibaseClient);
1258
+ /**
1259
+ * Get available namespace definitions for UI
1260
+ *
1261
+ * Returns all namespaces and their available relations/permissions.
1262
+ * Useful for building role configuration UIs.
1263
+ *
1264
+ * @returns List of namespace definitions
1265
+ *
1266
+ * @example
1267
+ * ```typescript
1268
+ * const definitions = await omnibase.permissions.roles.getDefinitions();
1269
+ *
1270
+ * // Output: [{ namespace: 'Tenant', relations: ['invite_user', 'delete_tenant', ...] }]
1271
+ * definitions.forEach(def => {
1272
+ * console.log(`${def.namespace} supports: ${def.relations.join(', ')}`);
1273
+ * });
1274
+ * ```
1275
+ */
1276
+ getDefinitions(): Promise<NamespaceDefinition[]>;
1277
+ /**
1278
+ * List all roles for the current tenant
1279
+ *
1280
+ * Returns both system roles (defined in roles.config.json) and
1281
+ * custom roles created via the API. System roles have `tenant_id = null`.
1282
+ *
1283
+ * @returns List of roles
1284
+ *
1285
+ * @example
1286
+ * ```typescript
1287
+ * const roles = await omnibase.permissions.roles.list();
1288
+ *
1289
+ * const systemRoles = roles.filter(r => r.tenant_id === null);
1290
+ * const customRoles = roles.filter(r => r.tenant_id !== null);
1291
+ *
1292
+ * console.log(`System roles: ${systemRoles.map(r => r.role_name).join(', ')}`);
1293
+ * console.log(`Custom roles: ${customRoles.map(r => r.role_name).join(', ')}`);
1294
+ * ```
1295
+ */
1296
+ list(): Promise<Role[]>;
1297
+ /**
1298
+ * Create a new custom role
1299
+ *
1300
+ * Creates a tenant-specific role with the specified permissions.
1301
+ * Permissions use the format `namespace#relation` or `namespace:id#relation`.
1302
+ *
1303
+ * @param request - Role creation request
1304
+ * @returns Created role
1305
+ *
1306
+ * @example
1307
+ * ```typescript
1308
+ * const role = await omnibase.permissions.roles.create({
1309
+ * role_name: 'billing_manager',
1310
+ * permissions: [
1311
+ * 'tenant#manage_billing',
1312
+ * 'tenant#view_invoices',
1313
+ * 'tenant#update_payment_methods'
1314
+ * ]
1315
+ * });
1316
+ *
1317
+ * console.log(`Created role: ${role.id}`);
1318
+ * ```
1319
+ *
1320
+ * @example
1321
+ * Resource-specific permissions:
1322
+ * ```typescript
1323
+ * const devRole = await omnibase.permissions.roles.create({
1324
+ * role_name: 'project_developer',
1325
+ * permissions: [
1326
+ * 'project:proj_abc123#deploy',
1327
+ * 'project:proj_abc123#view_logs',
1328
+ * 'tenant#invite_user'
1329
+ * ]
1330
+ * });
1331
+ * ```
1332
+ */
1333
+ create(request: CreateRoleRequest): Promise<Role>;
1334
+ /**
1335
+ * Update an existing role's permissions
1336
+ *
1337
+ * Updates the permissions for a role and automatically updates all
1338
+ * Keto relationships for users assigned to this role. Old permissions
1339
+ * are removed and new ones are created.
1340
+ *
1341
+ * @param roleId - ID of role to update
1342
+ * @param request - Update request with new permissions
1343
+ * @returns Updated role
1344
+ *
1345
+ * @example
1346
+ * ```typescript
1347
+ * const updatedRole = await omnibase.permissions.roles.update('role_123', {
1348
+ * permissions: [
1349
+ * 'tenant#manage_billing',
1350
+ * 'tenant#view_invoices',
1351
+ * 'tenant#manage_users' // Added new permission
1352
+ * ]
1353
+ * });
1354
+ *
1355
+ * console.log(`Updated role with ${updatedRole.permissions.length} permissions`);
1356
+ * ```
1357
+ */
1358
+ update(roleId: string, request: UpdateRoleRequest): Promise<Role>;
1359
+ /**
1360
+ * Delete a role
1361
+ *
1362
+ * Deletes the role and automatically removes all Keto relationships
1363
+ * for users assigned to this role. Cannot delete system roles.
1364
+ *
1365
+ * @param roleId - ID of role to delete
1366
+ *
1367
+ * @example
1368
+ * ```typescript
1369
+ * await omnibase.permissions.roles.delete('role_123');
1370
+ * console.log('Role deleted successfully');
1371
+ * ```
1372
+ */
1373
+ delete(roleId: string): Promise<void>;
1374
+ /**
1375
+ * Assign a role to a user
1376
+ *
1377
+ * Assigns a role to a user and automatically creates all necessary
1378
+ * Keto relationship tuples based on the role's permissions. The user
1379
+ * immediately gains all permissions defined in the role.
1380
+ *
1381
+ * @param userId - ID of user to assign role to
1382
+ * @param request - Assignment request with role ID
1383
+ *
1384
+ * @example
1385
+ * ```typescript
1386
+ * // Assign billing manager role to user
1387
+ * await omnibase.permissions.roles.assign('user_123', {
1388
+ * role_id: 'role_456'
1389
+ * });
1390
+ *
1391
+ * // User now has all permissions from the role
1392
+ * const canManageBilling = await omnibase.permissions.permissions.checkPermission(
1393
+ * undefined,
1394
+ * {
1395
+ * namespace: 'Tenant',
1396
+ * object: 'tenant_789',
1397
+ * relation: 'manage_billing',
1398
+ * subjectId: 'user_123'
1399
+ * }
1400
+ * );
1401
+ * // canManageBilling.data.allowed === true
1402
+ * ```
1403
+ */
1404
+ assign(userId: string, request: AssignRoleRequest): Promise<void>;
1405
+ }
1406
+
1407
+ /**
1408
+ * Client for managing permissions and relationships using Ory Keto
1409
+ *
1410
+ * This client provides access to Ory Keto's permission system, allowing you to
1411
+ * create, manage, and check relationships between subjects and objects. It handles
1412
+ * both read operations (permission checks) and write operations (relationship management).
1413
+ *
1414
+ * The client automatically configures separate endpoints for read and write operations
1415
+ * to optimize performance and security by following Ory Keto's recommended architecture.
1416
+ *
1417
+ * @example
1418
+ * Basic permission checking:
1419
+ * ```typescript
1420
+ * import { PermissionsClient } from '@omnibase/core-js/permissions';
1421
+ *
1422
+ * const permissionsClient = new PermissionsClient('https://api.example.com');
1423
+ *
1424
+ * // Check if a user can view a tenant
1425
+ * const canView = await permissionsClient.permissions.checkPermission(
1426
+ * undefined,
1427
+ * {
1428
+ * namespace: 'Tenant',
1429
+ * object: 'tenant_123',
1430
+ * relation: 'view',
1431
+ * subjectId: 'user_456'
1432
+ * }
1433
+ * );
1434
+ *
1435
+ * if (canView.data.allowed) {
1436
+ * console.log('User can view the tenant');
1437
+ * }
1438
+ * ```
1439
+ *
1440
+ * @example
1441
+ * Creating tenant relationships:
1442
+ * ```typescript
1443
+ * // Create a relationship making a user an owner of a tenant
1444
+ * await permissionsClient.relationships.createRelationship(
1445
+ * undefined,
1446
+ * {
1447
+ * namespace: 'Tenant',
1448
+ * object: 'tenant_123',
1449
+ * relation: 'owners',
1450
+ * subjectId: 'user_456'
1451
+ * }
1452
+ * );
1453
+ *
1454
+ * // Now the user has owner permissions on the tenant
1455
+ * console.log('User is now an owner of the tenant');
1456
+ * ```
1457
+ *
1458
+ * @example
1459
+ * Complex tenant permission management:
1460
+ * ```typescript
1461
+ * const tenantId = 'tenant_123';
1462
+ * const userId = 'user_456';
1463
+ *
1464
+ * // Grant admin permissions to a user
1465
+ * await permissionsClient.relationships.createRelationship(
1466
+ * undefined,
1467
+ * {
1468
+ * namespace: 'Tenant',
1469
+ * object: tenantId,
1470
+ * relation: 'admins',
1471
+ * subjectId: userId
1472
+ * }
1473
+ * );
1474
+ *
1475
+ * // Check if user can manage members (admins and owners can)
1476
+ * const canManageMembers = await permissionsClient.permissions.checkPermission(
1477
+ * undefined,
1478
+ * {
1479
+ * namespace: 'Tenant',
1480
+ * object: tenantId,
1481
+ * relation: 'manage_members',
1482
+ * subjectId: userId
1483
+ * }
1484
+ * );
1485
+ *
1486
+ * if (canManageMembers.data.allowed) {
1487
+ * // User can invite/remove members
1488
+ * console.log('User can manage tenant members');
1489
+ * }
1490
+ *
1491
+ * // Later, remove admin permissions
1492
+ * await permissionsClient.relationships.deleteRelationships(
1493
+ * undefined,
1494
+ * {
1495
+ * namespace: 'Tenant',
1496
+ * object: tenantId,
1497
+ * relation: 'admins',
1498
+ * subjectId: userId
1499
+ * }
1500
+ * );
1501
+ * ```
1502
+ *
1503
+ * @since 1.0.0
1504
+ * @public
1505
+ * @group Client
1506
+ */
1507
+ declare class PermissionsClient {
1508
+ /**
1509
+ * Ory Keto RelationshipApi for managing subject-object relationships
1510
+ *
1511
+ * Provides methods for creating, updating, and deleting relationships between
1512
+ * subjects (users, groups) and objects (tenants, resources). This API handles
1513
+ * write operations and is used to establish permission structures.
1514
+ *
1515
+ * Key methods:
1516
+ * - `createRelationship()` - Creates a new relationship tuple
1517
+ * - `deleteRelationships()` - Removes existing relationship tuples
1518
+ * - `getRelationships()` - Queries existing relationships
1519
+ * - `patchRelationships()` - Updates multiple relationships atomically
1520
+ *
1521
+ * @example
1522
+ * ```typescript
1523
+ * // Create a relationship
1524
+ * await client.relationships.createRelationship(
1525
+ * undefined,
1526
+ * {
1527
+ * namespace: 'Tenant',
1528
+ * object: 'tenant_123',
1529
+ * relation: 'members',
1530
+ * subjectId: 'user_456'
1531
+ * }
1532
+ * );
1533
+ * ```
1534
+ *
1535
+ * @since 1.0.0
1536
+ * @group Relationships
1537
+ */
1538
+ relationships: RelationshipApi;
1539
+ /**
1540
+ * Ory Keto PermissionApi for checking permissions
1541
+ *
1542
+ * Provides methods for querying whether a subject has a specific permission
1543
+ * on an object. This API handles read operations and is optimized for fast
1544
+ * permission checks in your application logic.
1545
+ *
1546
+ * Key methods:
1547
+ * - `checkPermission()` - Checks if a subject has permission on an object
1548
+ * - `checkPermissionOrError()` - Same as above but throws error if denied
1549
+ * - `expandPermissions()` - Expands relationships to show all granted permissions
1550
+ *
1551
+ * @example
1552
+ * ```typescript
1553
+ * // Check permission
1554
+ * const result = await client.permissions.checkPermission(
1555
+ * undefined,
1556
+ * {
1557
+ * namespace: 'Tenant',
1558
+ * object: 'tenant_123',
1559
+ * relation: 'view',
1560
+ * subjectId: 'user_456'
1561
+ * }
1562
+ * );
1563
+ *
1564
+ * console.log('Has permission:', result.data.allowed);
1565
+ * ```
1566
+ *
1567
+ * @since 1.0.0
1568
+ * @group Permissions
1569
+ */
1570
+ permissions: PermissionApi;
1571
+ /**
1572
+ * Handler for managing roles and role-based permissions
1573
+ *
1574
+ * Provides methods for creating custom roles, assigning permissions,
1575
+ * and managing role assignments. Works alongside the Keto-based
1576
+ * permissions system to provide dynamic RBAC capabilities.
1577
+ *
1578
+ * @example
1579
+ * ```typescript
1580
+ * // Create a custom role
1581
+ * const role = await omnibase.permissions.roles.create({
1582
+ * role_name: 'billing_manager',
1583
+ * permissions: ['tenant#manage_billing', 'tenant#view_invoices']
1584
+ * });
1585
+ *
1586
+ * // Assign role to user
1587
+ * await omnibase.permissions.roles.assign('user_123', {
1588
+ * role_id: role.id
1589
+ * });
1590
+ * ```
1591
+ *
1592
+ * @since 0.7.0
1593
+ * @group Roles
1594
+ */
1595
+ roles: RolesHandler;
1596
+ /**
1597
+ * Creates a new PermissionsClient instance
1598
+ *
1599
+ * Initializes the client with separate endpoints for read and write operations.
1600
+ * The client automatically appends the appropriate Keto API paths to the base URL
1601
+ * for optimal performance and security separation.
1602
+ *
1603
+ * @param apiBaseUrl - The base URL for your Omnibase API instance
1604
+ * @param client - The main OmnibaseClient instance (for roles handler)
1605
+ *
1606
+ * @throws {Error} When the base URL is invalid or cannot be reached
1607
+ *
1608
+ * @example
1609
+ * ```typescript
1610
+ * const client = new PermissionsClient('https://api.example.com', omnibaseClient);
1611
+ * ```
1612
+ *
1613
+ * @since 1.0.0
1614
+ * @group Client
1615
+ */
1616
+ constructor(apiBaseUrl: string, client: OmnibaseClient);
1617
+ }
1618
+
1019
1619
  interface UploadOptions {
1020
1620
  /**
1021
1621
  * Custom metadata to attach to the file
@@ -2255,4 +2855,4 @@ declare class OmnibaseClient {
2255
2855
  fetch(endpoint: string, options?: RequestInit): Promise<Response>;
2256
2856
  }
2257
2857
 
2258
- export { type AcceptTenantInviteRequest as A, type CreateTenantUserInviteResponse as C, CheckoutManager, type CheckoutOptions, ConfigManager, type CreateCheckoutResponse, type CreateCustomerPortalResponse, type DownloadResult as D, type OmnibaseClientConfig as O, PaymentHandler, PortalManager, type PortalOptions, type Price, type PriceDisplay, type PriceLimit, type PriceUI, type Product, type ProductUI, type ProductWithPricingUI, StorageClient as S, type StripeConfigResponse, type StripeConfiguration, TenantHandler as T, type Tier, type UploadOptions as U, UsageManager, type UsageOptions, type UploadResult as a, type AcceptTenantInviteResponse as b, type TenantInvite as c, type CreateTenantUserInviteRequest as d, TenantInviteManager as e, type SwitchActiveTenantResponse as f, type DeleteTenantResponse as g, type CreateTenantResponse as h, type Tenant as i, type CreateTenantRequest as j, TenantManger as k, OmnibaseClient as l, type ApiResponse as m };
2858
+ export { type AssignRoleRequest as A, type CreateRoleRequest as C, CheckoutManager, type CheckoutOptions, ConfigManager, type CreateCheckoutResponse, type CreateCustomerPortalResponse, type DownloadResult as D, type NamespaceDefinition as N, type OmnibaseClientConfig as O, PermissionsClient as P, PaymentHandler, PortalManager, type PortalOptions, type Price, type PriceDisplay, type PriceLimit, type PriceUI, type Product, type ProductUI, type ProductWithPricingUI, RolesHandler as R, StorageClient as S, type StripeConfigResponse, type StripeConfiguration, TenantHandler as T, type Tier, type UpdateRoleRequest as U, UsageManager, type UsageOptions, type Role as a, type UploadOptions as b, type UploadResult as c, type AcceptTenantInviteRequest as d, type AcceptTenantInviteResponse as e, type CreateTenantUserInviteResponse as f, type TenantInvite as g, type CreateTenantUserInviteRequest as h, TenantInviteManager as i, type SwitchActiveTenantResponse as j, type DeleteTenantResponse as k, type CreateTenantResponse as l, type Tenant as m, type CreateTenantRequest as n, TenantManger as o, OmnibaseClient as p, type ApiResponse as q };