@elqnt/entity 2.0.7 → 2.1.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.
- package/dist/api/index.d.mts +45 -0
- package/dist/api/index.d.ts +45 -0
- package/dist/api/index.js +34 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/index.mjs +34 -0
- package/dist/api/index.mjs.map +1 -0
- package/dist/chunk-4GC36G4D.js.map +1 -1
- package/dist/chunk-GQJJP4YL.js +204 -0
- package/dist/chunk-GQJJP4YL.js.map +1 -0
- package/dist/chunk-JEDTIUWW.mjs +204 -0
- package/dist/chunk-JEDTIUWW.mjs.map +1 -0
- package/dist/chunk-SXBB42DJ.js +80 -0
- package/dist/chunk-SXBB42DJ.js.map +1 -0
- package/dist/chunk-UHASYUCH.mjs +80 -0
- package/dist/chunk-UHASYUCH.mjs.map +1 -0
- package/dist/hooks/index.d.mts +46 -0
- package/dist/hooks/index.d.ts +46 -0
- package/dist/hooks/index.js +10 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +10 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +35 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -1
- package/dist/index.mjs.map +1 -1
- package/dist/models/index.js.map +1 -1
- package/package.json +30 -16
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
createEntityRecordApi,
|
|
4
|
+
deleteEntityRecordApi,
|
|
5
|
+
getEntityDefinitionApi,
|
|
6
|
+
getEntityRecordApi,
|
|
7
|
+
listEntityDefinitionsApi,
|
|
8
|
+
queryEntityRecordsApi,
|
|
9
|
+
updateEntityRecordApi
|
|
10
|
+
} from "./chunk-UHASYUCH.mjs";
|
|
11
|
+
|
|
12
|
+
// hooks/use-entities.ts
|
|
13
|
+
import { useState, useCallback } from "react";
|
|
14
|
+
function useEntities(options) {
|
|
15
|
+
const [loading, setLoading] = useState(false);
|
|
16
|
+
const [error, setError] = useState(null);
|
|
17
|
+
const listDefinitions = useCallback(async () => {
|
|
18
|
+
setLoading(true);
|
|
19
|
+
setError(null);
|
|
20
|
+
try {
|
|
21
|
+
const response = await listEntityDefinitionsApi(options);
|
|
22
|
+
if (response.error) {
|
|
23
|
+
setError(response.error);
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
return response.data?.definitions || [];
|
|
27
|
+
} catch (err) {
|
|
28
|
+
const message = err instanceof Error ? err.message : "Failed to load definitions";
|
|
29
|
+
setError(message);
|
|
30
|
+
return [];
|
|
31
|
+
} finally {
|
|
32
|
+
setLoading(false);
|
|
33
|
+
}
|
|
34
|
+
}, [options]);
|
|
35
|
+
const getDefinition = useCallback(
|
|
36
|
+
async (entityName) => {
|
|
37
|
+
setLoading(true);
|
|
38
|
+
setError(null);
|
|
39
|
+
try {
|
|
40
|
+
const response = await getEntityDefinitionApi(entityName, options);
|
|
41
|
+
if (response.error) {
|
|
42
|
+
setError(response.error);
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return response.data?.definition || null;
|
|
46
|
+
} catch (err) {
|
|
47
|
+
const message = err instanceof Error ? err.message : "Failed to get definition";
|
|
48
|
+
setError(message);
|
|
49
|
+
return null;
|
|
50
|
+
} finally {
|
|
51
|
+
setLoading(false);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
[options]
|
|
55
|
+
);
|
|
56
|
+
const queryRecords = useCallback(
|
|
57
|
+
async (entityName, query = {}) => {
|
|
58
|
+
setLoading(true);
|
|
59
|
+
setError(null);
|
|
60
|
+
try {
|
|
61
|
+
const queryParams = {
|
|
62
|
+
page: query.page || 1,
|
|
63
|
+
pageSize: query.pageSize || 20
|
|
64
|
+
};
|
|
65
|
+
if (query.filters) {
|
|
66
|
+
queryParams.filters = JSON.stringify(query.filters);
|
|
67
|
+
}
|
|
68
|
+
if (query.sortBy) {
|
|
69
|
+
queryParams.sortBy = query.sortBy;
|
|
70
|
+
}
|
|
71
|
+
if (query.sortOrder) {
|
|
72
|
+
queryParams.sortOrder = query.sortOrder;
|
|
73
|
+
}
|
|
74
|
+
const response = await queryEntityRecordsApi(entityName, queryParams, options);
|
|
75
|
+
if (response.error) {
|
|
76
|
+
setError(response.error);
|
|
77
|
+
return { records: [], total: 0, page: 1, pageSize: 20 };
|
|
78
|
+
}
|
|
79
|
+
const data = response.data;
|
|
80
|
+
if (data?.records?.items) {
|
|
81
|
+
return {
|
|
82
|
+
records: data.records.items,
|
|
83
|
+
total: data.records.totalCount,
|
|
84
|
+
page: data.records.currentPage,
|
|
85
|
+
pageSize: data.records.pageSize
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
records: data?.records || [],
|
|
90
|
+
total: data?.total || 0,
|
|
91
|
+
page: data?.page || 1,
|
|
92
|
+
pageSize: data?.pageSize || 20
|
|
93
|
+
};
|
|
94
|
+
} catch (err) {
|
|
95
|
+
const message = err instanceof Error ? err.message : "Failed to query records";
|
|
96
|
+
setError(message);
|
|
97
|
+
return { records: [], total: 0, page: 1, pageSize: 20 };
|
|
98
|
+
} finally {
|
|
99
|
+
setLoading(false);
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
[options]
|
|
103
|
+
);
|
|
104
|
+
const getRecord = useCallback(
|
|
105
|
+
async (entityName, recordId) => {
|
|
106
|
+
setLoading(true);
|
|
107
|
+
setError(null);
|
|
108
|
+
try {
|
|
109
|
+
const response = await getEntityRecordApi(entityName, recordId, options);
|
|
110
|
+
if (response.error) {
|
|
111
|
+
setError(response.error);
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
return response.data?.record || null;
|
|
115
|
+
} catch (err) {
|
|
116
|
+
const message = err instanceof Error ? err.message : "Failed to get record";
|
|
117
|
+
setError(message);
|
|
118
|
+
return null;
|
|
119
|
+
} finally {
|
|
120
|
+
setLoading(false);
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
[options]
|
|
124
|
+
);
|
|
125
|
+
const createRecord = useCallback(
|
|
126
|
+
async (entityName, record) => {
|
|
127
|
+
setLoading(true);
|
|
128
|
+
setError(null);
|
|
129
|
+
try {
|
|
130
|
+
const response = await createEntityRecordApi(entityName, record, options);
|
|
131
|
+
if (response.error) {
|
|
132
|
+
setError(response.error);
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
return response.data?.record || null;
|
|
136
|
+
} catch (err) {
|
|
137
|
+
const message = err instanceof Error ? err.message : "Failed to create record";
|
|
138
|
+
setError(message);
|
|
139
|
+
return null;
|
|
140
|
+
} finally {
|
|
141
|
+
setLoading(false);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
[options]
|
|
145
|
+
);
|
|
146
|
+
const updateRecord = useCallback(
|
|
147
|
+
async (entityName, recordId, record) => {
|
|
148
|
+
setLoading(true);
|
|
149
|
+
setError(null);
|
|
150
|
+
try {
|
|
151
|
+
const response = await updateEntityRecordApi(entityName, recordId, record, options);
|
|
152
|
+
if (response.error) {
|
|
153
|
+
setError(response.error);
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
return response.data?.record || null;
|
|
157
|
+
} catch (err) {
|
|
158
|
+
const message = err instanceof Error ? err.message : "Failed to update record";
|
|
159
|
+
setError(message);
|
|
160
|
+
return null;
|
|
161
|
+
} finally {
|
|
162
|
+
setLoading(false);
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
[options]
|
|
166
|
+
);
|
|
167
|
+
const deleteRecord = useCallback(
|
|
168
|
+
async (entityName, recordId) => {
|
|
169
|
+
setLoading(true);
|
|
170
|
+
setError(null);
|
|
171
|
+
try {
|
|
172
|
+
const response = await deleteEntityRecordApi(entityName, recordId, options);
|
|
173
|
+
if (response.error) {
|
|
174
|
+
setError(response.error);
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
return true;
|
|
178
|
+
} catch (err) {
|
|
179
|
+
const message = err instanceof Error ? err.message : "Failed to delete record";
|
|
180
|
+
setError(message);
|
|
181
|
+
return false;
|
|
182
|
+
} finally {
|
|
183
|
+
setLoading(false);
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
[options]
|
|
187
|
+
);
|
|
188
|
+
return {
|
|
189
|
+
loading,
|
|
190
|
+
error,
|
|
191
|
+
listDefinitions,
|
|
192
|
+
getDefinition,
|
|
193
|
+
queryRecords,
|
|
194
|
+
getRecord,
|
|
195
|
+
createRecord,
|
|
196
|
+
updateRecord,
|
|
197
|
+
deleteRecord
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export {
|
|
202
|
+
useEntities
|
|
203
|
+
};
|
|
204
|
+
//# sourceMappingURL=chunk-JEDTIUWW.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../hooks/use-entities.ts"],"sourcesContent":["\"use client\";\n\n/**\n * Entity hooks for React applications\n *\n * Provides React hooks for entity CRUD operations with loading/error states.\n */\n\nimport { useState, useCallback } from \"react\";\nimport type { ApiClientOptions } from \"@elqnt/api-client\";\nimport type { EntityDefinition, EntityRecord } from \"../models\";\nimport {\n listEntityDefinitionsApi,\n getEntityDefinitionApi,\n queryEntityRecordsApi,\n getEntityRecordApi,\n createEntityRecordApi,\n updateEntityRecordApi,\n deleteEntityRecordApi,\n} from \"../api\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\nexport type UseEntitiesOptions = ApiClientOptions;\n\nexport interface QueryOptions {\n page?: number;\n pageSize?: number;\n filters?: Record<string, unknown>;\n sortBy?: string;\n sortOrder?: \"asc\" | \"desc\";\n}\n\nexport interface QueryResult {\n records: EntityRecord[];\n total: number;\n page: number;\n pageSize: number;\n}\n\n// =============================================================================\n// USE ENTITIES HOOK\n// =============================================================================\n\n/**\n * Hook for entity CRUD operations\n *\n * @example\n * ```tsx\n * const { loading, error, queryRecords, createRecord } = useEntities({\n * baseUrl: apiGatewayUrl,\n * orgId: selectedOrgId,\n * userId: user?.id,\n * userEmail: user?.email,\n * });\n *\n * const records = await queryRecords(\"contacts\", { page: 1, pageSize: 20 });\n * ```\n */\nexport function useEntities(options: UseEntitiesOptions) {\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string | null>(null);\n\n const listDefinitions = useCallback(async (): Promise<EntityDefinition[]> => {\n setLoading(true);\n setError(null);\n try {\n const response = await listEntityDefinitionsApi(options);\n if (response.error) {\n setError(response.error);\n return [];\n }\n return response.data?.definitions || [];\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to load definitions\";\n setError(message);\n return [];\n } finally {\n setLoading(false);\n }\n }, [options]);\n\n const getDefinition = useCallback(\n async (entityName: string): Promise<EntityDefinition | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getEntityDefinitionApi(entityName, options);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.definition || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get definition\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [options]\n );\n\n const queryRecords = useCallback(\n async (entityName: string, query: QueryOptions = {}): Promise<QueryResult> => {\n setLoading(true);\n setError(null);\n try {\n const queryParams: Record<string, unknown> = {\n page: query.page || 1,\n pageSize: query.pageSize || 20,\n };\n if (query.filters) {\n queryParams.filters = JSON.stringify(query.filters);\n }\n if (query.sortBy) {\n queryParams.sortBy = query.sortBy;\n }\n if (query.sortOrder) {\n queryParams.sortOrder = query.sortOrder;\n }\n\n const response = await queryEntityRecordsApi(entityName, queryParams, options);\n if (response.error) {\n setError(response.error);\n return { records: [], total: 0, page: 1, pageSize: 20 };\n }\n\n // Handle both direct records array and nested ListResult structure\n const data = response.data;\n if (data?.records?.items) {\n // ListEntityRecordsResponse with ListResult\n return {\n records: data.records.items,\n total: data.records.totalCount,\n page: data.records.currentPage,\n pageSize: data.records.pageSize,\n };\n }\n // Fallback for simpler response structure\n return {\n records: (data as any)?.records || [],\n total: (data as any)?.total || 0,\n page: (data as any)?.page || 1,\n pageSize: (data as any)?.pageSize || 20,\n };\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to query records\";\n setError(message);\n return { records: [], total: 0, page: 1, pageSize: 20 };\n } finally {\n setLoading(false);\n }\n },\n [options]\n );\n\n const getRecord = useCallback(\n async (entityName: string, recordId: string): Promise<EntityRecord | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await getEntityRecordApi(entityName, recordId, options);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.record || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to get record\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [options]\n );\n\n const createRecord = useCallback(\n async (entityName: string, record: Partial<EntityRecord>): Promise<EntityRecord | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await createEntityRecordApi(entityName, record, options);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.record || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to create record\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [options]\n );\n\n const updateRecord = useCallback(\n async (\n entityName: string,\n recordId: string,\n record: Partial<EntityRecord>\n ): Promise<EntityRecord | null> => {\n setLoading(true);\n setError(null);\n try {\n const response = await updateEntityRecordApi(entityName, recordId, record, options);\n if (response.error) {\n setError(response.error);\n return null;\n }\n return response.data?.record || null;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to update record\";\n setError(message);\n return null;\n } finally {\n setLoading(false);\n }\n },\n [options]\n );\n\n const deleteRecord = useCallback(\n async (entityName: string, recordId: string): Promise<boolean> => {\n setLoading(true);\n setError(null);\n try {\n const response = await deleteEntityRecordApi(entityName, recordId, options);\n if (response.error) {\n setError(response.error);\n return false;\n }\n return true;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"Failed to delete record\";\n setError(message);\n return false;\n } finally {\n setLoading(false);\n }\n },\n [options]\n );\n\n return {\n loading,\n error,\n listDefinitions,\n getDefinition,\n queryRecords,\n getRecord,\n createRecord,\n updateRecord,\n deleteRecord,\n };\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
|
|
3
|
+
// api/index.ts
|
|
4
|
+
var _browser = require('@elqnt/api-client/browser');
|
|
5
|
+
async function listEntityDefinitionsApi(options) {
|
|
6
|
+
return _browser.browserApiRequest.call(void 0, "/api/v1/entities/definitions", { method: "GET", ...options });
|
|
7
|
+
}
|
|
8
|
+
async function getEntityDefinitionApi(entityName, options) {
|
|
9
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/entities/definitions/${entityName}`, { method: "GET", ...options });
|
|
10
|
+
}
|
|
11
|
+
async function createEntityDefinitionApi(definition, options) {
|
|
12
|
+
return _browser.browserApiRequest.call(void 0, "/api/v1/entities/definitions", { method: "POST", body: definition, ...options });
|
|
13
|
+
}
|
|
14
|
+
async function updateEntityDefinitionApi(entityName, definition, options) {
|
|
15
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/entities/definitions/${entityName}`, { method: "PUT", body: definition, ...options });
|
|
16
|
+
}
|
|
17
|
+
async function deleteEntityDefinitionApi(entityName, options) {
|
|
18
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/entities/definitions/${entityName}`, { method: "DELETE", ...options });
|
|
19
|
+
}
|
|
20
|
+
async function queryEntityRecordsApi(entityName, query, options) {
|
|
21
|
+
const params = new URLSearchParams();
|
|
22
|
+
Object.entries(query).forEach(([key, value]) => {
|
|
23
|
+
if (value !== void 0 && value !== null) {
|
|
24
|
+
params.set(key, String(value));
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const queryString = params.toString();
|
|
28
|
+
const endpoint = `/api/v1/entities/${entityName}/records${queryString ? `?${queryString}` : ""}`;
|
|
29
|
+
return _browser.browserApiRequest.call(void 0, endpoint, { method: "GET", ...options });
|
|
30
|
+
}
|
|
31
|
+
async function getEntityRecordApi(entityName, recordId, options) {
|
|
32
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/entities/${entityName}/records/${recordId}`, { method: "GET", ...options });
|
|
33
|
+
}
|
|
34
|
+
async function createEntityRecordApi(entityName, record, options) {
|
|
35
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/entities/${entityName}/records`, { method: "POST", body: record, ...options });
|
|
36
|
+
}
|
|
37
|
+
async function updateEntityRecordApi(entityName, recordId, record, options) {
|
|
38
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/entities/${entityName}/records/${recordId}`, { method: "PUT", body: record, ...options });
|
|
39
|
+
}
|
|
40
|
+
async function deleteEntityRecordApi(entityName, recordId, options) {
|
|
41
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/entities/${entityName}/records/${recordId}`, { method: "DELETE", ...options });
|
|
42
|
+
}
|
|
43
|
+
async function bulkCreateEntityRecordsApi(entityName, records, options) {
|
|
44
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/entities/${entityName}/records/bulk`, { method: "POST", body: { records }, ...options });
|
|
45
|
+
}
|
|
46
|
+
async function bulkUpdateEntityRecordsApi(entityName, records, options) {
|
|
47
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/entities/${entityName}/records/bulk`, { method: "PUT", body: { records }, ...options });
|
|
48
|
+
}
|
|
49
|
+
async function bulkDeleteEntityRecordsApi(entityName, recordIds, options) {
|
|
50
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/entities/${entityName}/records/bulk`, { method: "DELETE", body: { recordIds }, ...options });
|
|
51
|
+
}
|
|
52
|
+
async function countEntityRecordsApi(entityName, filters, options) {
|
|
53
|
+
const params = new URLSearchParams();
|
|
54
|
+
Object.entries(filters).forEach(([key, value]) => {
|
|
55
|
+
if (value !== void 0 && value !== null) {
|
|
56
|
+
params.set(key, String(value));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const queryString = params.toString();
|
|
60
|
+
const endpoint = `/api/v1/entities/${entityName}/records/count${queryString ? `?${queryString}` : ""}`;
|
|
61
|
+
return _browser.browserApiRequest.call(void 0, endpoint, { method: "GET", ...options });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
exports.listEntityDefinitionsApi = listEntityDefinitionsApi; exports.getEntityDefinitionApi = getEntityDefinitionApi; exports.createEntityDefinitionApi = createEntityDefinitionApi; exports.updateEntityDefinitionApi = updateEntityDefinitionApi; exports.deleteEntityDefinitionApi = deleteEntityDefinitionApi; exports.queryEntityRecordsApi = queryEntityRecordsApi; exports.getEntityRecordApi = getEntityRecordApi; exports.createEntityRecordApi = createEntityRecordApi; exports.updateEntityRecordApi = updateEntityRecordApi; exports.deleteEntityRecordApi = deleteEntityRecordApi; exports.bulkCreateEntityRecordsApi = bulkCreateEntityRecordsApi; exports.bulkUpdateEntityRecordsApi = bulkUpdateEntityRecordsApi; exports.bulkDeleteEntityRecordsApi = bulkDeleteEntityRecordsApi; exports.countEntityRecordsApi = countEntityRecordsApi;
|
|
80
|
+
//# sourceMappingURL=chunk-SXBB42DJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/entity/dist/chunk-SXBB42DJ.js","../api/index.ts"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACA;ACKA,oDAAkC;AAgBlC,MAAA,SAAsB,wBAAA,CACpB,OAAA,EACqD;AACrD,EAAA,OAAO,wCAAA,8BAAkB,EAAgC,EAAE,MAAA,EAAQ,KAAA,EAAO,GAAG,QAAQ,CAAC,CAAA;AACxF;AAEA,MAAA,SAAsB,sBAAA,CACpB,UAAA,EACA,OAAA,EACgD;AAChD,EAAA,OAAO,wCAAA,CAAkB,6BAAA,EAAgC,UAAU,CAAA,CAAA;AACrE;AAKkD;AACmB,EAAA;AACrE;AAKE;AAEmE,EAAA;AACrE;AAK0E;AACL,EAAA;AACrE;AAUmD;AACd,EAAA;AACa,EAAA;AACH,IAAA;AACZ,MAAA;AAC/B,IAAA;AACD,EAAA;AACmC,EAAA;AACsB,EAAA;AACM,EAAA;AAClE;AAM8C;AACuB,EAAA;AACrE;AAM8C;AACuB,EAAA;AACrE;AAME;AAEmE,EAAA;AACrE;AAM0E;AACL,EAAA;AACrE;AASE;AAEuD,EAAA;AACzD;AAKE;AAEuD,EAAA;AACzD;AAKE;AAEuD,EAAA;AACzD;AAUuE;AAClC,EAAA;AACe,EAAA;AACL,IAAA;AACZ,MAAA;AAC/B,IAAA;AACD,EAAA;AACmC,EAAA;AAC4B,EAAA;AACA,EAAA;AAClE;AD/FsE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/entity/dist/chunk-SXBB42DJ.js","sourcesContent":[null,"/**\n * Entity API functions\n *\n * Browser-side API client for entity operations.\n * Uses @elqnt/api-client for HTTP requests with automatic token management.\n */\n\nimport { browserApiRequest } from \"@elqnt/api-client/browser\";\nimport type { ApiResponse, ApiClientOptions } from \"@elqnt/api-client\";\nimport type { ResponseMetadata } from \"@elqnt/types\";\nimport type {\n EntityDefinition,\n EntityRecord,\n ListEntityDefinitionsResponse,\n EntityDefinitionResponse,\n ListEntityRecordsResponse,\n EntityRecordResponse,\n} from \"../models\";\n\n// =============================================================================\n// ENTITY DEFINITIONS\n// =============================================================================\n\nexport async function listEntityDefinitionsApi(\n options: ApiClientOptions\n): Promise<ApiResponse<ListEntityDefinitionsResponse>> {\n return browserApiRequest(\"/api/v1/entities/definitions\", { method: \"GET\", ...options });\n}\n\nexport async function getEntityDefinitionApi(\n entityName: string,\n options: ApiClientOptions\n): Promise<ApiResponse<EntityDefinitionResponse>> {\n return browserApiRequest(`/api/v1/entities/definitions/${entityName}`, { method: \"GET\", ...options });\n}\n\nexport async function createEntityDefinitionApi(\n definition: Partial<EntityDefinition>,\n options: ApiClientOptions\n): Promise<ApiResponse<EntityDefinitionResponse>> {\n return browserApiRequest(\"/api/v1/entities/definitions\", { method: \"POST\", body: definition, ...options });\n}\n\nexport async function updateEntityDefinitionApi(\n entityName: string,\n definition: Partial<EntityDefinition>,\n options: ApiClientOptions\n): Promise<ApiResponse<EntityDefinitionResponse>> {\n return browserApiRequest(`/api/v1/entities/definitions/${entityName}`, { method: \"PUT\", body: definition, ...options });\n}\n\nexport async function deleteEntityDefinitionApi(\n entityName: string,\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/entities/definitions/${entityName}`, { method: \"DELETE\", ...options });\n}\n\n// =============================================================================\n// ENTITY RECORDS\n// =============================================================================\n\nexport async function queryEntityRecordsApi(\n entityName: string,\n query: Record<string, unknown>,\n options: ApiClientOptions\n): Promise<ApiResponse<ListEntityRecordsResponse>> {\n const params = new URLSearchParams();\n Object.entries(query).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n params.set(key, String(value));\n }\n });\n const queryString = params.toString();\n const endpoint = `/api/v1/entities/${entityName}/records${queryString ? `?${queryString}` : \"\"}`;\n return browserApiRequest(endpoint, { method: \"GET\", ...options });\n}\n\nexport async function getEntityRecordApi(\n entityName: string,\n recordId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<EntityRecordResponse>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records/${recordId}`, { method: \"GET\", ...options });\n}\n\nexport async function createEntityRecordApi(\n entityName: string,\n record: Partial<EntityRecord>,\n options: ApiClientOptions\n): Promise<ApiResponse<EntityRecordResponse>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records`, { method: \"POST\", body: record, ...options });\n}\n\nexport async function updateEntityRecordApi(\n entityName: string,\n recordId: string,\n record: Partial<EntityRecord>,\n options: ApiClientOptions\n): Promise<ApiResponse<EntityRecordResponse>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records/${recordId}`, { method: \"PUT\", body: record, ...options });\n}\n\nexport async function deleteEntityRecordApi(\n entityName: string,\n recordId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records/${recordId}`, { method: \"DELETE\", ...options });\n}\n\n// =============================================================================\n// BULK OPERATIONS\n// =============================================================================\n\nexport async function bulkCreateEntityRecordsApi(\n entityName: string,\n records: Partial<EntityRecord>[],\n options: ApiClientOptions\n): Promise<ApiResponse<{ records: EntityRecord[]; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records/bulk`, { method: \"POST\", body: { records }, ...options });\n}\n\nexport async function bulkUpdateEntityRecordsApi(\n entityName: string,\n records: Partial<EntityRecord>[],\n options: ApiClientOptions\n): Promise<ApiResponse<{ records: EntityRecord[]; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records/bulk`, { method: \"PUT\", body: { records }, ...options });\n}\n\nexport async function bulkDeleteEntityRecordsApi(\n entityName: string,\n recordIds: string[],\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records/bulk`, { method: \"DELETE\", body: { recordIds }, ...options });\n}\n\n// =============================================================================\n// COUNT\n// =============================================================================\n\nexport async function countEntityRecordsApi(\n entityName: string,\n filters: Record<string, unknown>,\n options: ApiClientOptions\n): Promise<ApiResponse<{ count: number; metadata: ResponseMetadata }>> {\n const params = new URLSearchParams();\n Object.entries(filters).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n params.set(key, String(value));\n }\n });\n const queryString = params.toString();\n const endpoint = `/api/v1/entities/${entityName}/records/count${queryString ? `?${queryString}` : \"\"}`;\n return browserApiRequest(endpoint, { method: \"GET\", ...options });\n}\n"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// api/index.ts
|
|
4
|
+
import { browserApiRequest } from "@elqnt/api-client/browser";
|
|
5
|
+
async function listEntityDefinitionsApi(options) {
|
|
6
|
+
return browserApiRequest("/api/v1/entities/definitions", { method: "GET", ...options });
|
|
7
|
+
}
|
|
8
|
+
async function getEntityDefinitionApi(entityName, options) {
|
|
9
|
+
return browserApiRequest(`/api/v1/entities/definitions/${entityName}`, { method: "GET", ...options });
|
|
10
|
+
}
|
|
11
|
+
async function createEntityDefinitionApi(definition, options) {
|
|
12
|
+
return browserApiRequest("/api/v1/entities/definitions", { method: "POST", body: definition, ...options });
|
|
13
|
+
}
|
|
14
|
+
async function updateEntityDefinitionApi(entityName, definition, options) {
|
|
15
|
+
return browserApiRequest(`/api/v1/entities/definitions/${entityName}`, { method: "PUT", body: definition, ...options });
|
|
16
|
+
}
|
|
17
|
+
async function deleteEntityDefinitionApi(entityName, options) {
|
|
18
|
+
return browserApiRequest(`/api/v1/entities/definitions/${entityName}`, { method: "DELETE", ...options });
|
|
19
|
+
}
|
|
20
|
+
async function queryEntityRecordsApi(entityName, query, options) {
|
|
21
|
+
const params = new URLSearchParams();
|
|
22
|
+
Object.entries(query).forEach(([key, value]) => {
|
|
23
|
+
if (value !== void 0 && value !== null) {
|
|
24
|
+
params.set(key, String(value));
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const queryString = params.toString();
|
|
28
|
+
const endpoint = `/api/v1/entities/${entityName}/records${queryString ? `?${queryString}` : ""}`;
|
|
29
|
+
return browserApiRequest(endpoint, { method: "GET", ...options });
|
|
30
|
+
}
|
|
31
|
+
async function getEntityRecordApi(entityName, recordId, options) {
|
|
32
|
+
return browserApiRequest(`/api/v1/entities/${entityName}/records/${recordId}`, { method: "GET", ...options });
|
|
33
|
+
}
|
|
34
|
+
async function createEntityRecordApi(entityName, record, options) {
|
|
35
|
+
return browserApiRequest(`/api/v1/entities/${entityName}/records`, { method: "POST", body: record, ...options });
|
|
36
|
+
}
|
|
37
|
+
async function updateEntityRecordApi(entityName, recordId, record, options) {
|
|
38
|
+
return browserApiRequest(`/api/v1/entities/${entityName}/records/${recordId}`, { method: "PUT", body: record, ...options });
|
|
39
|
+
}
|
|
40
|
+
async function deleteEntityRecordApi(entityName, recordId, options) {
|
|
41
|
+
return browserApiRequest(`/api/v1/entities/${entityName}/records/${recordId}`, { method: "DELETE", ...options });
|
|
42
|
+
}
|
|
43
|
+
async function bulkCreateEntityRecordsApi(entityName, records, options) {
|
|
44
|
+
return browserApiRequest(`/api/v1/entities/${entityName}/records/bulk`, { method: "POST", body: { records }, ...options });
|
|
45
|
+
}
|
|
46
|
+
async function bulkUpdateEntityRecordsApi(entityName, records, options) {
|
|
47
|
+
return browserApiRequest(`/api/v1/entities/${entityName}/records/bulk`, { method: "PUT", body: { records }, ...options });
|
|
48
|
+
}
|
|
49
|
+
async function bulkDeleteEntityRecordsApi(entityName, recordIds, options) {
|
|
50
|
+
return browserApiRequest(`/api/v1/entities/${entityName}/records/bulk`, { method: "DELETE", body: { recordIds }, ...options });
|
|
51
|
+
}
|
|
52
|
+
async function countEntityRecordsApi(entityName, filters, options) {
|
|
53
|
+
const params = new URLSearchParams();
|
|
54
|
+
Object.entries(filters).forEach(([key, value]) => {
|
|
55
|
+
if (value !== void 0 && value !== null) {
|
|
56
|
+
params.set(key, String(value));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
const queryString = params.toString();
|
|
60
|
+
const endpoint = `/api/v1/entities/${entityName}/records/count${queryString ? `?${queryString}` : ""}`;
|
|
61
|
+
return browserApiRequest(endpoint, { method: "GET", ...options });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
listEntityDefinitionsApi,
|
|
66
|
+
getEntityDefinitionApi,
|
|
67
|
+
createEntityDefinitionApi,
|
|
68
|
+
updateEntityDefinitionApi,
|
|
69
|
+
deleteEntityDefinitionApi,
|
|
70
|
+
queryEntityRecordsApi,
|
|
71
|
+
getEntityRecordApi,
|
|
72
|
+
createEntityRecordApi,
|
|
73
|
+
updateEntityRecordApi,
|
|
74
|
+
deleteEntityRecordApi,
|
|
75
|
+
bulkCreateEntityRecordsApi,
|
|
76
|
+
bulkUpdateEntityRecordsApi,
|
|
77
|
+
bulkDeleteEntityRecordsApi,
|
|
78
|
+
countEntityRecordsApi
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=chunk-UHASYUCH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../api/index.ts"],"sourcesContent":["/**\n * Entity API functions\n *\n * Browser-side API client for entity operations.\n * Uses @elqnt/api-client for HTTP requests with automatic token management.\n */\n\nimport { browserApiRequest } from \"@elqnt/api-client/browser\";\nimport type { ApiResponse, ApiClientOptions } from \"@elqnt/api-client\";\nimport type { ResponseMetadata } from \"@elqnt/types\";\nimport type {\n EntityDefinition,\n EntityRecord,\n ListEntityDefinitionsResponse,\n EntityDefinitionResponse,\n ListEntityRecordsResponse,\n EntityRecordResponse,\n} from \"../models\";\n\n// =============================================================================\n// ENTITY DEFINITIONS\n// =============================================================================\n\nexport async function listEntityDefinitionsApi(\n options: ApiClientOptions\n): Promise<ApiResponse<ListEntityDefinitionsResponse>> {\n return browserApiRequest(\"/api/v1/entities/definitions\", { method: \"GET\", ...options });\n}\n\nexport async function getEntityDefinitionApi(\n entityName: string,\n options: ApiClientOptions\n): Promise<ApiResponse<EntityDefinitionResponse>> {\n return browserApiRequest(`/api/v1/entities/definitions/${entityName}`, { method: \"GET\", ...options });\n}\n\nexport async function createEntityDefinitionApi(\n definition: Partial<EntityDefinition>,\n options: ApiClientOptions\n): Promise<ApiResponse<EntityDefinitionResponse>> {\n return browserApiRequest(\"/api/v1/entities/definitions\", { method: \"POST\", body: definition, ...options });\n}\n\nexport async function updateEntityDefinitionApi(\n entityName: string,\n definition: Partial<EntityDefinition>,\n options: ApiClientOptions\n): Promise<ApiResponse<EntityDefinitionResponse>> {\n return browserApiRequest(`/api/v1/entities/definitions/${entityName}`, { method: \"PUT\", body: definition, ...options });\n}\n\nexport async function deleteEntityDefinitionApi(\n entityName: string,\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/entities/definitions/${entityName}`, { method: \"DELETE\", ...options });\n}\n\n// =============================================================================\n// ENTITY RECORDS\n// =============================================================================\n\nexport async function queryEntityRecordsApi(\n entityName: string,\n query: Record<string, unknown>,\n options: ApiClientOptions\n): Promise<ApiResponse<ListEntityRecordsResponse>> {\n const params = new URLSearchParams();\n Object.entries(query).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n params.set(key, String(value));\n }\n });\n const queryString = params.toString();\n const endpoint = `/api/v1/entities/${entityName}/records${queryString ? `?${queryString}` : \"\"}`;\n return browserApiRequest(endpoint, { method: \"GET\", ...options });\n}\n\nexport async function getEntityRecordApi(\n entityName: string,\n recordId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<EntityRecordResponse>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records/${recordId}`, { method: \"GET\", ...options });\n}\n\nexport async function createEntityRecordApi(\n entityName: string,\n record: Partial<EntityRecord>,\n options: ApiClientOptions\n): Promise<ApiResponse<EntityRecordResponse>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records`, { method: \"POST\", body: record, ...options });\n}\n\nexport async function updateEntityRecordApi(\n entityName: string,\n recordId: string,\n record: Partial<EntityRecord>,\n options: ApiClientOptions\n): Promise<ApiResponse<EntityRecordResponse>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records/${recordId}`, { method: \"PUT\", body: record, ...options });\n}\n\nexport async function deleteEntityRecordApi(\n entityName: string,\n recordId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records/${recordId}`, { method: \"DELETE\", ...options });\n}\n\n// =============================================================================\n// BULK OPERATIONS\n// =============================================================================\n\nexport async function bulkCreateEntityRecordsApi(\n entityName: string,\n records: Partial<EntityRecord>[],\n options: ApiClientOptions\n): Promise<ApiResponse<{ records: EntityRecord[]; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records/bulk`, { method: \"POST\", body: { records }, ...options });\n}\n\nexport async function bulkUpdateEntityRecordsApi(\n entityName: string,\n records: Partial<EntityRecord>[],\n options: ApiClientOptions\n): Promise<ApiResponse<{ records: EntityRecord[]; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records/bulk`, { method: \"PUT\", body: { records }, ...options });\n}\n\nexport async function bulkDeleteEntityRecordsApi(\n entityName: string,\n recordIds: string[],\n options: ApiClientOptions\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/entities/${entityName}/records/bulk`, { method: \"DELETE\", body: { recordIds }, ...options });\n}\n\n// =============================================================================\n// COUNT\n// =============================================================================\n\nexport async function countEntityRecordsApi(\n entityName: string,\n filters: Record<string, unknown>,\n options: ApiClientOptions\n): Promise<ApiResponse<{ count: number; metadata: ResponseMetadata }>> {\n const params = new URLSearchParams();\n Object.entries(filters).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n params.set(key, String(value));\n }\n });\n const queryString = params.toString();\n const endpoint = `/api/v1/entities/${entityName}/records/count${queryString ? `?${queryString}` : \"\"}`;\n return browserApiRequest(endpoint, { method: \"GET\", ...options });\n}\n"],"mappings":"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","names":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ApiClientOptions } from '@elqnt/api-client';
|
|
2
|
+
import { EntityRecord, EntityDefinition } from '../models/index.mjs';
|
|
3
|
+
import '@elqnt/types';
|
|
4
|
+
|
|
5
|
+
type UseEntitiesOptions = ApiClientOptions;
|
|
6
|
+
interface QueryOptions {
|
|
7
|
+
page?: number;
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
filters?: Record<string, unknown>;
|
|
10
|
+
sortBy?: string;
|
|
11
|
+
sortOrder?: "asc" | "desc";
|
|
12
|
+
}
|
|
13
|
+
interface QueryResult {
|
|
14
|
+
records: EntityRecord[];
|
|
15
|
+
total: number;
|
|
16
|
+
page: number;
|
|
17
|
+
pageSize: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Hook for entity CRUD operations
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const { loading, error, queryRecords, createRecord } = useEntities({
|
|
25
|
+
* baseUrl: apiGatewayUrl,
|
|
26
|
+
* orgId: selectedOrgId,
|
|
27
|
+
* userId: user?.id,
|
|
28
|
+
* userEmail: user?.email,
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* const records = await queryRecords("contacts", { page: 1, pageSize: 20 });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare function useEntities(options: UseEntitiesOptions): {
|
|
35
|
+
loading: boolean;
|
|
36
|
+
error: string | null;
|
|
37
|
+
listDefinitions: () => Promise<EntityDefinition[]>;
|
|
38
|
+
getDefinition: (entityName: string) => Promise<EntityDefinition | null>;
|
|
39
|
+
queryRecords: (entityName: string, query?: QueryOptions) => Promise<QueryResult>;
|
|
40
|
+
getRecord: (entityName: string, recordId: string) => Promise<EntityRecord | null>;
|
|
41
|
+
createRecord: (entityName: string, record: Partial<EntityRecord>) => Promise<EntityRecord | null>;
|
|
42
|
+
updateRecord: (entityName: string, recordId: string, record: Partial<EntityRecord>) => Promise<EntityRecord | null>;
|
|
43
|
+
deleteRecord: (entityName: string, recordId: string) => Promise<boolean>;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { type QueryOptions, type QueryResult, type UseEntitiesOptions, useEntities };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ApiClientOptions } from '@elqnt/api-client';
|
|
2
|
+
import { EntityRecord, EntityDefinition } from '../models/index.js';
|
|
3
|
+
import '@elqnt/types';
|
|
4
|
+
|
|
5
|
+
type UseEntitiesOptions = ApiClientOptions;
|
|
6
|
+
interface QueryOptions {
|
|
7
|
+
page?: number;
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
filters?: Record<string, unknown>;
|
|
10
|
+
sortBy?: string;
|
|
11
|
+
sortOrder?: "asc" | "desc";
|
|
12
|
+
}
|
|
13
|
+
interface QueryResult {
|
|
14
|
+
records: EntityRecord[];
|
|
15
|
+
total: number;
|
|
16
|
+
page: number;
|
|
17
|
+
pageSize: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Hook for entity CRUD operations
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* const { loading, error, queryRecords, createRecord } = useEntities({
|
|
25
|
+
* baseUrl: apiGatewayUrl,
|
|
26
|
+
* orgId: selectedOrgId,
|
|
27
|
+
* userId: user?.id,
|
|
28
|
+
* userEmail: user?.email,
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* const records = await queryRecords("contacts", { page: 1, pageSize: 20 });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare function useEntities(options: UseEntitiesOptions): {
|
|
35
|
+
loading: boolean;
|
|
36
|
+
error: string | null;
|
|
37
|
+
listDefinitions: () => Promise<EntityDefinition[]>;
|
|
38
|
+
getDefinition: (entityName: string) => Promise<EntityDefinition | null>;
|
|
39
|
+
queryRecords: (entityName: string, query?: QueryOptions) => Promise<QueryResult>;
|
|
40
|
+
getRecord: (entityName: string, recordId: string) => Promise<EntityRecord | null>;
|
|
41
|
+
createRecord: (entityName: string, record: Partial<EntityRecord>) => Promise<EntityRecord | null>;
|
|
42
|
+
updateRecord: (entityName: string, recordId: string, record: Partial<EntityRecord>) => Promise<EntityRecord | null>;
|
|
43
|
+
deleteRecord: (entityName: string, recordId: string) => Promise<boolean>;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { type QueryOptions, type QueryResult, type UseEntitiesOptions, useEntities };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkGQJJP4YLjs = require('../chunk-GQJJP4YL.js');
|
|
6
|
+
require('../chunk-SXBB42DJ.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.useEntities = _chunkGQJJP4YLjs.useEntities;
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/eloquent/eloquent/packages/@elqnt/entity/dist/hooks/index.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY;AACZ;AACE;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,mDAAC","file":"/home/runner/work/eloquent/eloquent/packages/@elqnt/entity/dist/hooks/index.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { EntityDefinition, EntityView, EntityRecord, EntityQuery, ListResult } from './models/index.mjs';
|
|
2
2
|
export { BulkCreateRequest, BulkDeleteRequest, BulkUpdateRequest, CountEntityRecordsRequest, CountEntityRecordsResponse, CreateEntityDefinitionRequest, CreateOrgSchemaRequest, CreateOrgSchemaResponse, CreateRecordRequest, CreateViewRequest, DeleteEntityDefinitionRequest, DeleteRecordRequest, DeleteViewRequest, DropOrgSchemaRequest, DropOrgSchemaResponse, EntityDefinitionChangeEvent, EntityDefinitionCreate, EntityDefinitionCreated, EntityDefinitionDelete, EntityDefinitionDeleted, EntityDefinitionGet, EntityDefinitionGetServer, EntityDefinitionList, EntityDefinitionResponse, EntityDefinitionUpdate, EntityDefinitionUpdated, EntityFieldType, EntityFieldTypeBool, EntityFieldTypeCurrency, EntityFieldTypeDate, EntityFieldTypeDateTime, EntityFieldTypeDropdown, EntityFieldTypeEmail, EntityFieldTypeFile, EntityFieldTypeFloat, EntityFieldTypeImage, EntityFieldTypeInt, EntityFieldTypeJSON, EntityFieldTypeLookup, EntityFieldTypeMultiLookup, EntityFieldTypeMultiSelect, EntityFieldTypeOptionTS, EntityFieldTypePhone, EntityFieldTypeString, EntityFieldTypeStringMultiline, EntityFieldTypeTS, EntityFieldTypeText, EntityFieldTypeURL, EntityFieldTypes, EntityFilterOperator, EntityFilterOperatorOptionTS, EntityFilterOperatorTS, EntityFilterOperators, EntityOrgSchemaCreate, EntityOrgSchemaDrop, EntityRecordChangeEvent, EntityRecordCount, EntityRecordCreate, EntityRecordCreated, EntityRecordDelete, EntityRecordDeleted, EntityRecordGet, EntityRecordQuery, EntityRecordResponse, EntityRecordUpdate, EntityRecordUpdated, EntityRecordsBulkCreate, EntityRecordsBulkCreated, EntityRecordsBulkDelete, EntityRecordsBulkDeleted, EntityRecordsBulkUpdate, EntityRecordsBulkUpdated, EntityViewChangeEvent, EntityViewCreate, EntityViewCreated, EntityViewDelete, EntityViewDeleted, EntityViewList, EntityViewResponse, EntityViewUpdate, EntityViewUpdated, FieldValidation, Filter, GetEntityDefinitionRequest, GetEntityRecordRequest, GetEntityRecordResponse, GetViewRequest, InsertOneResult, ListEntityDefinitionsRequest, ListEntityDefinitionsResponse, ListEntityRecordsResponse, ListOptions, ListViewsRequest, ListViewsResponse, LookupInclude, OperatorBetween, OperatorContains, OperatorEmpty, OperatorEndsWith, OperatorEq, OperatorExists, OperatorGt, OperatorGte, OperatorIn, OperatorLt, OperatorLte, OperatorNe, OperatorNin, OperatorStartsWith, QueryRequest, RecordChange, RecordChangeAction, RecordChangeActionCreated, RecordChangeActionDeleted, RecordChangeActionUpdated, RecordReference, ResponseMetadata, Sort, UpdateEntityDefinitionRequest, UpdateRecordRequest, UpdateViewRequest, ValidationRule, ValidationRuleCondition, View, ViewColumn, ViewFilter } from './models/index.mjs';
|
|
3
|
-
|
|
3
|
+
export { bulkCreateEntityRecordsApi, bulkDeleteEntityRecordsApi, bulkUpdateEntityRecordsApi, countEntityRecordsApi, createEntityDefinitionApi, createEntityRecordApi, deleteEntityDefinitionApi, deleteEntityRecordApi, getEntityDefinitionApi, getEntityRecordApi, listEntityDefinitionsApi, queryEntityRecordsApi, updateEntityDefinitionApi, updateEntityRecordApi } from './api/index.mjs';
|
|
4
|
+
export { QueryOptions, QueryResult, UseEntitiesOptions, useEntities } from './hooks/index.mjs';
|
|
5
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
4
6
|
import '@elqnt/types';
|
|
7
|
+
import '@elqnt/api-client';
|
|
5
8
|
|
|
6
9
|
interface EntityDefinitionState {
|
|
7
10
|
definitions: Record<string, EntityDefinition>;
|
|
@@ -15,7 +18,7 @@ interface EntityDefinitionState {
|
|
|
15
18
|
interface EntityDefinitionSelector {
|
|
16
19
|
entityDefinition: EntityDefinitionState;
|
|
17
20
|
}
|
|
18
|
-
declare const entityDefinitionReducer:
|
|
21
|
+
declare const entityDefinitionReducer: _reduxjs_toolkit.Reducer<EntityDefinitionState>;
|
|
19
22
|
|
|
20
23
|
interface EntityRecordState {
|
|
21
24
|
records: {
|
|
@@ -35,7 +38,7 @@ interface EntityRecordState {
|
|
|
35
38
|
interface EntityRecordSelector {
|
|
36
39
|
entityRecord: EntityRecordState;
|
|
37
40
|
}
|
|
38
|
-
declare const entityRecordReducer:
|
|
41
|
+
declare const entityRecordReducer: _reduxjs_toolkit.Reducer<EntityRecordState>;
|
|
39
42
|
|
|
40
43
|
declare const PREDEFINED_COLORS: {
|
|
41
44
|
value: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { EntityDefinition, EntityView, EntityRecord, EntityQuery, ListResult } from './models/index.js';
|
|
2
2
|
export { BulkCreateRequest, BulkDeleteRequest, BulkUpdateRequest, CountEntityRecordsRequest, CountEntityRecordsResponse, CreateEntityDefinitionRequest, CreateOrgSchemaRequest, CreateOrgSchemaResponse, CreateRecordRequest, CreateViewRequest, DeleteEntityDefinitionRequest, DeleteRecordRequest, DeleteViewRequest, DropOrgSchemaRequest, DropOrgSchemaResponse, EntityDefinitionChangeEvent, EntityDefinitionCreate, EntityDefinitionCreated, EntityDefinitionDelete, EntityDefinitionDeleted, EntityDefinitionGet, EntityDefinitionGetServer, EntityDefinitionList, EntityDefinitionResponse, EntityDefinitionUpdate, EntityDefinitionUpdated, EntityFieldType, EntityFieldTypeBool, EntityFieldTypeCurrency, EntityFieldTypeDate, EntityFieldTypeDateTime, EntityFieldTypeDropdown, EntityFieldTypeEmail, EntityFieldTypeFile, EntityFieldTypeFloat, EntityFieldTypeImage, EntityFieldTypeInt, EntityFieldTypeJSON, EntityFieldTypeLookup, EntityFieldTypeMultiLookup, EntityFieldTypeMultiSelect, EntityFieldTypeOptionTS, EntityFieldTypePhone, EntityFieldTypeString, EntityFieldTypeStringMultiline, EntityFieldTypeTS, EntityFieldTypeText, EntityFieldTypeURL, EntityFieldTypes, EntityFilterOperator, EntityFilterOperatorOptionTS, EntityFilterOperatorTS, EntityFilterOperators, EntityOrgSchemaCreate, EntityOrgSchemaDrop, EntityRecordChangeEvent, EntityRecordCount, EntityRecordCreate, EntityRecordCreated, EntityRecordDelete, EntityRecordDeleted, EntityRecordGet, EntityRecordQuery, EntityRecordResponse, EntityRecordUpdate, EntityRecordUpdated, EntityRecordsBulkCreate, EntityRecordsBulkCreated, EntityRecordsBulkDelete, EntityRecordsBulkDeleted, EntityRecordsBulkUpdate, EntityRecordsBulkUpdated, EntityViewChangeEvent, EntityViewCreate, EntityViewCreated, EntityViewDelete, EntityViewDeleted, EntityViewList, EntityViewResponse, EntityViewUpdate, EntityViewUpdated, FieldValidation, Filter, GetEntityDefinitionRequest, GetEntityRecordRequest, GetEntityRecordResponse, GetViewRequest, InsertOneResult, ListEntityDefinitionsRequest, ListEntityDefinitionsResponse, ListEntityRecordsResponse, ListOptions, ListViewsRequest, ListViewsResponse, LookupInclude, OperatorBetween, OperatorContains, OperatorEmpty, OperatorEndsWith, OperatorEq, OperatorExists, OperatorGt, OperatorGte, OperatorIn, OperatorLt, OperatorLte, OperatorNe, OperatorNin, OperatorStartsWith, QueryRequest, RecordChange, RecordChangeAction, RecordChangeActionCreated, RecordChangeActionDeleted, RecordChangeActionUpdated, RecordReference, ResponseMetadata, Sort, UpdateEntityDefinitionRequest, UpdateRecordRequest, UpdateViewRequest, ValidationRule, ValidationRuleCondition, View, ViewColumn, ViewFilter } from './models/index.js';
|
|
3
|
-
|
|
3
|
+
export { bulkCreateEntityRecordsApi, bulkDeleteEntityRecordsApi, bulkUpdateEntityRecordsApi, countEntityRecordsApi, createEntityDefinitionApi, createEntityRecordApi, deleteEntityDefinitionApi, deleteEntityRecordApi, getEntityDefinitionApi, getEntityRecordApi, listEntityDefinitionsApi, queryEntityRecordsApi, updateEntityDefinitionApi, updateEntityRecordApi } from './api/index.js';
|
|
4
|
+
export { QueryOptions, QueryResult, UseEntitiesOptions, useEntities } from './hooks/index.js';
|
|
5
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
4
6
|
import '@elqnt/types';
|
|
7
|
+
import '@elqnt/api-client';
|
|
5
8
|
|
|
6
9
|
interface EntityDefinitionState {
|
|
7
10
|
definitions: Record<string, EntityDefinition>;
|
|
@@ -15,7 +18,7 @@ interface EntityDefinitionState {
|
|
|
15
18
|
interface EntityDefinitionSelector {
|
|
16
19
|
entityDefinition: EntityDefinitionState;
|
|
17
20
|
}
|
|
18
|
-
declare const entityDefinitionReducer:
|
|
21
|
+
declare const entityDefinitionReducer: _reduxjs_toolkit.Reducer<EntityDefinitionState>;
|
|
19
22
|
|
|
20
23
|
interface EntityRecordState {
|
|
21
24
|
records: {
|
|
@@ -35,7 +38,7 @@ interface EntityRecordState {
|
|
|
35
38
|
interface EntityRecordSelector {
|
|
36
39
|
entityRecord: EntityRecordState;
|
|
37
40
|
}
|
|
38
|
-
declare const entityRecordReducer:
|
|
41
|
+
declare const entityRecordReducer: _reduxjs_toolkit.Reducer<EntityRecordState>;
|
|
39
42
|
|
|
40
43
|
declare const PREDEFINED_COLORS: {
|
|
41
44
|
value: string;
|