@micro-cms/node-adapter 0.0.2 → 0.0.4
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/index.d.ts +4 -1
- package/dist/index.js +1 -1
- package/package.json +7 -5
package/dist/index.d.ts
CHANGED
|
@@ -8,7 +8,10 @@ export declare class NodeDataProvider implements DataProvider {
|
|
|
8
8
|
constructor(config: NodeAdapterConfig);
|
|
9
9
|
private fetchApi;
|
|
10
10
|
introspect(): Promise<Schema>;
|
|
11
|
-
find(entity: string, query?:
|
|
11
|
+
find(entity: string, query?: {
|
|
12
|
+
page?: number;
|
|
13
|
+
limit?: number;
|
|
14
|
+
}): Promise<any>;
|
|
12
15
|
create(entity: string, data: any): Promise<any>;
|
|
13
16
|
update(entity: string, id: any, data: any): Promise<any>;
|
|
14
17
|
delete(entity: string, id: any): Promise<any>;
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ export class NodeDataProvider {
|
|
|
32
32
|
async find(entity, query) {
|
|
33
33
|
const queryString = query ? '?' + new URLSearchParams(query).toString() : '';
|
|
34
34
|
const response = await this.fetchApi(`/admin/resources/${entity}${queryString}`);
|
|
35
|
-
return response;
|
|
35
|
+
return response; // Assuming API returns { data: [], total: ..., page: ..., limit: ... }
|
|
36
36
|
}
|
|
37
37
|
async create(entity, data) {
|
|
38
38
|
return this.fetchApi(`/admin/resources/${entity}`, {
|
package/package.json
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micro-cms/node-adapter",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
|
-
"files": [
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
9
11
|
"exports": {
|
|
10
12
|
".": {
|
|
11
13
|
"types": "./dist/index.d.ts",
|
|
12
14
|
"import": "./dist/index.js",
|
|
13
|
-
|
|
15
|
+
"default": "./dist/index.js"
|
|
14
16
|
}
|
|
15
17
|
},
|
|
16
18
|
"dependencies": {
|
|
17
|
-
"@micro-cms/types": "
|
|
19
|
+
"@micro-cms/types": "^0.0.2"
|
|
18
20
|
},
|
|
19
21
|
"scripts": {
|
|
20
22
|
"build": "tsc",
|
|
@@ -23,4 +25,4 @@
|
|
|
23
25
|
"devDependencies": {
|
|
24
26
|
"typescript": "^5.0.0"
|
|
25
27
|
}
|
|
26
|
-
}
|
|
28
|
+
}
|