@elqnt/admin 2.2.1 → 2.3.1

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.
@@ -0,0 +1,53 @@
1
+ import { ApiClientOptions, ApiResponse } from '@elqnt/api-client';
2
+ import { O as OrgStatusTS, a as OrgTypeTS, b as Org, c as OrgResponse, d as OrgInfoResponse, L as ListOrgsResponse } from './admin-C1iVQe2d.cjs';
3
+
4
+ /**
5
+ * Organizations Admin API
6
+ *
7
+ * Browser-side API client for organization management.
8
+ * Uses @elqnt/api-client for HTTP requests with automatic token management.
9
+ */
10
+
11
+ /**
12
+ * Filter options for listing organizations
13
+ *
14
+ * `product` is routing metadata: it selects which admin_<product> DB to read
15
+ * from (empty → eloquent). It is not a stored column on the org.
16
+ */
17
+ interface ListOrgsFilter {
18
+ status?: OrgStatusTS;
19
+ type?: OrgTypeTS;
20
+ product?: string;
21
+ }
22
+ /**
23
+ * List all organizations (admin scope required)
24
+ * @param filter - Optional filter criteria
25
+ * @param options - API client options
26
+ */
27
+ declare function listOrgsApi(filter: ListOrgsFilter | undefined, options: ApiClientOptions): Promise<ApiResponse<ListOrgsResponse>>;
28
+ /**
29
+ * Create a new organization
30
+ */
31
+ declare function createOrgApi(org: Partial<Org> & {
32
+ product?: string;
33
+ }, options: ApiClientOptions): Promise<ApiResponse<OrgResponse>>;
34
+ /**
35
+ * Get an organization by ID
36
+ */
37
+ declare function getOrgApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<OrgResponse>>;
38
+ /**
39
+ * Update an organization
40
+ */
41
+ declare function updateOrgApi(orgId: string, updates: Partial<Org>, options: ApiClientOptions): Promise<ApiResponse<OrgResponse>>;
42
+ /**
43
+ * Delete an organization
44
+ */
45
+ declare function deleteOrgApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<{
46
+ success: boolean;
47
+ }>>;
48
+ /**
49
+ * Get organization info (lightweight response)
50
+ */
51
+ declare function getOrgInfoApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<OrgInfoResponse>>;
52
+
53
+ export { type ListOrgsFilter as L, getOrgInfoApi as a, createOrgApi as c, deleteOrgApi as d, getOrgApi as g, listOrgsApi as l, updateOrgApi as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elqnt/admin",
3
- "version": "2.2.1",
3
+ "version": "2.3.1",
4
4
  "description": "Admin APIs for Eloquent platform (onboarding, org-settings, billing)",
5
5
  "type": "module",
6
6
  "exports": {
@@ -26,12 +26,13 @@
26
26
  }
27
27
  },
28
28
  "files": [
29
- "dist"
29
+ "dist",
30
+ "SKILL.md"
30
31
  ],
31
32
  "dependencies": {
32
- "@elqnt/agents": "3.2.1",
33
- "@elqnt/types": "2.0.13",
34
- "@elqnt/api-client": "1.0.5"
33
+ "@elqnt/agents": "4.0.0",
34
+ "@elqnt/types": "2.2.0",
35
+ "@elqnt/api-client": "2.2.0"
35
36
  },
