@tachybase/plugin-data-source-common 0.23.17 → 0.23.20
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/client/features/rest-api/collection-add/AddCollection.d.ts +1 -2
- package/dist/client/features/rest-api/collection-add/AddCollectionAction.component.d.ts +1 -2
- package/dist/client/features/rest-api/collection-add/CreateCollection.schema.d.ts +27 -27
- package/dist/client/features/rest-api/collection-add/CreateCollection.view.d.ts +1 -2
- package/dist/client/features/rest-api/collection-add/PreviewComponent.d.ts +1 -2
- package/dist/client/features/rest-api/collection-add/PreviewFields.d.ts +2 -2
- package/dist/client/features/rest-api/collection-add/RequestActionItems.provider.d.ts +1 -2
- package/dist/client/features/rest-api/collection-add/getSchemaRequestAction.d.ts +5 -6
- package/dist/client/features/rest-api/collection-delete/DeleteCollection.d.ts +1 -2
- package/dist/client/features/rest-api/collection-delete/DeleteCollectionAction.component.d.ts +1 -2
- package/dist/client/features/rest-api/collection-edit/EditCollection.d.ts +1 -2
- package/dist/client/features/rest-api/collection-edit/EditCollectionAction.component.d.ts +1 -2
- package/dist/client/features/rest-api/collection-edit/EditCollectionForm.view.d.ts +1 -2
- package/dist/client/features/rest-api/form-data-source/DataSourceSettingsForm.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/Debug.provider.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/Debug.schema.d.ts +7 -7
- package/dist/client/features/rest-api/request-configs/debug-area/Debug.view.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/DebugComponent.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/components/AlertError.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/components/DebugResponse.view.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/components/DebugResponseTabs.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/components/DebugResponseTabs.items.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/components/ExtractFieldMetadata.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/components/RequestHeaders.view.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/components/ResponseBody.view.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/components/ResponseHeaders.view.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/components/ResponseTab.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/components/ResponseTab.item.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/debug-area/components/TooltipContainer.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/method-path/FieldMethod.view.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/method-path/FieldPath.schema.d.ts +1 -1
- package/dist/client/features/rest-api/request-configs/method-path/FieldPath.view.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/method-path/MethodPathComponent.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/request-tab/RequestBody.view.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/request-tab/RequestHeaders.view.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/request-tab/RequestParams.view.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/request-tab/RequestTab.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/request-tab/RequestTab.items.d.ts +1 -2
- package/dist/client/features/rest-api/request-configs/request-transformer/ResponseTransformerComponent.d.ts +1 -2
- package/dist/client/forms/msql.d.ts +1 -2
- package/dist/client/forms/pg.d.ts +1 -2
- package/dist/client/index.js +8 -8
- package/dist/externalVersion.js +9 -9
- package/package.json +10 -10
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const AddCollection: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const AddCollection: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const AddCollectionAction: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const AddCollectionAction: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -50,7 +50,7 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
50
50
|
properties: {
|
|
51
51
|
list: {
|
|
52
52
|
type: string;
|
|
53
|
-
'x-decorator': (props: any) => import("react").JSX.Element;
|
|
53
|
+
'x-decorator': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
54
54
|
'x-decorator-props': {
|
|
55
55
|
actionKey: any;
|
|
56
56
|
};
|
|
@@ -74,13 +74,13 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
74
74
|
properties: {
|
|
75
75
|
requestAction: {
|
|
76
76
|
type: string;
|
|
77
|
-
'x-component': (props: any) => import("react").JSX.Element;
|
|
77
|
+
'x-component': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
78
78
|
};
|
|
79
79
|
requestTab: {
|
|
80
80
|
type: string;
|
|
81
81
|
'x-decorator': string;
|
|
82
82
|
title: string;
|
|
83
|
-
'x-component': () => import("react").JSX.Element;
|
|
83
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
84
84
|
'x-decorator-props': {
|
|
85
85
|
tooltip: string;
|
|
86
86
|
};
|
|
@@ -89,14 +89,14 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
89
89
|
type: string;
|
|
90
90
|
'x-decorator': string;
|
|
91
91
|
title: string;
|
|
92
|
-
'x-component': () => import("react").JSX.Element;
|
|
92
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
93
93
|
'x-decorator-props': {
|
|
94
94
|
tooltip: string;
|
|
95
95
|
};
|
|
96
96
|
};
|
|
97
97
|
debug: {
|
|
98
98
|
type: string;
|
|
99
|
-
'x-component': () => import("react").JSX.Element;
|
|
99
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
100
100
|
};
|
|
101
101
|
};
|
|
102
102
|
};
|
|
@@ -106,7 +106,7 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
106
106
|
};
|
|
107
107
|
get: {
|
|
108
108
|
type: string;
|
|
109
|
-
'x-decorator': (props: any) => import("react").JSX.Element;
|
|
109
|
+
'x-decorator': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
110
110
|
'x-decorator-props': {
|
|
111
111
|
actionKey: any;
|
|
112
112
|
};
|
|
@@ -130,13 +130,13 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
130
130
|
properties: {
|
|
131
131
|
requestAction: {
|
|
132
132
|
type: string;
|
|
133
|
-
'x-component': (props: any) => import("react").JSX.Element;
|
|
133
|
+
'x-component': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
134
134
|
};
|
|
135
135
|
requestTab: {
|
|
136
136
|
type: string;
|
|
137
137
|
'x-decorator': string;
|
|
138
138
|
title: string;
|
|
139
|
-
'x-component': () => import("react").JSX.Element;
|
|
139
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
140
140
|
'x-decorator-props': {
|
|
141
141
|
tooltip: string;
|
|
142
142
|
};
|
|
@@ -145,14 +145,14 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
145
145
|
type: string;
|
|
146
146
|
'x-decorator': string;
|
|
147
147
|
title: string;
|
|
148
|
-
'x-component': () => import("react").JSX.Element;
|
|
148
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
149
149
|
'x-decorator-props': {
|
|
150
150
|
tooltip: string;
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
153
|
debug: {
|
|
154
154
|
type: string;
|
|
155
|
-
'x-component': () => import("react").JSX.Element;
|
|
155
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
156
156
|
};
|
|
157
157
|
};
|
|
158
158
|
};
|
|
@@ -162,7 +162,7 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
162
162
|
};
|
|
163
163
|
create: {
|
|
164
164
|
type: string;
|
|
165
|
-
'x-decorator': (props: any) => import("react").JSX.Element;
|
|
165
|
+
'x-decorator': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
166
166
|
'x-decorator-props': {
|
|
167
167
|
actionKey: any;
|
|
168
168
|
};
|
|
@@ -186,13 +186,13 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
186
186
|
properties: {
|
|
187
187
|
requestAction: {
|
|
188
188
|
type: string;
|
|
189
|
-
'x-component': (props: any) => import("react").JSX.Element;
|
|
189
|
+
'x-component': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
190
190
|
};
|
|
191
191
|
requestTab: {
|
|
192
192
|
type: string;
|
|
193
193
|
'x-decorator': string;
|
|
194
194
|
title: string;
|
|
195
|
-
'x-component': () => import("react").JSX.Element;
|
|
195
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
196
196
|
'x-decorator-props': {
|
|
197
197
|
tooltip: string;
|
|
198
198
|
};
|
|
@@ -201,14 +201,14 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
201
201
|
type: string;
|
|
202
202
|
'x-decorator': string;
|
|
203
203
|
title: string;
|
|
204
|
-
'x-component': () => import("react").JSX.Element;
|
|
204
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
205
205
|
'x-decorator-props': {
|
|
206
206
|
tooltip: string;
|
|
207
207
|
};
|
|
208
208
|
};
|
|
209
209
|
debug: {
|
|
210
210
|
type: string;
|
|
211
|
-
'x-component': () => import("react").JSX.Element;
|
|
211
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
212
212
|
};
|
|
213
213
|
};
|
|
214
214
|
};
|
|
@@ -218,7 +218,7 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
218
218
|
};
|
|
219
219
|
update: {
|
|
220
220
|
type: string;
|
|
221
|
-
'x-decorator': (props: any) => import("react").JSX.Element;
|
|
221
|
+
'x-decorator': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
222
222
|
'x-decorator-props': {
|
|
223
223
|
actionKey: any;
|
|
224
224
|
};
|
|
@@ -242,13 +242,13 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
242
242
|
properties: {
|
|
243
243
|
requestAction: {
|
|
244
244
|
type: string;
|
|
245
|
-
'x-component': (props: any) => import("react").JSX.Element;
|
|
245
|
+
'x-component': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
246
246
|
};
|
|
247
247
|
requestTab: {
|
|
248
248
|
type: string;
|
|
249
249
|
'x-decorator': string;
|
|
250
250
|
title: string;
|
|
251
|
-
'x-component': () => import("react").JSX.Element;
|
|
251
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
252
252
|
'x-decorator-props': {
|
|
253
253
|
tooltip: string;
|
|
254
254
|
};
|
|
@@ -257,14 +257,14 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
257
257
|
type: string;
|
|
258
258
|
'x-decorator': string;
|
|
259
259
|
title: string;
|
|
260
|
-
'x-component': () => import("react").JSX.Element;
|
|
260
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
261
261
|
'x-decorator-props': {
|
|
262
262
|
tooltip: string;
|
|
263
263
|
};
|
|
264
264
|
};
|
|
265
265
|
debug: {
|
|
266
266
|
type: string;
|
|
267
|
-
'x-component': () => import("react").JSX.Element;
|
|
267
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
268
268
|
};
|
|
269
269
|
};
|
|
270
270
|
};
|
|
@@ -274,7 +274,7 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
274
274
|
};
|
|
275
275
|
destroy: {
|
|
276
276
|
type: string;
|
|
277
|
-
'x-decorator': (props: any) => import("react").JSX.Element;
|
|
277
|
+
'x-decorator': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
278
278
|
'x-decorator-props': {
|
|
279
279
|
actionKey: any;
|
|
280
280
|
};
|
|
@@ -298,13 +298,13 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
298
298
|
properties: {
|
|
299
299
|
requestAction: {
|
|
300
300
|
type: string;
|
|
301
|
-
'x-component': (props: any) => import("react").JSX.Element;
|
|
301
|
+
'x-component': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
302
302
|
};
|
|
303
303
|
requestTab: {
|
|
304
304
|
type: string;
|
|
305
305
|
'x-decorator': string;
|
|
306
306
|
title: string;
|
|
307
|
-
'x-component': () => import("react").JSX.Element;
|
|
307
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
308
308
|
'x-decorator-props': {
|
|
309
309
|
tooltip: string;
|
|
310
310
|
};
|
|
@@ -313,14 +313,14 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
313
313
|
type: string;
|
|
314
314
|
'x-decorator': string;
|
|
315
315
|
title: string;
|
|
316
|
-
'x-component': () => import("react").JSX.Element;
|
|
316
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
317
317
|
'x-decorator-props': {
|
|
318
318
|
tooltip: string;
|
|
319
319
|
};
|
|
320
320
|
};
|
|
321
321
|
debug: {
|
|
322
322
|
type: string;
|
|
323
|
-
'x-component': () => import("react").JSX.Element;
|
|
323
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
324
324
|
};
|
|
325
325
|
};
|
|
326
326
|
};
|
|
@@ -334,7 +334,7 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
334
334
|
type: string;
|
|
335
335
|
required: boolean;
|
|
336
336
|
'x-component': {
|
|
337
|
-
(props: any): import("react").JSX.Element;
|
|
337
|
+
(props: any): import("react/jsx-runtime").JSX.Element;
|
|
338
338
|
displayName: string;
|
|
339
339
|
};
|
|
340
340
|
'x-decorator': string;
|
|
@@ -352,7 +352,7 @@ export declare function useSchemaCollection(title: any, useAction: any, item?: R
|
|
|
352
352
|
preview: {
|
|
353
353
|
type: string;
|
|
354
354
|
'x-visible': string;
|
|
355
|
-
'x-component': (props: any) => import("react").JSX.Element;
|
|
355
|
+
'x-component': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
356
356
|
'x-reactions': {
|
|
357
357
|
dependencies: string[];
|
|
358
358
|
fulfill: {
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ViewCreateCollection: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const ViewCreateCollection: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const PreviewComponent: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const PreviewComponent: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ProviderRequestActionItems: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const ProviderRequestActionItems: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export declare const useSchemaRequestAction: (key: any, header: any) => {
|
|
3
2
|
type: string;
|
|
4
|
-
'x-decorator': (props: any) =>
|
|
3
|
+
'x-decorator': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
5
4
|
'x-decorator-props': {
|
|
6
5
|
actionKey: any;
|
|
7
6
|
};
|
|
@@ -25,13 +24,13 @@ export declare const useSchemaRequestAction: (key: any, header: any) => {
|
|
|
25
24
|
properties: {
|
|
26
25
|
requestAction: {
|
|
27
26
|
type: string;
|
|
28
|
-
'x-component': (props: any) =>
|
|
27
|
+
'x-component': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
29
28
|
};
|
|
30
29
|
requestTab: {
|
|
31
30
|
type: string;
|
|
32
31
|
'x-decorator': string;
|
|
33
32
|
title: string;
|
|
34
|
-
'x-component': () =>
|
|
33
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
35
34
|
'x-decorator-props': {
|
|
36
35
|
tooltip: string;
|
|
37
36
|
};
|
|
@@ -40,14 +39,14 @@ export declare const useSchemaRequestAction: (key: any, header: any) => {
|
|
|
40
39
|
type: string;
|
|
41
40
|
'x-decorator': string;
|
|
42
41
|
title: string;
|
|
43
|
-
'x-component': () =>
|
|
42
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
44
43
|
'x-decorator-props': {
|
|
45
44
|
tooltip: string;
|
|
46
45
|
};
|
|
47
46
|
};
|
|
48
47
|
debug: {
|
|
49
48
|
type: string;
|
|
50
|
-
'x-component': () =>
|
|
49
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
51
50
|
};
|
|
52
51
|
};
|
|
53
52
|
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const DeleteCollection: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const DeleteCollection: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const EditCollection: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const EditCollection: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const EditCollectionAction: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const EditCollectionAction: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ViewEditCollectionForm: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const ViewEditCollectionForm: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const DataSourceSettingsForm: () => React.JSX.Element;
|
|
1
|
+
export declare const DataSourceSettingsForm: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ProviderDebug: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const ProviderDebug: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -82,7 +82,7 @@ export declare const useSchemaDebug: () => {
|
|
|
82
82
|
properties: {
|
|
83
83
|
requestAction: {
|
|
84
84
|
type: string;
|
|
85
|
-
'x-component': (props: any) => import("react").JSX.Element;
|
|
85
|
+
'x-component': (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
86
86
|
'x-component-props': {
|
|
87
87
|
actionForm: boolean;
|
|
88
88
|
};
|
|
@@ -90,11 +90,11 @@ export declare const useSchemaDebug: () => {
|
|
|
90
90
|
requestTab: {
|
|
91
91
|
type: string;
|
|
92
92
|
'x-decorator': string;
|
|
93
|
-
'x-component': () => import("react").JSX.Element;
|
|
93
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
94
94
|
};
|
|
95
95
|
responseTab: {
|
|
96
96
|
type: string;
|
|
97
|
-
'x-component': () => import("react").JSX.Element;
|
|
97
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
100
|
};
|
|
@@ -124,16 +124,16 @@ export declare const useSchemaDebug: () => {
|
|
|
124
124
|
properties: {
|
|
125
125
|
alertError: {
|
|
126
126
|
type: string;
|
|
127
|
-
'x-component': () => import("react").JSX.Element;
|
|
127
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
128
128
|
};
|
|
129
129
|
responseTransformer: {
|
|
130
130
|
type: string;
|
|
131
131
|
'x-decorator': string;
|
|
132
|
-
'x-component': () => import("react").JSX.Element;
|
|
132
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
133
133
|
};
|
|
134
134
|
debugResponse: {
|
|
135
135
|
type: string;
|
|
136
|
-
'x-component': () => import("react").JSX.Element;
|
|
136
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
137
137
|
};
|
|
138
138
|
};
|
|
139
139
|
};
|
|
@@ -154,7 +154,7 @@ export declare const useSchemaDebug: () => {
|
|
|
154
154
|
};
|
|
155
155
|
};
|
|
156
156
|
extractFieldMetadata: {
|
|
157
|
-
'x-component': () => import("react").JSX.Element;
|
|
157
|
+
'x-component': () => import("react/jsx-runtime").JSX.Element;
|
|
158
158
|
};
|
|
159
159
|
};
|
|
160
160
|
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ViewDebug: () => React.JSX.Element;
|
|
1
|
+
export declare const ViewDebug: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const DebugComponent: () => React.JSX.Element;
|
|
1
|
+
export declare const DebugComponent: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const AlertError: () => React.JSX.Element;
|
|
1
|
+
export declare const AlertError: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/client/features/rest-api/request-configs/debug-area/components/DebugResponse.view.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ViewDebugResponse: () => React.JSX.Element;
|
|
1
|
+
export declare const ViewDebugResponse: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/client/features/rest-api/request-configs/debug-area/components/DebugResponseTabs.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const DebugResponseTabs: () => React.JSX.Element;
|
|
1
|
+
export declare const DebugResponseTabs: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ExtractFieldMetadata: () => React.JSX.Element;
|
|
1
|
+
export declare const ExtractFieldMetadata: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/client/features/rest-api/request-configs/debug-area/components/RequestHeaders.view.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ViewRequestHeaders: () => React.JSX.Element;
|
|
1
|
+
export declare const ViewRequestHeaders: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/client/features/rest-api/request-configs/debug-area/components/ResponseBody.view.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ViewResponseBody: () => React.JSX.Element;
|
|
1
|
+
export declare const ViewResponseBody: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ViewResponseHeaders: () => React.JSX.Element;
|
|
1
|
+
export declare const ViewResponseHeaders: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/client/features/rest-api/request-configs/debug-area/components/ResponseTab.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ResponseTab: () => React.JSX.Element;
|
|
1
|
+
export declare const ResponseTab: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/client/features/rest-api/request-configs/debug-area/components/TooltipContainer.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const TooltipContainer: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const TooltipContainer: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ViewFieldMethod: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const ViewFieldMethod: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,7 +7,7 @@ export declare const getSchemaFieldPath: (params: any) => {
|
|
|
7
7
|
'x-decorator': string;
|
|
8
8
|
'x-decorator-props': {
|
|
9
9
|
feedbackLayout: string;
|
|
10
|
-
addonBefore:
|
|
10
|
+
addonBefore: import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
validator: {
|
|
12
12
|
required: boolean;
|
|
13
13
|
message: any;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ViewFieldPath: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const ViewFieldPath: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const MethodPathComponent: (props: any) => React.JSX.Element;
|
|
1
|
+
export declare const MethodPathComponent: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ViewRequestBody: () => React.JSX.Element;
|
|
1
|
+
export declare const ViewRequestBody: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ViewRequestHeaders: () => React.JSX.Element;
|
|
1
|
+
export declare const ViewRequestHeaders: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ViewRequestParams: () => React.JSX.Element;
|
|
1
|
+
export declare const ViewRequestParams: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const RequestTab: () => React.JSX.Element;
|
|
1
|
+
export declare const RequestTab: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ResponseTransformerComponent: () => React.JSX.Element;
|
|
1
|
+
export declare const ResponseTransformerComponent: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const MysqlDataSourceSettingsForm: () => React.JSX.Element;
|
|
1
|
+
export declare const MysqlDataSourceSettingsForm: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const PgDataSourceSettingsForm: () => React.JSX.Element;
|
|
1
|
+
export declare const PgDataSourceSettingsForm: () => import("react/jsx-runtime").JSX.Element;
|
package/dist/client/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(y,r){typeof exports=="object"&&typeof module!="undefined"?r(exports,require("@tachybase/client"),require("@tachybase/module-data-source/client"),require("react/jsx-runtime"),require("react"),require("@ant-design/icons"),require("antd"),require("@tachybase/components"),require("@tachybase/schema"),require("lodash"),require("@tachybase/utils/client"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/module-data-source/client","react/jsx-runtime","react","@ant-design/icons","antd","@tachybase/components","@tachybase/schema","lodash","@tachybase/utils/client","react-router-dom"],r):(y=typeof globalThis!="undefined"?globalThis:y||self,r(y["@tachybase/plugin-data-source-common"]={},y["@tachybase/client"],y["@tachybase/module-data-source"],y.jsxRuntime,y.react,y["@ant-design/icons"],y.antd,y["@tachybase/components"],y["@tachybase/schema"],y.lodash,y["@tachybase/utils"],y["react-router-dom"]))})(this,function(y,r,P,c,I,R,b,k,x,V,X,H){"use strict";var gt=Object.defineProperty,It=Object.defineProperties;var vt=Object.getOwnPropertyDescriptors;var U=Object.getOwnPropertySymbols;var pe=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var ie=(y,r,P)=>r in y?gt(y,r,{enumerable:!0,configurable:!0,writable:!0,value:P}):y[r]=P,f=(y,r)=>{for(var P in r||(r={}))pe.call(r,P)&&ie(y,P,r[P]);if(U)for(var P of U(r))le.call(r,P)&&ie(y,P,r[P]);return y},A=(y,r)=>It(y,vt(r));var de=(y,r)=>{var P={};for(var c in y)pe.call(y,c)&&r.indexOf(c)<0&&(P[c]=y[c]);if(y!=null&&U)for(var c of U(y))r.indexOf(c)<0&&le.call(y,c)&&(P[c]=y[c]);return P};var D=(y,r,P)=>new Promise((c,I)=>{var R=x=>{try{k(P.next(x))}catch(V){I(V)}},b=x=>{try{k(P.throw(x))}catch(V){I(V)}},k=x=>x.done?c(x.value):Promise.resolve(x.value).then(R,b);k((P=P.apply(y,r)).next())});const C="data-source-common",F=(e,t=!1)=>r.tval(e,{ns:t?void 0:C});function _(e,t={}){return r.i18n.t(e,A(f({},t),{ns:[C,"core"]}))}const q=(e=!1)=>{const{i18n:t}=r.useApp();return{t:(o,n={})=>t.t(o,f({ns:e?void 0:C},n))}},J=I.createContext({}),ue=J.Provider;function j(){return I.useContext(J)}const G=I.createContext({}),me=G.Provider;function O(){return I.useContext(G)}const ye=e=>{const{visible:t,setVisible:s}=e,[o,n]=I.useState(null),[a,i]=I.useState(null),[p,l]=I.useState(null);return c.jsx(r.ActionContextProvider,{visible:t,setVisible:s,children:c.jsx(me,{value:{rawResponse:o,debugResponse:a,responseValidationErrorMessage:p,setRawResponse:n,setDebugResponse:i,setResponseValidationErrorMessage:l},children:e.children})})},Y={list:["page","pageSize","filter","sort","appends","fields","except"],get:["filterByTk","filter","sort","appends","fields","except"],create:["whiteList","blacklist","body"],update:["filterByTk","filter","whiteList","blacklist","body"],destroy:["filterByTk","filter"]},xe=[{name:"X-App",title:"X-App"},{name:"X-Locale",title:"X-Locale"},{name:"X-Hostname",title:"X-Hostname"},{name:"X-Timezone",title:"X-Timezone"},{name:"X-Role",title:"X-Role"},{name:"X-Authenticator",title:"X-Authenticator"}],L=e=>{var p,l;const t=r.useCompile(),{t:s}=q(),o=I.useContext(r.SchemaComponentContext),{actionKey:n}=j(),{variables:a}=((l=(p=o.dataSourceData)==null?void 0:p.data)==null?void 0:l.options)||{};return I.useMemo(()=>fe({t:s,variables:a,compile:t,actionKey:n,showResponse:e}),[n])},fe=e=>{const{t,variables:s,compile:o,actionKey:n,showResponse:a}=e,i=[];return s&&i.push({name:"dataSourceVariables",title:t("Custom variables"),children:s==null?void 0:s.map(p=>({name:o(p.name),title:p.name}))}),i.push({name:"request",title:t("TachyBase request"),children:[{name:"params",title:"params",children:(Y[n]||[]).map(p=>({name:p,title:p}))},{name:"header",title:"headers",children:xe},{name:"body",title:"Body"},{name:"token",title:"Token"}]}),a&&i.push({name:"rawResponse",title:t("Third party response"),children:[{name:"body",title:"body"}]}),i},he=e=>{const{t,method:s,setFormValue:o}=e;return{name:"method",title:"HTTP method",default:s,"x-decorator":"FormItem","x-decorator-props":{validator:{required:!0,message:t("Method is required")},feedbackLayout:"popover"},required:!0,"x-component":"Select","x-component-props":{defaultValue:s,onChange:n=>{o(n,"method")},options:[{value:"GET",label:"GET"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"PATCH",label:"PATCH"},{value:"DELETE",label:"DELETE"}]}}},be=e=>{const{t}=q(),{method:s,setFormValue:o}=e,n=he({t,method:s,setFormValue:o});return c.jsx(r.SchemaComponent,{schema:n})},ge=e=>{var a,i,p;const{t,path:s,setFormValue:o,scCtx:n}=e;return{name:"path",title:"URL",required:!0,default:s,"x-decorator":"FormItem","x-decorator-props":{feedbackLayout:"popover",addonBefore:c.jsx(r.EllipsisWithTooltip,{ellipsis:!0,children:c.jsx(r.Input.ReadPretty,{value:(p=(i=(a=n==null?void 0:n.dataSourceData)==null?void 0:a.data)==null?void 0:i.options)==null?void 0:p.baseUrl})}),validator:{required:!0,message:t("Path is required")},className:r.css`
|
|
2
2
|
.ant-formily-item-addon-before {
|
|
3
3
|
border-width: 1px;
|
|
4
4
|
border-style: solid;
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
text-overflow: ellipsis;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
`,style:{width:"100%"}},"x-component":r.Variable.RawTextArea,"x-component-props":{defaultValue:s,autoSize:!0,onChange:l=>{o(l.target.value,"path")},scope:L,fieldNames:{value:"name",label:"title"},style:{borderTopLeftRadius:"0",borderBottomLeftRadius:"0"}}}},Ie=e=>{const{t}=
|
|
20
|
+
`,style:{width:"100%"}},"x-component":r.Variable.RawTextArea,"x-component-props":{defaultValue:s,autoSize:!0,onChange:l=>{o(l.target.value,"path")},scope:L,fieldNames:{value:"name",label:"title"},style:{borderTopLeftRadius:"0",borderBottomLeftRadius:"0"}}}},Ie=e=>{const{t}=q(),s=r.useSchemaComponentContext(),{path:o,setFormValue:n}=e,a=ge({t,path:o,setFormValue:n,scCtx:s});return c.jsx(r.SchemaComponent,{schema:a})},Q=e=>{var u;const{data:t}=r.useCollectionRecord(),{form:s,actionKey:o,requestActionForm:n}=j(),a=r.useSchemaComponentContext(),{path:i,method:p}=((u=t==null?void 0:t.actions)==null?void 0:u[o])||{},l=V.debounce((h,T)=>D(this,null,function*(){const{actions:S}=(s==null?void 0:s.values)||{};s.setValuesIn("actions",A(f({},S),{[o]:A(f({},S==null?void 0:S[o]),{[T]:h})})),n.setValuesIn(T,h)}),100),d=I.useMemo(()=>x.createForm({initialValues:n.values}),[]);return c.jsxs(r.FormProvider,{form:e!=null&&e.actionForm?d:n,children:[c.jsx(be,{method:p,setFormValue:l}),c.jsx(x.SchemaOptionsContext.Provider,{value:a,children:c.jsx(Ie,{path:i,setFormValue:l})})]})},W=X.lodash.debounce((e,t,s,o)=>{const{actions:n}=e.values||{};e.setValuesIn("actions",A(f({},n),{[t]:A(f({},n==null?void 0:n[t]),{[s]:o})}))},400),ve=({defaultValue:e,actionKey:t,parentForm:s,field:o})=>({type:"object",properties:{contentType:{type:"string","x-decorator":"FormItem","x-component":"Select",placeholder:`{{t("Content-Type",{ ns: "${C}" })}}`,default:e==null?void 0:e.contentType,"x-component-props":{onChange:n=>{W(s,t,"contentType",n)}},enum:[{value:"application/x-www-form-urlencoded",label:"application/x-www-form-urlencoded "},{value:"application/json",label:"application/json"}],"x-reactions":n=>{const a=s.values.actions[t],i=a==null?void 0:a.contentType;(n==null?void 0:n.value)!==i&&n.setValue(i!=null?i:"application/json"),n.value||W(s,t,"contentType","application/json")}},body:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",default:e.body,items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{style:{flexWrap:"nowrap",maxWidth:"100%",display:"flex"},className:r.css`
|
|
21
21
|
& > .ant-space-item:first-child,
|
|
22
22
|
& > .ant-space-item:last-child {
|
|
23
23
|
flex-shrink: 0;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
& > .ant-space-item:nth-of-type(2) {
|
|
27
27
|
flex: 1;
|
|
28
28
|
}
|
|
29
|
-
`},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}},value:{type:"string","x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:"{{useVariableOptions}}",autoSize:!0,fieldNames:{value:"name",label:"title"},style:{minWidth:"220px"}}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove","x-component-props":{onClick:()=>{W(s,t,"body",o.form.values.body)}}}}}}},properties:{add:{type:"void",title:`{{t("Add", { ns: "${C}" })}}`,"x-component":"ArrayItems.Addition"}},"x-reactions":[{dependencies:[".contentType"],fulfill:{state:{visible:'{{ $deps[0]==="application/x-www-form-urlencoded"}}'}}}]},jsonBody:{type:"string","x-decorator":"FormItem","x-component":"Variable.JSON",default:e.jsonBody,"x-component-props":{scope:"{{useVariableOptions}}",autoSize:!0,fieldNames:{value:"name",label:"title"},placeholder:'{{t("Value")}}',style:{minHeight:200},onChange:n=>{const{actions:a}=s.values||{};s.setValuesIn("actions",A(f({},a),{[t]:A(f({},a==null?void 0:a[t]),{body:n})}))}},"x-reactions":[{dependencies:[".contentType"],fulfill:{state:{visible:'{{ $deps[0]==="application/json"}}'}}},n=>{var i,p,l;const a=(l=(p=(i=s==null?void 0:s.values)==null?void 0:i.actions)==null?void 0:p[t])==null?void 0:l.body;(n==null?void 0:n.value)!==a&&n.setValue(s.values.actions[t].body)}]}}}),Ce=()=>{var a,i;const e=
|
|
29
|
+
`},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}},value:{type:"string","x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:"{{useVariableOptions}}",autoSize:!0,fieldNames:{value:"name",label:"title"},style:{minWidth:"220px"}}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove","x-component-props":{onClick:()=>{W(s,t,"body",o.form.values.body)}}}}}}},properties:{add:{type:"void",title:`{{t("Add", { ns: "${C}" })}}`,"x-component":"ArrayItems.Addition"}},"x-reactions":[{dependencies:[".contentType"],fulfill:{state:{visible:'{{ $deps[0]==="application/x-www-form-urlencoded"}}'}}}]},jsonBody:{type:"string","x-decorator":"FormItem","x-component":"Variable.JSON",default:e.jsonBody,"x-component-props":{scope:"{{useVariableOptions}}",autoSize:!0,fieldNames:{value:"name",label:"title"},placeholder:'{{t("Value")}}',style:{minHeight:200},onChange:n=>{const{actions:a}=s.values||{};s.setValuesIn("actions",A(f({},a),{[t]:A(f({},a==null?void 0:a[t]),{body:n})}))}},"x-reactions":[{dependencies:[".contentType"],fulfill:{state:{visible:'{{ $deps[0]==="application/json"}}'}}},n=>{var i,p,l;const a=(l=(p=(i=s==null?void 0:s.values)==null?void 0:i.actions)==null?void 0:p[t])==null?void 0:l.body;(n==null?void 0:n.value)!==a&&n.setValue(s.values.actions[t].body)}]}}}),Ce=()=>{var a,i;const e=x.useField(),{form:t,actionKey:s}=j(),o=(i=(a=t==null?void 0:t.values)==null?void 0:a.actions)==null?void 0:i[s],n=ve({parentForm:t,actionKey:s,defaultValue:{contentType:o==null?void 0:o.contentType,body:o==null?void 0:o.body,jsonBody:o==null?void 0:o.body},field:e});return c.jsx(r.SchemaComponent,{schema:n,components:{ArrayItems:k.ArrayItems,FormItem:r.FormItem,Input:b.Input,FormProvider:r.FormProvider},scope:{useVariableOptions:L}})},Fe=({title:e,defaultValue:t,field:s,parentForm:o,actionKey:n})=>{const a=p=>{var d,u,h;const l=(h=(u=(d=o==null?void 0:o.values)==null?void 0:d.actions)==null?void 0:u[n])==null?void 0:h.headers;(l==null?void 0:l.length)>0&&l!==t&&p.setValue(l)},i=()=>{W(o,n,"headers",s.form.values.headers)};return{type:"object","x-decorator":"Form",properties:{headers:{type:"array","x-component":"ArrayItems",default:t,"x-decorator":"FormItem","x-reactions":a,items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{style:{flexWrap:"nowrap",maxWidth:"100%",display:"flex"},className:r.css`
|
|
30
30
|
& > .ant-space-item:first-child,
|
|
31
31
|
& > .ant-space-item:last-child {
|
|
32
32
|
flex-shrink: 0;
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
& > .ant-space-item:nth-of-type(2) {
|
|
36
36
|
flex: 1;
|
|
37
37
|
}
|
|
38
|
-
`},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}},value:{type:"string","x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:"{{useVariableOptions}}",autoSize:!0,fieldNames:{value:"name",label:"title"},style:{minWidth:"220px"}}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove","x-component-props":{onClick:i}}}}}},properties:{add:{title:e,type:"void","x-component":"ArrayItems.Addition"}}}}}},Ae=()=>{var i,p;const{t:e}=
|
|
38
|
+
`},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}},value:{type:"string","x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:"{{useVariableOptions}}",autoSize:!0,fieldNames:{value:"name",label:"title"},style:{minWidth:"220px"}}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove","x-component-props":{onClick:i}}}}}},properties:{add:{title:e,type:"void","x-component":"ArrayItems.Addition"}}}}}},Ae=()=>{var i,p;const{t:e}=q(),t=x.useField(),{form:s,actionKey:o}=j(),n=(p=(i=s==null?void 0:s.values)==null?void 0:i.actions)==null?void 0:p[o],a=Fe({title:e("Add header"),defaultValue:(n==null?void 0:n.headers)||[],field:t,parentForm:s,actionKey:o});return c.jsx(r.SchemaComponent,{schema:a,components:{ArrayItems:k.ArrayItems,FormItem:r.FormItem,Input:b.Input},scope:{useVariableOptions:L}})},Se=({title:e,defaultValue:t,field:s,parentForm:o,actionKey:n})=>({type:"object","x-decorator":"Form",properties:{params:{type:"array","x-component":"ArrayItems",default:t,"x-decorator":"FormItem","x-reactions":a=>{var p,l,d;const i=(d=(l=(p=o.values)==null?void 0:p.actions)==null?void 0:l[n])==null?void 0:d.params;i!=null&&i.length&&i!==t&&a.setValue(i)},items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{style:{flexWrap:"nowrap",maxWidth:"100%",display:"flex"},className:r.css`
|
|
39
39
|
& > .ant-space-item:first-child,
|
|
40
40
|
& > .ant-space-item:last-child {
|
|
41
41
|
flex-shrink: 0;
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
& > .ant-space-item:nth-of-type(2) {
|
|
45
45
|
flex: 1;
|
|
46
46
|
}
|
|
47
|
-
`},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}',style:{width:"100%"}}},value:{type:"string","x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:"{{useVariableOptions}}",autoSize:!0,fieldNames:{value:"name",label:"title"},style:{minWidth:"230px",width:"100%"}}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove","x-component-props":{onClick:()=>{var a;W(o,n,"params",(a=s.form.values)==null?void 0:a.params)}}}}}}},properties:{add:{type:"void",title:e,"x-component":"ArrayItems.Addition"}}}}}),we=()=>{var i,p;const{t:e}=
|
|
47
|
+
`},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}',style:{width:"100%"}}},value:{type:"string","x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:"{{useVariableOptions}}",autoSize:!0,fieldNames:{value:"name",label:"title"},style:{minWidth:"230px",width:"100%"}}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove","x-component-props":{onClick:()=>{var a;W(o,n,"params",(a=s.form.values)==null?void 0:a.params)}}}}}}},properties:{add:{type:"void",title:e,"x-component":"ArrayItems.Addition"}}}}}),we=()=>{var i,p;const{t:e}=q(),t=x.useField(),{form:s,actionKey:o}=j(),n=(p=(i=s==null?void 0:s.values)==null?void 0:i.actions)==null?void 0:p[o],a=Se({title:e("Add parameter"),defaultValue:n==null?void 0:n.params,field:t,parentForm:s,actionKey:o});return c.jsx(r.SchemaComponent,{schema:a,components:{ArrayItems:k.ArrayItems,FormItem:r.FormItem,Input:b.Input},scope:{useVariableOptions:L}})},Te=e=>{const{t}=e;return[{key:"parameters",label:t("Parameters"),children:c.jsx(we,{})},{key:"body",label:t("Body"),children:c.jsx(Ce,{})},{key:"headers",label:t("Headers"),children:c.jsx(Ae,{})}]},Z=()=>{const{t:e}=q(),t=Te({t:e});return c.jsx(b.Tabs,{items:t})},Pe={data:"{{rawResponse.body}}",meta:{}},qe=(e,t,s)=>D(this,null,function*(){const{actions:o}=e.values||{};e.setValuesIn("actions",A(f({},o),{[t]:A(f({},o==null?void 0:o[t]),{responseTransformer:s})}))}),ee=()=>{var l,d,u;const{form:e,actionKey:t,responseTransformer:s,setResponseTransformer:o}=j(),n=(u=(d=(l=e==null?void 0:e.values)==null?void 0:l.actions)==null?void 0:d[t])==null?void 0:u.responseTransformer,a=s!=null?s:n,{data:i}=r.useCollectionRecord();I.useEffect(()=>{var h,T;if(!((T=(h=i==null?void 0:i.actions)==null?void 0:h[t])!=null&&T.responseTransformer)&&!n){const{actions:S}=e.values||{};e.setValuesIn("actions",A(f({},S),{[t]:A(f({},S==null?void 0:S[t]),{responseTransformer:Pe})}))}},[]);const p=L(!0);return c.jsx(r.Variable.JSON,{value:a,onChange:h=>{o(h),qe(e,t,h)},autoSize:{minRows:5},fieldNames:{value:"name",label:"title"},scope:()=>p})},ke=()=>{const{responseValidationErrorMessage:e}=O();return e?c.jsxs(c.Fragment,{children:[c.jsx(b.Alert,{type:"error",showIcon:!0,message:e}),c.jsx("br",{})]}):null},Ve=e=>({type:"object","x-decorator":"Form","x-decorator-props":{useValues(t){return r.useRequest(()=>Promise.resolve({data:{}}),t)}},properties:{[x.uid()]:{type:"string",default:e,"x-read-pretty":!0,"x-decorator":"FormItem","x-component":"Input.JSON","x-component-props":{style:{maxHeight:"350px"}}}}}),De=()=>{const{debugResponse:e}=O(),t=Ve(e);return c.jsx(r.SchemaComponent,{schema:t,components:{ArrayTable:k.ArrayTable,FormItem:r.FormItem,Input:r.Input}})},Me=e=>{const{t}=e;return[{key:"body",label:t("Body"),children:c.jsx(De,{})}]},Be=()=>{const{t:e}=q(),{debugResponse:t}=O(),s=Me({t:e});return t?c.jsx(b.Tabs,{defaultActiveKey:"body",items:s}):null},Ne=e=>{const{t}=q(),s=t("Extract field metadata from the response data");return c.jsx(b.Tooltip,{title:s,children:e.children})},je=()=>{const e=x.useForm(),t=r.useAPIClient(),{t:s}=q(),{setVisible:o}=I.useContext(r.ActionContext),{name:n}=H.useParams(),{rawResponse:a,responseValidationErrorMessage:i}=O(),{form:p,actionKey:l}=j(),{fields:d}=p.values,[u,h]=I.useState(!1),T=V.omit(e.values,"responseTab"),S=()=>D(this,null,function*(){var v,g;try{h(!0);const w=(g=(v=p==null?void 0:p.values)==null?void 0:v.actions)==null?void 0:g[l],m=t.resource("dataSources.httpCollections",n),{data:{data:M}}=yield m.runAction({values:{debug:!1,inferFields:!0,actionOptions:A(f({},w),{type:l,responseTransformer:w==null?void 0:w.responseTransformer}),debugVars:T}});o(!1),h(!1);const{transformedResponse:B,fields:E,filterTargetKey:$}=M;if($&&p.setValuesIn("filterTargetKey",$),E){const N=V.unionBy(d,E,"name");p.setValuesIn("fields",N)}if(typeof(B==null?void 0:B.data)=="object"){let N=[];l==="get"?N=[B==null?void 0:B.data]:N=B==null?void 0:B.data,p.setValuesIn("preview",N)}}catch(w){h(!1),console.log(w)}});return["list","get"].includes(l)?c.jsx(Ne,{children:c.jsx(b.Button,{type:"primary",disabled:!a||i,loading:u,onClick:S,children:s("Extract field metadata")})}):null},te=({key:e,defaultValue:t})=>({type:"object",properties:{[e]:{type:"array","x-decorator":"FormItem","x-component":"ArrayTable",default:t,"x-component-props":{scroll:{y:300}},items:{type:"object",properties:{column1:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:200,title:`{{t("Name",{ ns: "${C}" })}}`},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}}}},column2:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:200,title:`{{t("Value",{ ns: "${C}" })}}`},properties:{value:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Value")}}'}}}}}}}}}),Oe=()=>{const{rawResponse:e}=O(),{request:t}=e||{},s=Object.entries((t==null?void 0:t.headers)||{}).map(([n,a])=>({name:n,value:a})),o=te({key:"requestHeaders",defaultValue:s});return c.jsx(r.SchemaComponent,{schema:o,components:{ArrayTable:k.ArrayTable,FormItem:r.FormItem,Input:r.Input}})},Ee=e=>({type:"object","x-decorator":"Form","x-decorator-props":{useValues(t){return r.useRequest(()=>Promise.resolve({data:{}}),t)}},properties:{[x.uid()]:{type:"string",default:e,"x-read-pretty":!0,"x-decorator":"FormItem","x-component":"Input.JSON","x-component-props":{style:{maxHeight:"400px"}}}}}),$e=()=>{const{rawResponse:e}=O(),{data:t}=e||{},s=Ee(t);return c.jsx(r.SchemaComponent,{schema:s,components:{ArrayTable:k.ArrayTable,FormItem:r.FormItem,Input:r.Input}})},He=()=>{const{rawResponse:e}=O(),{headers:t}=e||{},s=Object.entries(t||{}).map(([n,a])=>({name:n,value:a})),o=te({key:"responseHeaders",defaultValue:s});return c.jsx(r.SchemaComponent,{schema:o,components:{ArrayTable:k.ArrayTable,FormItem:r.FormItem,Input:r.Input}})},Le=e=>{const{t}=e;return[{key:"body",label:t("Body"),children:c.jsx($e,{})},{key:"responseHeaders",label:t("Response headers"),children:c.jsx(He,{})},{key:"requestHeaders",label:t("Request headers"),children:c.jsx(Oe,{})}]},We=()=>{const{t:e}=q(),{rawResponse:t}=O(),{status:s}=t||{},o=Le({t:e});if(!t)return null;const n=s.toString().startsWith("2")?"success":"error",a=c.jsx(b.Tag,{color:n,children:`HTTP Code:${s}`});return c.jsx(b.Card,{title:a,children:c.jsx(b.Tabs,{defaultActiveKey:"body",items:o})})};function ze(e,t){var p,l;const s=(l=(p=e==null?void 0:e.values)==null?void 0:p.actions)==null?void 0:l[t];let o=[];const{params:n=[],headers:a=[],body:i=[]}=s||{};return o=[...n,...a].map(d=>{var u;return(u=d==null?void 0:d.value)==null?void 0:u.replace(/{{|}}/g,"")}),typeof i=="string"?o.concat(i==null?void 0:i.replace(/{{|}}/g,"")):o.concat(i==null?void 0:i.map(d=>d==null?void 0:d.value.replace(/{{|}}/g,""))),o.filter(Boolean)}const Ke=(e,t)=>{const s=(o,n)=>{ze(e,t).find(p=>((p==null?void 0:p.split("."))||[]).pop()===o)&&(n.description=null)};return{page:{type:"number",title:"Page","x-decorator":"FormItem","x-component":"InputNumber",description:"{{t('Page variable not used. Pagination based on total current request data.')}}","x-reactions":o=>s("page",o)},pageSize:{type:"number",title:"PageSize","x-decorator":"FormItem","x-component":"InputNumber",description:"{{t('PageSize variable not used. Pagination based on total current request data.')}}","x-reactions":o=>s("pageSize",o)},filter:{type:"object",title:"Filter","x-decorator":"FormItem","x-component":"Input.JSON",description:"{{t('Filter variable not used. Filtering will apply to the current request data.')}}","x-reactions":o=>s("filter",o)},sort:{type:"string",title:"Sort","x-decorator":"FormItem","x-component":"Input",description:"{{t('Sort variable not used. Sorting will apply to the current request data.')}}","x-reactions":o=>s("sort",o)},appends:{type:"string",title:"Appends","x-decorator":"FormItem","x-component":"Input"},fields:{type:"string",title:"Fields","x-decorator":"FormItem","x-component":"Input",description:"{{t('Fields variable not used. Filtering will be based on the current request data.')}}","x-reactions":o=>s("fields",o)},except:{type:"string",title:"Except","x-decorator":"FormItem","x-component":"Input",description:"{{t('Except variable not used. Filtering will be based on the current request data.')}}","x-reactions":o=>s("except",o)},filterByTk:{type:"string",title:"FilterByTk","x-decorator":"FormItem","x-component":"Input",description:"{{t('The current parameters are not adapted')}}","x-reactions":o=>s("filterByTk",o)},whiteList:{type:"string",title:"whiteList","x-decorator":"FormItem","x-component":"Input"},blacklist:{type:"string",title:"blacklist","x-decorator":"FormItem","x-component":"Input"},body:{type:"object",title:"Body","x-decorator":"FormItem","x-component":"Input.JSON","x-component-props":{autoSize:{minRows:5,maxRows:20}}}}};function Re(e,t){const s={},o=Y[e]||[],n=Ke(t,e);for(const a of o)s[a]=n[a];return s}const Ue=()=>{const{t:e}=q(),{actionKey:t,form:s,requestActionForm:o}=j(),n=Re(t,s),a=()=>{const i=l=>D(this,null,function*(){const{actions:d}=s.values||{},{path:u,value:h}=l.getState();u.includes("add")||(yield s.setValuesIn("actions",A(f({},d),{[t]:X.unflatten(A(f({},d==null?void 0:d[t]),{[u]:h}))})),["method","path"].includes(u)&&(yield o.setValuesIn([u],h)))}),p=V.debounce(i,400);x.onFieldChange("*",(l,d)=>{d.modified&&p(l)})};return{type:"object",properties:{modal:{type:"void","x-decorator":"Form","x-component":"Action.Modal","x-component-props":{className:r.cx("tb-action-popup",r.css`
|
|
48
48
|
.ant-modal-content {
|
|
49
49
|
padding: 0;
|
|
50
50
|
}
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
.ant-formily-item-feedback-layout-loose {
|
|
62
62
|
margin-bottom: 10px;
|
|
63
63
|
}
|
|
64
|
-
`},properties:{requestAction:{type:"string","x-component":
|
|
64
|
+
`},properties:{requestAction:{type:"string","x-component":Q,"x-component-props":{actionForm:!0}},requestTab:{type:"void","x-decorator":"FormItem","x-component":Z},responseTab:{type:"string","x-component":We}}}}},nocoBaseResponse:{type:"void","x-decorator":"Col","x-decorator-props":{span:8},"x-component":"Card","x-component-props":{bordered:!1,title:e("TachyBase response"),style:{height:"80vh",overflowY:"auto",borderTopLeftRadius:0,borderBottomLeftRadius:0}},properties:{responseContainer:{type:"void","x-decorator":"Form",properties:{alertError:{type:"string","x-component":ke},responseTransformer:{type:"string","x-decorator":"FormItem","x-component":ee},debugResponse:{type:"string","x-component":Be}}}}}}},footer:{type:"void","x-component":"Action.Modal.Footer",properties:{debug:{title:'{{t("Debug")}}',"x-component":"Action","x-component-props":{type:"primary",useAction:"{{ useDebugAction }}"}},extractFieldMetadata:{"x-component":je}}}}}}}},Xe=()=>{const e=x.useForm(),{setVisible:t}=I.useContext(r.ActionContext),{setRawResponse:s,setDebugResponse:o}=O();return{run(){t(!1),e.reset(),e.setValuesIn("responseTab",null),s(null),o(null)}}},_e=()=>{const e=x.useField(),t=r.useAPIClient(),s=x.useForm(),{form:o,actionKey:n,requestActionForm:a}=j(),{name:i}=H.useParams(),{setRawResponse:p,setDebugResponse:l,setResponseValidationErrorMessage:d}=O();return{run(){return D(this,null,function*(){var T,S;const h=(S=(T=o==null?void 0:o.values)==null?void 0:T.actions)==null?void 0:S[n];try{e.data=(e==null?void 0:e.data)||{},e.data.loading=!0,yield a.submit();const v=t.resource("dataSources.httpCollections",i),g=V.omit(s.values,"responseTab"),{data:{data:w}}=yield v.runAction({values:{debug:!0,inferFields:!1,actionOptions:A(f({},h),{type:n,responseTransformer:h==null?void 0:h.responseTransformer}),debugVars:g}});e.data.loading=!1;const{rawResponse:m,debugBody:M,responseValidationErrorMessage:B}=w;p(m),l(M),d(B)}catch(v){e.data.loading=!1,console.log(v)}})}}},Je=()=>{const{t:e}=q(),t=Ue();return c.jsx(r.SchemaComponent,{schema:t,components:{Form:k.Form,Input:r.Input,Action:r.Action,FormItem:r.FormItem,InputNumber:r.InputNumber,Card:b.Card,Variable:r.Variable,Space:r.Space,Select:b.Select,FormLayout:k.FormLayout,Row:b.Row,Col:b.Col},scope:{t:e,useDebugAction:_e,useCancelAction:Xe,useVariableOptions:L}})},Ge=()=>{const{t:e}=q(),{requestActionForm:t}=j(),[s,o]=I.useState(!1),n=()=>D(this,null,function*(){yield t.submit(),o(!0)});return c.jsxs(c.Fragment,{children:[c.jsx(b.Button,{type:"primary",onClick:n,children:e("Try it out")}),c.jsx(ye,{visible:s,setVisible:o,children:c.jsx(Je,{})})]})},Ye=e=>{const t=x.useForm(),{actionKey:s}=e,o=I.useMemo(()=>x.createForm({}),[]),[n,a]=I.useState(null);return c.jsx(ue,{value:{form:A(f({},t),{[s]:o}),actionKey:s,requestActionForm:o,responseTransformer:n,setResponseTransformer:a},children:e.children})},z=(e,t)=>{const s=I.useRef();return{type:"void","x-decorator":Ye,"x-decorator-props":{actionKey:e},"x-component":"FormCollapse.CollapsePanel","x-component-props":{header:t,key:e},properties:{form:{"x-decorator":"Form","x-decorator-props":{className:r.css`
|
|
65
65
|
.ant-formily-item-feedback-layout-loose {
|
|
66
66
|
margin-bottom: 10px;
|
|
67
67
|
}
|
|
68
|
-
`,useValues(o){return s.current=y.useForm(),r.useRequest(()=>Promise.resolve(),o)},effects:()=>{const o=a=>{const i=s.current,{actions:p}=i.values||{},{path:l,value:d}=a.getState();l.includes("add")||i.setValuesIn("actions",A(f({},p),{[e]:X.unflatten(A(f({},p==null?void 0:p[e]),{[l]:d}))}))},n=V.debounce((a,i)=>M(this,null,function*(){i.modified&&(yield o(a))}),400);y.onFieldChange("*",(a,i)=>{i.modified&&n(a,i)})}},type:"void",properties:{[y.uid()]:{type:"void",properties:{requestAction:{type:"string","x-component":Y},requestTab:{type:"void","x-decorator":"FormItem",title:`{{t("Adapt request parameters",{ ns: "${C}" })}}`,"x-component":Q,"x-decorator-props":{tooltip:`{{t("Provide request variables from TachyBase for use by third-party APIs.",{ ns: "${C}" })}}`}},responseTransformer:{type:"string","x-decorator":"FormItem",title:`{{t("Convert third-party response results to NocoBase standard",{ ns: "${C}" })}}`,"x-component":Z,"x-decorator-props":{tooltip:`{{t("The response results from third-party APIs need to be converted to the NocoBase standard to display correctly on the frontend.",{ ns: "${C}" })}}`}},debug:{type:"void","x-component":Ge}}}}}}}},Qe=e=>{const t=y.useForm(),s=r.useCompile(),{t:o}=P(),{fields:n,preview:a}=e,[i,p]=I.useState([]),[l,d]=I.useState(a),{getInterface:x}=r.useCollectionManager_deprecated(),g=T=>{const S=T.filter(b=>b.source||b.interface);return S?S.map(b=>{var D,N;const w=((D=b==null?void 0:b.uiSchema)==null?void 0:D.title)||b.name,u=(N=x(b.interface))==null?void 0:N.default.uiSchema;return{key:b.name,title:s(w),dataIndex:b.name,width:200,render:(E,$,B)=>{const K=$[b.name],bt={type:"object",properties:{[b.name]:A(f({name:`${b.name}`},u),{"x-read-pretty":!0,default:b.interface==="json"||typeof K=="object"?JSON.stringify(K):K})}};return c.jsx(r.EllipsisWithTooltip,{ellipsis:!0,children:c.jsx(y.RecursionField,{schema:bt,name:B,onlyRenderProperties:!0})})}}}):void 0};return I.useEffect(()=>{d(a)},[a,n]),I.useEffect(()=>{p([]);const T=g(n);p(T)},[t.values.fields]),c.jsx("div",{style:{marginBottom:"var(--tb-spacing)"},children:(l==null?void 0:l.length)>0&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ant-formily-item-label",style:{marginTop:"var(--tb-spacing)",display:"flex",padding:"0 0 8px"},children:[c.jsx("div",{className:"ant-formily-item-label-content",children:c.jsx("span",{children:c.jsx("label",{children:o("Preview")})})}),c.jsx("span",{className:"ant-formily-item-colon",children:":"})]}),c.jsx(h.Table,{size:"middle",pagination:!1,bordered:!0,columns:i,dataSource:l,scroll:{x:1e3,y:300}},"preview")]})},y.uid())},Ze=(e,t)=>e.filter(o=>o.children.filter(a=>a.availableTypes&&a.availableTypes.includes(t)).length>0).map(o=>({label:o.label,key:o.key,children:o.children.filter(n=>n.availableTypes&&n.availableTypes.includes(t))})),te=e=>{const t=r.useCompile(),{getInterface:s}=r.useCollectionManager_deprecated(),{t:o}=P(),n=y.useForm(),a=y.useField(),[i,p]=I.useState(a.value),l=r.useFieldInterfaceOptions().filter(v=>!["relation","systemInfo"].includes(v.key)),{modal:d}=h.App.useApp(),x=(v,b)=>{setTimeout(()=>{i.splice(b,1,v),p(i),a.value=i.concat()},300)},g=v=>{i.splice(v,1);const b=i.concat();a.value=b,p(b)},T=()=>{d.confirm({title:o("Are you sure you want to clear fields?"),onOk:()=>{n.setValuesIn("fields",[]),n.setValuesIn("preview",[])}})},S=I.useMemo(()=>[{dataIndex:"index",width:60,key:"index",render:(v,b,w)=>w+1},{title:o("Field display name"),dataIndex:"title",key:"title",width:150,render:(v,b,w)=>{const u=i[w];return c.jsx(h.Input,{defaultValue:u.uiSchema.title,onChange:V.debounce(D=>{x(A(f({},u),{uiSchema:A(f({},V.omit(u==null?void 0:u.uiSchema,"rawTitle")),{title:D.target.value})}),w)},300)})}},{title:o("Field name"),dataIndex:"name",key:"name",width:130},{title:o("Field type"),dataIndex:"type",width:140,key:"type",render:(v,b,w)=>{const u=i[w];return u!=null&&u.source||!(u!=null&&u.possibleTypes)?c.jsxs(h.Tag,{children:[" ",v]}):c.jsx(h.Select,{defaultValue:v,popupMatchSelectWidth:!1,style:{width:"100%"},options:(u==null?void 0:u.possibleTypes.map(D=>({label:D,value:D})))||[],onChange:D=>{x(A(f({},u),{type:D}),w)}})}},{title:o("Field interface"),dataIndex:"interface",key:"interface",width:150,render:(v,b,w)=>{const u=i[w],D=(u==null?void 0:u.type)&&Ze(l,u==null?void 0:u.type),N=E=>{var B;const $=s(E);x(A(f({},u),{interface:E,uiSchema:f(f({},u.uiSchema),(B=$==null?void 0:$.default)==null?void 0:B.uiSchema)}),w)};return c.jsx(h.Select,{defaultValue:v,style:{width:"100%"},popupMatchSelectWidth:!1,onChange:N,children:D==null?void 0:D.map(E=>c.jsx(h.Select.OptGroup,{label:t(E.label),children:E.children.map(({label:$,value:B,name:K})=>c.jsx(h.Select.Option,{value:K,children:t($)},B))},E.key))})}},{title:o("Actions"),dataIndex:"actions",fixed:"right",key:"actions",align:"center",width:100,render:(v,b,w)=>c.jsxs("a",{onClick:()=>g(w),children:[" ",o("Delete")]})}],[i]);return I.useEffect(()=>{p(a.value)},[a.value]),c.jsxs(c.Fragment,{children:[i.length?c.jsx(h.Button,{style:{position:"absolute",top:"-10px",right:"0px"},onClick:T,children:o("Clear")}):null,c.jsx(h.Table,{bordered:!0,size:"middle",columns:S,dataSource:i,scroll:{y:300},pagination:!1})]})};te.displayName="PreviewFields";function oe(e,t,s={}){const o=V.cloneDeep(s),n=f({name:`t_${y.uid()}`},o);n.reverseField&&(n.reverseField.name=`f_${y.uid()}`);const a=z("list",`{{t("List",{ ns: "${C}" })}}`),i=z("get",`{{t("Get",{ ns: "${C}" })}}`),p=z("create",`{{t("Create",{ ns: "${C}" })}}`),l=z("update",`{{t("Update",{ ns: "${C}" })}}`),d=z("destroy",`{{t("Destroy",{ ns: "${C}" })}}`);return{type:"object",properties:{[y.uid()]:{type:"void","x-component":"Action.Drawer","x-component-props":{getContainer:"{{ getContainer }}"},"x-decorator":"Form","x-decorator-props":{useValues(x){return r.useRequest(()=>Promise.resolve({data:n}),x)}},title:e,properties:{title:{type:"string",title:'{{ t("Collection display name") }}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Collection name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input","x-validator":"uid",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},description:{title:'{{t("Description")}}',type:"string",name:"description","x-decorator":"FormItem","x-component":"Input"},actions:{type:"void",title:F("Request actions"),"x-decorator":"FormItem","x-component":"FormCollapse","x-component-props":{size:"small",accordion:!0,defaultActiveKey:[]},properties:{list:a,get:i,create:p,update:l,destroy:d}},fields:{type:"array",required:!0,"x-component":te,"x-decorator":"FormItem",title:F("Fields",!0)},filterTargetKey:{title:F("Record unique key"),required:!0,type:"single",description:F("If a collection lacks a primary key, you must configure a unique record key to locate row records within a block, failure to configure this will prevent the creation of data blocks for the collection."),"x-decorator":"FormItem","x-component":"Select","x-reactions":["{{useAsyncDataSource(loadFilterTargetKeys)}}"]},preview:{type:"void","x-visible":"{{ createOnly }}","x-component":Qe,"x-reactions":{dependencies:["fields"],fulfill:{schema:{"x-component-props":"{{$form.values}}"}}}},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{action1:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}},action2:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:t}}}}}}}}}function re(e){return Object.keys(e).filter(n=>{const a=e[n];return a.method&&a.path}).reduce((n,a)=>A(f({},n),{[a]:e[a]}),{})}function se(e){return["list","get"].filter(t=>!e.includes(t))}function et(){const e=y.useForm(),{refreshCM:t}=r.useCollectionManager_deprecated(),s=r.useActionContext(),{refresh:o}=r.useResourceActionContext(),n=r.useAPIClient(),{name:a}=H.useParams(),i=n.resource("dataSources.collections",a),p=y.useField(),l=r.useDataSourceManager();return P(),{run(){return M(this,null,function*(){p.data=p.data||{},p.data.loading=!0;try{yield e.submit();const x=V.cloneDeep(e.values),g=re(x==null?void 0:x.actions),T=se(Object.keys(g)),S=V.pick(x,["fields","name","title","filterTargetKey"]),v=T[0];v?(e.query(`*.actions.${v}`).take(b=>{b.setComponentProps({style:{border:"1px solid #ff4d4f"}})}),yield e[v].submit()):(yield i.create({values:A(f({logging:!0},S),{actions:g})}),s.setVisible(!1),yield e.reset(),p.data.loading=!1,o(),yield t(),l.getDataSource(a).reload())}catch(x){console.error(x),p.data.loading=!1}})}}}const tt=e=>{const{scope:t,getContainer:s,item:o}=e,n=F("Create collection",!0),a=oe(n,et);return c.jsx(r.SchemaComponent,{schema:a,components:{ArrayTable:k.ArrayTable,TemplateSummay:r.TemplateSummary,FormCollapse:k.FormCollapse,ArrayItems:k.ArrayItems,FormLayout:k.FormLayout,FormItem:r.FormItem},scope:f({createOnly:!0,record:o,showReverseFieldConfig:!0,presetFieldsDisabled:!0,getContainer:s,useCancelAction:r.useCancelAction},t)})},ot=e=>{const{t}=P(!0),{scope:s,getContainer:o,item:n}=e,[a,i]=I.useState(!1),p=()=>i(!0);return c.jsx(r.RecordProvider,{record:n,children:c.jsxs(r.ActionContextProvider,{value:{visible:a,setVisible:i},children:[c.jsx(h.Button,{type:"primary",icon:c.jsx(R.PlusOutlined,{}),onClick:p,children:t("Create collection")}),c.jsx(tt,{scope:s,getContainer:o,item:n})]})})},rt=e=>{const t=r.useRecord();return c.jsx(ot,f({item:t},e))};function st(){const{run:e}=nt(),{refreshCM:t}=r.useCollectionManager_deprecated();return{run(){return M(this,null,function*(){yield e(),yield t()})}}}function nt(){const e=r.useAPIClient(),{t}=P(),s=y.useForm(),o=r.useActionContext(),{name:n}=H.useParams(),{state:a,setState:i,refresh:p}=r.useResourceActionContext();return{run(){return M(this,null,function*(){var d;if(!(a!=null&&a.selectedRowKeys)||a.selectedRowKeys.length===0)return h.message.error(t("Please select the records you want to delete"));yield e.resource("dataSources.collections",n).destroy({filterByTk:(a==null?void 0:a.selectedRowKeys)||[]}),s.reset(),(d=o==null?void 0:o.setVisible)==null||d.call(o,!1),i==null||i({selectedRowKeys:[]}),p()})}}}function at(){const{run:e}=ct(),{refreshCM:t}=r.useCollectionManager_deprecated();return{run(){return M(this,null,function*(){yield e(),yield t()})}}}function ct(){const e=r.useAPIClient(),t=r.useActionContext(),{key:s}=r.useRecord(),{name:o}=H.useParams(),{refresh:n}=r.useResourceActionContext();return{run(){return M(this,null,function*(){var i;yield e.resource("dataSources.collections",o).destroy({filterByTk:s}),(i=t==null?void 0:t.setVisible)==null||i.call(t,!1),n()})}}}const ne=e=>{const{t}=P(),{modal:s}=h.App.useApp(),v=e,{item:o,isBulk:n,children:a}=v,i=le(v,["item","isBulk","children"]),p=V.omit(i,["scope","getContainer","useAction"]),[l,d]=I.useState(!1),{run:x}=st(),{run:g}=at(),T=n?x:g,S=()=>{s.confirm({title:t("Delete collection"),content:t("Are you sure you want to delete it?"),onOk:T})};return c.jsx(r.RecordProvider,{record:o,children:c.jsx(r.ActionContextProvider,{value:{visible:l,setVisible:d},children:n?c.jsx(h.Button,{icon:c.jsx(R.DeleteOutlined,{}),onClick:S,children:a||t("Delete")}):c.jsx("a",A(f({onClick:S},p),{children:a||t("Delete")}))})})};ne.displayName="DeleteCollectionAction";const it=e=>{const t=r.useRecord();return c.jsx(ne,f({item:t},e))},pt=e=>{const t=r.useAPIClient(),s=r.useDataSourceManager(),{refreshCM:o}=r.useCollectionManager_deprecated(),{refresh:n}=r.useResourceActionContext(),a=y.useForm(),i=r.useActionContext(),{targetKey:p}=r.useResourceContext(),{name:l}=H.useParams(),{[p]:d}=r.useRecord(),x=t.resource("dataSources.collections",l);return{run(){return M(this,null,function*(){yield a.submit();const T=V.cloneDeep(a.values),S=re(T==null?void 0:T.actions),v=se(Object.keys(S)),b=V.pick(a.values,["fields","name","title","filterTargetKey"]),w=v[0];if(w)a.query(`*.actions.${w}`).take(u=>{u.setComponentProps({style:{border:"1px solid #ff4d4f"}})}),yield a[w].submit();else{yield x.update({filterByTk:d,values:A(f({},b),{actions:S})}),i.setVisible(!1);const u=s.getDataSource(l);u!=null&&u.reload||u.reload.call(u),yield a.reset(),n(),yield o()}})}}},lt=e=>{const{scope:t,getContainer:s,item:o}=e,n=oe('{{ t("Edit collection") }}',pt,o);return c.jsx(r.SchemaComponent,{schema:n,components:{ArrayTable:k.ArrayTable,TemplateSummay:r.TemplateSummary,FormCollapse:k.FormCollapse,ArrayItems:k.ArrayItems,FormLayout:k.FormLayout,FormItem:r.FormItem},scope:f({createOnly:!0,record:o,showReverseFieldConfig:!0,presetFieldsDisabled:!0,getContainer:s,useCancelAction:r.useCancelAction},t)})},dt=e=>{P();const{scope:t,getContainer:s,item:o}=e,[n,a]=I.useState(!1);return c.jsx(r.RecordProvider,{record:o,children:c.jsxs(r.ActionContextProvider,{value:{visible:n,setVisible:a},children:[c.jsx("a",{onClick:()=>a(!0),children:de("Edit")}),c.jsx(lt,{scope:t,item:o,getContainer:s})]})})},ut=e=>{const t=r.useRecord();return c.jsx(dt,f({item:t},e))},mt={type:"object",properties:{displayName:{type:"string",title:`{{t("Data source display name",{ ns: "${C}" })}}`,required:!0,"x-decorator":"FormItem","x-component":"Input"},key:{type:"string",title:`{{t("Data source name",{ ns: "${C}" })}}`,required:!0,"x-decorator":"FormItem","x-component":"Input","x-validator":"uid","x-disabled":"{{ createOnly }}",description:`{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.',{ ns: "${C}" })}}`},options:{type:"object",properties:{baseUrl:{type:"string",title:`{{t("BaseURL",{ ns: "${C}" })}}`,required:!0,"x-decorator":"FormItem","x-component":"Input.URL","x-validator":{type:"pattern",pattern:/^(https?|ftp):\/\/((([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})|(\d{1,3}\.){3}\d{1,3}|localhost)(:(\d{1,5}))?(\/[^\s]*)?$/,message:`{{t("Invalid URL",{ ns: "${C}" })}}`}},headers:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:`{{t("Headers", { ns: "${C}" })}}`,items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{style:{flexWrap:"nowrap",maxWidth:"100%",display:"flex"},className:r.css`
|
|
68
|
+
`,useValues(o){return s.current=x.useForm(),r.useRequest(()=>Promise.resolve(),o)},effects:()=>{const o=a=>{const i=s.current,{actions:p}=i.values||{},{path:l,value:d}=a.getState();l.includes("add")||i.setValuesIn("actions",A(f({},p),{[e]:X.unflatten(A(f({},p==null?void 0:p[e]),{[l]:d}))}))},n=V.debounce((a,i)=>D(this,null,function*(){i.modified&&(yield o(a))}),400);x.onFieldChange("*",(a,i)=>{i.modified&&n(a,i)})}},type:"void",properties:{[x.uid()]:{type:"void",properties:{requestAction:{type:"string","x-component":Q},requestTab:{type:"void","x-decorator":"FormItem",title:`{{t("Adapt request parameters",{ ns: "${C}" })}}`,"x-component":Z,"x-decorator-props":{tooltip:`{{t("Provide request variables from TachyBase for use by third-party APIs.",{ ns: "${C}" })}}`}},responseTransformer:{type:"string","x-decorator":"FormItem",title:`{{t("Convert third-party response results to NocoBase standard",{ ns: "${C}" })}}`,"x-component":ee,"x-decorator-props":{tooltip:`{{t("The response results from third-party APIs need to be converted to the NocoBase standard to display correctly on the frontend.",{ ns: "${C}" })}}`}},debug:{type:"void","x-component":Ge}}}}}}}},Qe=e=>{const t=x.useForm(),s=r.useCompile(),{t:o}=q(),{fields:n,preview:a}=e,[i,p]=I.useState([]),[l,d]=I.useState(a),{getInterface:u}=r.useCollectionManager_deprecated(),h=T=>{const S=T.filter(g=>g.source||g.interface);return S?S.map(g=>{var M,B;const w=((M=g==null?void 0:g.uiSchema)==null?void 0:M.title)||g.name,m=(B=u(g.interface))==null?void 0:B.default.uiSchema;return{key:g.name,title:s(w),dataIndex:g.name,width:200,render:(E,$,N)=>{const K=$[g.name],bt={type:"object",properties:{[g.name]:A(f({name:`${g.name}`},m),{"x-read-pretty":!0,default:g.interface==="json"||typeof K=="object"?JSON.stringify(K):K})}};return c.jsx(r.EllipsisWithTooltip,{ellipsis:!0,children:c.jsx(x.RecursionField,{schema:bt,name:N,onlyRenderProperties:!0})})}}}):void 0};return I.useEffect(()=>{d(a)},[a,n]),I.useEffect(()=>{p([]);const T=h(n);p(T)},[t.values.fields]),c.jsx("div",{style:{marginBottom:"var(--tb-spacing)"},children:(l==null?void 0:l.length)>0&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"ant-formily-item-label",style:{marginTop:"var(--tb-spacing)",display:"flex",padding:"0 0 8px"},children:[c.jsx("div",{className:"ant-formily-item-label-content",children:c.jsx("span",{children:c.jsx("label",{children:o("Preview")})})}),c.jsx("span",{className:"ant-formily-item-colon",children:":"})]}),c.jsx(b.Table,{size:"middle",pagination:!1,bordered:!0,columns:i,dataSource:l,scroll:{x:1e3,y:300}},"preview")]})},x.uid())},Ze=(e,t)=>e.filter(o=>o.children.filter(a=>a.availableTypes&&a.availableTypes.includes(t)).length>0).map(o=>({label:o.label,key:o.key,children:o.children.filter(n=>n.availableTypes&&n.availableTypes.includes(t))})),oe=e=>{const t=r.useCompile(),{getInterface:s}=r.useCollectionManager_deprecated(),{t:o}=q(),n=x.useForm(),a=x.useField(),[i,p]=I.useState(a.value),l=r.useFieldInterfaceOptions().filter(v=>!["relation","systemInfo"].includes(v.key)),{modal:d}=b.App.useApp(),u=(v,g)=>{setTimeout(()=>{i.splice(g,1,v),p(i),a.value=i.concat()},300)},h=v=>{i.splice(v,1);const g=i.concat();a.value=g,p(g)},T=()=>{d.confirm({title:o("Are you sure you want to clear fields?"),onOk:()=>{n.setValuesIn("fields",[]),n.setValuesIn("preview",[])}})},S=I.useMemo(()=>[{dataIndex:"index",width:60,key:"index",render:(v,g,w)=>w+1},{title:o("Field display name"),dataIndex:"title",key:"title",width:150,render:(v,g,w)=>{const m=i[w];return c.jsx(b.Input,{defaultValue:m.uiSchema.title,onChange:V.debounce(M=>{u(A(f({},m),{uiSchema:A(f({},V.omit(m==null?void 0:m.uiSchema,"rawTitle")),{title:M.target.value})}),w)},300)})}},{title:o("Field name"),dataIndex:"name",key:"name",width:130},{title:o("Field type"),dataIndex:"type",width:140,key:"type",render:(v,g,w)=>{const m=i[w];return m!=null&&m.source||!(m!=null&&m.possibleTypes)?c.jsxs(b.Tag,{children:[" ",v]}):c.jsx(b.Select,{defaultValue:v,popupMatchSelectWidth:!1,style:{width:"100%"},options:(m==null?void 0:m.possibleTypes.map(M=>({label:M,value:M})))||[],onChange:M=>{u(A(f({},m),{type:M}),w)}})}},{title:o("Field interface"),dataIndex:"interface",key:"interface",width:150,render:(v,g,w)=>{const m=i[w],M=(m==null?void 0:m.type)&&Ze(l,m==null?void 0:m.type),B=E=>{var N;const $=s(E);u(A(f({},m),{interface:E,uiSchema:f(f({},m.uiSchema),(N=$==null?void 0:$.default)==null?void 0:N.uiSchema)}),w)};return c.jsx(b.Select,{defaultValue:v,style:{width:"100%"},popupMatchSelectWidth:!1,onChange:B,children:M==null?void 0:M.map(E=>c.jsx(b.Select.OptGroup,{label:t(E.label),children:E.children.map(({label:$,value:N,name:K})=>c.jsx(b.Select.Option,{value:K,children:t($)},N))},E.key))})}},{title:o("Actions"),dataIndex:"actions",fixed:"right",key:"actions",align:"center",width:100,render:(v,g,w)=>c.jsxs("a",{onClick:()=>h(w),children:[" ",o("Delete")]})}],[i]);return I.useEffect(()=>{p(a.value)},[a.value]),c.jsxs(c.Fragment,{children:[i.length?c.jsx(b.Button,{style:{position:"absolute",top:"-10px",right:"0px"},onClick:T,children:o("Clear")}):null,c.jsx(b.Table,{bordered:!0,size:"middle",columns:S,dataSource:i,scroll:{y:300},pagination:!1})]})};oe.displayName="PreviewFields";function re(e,t,s={}){const o=V.cloneDeep(s),n=f({name:`t_${x.uid()}`},o);n.reverseField&&(n.reverseField.name=`f_${x.uid()}`);const a=z("list",`{{t("List",{ ns: "${C}" })}}`),i=z("get",`{{t("Get",{ ns: "${C}" })}}`),p=z("create",`{{t("Create",{ ns: "${C}" })}}`),l=z("update",`{{t("Update",{ ns: "${C}" })}}`),d=z("destroy",`{{t("Destroy",{ ns: "${C}" })}}`);return{type:"object",properties:{[x.uid()]:{type:"void","x-component":"Action.Drawer","x-component-props":{getContainer:"{{ getContainer }}"},"x-decorator":"Form","x-decorator-props":{useValues(u){return r.useRequest(()=>Promise.resolve({data:n}),u)}},title:e,properties:{title:{type:"string",title:'{{ t("Collection display name") }}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Collection name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input","x-validator":"uid",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},description:{title:'{{t("Description")}}',type:"string",name:"description","x-decorator":"FormItem","x-component":"Input"},actions:{type:"void",title:F("Request actions"),"x-decorator":"FormItem","x-component":"FormCollapse","x-component-props":{size:"small",accordion:!0,defaultActiveKey:[]},properties:{list:a,get:i,create:p,update:l,destroy:d}},fields:{type:"array",required:!0,"x-component":oe,"x-decorator":"FormItem",title:F("Fields",!0)},filterTargetKey:{title:F("Record unique key"),required:!0,type:"single",description:F("If a collection lacks a primary key, you must configure a unique record key to locate row records within a block, failure to configure this will prevent the creation of data blocks for the collection."),"x-decorator":"FormItem","x-component":"Select","x-reactions":["{{useAsyncDataSource(loadFilterTargetKeys)}}"]},preview:{type:"void","x-visible":"{{ createOnly }}","x-component":Qe,"x-reactions":{dependencies:["fields"],fulfill:{schema:{"x-component-props":"{{$form.values}}"}}}},footer:{type:"void","x-component":"Action.Drawer.Footer",properties:{action1:{title:'{{ t("Cancel") }}',"x-component":"Action","x-component-props":{useAction:"{{ useCancelAction }}"}},action2:{title:'{{ t("Submit") }}',"x-component":"Action","x-component-props":{type:"primary",useAction:t}}}}}}}}}function se(e){return Object.keys(e).filter(n=>{const a=e[n];return a.method&&a.path}).reduce((n,a)=>A(f({},n),{[a]:e[a]}),{})}function ne(e){return["list","get"].filter(t=>!e.includes(t))}function et(){const e=x.useForm(),{refreshCM:t}=r.useCollectionManager_deprecated(),s=r.useActionContext(),{refresh:o}=r.useResourceActionContext(),n=r.useAPIClient(),{name:a}=H.useParams(),i=n.resource("dataSources.collections",a),p=x.useField(),l=r.useDataSourceManager();return q(),{run(){return D(this,null,function*(){p.data=p.data||{},p.data.loading=!0;try{yield e.submit();const u=V.cloneDeep(e.values),h=se(u==null?void 0:u.actions),T=ne(Object.keys(h)),S=V.pick(u,["fields","name","title","filterTargetKey"]),v=T[0];v?(e.query(`*.actions.${v}`).take(g=>{g.setComponentProps({style:{border:"1px solid #ff4d4f"}})}),yield e[v].submit()):(yield i.create({values:A(f({logging:!0},S),{actions:h})}),s.setVisible(!1),yield e.reset(),p.data.loading=!1,o(),yield t(),l.getDataSource(a).reload())}catch(u){console.error(u),p.data.loading=!1}})}}}const tt=e=>{const{scope:t,getContainer:s,item:o}=e,n=F("Create collection",!0),a=re(n,et);return c.jsx(r.SchemaComponent,{schema:a,components:{ArrayTable:k.ArrayTable,TemplateSummay:r.TemplateSummary,FormCollapse:k.FormCollapse,ArrayItems:k.ArrayItems,FormLayout:k.FormLayout,FormItem:r.FormItem},scope:f({createOnly:!0,record:o,showReverseFieldConfig:!0,presetFieldsDisabled:!0,getContainer:s,useCancelAction:r.useCancelAction},t)})},ot=e=>{const{t}=q(!0),{scope:s,getContainer:o,item:n}=e,[a,i]=I.useState(!1),p=()=>i(!0);return c.jsx(r.RecordProvider,{record:n,children:c.jsxs(r.ActionContextProvider,{value:{visible:a,setVisible:i},children:[c.jsx(b.Button,{type:"primary",icon:c.jsx(R.PlusOutlined,{}),onClick:p,children:t("Create collection")}),c.jsx(tt,{scope:s,getContainer:o,item:n})]})})},rt=e=>{const t=r.useRecord();return c.jsx(ot,f({item:t},e))};function st(){const{run:e}=nt(),{refreshCM:t}=r.useCollectionManager_deprecated();return{run(){return D(this,null,function*(){yield e(),yield t()})}}}function nt(){const e=r.useAPIClient(),{t}=q(),s=x.useForm(),o=r.useActionContext(),{name:n}=H.useParams(),{state:a,setState:i,refresh:p}=r.useResourceActionContext();return{run(){return D(this,null,function*(){var d;if(!(a!=null&&a.selectedRowKeys)||a.selectedRowKeys.length===0)return b.message.error(t("Please select the records you want to delete"));yield e.resource("dataSources.collections",n).destroy({filterByTk:(a==null?void 0:a.selectedRowKeys)||[]}),s.reset(),(d=o==null?void 0:o.setVisible)==null||d.call(o,!1),i==null||i({selectedRowKeys:[]}),p()})}}}function at(){const{run:e}=ct(),{refreshCM:t}=r.useCollectionManager_deprecated();return{run(){return D(this,null,function*(){yield e(),yield t()})}}}function ct(){const e=r.useAPIClient(),t=r.useActionContext(),{key:s}=r.useRecord(),{name:o}=H.useParams(),{refresh:n}=r.useResourceActionContext();return{run(){return D(this,null,function*(){var i;yield e.resource("dataSources.collections",o).destroy({filterByTk:s}),(i=t==null?void 0:t.setVisible)==null||i.call(t,!1),n()})}}}const ae=e=>{const{t}=q(),{modal:s}=b.App.useApp(),v=e,{item:o,isBulk:n,children:a}=v,i=de(v,["item","isBulk","children"]),p=V.omit(i,["scope","getContainer","useAction"]),[l,d]=I.useState(!1),{run:u}=st(),{run:h}=at(),T=n?u:h,S=()=>{s.confirm({title:t("Delete collection"),content:t("Are you sure you want to delete it?"),onOk:T})};return c.jsx(r.RecordProvider,{record:o,children:c.jsx(r.ActionContextProvider,{value:{visible:l,setVisible:d},children:n?c.jsx(b.Button,{icon:c.jsx(R.DeleteOutlined,{}),onClick:S,children:a||_("Delete")}):c.jsx("a",A(f({onClick:S},p),{children:a||_("Delete")}))})})};ae.displayName="DeleteCollectionAction";const it=e=>{const t=r.useRecord();return c.jsx(ae,f({item:t},e))},pt=e=>{const t=r.useAPIClient(),s=r.useDataSourceManager(),{refreshCM:o}=r.useCollectionManager_deprecated(),{refresh:n}=r.useResourceActionContext(),a=x.useForm(),i=r.useActionContext(),{targetKey:p}=r.useResourceContext(),{name:l}=H.useParams(),{[p]:d}=r.useRecord(),u=t.resource("dataSources.collections",l);return{run(){return D(this,null,function*(){yield a.submit();const T=V.cloneDeep(a.values),S=se(T==null?void 0:T.actions),v=ne(Object.keys(S)),g=V.pick(a.values,["fields","name","title","filterTargetKey","description"]),w=v[0];if(w)a.query(`*.actions.${w}`).take(m=>{m.setComponentProps({style:{border:"1px solid #ff4d4f"}})}),yield a[w].submit();else{yield u.update({filterByTk:d,values:A(f({},g),{actions:S})}),i.setVisible(!1);const m=s.getDataSource(l);m!=null&&m.reload||m.reload.call(m),yield a.reset(),n(),yield o()}})}}},lt=e=>{const{scope:t,getContainer:s,item:o}=e,n=re('{{ t("Edit collection") }}',pt,o);return c.jsx(r.SchemaComponent,{schema:n,components:{ArrayTable:k.ArrayTable,TemplateSummay:r.TemplateSummary,FormCollapse:k.FormCollapse,ArrayItems:k.ArrayItems,FormLayout:k.FormLayout,FormItem:r.FormItem},scope:f({createOnly:!0,record:o,showReverseFieldConfig:!0,presetFieldsDisabled:!0,getContainer:s,useCancelAction:r.useCancelAction},t)})},dt=e=>{q();const{scope:t,getContainer:s,item:o}=e,[n,a]=I.useState(!1),[i,p]=I.useState(null),d=r.useAPIClient().resource("dataSources.collections",o.dataSourceKey);return c.jsx(r.RecordProvider,{record:o,children:c.jsxs(r.ActionContextProvider,{value:{visible:n,setVisible:a},children:[c.jsx("a",{onClick:()=>D(this,null,function*(){var h;const u=yield d.get({filterByTk:o.key,appends:["fields"]});p((h=u==null?void 0:u.data)==null?void 0:h.data),a(!0)}),children:_("Edit")}),c.jsx(lt,{scope:t,item:i,getContainer:s})]})})},ut=e=>{const t=r.useRecord();return c.jsx(dt,f({item:t},e))},mt={type:"object",properties:{displayName:{type:"string",title:`{{t("Data source display name",{ ns: "${C}" })}}`,required:!0,"x-decorator":"FormItem","x-component":"Input"},key:{type:"string",title:`{{t("Data source name",{ ns: "${C}" })}}`,required:!0,"x-decorator":"FormItem","x-component":"Input","x-validator":"uid","x-disabled":"{{ createOnly }}",description:`{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.',{ ns: "${C}" })}}`},options:{type:"object",properties:{baseUrl:{type:"string",title:`{{t("BaseURL",{ ns: "${C}" })}}`,required:!0,"x-decorator":"FormItem","x-component":"Input.URL","x-validator":{type:"pattern",pattern:/^(https?|ftp):\/\/((([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})|(\d{1,3}\.){3}\d{1,3}|localhost)(:(\d{1,5}))?(\/[^\s]*)?$/,message:`{{t("Invalid URL",{ ns: "${C}" })}}`}},headers:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:`{{t("Headers", { ns: "${C}" })}}`,items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{style:{flexWrap:"nowrap",maxWidth:"100%",display:"flex"},className:r.css`
|
|
69
69
|
& > .ant-space-item:first-child,
|
|
70
70
|
& > .ant-space-item:last-child {
|
|
71
71
|
flex-shrink: 0;
|
|
@@ -83,4 +83,4 @@
|
|
|
83
83
|
& > .ant-space-item:nth-of-type(2) {
|
|
84
84
|
flex: 1;
|
|
85
85
|
}
|
|
86
|
-
`},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}},value:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{useTypedConstant:!0}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:`{{t("Add variable", { ns: "${C}" })}}`,"x-component":"ArrayItems.Addition"}}},timeout:{type:"string",title:`{{t("Timeout",{ ns: "${C}" })}}`,"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{addonAfter:"ms",style:{minWidth:200}},default:5e3},responseType:{type:"string",title:`{{t("Response type",{ ns: "${C}" })}}`,"x-decorator":"FormItem","x-component":"Select",default:"json",enum:[{value:"json",label:`{{t("JSON",{ ns: "${C}" })}}`}]}}},enabled:{type:"string","x-content":`{{t("Enabled the data source",{ ns: "${C}" })}}`,"x-decorator":"FormItem","x-component":"Checkbox",default:!0}}},yt=()=>{const{t:e}=
|
|
86
|
+
`},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}},value:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{useTypedConstant:!0}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},properties:{add:{type:"void",title:`{{t("Add variable", { ns: "${C}" })}}`,"x-component":"ArrayItems.Addition"}}},timeout:{type:"string",title:`{{t("Timeout",{ ns: "${C}" })}}`,"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{addonAfter:"ms",style:{minWidth:200}},default:5e3},responseType:{type:"string",title:`{{t("Response type",{ ns: "${C}" })}}`,"x-decorator":"FormItem","x-component":"Select",default:"json",enum:[{value:"json",label:`{{t("JSON",{ ns: "${C}" })}}`}]}}},enabled:{type:"string","x-content":`{{t("Enabled the data source",{ ns: "${C}" })}}`,"x-decorator":"FormItem","x-component":"Checkbox",default:!0}}},yt=()=>{const{t:e}=q();return c.jsx(r.SchemaComponent,{schema:mt,components:{Space:r.Space},scope:{t:e}})};class xt extends r.Plugin{load(){return D(this,null,function*(){this.app.pm.get(P).registerType("http",{label:F("REST API"),allowCollectionCreate:!0,allowCollectionDeletion:!0,disabledConfigureFields:!1,disableAddFields:!0,disableTestConnection:!0,DataSourceSettingsForm:yt,AddCollection:rt,EditCollection:ut,DeleteCollection:it})})}}const ft=()=>{const{t:e}=q();return c.jsx(r.SchemaComponent,{scope:{t:e},schema:{type:"object",properties:{key:{type:"string",title:F("Data source name"),required:!0,"x-decorator":"FormItem","x-component":"Input","x-validator":"uid","x-disabled":"{{ createOnly }}",description:F("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")},displayName:{type:"string",title:F("Data source display name"),required:!0,"x-decorator":"FormItem","x-component":"Input"},options:{type:"object",properties:{host:{type:"string",title:F("Host"),required:!0,"x-decorator":"FormItem","x-component":"Input",default:"localhost"},port:{type:"string",title:F("Port"),required:!0,"x-decorator":"FormItem","x-component":"Input",default:3306},database:{type:"string",title:F("Database"),required:!0,"x-decorator":"FormItem","x-component":"Input"},username:{type:"string",title:F("Username"),required:!0,"x-decorator":"FormItem","x-component":"Input"},password:{type:"string",title:F("Password"),"x-decorator":"FormItem","x-component":"Password"},tablePrefix:{type:"string",title:F("Table prefix"),"x-decorator":"FormItem","x-component":"Input"}}},enabled:{type:"string","x-content":F("Enabled the data source"),"x-decorator":"FormItem","x-component":"Checkbox",default:!0}}}})},ht=()=>{const{t:e}=q();return c.jsx(r.SchemaComponent,{scope:{t:e},components:{Space:b.Space},schema:{type:"object",properties:{key:{type:"string",title:F("Data source name"),required:!0,"x-decorator":"FormItem","x-component":"Input","x-validator":"uid","x-disabled":"{{ createOnly }}",description:F("Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.")},displayName:{type:"string",title:F("Data source display name"),required:!0,"x-decorator":"FormItem","x-component":"Input"},options:{type:"object",properties:{host:{type:"string",title:F("Host"),required:!0,"x-decorator":"FormItem","x-component":"Input",default:"localhost"},port:{type:"string",title:F("Port"),required:!0,"x-decorator":"FormItem","x-component":"Input",default:5432},database:{type:"string",title:F("Database"),required:!0,"x-decorator":"FormItem","x-component":"Input"},username:{type:"string",title:F("Username"),required:!0,"x-decorator":"FormItem","x-component":"Input"},password:{type:"string",title:F("Password"),"x-decorator":"FormItem","x-component":"Password"},tablePrefix:{type:"string",title:F("Table prefix"),"x-decorator":"FormItem","x-component":"Input"},schema:{type:"string",title:F("Schema"),"x-decorator":"FormItem","x-component":"Input"}}},enabled:{type:"string","x-content":F("Enabled the data source"),"x-decorator":"FormItem","x-component":"Checkbox",default:!0}}}})};class ce extends r.Plugin{afterAdd(){return D(this,null,function*(){this.app.pm.add(xt)})}load(){return D(this,null,function*(){this.app.pm.get(P.PluginDataSourceManagerClient).registerType("postgres",{DataSourceSettingsForm:ht,label:F("PostgreSQL")}),this.app.pm.get(P.PluginDataSourceManagerClient).registerType("mysql",{DataSourceSettingsForm:ft,label:F("MySQL")})})}}y.PluginExternalDataSourceClient=ce,y.default=ce,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@tachybase/client": "0.23.
|
|
3
|
-
"@tachybase/module-data-source": "0.23.
|
|
4
|
-
"@tachybase/server": "0.23.
|
|
2
|
+
"@tachybase/client": "0.23.20",
|
|
3
|
+
"@tachybase/module-data-source": "0.23.20",
|
|
4
|
+
"@tachybase/server": "0.23.20",
|
|
5
5
|
"react": "18.3.1",
|
|
6
6
|
"antd": "5.22.5",
|
|
7
7
|
"lodash": "4.17.21",
|
|
8
|
-
"@tachybase/database": "0.23.
|
|
9
|
-
"@tachybase/data-source": "0.23.
|
|
10
|
-
"@tachybase/utils": "0.23.
|
|
11
|
-
"axios": "1.7.
|
|
8
|
+
"@tachybase/database": "0.23.20",
|
|
9
|
+
"@tachybase/data-source": "0.23.20",
|
|
10
|
+
"@tachybase/utils": "0.23.20",
|
|
11
|
+
"axios": "1.7.7",
|
|
12
12
|
"@ant-design/icons": "5.5.2",
|
|
13
|
-
"@tachybase/schema": "0.23.
|
|
14
|
-
"@tachybase/components": "0.23.
|
|
13
|
+
"@tachybase/schema": "0.23.20",
|
|
14
|
+
"@tachybase/components": "0.23.20",
|
|
15
15
|
"react-router-dom": "6.28.1"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-data-source-common",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.20",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"dependencies": {},
|
|
6
6
|
"devDependencies": {
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"react-router-dom": "6.28.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@tachybase/client": "0.23.
|
|
18
|
-
"@tachybase/components": "0.23.
|
|
19
|
-
"@tachybase/data-source": "0.23.
|
|
20
|
-
"@tachybase/database": "0.23.
|
|
21
|
-
"@tachybase/
|
|
22
|
-
"@tachybase/
|
|
23
|
-
"@tachybase/
|
|
24
|
-
"@tachybase/
|
|
25
|
-
"@tachybase/
|
|
17
|
+
"@tachybase/client": "0.23.20",
|
|
18
|
+
"@tachybase/components": "0.23.20",
|
|
19
|
+
"@tachybase/data-source": "0.23.20",
|
|
20
|
+
"@tachybase/database": "0.23.20",
|
|
21
|
+
"@tachybase/module-data-source": "0.23.20",
|
|
22
|
+
"@tachybase/server": "0.23.20",
|
|
23
|
+
"@tachybase/schema": "0.23.20",
|
|
24
|
+
"@tachybase/test": "0.23.20",
|
|
25
|
+
"@tachybase/utils": "0.23.20"
|
|
26
26
|
},
|
|
27
27
|
"description.zh-CN": "支持更多的数据源",
|
|
28
28
|
"displayName.zh-CN": "外部数据源支持",
|