@ywfe/fe-tools 1.2.1-beta.32 → 1.2.1-beta.33

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.
@@ -4,5 +4,9 @@ interface userInput {
4
4
  }
5
5
  declare function userInputToJson({ input }: {
6
6
  input: userInput;
7
- }): Promise<any>;
7
+ }): Promise<{
8
+ message: string;
9
+ success: boolean;
10
+ data: any;
11
+ }>;
8
12
  export default userInputToJson;
@@ -8728,6 +8728,7 @@ function request(_a) {
8728
8728
  };
8729
8729
  prefix = getBasePath();
8730
8730
  requestUrl = isValidURL(input.url) ? input.url : "".concat(prefix).concat(input.url);
8731
+ console.log('requestUrl', requestUrl, isValidURL(input.url));
8731
8732
  fetchOption = {
8732
8733
  method: method,
8733
8734
  headers: {
@@ -8746,13 +8747,11 @@ function request(_a) {
8746
8747
  response = _c.sent();
8747
8748
  if (!response.ok) {
8748
8749
  message = "An error has occured: ".concat(response.status);
8749
- console.log('req result', message);
8750
8750
  return [2 /*return*/, { success: false, message: message }];
8751
8751
  }
8752
8752
  return [4 /*yield*/, response.json()];
8753
8753
  case 2:
8754
8754
  result = _c.sent();
8755
- console.log('req result', result);
8756
8755
  return [2 /*return*/, result];
8757
8756
  }
8758
8757
  });
@@ -8761,28 +8760,21 @@ function request(_a) {
8761
8760
 
8762
8761
  function userInputToJson(_a) {
8763
8762
  return __awaiter(this, arguments, void 0, function (_b) {
8764
- var res, result;
8763
+ var res;
8765
8764
  var input = _b.input;
8766
8765
  return __generator(this, function (_c) {
8767
8766
  switch (_c.label) {
8768
- case 0:
8769
- console.log("input", input);
8770
- return [4 /*yield*/, request({
8771
- input: {
8772
- url: "https://fc-typechat.ywwl.com/userInputToJson",
8773
- method: "GET",
8774
- params: input,
8775
- },
8776
- })];
8767
+ case 0: return [4 /*yield*/, request({
8768
+ input: {
8769
+ url: "https://fc-typechat.ywwl.com/userInputToJson",
8770
+ method: "GET",
8771
+ params: input,
8772
+ },
8773
+ })];
8777
8774
  case 1:
8778
8775
  res = _c.sent();
8779
- if (res.success) {
8780
- result = res.data;
8781
- return [2 /*return*/, result.success ? result.data : result];
8782
- }
8783
- else {
8784
- return [2 /*return*/, res.success ? res.data : res];
8785
- }
8776
+ console.log('userINput1', res);
8777
+ return [2 /*return*/, res];
8786
8778
  }
8787
8779
  });
8788
8780
  });