@ywfe/fe-tools 1.2.1-beta.15 → 1.2.1-beta.16

Sign up to get free protection for your applications and to get access to all the features.
package/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as request } from './request'
2
+ export { default as userInputToJson } from './userInputToJson'
2
3
  export { default as JSON2String } from './JSON2String'
package/lib/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as request } from './request';
2
+ export { default as userInputToJson } from './userInputToJson';
2
3
  export { default as JSON2String } from './JSON2String';
@@ -0,0 +1,8 @@
1
+ interface userInput {
2
+ userInput?: string;
3
+ rules?: string;
4
+ }
5
+ declare function userInputToJson({ input }: {
6
+ input: userInput;
7
+ }): Promise<any>;
8
+ export default userInputToJson;
@@ -10739,6 +10739,35 @@ function request(_a) {
10739
10739
  });
10740
10740
  }
10741
10741
 
10742
+ function userInputToJson(_a) {
10743
+ return __awaiter(this, arguments, void 0, function (_b) {
10744
+ var res, result;
10745
+ var input = _b.input;
10746
+ return __generator(this, function (_c) {
10747
+ switch (_c.label) {
10748
+ case 0:
10749
+ console.log("input", input);
10750
+ return [4 /*yield*/, request({
10751
+ input: {
10752
+ url: "https://fc-typechat.ywwl.com/userInputToJson",
10753
+ method: "GET",
10754
+ params: input,
10755
+ },
10756
+ })];
10757
+ case 1:
10758
+ res = _c.sent();
10759
+ if (res.success) {
10760
+ result = res.data;
10761
+ return [2 /*return*/, result.success ? result.data : result];
10762
+ }
10763
+ else {
10764
+ return [2 /*return*/, res.success ? res.data : res];
10765
+ }
10766
+ }
10767
+ });
10768
+ });
10769
+ }
10770
+
10742
10771
  function JSON2String(_a) {
10743
10772
  var input = _a.input;
10744
10773
  var _b = input.data, data = _b === void 0 ? {} : _b;
@@ -10752,4 +10781,5 @@ function JSON2String(_a) {
10752
10781
 
10753
10782
  exports.JSON2String = JSON2String;
10754
10783
  exports.request = request;
10784
+ exports.userInputToJson = userInputToJson;
10755
10785
  //# sourceMappingURL=ywfe-tools.cjs.map