@nocobase/client 0.7.0-alpha.80 → 0.7.0-alpha.83
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/es/acl/ACLProvider.js +10 -15
- package/es/antd-config-provider/index.js +7 -4
- package/es/api-client/APIClient.d.ts +2 -30
- package/es/api-client/APIClient.js +30 -158
- package/es/api-client/hooks/useResource.d.ts +1 -1
- package/es/block-provider/hooks/index.d.ts +3 -0
- package/es/block-provider/hooks/index.js +233 -168
- package/es/collection-manager/Configuration/AddFieldAction.js +27 -9
- package/es/collection-manager/Configuration/EditFieldAction.js +25 -8
- package/es/collection-manager/hooks/useCollection.d.ts +1 -1
- package/es/i18n/i18n.js +3 -3
- package/es/locale/en_US.d.ts +10 -0
- package/es/locale/en_US.js +11 -1
- package/es/locale/index.d.ts +44 -0
- package/es/locale/zh_CN.d.ts +34 -0
- package/es/locale/zh_CN.js +35 -1
- package/es/schema-component/antd/action/Action.Designer.js +33 -13
- package/es/schema-component/antd/action/utils.d.ts +2 -0
- package/es/schema-component/antd/action/utils.js +60 -0
- package/es/schema-component/antd/date-picker/util.d.ts +2 -1
- package/es/schema-component/antd/date-picker/util.js +4 -2
- package/es/schema-initializer/buttons/FormActionInitializers.d.ts +84 -0
- package/es/schema-initializer/buttons/FormActionInitializers.js +63 -0
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +26 -0
- package/es/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +21 -0
- package/es/schema-initializer/buttons/TableActionColumnInitializers.js +21 -0
- package/es/schema-settings/SchemaSettings.js +48 -16
- package/es/user/CurrentUser.js +1 -1
- package/es/user/LanguageSettings.js +4 -3
- package/es/user/SigninPage.js +3 -14
- package/es/user/SwitchRole.js +2 -26
- package/es/workflow/triggers/collection.js +1 -0
- package/es/workflow/triggers/index.js +2 -0
- package/es/workflow/triggers/schedule.d.ts +25 -0
- package/es/workflow/triggers/schedule.js +531 -0
- package/lib/acl/ACLProvider.js +9 -15
- package/lib/antd-config-provider/index.js +6 -3
- package/lib/api-client/APIClient.d.ts +2 -30
- package/lib/api-client/APIClient.js +26 -160
- package/lib/api-client/hooks/useResource.d.ts +1 -1
- package/lib/block-provider/hooks/index.d.ts +3 -0
- package/lib/block-provider/hooks/index.js +238 -169
- package/lib/collection-manager/Configuration/AddFieldAction.js +27 -9
- package/lib/collection-manager/Configuration/EditFieldAction.js +25 -8
- package/lib/collection-manager/hooks/useCollection.d.ts +1 -1
- package/lib/i18n/i18n.js +3 -3
- package/lib/locale/en_US.d.ts +10 -0
- package/lib/locale/en_US.js +11 -1
- package/lib/locale/index.d.ts +44 -0
- package/lib/locale/zh_CN.d.ts +34 -0
- package/lib/locale/zh_CN.js +35 -1
- package/lib/schema-component/antd/action/Action.Designer.js +34 -13
- package/lib/schema-component/antd/action/utils.d.ts +2 -0
- package/lib/schema-component/antd/action/utils.js +67 -0
- package/lib/schema-component/antd/date-picker/util.d.ts +2 -1
- package/lib/schema-component/antd/date-picker/util.js +6 -1
- package/lib/schema-initializer/buttons/FormActionInitializers.d.ts +84 -0
- package/lib/schema-initializer/buttons/FormActionInitializers.js +63 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.d.ts +26 -0
- package/lib/schema-initializer/buttons/ReadPrettyFormActionInitializers.js +21 -0
- package/lib/schema-initializer/buttons/TableActionColumnInitializers.js +21 -0
- package/lib/schema-settings/SchemaSettings.js +49 -16
- package/lib/user/CurrentUser.js +1 -1
- package/lib/user/LanguageSettings.js +4 -3
- package/lib/user/SigninPage.js +3 -14
- package/lib/user/SwitchRole.js +2 -27
- package/lib/workflow/triggers/collection.js +1 -0
- package/lib/workflow/triggers/index.js +3 -0
- package/lib/workflow/triggers/schedule.d.ts +25 -0
- package/lib/workflow/triggers/schedule.js +554 -0
- package/package.json +4 -3
- package/src/acl/ACLProvider.tsx +4 -5
- package/src/antd-config-provider/index.tsx +4 -2
- package/src/api-client/APIClient.ts +2 -120
- package/src/block-provider/hooks/index.ts +106 -69
- package/src/collection-manager/Configuration/AddFieldAction.tsx +18 -0
- package/src/collection-manager/Configuration/EditFieldAction.tsx +19 -0
- package/src/i18n/i18n.ts +3 -3
- package/src/locale/en_US.ts +11 -1
- package/src/locale/zh_CN.ts +39 -1
- package/src/schema-component/antd/action/Action.Designer.tsx +33 -1
- package/src/schema-component/antd/action/utils.ts +68 -0
- package/src/schema-component/antd/date-picker/util.ts +4 -3
- package/src/schema-initializer/SchemaInitializer.tsx +2 -2
- package/src/schema-initializer/buttons/FormActionInitializers.tsx +66 -0
- package/src/schema-initializer/buttons/ReadPrettyFormActionInitializers.tsx +22 -0
- package/src/schema-initializer/buttons/TableActionColumnInitializers.tsx +22 -0
- package/src/schema-settings/SchemaSettings.tsx +40 -29
- package/src/user/CurrentUser.tsx +1 -1
- package/src/user/LanguageSettings.tsx +1 -0
- package/src/user/SigninPage.tsx +2 -7
- package/src/user/SwitchRole.tsx +2 -6
- package/src/workflow/triggers/collection.tsx +1 -1
- package/src/workflow/triggers/index.tsx +2 -0
- package/src/workflow/triggers/schedule.tsx +422 -0
package/es/acl/ACLProvider.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
|
-
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
|
|
5
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
-
|
|
7
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
2
|
|
|
9
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -16,12 +10,17 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
|
16
10
|
|
|
17
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
12
|
|
|
13
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
14
|
+
|
|
15
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
|
+
|
|
17
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
18
|
+
|
|
19
19
|
import { useFieldSchema } from '@formily/react';
|
|
20
|
-
import { useCookieState } from 'ahooks';
|
|
21
20
|
import { Spin } from 'antd';
|
|
22
21
|
import React, { createContext, useContext } from 'react';
|
|
23
22
|
import { Redirect } from 'react-router-dom';
|
|
24
|
-
import { useRequest } from '../api-client';
|
|
23
|
+
import { useAPIClient, useRequest } from '../api-client';
|
|
25
24
|
import { useCollection } from '../collection-manager';
|
|
26
25
|
import { useRecordIsOwn } from '../record-provider';
|
|
27
26
|
import { SchemaComponentOptions, useDesignable } from '../schema-component';
|
|
@@ -40,11 +39,7 @@ export var ACLRolesCheckProvider = function ACLRolesCheckProvider(props) {
|
|
|
40
39
|
var _useDesignable = useDesignable(),
|
|
41
40
|
setDesignable = _useDesignable.setDesignable;
|
|
42
41
|
|
|
43
|
-
var
|
|
44
|
-
_useCookieState2 = _slicedToArray(_useCookieState, 2),
|
|
45
|
-
roleName = _useCookieState2[0],
|
|
46
|
-
setRoleName = _useCookieState2[1];
|
|
47
|
-
|
|
42
|
+
var api = useAPIClient();
|
|
48
43
|
var result = useRequest({
|
|
49
44
|
url: 'roles:check'
|
|
50
45
|
}, {
|
|
@@ -55,10 +50,10 @@ export var ACLRolesCheckProvider = function ACLRolesCheckProvider(props) {
|
|
|
55
50
|
setDesignable(false);
|
|
56
51
|
}
|
|
57
52
|
|
|
58
|
-
if ((data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3.role) !==
|
|
53
|
+
if ((data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3.role) !== api.auth.role) {
|
|
59
54
|
var _data$data4;
|
|
60
55
|
|
|
61
|
-
|
|
56
|
+
api.auth.setRole(data === null || data === void 0 ? void 0 : (_data$data4 = data.data) === null || _data$data4 === void 0 ? void 0 : _data$data4.role);
|
|
62
57
|
}
|
|
63
58
|
}
|
|
64
59
|
});
|
|
@@ -15,11 +15,13 @@ import enUS from 'antd/lib/locale/en_US';
|
|
|
15
15
|
import zhCN from 'antd/lib/locale/zh_CN';
|
|
16
16
|
import React from 'react';
|
|
17
17
|
import { useTranslation } from 'react-i18next';
|
|
18
|
-
import { useRequest } from '../api-client';
|
|
18
|
+
import { useAPIClient, useRequest } from '../api-client';
|
|
19
19
|
export function AntdConfigProvider(props) {
|
|
20
20
|
var remoteLocale = props.remoteLocale,
|
|
21
21
|
others = _objectWithoutProperties(props, _excluded);
|
|
22
22
|
|
|
23
|
+
var api = useAPIClient();
|
|
24
|
+
|
|
23
25
|
var _useTranslation = useTranslation(),
|
|
24
26
|
i18n = _useTranslation.i18n;
|
|
25
27
|
|
|
@@ -29,12 +31,13 @@ export function AntdConfigProvider(props) {
|
|
|
29
31
|
onSuccess: function onSuccess(data) {
|
|
30
32
|
var _data$data;
|
|
31
33
|
|
|
32
|
-
var locale =
|
|
34
|
+
var locale = api.auth.locale;
|
|
33
35
|
|
|
34
36
|
if ((data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.lang) && !locale) {
|
|
35
|
-
var _data$data2;
|
|
37
|
+
var _data$data2, _data$data3;
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
api.auth.setLocale(data === null || data === void 0 ? void 0 : (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.lang);
|
|
40
|
+
i18n.changeLanguage(data === null || data === void 0 ? void 0 : (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3.lang);
|
|
38
41
|
}
|
|
39
42
|
},
|
|
40
43
|
manual: !remoteLocale
|
|
@@ -1,33 +1,5 @@
|
|
|
1
|
+
import { APIClient as APIClientSDK } from '@nocobase/sdk';
|
|
1
2
|
import { Result } from 'ahooks/lib/useRequest/src/types';
|
|
2
|
-
|
|
3
|
-
export interface ActionParams {
|
|
4
|
-
filterByTk?: any;
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
}
|
|
7
|
-
declare type ResourceActionOptions<P = any> = {
|
|
8
|
-
resource?: string;
|
|
9
|
-
resourceOf?: any;
|
|
10
|
-
action?: string;
|
|
11
|
-
params?: P;
|
|
12
|
-
};
|
|
13
|
-
export interface IResource {
|
|
14
|
-
list?: (params?: ActionParams) => Promise<any>;
|
|
15
|
-
get?: (params?: ActionParams) => Promise<any>;
|
|
16
|
-
create?: (params?: ActionParams) => Promise<any>;
|
|
17
|
-
update?: (params?: ActionParams) => Promise<any>;
|
|
18
|
-
destroy?: (params?: ActionParams) => Promise<any>;
|
|
19
|
-
[key: string]: (params?: ActionParams) => Promise<any>;
|
|
20
|
-
}
|
|
21
|
-
export declare class APIClient {
|
|
22
|
-
axios: AxiosInstance;
|
|
3
|
+
export declare class APIClient extends APIClientSDK {
|
|
23
4
|
services: Record<string, Result<any, any>>;
|
|
24
|
-
tokenKey: string;
|
|
25
|
-
constructor(instance?: AxiosInstance | AxiosRequestConfig);
|
|
26
|
-
qsMiddleware(): void;
|
|
27
|
-
authMiddleware(): void;
|
|
28
|
-
setBearerToken(token: any): void;
|
|
29
|
-
service(uid: string): Result<any, any>;
|
|
30
|
-
request<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D> | ResourceActionOptions): Promise<R>;
|
|
31
|
-
resource(name: string, of?: any): IResource;
|
|
32
5
|
}
|
|
33
|
-
export {};
|
|
@@ -1,172 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
8
|
|
|
9
|
-
function
|
|
9
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
10
10
|
|
|
11
|
-
function
|
|
11
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
12
12
|
|
|
13
|
-
function
|
|
13
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
14
|
|
|
15
|
-
function
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
import axios from 'axios';
|
|
19
|
-
import Cookies from 'js-cookie';
|
|
20
|
-
import qs from 'qs';
|
|
21
|
-
export var APIClient = /*#__PURE__*/function () {
|
|
22
|
-
function APIClient(instance) {
|
|
23
|
-
_classCallCheck(this, APIClient);
|
|
17
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
this.services = void 0;
|
|
27
|
-
this.tokenKey = 'NOCOBASE_TOKEN';
|
|
28
|
-
this.services = observable({});
|
|
19
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
29
20
|
|
|
30
|
-
|
|
31
|
-
this.axios = instance;
|
|
32
|
-
} else {
|
|
33
|
-
this.axios = axios.create(instance);
|
|
34
|
-
}
|
|
21
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
35
22
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
import { APIClient as APIClientSDK } from '@nocobase/sdk';
|
|
24
|
+
export var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
25
|
+
_inherits(APIClient, _APIClientSDK);
|
|
39
26
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return config;
|
|
52
|
-
});
|
|
53
|
-
} // TODO
|
|
54
|
-
|
|
55
|
-
}, {
|
|
56
|
-
key: "authMiddleware",
|
|
57
|
-
value: function authMiddleware() {
|
|
58
|
-
var _this = this;
|
|
59
|
-
|
|
60
|
-
this.axios.interceptors.request.use(function (config) {
|
|
61
|
-
var token = localStorage.getItem(_this.tokenKey);
|
|
62
|
-
config.headers['X-Locale'] = localStorage.getItem('NOCOBASE_LANG');
|
|
63
|
-
config.headers['X-Hostname'] = window.location.hostname;
|
|
64
|
-
|
|
65
|
-
if (token) {
|
|
66
|
-
config.headers['Authorization'] = "Bearer ".concat(token);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
var currentRoleName = Cookies.get('currentRoleName');
|
|
70
|
-
|
|
71
|
-
if (currentRoleName) {
|
|
72
|
-
config.headers['X-Role'] = currentRoleName;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return config;
|
|
76
|
-
});
|
|
77
|
-
} // TODO
|
|
78
|
-
|
|
79
|
-
}, {
|
|
80
|
-
key: "setBearerToken",
|
|
81
|
-
value: function setBearerToken(token) {
|
|
82
|
-
localStorage.setItem(this.tokenKey, token || '');
|
|
83
|
-
Cookies.remove('currentRoleName');
|
|
84
|
-
}
|
|
85
|
-
}, {
|
|
86
|
-
key: "service",
|
|
87
|
-
value: function service(uid) {
|
|
88
|
-
return this.services[uid];
|
|
89
|
-
}
|
|
90
|
-
}, {
|
|
91
|
-
key: "request",
|
|
92
|
-
value: function request(config) {
|
|
93
|
-
var resource = config.resource,
|
|
94
|
-
resourceOf = config.resourceOf,
|
|
95
|
-
action = config.action,
|
|
96
|
-
params = config.params;
|
|
97
|
-
|
|
98
|
-
if (resource) {
|
|
99
|
-
return this.resource(resource, resourceOf)[action](params);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return this.axios.request(config);
|
|
103
|
-
}
|
|
104
|
-
}, {
|
|
105
|
-
key: "resource",
|
|
106
|
-
value: function resource(name, of) {
|
|
107
|
-
var _this2 = this;
|
|
108
|
-
|
|
109
|
-
var target = {};
|
|
110
|
-
var handler = {
|
|
111
|
-
get: function get(_, actionName) {
|
|
112
|
-
var url = name.split('.').join("/".concat(of || '_', "/"));
|
|
113
|
-
url += ":".concat(actionName);
|
|
114
|
-
var config = {
|
|
115
|
-
url: url
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
if (['get', 'list'].includes(actionName)) {
|
|
119
|
-
config['method'] = 'get';
|
|
120
|
-
} else {
|
|
121
|
-
config['method'] = 'post';
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return /*#__PURE__*/function () {
|
|
125
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(params) {
|
|
126
|
-
var _ref2, values, filter, others;
|
|
127
|
-
|
|
128
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
129
|
-
while (1) {
|
|
130
|
-
switch (_context.prev = _context.next) {
|
|
131
|
-
case 0:
|
|
132
|
-
_ref2 = params || {}, values = _ref2.values, filter = _ref2.filter, others = _objectWithoutProperties(_ref2, _excluded);
|
|
133
|
-
config['params'] = others;
|
|
134
|
-
|
|
135
|
-
if (filter) {
|
|
136
|
-
if (typeof filter === 'string') {
|
|
137
|
-
config['params']['filter'] = filter;
|
|
138
|
-
} else {
|
|
139
|
-
config['params']['filter'] = JSON.stringify(filter);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if (config.method !== 'get') {
|
|
144
|
-
config['data'] = values || {};
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
_context.next = 6;
|
|
148
|
-
return _this2.request(config);
|
|
149
|
-
|
|
150
|
-
case 6:
|
|
151
|
-
return _context.abrupt("return", _context.sent);
|
|
152
|
-
|
|
153
|
-
case 7:
|
|
154
|
-
case "end":
|
|
155
|
-
return _context.stop();
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}, _callee);
|
|
159
|
-
}));
|
|
160
|
-
|
|
161
|
-
return function (_x) {
|
|
162
|
-
return _ref.apply(this, arguments);
|
|
163
|
-
};
|
|
164
|
-
}();
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
return new Proxy(target, handler);
|
|
27
|
+
var _super = _createSuper(APIClient);
|
|
28
|
+
|
|
29
|
+
function APIClient() {
|
|
30
|
+
var _this;
|
|
31
|
+
|
|
32
|
+
_classCallCheck(this, APIClient);
|
|
33
|
+
|
|
34
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
35
|
+
args[_key] = arguments[_key];
|
|
168
36
|
}
|
|
169
|
-
}]);
|
|
170
37
|
|
|
171
|
-
|
|
172
|
-
|
|
38
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
39
|
+
_this.services = void 0;
|
|
40
|
+
return _this;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return _createClass(APIClient);
|
|
44
|
+
}(APIClientSDK);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useResource(name: string, of?: string | number): import("
|
|
1
|
+
export declare function useResource(name: string, of?: string | number): import("@nocobase/sdk").IResource;
|
|
@@ -7,6 +7,9 @@ export declare const useCreateActionProps: () => {
|
|
|
7
7
|
export declare const useCustomizeUpdateActionProps: () => {
|
|
8
8
|
onClick(): Promise<void>;
|
|
9
9
|
};
|
|
10
|
+
export declare const useCustomizeRequestActionProps: () => {
|
|
11
|
+
onClick(): Promise<void>;
|
|
12
|
+
};
|
|
10
13
|
export declare const useUpdateActionProps: () => {
|
|
11
14
|
onClick(): Promise<void>;
|
|
12
15
|
};
|