cmx-sdk 0.1.5 → 0.1.6
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/lib/api-client.js +9 -9
- package/package.json +1 -1
- package/src/lib/api-client.ts +10 -10
package/dist/lib/api-client.js
CHANGED
|
@@ -9,7 +9,7 @@ export class AdminApiClient {
|
|
|
9
9
|
constructor(config) {
|
|
10
10
|
this.apiUrl = config.apiUrl.replace(/\/$/, "");
|
|
11
11
|
this.apiKey = config.apiKey;
|
|
12
|
-
this.basePath = config.basePath || "/api/v1/sdk
|
|
12
|
+
this.basePath = config.basePath || "/api/v1/sdk";
|
|
13
13
|
}
|
|
14
14
|
async request(method, path, body) {
|
|
15
15
|
// パスが / で始まる場合は basePath を使わない(絶対パス)
|
|
@@ -34,31 +34,31 @@ export class AdminApiClient {
|
|
|
34
34
|
}
|
|
35
35
|
// Collections
|
|
36
36
|
async listCollections() {
|
|
37
|
-
return this.request("GET", "/collections");
|
|
37
|
+
return this.request("GET", "/manage/collections");
|
|
38
38
|
}
|
|
39
39
|
async createCollection(data) {
|
|
40
|
-
return this.request("POST", "/collections", data);
|
|
40
|
+
return this.request("POST", "/manage/collections", data);
|
|
41
41
|
}
|
|
42
42
|
// Data Types
|
|
43
43
|
async listDataTypes() {
|
|
44
|
-
return this.request("GET", "/data-types");
|
|
44
|
+
return this.request("GET", "/manage/data-types");
|
|
45
45
|
}
|
|
46
46
|
async createDataType(data) {
|
|
47
|
-
return this.request("POST", "/data-types", data);
|
|
47
|
+
return this.request("POST", "/manage/data-types", data);
|
|
48
48
|
}
|
|
49
49
|
// Form Definitions
|
|
50
50
|
async listFormDefinitions() {
|
|
51
|
-
return this.request("GET", "/form-definitions");
|
|
51
|
+
return this.request("GET", "/manage/form-definitions");
|
|
52
52
|
}
|
|
53
53
|
async createFormDefinition(data) {
|
|
54
|
-
return this.request("POST", "/form-definitions", data);
|
|
54
|
+
return this.request("POST", "/manage/form-definitions", data);
|
|
55
55
|
}
|
|
56
56
|
// Custom Components
|
|
57
57
|
async listCustomComponents() {
|
|
58
|
-
return this.request("GET", "/components");
|
|
58
|
+
return this.request("GET", "/manage/components");
|
|
59
59
|
}
|
|
60
60
|
async syncComponents(data) {
|
|
61
|
-
return this.request("POST", "/components/sync", data);
|
|
61
|
+
return this.request("POST", "/manage/components/sync", data);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
export function createApiClient() {
|
package/package.json
CHANGED
package/src/lib/api-client.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
interface ApiClientConfig {
|
|
8
8
|
apiUrl: string
|
|
9
9
|
apiKey: string
|
|
10
|
-
basePath?: string // デフォルト: /api/v1/sdk
|
|
10
|
+
basePath?: string // デフォルト: /api/v1/sdk
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export class AdminApiClient {
|
|
@@ -18,7 +18,7 @@ export class AdminApiClient {
|
|
|
18
18
|
constructor(config: ApiClientConfig) {
|
|
19
19
|
this.apiUrl = config.apiUrl.replace(/\/$/, "")
|
|
20
20
|
this.apiKey = config.apiKey
|
|
21
|
-
this.basePath = config.basePath || "/api/v1/sdk
|
|
21
|
+
this.basePath = config.basePath || "/api/v1/sdk"
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
private async request(method: string, path: string, body?: unknown) {
|
|
@@ -50,7 +50,7 @@ export class AdminApiClient {
|
|
|
50
50
|
|
|
51
51
|
// Collections
|
|
52
52
|
async listCollections() {
|
|
53
|
-
return this.request("GET", "/collections")
|
|
53
|
+
return this.request("GET", "/manage/collections")
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
async createCollection(data: {
|
|
@@ -59,12 +59,12 @@ export class AdminApiClient {
|
|
|
59
59
|
name: string
|
|
60
60
|
description?: string
|
|
61
61
|
}) {
|
|
62
|
-
return this.request("POST", "/collections", data)
|
|
62
|
+
return this.request("POST", "/manage/collections", data)
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
// Data Types
|
|
66
66
|
async listDataTypes() {
|
|
67
|
-
return this.request("GET", "/data-types")
|
|
67
|
+
return this.request("GET", "/manage/data-types")
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
async createDataType(data: {
|
|
@@ -80,12 +80,12 @@ export class AdminApiClient {
|
|
|
80
80
|
options?: Record<string, unknown>
|
|
81
81
|
}>
|
|
82
82
|
}) {
|
|
83
|
-
return this.request("POST", "/data-types", data)
|
|
83
|
+
return this.request("POST", "/manage/data-types", data)
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// Form Definitions
|
|
87
87
|
async listFormDefinitions() {
|
|
88
|
-
return this.request("GET", "/form-definitions")
|
|
88
|
+
return this.request("GET", "/manage/form-definitions")
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
async createFormDefinition(data: {
|
|
@@ -101,12 +101,12 @@ export class AdminApiClient {
|
|
|
101
101
|
options?: Record<string, unknown>
|
|
102
102
|
}>
|
|
103
103
|
}) {
|
|
104
|
-
return this.request("POST", "/form-definitions", data)
|
|
104
|
+
return this.request("POST", "/manage/form-definitions", data)
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
// Custom Components
|
|
108
108
|
async listCustomComponents() {
|
|
109
|
-
return this.request("GET", "/components")
|
|
109
|
+
return this.request("GET", "/manage/components")
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
async syncComponents(data: {
|
|
@@ -118,7 +118,7 @@ export class AdminApiClient {
|
|
|
118
118
|
examples?: string[]
|
|
119
119
|
}>
|
|
120
120
|
}) {
|
|
121
|
-
return this.request("POST", "/components/sync", data)
|
|
121
|
+
return this.request("POST", "/manage/components/sync", data)
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|