@omnibase/core-js 0.1.7 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,5 @@
1
+ import { A as ApiResponse } from '../types-DgsX5kVK.js';
2
+
1
3
  /**
2
4
  * Request data for accepting a tenant invitation
3
5
  *
@@ -520,54 +522,6 @@ type DeleteTenantResponse = ApiResponse<{
520
522
  */
521
523
  declare function deleteTenant(tenantId: string): Promise<DeleteTenantResponse>;
522
524
 
523
- /**
524
- * Base API Response structure for all tenant operations
525
- *
526
- * This generic type defines the standard response format returned by all
527
- * tenant-related API endpoints. It provides a consistent structure for
528
- * handling both successful responses and error conditions across the SDK.
529
- *
530
- * @template T - The type of the response data payload
531
- *
532
- * @example
533
- * Successful response:
534
- * ```typescript
535
- * const response: ApiResponse<{ tenant: Tenant }> = {
536
- * data: { tenant: { id: '123', name: 'My Company' } },
537
- * status: 200
538
- * };
539
- * ```
540
- *
541
- * @example
542
- * Error response:
543
- * ```typescript
544
- * const response: ApiResponse<never> = {
545
- * status: 400,
546
- * error: 'Invalid tenant name provided'
547
- * };
548
- * ```
549
- *
550
- * @since 1.0.0
551
- * @public
552
- */
553
- type ApiResponse<T> = {
554
- /**
555
- * Response data payload (present only on successful operations)
556
- * Contains the actual data returned by the API endpoint
557
- */
558
- data?: T;
559
- /**
560
- * HTTP status code indicating the result of the operation
561
- * @example 200 for success, 400 for client errors, 500 for server errors
562
- */
563
- status: number;
564
- /**
565
- * Error message (present only when operation fails)
566
- * Provides human-readable description of what went wrong
567
- */
568
- error?: string;
569
- };
570
-
571
525
  /**
572
526
  * Response structure for switching the active tenant
573
527
  *
@@ -678,4 +632,4 @@ type SwitchActiveTenantResponse = ApiResponse<{
678
632
  */
679
633
  declare function switchActiveTenant(tenantId: string): Promise<SwitchActiveTenantResponse>;
680
634
 