36
37
  "devDependencies": {
37
38
  "@types/react": "^19.0.0",
@@ -1,168 +0,0 @@
1
- import { ApiClientOptions, ApiResponse } from '@elqnt/api-client';
2
- import { OrgProductTS, OrgStatusTS, OrgTypeTS, Org, OrgResponse, OrgSchemaTypeTS, CreateOrgWithSchemasResponse, OrgInfoResponse, ListOrgsResponse, OrgArtifactTypeTS, CreateOrgRequest, CreateOrgResponse, RetryProvisioningRequest } from './models/index.cjs';
3
-
4
- /**
5
- * Organizations Admin API
6
- *
7
- * Browser-side API client for organization management.
8
- * Uses @elqnt/api-client for HTTP requests with automatic token management.
9
- */
10
-
11
- /**
12
- * Filter options for listing organizations
13
- */
14
- interface ListOrgsFilter {
15
- product?: OrgProductTS;
16
- status?: OrgStatusTS;
17
- type?: OrgTypeTS;
18
- }
19
- /**
20
- * List all organizations (admin scope required)
21
- * @param filter - Optional filter criteria
22
- * @param options - API client options
23
- */
24
- declare function listOrgsApi(filter: ListOrgsFilter | undefined, options: ApiClientOptions): Promise<ApiResponse<ListOrgsResponse>>;
25
- /**
26
- * Create a new organization
27
- */
28
- declare function createOrgApi(org: Partial<Org>, options: ApiClientOptions): Promise<ApiResponse<OrgResponse>>;
29
- /**
30
- * Get an organization by ID
31
- */
32
- declare function getOrgApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<OrgResponse>>;
33
- /**
34
- * Update an organization
35
- */
36
- declare function updateOrgApi(orgId: string, updates: Partial<Org>, options: ApiClientOptions): Promise<ApiResponse<OrgResponse>>;
37
- /**
38
- * Delete an organization
39
- */
40
- declare function deleteOrgApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<{
41
- success: boolean;
42
- }>>;
43
- /**
44
- * Get organization info (lightweight response)
45
- */
46
- declare function getOrgInfoApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<OrgInfoResponse>>;
47
- /**
48
- * Create an organization with specific database schemas.
49
- * Only creates bare org_<uuid> schemas, no tables or default data.
50
- * Use this when you want to create an org then bootstrap custom content
51
- * using @elqnt/* hooks.
52
- *
53
- * @param org - Partial org data (title is required)
54
- * @param schemas - Array of schema types to create: "entities", "agents", "org-config"
55
- * @param options - API client options
56
- */
57
- declare function createOrgWithSchemasApi(org: Partial<Org>, schemas: OrgSchemaTypeTS[], options: ApiClientOptions): Promise<ApiResponse<CreateOrgWithSchemasResponse>>;
58
-
59
- /**
60
- * Organization Provisioning Admin API
61
- *
62
- * Browser-side API client for organization provisioning management.
63
- * Uses @elqnt/api-client for HTTP requests with automatic token management.
64
- */
65
-
66
- interface ProvisioningProgress {
67
- orgId: string;
68
- status: string;
69
- totalArtifacts: number;
70
- completedArtifacts: number;
71
- failedArtifacts: number;
72
- currentArtifact?: {
73
- type: OrgArtifactTypeTS;
74
- status: string;
75
- critical: boolean;
76
- };
77
- artifacts: Array<{
78
- type: OrgArtifactTypeTS;
79
- status: string;
80
- critical: boolean;
81
- error?: string;
82
- duration?: number;
83
- estimatedDuration?: number;
84
- }>;
85
- startedAt: number;
86
- completedAt?: number;
87
- error?: string;
88
- }
89
- interface ValidationResult {
90
- valid: boolean;
91
- artifacts: Array<{
92
- type: string;
93
- valid: boolean;
94
- }>;
95
- }
96
- /**
97
- * Create a new organization with provisioning
98
- */
99
- declare function createOrgWithProvisioningApi(request: CreateOrgRequest, options: ApiClientOptions): Promise<ApiResponse<CreateOrgResponse & {
100
- provisioningStatus: string;
101
- }>>;
102
- /**
103
- * Get provisioning status for an organization
104
- */
105
- declare function getProvisioningStatusApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<{
106
- progress: ProvisioningProgress;
107
- }>>;
108
- /**
109
- * Retry failed provisioning artifacts
110
- */
111
- declare function retryProvisioningApi(orgId: string, request: RetryProvisioningRequest | undefined, options: ApiClientOptions): Promise<ApiResponse<{
112
- message: string;
113
- status: string;
114
- }>>;
115
- /**
116
- * Validate all provisioned artifacts
117
- */
118
- declare function validateProvisioningApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<ValidationResult>>;
119
- /**
120
- * Cancel active provisioning
121
- */
122
- declare function cancelProvisioningApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<{
123
- message: string;
124
- }>>;
125
- /**
126
- * Cleanup provisioned resources for an organization
127
- */
128
- declare function cleanupProvisioningApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<{
129
- message: string;
130
- }>>;
131
- interface ProvisioningStreamCallbacks {
132
- onProgress?: (progress: ProvisioningProgress) => void;
133
- onConnected?: (orgId: string) => void;
134
- onDone?: () => void;
135
- onError?: (error: Error) => void;
136
- onTimeout?: () => void;
137
- }
138
- /**
139
- * Stream provisioning progress via Server-Sent Events
140
- *
141
- * Returns a function to close the connection
142
- */
143
- declare function streamProvisioningProgress(orgId: string, callbacks: ProvisioningStreamCallbacks, options: {
144
- baseUrl: string;
145
- token?: string;
146
- }): () => void;
147
- /**
148
- * Calculate provisioning progress percentage
149
- */
150
- declare function calculateProgressPercentage(progress: ProvisioningProgress): number;
151
- /**
152
- * Check if provisioning is complete (success or failure)
153
- */
154
- declare function isProvisioningComplete(progress: ProvisioningProgress): boolean;
155
- /**
156
- * Check if provisioning was successful
157
- */
158
- declare function isProvisioningSuccessful(progress: ProvisioningProgress): boolean;
159
- /**
160
- * Get failed artifacts from progress
161
- */
162
- declare function getFailedArtifacts(progress: ProvisioningProgress): ProvisioningProgress["artifacts"];
163
- /**
164
- * Check if any critical artifacts failed
165
- */
166
- declare function hasCriticalFailures(progress: ProvisioningProgress): boolean;
167
-
168
- export { type ListOrgsFilter as L, type ProvisioningProgress as P, type ValidationResult as V, type ProvisioningStreamCallbacks as a, cancelProvisioningApi as b, calculateProgressPercentage as c, cleanupProvisioningApi as d, createOrgApi as e, createOrgWithProvisioningApi as f, createOrgWithSchemasApi as g, deleteOrgApi as h, getFailedArtifacts as i, getOrgApi as j, getOrgInfoApi as k, getProvisioningStatusApi as l, hasCriticalFailures as m, isProvisioningComplete as n, isProvisioningSuccessful as o, listOrgsApi as p, retryProvisioningApi as r, streamProvisioningProgress as s, updateOrgApi as u, validateProvisioningApi as v };
@@ -1,168 +0,0 @@
1
- import { ApiClientOptions, ApiResponse } from '@elqnt/api-client';
2
- import { OrgProductTS, OrgStatusTS, OrgTypeTS, Org, OrgResponse, OrgSchemaTypeTS, CreateOrgWithSchemasResponse, OrgInfoResponse, ListOrgsResponse, OrgArtifactTypeTS, CreateOrgRequest, CreateOrgResponse, RetryProvisioningRequest } from './models/index.js';
3
-
4
- /**
5
- * Organizations Admin API
6
- *
7
- * Browser-side API client for organization management.
8
- * Uses @elqnt/api-client for HTTP requests with automatic token management.
9
- */
10
-
11
- /**
12
- * Filter options for listing organizations
13
- */
14
- interface ListOrgsFilter {
15
- product?: OrgProductTS;
16
- status?: OrgStatusTS;
17
- type?: OrgTypeTS;
18
- }
19
- /**
20
- * List all organizations (admin scope required)
21
- * @param filter - Optional filter criteria
22
- * @param options - API client options
23
- */
24
- declare function listOrgsApi(filter: ListOrgsFilter | undefined, options: ApiClientOptions): Promise<ApiResponse<ListOrgsResponse>>;
25
- /**
26
- * Create a new organization
27
- */
28
- declare function createOrgApi(org: Partial<Org>, options: ApiClientOptions): Promise<ApiResponse<OrgResponse>>;
29
- /**
30
- * Get an organization by ID
31
- */
32
- declare function getOrgApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<OrgResponse>>;
33
- /**
34
- * Update an organization
35
- */
36
- declare function updateOrgApi(orgId: string, updates: Partial<Org>, options: ApiClientOptions): Promise<ApiResponse<OrgResponse>>;
37
- /**
38
- * Delete an organization
39
- */
40
- declare function deleteOrgApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<{
41
- success: boolean;
42
- }>>;
43
- /**
44
- * Get organization info (lightweight response)
45
- */
46
- declare function getOrgInfoApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<OrgInfoResponse>>;
47
- /**
48
- * Create an organization with specific database schemas.
49
- * Only creates bare org_<uuid> schemas, no tables or default data.
50
- * Use this when you want to create an org then bootstrap custom content
51
- * using @elqnt/* hooks.
52
- *
53
- * @param org - Partial org data (title is required)
54
- * @param schemas - Array of schema types to create: "entities", "agents", "org-config"
55
- * @param options - API client options
56
- */
57
- declare function createOrgWithSchemasApi(org: Partial<Org>, schemas: OrgSchemaTypeTS[], options: ApiClientOptions): Promise<ApiResponse<CreateOrgWithSchemasResponse>>;
58
-
59
- /**
60
- * Organization Provisioning Admin API
61
- *
62
- * Browser-side API client for organization provisioning management.
63
- * Uses @elqnt/api-client for HTTP requests with automatic token management.
64
- */
65
-
66
- interface ProvisioningProgress {
67
- orgId: string;
68
- status: string;
69
- totalArtifacts: number;
70
- completedArtifacts: number;
71
- failedArtifacts: number;
72
- currentArtifact?: {
73
- type: OrgArtifactTypeTS;
74
- status: string;
75
- critical: boolean;
76
- };
77
- artifacts: Array<{
78
- type: OrgArtifactTypeTS;
79
- status: string;
80
- critical: boolean;
81
- error?: string;
82
- duration?: number;
83
- estimatedDuration?: number;
84
- }>;
85
- startedAt: number;
86
- completedAt?: number;
87
- error?: string;
88
- }
89
- interface ValidationResult {
90
- valid: boolean;
91
- artifacts: Array<{
92
- type: string;
93
- valid: boolean;
94
- }>;
95
- }
96
- /**
97
- * Create a new organization with provisioning
98
- */
99
- declare function createOrgWithProvisioningApi(request: CreateOrgRequest, options: ApiClientOptions): Promise<ApiResponse<CreateOrgResponse & {
100
- provisioningStatus: string;
101
- }>>;
102
- /**
103
- * Get provisioning status for an organization
104
- */
105
- declare function getProvisioningStatusApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<{
106
- progress: ProvisioningProgress;
107
- }>>;
108
- /**
109
- * Retry failed provisioning artifacts
110
- */
111
- declare function retryProvisioningApi(orgId: string, request: RetryProvisioningRequest | undefined, options: ApiClientOptions): Promise<ApiResponse<{
112
- message: string;
113
- status: string;
114
- }>>;
115
- /**
116
- * Validate all provisioned artifacts
117
- */
118
- declare function validateProvisioningApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<ValidationResult>>;
119
- /**
120
- * Cancel active provisioning
121
- */
122
- declare function cancelProvisioningApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<{
123
- message: string;
124
- }>>;
125
- /**
126
- * Cleanup provisioned resources for an organization
127
- */
128
- declare function cleanupProvisioningApi(orgId: string, options: ApiClientOptions): Promise<ApiResponse<{
129
- message: string;
130
- }>>;
131
- interface ProvisioningStreamCallbacks {
132
- onProgress?: (progress: ProvisioningProgress) => void;
133
- onConnected?: (orgId: string) => void;
134
- onDone?: () => void;
135
- onError?: (error: Error) => void;
136
- onTimeout?: () => void;
137
- }
138
- /**
139
- * Stream provisioning progress via Server-Sent Events
140
- *
141
- * Returns a function to close the connection
142
- */
143
- declare function streamProvisioningProgress(orgId: string, callbacks: ProvisioningStreamCallbacks, options: {
144
- baseUrl: string;
145
- token?: string;
146
- }): () => void;
147
- /**
148
- * Calculate provisioning progress percentage
149
- */
150
- declare function calculateProgressPercentage(progress: ProvisioningProgress): number;
151
- /**
152
- * Check if provisioning is complete (success or failure)
153
- */
154
- declare function isProvisioningComplete(progress: ProvisioningProgress): boolean;
155
- /**
156
- * Check if provisioning was successful
157
- */
158
- declare function isProvisioningSuccessful(progress: ProvisioningProgress): boolean;
159
- /**
160
- * Get failed artifacts from progress
161
- */
162
- declare function getFailedArtifacts(progress: ProvisioningProgress): ProvisioningProgress["artifacts"];
163
- /**
164
- * Check if any critical artifacts failed
165
- */
166
- declare function hasCriticalFailures(progress: ProvisioningProgress): boolean;
167
-
168
- export { type ListOrgsFilter as L, type ProvisioningProgress as P, type ValidationResult as V, type ProvisioningStreamCallbacks as a, cancelProvisioningApi as b, calculateProgressPercentage as c, cleanupProvisioningApi as d, createOrgApi as e, createOrgWithProvisioningApi as f, createOrgWithSchemasApi as g, deleteOrgApi as h, getFailedArtifacts as i, getOrgApi as j, getOrgInfoApi as k, getProvisioningStatusApi as l, hasCriticalFailures as m, isProvisioningComplete as n, isProvisioningSuccessful as o, listOrgsApi as p, retryProvisioningApi as r, streamProvisioningProgress as s, updateOrgApi as u, validateProvisioningApi as v };