@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
|
@@ -1,188 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
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); }
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.APIClient = void 0;
|
|
7
9
|
|
|
8
|
-
var
|
|
10
|
+
var _sdk = require("@nocobase/sdk");
|
|
9
11
|
|
|
10
|
-
var
|
|
12
|
+
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); } }
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
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); }
|
|
17
19
|
|
|
18
|
-
function
|
|
20
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
19
21
|
|
|
20
|
-
function
|
|
22
|
+
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); }; }
|
|
21
23
|
|
|
22
|
-
function
|
|
24
|
+
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); }
|
|
23
25
|
|
|
24
|
-
function
|
|
26
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
25
27
|
|
|
26
|
-
function
|
|
28
|
+
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; } }
|
|
27
29
|
|
|
28
|
-
function
|
|
30
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
var APIClient = /*#__PURE__*/function (_APIClientSDK) {
|
|
33
|
+
_inherits(APIClient, _APIClientSDK);
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
var _super = _createSuper(APIClient);
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
_classCallCheck(this, APIClient);
|
|
37
|
+
function APIClient() {
|
|
38
|
+
var _this;
|
|
37
39
|
|
|
38
|
-
this
|
|
39
|
-
this.services = void 0;
|
|
40
|
-
this.tokenKey = 'NOCOBASE_TOKEN';
|
|
41
|
-
this.services = (0, _reactive.observable)({});
|
|
40
|
+
_classCallCheck(this, APIClient);
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
} else {
|
|
46
|
-
this.axios = _axios.default.create(instance);
|
|
42
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
43
|
+
args[_key] = arguments[_key];
|
|
47
44
|
}
|
|
48
45
|
|
|
49
|
-
this.
|
|
50
|
-
|
|
46
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
47
|
+
_this.services = void 0;
|
|
48
|
+
return _this;
|
|
51
49
|
}
|
|
52
50
|
|
|
53
|
-
_createClass(APIClient
|
|
54
|
-
|
|
55
|
-
value: function qsMiddleware() {
|
|
56
|
-
this.axios.interceptors.request.use(function (config) {
|
|
57
|
-
config.paramsSerializer = function (params) {
|
|
58
|
-
return _qs.default.stringify(params, {
|
|
59
|
-
strictNullHandling: true,
|
|
60
|
-
arrayFormat: 'brackets'
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
return config;
|
|
65
|
-
});
|
|
66
|
-
} // TODO
|
|
67
|
-
|
|
68
|
-
}, {
|
|
69
|
-
key: "authMiddleware",
|
|
70
|
-
value: function authMiddleware() {
|
|
71
|
-
var _this = this;
|
|
72
|
-
|
|
73
|
-
this.axios.interceptors.request.use(function (config) {
|
|
74
|
-
var token = localStorage.getItem(_this.tokenKey);
|
|
75
|
-
config.headers['X-Locale'] = localStorage.getItem('NOCOBASE_LANG');
|
|
76
|
-
config.headers['X-Hostname'] = window.location.hostname;
|
|
77
|
-
|
|
78
|
-
if (token) {
|
|
79
|
-
config.headers['Authorization'] = "Bearer ".concat(token);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
var currentRoleName = _jsCookie.default.get('currentRoleName');
|
|
83
|
-
|
|
84
|
-
if (currentRoleName) {
|
|
85
|
-
config.headers['X-Role'] = currentRoleName;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return config;
|
|
89
|
-
});
|
|
90
|
-
} // TODO
|
|
91
|
-
|
|
92
|
-
}, {
|
|
93
|
-
key: "setBearerToken",
|
|
94
|
-
value: function setBearerToken(token) {
|
|
95
|
-
localStorage.setItem(this.tokenKey, token || '');
|
|
96
|
-
|
|
97
|
-
_jsCookie.default.remove('currentRoleName');
|
|
98
|
-
}
|
|
99
|
-
}, {
|
|
100
|
-
key: "service",
|
|
101
|
-
value: function service(uid) {
|
|
102
|
-
return this.services[uid];
|
|
103
|
-
}
|
|
104
|
-
}, {
|
|
105
|
-
key: "request",
|
|
106
|
-
value: function request(config) {
|
|
107
|
-
var resource = config.resource,
|
|
108
|
-
resourceOf = config.resourceOf,
|
|
109
|
-
action = config.action,
|
|
110
|
-
params = config.params;
|
|
111
|
-
|
|
112
|
-
if (resource) {
|
|
113
|
-
return this.resource(resource, resourceOf)[action](params);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return this.axios.request(config);
|
|
117
|
-
}
|
|
118
|
-
}, {
|
|
119
|
-
key: "resource",
|
|
120
|
-
value: function resource(name, of) {
|
|
121
|
-
var _this2 = this;
|
|
122
|
-
|
|
123
|
-
var target = {};
|
|
124
|
-
var handler = {
|
|
125
|
-
get: function get(_, actionName) {
|
|
126
|
-
var url = name.split('.').join("/".concat(of || '_', "/"));
|
|
127
|
-
url += ":".concat(actionName);
|
|
128
|
-
var config = {
|
|
129
|
-
url: url
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
if (['get', 'list'].includes(actionName)) {
|
|
133
|
-
config['method'] = 'get';
|
|
134
|
-
} else {
|
|
135
|
-
config['method'] = 'post';
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return /*#__PURE__*/function () {
|
|
139
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(params) {
|
|
140
|
-
var _ref2, values, filter, others;
|
|
141
|
-
|
|
142
|
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
143
|
-
while (1) {
|
|
144
|
-
switch (_context.prev = _context.next) {
|
|
145
|
-
case 0:
|
|
146
|
-
_ref2 = params || {}, values = _ref2.values, filter = _ref2.filter, others = _objectWithoutProperties(_ref2, _excluded);
|
|
147
|
-
config['params'] = others;
|
|
148
|
-
|
|
149
|
-
if (filter) {
|
|
150
|
-
if (typeof filter === 'string') {
|
|
151
|
-
config['params']['filter'] = filter;
|
|
152
|
-
} else {
|
|
153
|
-
config['params']['filter'] = JSON.stringify(filter);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
if (config.method !== 'get') {
|
|
158
|
-
config['data'] = values || {};
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
_context.next = 6;
|
|
162
|
-
return _this2.request(config);
|
|
163
|
-
|
|
164
|
-
case 6:
|
|
165
|
-
return _context.abrupt("return", _context.sent);
|
|
166
|
-
|
|
167
|
-
case 7:
|
|
168
|
-
case "end":
|
|
169
|
-
return _context.stop();
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}, _callee);
|
|
173
|
-
}));
|
|
174
|
-
|
|
175
|
-
return function (_x) {
|
|
176
|
-
return _ref.apply(this, arguments);
|
|
177
|
-
};
|
|
178
|
-
}();
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
return new Proxy(target, handler);
|
|
182
|
-
}
|
|
183
|
-
}]);
|
|
184
|
-
|
|
185
|
-
return APIClient;
|
|
186
|
-
}();
|
|
51
|
+
return _createClass(APIClient);
|
|
52
|
+
}(_sdk.APIClient);
|
|
187
53
|
|
|
188
54
|
exports.APIClient = APIClient;
|
|
@@ -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
|
};
|