681
- export { type AcceptTenantInviteRequest, type AcceptTenantInviteResponse, type ApiResponse, type CreateTenantRequest, type CreateTenantResponse, type CreateTenantUserInviteRequest, type CreateTenantUserInviteResponse, type DeleteTenantResponse, type SwitchActiveTenantResponse, type Tenant, type TenantInvite, acceptTenantInvite, createTenant, createTenantUserInvite, deleteTenant, switchActiveTenant };
635
+ export { type AcceptTenantInviteRequest, type AcceptTenantInviteResponse, ApiResponse, type CreateTenantRequest, type CreateTenantResponse, type CreateTenantUserInviteRequest, type CreateTenantUserInviteResponse, type DeleteTenantResponse, type SwitchActiveTenantResponse, type Tenant, type TenantInvite, acceptTenantInvite, createTenant, createTenantUserInvite, deleteTenant, switchActiveTenant };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Base API Response structure for all tenant operations
3
+ *
4
+ * This generic type defines the standard response format returned by all
5
+ * tenant-related API endpoints. It provides a consistent structure for
6
+ * handling both successful responses and error conditions across the SDK.
7
+ *
8
+ * @template T - The type of the response data payload
9
+ *
10
+ * @example
11
+ * Successful response:
12
+ * ```typescript
13
+ * const response: ApiResponse<{ tenant: Tenant }> = {
14
+ * data: { tenant: { id: '123', name: 'My Company' } },
15
+ * status: 200
16
+ * };
17
+ * ```
18
+ *
19
+ * @example
20
+ * Error response:
21
+ * ```typescript
22
+ * const response: ApiResponse<never> = {
23
+ * status: 400,
24
+ * error: 'Invalid tenant name provided'
25
+ * };
26
+ * ```
27
+ *
28
+ * @since 1.0.0
29
+ * @public
30
+ */
31
+ type ApiResponse<T> = {
32
+ /**
33
+ * Response data payload (present only on successful operations)
34
+ * Contains the actual data returned by the API endpoint
35
+ */
36
+ data?: T;
37
+ /**
38
+ * HTTP status code indicating the result of the operation
39
+ * @example 200 for success, 400 for client errors, 500 for server errors
40
+ */
41
+ status: number;
42
+ /**
43
+ * Error message (present only when operation fails)
44
+ * Provides human-readable description of what went wrong
45
+ */
46
+ error?: string;
47
+ };
48
+
49
+ export type { ApiResponse as A };
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Base API Response structure for all tenant operations
3
+ *
4
+ * This generic type defines the standard response format returned by all
5
+ * tenant-related API endpoints. It provides a consistent structure for
6
+ * handling both successful responses and error conditions across the SDK.
7
+ *
8
+ * @template T - The type of the response data payload
9
+ *
10
+ * @example
11
+ * Successful response:
12
+ * ```typescript
13
+ * const response: ApiResponse<{ tenant: Tenant }> = {
14
+ * data: { tenant: { id: '123', name: 'My Company' } },
15
+ * status: 200
16
+ * };
17
+ * ```
18
+ *
19
+ * @example
20
+ * Error response:
21
+ * ```typescript
22
+ * const response: ApiResponse<never> = {
23
+ * status: 400,
24
+ * error: 'Invalid tenant name provided'
25
+ * };
26
+ * ```
27
+ *
28
+ * @since 1.0.0
29
+ * @public
30
+ */
31
+ type ApiResponse<T> = {
32
+ /**
33
+ * Response data payload (present only on successful operations)
34
+ * Contains the actual data returned by the API endpoint
35
+ */
36
+ data?: T;
37
+ /**
38
+ * HTTP status code indicating the result of the operation
39
+ * @example 200 for success, 400 for client errors, 500 for server errors
40
+ */
41
+ status: number;
42
+ /**
43
+ * Error message (present only when operation fails)
44
+ * Provides human-readable description of what went wrong
45
+ */
46
+ error?: string;
47
+ };
48
+
49
+ export type { ApiResponse as A };
package/package.json CHANGED
@@ -1,20 +1,24 @@
1
1
  {
2
2
  "name": "@omnibase/core-js",
3
- "version": "0.1.7",
3
+ "version": "0.3.0",
4
4
  "description": "OmniBase core Javascript SDK - framework agnostic",
5
5
  "files": [
6
6
  "dist/**/*"
7
7
  ],
8
8
  "type": "module",
9
9
  "scripts": {
10
- "build": "tsup src/database/index.ts src/tenants/index.ts src/auth/index.ts --format cjs,esm --dts",
11
- "prepublishOnly": "npm run build",
12
- "build:docs": "bunx typedoc"
10
+ "build": "tsup src/permissions/index.ts src/database/index.ts src/tenants/index.ts src/auth/index.ts src/stripe/index.ts --format cjs,esm --dts",
11
+ "prepublishOnly": "npm run build"
13
12
  },
14
13
  "exports": {
15
14
  "./auth": {
16
15
  "types": "./dist/auth/index.d.ts"
17
16
  },
17
+ "./permissions": {
18
+ "import": "./dist/permissions/index.d.ts",
19
+ "require": "./dist/permissions/index.cjs",
20
+ "types": "./dist/permissions/index.d.ts"
21
+ },
18
22
  "./database": {
19
23
  "import": "./dist/database/index.js",
20
24
  "require": "./dist/database/index.cjs",
@@ -24,6 +28,11 @@
24
28
  "import": "./dist/tenants/index.js",
25
29
  "require": "./dist/tenants/index.cjs",
26
30
  "types": "./dist/tenants/index.d.ts"
31
+ },
32
+ "./stripe": {
33
+ "import": "./dist/stripe/index.js",
34
+ "require": "./dist/stripe/index.cjs",
35
+ "types": "./dist/stripe/index.d.ts"
27
36
  }
28
37
  },
29
38
  "keywords": [
@@ -46,6 +55,7 @@
46
55
  "typescript": "^5.9.2"
47
56
  },
48
57
  "dependencies": {
58
+ "@ory/client": "^1.22.3",
49
59
  "@ory/client-fetch": "^1.22.2",
50
60
  "@supabase/postgrest-js": "^1.21.4"
51
61
  }