@tachybase/plugin-data-source-common 1.0.6 → 1.0.18
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/index.js
CHANGED
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
.ant-formily-item-feedback-layout-loose {
|
|
59
59
|
margin-bottom: 10px;
|
|
60
60
|
}
|
|
61
|
-
`},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":Ke}}}}},tachyBaseResponse:{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":Oe}}}}}}}},Re=()=>{const e=x.useForm(),{setVisible:t}=v.useContext(r.ActionContext),{setRawResponse:s,setDebugResponse:o}=j();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}=O(),{name:i}=$.useParams(),{setRawResponse:p,setDebugResponse:l,setResponseValidationErrorMessage:d}=j();return{run(){return D(this,null,function*(){var T,w;const h=(w=(T=o==null?void 0:o.values)==null?void 0:T.actions)==null?void 0:w[n];try{e.data=(e==null?void 0:e.data)||{},e.data.loading=!0,yield a.submit();const b=t.resource("dataSources.httpCollections",i),I=V.omit(s.values,"responseTab"),{data:{data:S}}=yield b.runAction({values:{debug:!0,inferFields:!1,actionOptions:A(f({},h),{type:n,responseTransformer:h==null?void 0:h.responseTransformer}),debugVars:I}});e.data.loading=!1;const{rawResponse:m,debugBody:M,responseValidationErrorMessage:B}=S;p(m),l(M),d(B)}catch(b){e.data.loading=!1,console.
|
|
61
|
+
`},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":Ke}}}}},tachyBaseResponse:{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":Oe}}}}}}}},Re=()=>{const e=x.useForm(),{setVisible:t}=v.useContext(r.ActionContext),{setRawResponse:s,setDebugResponse:o}=j();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}=O(),{name:i}=$.useParams(),{setRawResponse:p,setDebugResponse:l,setResponseValidationErrorMessage:d}=j();return{run(){return D(this,null,function*(){var T,w;const h=(w=(T=o==null?void 0:o.values)==null?void 0:T.actions)==null?void 0:w[n];try{e.data=(e==null?void 0:e.data)||{},e.data.loading=!0,yield a.submit();const b=t.resource("dataSources.httpCollections",i),I=V.omit(s.values,"responseTab"),{data:{data:S}}=yield b.runAction({values:{debug:!0,inferFields:!1,actionOptions:A(f({},h),{type:n,responseTransformer:h==null?void 0:h.responseTransformer}),debugVars:I}});e.data.loading=!1;const{rawResponse:m,debugBody:M,responseValidationErrorMessage:B}=S;p(m),l(M),d(B)}catch(b){e.data.loading=!1,console.error(b)}})}}},Je=()=>{const{t:e}=q(),t=Xe();return c.jsx(r.SchemaComponent,{schema:t,components:{Form:k.Form,Input:r.Input,Action:r.Action,FormItem:r.FormItem,InputNumber:r.InputNumber,Card:g.Card,Variable:r.Variable,Space:r.Space,Select:g.Select,FormLayout:k.FormLayout,Row:g.Row,Col:g.Col},scope:{t:e,useDebugAction:_e,useCancelAction:Re,useVariableOptions:L}})},Ge=()=>{const{t:e}=q(),{requestActionForm:t}=O(),[s,o]=v.useState(!1),n=()=>D(this,null,function*(){yield t.submit(),o(!0)});return c.jsxs(c.Fragment,{children:[c.jsx(g.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=v.useMemo(()=>x.createForm({}),[]),[n,a]=v.useState(null);return c.jsx(ue,{value:{form:A(f({},t),{[s]:o}),actionKey:s,requestActionForm:o,responseTransformer:n,setResponseTransformer:a},children:e.children})},W=(e,t)=>{const s=v.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`
|
|
62
62
|
.ant-formily-item-feedback-layout-loose {
|
|
63
63
|
margin-bottom: 10px;
|
|
64
64
|
}
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@tachybase/client": "1.0.
|
|
3
|
-
"@tachybase/module-data-source": "1.0.
|
|
4
|
-
"@tachybase/server": "1.0.
|
|
2
|
+
"@tachybase/client": "1.0.18",
|
|
3
|
+
"@tachybase/module-data-source": "1.0.18",
|
|
4
|
+
"@tachybase/server": "1.0.18",
|
|
5
5
|
"react": "18.3.1",
|
|
6
6
|
"antd": "5.22.5",
|
|
7
7
|
"lodash": "4.17.21",
|
|
8
|
-
"@tachybase/database": "1.0.
|
|
9
|
-
"@tachybase/data-source": "1.0.
|
|
10
|
-
"@tachybase/utils": "1.0.
|
|
8
|
+
"@tachybase/database": "1.0.18",
|
|
9
|
+
"@tachybase/data-source": "1.0.18",
|
|
10
|
+
"@tachybase/utils": "1.0.18",
|
|
11
11
|
"axios": "1.7.7",
|
|
12
12
|
"@ant-design/icons": "5.5.2",
|
|
13
|
-
"@tachybase/schema": "1.0.
|
|
14
|
-
"@tachybase/components": "1.0.
|
|
13
|
+
"@tachybase/schema": "1.0.18",
|
|
14
|
+
"@tachybase/components": "1.0.18",
|
|
15
15
|
"react-router-dom": "6.28.1"
|
|
16
16
|
};
|
|
@@ -116,10 +116,7 @@ function rawTypeToFieldType(rawType, exampleValue) {
|
|
|
116
116
|
},
|
|
117
117
|
number: () => {
|
|
118
118
|
if (Number.isInteger(exampleValue)) {
|
|
119
|
-
|
|
120
|
-
return ["integer", "bigInt"];
|
|
121
|
-
}
|
|
122
|
-
return "integer";
|
|
119
|
+
return ["integer", "float", "date", "bigInt"];
|
|
123
120
|
}
|
|
124
121
|
return "float";
|
|
125
122
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-data-source-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
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": "1.0.
|
|
18
|
-
"@tachybase/components": "1.0.
|
|
19
|
-
"@tachybase/data-source": "1.0.
|
|
20
|
-
"@tachybase/
|
|
21
|
-
"@tachybase/
|
|
22
|
-
"@tachybase/schema": "1.0.
|
|
23
|
-
"@tachybase/
|
|
24
|
-
"@tachybase/server": "1.0.
|
|
25
|
-
"@tachybase/
|
|
17
|
+
"@tachybase/client": "1.0.18",
|
|
18
|
+
"@tachybase/components": "1.0.18",
|
|
19
|
+
"@tachybase/data-source": "1.0.18",
|
|
20
|
+
"@tachybase/module-data-source": "1.0.18",
|
|
21
|
+
"@tachybase/database": "1.0.18",
|
|
22
|
+
"@tachybase/schema": "1.0.18",
|
|
23
|
+
"@tachybase/utils": "1.0.18",
|
|
24
|
+
"@tachybase/server": "1.0.18",
|
|
25
|
+
"@tachybase/test": "1.0.18"
|
|
26
26
|
},
|
|
27
27
|
"description.zh-CN": "支持更多的数据源",
|
|
28
28
|
"displayName.zh-CN": "外部数据源支持",
|