@steedos/webapp 3.0.0-beta.37 → 3.0.0-beta.40

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.
@@ -53841,1593 +53841,530 @@ Try polyfilling it using "@formatjs/intl-displaynames"
53841
53841
  app_id: ""
53842
53842
  } }) });
53843
53843
  };
53844
- const AppView = () => {
53845
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {});
53846
- };
53847
- const AppHeader = () => {
53848
- var _a2, _b2, _c, _d, _e, _f, _g, _h;
53849
- const params = useParams();
53850
- let { appId = null, objectName } = params;
53851
- if (!appId) {
53852
- document.body.classList.remove("sidebar-open");
53844
+ var axios$2 = { exports: {} };
53845
+ var bind;
53846
+ var hasRequiredBind;
53847
+ function requireBind() {
53848
+ if (hasRequiredBind) return bind;
53849
+ hasRequiredBind = 1;
53850
+ bind = function bind2(fn, thisArg) {
53851
+ return function wrap() {
53852
+ var args = new Array(arguments.length);
53853
+ for (var i = 0; i < args.length; i++) {
53854
+ args[i] = arguments[i];
53855
+ }
53856
+ return fn.apply(thisArg, args);
53857
+ };
53858
+ };
53859
+ return bind;
53860
+ }
53861
+ var utils;
53862
+ var hasRequiredUtils;
53863
+ function requireUtils() {
53864
+ if (hasRequiredUtils) return utils;
53865
+ hasRequiredUtils = 1;
53866
+ var bind2 = requireBind();
53867
+ var toString2 = Object.prototype.toString;
53868
+ function isArray2(val) {
53869
+ return toString2.call(val) === "[object Array]";
53853
53870
  }
53854
- const isMobile = window.innerWidth < 1024;
53855
- let logoSrc = `/images/logo_platform.png`;
53856
- if ((_d = (_c = (_b2 = (_a2 = Builder$1.settings) == null ? void 0 : _a2.context) == null ? void 0 : _b2.user) == null ? void 0 : _c.space) == null ? void 0 : _d.avatar) {
53857
- logoSrc = "/api/v6/files/cfs.avatars.filerecord/" + Builder$1.settings.context.user.space.avatar;
53871
+ function isUndefined(val) {
53872
+ return typeof val === "undefined";
53858
53873
  }
53859
- const faviconLink = document.querySelector('link[rel*="icon"], link[rel*="shortcut"]');
53860
- let favicon = "/favicons/favicon.ico";
53861
- if ((_h = (_g = (_f = (_e = Builder$1.settings) == null ? void 0 : _e.context) == null ? void 0 : _f.user) == null ? void 0 : _g.space) == null ? void 0 : _h.favicon) {
53862
- favicon = "/api/v6/files/cfs.avatars.filerecord/" + Builder$1.settings.context.user.space.favicon;
53874
+ function isBuffer(val) {
53875
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
53863
53876
  }
53864
- if (faviconLink) {
53865
- faviconLink.href = favicon;
53866
- } else {
53867
- const newFaviconLink = document.createElement("link");
53868
- newFaviconLink.rel = "icon";
53869
- newFaviconLink.href = favicon;
53870
- document.head.appendChild(newFaviconLink);
53877
+ function isArrayBuffer(val) {
53878
+ return toString2.call(val) === "[object ArrayBuffer]";
53871
53879
  }
53872
- const schema = {
53873
- "type": "service",
53874
- name: "globalHeader",
53875
- body: [
53876
- {
53877
- "type": "steedos-global-header",
53878
- "logoSrc": logoSrc,
53879
- "customButtons": [
53880
- {
53881
- "type": "steedos-app-launcher",
53882
- "showAppName": false,
53883
- "appId": "${app.id}",
53884
- "visibleOn": "${isMobile}"
53885
- }
53886
- ]
53887
- }
53888
- ],
53889
- "api": {
53890
- "method": "get",
53891
- "cache": "10000",
53892
- "url": "/service/api/apps/${appId}/menus?mobile=" + isMobile,
53893
- "sendOn": "!!appId",
53894
- "headers": {
53895
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
53896
- },
53897
- "adaptor": `
53898
- const app = payload;
53899
- if (app.showSidebar){
53900
- document.body.classList.add('sidebar')
53901
- } else {
53902
- document.body.classList.remove("sidebar")
53903
- }
53904
-
53905
- if (window.innerWidth >= 768) {
53906
- document.body.classList.add('sidebar-open')
53907
- }
53908
-
53909
- return {
53910
- app: app
53911
- }
53912
- `,
53913
- "messages": {}
53880
+ function isFormData(val) {
53881
+ return typeof FormData !== "undefined" && val instanceof FormData;
53882
+ }
53883
+ function isArrayBufferView2(val) {
53884
+ var result;
53885
+ if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
53886
+ result = ArrayBuffer.isView(val);
53887
+ } else {
53888
+ result = val && val.buffer && val.buffer instanceof ArrayBuffer;
53914
53889
  }
53915
- };
53916
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "header", className: "steedos-global-header-root flex-none", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema, data: {
53917
- context: {
53918
- ...Builder$1.settings.context,
53919
- appId,
53920
- showSidebar: true,
53921
- stacked: true
53922
- },
53923
- appId,
53924
- showSidebar: true,
53925
- stacked: true
53926
- }, env: {} }) });
53927
- };
53928
- const GlobalLinkInterceptor = () => {
53929
- const navigate = useNavigate();
53930
- reactExports.useEffect(() => {
53931
- const handleClick = (event2) => {
53932
- const target = event2.target.closest("a");
53933
- if (target) {
53934
- const href = target.getAttribute("href");
53935
- const targetAttr = target.getAttribute("target");
53936
- const onclick = target.getAttribute("onclick");
53937
- if (onclick == "return false;") {
53938
- return;
53939
- }
53940
- const isInternal = href && href.startsWith("/");
53941
- if (isInternal && targetAttr !== "_blank") {
53942
- event2.preventDefault();
53943
- navigate(href);
53890
+ return result;
53891
+ }
53892
+ function isString2(val) {
53893
+ return typeof val === "string";
53894
+ }
53895
+ function isNumber2(val) {
53896
+ return typeof val === "number";
53897
+ }
53898
+ function isObject2(val) {
53899
+ return val !== null && typeof val === "object";
53900
+ }
53901
+ function isPlainObject2(val) {
53902
+ if (toString2.call(val) !== "[object Object]") {
53903
+ return false;
53904
+ }
53905
+ var prototype = Object.getPrototypeOf(val);
53906
+ return prototype === null || prototype === Object.prototype;
53907
+ }
53908
+ function isDate(val) {
53909
+ return toString2.call(val) === "[object Date]";
53910
+ }
53911
+ function isFile(val) {
53912
+ return toString2.call(val) === "[object File]";
53913
+ }
53914
+ function isBlob(val) {
53915
+ return toString2.call(val) === "[object Blob]";
53916
+ }
53917
+ function isFunction2(val) {
53918
+ return toString2.call(val) === "[object Function]";
53919
+ }
53920
+ function isStream(val) {
53921
+ return isObject2(val) && isFunction2(val.pipe);
53922
+ }
53923
+ function isURLSearchParams(val) {
53924
+ return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
53925
+ }
53926
+ function trim(str) {
53927
+ return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
53928
+ }
53929
+ function isStandardBrowserEnv() {
53930
+ if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
53931
+ return false;
53932
+ }
53933
+ return typeof window !== "undefined" && typeof document !== "undefined";
53934
+ }
53935
+ function forEach2(obj, fn) {
53936
+ if (obj === null || typeof obj === "undefined") {
53937
+ return;
53938
+ }
53939
+ if (typeof obj !== "object") {
53940
+ obj = [obj];
53941
+ }
53942
+ if (isArray2(obj)) {
53943
+ for (var i = 0, l = obj.length; i < l; i++) {
53944
+ fn.call(null, obj[i], i, obj);
53945
+ }
53946
+ } else {
53947
+ for (var key2 in obj) {
53948
+ if (Object.prototype.hasOwnProperty.call(obj, key2)) {
53949
+ fn.call(null, obj[key2], key2, obj);
53944
53950
  }
53945
53951
  }
53946
- };
53947
- document.addEventListener("click", handleClick);
53948
- return () => {
53949
- document.removeEventListener("click", handleClick);
53950
- };
53951
- }, [navigate]);
53952
- return null;
53953
- };
53954
- const AppLayout = (props) => {
53955
- const { children } = props;
53956
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
53957
- /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalLinkInterceptor, {}),
53958
- /* @__PURE__ */ jsxRuntimeExports.jsx(AppHeader, {}),
53959
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "creator-content-wrapper", id: "main", children })
53960
- ] });
53961
- };
53962
- const ObjectListView = () => {
53963
- var _a2;
53964
- let { appId, objectName, listviewId: listName } = useParams();
53965
- const uiSchema = window.getUISchemaSync(objectName);
53966
- if (!listName) {
53967
- listName = (_a2 = lodashExports.first(lodashExports.values(uiSchema.list_views))) == null ? void 0 : _a2.name;
53952
+ }
53968
53953
  }
53969
- return /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema: {
53970
- type: "page",
53971
- bodyClassName: "p-0",
53972
- body: {
53973
- "type": "steedos-page-object-control",
53974
- "name": "steedosPageObjectControl",
53975
- "data": {
53976
- objectName,
53977
- object_name: objectName,
53978
- pageType: "list",
53979
- listName: listName || "",
53980
- display: Steedos.Page.getDisplay(objectName)
53954
+ function merge2() {
53955
+ var result = {};
53956
+ function assignValue(val, key2) {
53957
+ if (isPlainObject2(result[key2]) && isPlainObject2(val)) {
53958
+ result[key2] = merge2(result[key2], val);
53959
+ } else if (isPlainObject2(val)) {
53960
+ result[key2] = merge2({}, val);
53961
+ } else if (isArray2(val)) {
53962
+ result[key2] = val.slice();
53963
+ } else {
53964
+ result[key2] = val;
53981
53965
  }
53982
- },
53983
- data: {
53984
- objectName,
53985
- object_name: objectName,
53986
- pageType: "list",
53987
- listName: listName || ""
53988
53966
  }
53989
- }, data: {
53990
- context: {
53991
- app: appId,
53992
- appId,
53993
- app_id: appId,
53994
- listName: listName || "",
53995
- ...Builder$1.settings.context
53996
- },
53997
- app: appId,
53998
- appId,
53999
- app_id: appId,
54000
- listName: listName || "",
54001
- objectName,
54002
- object_name: objectName
54003
- }, env: {} });
54004
- };
54005
- const ObjectDetail = () => {
54006
- const { appId, objectName, recordId } = useParams();
54007
- return /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema: {
54008
- type: "page",
54009
- bodyClassName: "p-0",
54010
- body: {
54011
- "type": "steedos-page-object-control",
54012
- "name": "steedosPageObjectControl",
54013
- "data": {
54014
- objectName,
54015
- object_name: objectName,
54016
- pageType: "record",
54017
- recordId,
54018
- display: Steedos.Page.getDisplay(objectName)
53967
+ for (var i = 0, l = arguments.length; i < l; i++) {
53968
+ forEach2(arguments[i], assignValue);
53969
+ }
53970
+ return result;
53971
+ }
53972
+ function extend(a, b, thisArg) {
53973
+ forEach2(b, function assignValue(val, key2) {
53974
+ if (thisArg && typeof val === "function") {
53975
+ a[key2] = bind2(val, thisArg);
53976
+ } else {
53977
+ a[key2] = val;
54019
53978
  }
54020
- },
54021
- data: {
54022
- objectName,
54023
- object_name: objectName,
54024
- pageType: "record",
54025
- recordId
53979
+ });
53980
+ return a;
53981
+ }
53982
+ function stripBOM(content) {
53983
+ if (content.charCodeAt(0) === 65279) {
53984
+ content = content.slice(1);
54026
53985
  }
54027
- }, data: {
54028
- context: {
54029
- app: appId,
54030
- appId,
54031
- app_id: appId,
54032
- ...Builder$1.settings.context
54033
- },
54034
- app: appId,
54035
- appId,
54036
- app_id: appId
54037
- }, env: {} });
54038
- };
54039
- const PageView = () => {
54040
- const { appId, pageId } = useParams();
54041
- return /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema: {
54042
- type: "service",
54043
- schemaApi: {
54044
- "method": "get",
54045
- "url": "/api/pageSchema/app?app=${appId}&pageId=${pageId}&formFactor=${formFactor}",
54046
- "adaptor": `
54047
- return {
54048
- "data": _.isString(payload.schema) ? JSON.parse(payload.schema):payload.schema
54049
- }
54050
- `
53986
+ return content;
53987
+ }
53988
+ utils = {
53989
+ isArray: isArray2,
53990
+ isArrayBuffer,
53991
+ isBuffer,
53992
+ isFormData,
53993
+ isArrayBufferView: isArrayBufferView2,
53994
+ isString: isString2,
53995
+ isNumber: isNumber2,
53996
+ isObject: isObject2,
53997
+ isPlainObject: isPlainObject2,
53998
+ isUndefined,
53999
+ isDate,
54000
+ isFile,
54001
+ isBlob,
54002
+ isFunction: isFunction2,
54003
+ isStream,
54004
+ isURLSearchParams,
54005
+ isStandardBrowserEnv,
54006
+ forEach: forEach2,
54007
+ merge: merge2,
54008
+ extend,
54009
+ trim,
54010
+ stripBOM
54011
+ };
54012
+ return utils;
54013
+ }
54014
+ var buildURL;
54015
+ var hasRequiredBuildURL;
54016
+ function requireBuildURL() {
54017
+ if (hasRequiredBuildURL) return buildURL;
54018
+ hasRequiredBuildURL = 1;
54019
+ var utils2 = requireUtils();
54020
+ function encode(val) {
54021
+ return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
54022
+ }
54023
+ buildURL = function buildURL2(url2, params, paramsSerializer) {
54024
+ if (!params) {
54025
+ return url2;
54051
54026
  }
54052
- }, data: {
54053
- context: {
54054
- app: appId,
54055
- appId,
54056
- app_id: appId,
54057
- ...Builder$1.settings.context
54058
- },
54059
- app: appId,
54060
- appId,
54061
- app_id: appId,
54062
- pageId
54063
- }, env: {} });
54064
- };
54065
- const IframeView = () => {
54066
- const { appId, tabId } = useParams();
54067
- const [searchParams] = useSearchParams();
54068
- const iframeSrc = searchParams.get("url");
54069
- return /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema: {
54070
- "type": "page",
54071
- "body": {
54072
- "type": "iframe",
54073
- "src": iframeSrc,
54074
- "height": "100%",
54075
- "width": "100%"
54027
+ var serializedParams;
54028
+ if (paramsSerializer) {
54029
+ serializedParams = paramsSerializer(params);
54030
+ } else if (utils2.isURLSearchParams(params)) {
54031
+ serializedParams = params.toString();
54032
+ } else {
54033
+ var parts = [];
54034
+ utils2.forEach(params, function serialize(val, key2) {
54035
+ if (val === null || typeof val === "undefined") {
54036
+ return;
54037
+ }
54038
+ if (utils2.isArray(val)) {
54039
+ key2 = key2 + "[]";
54040
+ } else {
54041
+ val = [val];
54042
+ }
54043
+ utils2.forEach(val, function parseValue(v) {
54044
+ if (utils2.isDate(v)) {
54045
+ v = v.toISOString();
54046
+ } else if (utils2.isObject(v)) {
54047
+ v = JSON.stringify(v);
54048
+ }
54049
+ parts.push(encode(key2) + "=" + encode(v));
54050
+ });
54051
+ });
54052
+ serializedParams = parts.join("&");
54076
54053
  }
54077
- }, data: {
54078
- context: {
54079
- app: appId,
54080
- appId,
54081
- app_id: appId,
54082
- ...Builder$1.settings.context
54083
- },
54084
- app: appId,
54085
- appId,
54086
- app_id: appId,
54087
- tabId
54088
- }, env: {} });
54089
- };
54090
- const ObjectRelatedListView = () => {
54091
- const location2 = useLocation();
54092
- const queryParams = new URLSearchParams(location2.search);
54093
- const relatedKey = queryParams.get("related_field_name");
54094
- const { appId, objectName, listviewId: listName, recordId, relatedObjectName } = useParams();
54095
- const mainUiSchema = window.getUISchemaSync(objectName);
54096
- const idFieldName = mainUiSchema.idFieldName;
54097
- const uiSchema = window.getUISchemaSync(relatedObjectName);
54098
- const relatedKeyRefToField = uiSchema.fields[relatedKey].reference_to_field || idFieldName || "_id";
54099
- return /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema: {
54100
- type: "service",
54101
- name: `amis-${appId}-${objectName}-related-${relatedObjectName}`,
54102
- api: {
54103
- method: "post",
54104
- url: `/graphql`,
54105
- requestAdaptor: `
54106
- api.data = {
54107
- query: \`{
54108
- data: ${objectName}(filters:["${idFieldName}", "=", "${recordId}"]){
54109
- ${idFieldName === relatedKeyRefToField ? idFieldName : idFieldName + "," + relatedKeyRefToField},
54110
- ${mainUiSchema.NAME_FIELD_KEY},
54111
- locked,
54112
- recordPermissions: _permissions{
54113
- allowCreate,
54114
- allowCreateFiles,
54115
- allowDelete,
54116
- allowDeleteFiles,
54117
- allowEdit,
54118
- allowEditFiles,
54119
- allowRead,
54120
- allowReadFiles,
54121
- disabled_actions,
54122
- disabled_list_views,
54123
- field_permissions,
54124
- modifyAllFiles,
54125
- modifyAllRecords,
54126
- modifyAssignCompanysRecords,
54127
- modifyCompanyRecords,
54128
- uneditable_fields,
54129
- unreadable_fields,
54130
- unrelated_objects,
54131
- viewAllFiles,
54132
- viewAllRecords,
54133
- viewAssignCompanysRecords,
54134
- viewCompanyRecords,
54135
- }
54136
- }
54137
- }\`
54138
- }
54139
- return api;
54140
- `,
54141
- adaptor: `
54142
- if(payload.data.data){
54143
- var data = payload.data.data[0];
54144
- payload.data = data;
54145
- payload.data._master = {
54146
- objectName: "${objectName}",
54147
- recordId: data["${idFieldName}"],
54148
- record: {
54149
- "${idFieldName}": data["${idFieldName}"],
54150
- "${mainUiSchema.NAME_FIELD_KEY}": data["${mainUiSchema.NAME_FIELD_KEY}"],
54151
- "${relatedKeyRefToField}": data["${relatedKeyRefToField}"],
54152
- "locked": data.locked
54153
- }
54154
- };
54155
- }
54156
- payload.data.$breadcrumb = [
54157
- {
54158
- "label": "${mainUiSchema.label}",
54159
- "href": "/app/${appId}/${objectName}"
54160
- },
54161
- {
54162
- "label": payload.data.${mainUiSchema.NAME_FIELD_KEY},
54163
- "href": "/app/${appId}/${objectName}/view/${recordId}",
54164
- },
54165
- {
54166
- "label": "相关 ${uiSchema.label}"
54167
- },
54168
- ]
54169
- payload.data.$loaded = true;
54170
- return payload;
54171
- `,
54172
- headers: {
54173
- Authorization: "Bearer ${context.tenantId},${context.authToken}"
54174
- }
54175
- },
54176
- "data": {
54177
- "&": "$$",
54178
- "$breadcrumb": []
54179
- //先给一个空数组, 防止breadcrumb组件报错
54180
- },
54181
- body: [
54182
- {
54183
- "type": "breadcrumb",
54184
- "source": "${$breadcrumb}",
54185
- "className": "mx-4 my-2"
54186
- },
54187
- {
54188
- type: "steedos-object-related-listview",
54189
- objectApiName: mainUiSchema.name,
54190
- recordId,
54191
- relatedObjectApiName: relatedObjectName,
54192
- foreign_key: relatedKey,
54193
- relatedKey,
54194
- hiddenOn: "!!!this.$loaded",
54195
- "className": "mx-4"
54196
- // top: 5
54054
+ if (serializedParams) {
54055
+ var hashmarkIndex = url2.indexOf("#");
54056
+ if (hashmarkIndex !== -1) {
54057
+ url2 = url2.slice(0, hashmarkIndex);
54197
54058
  }
54198
- // {
54199
- // type: 'steedos-object-related-listview',
54200
- // objectApiName: masterObject.name,
54201
- // recordId: recordId,
54202
- // relatedObjectApiName: objectApiName,
54203
- // foreign_key: relatedKey,
54204
- // relatedKey: relatedKey,
54205
- // hiddenOn: "!!!this.$loaded"
54206
- // // top: 5
54207
- // }
54208
- ]
54209
- }, data: {
54210
- context: {
54211
- app: appId,
54212
- appId,
54213
- app_id: appId,
54214
- listName: listName || "",
54215
- ...Builder$1.settings.context
54216
- },
54217
- app: appId,
54218
- appId,
54219
- app_id: appId,
54220
- listName: listName || "",
54221
- objectName,
54222
- object_name: objectName
54223
- }, env: {} });
54224
- };
54225
- const routes = [
54226
- {
54227
- path: "/logout",
54228
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(Logout$1, {})
54229
- },
54230
- {
54231
- path: "/signup",
54232
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(Signup$1, {})
54233
- },
54234
- {
54235
- path: "/login",
54236
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(Login$1, {})
54237
- },
54238
- {
54239
- path: "/",
54240
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(Home, {})
54241
- },
54242
- {
54243
- path: "/create-space",
54244
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CreateTenant$1, {}) })
54245
- },
54246
- {
54247
- path: "/select-space",
54248
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectSpace$1, {}) })
54249
- },
54250
- {
54251
- path: "/update-password",
54252
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(UpdatePassword$1, {}) })
54253
- },
54254
- {
54255
- path: "/verify/email",
54256
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(VerifyEmail$1, {}) })
54257
- },
54258
- {
54259
- path: "/verify/mobile",
54260
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(VerifyMobile$1, {}) })
54261
- },
54262
- {
54263
- path: "/home",
54264
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Home, {}) })
54265
- },
54266
- {
54267
- path: "/home/:spaceId",
54268
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Home, {}) })
54269
- },
54270
- {
54271
- path: "/app",
54272
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppDashboard, {}) }) })
54273
- },
54274
- {
54275
- path: "/app/:appId",
54276
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppView, {}) }) })
54277
- },
54278
- {
54279
- path: "/app/:appId/page/:pageId",
54280
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PageView, {}) }) })
54281
- },
54282
- {
54283
- path: "/app/:appId/:objectName",
54284
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ObjectListView, {}) }) })
54285
- },
54286
- {
54287
- path: "/app/:appId/:objectName/grid/:listviewId",
54288
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ObjectListView, {}) }) })
54289
- },
54290
- {
54291
- path: "/app/:appId/:objectName/:recordId/:relatedObjectName/grid",
54292
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ObjectRelatedListView, {}) }) })
54293
- },
54294
- {
54295
- path: "/app/:appId/:objectName/view/:recordId",
54296
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ObjectDetail, {}) }) })
54297
- },
54298
- {
54299
- path: "/app/:appId/tab_iframe/:tabId",
54300
- element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(IframeView, {}) }) })
54059
+ url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;
54060
+ }
54061
+ return url2;
54062
+ };
54063
+ return buildURL;
54064
+ }
54065
+ var InterceptorManager_1;
54066
+ var hasRequiredInterceptorManager;
54067
+ function requireInterceptorManager() {
54068
+ if (hasRequiredInterceptorManager) return InterceptorManager_1;
54069
+ hasRequiredInterceptorManager = 1;
54070
+ var utils2 = requireUtils();
54071
+ function InterceptorManager() {
54072
+ this.handlers = [];
54301
54073
  }
54302
- ];
54303
- const SteedosRouter = () => {
54304
- const router = createBrowserRouter(routes);
54305
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(RouterProvider2, { router }) });
54306
- };
54307
- function loadSettings() {
54308
- return async (dispatch, getState) => {
54309
- let data2;
54310
- try {
54311
- data2 = await Client4.getSettings();
54312
- } catch (error) {
54313
- forceLogoutIfNecessary(error, dispatch, getState);
54314
- return { error };
54074
+ InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
54075
+ this.handlers.push({
54076
+ fulfilled,
54077
+ rejected,
54078
+ synchronous: options ? options.synchronous : false,
54079
+ runWhen: options ? options.runWhen : null
54080
+ });
54081
+ return this.handlers.length - 1;
54082
+ };
54083
+ InterceptorManager.prototype.eject = function eject(id2) {
54084
+ if (this.handlers[id2]) {
54085
+ this.handlers[id2] = null;
54315
54086
  }
54316
- Client4.setEnableLogging(data2.EnableDeveloper === "true");
54317
- Client4.setDiagnosticId(data2.DiagnosticId);
54318
- Steedos.settings = {
54319
- public: data2.public
54320
- };
54321
- dispatch({
54322
- type: GeneralTypes.RECEIVED_SETTINGS,
54323
- data: data2
54087
+ };
54088
+ InterceptorManager.prototype.forEach = function forEach2(fn) {
54089
+ utils2.forEach(this.handlers, function forEachHandler(h) {
54090
+ if (h !== null) {
54091
+ fn(h);
54092
+ }
54324
54093
  });
54325
- return { data: data2 };
54326
54094
  };
54095
+ InterceptorManager_1 = InterceptorManager;
54096
+ return InterceptorManager_1;
54327
54097
  }
54328
- const Account = {
54329
- disabledAccountRegister: () => {
54330
- var _a2, _b2, _c, _d;
54331
- return (_d = (_c = (_b2 = (_a2 = window.Tenant) == null ? void 0 : _a2.settings) == null ? void 0 : _b2.public) == null ? void 0 : _c.accounts) == null ? void 0 : _d.disabled_account_register;
54332
- }
54333
- };
54334
- const Space = {
54335
- get: () => {
54336
- var _a2;
54337
- return _.find(Steedos.__hotRecords.spaces, { _id: (_a2 = window.Builder.settings.context) == null ? void 0 : _a2.tenantId });
54338
- },
54339
- getMySpaces: () => {
54340
- return Steedos.__hotRecords.spaces;
54341
- }
54342
- };
54343
- const BaseObject = {
54344
- base: {
54345
- actions: {
54346
- standard_query: {
54347
- label: "Search",
54348
- visible: function() {
54349
- return Steedos.StandardObjects.Base.Actions.standard_query.visible.apply(
54350
- this,
54351
- arguments
54352
- );
54353
- },
54354
- on: "list",
54355
- todo: "standard_query"
54356
- },
54357
- standard_new: {
54358
- label: "New",
54359
- visible: function(object_name) {
54360
- return Steedos.StandardObjects.Base.Actions.standard_new.visible.apply(
54361
- this,
54362
- arguments
54363
- );
54364
- },
54365
- on: "list",
54366
- todo: "standard_new"
54367
- },
54368
- standard_open_view: {
54369
- label: "Open",
54370
- sort: -1,
54371
- visible: function(object_name, record_id, record_permissions) {
54372
- return true;
54373
- },
54374
- on: "list_item",
54375
- todo: "standard_open_view"
54376
- },
54377
- standard_edit: {
54378
- label: "Edit",
54379
- sort: 0,
54380
- visible: function(object_name, record_id, record_permissions) {
54381
- return Steedos.StandardObjects.Base.Actions.standard_edit.visible.apply(
54382
- this,
54383
- arguments
54384
- );
54385
- },
54386
- on: "record",
54387
- todo: "standard_edit"
54388
- },
54389
- standard_delete: {
54390
- label: "Delete",
54391
- visible: function(object_name, record_id, record_permissions) {
54392
- return Steedos.StandardObjects.Base.Actions.standard_delete.visible.apply(
54393
- this,
54394
- arguments
54395
- );
54396
- },
54397
- on: "record_more",
54398
- todo: "standard_delete"
54399
- },
54400
- standard_delete_many: {
54401
- label: "Delete",
54402
- visible: function(object_name, record_id, record_permissions) {
54403
- return Steedos.StandardObjects.Base.Actions.standard_delete_many.visible.apply(
54404
- this,
54405
- arguments
54406
- );
54098
+ var normalizeHeaderName;
54099
+ var hasRequiredNormalizeHeaderName;
54100
+ function requireNormalizeHeaderName() {
54101
+ if (hasRequiredNormalizeHeaderName) return normalizeHeaderName;
54102
+ hasRequiredNormalizeHeaderName = 1;
54103
+ var utils2 = requireUtils();
54104
+ normalizeHeaderName = function normalizeHeaderName2(headers, normalizedName) {
54105
+ utils2.forEach(headers, function processHeader(value, name) {
54106
+ if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
54107
+ headers[normalizedName] = value;
54108
+ delete headers[name];
54109
+ }
54110
+ });
54111
+ };
54112
+ return normalizeHeaderName;
54113
+ }
54114
+ var enhanceError;
54115
+ var hasRequiredEnhanceError;
54116
+ function requireEnhanceError() {
54117
+ if (hasRequiredEnhanceError) return enhanceError;
54118
+ hasRequiredEnhanceError = 1;
54119
+ enhanceError = function enhanceError2(error, config2, code, request2, response) {
54120
+ error.config = config2;
54121
+ if (code) {
54122
+ error.code = code;
54123
+ }
54124
+ error.request = request2;
54125
+ error.response = response;
54126
+ error.isAxiosError = true;
54127
+ error.toJSON = function toJSON() {
54128
+ return {
54129
+ // Standard
54130
+ message: this.message,
54131
+ name: this.name,
54132
+ // Microsoft
54133
+ description: this.description,
54134
+ number: this.number,
54135
+ // Mozilla
54136
+ fileName: this.fileName,
54137
+ lineNumber: this.lineNumber,
54138
+ columnNumber: this.columnNumber,
54139
+ stack: this.stack,
54140
+ // Axios
54141
+ config: this.config,
54142
+ code: this.code
54143
+ };
54144
+ };
54145
+ return error;
54146
+ };
54147
+ return enhanceError;
54148
+ }
54149
+ var createError;
54150
+ var hasRequiredCreateError;
54151
+ function requireCreateError() {
54152
+ if (hasRequiredCreateError) return createError;
54153
+ hasRequiredCreateError = 1;
54154
+ var enhanceError2 = requireEnhanceError();
54155
+ createError = function createError2(message2, config2, code, request2, response) {
54156
+ var error = new Error(message2);
54157
+ return enhanceError2(error, config2, code, request2, response);
54158
+ };
54159
+ return createError;
54160
+ }
54161
+ var settle;
54162
+ var hasRequiredSettle;
54163
+ function requireSettle() {
54164
+ if (hasRequiredSettle) return settle;
54165
+ hasRequiredSettle = 1;
54166
+ var createError2 = requireCreateError();
54167
+ settle = function settle2(resolve, reject, response) {
54168
+ var validateStatus = response.config.validateStatus;
54169
+ if (!response.status || !validateStatus || validateStatus(response.status)) {
54170
+ resolve(response);
54171
+ } else {
54172
+ reject(createError2(
54173
+ "Request failed with status code " + response.status,
54174
+ response.config,
54175
+ null,
54176
+ response.request,
54177
+ response
54178
+ ));
54179
+ }
54180
+ };
54181
+ return settle;
54182
+ }
54183
+ var cookies;
54184
+ var hasRequiredCookies;
54185
+ function requireCookies() {
54186
+ if (hasRequiredCookies) return cookies;
54187
+ hasRequiredCookies = 1;
54188
+ var utils2 = requireUtils();
54189
+ cookies = utils2.isStandardBrowserEnv() ? (
54190
+ // Standard browser envs support document.cookie
54191
+ /* @__PURE__ */ function standardBrowserEnv() {
54192
+ return {
54193
+ write: function write(name, value, expires, path2, domain, secure) {
54194
+ var cookie2 = [];
54195
+ cookie2.push(name + "=" + encodeURIComponent(value));
54196
+ if (utils2.isNumber(expires)) {
54197
+ cookie2.push("expires=" + new Date(expires).toGMTString());
54198
+ }
54199
+ if (utils2.isString(path2)) {
54200
+ cookie2.push("path=" + path2);
54201
+ }
54202
+ if (utils2.isString(domain)) {
54203
+ cookie2.push("domain=" + domain);
54204
+ }
54205
+ if (secure === true) {
54206
+ cookie2.push("secure");
54207
+ }
54208
+ document.cookie = cookie2.join("; ");
54407
54209
  },
54408
- on: "list",
54409
- todo: function() {
54410
- return Steedos.StandardObjects.Base.Actions.standard_delete_many.todo.apply(
54411
- this,
54412
- arguments
54413
- );
54210
+ read: function read(name) {
54211
+ var match2 = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
54212
+ return match2 ? decodeURIComponent(match2[3]) : null;
54213
+ },
54214
+ remove: function remove(name) {
54215
+ this.write(name, "", Date.now() - 864e5);
54414
54216
  }
54415
- },
54416
- // standard_approve: {
54417
- // label: "Initiate Approval",
54418
- // visible: function (object_name, record_id, record_permissions) {
54419
- // return Steedos.StandardObjects.Base.Actions.standard_approve.visible.apply(
54420
- // this,
54421
- // arguments,
54422
- // );
54423
- // },
54424
- // on: "record_only",
54425
- // type: "amis_button",
54426
- // amis_schema: {
54427
- // type: "service",
54428
- // body: [
54429
- // {
54430
- // type: "button",
54431
- // label: "发起审批",
54432
- // id: "u:6887f3ab860a",
54433
- // editorState: "default",
54434
- // onEvent: {
54435
- // click: {
54436
- // weight: 0,
54437
- // actions: [
54438
- // {
54439
- // actionType: "steedos_actions_standard_approve",
54440
- // },
54441
- // ],
54442
- // },
54443
- // },
54444
- // },
54445
- // ],
54446
- // regions: ["body"],
54447
- // data: {
54448
- // context: {},
54449
- // dataComponentId: "",
54450
- // record_id: "",
54451
- // record: {},
54452
- // permissions: {},
54453
- // },
54454
- // bodyClassName: "p-0",
54455
- // id: "u:5dd49d3a508c",
54456
- // },
54457
- // },
54458
- // standard_create_instance: {
54459
- // label: "Create Approval",
54460
- // sort: -1,
54461
- // on: "list",
54462
- // type: "amis_button",
54463
- // visible: function (object_name, record_id, record_permissions, data) {
54464
- // if (data._isRelated) return false;
54465
- // return (
54466
- // lodash.filter(Steedos.Workflow?.getObjectWorkflows(), (item) => {
54467
- // return (
54468
- // item.object_name == object_name &&
54469
- // (!item.sync_direction ||
54470
- // item.sync_direction == "both" ||
54471
- // item.sync_direction == "ins_to_obj") &&
54472
- // true !== item.forbid_initiate_instance
54473
- // );
54474
- // }).length > 0
54475
- // );
54476
- // },
54477
- // amis_schema: {
54478
- // type: "service",
54479
- // body: [
54480
- // {
54481
- // type: "button",
54482
- // label: "申请",
54483
- // id: "u:standard_create_instance",
54484
- // editorState: "default",
54485
- // onEvent: {
54486
- // click: {
54487
- // weight: 0,
54488
- // actions: [
54489
- // {
54490
- // actionType: "custom",
54491
- // script:
54492
- // "// 编写判断,当前可发起的流程是单个还是多个. 并返回数据用于控制下个事件是直接新建申请单草稿还是弹出流程让选择\n\nconst flows = lodash.filter(Creator.object_workflows, (item) => { return item.object_name == event.data.object_name && (!item.sync_direction || item.sync_direction == 'both' || item.sync_direction == 'ins_to_obj') && true !== item.forbid_initiate_instance })\n\nevent.setData({ ...event.data, ...{ flows: flows, flowCount: flows.length } })\n\n",
54493
- // },
54494
- // {
54495
- // actionType: "ajax",
54496
- // outputVar: "responseResult",
54497
- // args: {
54498
- // options: {},
54499
- // api: {
54500
- // url: "${context.rootUrl}/api/workflow/v2/draft",
54501
- // method: "post",
54502
- // requestAdaptor:
54503
- // "api.data = {\n 'instance': {\n 'flow': api.body.flows[0].flow_id,\n 'applicant': api.body.context.userId,\n 'space': api.body.context.tenantId\n \n}}\n\nreturn api;",
54504
- // adaptor:
54505
- // "\nif (payload.error) { \n return {\n status: 2,\n msg: payload.error\n }\n}\nconst instance = payload.instance;\nSteedos.openWindow(Steedos.absoluteUrl('/app/' + FlowRouter.current().params.app_id + '/instances/view/' + instance._id + '?display=' + (Steedos.Page.getDisplay('instances') || '') + '&side_object=instances&side_listview_id=draft'))\nreturn payload;",
54506
- // messages: {},
54507
- // headers: {
54508
- // Authorization:
54509
- // "Bearer ${context.tenantId},${context.authToken}",
54510
- // },
54511
- // data: {
54512
- // "&": "$$",
54513
- // context: "${context}",
54514
- // objectName: "${objectName}",
54515
- // recordId: "${recordId}",
54516
- // },
54517
- // },
54518
- // },
54519
- // expression: "${event.data.flowCount == 1}",
54520
- // },
54521
- // {
54522
- // actionType: "dialog",
54523
- // expression: "${event.data.flowCount > 1}",
54524
- // dialog: {
54525
- // type: "dialog",
54526
- // title: "选择流程发起审批",
54527
- // body: [
54528
- // {
54529
- // type: "form",
54530
- // id: "u:f78efaa51a4f",
54531
- // body: [
54532
- // {
54533
- // type: "input-tree",
54534
- // name: "flowId",
54535
- // label: false,
54536
- // clearable: true,
54537
- // id: "u:025b991fd40b",
54538
- // multiple: false,
54539
- // treeContainerClassName:
54540
- // "no-border m-none p-none",
54541
- // source: {
54542
- // method: "get",
54543
- // url: "${context.rootUrl}/api/workflow/v2/get_object_workflows",
54544
- // requestAdaptor: "api.data = {};return api;",
54545
- // adaptor:
54546
- // "return { data: _.filter(payload, (item) => { return item.object_name == api.body.objectName && item.can_add && (!item.sync_direction || item.sync_direction == 'both' || item.sync_direction == 'ins_to_obj') && true !== item.forbid_initiate_instance })};",
54547
- // messages: {},
54548
- // dataType: "json",
54549
- // headers: {
54550
- // Authorization:
54551
- // "Bearer ${context.tenantId},${context.authToken}",
54552
- // },
54553
- // data: {
54554
- // objectName: "${objectName}",
54555
- // spaceId: "${context.tenantId}",
54556
- // },
54557
- // },
54558
- // value: "",
54559
- // labelField: "flow_name",
54560
- // valueField: "flow_id",
54561
- // onEvent: {
54562
- // change: {
54563
- // weight: 0,
54564
- // actions: [
54565
- // {
54566
- // actionType: "ajax",
54567
- // outputVar: "responseResult",
54568
- // args: {
54569
- // options: {},
54570
- // api: {
54571
- // url: "${context.rootUrl}/api/workflow/v2/draft",
54572
- // method: "post",
54573
- // requestAdaptor:
54574
- // "api.data = {\n 'instance': {\n 'flow': api.body.flowId,\n 'applicant': api.body.context.userId,\n 'space': api.body.context.tenantId\n \n}}\n\nreturn api;",
54575
- // adaptor:
54576
- // "\nif (payload.error) { \n return {\n status: 2,\n msg: payload.error\n }\n}\nconst instance = payload.instance;\nSteedos.openWindow(Steedos.absoluteUrl('/app/' + FlowRouter.current().params.app_id + '/instances/view/' + instance._id + '?display=' + (Steedos.Page.getDisplay('instances') || '') + '&side_object=instances&side_listview_id=draft'))\nreturn payload;",
54577
- // messages: {},
54578
- // headers: {
54579
- // Authorization:
54580
- // "Bearer ${context.tenantId},${context.authToken}",
54581
- // },
54582
- // data: {
54583
- // "&": "$$",
54584
- // context: "${context}",
54585
- // objectName: "${objectName}",
54586
- // recordId: "${recordId}",
54587
- // },
54588
- // },
54589
- // },
54590
- // expression: "${event.data.value}",
54591
- // },
54592
- // {
54593
- // actionType: "closeDialog",
54594
- // },
54595
- // ],
54596
- // },
54597
- // },
54598
- // },
54599
- // ],
54600
- // wrapWithPanel: false,
54601
- // },
54602
- // ],
54603
- // showCloseButton: true,
54604
- // showErrorMsg: true,
54605
- // showLoading: true,
54606
- // className: "",
54607
- // id: "u:ba79188bbf7e",
54608
- // closeOnEsc: true,
54609
- // actions: [],
54610
- // size: "md",
54611
- // data: {
54612
- // "&": "$$",
54613
- // },
54614
- // dataMap: {},
54615
- // withDefaultData: true,
54616
- // dataMapSwitch: true,
54617
- // bodyClassName: "overflow-hidden",
54618
- // },
54619
- // },
54620
- // ],
54621
- // },
54622
- // },
54623
- // },
54624
- // ],
54625
- // regions: ["body"],
54626
- // data: {
54627
- // context: {},
54628
- // dataComponentId: "",
54629
- // record_id: "",
54630
- // record: {},
54631
- // permissions: {},
54632
- // },
54633
- // bodyClassName: "p-0",
54634
- // id: "u:6ac1032391f4",
54635
- // },
54636
- // },
54637
- // standard_view_instance: {
54638
- // label: "View Instance",
54639
- // visible: function (object_name, record_id, record_permissions) {
54640
- // return Steedos.StandardObjects.Base.Actions.standard_view_instance.visible.apply(
54641
- // this,
54642
- // arguments,
54643
- // );
54644
- // },
54645
- // on: "record_only",
54646
- // todo: function () {
54647
- // return Steedos.StandardObjects.Base.Actions.standard_view_instance.todo.apply(
54648
- // this,
54649
- // arguments,
54650
- // );
54651
- // },
54652
- // },
54653
- // standard_submit_for_approval: {
54654
- // visible: function (object_name, record_id) {
54655
- // return Steedos.StandardObjects.Base.Actions.standard_submit_for_approval.visible.apply(
54656
- // this,
54657
- // arguments,
54658
- // );
54659
- // },
54660
- // on: "record_only",
54661
- // type: "amis_button",
54662
- // amis_schema: {
54663
- // type: "service",
54664
- // body: [
54665
- // {
54666
- // type: "button",
54667
- // label: "提请审批",
54668
- // id: "u:standard_submit_for_approval",
54669
- // onEvent: {
54670
- // click: {
54671
- // actions: [
54672
- // {
54673
- // actionType: "dialog",
54674
- // dialog: {
54675
- // type: "dialog",
54676
- // title: "提交待审核",
54677
- // body: [
54678
- // {
54679
- // type: "form",
54680
- // id: "u:1eb06e6962d8",
54681
- // title: "表单",
54682
- // body: [
54683
- // {
54684
- // type: "steedos-field",
54685
- // id: "u:9f4486c22f52",
54686
- // field:
54687
- // '{\n "label": "意见",\n "name": "comment",\n "type": "textarea",\n "rows": 3,\n "is_wide": true\n}',
54688
- // name: "comment",
54689
- // },
54690
- // {
54691
- // type: "steedos-field",
54692
- // id: "u:9f4486c22f52",
54693
- // field:
54694
- // '{\n "label": "选择下一位批准人",\n "name": "approver",\n "type": "lookup",\n "reference_to": "space_users",\n "reference_to_field": "user",\n "required": true,\n "is_wide": true\n}',
54695
- // name: "approver",
54696
- // placeholder: "",
54697
- // visibleOn: "${showApprover === true}",
54698
- // },
54699
- // ],
54700
- // wrapWithPanel: false,
54701
- // mode: "normal",
54702
- // api: {
54703
- // method: "post",
54704
- // url: "${context.rootUrl}/api/v4/process/submit/${objectName}/${recordId}",
54705
- // data: {
54706
- // "&": "$$",
54707
- // },
54708
- // requestAdaptor:
54709
- // "\napi.data = {\n comment: api.body.comment\n};\n\nif (api.body.approver) {\n api.data.approver = api.body.approver;\n}\n\nreturn api;",
54710
- // adaptor:
54711
- // "\npayload.data = {};\npayload.data.showApprover = payload.error === 'process_approval_error_needToChooseApprover'\n\nif (payload.state === 'FAILURE') {\n if (payload.data.showApprover) {\n payload.msg = \"请选择下一位批准人\";\n } else { \n payload.msg = window.t(payload.error)\n }\n}\n\n\nreturn payload;",
54712
- // responseData: {
54713
- // "&": "$$",
54714
- // },
54715
- // headers: {
54716
- // Authorization:
54717
- // "Bearer ${context.tenantId},${context.authToken}",
54718
- // },
54719
- // },
54720
- // debug: false,
54721
- // onEvent: {
54722
- // submitSucc: {
54723
- // weight: 0,
54724
- // actions: [
54725
- // {
54726
- // actionType: "custom",
54727
- // script: `
54728
- // doAction({
54729
- // "actionType": "broadcast",
54730
- // "args": {
54731
- // "eventName": \`@data.changed.\${event.data.objectName}\`
54732
- // },
54733
- // "data": {
54734
- // "objectName": \`\${event.data.objectName}\`
54735
- // }
54736
- // });
54737
- // `,
54738
- // },
54739
- // ],
54740
- // },
54741
- // },
54742
- // },
54743
- // ],
54744
- // id: "u:7a3f92e56805",
54745
- // closeOnEsc: false,
54746
- // closeOnOutside: false,
54747
- // showCloseButton: true,
54748
- // size: "md",
54749
- // },
54750
- // },
54751
- // ],
54752
- // weight: 0,
54753
- // },
54754
- // },
54755
- // },
54756
- // ],
54757
- // regions: ["body"],
54758
- // data: {},
54759
- // bodyClassName: "p-0",
54760
- // id: "u:50444554a302",
54761
- // },
54762
- // },
54763
- standard_export_excel: {
54764
- label: "Export Excel",
54765
- visible: function(object_name, record_id, record_permissions) {
54766
- return Steedos.StandardObjects.Base.Actions.standard_export_excel.visible.apply(
54767
- this,
54768
- arguments
54769
- );
54217
+ };
54218
+ }()
54219
+ ) : (
54220
+ // Non standard browser env (web workers, react-native) lack needed support.
54221
+ /* @__PURE__ */ function nonStandardBrowserEnv() {
54222
+ return {
54223
+ write: function write() {
54770
54224
  },
54771
- on: "list",
54772
- todo: function() {
54773
- return Steedos.StandardObjects.Base.Actions.standard_export_excel.todo.apply(
54774
- this,
54775
- arguments
54776
- );
54225
+ read: function read() {
54226
+ return null;
54227
+ },
54228
+ remove: function remove() {
54777
54229
  }
54778
- },
54779
- standard_print: {
54780
- label: "Print",
54781
- visible: false,
54782
- on: "record_only",
54783
- type: "amis_button",
54784
- amis_schema: {
54785
- type: "service",
54786
- body: [
54787
- {
54788
- type: "service",
54789
- body: [
54790
- {
54791
- type: "dropdown-button",
54792
- label: "打印",
54793
- buttons: "${buttonOptions}",
54794
- id: "u:8cd2cefcaf9b",
54795
- disabled: false,
54796
- hidden: false
54797
- }
54798
- ],
54799
- id: "u:2b1dc4682c90",
54800
- messages: {},
54801
- api: {
54802
- url: "${context.rootUrl}/graphql",
54803
- method: "post",
54804
- messages: {
54805
- failed: "打印功能需要企业许可证"
54806
- },
54807
- requestAdaptor: "",
54808
- adaptor: 'const buttonOptions = [];\nfor (const row of payload.data.rows) {\n buttonOptions.push({\n "type": "button",\n "label": row.label,\n "onEvent": {\n "click": {\n "actions": [\n {\n "actionType": "url",\n "args": {\n "url": "${context.rootUrl}/api/page/render",\n "blank": true,\n "params": {\n "schemaApi": "${context.rootUrl}/service/api/@steedos/print-template/getPrintSchema/" + row._id,\n "data": {\n "filters": ["_id", "=", "${recordId}"]\n } \n }\n }\n }\n ]\n }\n }\n })\n}\n\npayload.data = {\n buttonOptions: buttonOptions \n}\nreturn payload',
54809
- headers: {
54810
- Authorization: "Bearer ${context.tenantId},${context.authToken}"
54811
- },
54812
- data: {
54813
- "&": "$$",
54814
- query: '{ rows: object_print(filters: [["object_name", "=", "${objectName}"]]) { _id name label object_name } }'
54815
- }
54816
- },
54817
- initFetch: true,
54818
- onEvent: {
54819
- init: {
54820
- weight: 0,
54821
- actions: []
54822
- }
54823
- },
54824
- name: "print"
54825
- }
54826
- ],
54827
- regions: ["body"],
54828
- data: {
54829
- context: {},
54830
- dataComponentId: "",
54831
- record_id: "",
54832
- record: {},
54833
- permissions: {}
54834
- },
54835
- id: "u:038c6047be31",
54836
- bodyClassName: "p-0"
54837
- }
54838
- }
54839
- }
54840
- }
54841
- };
54842
- const User = {
54843
- get: () => {
54844
- var _a2;
54845
- return (_a2 = window.Builder.settings.context) == null ? void 0 : _a2.user;
54846
- }
54847
- };
54848
- const Workflow = {
54849
- // TODO: 初始化对象流程?
54850
- getObjectWorkflows: () => {
54851
- return [];
54852
- }
54853
- };
54854
- const ProcessManager = {};
54855
- class SObject {
54856
- constructor(objectName, client2) {
54857
- __publicField(this, "objectName");
54858
- __publicField(this, "client");
54859
- this.objectName = objectName;
54860
- this.client = client2;
54861
- }
54862
- // fetches a record or records specified by id(s) in first argument.
54863
- async retrieve(id2) {
54864
- if (_.isEmpty(id2)) {
54865
- return [];
54866
- }
54867
- if (_.isString(id2)) {
54868
- return await this.client.getRecord({
54869
- objectName: this.objectName,
54870
- id: id2
54871
- });
54872
- } else if (_.isArray(id2)) {
54873
- return await this.client.searchRecords(this.objectName, {
54874
- filters: [["_id", "in", id2]]
54875
- });
54876
- }
54877
- }
54878
- async create(doc) {
54879
- return await this.client.createRecord({
54880
- objectName: this.objectName,
54881
- doc
54882
- });
54883
- }
54884
- async update(id2, doc) {
54885
- return await this.client.updateRecord({
54886
- objectName: this.objectName,
54887
- id: id2,
54888
- doc
54889
- });
54890
- }
54891
- async delete(id2) {
54892
- return await this.client.deleteRecord({
54893
- objectName: this.objectName,
54894
- id: id2
54895
- });
54896
- }
54897
- async find(filters, fields, sort, top, skip) {
54898
- return await this.client.searchRecords(this.objectName, {
54899
- filters,
54900
- fields,
54901
- sort,
54902
- top,
54903
- skip
54904
- });
54905
- }
54230
+ };
54231
+ }()
54232
+ );
54233
+ return cookies;
54906
54234
  }
54907
- var axios$2 = { exports: {} };
54908
- var bind;
54909
- var hasRequiredBind;
54910
- function requireBind() {
54911
- if (hasRequiredBind) return bind;
54912
- hasRequiredBind = 1;
54913
- bind = function bind2(fn, thisArg) {
54914
- return function wrap() {
54915
- var args = new Array(arguments.length);
54916
- for (var i = 0; i < args.length; i++) {
54917
- args[i] = arguments[i];
54918
- }
54919
- return fn.apply(thisArg, args);
54920
- };
54235
+ var isAbsoluteURL;
54236
+ var hasRequiredIsAbsoluteURL;
54237
+ function requireIsAbsoluteURL() {
54238
+ if (hasRequiredIsAbsoluteURL) return isAbsoluteURL;
54239
+ hasRequiredIsAbsoluteURL = 1;
54240
+ isAbsoluteURL = function isAbsoluteURL2(url2) {
54241
+ return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url2);
54921
54242
  };
54922
- return bind;
54243
+ return isAbsoluteURL;
54923
54244
  }
54924
- var utils;
54925
- var hasRequiredUtils;
54926
- function requireUtils() {
54927
- if (hasRequiredUtils) return utils;
54928
- hasRequiredUtils = 1;
54929
- var bind2 = requireBind();
54930
- var toString2 = Object.prototype.toString;
54931
- function isArray2(val) {
54932
- return toString2.call(val) === "[object Array]";
54933
- }
54934
- function isUndefined(val) {
54935
- return typeof val === "undefined";
54936
- }
54937
- function isBuffer(val) {
54938
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
54939
- }
54940
- function isArrayBuffer(val) {
54941
- return toString2.call(val) === "[object ArrayBuffer]";
54942
- }
54943
- function isFormData(val) {
54944
- return typeof FormData !== "undefined" && val instanceof FormData;
54945
- }
54946
- function isArrayBufferView2(val) {
54947
- var result;
54948
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
54949
- result = ArrayBuffer.isView(val);
54950
- } else {
54951
- result = val && val.buffer && val.buffer instanceof ArrayBuffer;
54245
+ var combineURLs;
54246
+ var hasRequiredCombineURLs;
54247
+ function requireCombineURLs() {
54248
+ if (hasRequiredCombineURLs) return combineURLs;
54249
+ hasRequiredCombineURLs = 1;
54250
+ combineURLs = function combineURLs2(baseURL, relativeURL) {
54251
+ return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
54252
+ };
54253
+ return combineURLs;
54254
+ }
54255
+ var buildFullPath;
54256
+ var hasRequiredBuildFullPath;
54257
+ function requireBuildFullPath() {
54258
+ if (hasRequiredBuildFullPath) return buildFullPath;
54259
+ hasRequiredBuildFullPath = 1;
54260
+ var isAbsoluteURL2 = requireIsAbsoluteURL();
54261
+ var combineURLs2 = requireCombineURLs();
54262
+ buildFullPath = function buildFullPath2(baseURL, requestedURL) {
54263
+ if (baseURL && !isAbsoluteURL2(requestedURL)) {
54264
+ return combineURLs2(baseURL, requestedURL);
54952
54265
  }
54953
- return result;
54954
- }
54955
- function isString2(val) {
54956
- return typeof val === "string";
54957
- }
54958
- function isNumber2(val) {
54959
- return typeof val === "number";
54960
- }
54961
- function isObject2(val) {
54962
- return val !== null && typeof val === "object";
54963
- }
54964
- function isPlainObject2(val) {
54965
- if (toString2.call(val) !== "[object Object]") {
54966
- return false;
54266
+ return requestedURL;
54267
+ };
54268
+ return buildFullPath;
54269
+ }
54270
+ var parseHeaders;
54271
+ var hasRequiredParseHeaders;
54272
+ function requireParseHeaders() {
54273
+ if (hasRequiredParseHeaders) return parseHeaders;
54274
+ hasRequiredParseHeaders = 1;
54275
+ var utils2 = requireUtils();
54276
+ var ignoreDuplicateOf = [
54277
+ "age",
54278
+ "authorization",
54279
+ "content-length",
54280
+ "content-type",
54281
+ "etag",
54282
+ "expires",
54283
+ "from",
54284
+ "host",
54285
+ "if-modified-since",
54286
+ "if-unmodified-since",
54287
+ "last-modified",
54288
+ "location",
54289
+ "max-forwards",
54290
+ "proxy-authorization",
54291
+ "referer",
54292
+ "retry-after",
54293
+ "user-agent"
54294
+ ];
54295
+ parseHeaders = function parseHeaders2(headers) {
54296
+ var parsed = {};
54297
+ var key2;
54298
+ var val;
54299
+ var i;
54300
+ if (!headers) {
54301
+ return parsed;
54967
54302
  }
54968
- var prototype = Object.getPrototypeOf(val);
54969
- return prototype === null || prototype === Object.prototype;
54970
- }
54971
- function isDate(val) {
54972
- return toString2.call(val) === "[object Date]";
54973
- }
54974
- function isFile(val) {
54975
- return toString2.call(val) === "[object File]";
54976
- }
54977
- function isBlob(val) {
54978
- return toString2.call(val) === "[object Blob]";
54979
- }
54980
- function isFunction2(val) {
54981
- return toString2.call(val) === "[object Function]";
54982
- }
54983
- function isStream(val) {
54984
- return isObject2(val) && isFunction2(val.pipe);
54985
- }
54986
- function isURLSearchParams(val) {
54987
- return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
54988
- }
54989
- function trim(str) {
54990
- return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
54991
- }
54992
- function isStandardBrowserEnv() {
54993
- if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
54994
- return false;
54995
- }
54996
- return typeof window !== "undefined" && typeof document !== "undefined";
54997
- }
54998
- function forEach2(obj, fn) {
54999
- if (obj === null || typeof obj === "undefined") {
55000
- return;
55001
- }
55002
- if (typeof obj !== "object") {
55003
- obj = [obj];
55004
- }
55005
- if (isArray2(obj)) {
55006
- for (var i = 0, l = obj.length; i < l; i++) {
55007
- fn.call(null, obj[i], i, obj);
55008
- }
55009
- } else {
55010
- for (var key2 in obj) {
55011
- if (Object.prototype.hasOwnProperty.call(obj, key2)) {
55012
- fn.call(null, obj[key2], key2, obj);
55013
- }
55014
- }
55015
- }
55016
- }
55017
- function merge2() {
55018
- var result = {};
55019
- function assignValue(val, key2) {
55020
- if (isPlainObject2(result[key2]) && isPlainObject2(val)) {
55021
- result[key2] = merge2(result[key2], val);
55022
- } else if (isPlainObject2(val)) {
55023
- result[key2] = merge2({}, val);
55024
- } else if (isArray2(val)) {
55025
- result[key2] = val.slice();
55026
- } else {
55027
- result[key2] = val;
55028
- }
55029
- }
55030
- for (var i = 0, l = arguments.length; i < l; i++) {
55031
- forEach2(arguments[i], assignValue);
55032
- }
55033
- return result;
55034
- }
55035
- function extend(a, b, thisArg) {
55036
- forEach2(b, function assignValue(val, key2) {
55037
- if (thisArg && typeof val === "function") {
55038
- a[key2] = bind2(val, thisArg);
55039
- } else {
55040
- a[key2] = val;
55041
- }
55042
- });
55043
- return a;
55044
- }
55045
- function stripBOM(content) {
55046
- if (content.charCodeAt(0) === 65279) {
55047
- content = content.slice(1);
55048
- }
55049
- return content;
55050
- }
55051
- utils = {
55052
- isArray: isArray2,
55053
- isArrayBuffer,
55054
- isBuffer,
55055
- isFormData,
55056
- isArrayBufferView: isArrayBufferView2,
55057
- isString: isString2,
55058
- isNumber: isNumber2,
55059
- isObject: isObject2,
55060
- isPlainObject: isPlainObject2,
55061
- isUndefined,
55062
- isDate,
55063
- isFile,
55064
- isBlob,
55065
- isFunction: isFunction2,
55066
- isStream,
55067
- isURLSearchParams,
55068
- isStandardBrowserEnv,
55069
- forEach: forEach2,
55070
- merge: merge2,
55071
- extend,
55072
- trim,
55073
- stripBOM
55074
- };
55075
- return utils;
55076
- }
55077
- var buildURL;
55078
- var hasRequiredBuildURL;
55079
- function requireBuildURL() {
55080
- if (hasRequiredBuildURL) return buildURL;
55081
- hasRequiredBuildURL = 1;
55082
- var utils2 = requireUtils();
55083
- function encode(val) {
55084
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
55085
- }
55086
- buildURL = function buildURL2(url2, params, paramsSerializer) {
55087
- if (!params) {
55088
- return url2;
55089
- }
55090
- var serializedParams;
55091
- if (paramsSerializer) {
55092
- serializedParams = paramsSerializer(params);
55093
- } else if (utils2.isURLSearchParams(params)) {
55094
- serializedParams = params.toString();
55095
- } else {
55096
- var parts = [];
55097
- utils2.forEach(params, function serialize(val, key2) {
55098
- if (val === null || typeof val === "undefined") {
54303
+ utils2.forEach(headers.split("\n"), function parser(line) {
54304
+ i = line.indexOf(":");
54305
+ key2 = utils2.trim(line.substr(0, i)).toLowerCase();
54306
+ val = utils2.trim(line.substr(i + 1));
54307
+ if (key2) {
54308
+ if (parsed[key2] && ignoreDuplicateOf.indexOf(key2) >= 0) {
55099
54309
  return;
55100
54310
  }
55101
- if (utils2.isArray(val)) {
55102
- key2 = key2 + "[]";
54311
+ if (key2 === "set-cookie") {
54312
+ parsed[key2] = (parsed[key2] ? parsed[key2] : []).concat([val]);
55103
54313
  } else {
55104
- val = [val];
54314
+ parsed[key2] = parsed[key2] ? parsed[key2] + ", " + val : val;
55105
54315
  }
55106
- utils2.forEach(val, function parseValue(v) {
55107
- if (utils2.isDate(v)) {
55108
- v = v.toISOString();
55109
- } else if (utils2.isObject(v)) {
55110
- v = JSON.stringify(v);
55111
- }
55112
- parts.push(encode(key2) + "=" + encode(v));
55113
- });
55114
- });
55115
- serializedParams = parts.join("&");
55116
- }
55117
- if (serializedParams) {
55118
- var hashmarkIndex = url2.indexOf("#");
55119
- if (hashmarkIndex !== -1) {
55120
- url2 = url2.slice(0, hashmarkIndex);
55121
- }
55122
- url2 += (url2.indexOf("?") === -1 ? "?" : "&") + serializedParams;
55123
- }
55124
- return url2;
55125
- };
55126
- return buildURL;
55127
- }
55128
- var InterceptorManager_1;
55129
- var hasRequiredInterceptorManager;
55130
- function requireInterceptorManager() {
55131
- if (hasRequiredInterceptorManager) return InterceptorManager_1;
55132
- hasRequiredInterceptorManager = 1;
55133
- var utils2 = requireUtils();
55134
- function InterceptorManager() {
55135
- this.handlers = [];
55136
- }
55137
- InterceptorManager.prototype.use = function use(fulfilled, rejected, options) {
55138
- this.handlers.push({
55139
- fulfilled,
55140
- rejected,
55141
- synchronous: options ? options.synchronous : false,
55142
- runWhen: options ? options.runWhen : null
55143
- });
55144
- return this.handlers.length - 1;
55145
- };
55146
- InterceptorManager.prototype.eject = function eject(id2) {
55147
- if (this.handlers[id2]) {
55148
- this.handlers[id2] = null;
55149
- }
55150
- };
55151
- InterceptorManager.prototype.forEach = function forEach2(fn) {
55152
- utils2.forEach(this.handlers, function forEachHandler(h) {
55153
- if (h !== null) {
55154
- fn(h);
55155
54316
  }
55156
54317
  });
54318
+ return parsed;
55157
54319
  };
55158
- InterceptorManager_1 = InterceptorManager;
55159
- return InterceptorManager_1;
54320
+ return parseHeaders;
55160
54321
  }
55161
- var normalizeHeaderName;
55162
- var hasRequiredNormalizeHeaderName;
55163
- function requireNormalizeHeaderName() {
55164
- if (hasRequiredNormalizeHeaderName) return normalizeHeaderName;
55165
- hasRequiredNormalizeHeaderName = 1;
54322
+ var isURLSameOrigin;
54323
+ var hasRequiredIsURLSameOrigin;
54324
+ function requireIsURLSameOrigin() {
54325
+ if (hasRequiredIsURLSameOrigin) return isURLSameOrigin;
54326
+ hasRequiredIsURLSameOrigin = 1;
55166
54327
  var utils2 = requireUtils();
55167
- normalizeHeaderName = function normalizeHeaderName2(headers, normalizedName) {
55168
- utils2.forEach(headers, function processHeader(value, name) {
55169
- if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
55170
- headers[normalizedName] = value;
55171
- delete headers[name];
54328
+ isURLSameOrigin = utils2.isStandardBrowserEnv() ? (
54329
+ // Standard browser envs have full support of the APIs needed to test
54330
+ // whether the request URL is of the same origin as current location.
54331
+ function standardBrowserEnv() {
54332
+ var msie = /(msie|trident)/i.test(navigator.userAgent);
54333
+ var urlParsingNode = document.createElement("a");
54334
+ var originURL;
54335
+ function resolveURL(url2) {
54336
+ var href = url2;
54337
+ if (msie) {
54338
+ urlParsingNode.setAttribute("href", href);
54339
+ href = urlParsingNode.href;
54340
+ }
54341
+ urlParsingNode.setAttribute("href", href);
54342
+ return {
54343
+ href: urlParsingNode.href,
54344
+ protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
54345
+ host: urlParsingNode.host,
54346
+ search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
54347
+ hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
54348
+ hostname: urlParsingNode.hostname,
54349
+ port: urlParsingNode.port,
54350
+ pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
54351
+ };
55172
54352
  }
55173
- });
55174
- };
55175
- return normalizeHeaderName;
55176
- }
55177
- var enhanceError;
55178
- var hasRequiredEnhanceError;
55179
- function requireEnhanceError() {
55180
- if (hasRequiredEnhanceError) return enhanceError;
55181
- hasRequiredEnhanceError = 1;
55182
- enhanceError = function enhanceError2(error, config2, code, request2, response) {
55183
- error.config = config2;
55184
- if (code) {
55185
- error.code = code;
55186
- }
55187
- error.request = request2;
55188
- error.response = response;
55189
- error.isAxiosError = true;
55190
- error.toJSON = function toJSON() {
55191
- return {
55192
- // Standard
55193
- message: this.message,
55194
- name: this.name,
55195
- // Microsoft
55196
- description: this.description,
55197
- number: this.number,
55198
- // Mozilla
55199
- fileName: this.fileName,
55200
- lineNumber: this.lineNumber,
55201
- columnNumber: this.columnNumber,
55202
- stack: this.stack,
55203
- // Axios
55204
- config: this.config,
55205
- code: this.code
55206
- };
55207
- };
55208
- return error;
55209
- };
55210
- return enhanceError;
55211
- }
55212
- var createError;
55213
- var hasRequiredCreateError;
55214
- function requireCreateError() {
55215
- if (hasRequiredCreateError) return createError;
55216
- hasRequiredCreateError = 1;
55217
- var enhanceError2 = requireEnhanceError();
55218
- createError = function createError2(message2, config2, code, request2, response) {
55219
- var error = new Error(message2);
55220
- return enhanceError2(error, config2, code, request2, response);
55221
- };
55222
- return createError;
55223
- }
55224
- var settle;
55225
- var hasRequiredSettle;
55226
- function requireSettle() {
55227
- if (hasRequiredSettle) return settle;
55228
- hasRequiredSettle = 1;
55229
- var createError2 = requireCreateError();
55230
- settle = function settle2(resolve, reject, response) {
55231
- var validateStatus = response.config.validateStatus;
55232
- if (!response.status || !validateStatus || validateStatus(response.status)) {
55233
- resolve(response);
55234
- } else {
55235
- reject(createError2(
55236
- "Request failed with status code " + response.status,
55237
- response.config,
55238
- null,
55239
- response.request,
55240
- response
55241
- ));
55242
- }
55243
- };
55244
- return settle;
55245
- }
55246
- var cookies;
55247
- var hasRequiredCookies;
55248
- function requireCookies() {
55249
- if (hasRequiredCookies) return cookies;
55250
- hasRequiredCookies = 1;
55251
- var utils2 = requireUtils();
55252
- cookies = utils2.isStandardBrowserEnv() ? (
55253
- // Standard browser envs support document.cookie
55254
- /* @__PURE__ */ function standardBrowserEnv() {
55255
- return {
55256
- write: function write(name, value, expires, path2, domain, secure) {
55257
- var cookie2 = [];
55258
- cookie2.push(name + "=" + encodeURIComponent(value));
55259
- if (utils2.isNumber(expires)) {
55260
- cookie2.push("expires=" + new Date(expires).toGMTString());
55261
- }
55262
- if (utils2.isString(path2)) {
55263
- cookie2.push("path=" + path2);
55264
- }
55265
- if (utils2.isString(domain)) {
55266
- cookie2.push("domain=" + domain);
55267
- }
55268
- if (secure === true) {
55269
- cookie2.push("secure");
55270
- }
55271
- document.cookie = cookie2.join("; ");
55272
- },
55273
- read: function read(name) {
55274
- var match2 = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
55275
- return match2 ? decodeURIComponent(match2[3]) : null;
55276
- },
55277
- remove: function remove(name) {
55278
- this.write(name, "", Date.now() - 864e5);
55279
- }
55280
- };
55281
- }()
55282
- ) : (
55283
- // Non standard browser env (web workers, react-native) lack needed support.
55284
- /* @__PURE__ */ function nonStandardBrowserEnv() {
55285
- return {
55286
- write: function write() {
55287
- },
55288
- read: function read() {
55289
- return null;
55290
- },
55291
- remove: function remove() {
55292
- }
55293
- };
55294
- }()
55295
- );
55296
- return cookies;
55297
- }
55298
- var isAbsoluteURL;
55299
- var hasRequiredIsAbsoluteURL;
55300
- function requireIsAbsoluteURL() {
55301
- if (hasRequiredIsAbsoluteURL) return isAbsoluteURL;
55302
- hasRequiredIsAbsoluteURL = 1;
55303
- isAbsoluteURL = function isAbsoluteURL2(url2) {
55304
- return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url2);
55305
- };
55306
- return isAbsoluteURL;
55307
- }
55308
- var combineURLs;
55309
- var hasRequiredCombineURLs;
55310
- function requireCombineURLs() {
55311
- if (hasRequiredCombineURLs) return combineURLs;
55312
- hasRequiredCombineURLs = 1;
55313
- combineURLs = function combineURLs2(baseURL, relativeURL) {
55314
- return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
55315
- };
55316
- return combineURLs;
55317
- }
55318
- var buildFullPath;
55319
- var hasRequiredBuildFullPath;
55320
- function requireBuildFullPath() {
55321
- if (hasRequiredBuildFullPath) return buildFullPath;
55322
- hasRequiredBuildFullPath = 1;
55323
- var isAbsoluteURL2 = requireIsAbsoluteURL();
55324
- var combineURLs2 = requireCombineURLs();
55325
- buildFullPath = function buildFullPath2(baseURL, requestedURL) {
55326
- if (baseURL && !isAbsoluteURL2(requestedURL)) {
55327
- return combineURLs2(baseURL, requestedURL);
55328
- }
55329
- return requestedURL;
55330
- };
55331
- return buildFullPath;
55332
- }
55333
- var parseHeaders;
55334
- var hasRequiredParseHeaders;
55335
- function requireParseHeaders() {
55336
- if (hasRequiredParseHeaders) return parseHeaders;
55337
- hasRequiredParseHeaders = 1;
55338
- var utils2 = requireUtils();
55339
- var ignoreDuplicateOf = [
55340
- "age",
55341
- "authorization",
55342
- "content-length",
55343
- "content-type",
55344
- "etag",
55345
- "expires",
55346
- "from",
55347
- "host",
55348
- "if-modified-since",
55349
- "if-unmodified-since",
55350
- "last-modified",
55351
- "location",
55352
- "max-forwards",
55353
- "proxy-authorization",
55354
- "referer",
55355
- "retry-after",
55356
- "user-agent"
55357
- ];
55358
- parseHeaders = function parseHeaders2(headers) {
55359
- var parsed = {};
55360
- var key2;
55361
- var val;
55362
- var i;
55363
- if (!headers) {
55364
- return parsed;
55365
- }
55366
- utils2.forEach(headers.split("\n"), function parser(line) {
55367
- i = line.indexOf(":");
55368
- key2 = utils2.trim(line.substr(0, i)).toLowerCase();
55369
- val = utils2.trim(line.substr(i + 1));
55370
- if (key2) {
55371
- if (parsed[key2] && ignoreDuplicateOf.indexOf(key2) >= 0) {
55372
- return;
55373
- }
55374
- if (key2 === "set-cookie") {
55375
- parsed[key2] = (parsed[key2] ? parsed[key2] : []).concat([val]);
55376
- } else {
55377
- parsed[key2] = parsed[key2] ? parsed[key2] + ", " + val : val;
55378
- }
55379
- }
55380
- });
55381
- return parsed;
55382
- };
55383
- return parseHeaders;
55384
- }
55385
- var isURLSameOrigin;
55386
- var hasRequiredIsURLSameOrigin;
55387
- function requireIsURLSameOrigin() {
55388
- if (hasRequiredIsURLSameOrigin) return isURLSameOrigin;
55389
- hasRequiredIsURLSameOrigin = 1;
55390
- var utils2 = requireUtils();
55391
- isURLSameOrigin = utils2.isStandardBrowserEnv() ? (
55392
- // Standard browser envs have full support of the APIs needed to test
55393
- // whether the request URL is of the same origin as current location.
55394
- function standardBrowserEnv() {
55395
- var msie = /(msie|trident)/i.test(navigator.userAgent);
55396
- var urlParsingNode = document.createElement("a");
55397
- var originURL;
55398
- function resolveURL(url2) {
55399
- var href = url2;
55400
- if (msie) {
55401
- urlParsingNode.setAttribute("href", href);
55402
- href = urlParsingNode.href;
55403
- }
55404
- urlParsingNode.setAttribute("href", href);
55405
- return {
55406
- href: urlParsingNode.href,
55407
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
55408
- host: urlParsingNode.host,
55409
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
55410
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
55411
- hostname: urlParsingNode.hostname,
55412
- port: urlParsingNode.port,
55413
- pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
55414
- };
55415
- }
55416
- originURL = resolveURL(window.location.href);
55417
- return function isURLSameOrigin2(requestURL) {
55418
- var parsed = utils2.isString(requestURL) ? resolveURL(requestURL) : requestURL;
55419
- return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
55420
- };
55421
- }()
55422
- ) : (
55423
- // Non standard browser envs (web workers, react-native) lack needed support.
55424
- /* @__PURE__ */ function nonStandardBrowserEnv() {
55425
- return function isURLSameOrigin2() {
55426
- return true;
55427
- };
55428
- }()
55429
- );
55430
- return isURLSameOrigin;
54353
+ originURL = resolveURL(window.location.href);
54354
+ return function isURLSameOrigin2(requestURL) {
54355
+ var parsed = utils2.isString(requestURL) ? resolveURL(requestURL) : requestURL;
54356
+ return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
54357
+ };
54358
+ }()
54359
+ ) : (
54360
+ // Non standard browser envs (web workers, react-native) lack needed support.
54361
+ /* @__PURE__ */ function nonStandardBrowserEnv() {
54362
+ return function isURLSameOrigin2() {
54363
+ return true;
54364
+ };
54365
+ }()
54366
+ );
54367
+ return isURLSameOrigin;
55431
54368
  }
55432
54369
  var xhr;
55433
54370
  var hasRequiredXhr;
@@ -55749,408 +54686,1501 @@ Try polyfilling it using "@formatjs/intl-displaynames"
55749
54686
  config2.transformResponse
55750
54687
  );
55751
54688
  }
55752
- }
55753
- return Promise.reject(reason);
55754
- });
55755
- };
55756
- return dispatchRequest;
55757
- }
55758
- var mergeConfig;
55759
- var hasRequiredMergeConfig;
55760
- function requireMergeConfig() {
55761
- if (hasRequiredMergeConfig) return mergeConfig;
55762
- hasRequiredMergeConfig = 1;
55763
- var utils2 = requireUtils();
55764
- mergeConfig = function mergeConfig2(config1, config2) {
55765
- config2 = config2 || {};
55766
- var config3 = {};
55767
- var valueFromConfig2Keys = ["url", "method", "data"];
55768
- var mergeDeepPropertiesKeys = ["headers", "auth", "proxy", "params"];
55769
- var defaultToConfig2Keys = [
55770
- "baseURL",
55771
- "transformRequest",
55772
- "transformResponse",
55773
- "paramsSerializer",
55774
- "timeout",
55775
- "timeoutMessage",
55776
- "withCredentials",
55777
- "adapter",
55778
- "responseType",
55779
- "xsrfCookieName",
55780
- "xsrfHeaderName",
55781
- "onUploadProgress",
55782
- "onDownloadProgress",
55783
- "decompress",
55784
- "maxContentLength",
55785
- "maxBodyLength",
55786
- "maxRedirects",
55787
- "transport",
55788
- "httpAgent",
55789
- "httpsAgent",
55790
- "cancelToken",
55791
- "socketPath",
55792
- "responseEncoding"
55793
- ];
55794
- var directMergeKeys = ["validateStatus"];
55795
- function getMergedValue(target, source) {
55796
- if (utils2.isPlainObject(target) && utils2.isPlainObject(source)) {
55797
- return utils2.merge(target, source);
55798
- } else if (utils2.isPlainObject(source)) {
55799
- return utils2.merge({}, source);
55800
- } else if (utils2.isArray(source)) {
55801
- return source.slice();
55802
- }
55803
- return source;
55804
- }
55805
- function mergeDeepProperties(prop) {
55806
- if (!utils2.isUndefined(config2[prop])) {
55807
- config3[prop] = getMergedValue(config1[prop], config2[prop]);
55808
- } else if (!utils2.isUndefined(config1[prop])) {
55809
- config3[prop] = getMergedValue(void 0, config1[prop]);
55810
- }
55811
- }
55812
- utils2.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
55813
- if (!utils2.isUndefined(config2[prop])) {
55814
- config3[prop] = getMergedValue(void 0, config2[prop]);
55815
- }
55816
- });
55817
- utils2.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
55818
- utils2.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
55819
- if (!utils2.isUndefined(config2[prop])) {
55820
- config3[prop] = getMergedValue(void 0, config2[prop]);
55821
- } else if (!utils2.isUndefined(config1[prop])) {
55822
- config3[prop] = getMergedValue(void 0, config1[prop]);
55823
- }
55824
- });
55825
- utils2.forEach(directMergeKeys, function merge2(prop) {
55826
- if (prop in config2) {
55827
- config3[prop] = getMergedValue(config1[prop], config2[prop]);
55828
- } else if (prop in config1) {
55829
- config3[prop] = getMergedValue(void 0, config1[prop]);
55830
- }
55831
- });
55832
- var axiosKeys = valueFromConfig2Keys.concat(mergeDeepPropertiesKeys).concat(defaultToConfig2Keys).concat(directMergeKeys);
55833
- var otherKeys = Object.keys(config1).concat(Object.keys(config2)).filter(function filterAxiosKeys(key2) {
55834
- return axiosKeys.indexOf(key2) === -1;
55835
- });
55836
- utils2.forEach(otherKeys, mergeDeepProperties);
55837
- return config3;
55838
- };
55839
- return mergeConfig;
55840
- }
55841
- const version = "0.21.4";
55842
- const require$$0 = {
55843
- version
55844
- };
55845
- var validator;
55846
- var hasRequiredValidator;
55847
- function requireValidator() {
55848
- if (hasRequiredValidator) return validator;
55849
- hasRequiredValidator = 1;
55850
- var pkg = require$$0;
55851
- var validators = {};
55852
- ["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i) {
55853
- validators[type] = function validator2(thing) {
55854
- return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
55855
- };
55856
- });
55857
- var deprecatedWarnings = {};
55858
- var currentVerArr = pkg.version.split(".");
55859
- function isOlderVersion(version2, thanVersion) {
55860
- var pkgVersionArr = thanVersion ? thanVersion.split(".") : currentVerArr;
55861
- var destVer = version2.split(".");
55862
- for (var i = 0; i < 3; i++) {
55863
- if (pkgVersionArr[i] > destVer[i]) {
55864
- return true;
55865
- } else if (pkgVersionArr[i] < destVer[i]) {
55866
- return false;
55867
- }
55868
- }
55869
- return false;
55870
- }
55871
- validators.transitional = function transitional(validator2, version2, message2) {
55872
- var isDeprecated = version2 && isOlderVersion(version2);
55873
- function formatMessage2(opt, desc) {
55874
- return "[Axios v" + pkg.version + "] Transitional option '" + opt + "'" + desc + (message2 ? ". " + message2 : "");
55875
- }
55876
- return function(value, opt, opts) {
55877
- if (validator2 === false) {
55878
- throw new Error(formatMessage2(opt, " has been removed in " + version2));
55879
- }
55880
- if (isDeprecated && !deprecatedWarnings[opt]) {
55881
- deprecatedWarnings[opt] = true;
55882
- console.warn(
55883
- formatMessage2(
55884
- opt,
55885
- " has been deprecated since v" + version2 + " and will be removed in the near future"
55886
- )
55887
- );
55888
- }
55889
- return validator2 ? validator2(value, opt, opts) : true;
55890
- };
55891
- };
55892
- function assertOptions(options, schema, allowUnknown) {
55893
- if (typeof options !== "object") {
55894
- throw new TypeError("options must be an object");
55895
- }
55896
- var keys2 = Object.keys(options);
55897
- var i = keys2.length;
55898
- while (i-- > 0) {
55899
- var opt = keys2[i];
55900
- var validator2 = schema[opt];
55901
- if (validator2) {
55902
- var value = options[opt];
55903
- var result = value === void 0 || validator2(value, opt, options);
55904
- if (result !== true) {
55905
- throw new TypeError("option " + opt + " must be " + result);
55906
- }
55907
- continue;
55908
- }
55909
- if (allowUnknown !== true) {
55910
- throw Error("Unknown option " + opt);
55911
- }
55912
- }
55913
- }
55914
- validator = {
55915
- isOlderVersion,
55916
- assertOptions,
55917
- validators
55918
- };
55919
- return validator;
55920
- }
55921
- var Axios_1;
55922
- var hasRequiredAxios$2;
55923
- function requireAxios$2() {
55924
- if (hasRequiredAxios$2) return Axios_1;
55925
- hasRequiredAxios$2 = 1;
55926
- var utils2 = requireUtils();
55927
- var buildURL2 = requireBuildURL();
55928
- var InterceptorManager = requireInterceptorManager();
55929
- var dispatchRequest2 = requireDispatchRequest();
55930
- var mergeConfig2 = requireMergeConfig();
55931
- var validator2 = requireValidator();
55932
- var validators = validator2.validators;
55933
- function Axios(instanceConfig) {
55934
- this.defaults = instanceConfig;
55935
- this.interceptors = {
55936
- request: new InterceptorManager(),
55937
- response: new InterceptorManager()
55938
- };
55939
- }
55940
- Axios.prototype.request = function request2(config2) {
55941
- if (typeof config2 === "string") {
55942
- config2 = arguments[1] || {};
55943
- config2.url = arguments[0];
55944
- } else {
55945
- config2 = config2 || {};
55946
- }
55947
- config2 = mergeConfig2(this.defaults, config2);
55948
- if (config2.method) {
55949
- config2.method = config2.method.toLowerCase();
55950
- } else if (this.defaults.method) {
55951
- config2.method = this.defaults.method.toLowerCase();
55952
- } else {
55953
- config2.method = "get";
55954
- }
55955
- var transitional = config2.transitional;
55956
- if (transitional !== void 0) {
55957
- validator2.assertOptions(transitional, {
55958
- silentJSONParsing: validators.transitional(validators.boolean, "1.0.0"),
55959
- forcedJSONParsing: validators.transitional(validators.boolean, "1.0.0"),
55960
- clarifyTimeoutError: validators.transitional(validators.boolean, "1.0.0")
55961
- }, false);
55962
- }
55963
- var requestInterceptorChain = [];
55964
- var synchronousRequestInterceptors = true;
55965
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
55966
- if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config2) === false) {
55967
- return;
55968
- }
55969
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
55970
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
55971
- });
55972
- var responseInterceptorChain = [];
55973
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
55974
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
55975
- });
55976
- var promise;
55977
- if (!synchronousRequestInterceptors) {
55978
- var chain = [dispatchRequest2, void 0];
55979
- Array.prototype.unshift.apply(chain, requestInterceptorChain);
55980
- chain = chain.concat(responseInterceptorChain);
55981
- promise = Promise.resolve(config2);
55982
- while (chain.length) {
55983
- promise = promise.then(chain.shift(), chain.shift());
55984
- }
55985
- return promise;
55986
- }
55987
- var newConfig = config2;
55988
- while (requestInterceptorChain.length) {
55989
- var onFulfilled = requestInterceptorChain.shift();
55990
- var onRejected = requestInterceptorChain.shift();
55991
- try {
55992
- newConfig = onFulfilled(newConfig);
55993
- } catch (error) {
55994
- onRejected(error);
55995
- break;
54689
+ }
54690
+ return Promise.reject(reason);
54691
+ });
54692
+ };
54693
+ return dispatchRequest;
54694
+ }
54695
+ var mergeConfig;
54696
+ var hasRequiredMergeConfig;
54697
+ function requireMergeConfig() {
54698
+ if (hasRequiredMergeConfig) return mergeConfig;
54699
+ hasRequiredMergeConfig = 1;
54700
+ var utils2 = requireUtils();
54701
+ mergeConfig = function mergeConfig2(config1, config2) {
54702
+ config2 = config2 || {};
54703
+ var config3 = {};
54704
+ var valueFromConfig2Keys = ["url", "method", "data"];
54705
+ var mergeDeepPropertiesKeys = ["headers", "auth", "proxy", "params"];
54706
+ var defaultToConfig2Keys = [
54707
+ "baseURL",
54708
+ "transformRequest",
54709
+ "transformResponse",
54710
+ "paramsSerializer",
54711
+ "timeout",
54712
+ "timeoutMessage",
54713
+ "withCredentials",
54714
+ "adapter",
54715
+ "responseType",
54716
+ "xsrfCookieName",
54717
+ "xsrfHeaderName",
54718
+ "onUploadProgress",
54719
+ "onDownloadProgress",
54720
+ "decompress",
54721
+ "maxContentLength",
54722
+ "maxBodyLength",
54723
+ "maxRedirects",
54724
+ "transport",
54725
+ "httpAgent",
54726
+ "httpsAgent",
54727
+ "cancelToken",
54728
+ "socketPath",
54729
+ "responseEncoding"
54730
+ ];
54731
+ var directMergeKeys = ["validateStatus"];
54732
+ function getMergedValue(target, source) {
54733
+ if (utils2.isPlainObject(target) && utils2.isPlainObject(source)) {
54734
+ return utils2.merge(target, source);
54735
+ } else if (utils2.isPlainObject(source)) {
54736
+ return utils2.merge({}, source);
54737
+ } else if (utils2.isArray(source)) {
54738
+ return source.slice();
54739
+ }
54740
+ return source;
54741
+ }
54742
+ function mergeDeepProperties(prop) {
54743
+ if (!utils2.isUndefined(config2[prop])) {
54744
+ config3[prop] = getMergedValue(config1[prop], config2[prop]);
54745
+ } else if (!utils2.isUndefined(config1[prop])) {
54746
+ config3[prop] = getMergedValue(void 0, config1[prop]);
54747
+ }
54748
+ }
54749
+ utils2.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
54750
+ if (!utils2.isUndefined(config2[prop])) {
54751
+ config3[prop] = getMergedValue(void 0, config2[prop]);
54752
+ }
54753
+ });
54754
+ utils2.forEach(mergeDeepPropertiesKeys, mergeDeepProperties);
54755
+ utils2.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
54756
+ if (!utils2.isUndefined(config2[prop])) {
54757
+ config3[prop] = getMergedValue(void 0, config2[prop]);
54758
+ } else if (!utils2.isUndefined(config1[prop])) {
54759
+ config3[prop] = getMergedValue(void 0, config1[prop]);
54760
+ }
54761
+ });
54762
+ utils2.forEach(directMergeKeys, function merge2(prop) {
54763
+ if (prop in config2) {
54764
+ config3[prop] = getMergedValue(config1[prop], config2[prop]);
54765
+ } else if (prop in config1) {
54766
+ config3[prop] = getMergedValue(void 0, config1[prop]);
54767
+ }
54768
+ });
54769
+ var axiosKeys = valueFromConfig2Keys.concat(mergeDeepPropertiesKeys).concat(defaultToConfig2Keys).concat(directMergeKeys);
54770
+ var otherKeys = Object.keys(config1).concat(Object.keys(config2)).filter(function filterAxiosKeys(key2) {
54771
+ return axiosKeys.indexOf(key2) === -1;
54772
+ });
54773
+ utils2.forEach(otherKeys, mergeDeepProperties);
54774
+ return config3;
54775
+ };
54776
+ return mergeConfig;
54777
+ }
54778
+ const version = "0.21.4";
54779
+ const require$$0 = {
54780
+ version
54781
+ };
54782
+ var validator;
54783
+ var hasRequiredValidator;
54784
+ function requireValidator() {
54785
+ if (hasRequiredValidator) return validator;
54786
+ hasRequiredValidator = 1;
54787
+ var pkg = require$$0;
54788
+ var validators = {};
54789
+ ["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i) {
54790
+ validators[type] = function validator2(thing) {
54791
+ return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
54792
+ };
54793
+ });
54794
+ var deprecatedWarnings = {};
54795
+ var currentVerArr = pkg.version.split(".");
54796
+ function isOlderVersion(version2, thanVersion) {
54797
+ var pkgVersionArr = thanVersion ? thanVersion.split(".") : currentVerArr;
54798
+ var destVer = version2.split(".");
54799
+ for (var i = 0; i < 3; i++) {
54800
+ if (pkgVersionArr[i] > destVer[i]) {
54801
+ return true;
54802
+ } else if (pkgVersionArr[i] < destVer[i]) {
54803
+ return false;
54804
+ }
54805
+ }
54806
+ return false;
54807
+ }
54808
+ validators.transitional = function transitional(validator2, version2, message2) {
54809
+ var isDeprecated = version2 && isOlderVersion(version2);
54810
+ function formatMessage2(opt, desc) {
54811
+ return "[Axios v" + pkg.version + "] Transitional option '" + opt + "'" + desc + (message2 ? ". " + message2 : "");
54812
+ }
54813
+ return function(value, opt, opts) {
54814
+ if (validator2 === false) {
54815
+ throw new Error(formatMessage2(opt, " has been removed in " + version2));
54816
+ }
54817
+ if (isDeprecated && !deprecatedWarnings[opt]) {
54818
+ deprecatedWarnings[opt] = true;
54819
+ console.warn(
54820
+ formatMessage2(
54821
+ opt,
54822
+ " has been deprecated since v" + version2 + " and will be removed in the near future"
54823
+ )
54824
+ );
54825
+ }
54826
+ return validator2 ? validator2(value, opt, opts) : true;
54827
+ };
54828
+ };
54829
+ function assertOptions(options, schema, allowUnknown) {
54830
+ if (typeof options !== "object") {
54831
+ throw new TypeError("options must be an object");
54832
+ }
54833
+ var keys2 = Object.keys(options);
54834
+ var i = keys2.length;
54835
+ while (i-- > 0) {
54836
+ var opt = keys2[i];
54837
+ var validator2 = schema[opt];
54838
+ if (validator2) {
54839
+ var value = options[opt];
54840
+ var result = value === void 0 || validator2(value, opt, options);
54841
+ if (result !== true) {
54842
+ throw new TypeError("option " + opt + " must be " + result);
54843
+ }
54844
+ continue;
54845
+ }
54846
+ if (allowUnknown !== true) {
54847
+ throw Error("Unknown option " + opt);
54848
+ }
54849
+ }
54850
+ }
54851
+ validator = {
54852
+ isOlderVersion,
54853
+ assertOptions,
54854
+ validators
54855
+ };
54856
+ return validator;
54857
+ }
54858
+ var Axios_1;
54859
+ var hasRequiredAxios$2;
54860
+ function requireAxios$2() {
54861
+ if (hasRequiredAxios$2) return Axios_1;
54862
+ hasRequiredAxios$2 = 1;
54863
+ var utils2 = requireUtils();
54864
+ var buildURL2 = requireBuildURL();
54865
+ var InterceptorManager = requireInterceptorManager();
54866
+ var dispatchRequest2 = requireDispatchRequest();
54867
+ var mergeConfig2 = requireMergeConfig();
54868
+ var validator2 = requireValidator();
54869
+ var validators = validator2.validators;
54870
+ function Axios(instanceConfig) {
54871
+ this.defaults = instanceConfig;
54872
+ this.interceptors = {
54873
+ request: new InterceptorManager(),
54874
+ response: new InterceptorManager()
54875
+ };
54876
+ }
54877
+ Axios.prototype.request = function request2(config2) {
54878
+ if (typeof config2 === "string") {
54879
+ config2 = arguments[1] || {};
54880
+ config2.url = arguments[0];
54881
+ } else {
54882
+ config2 = config2 || {};
54883
+ }
54884
+ config2 = mergeConfig2(this.defaults, config2);
54885
+ if (config2.method) {
54886
+ config2.method = config2.method.toLowerCase();
54887
+ } else if (this.defaults.method) {
54888
+ config2.method = this.defaults.method.toLowerCase();
54889
+ } else {
54890
+ config2.method = "get";
54891
+ }
54892
+ var transitional = config2.transitional;
54893
+ if (transitional !== void 0) {
54894
+ validator2.assertOptions(transitional, {
54895
+ silentJSONParsing: validators.transitional(validators.boolean, "1.0.0"),
54896
+ forcedJSONParsing: validators.transitional(validators.boolean, "1.0.0"),
54897
+ clarifyTimeoutError: validators.transitional(validators.boolean, "1.0.0")
54898
+ }, false);
54899
+ }
54900
+ var requestInterceptorChain = [];
54901
+ var synchronousRequestInterceptors = true;
54902
+ this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
54903
+ if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config2) === false) {
54904
+ return;
54905
+ }
54906
+ synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
54907
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
54908
+ });
54909
+ var responseInterceptorChain = [];
54910
+ this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
54911
+ responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
54912
+ });
54913
+ var promise;
54914
+ if (!synchronousRequestInterceptors) {
54915
+ var chain = [dispatchRequest2, void 0];
54916
+ Array.prototype.unshift.apply(chain, requestInterceptorChain);
54917
+ chain = chain.concat(responseInterceptorChain);
54918
+ promise = Promise.resolve(config2);
54919
+ while (chain.length) {
54920
+ promise = promise.then(chain.shift(), chain.shift());
54921
+ }
54922
+ return promise;
54923
+ }
54924
+ var newConfig = config2;
54925
+ while (requestInterceptorChain.length) {
54926
+ var onFulfilled = requestInterceptorChain.shift();
54927
+ var onRejected = requestInterceptorChain.shift();
54928
+ try {
54929
+ newConfig = onFulfilled(newConfig);
54930
+ } catch (error) {
54931
+ onRejected(error);
54932
+ break;
54933
+ }
54934
+ }
54935
+ try {
54936
+ promise = dispatchRequest2(newConfig);
54937
+ } catch (error) {
54938
+ return Promise.reject(error);
54939
+ }
54940
+ while (responseInterceptorChain.length) {
54941
+ promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
54942
+ }
54943
+ return promise;
54944
+ };
54945
+ Axios.prototype.getUri = function getUri(config2) {
54946
+ config2 = mergeConfig2(this.defaults, config2);
54947
+ return buildURL2(config2.url, config2.params, config2.paramsSerializer).replace(/^\?/, "");
54948
+ };
54949
+ utils2.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
54950
+ Axios.prototype[method] = function(url2, config2) {
54951
+ return this.request(mergeConfig2(config2 || {}, {
54952
+ method,
54953
+ url: url2,
54954
+ data: (config2 || {}).data
54955
+ }));
54956
+ };
54957
+ });
54958
+ utils2.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
54959
+ Axios.prototype[method] = function(url2, data2, config2) {
54960
+ return this.request(mergeConfig2(config2 || {}, {
54961
+ method,
54962
+ url: url2,
54963
+ data: data2
54964
+ }));
54965
+ };
54966
+ });
54967
+ Axios_1 = Axios;
54968
+ return Axios_1;
54969
+ }
54970
+ var Cancel_1;
54971
+ var hasRequiredCancel;
54972
+ function requireCancel() {
54973
+ if (hasRequiredCancel) return Cancel_1;
54974
+ hasRequiredCancel = 1;
54975
+ function Cancel(message2) {
54976
+ this.message = message2;
54977
+ }
54978
+ Cancel.prototype.toString = function toString2() {
54979
+ return "Cancel" + (this.message ? ": " + this.message : "");
54980
+ };
54981
+ Cancel.prototype.__CANCEL__ = true;
54982
+ Cancel_1 = Cancel;
54983
+ return Cancel_1;
54984
+ }
54985
+ var CancelToken_1;
54986
+ var hasRequiredCancelToken;
54987
+ function requireCancelToken() {
54988
+ if (hasRequiredCancelToken) return CancelToken_1;
54989
+ hasRequiredCancelToken = 1;
54990
+ var Cancel = requireCancel();
54991
+ function CancelToken(executor) {
54992
+ if (typeof executor !== "function") {
54993
+ throw new TypeError("executor must be a function.");
54994
+ }
54995
+ var resolvePromise;
54996
+ this.promise = new Promise(function promiseExecutor(resolve) {
54997
+ resolvePromise = resolve;
54998
+ });
54999
+ var token = this;
55000
+ executor(function cancel(message2) {
55001
+ if (token.reason) {
55002
+ return;
55003
+ }
55004
+ token.reason = new Cancel(message2);
55005
+ resolvePromise(token.reason);
55006
+ });
55007
+ }
55008
+ CancelToken.prototype.throwIfRequested = function throwIfRequested() {
55009
+ if (this.reason) {
55010
+ throw this.reason;
55011
+ }
55012
+ };
55013
+ CancelToken.source = function source() {
55014
+ var cancel;
55015
+ var token = new CancelToken(function executor(c) {
55016
+ cancel = c;
55017
+ });
55018
+ return {
55019
+ token,
55020
+ cancel
55021
+ };
55022
+ };
55023
+ CancelToken_1 = CancelToken;
55024
+ return CancelToken_1;
55025
+ }
55026
+ var spread;
55027
+ var hasRequiredSpread;
55028
+ function requireSpread() {
55029
+ if (hasRequiredSpread) return spread;
55030
+ hasRequiredSpread = 1;
55031
+ spread = function spread2(callback) {
55032
+ return function wrap(arr2) {
55033
+ return callback.apply(null, arr2);
55034
+ };
55035
+ };
55036
+ return spread;
55037
+ }
55038
+ var isAxiosError;
55039
+ var hasRequiredIsAxiosError;
55040
+ function requireIsAxiosError() {
55041
+ if (hasRequiredIsAxiosError) return isAxiosError;
55042
+ hasRequiredIsAxiosError = 1;
55043
+ isAxiosError = function isAxiosError2(payload) {
55044
+ return typeof payload === "object" && payload.isAxiosError === true;
55045
+ };
55046
+ return isAxiosError;
55047
+ }
55048
+ var hasRequiredAxios$1;
55049
+ function requireAxios$1() {
55050
+ if (hasRequiredAxios$1) return axios$2.exports;
55051
+ hasRequiredAxios$1 = 1;
55052
+ var utils2 = requireUtils();
55053
+ var bind2 = requireBind();
55054
+ var Axios = requireAxios$2();
55055
+ var mergeConfig2 = requireMergeConfig();
55056
+ var defaults2 = requireDefaults();
55057
+ function createInstance(defaultConfig) {
55058
+ var context = new Axios(defaultConfig);
55059
+ var instance2 = bind2(Axios.prototype.request, context);
55060
+ utils2.extend(instance2, Axios.prototype, context);
55061
+ utils2.extend(instance2, context);
55062
+ return instance2;
55063
+ }
55064
+ var axios2 = createInstance(defaults2);
55065
+ axios2.Axios = Axios;
55066
+ axios2.create = function create(instanceConfig) {
55067
+ return createInstance(mergeConfig2(axios2.defaults, instanceConfig));
55068
+ };
55069
+ axios2.Cancel = requireCancel();
55070
+ axios2.CancelToken = requireCancelToken();
55071
+ axios2.isCancel = requireIsCancel();
55072
+ axios2.all = function all(promises) {
55073
+ return Promise.all(promises);
55074
+ };
55075
+ axios2.spread = requireSpread();
55076
+ axios2.isAxiosError = requireIsAxiosError();
55077
+ axios$2.exports = axios2;
55078
+ axios$2.exports.default = axios2;
55079
+ return axios$2.exports;
55080
+ }
55081
+ var axios$1;
55082
+ var hasRequiredAxios;
55083
+ function requireAxios() {
55084
+ if (hasRequiredAxios) return axios$1;
55085
+ hasRequiredAxios = 1;
55086
+ axios$1 = requireAxios$1();
55087
+ return axios$1;
55088
+ }
55089
+ var axiosExports = requireAxios();
55090
+ const axios = /* @__PURE__ */ getDefaultExportFromCjs(axiosExports);
55091
+ const AppView = () => {
55092
+ const { appId } = useParams();
55093
+ const navigate = useNavigate();
55094
+ reactExports.useEffect(() => {
55095
+ const fetchData = async () => {
55096
+ var _a2, _b2;
55097
+ try {
55098
+ const response = await axios.get(
55099
+ `/service/api/apps/${appId}/menus`
55100
+ );
55101
+ const data2 = response.data;
55102
+ if ((data2 == null ? void 0 : data2.children.length) > 0 && data2.children[0].path) {
55103
+ const children = _.sortBy(data2.children, ["index"]);
55104
+ navigate(children[0].path);
55105
+ }
55106
+ } catch (error) {
55107
+ console.error("Error fetching data:", error);
55108
+ if (axios.isAxiosError(error)) {
55109
+ console.error("Axios error details:", {
55110
+ message: error.message,
55111
+ code: error.code,
55112
+ status: (_a2 = error.response) == null ? void 0 : _a2.status,
55113
+ data: (_b2 = error.response) == null ? void 0 : _b2.data
55114
+ });
55115
+ }
55116
+ }
55117
+ };
55118
+ if (appId) {
55119
+ fetchData();
55120
+ }
55121
+ }, [appId, navigate]);
55122
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {});
55123
+ };
55124
+ const AppHeader = () => {
55125
+ var _a2, _b2, _c, _d, _e, _f, _g, _h;
55126
+ const params = useParams();
55127
+ let { appId = null, objectName } = params;
55128
+ if (!appId) {
55129
+ document.body.classList.remove("sidebar-open");
55130
+ }
55131
+ const isMobile = window.innerWidth < 1024;
55132
+ let logoSrc = `/images/logo_platform.png`;
55133
+ if ((_d = (_c = (_b2 = (_a2 = Builder$1.settings) == null ? void 0 : _a2.context) == null ? void 0 : _b2.user) == null ? void 0 : _c.space) == null ? void 0 : _d.avatar) {
55134
+ logoSrc = "/api/v6/files/cfs.avatars.filerecord/" + Builder$1.settings.context.user.space.avatar;
55135
+ }
55136
+ const faviconLink = document.querySelector('link[rel*="icon"], link[rel*="shortcut"]');
55137
+ let favicon = "/favicons/favicon.ico";
55138
+ if ((_h = (_g = (_f = (_e = Builder$1.settings) == null ? void 0 : _e.context) == null ? void 0 : _f.user) == null ? void 0 : _g.space) == null ? void 0 : _h.favicon) {
55139
+ favicon = "/api/v6/files/cfs.avatars.filerecord/" + Builder$1.settings.context.user.space.favicon;
55140
+ }
55141
+ if (faviconLink) {
55142
+ faviconLink.href = favicon;
55143
+ } else {
55144
+ const newFaviconLink = document.createElement("link");
55145
+ newFaviconLink.rel = "icon";
55146
+ newFaviconLink.href = favicon;
55147
+ document.head.appendChild(newFaviconLink);
55148
+ }
55149
+ const schema = {
55150
+ "type": "service",
55151
+ name: "globalHeader",
55152
+ body: [
55153
+ {
55154
+ "type": "steedos-global-header",
55155
+ "logoSrc": logoSrc,
55156
+ "customButtons": [
55157
+ {
55158
+ "type": "steedos-app-launcher",
55159
+ "showAppName": false,
55160
+ "appId": "${app.id}",
55161
+ "visibleOn": "${isMobile}"
55162
+ }
55163
+ ]
55164
+ }
55165
+ ],
55166
+ "api": {
55167
+ "method": "get",
55168
+ "cache": "10000",
55169
+ "url": "/service/api/apps/${appId}/menus?mobile=" + isMobile,
55170
+ "sendOn": "!!appId",
55171
+ "headers": {
55172
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
55173
+ },
55174
+ "adaptor": `
55175
+ const app = payload;
55176
+ if (app.showSidebar){
55177
+ document.body.classList.add('sidebar')
55178
+ } else {
55179
+ document.body.classList.remove("sidebar")
55180
+ }
55181
+
55182
+ if (window.innerWidth >= 768) {
55183
+ document.body.classList.add('sidebar-open')
55184
+ }
55185
+
55186
+ return {
55187
+ app: app
55188
+ }
55189
+ `,
55190
+ "messages": {}
55191
+ }
55192
+ };
55193
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "header", className: "steedos-global-header-root flex-none", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema, data: {
55194
+ context: {
55195
+ ...Builder$1.settings.context,
55196
+ appId,
55197
+ showSidebar: true,
55198
+ stacked: true
55199
+ },
55200
+ appId,
55201
+ showSidebar: true,
55202
+ stacked: true
55203
+ }, env: {} }) });
55204
+ };
55205
+ const GlobalLinkInterceptor = () => {
55206
+ const navigate = useNavigate();
55207
+ reactExports.useEffect(() => {
55208
+ const handleClick = (event2) => {
55209
+ const target = event2.target.closest("a");
55210
+ if (target) {
55211
+ const href = target.getAttribute("href");
55212
+ const targetAttr = target.getAttribute("target");
55213
+ const onclick = target.getAttribute("onclick");
55214
+ if (onclick == "return false;") {
55215
+ return;
55216
+ }
55217
+ const isInternal = href && href.startsWith("/");
55218
+ if (isInternal && targetAttr !== "_blank") {
55219
+ event2.preventDefault();
55220
+ navigate(href);
55221
+ }
55222
+ }
55223
+ };
55224
+ document.addEventListener("click", handleClick);
55225
+ return () => {
55226
+ document.removeEventListener("click", handleClick);
55227
+ };
55228
+ }, [navigate]);
55229
+ return null;
55230
+ };
55231
+ const AppLayout = (props) => {
55232
+ const { children } = props;
55233
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
55234
+ /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalLinkInterceptor, {}),
55235
+ /* @__PURE__ */ jsxRuntimeExports.jsx(AppHeader, {}),
55236
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "creator-content-wrapper", id: "main", children })
55237
+ ] });
55238
+ };
55239
+ const ObjectListView = () => {
55240
+ var _a2;
55241
+ let { appId, objectName, listviewId: listName } = useParams();
55242
+ const uiSchema = window.getUISchemaSync(objectName);
55243
+ if (!listName) {
55244
+ listName = (_a2 = lodashExports.first(lodashExports.values(uiSchema.list_views))) == null ? void 0 : _a2.name;
55245
+ }
55246
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema: {
55247
+ type: "page",
55248
+ bodyClassName: "p-0",
55249
+ body: {
55250
+ "type": "steedos-page-object-control",
55251
+ "name": "steedosPageObjectControl",
55252
+ "data": {
55253
+ objectName,
55254
+ object_name: objectName,
55255
+ pageType: "list",
55256
+ listName: listName || "",
55257
+ display: Steedos.Page.getDisplay(objectName)
55258
+ }
55259
+ },
55260
+ data: {
55261
+ objectName,
55262
+ object_name: objectName,
55263
+ pageType: "list",
55264
+ listName: listName || ""
55265
+ }
55266
+ }, data: {
55267
+ context: {
55268
+ app: appId,
55269
+ appId,
55270
+ app_id: appId,
55271
+ listName: listName || "",
55272
+ ...Builder$1.settings.context
55273
+ },
55274
+ app: appId,
55275
+ appId,
55276
+ app_id: appId,
55277
+ listName: listName || "",
55278
+ objectName,
55279
+ object_name: objectName
55280
+ }, env: {} });
55281
+ };
55282
+ const ObjectDetail = () => {
55283
+ const { appId, objectName, recordId } = useParams();
55284
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema: {
55285
+ type: "page",
55286
+ bodyClassName: "p-0",
55287
+ body: {
55288
+ "type": "steedos-page-object-control",
55289
+ "name": "steedosPageObjectControl",
55290
+ "data": {
55291
+ objectName,
55292
+ object_name: objectName,
55293
+ pageType: "record",
55294
+ recordId,
55295
+ display: Steedos.Page.getDisplay(objectName)
55296
+ }
55297
+ },
55298
+ data: {
55299
+ objectName,
55300
+ object_name: objectName,
55301
+ pageType: "record",
55302
+ recordId
55303
+ }
55304
+ }, data: {
55305
+ context: {
55306
+ app: appId,
55307
+ appId,
55308
+ app_id: appId,
55309
+ ...Builder$1.settings.context
55310
+ },
55311
+ app: appId,
55312
+ appId,
55313
+ app_id: appId
55314
+ }, env: {} });
55315
+ };
55316
+ const PageView = () => {
55317
+ const { appId, pageId } = useParams();
55318
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema: {
55319
+ type: "service",
55320
+ schemaApi: {
55321
+ "method": "get",
55322
+ "url": "/api/pageSchema/app?app=${appId}&pageId=${pageId}&formFactor=${formFactor}",
55323
+ "adaptor": `
55324
+ return {
55325
+ "data": _.isString(payload.schema) ? JSON.parse(payload.schema):payload.schema
55326
+ }
55327
+ `
55328
+ }
55329
+ }, data: {
55330
+ context: {
55331
+ app: appId,
55332
+ appId,
55333
+ app_id: appId,
55334
+ ...Builder$1.settings.context
55335
+ },
55336
+ app: appId,
55337
+ appId,
55338
+ app_id: appId,
55339
+ pageId
55340
+ }, env: {} });
55341
+ };
55342
+ const IframeView = () => {
55343
+ const { appId, tabId } = useParams();
55344
+ const [searchParams] = useSearchParams();
55345
+ const iframeSrc = searchParams.get("url");
55346
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema: {
55347
+ "type": "page",
55348
+ "body": {
55349
+ "type": "iframe",
55350
+ "src": iframeSrc,
55351
+ "height": "100%",
55352
+ "width": "100%"
55353
+ }
55354
+ }, data: {
55355
+ context: {
55356
+ app: appId,
55357
+ appId,
55358
+ app_id: appId,
55359
+ ...Builder$1.settings.context
55360
+ },
55361
+ app: appId,
55362
+ appId,
55363
+ app_id: appId,
55364
+ tabId
55365
+ }, env: {} });
55366
+ };
55367
+ const ObjectRelatedListView = () => {
55368
+ const location2 = useLocation();
55369
+ const queryParams = new URLSearchParams(location2.search);
55370
+ const relatedKey = queryParams.get("related_field_name");
55371
+ const { appId, objectName, listviewId: listName, recordId, relatedObjectName } = useParams();
55372
+ const mainUiSchema = window.getUISchemaSync(objectName);
55373
+ const idFieldName = mainUiSchema.idFieldName;
55374
+ const uiSchema = window.getUISchemaSync(relatedObjectName);
55375
+ const relatedKeyRefToField = uiSchema.fields[relatedKey].reference_to_field || idFieldName || "_id";
55376
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema: {
55377
+ type: "service",
55378
+ name: `amis-${appId}-${objectName}-related-${relatedObjectName}`,
55379
+ api: {
55380
+ method: "post",
55381
+ url: `/graphql`,
55382
+ requestAdaptor: `
55383
+ api.data = {
55384
+ query: \`{
55385
+ data: ${objectName}(filters:["${idFieldName}", "=", "${recordId}"]){
55386
+ ${idFieldName === relatedKeyRefToField ? idFieldName : idFieldName + "," + relatedKeyRefToField},
55387
+ ${mainUiSchema.NAME_FIELD_KEY},
55388
+ locked,
55389
+ recordPermissions: _permissions{
55390
+ allowCreate,
55391
+ allowCreateFiles,
55392
+ allowDelete,
55393
+ allowDeleteFiles,
55394
+ allowEdit,
55395
+ allowEditFiles,
55396
+ allowRead,
55397
+ allowReadFiles,
55398
+ disabled_actions,
55399
+ disabled_list_views,
55400
+ field_permissions,
55401
+ modifyAllFiles,
55402
+ modifyAllRecords,
55403
+ modifyAssignCompanysRecords,
55404
+ modifyCompanyRecords,
55405
+ uneditable_fields,
55406
+ unreadable_fields,
55407
+ unrelated_objects,
55408
+ viewAllFiles,
55409
+ viewAllRecords,
55410
+ viewAssignCompanysRecords,
55411
+ viewCompanyRecords,
55412
+ }
55413
+ }
55414
+ }\`
55415
+ }
55416
+ return api;
55417
+ `,
55418
+ adaptor: `
55419
+ if(payload.data.data){
55420
+ var data = payload.data.data[0];
55421
+ payload.data = data;
55422
+ payload.data._master = {
55423
+ objectName: "${objectName}",
55424
+ recordId: data["${idFieldName}"],
55425
+ record: {
55426
+ "${idFieldName}": data["${idFieldName}"],
55427
+ "${mainUiSchema.NAME_FIELD_KEY}": data["${mainUiSchema.NAME_FIELD_KEY}"],
55428
+ "${relatedKeyRefToField}": data["${relatedKeyRefToField}"],
55429
+ "locked": data.locked
55430
+ }
55431
+ };
55432
+ }
55433
+ payload.data.$breadcrumb = [
55434
+ {
55435
+ "label": "${mainUiSchema.label}",
55436
+ "href": "/app/${appId}/${objectName}"
55437
+ },
55438
+ {
55439
+ "label": payload.data.${mainUiSchema.NAME_FIELD_KEY},
55440
+ "href": "/app/${appId}/${objectName}/view/${recordId}",
55441
+ },
55442
+ {
55443
+ "label": "相关 ${uiSchema.label}"
55444
+ },
55445
+ ]
55446
+ payload.data.$loaded = true;
55447
+ return payload;
55448
+ `,
55449
+ headers: {
55450
+ Authorization: "Bearer ${context.tenantId},${context.authToken}"
55451
+ }
55452
+ },
55453
+ "data": {
55454
+ "&": "$$",
55455
+ "$breadcrumb": []
55456
+ //先给一个空数组, 防止breadcrumb组件报错
55457
+ },
55458
+ body: [
55459
+ {
55460
+ "type": "breadcrumb",
55461
+ "source": "${$breadcrumb}",
55462
+ "className": "mx-4 my-2"
55463
+ },
55464
+ {
55465
+ type: "steedos-object-related-listview",
55466
+ objectApiName: mainUiSchema.name,
55467
+ recordId,
55468
+ relatedObjectApiName: relatedObjectName,
55469
+ foreign_key: relatedKey,
55470
+ relatedKey,
55471
+ hiddenOn: "!!!this.$loaded",
55472
+ "className": "mx-4"
55473
+ // top: 5
55474
+ }
55475
+ // {
55476
+ // type: 'steedos-object-related-listview',
55477
+ // objectApiName: masterObject.name,
55478
+ // recordId: recordId,
55479
+ // relatedObjectApiName: objectApiName,
55480
+ // foreign_key: relatedKey,
55481
+ // relatedKey: relatedKey,
55482
+ // hiddenOn: "!!!this.$loaded"
55483
+ // // top: 5
55484
+ // }
55485
+ ]
55486
+ }, data: {
55487
+ context: {
55488
+ app: appId,
55489
+ appId,
55490
+ app_id: appId,
55491
+ listName: listName || "",
55492
+ ...Builder$1.settings.context
55493
+ },
55494
+ app: appId,
55495
+ appId,
55496
+ app_id: appId,
55497
+ listName: listName || "",
55498
+ objectName,
55499
+ object_name: objectName
55500
+ }, env: {} });
55501
+ };
55502
+ const routes = [
55503
+ {
55504
+ path: "/logout",
55505
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(Logout$1, {})
55506
+ },
55507
+ {
55508
+ path: "/signup",
55509
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(Signup$1, {})
55510
+ },
55511
+ {
55512
+ path: "/login",
55513
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(Login$1, {})
55514
+ },
55515
+ {
55516
+ path: "/",
55517
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(Home, {})
55518
+ },
55519
+ {
55520
+ path: "/create-space",
55521
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CreateTenant$1, {}) })
55522
+ },
55523
+ {
55524
+ path: "/select-space",
55525
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectSpace$1, {}) })
55526
+ },
55527
+ {
55528
+ path: "/update-password",
55529
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(UpdatePassword$1, {}) })
55530
+ },
55531
+ {
55532
+ path: "/verify/email",
55533
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(VerifyEmail$1, {}) })
55534
+ },
55535
+ {
55536
+ path: "/verify/mobile",
55537
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(VerifyMobile$1, {}) })
55538
+ },
55539
+ {
55540
+ path: "/home",
55541
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Home, {}) })
55542
+ },
55543
+ {
55544
+ path: "/home/:spaceId",
55545
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Home, {}) })
55546
+ },
55547
+ {
55548
+ path: "/app",
55549
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppDashboard, {}) }) })
55550
+ },
55551
+ {
55552
+ path: "/app/:appId",
55553
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppView, {}) }) })
55554
+ },
55555
+ {
55556
+ path: "/app/:appId/page/:pageId",
55557
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PageView, {}) }) })
55558
+ },
55559
+ {
55560
+ path: "/app/:appId/:objectName",
55561
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ObjectListView, {}) }) })
55562
+ },
55563
+ {
55564
+ path: "/app/:appId/:objectName/grid/:listviewId",
55565
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ObjectListView, {}) }) })
55566
+ },
55567
+ {
55568
+ path: "/app/:appId/:objectName/:recordId/:relatedObjectName/grid",
55569
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ObjectRelatedListView, {}) }) })
55570
+ },
55571
+ {
55572
+ path: "/app/:appId/:objectName/view/:recordId",
55573
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ObjectDetail, {}) }) })
55574
+ },
55575
+ {
55576
+ path: "/app/:appId/tab_iframe/:tabId",
55577
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(LoggedIn, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppLayout, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(IframeView, {}) }) })
55578
+ }
55579
+ ];
55580
+ const SteedosRouter = () => {
55581
+ const router = createBrowserRouter(routes);
55582
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(RouterProvider2, { router }) });
55583
+ };
55584
+ function loadSettings() {
55585
+ return async (dispatch, getState) => {
55586
+ let data2;
55587
+ try {
55588
+ data2 = await Client4.getSettings();
55589
+ } catch (error) {
55590
+ forceLogoutIfNecessary(error, dispatch, getState);
55591
+ return { error };
55592
+ }
55593
+ Client4.setEnableLogging(data2.EnableDeveloper === "true");
55594
+ Client4.setDiagnosticId(data2.DiagnosticId);
55595
+ Steedos.settings = {
55596
+ public: data2.public
55597
+ };
55598
+ dispatch({
55599
+ type: GeneralTypes.RECEIVED_SETTINGS,
55600
+ data: data2
55601
+ });
55602
+ return { data: data2 };
55603
+ };
55604
+ }
55605
+ const Account = {
55606
+ disabledAccountRegister: () => {
55607
+ var _a2, _b2, _c, _d;
55608
+ return (_d = (_c = (_b2 = (_a2 = window.Tenant) == null ? void 0 : _a2.settings) == null ? void 0 : _b2.public) == null ? void 0 : _c.accounts) == null ? void 0 : _d.disabled_account_register;
55609
+ }
55610
+ };
55611
+ const Space = {
55612
+ get: () => {
55613
+ var _a2;
55614
+ return _.find(Steedos.__hotRecords.spaces, { _id: (_a2 = window.Builder.settings.context) == null ? void 0 : _a2.tenantId });
55615
+ },
55616
+ getMySpaces: () => {
55617
+ return Steedos.__hotRecords.spaces;
55618
+ }
55619
+ };
55620
+ const BaseObject = {
55621
+ base: {
55622
+ actions: {
55623
+ standard_query: {
55624
+ label: "Search",
55625
+ visible: function() {
55626
+ return Steedos.StandardObjects.Base.Actions.standard_query.visible.apply(
55627
+ this,
55628
+ arguments
55629
+ );
55630
+ },
55631
+ on: "list",
55632
+ todo: "standard_query"
55633
+ },
55634
+ standard_new: {
55635
+ label: "New",
55636
+ visible: function(object_name) {
55637
+ return Steedos.StandardObjects.Base.Actions.standard_new.visible.apply(
55638
+ this,
55639
+ arguments
55640
+ );
55641
+ },
55642
+ on: "list",
55643
+ todo: "standard_new"
55644
+ },
55645
+ standard_open_view: {
55646
+ label: "Open",
55647
+ sort: -1,
55648
+ visible: function(object_name, record_id, record_permissions) {
55649
+ return true;
55650
+ },
55651
+ on: "list_item",
55652
+ todo: "standard_open_view"
55653
+ },
55654
+ standard_edit: {
55655
+ label: "Edit",
55656
+ sort: 0,
55657
+ visible: function(object_name, record_id, record_permissions) {
55658
+ return Steedos.StandardObjects.Base.Actions.standard_edit.visible.apply(
55659
+ this,
55660
+ arguments
55661
+ );
55662
+ },
55663
+ on: "record",
55664
+ todo: "standard_edit"
55665
+ },
55666
+ standard_delete: {
55667
+ label: "Delete",
55668
+ visible: function(object_name, record_id, record_permissions) {
55669
+ return Steedos.StandardObjects.Base.Actions.standard_delete.visible.apply(
55670
+ this,
55671
+ arguments
55672
+ );
55673
+ },
55674
+ on: "record_more",
55675
+ todo: "standard_delete"
55676
+ },
55677
+ standard_delete_many: {
55678
+ label: "Delete",
55679
+ visible: function(object_name, record_id, record_permissions) {
55680
+ return Steedos.StandardObjects.Base.Actions.standard_delete_many.visible.apply(
55681
+ this,
55682
+ arguments
55683
+ );
55684
+ },
55685
+ on: "list",
55686
+ todo: function() {
55687
+ return Steedos.StandardObjects.Base.Actions.standard_delete_many.todo.apply(
55688
+ this,
55689
+ arguments
55690
+ );
55691
+ }
55692
+ },
55693
+ // standard_approve: {
55694
+ // label: "Initiate Approval",
55695
+ // visible: function (object_name, record_id, record_permissions) {
55696
+ // return Steedos.StandardObjects.Base.Actions.standard_approve.visible.apply(
55697
+ // this,
55698
+ // arguments,
55699
+ // );
55700
+ // },
55701
+ // on: "record_only",
55702
+ // type: "amis_button",
55703
+ // amis_schema: {
55704
+ // type: "service",
55705
+ // body: [
55706
+ // {
55707
+ // type: "button",
55708
+ // label: "发起审批",
55709
+ // id: "u:6887f3ab860a",
55710
+ // editorState: "default",
55711
+ // onEvent: {
55712
+ // click: {
55713
+ // weight: 0,
55714
+ // actions: [
55715
+ // {
55716
+ // actionType: "steedos_actions_standard_approve",
55717
+ // },
55718
+ // ],
55719
+ // },
55720
+ // },
55721
+ // },
55722
+ // ],
55723
+ // regions: ["body"],
55724
+ // data: {
55725
+ // context: {},
55726
+ // dataComponentId: "",
55727
+ // record_id: "",
55728
+ // record: {},
55729
+ // permissions: {},
55730
+ // },
55731
+ // bodyClassName: "p-0",
55732
+ // id: "u:5dd49d3a508c",
55733
+ // },
55734
+ // },
55735
+ // standard_create_instance: {
55736
+ // label: "Create Approval",
55737
+ // sort: -1,
55738
+ // on: "list",
55739
+ // type: "amis_button",
55740
+ // visible: function (object_name, record_id, record_permissions, data) {
55741
+ // if (data._isRelated) return false;
55742
+ // return (
55743
+ // lodash.filter(Steedos.Workflow?.getObjectWorkflows(), (item) => {
55744
+ // return (
55745
+ // item.object_name == object_name &&
55746
+ // (!item.sync_direction ||
55747
+ // item.sync_direction == "both" ||
55748
+ // item.sync_direction == "ins_to_obj") &&
55749
+ // true !== item.forbid_initiate_instance
55750
+ // );
55751
+ // }).length > 0
55752
+ // );
55753
+ // },
55754
+ // amis_schema: {
55755
+ // type: "service",
55756
+ // body: [
55757
+ // {
55758
+ // type: "button",
55759
+ // label: "申请",
55760
+ // id: "u:standard_create_instance",
55761
+ // editorState: "default",
55762
+ // onEvent: {
55763
+ // click: {
55764
+ // weight: 0,
55765
+ // actions: [
55766
+ // {
55767
+ // actionType: "custom",
55768
+ // script:
55769
+ // "// 编写判断,当前可发起的流程是单个还是多个. 并返回数据用于控制下个事件是直接新建申请单草稿还是弹出流程让选择\n\nconst flows = lodash.filter(Creator.object_workflows, (item) => { return item.object_name == event.data.object_name && (!item.sync_direction || item.sync_direction == 'both' || item.sync_direction == 'ins_to_obj') && true !== item.forbid_initiate_instance })\n\nevent.setData({ ...event.data, ...{ flows: flows, flowCount: flows.length } })\n\n",
55770
+ // },
55771
+ // {
55772
+ // actionType: "ajax",
55773
+ // outputVar: "responseResult",
55774
+ // args: {
55775
+ // options: {},
55776
+ // api: {
55777
+ // url: "${context.rootUrl}/api/workflow/v2/draft",
55778
+ // method: "post",
55779
+ // requestAdaptor:
55780
+ // "api.data = {\n 'instance': {\n 'flow': api.body.flows[0].flow_id,\n 'applicant': api.body.context.userId,\n 'space': api.body.context.tenantId\n \n}}\n\nreturn api;",
55781
+ // adaptor:
55782
+ // "\nif (payload.error) { \n return {\n status: 2,\n msg: payload.error\n }\n}\nconst instance = payload.instance;\nSteedos.openWindow(Steedos.absoluteUrl('/app/' + FlowRouter.current().params.app_id + '/instances/view/' + instance._id + '?display=' + (Steedos.Page.getDisplay('instances') || '') + '&side_object=instances&side_listview_id=draft'))\nreturn payload;",
55783
+ // messages: {},
55784
+ // headers: {
55785
+ // Authorization:
55786
+ // "Bearer ${context.tenantId},${context.authToken}",
55787
+ // },
55788
+ // data: {
55789
+ // "&": "$$",
55790
+ // context: "${context}",
55791
+ // objectName: "${objectName}",
55792
+ // recordId: "${recordId}",
55793
+ // },
55794
+ // },
55795
+ // },
55796
+ // expression: "${event.data.flowCount == 1}",
55797
+ // },
55798
+ // {
55799
+ // actionType: "dialog",
55800
+ // expression: "${event.data.flowCount > 1}",
55801
+ // dialog: {
55802
+ // type: "dialog",
55803
+ // title: "选择流程发起审批",
55804
+ // body: [
55805
+ // {
55806
+ // type: "form",
55807
+ // id: "u:f78efaa51a4f",
55808
+ // body: [
55809
+ // {
55810
+ // type: "input-tree",
55811
+ // name: "flowId",
55812
+ // label: false,
55813
+ // clearable: true,
55814
+ // id: "u:025b991fd40b",
55815
+ // multiple: false,
55816
+ // treeContainerClassName:
55817
+ // "no-border m-none p-none",
55818
+ // source: {
55819
+ // method: "get",
55820
+ // url: "${context.rootUrl}/api/workflow/v2/get_object_workflows",
55821
+ // requestAdaptor: "api.data = {};return api;",
55822
+ // adaptor:
55823
+ // "return { data: _.filter(payload, (item) => { return item.object_name == api.body.objectName && item.can_add && (!item.sync_direction || item.sync_direction == 'both' || item.sync_direction == 'ins_to_obj') && true !== item.forbid_initiate_instance })};",
55824
+ // messages: {},
55825
+ // dataType: "json",
55826
+ // headers: {
55827
+ // Authorization:
55828
+ // "Bearer ${context.tenantId},${context.authToken}",
55829
+ // },
55830
+ // data: {
55831
+ // objectName: "${objectName}",
55832
+ // spaceId: "${context.tenantId}",
55833
+ // },
55834
+ // },
55835
+ // value: "",
55836
+ // labelField: "flow_name",
55837
+ // valueField: "flow_id",
55838
+ // onEvent: {
55839
+ // change: {
55840
+ // weight: 0,
55841
+ // actions: [
55842
+ // {
55843
+ // actionType: "ajax",
55844
+ // outputVar: "responseResult",
55845
+ // args: {
55846
+ // options: {},
55847
+ // api: {
55848
+ // url: "${context.rootUrl}/api/workflow/v2/draft",
55849
+ // method: "post",
55850
+ // requestAdaptor:
55851
+ // "api.data = {\n 'instance': {\n 'flow': api.body.flowId,\n 'applicant': api.body.context.userId,\n 'space': api.body.context.tenantId\n \n}}\n\nreturn api;",
55852
+ // adaptor:
55853
+ // "\nif (payload.error) { \n return {\n status: 2,\n msg: payload.error\n }\n}\nconst instance = payload.instance;\nSteedos.openWindow(Steedos.absoluteUrl('/app/' + FlowRouter.current().params.app_id + '/instances/view/' + instance._id + '?display=' + (Steedos.Page.getDisplay('instances') || '') + '&side_object=instances&side_listview_id=draft'))\nreturn payload;",
55854
+ // messages: {},
55855
+ // headers: {
55856
+ // Authorization:
55857
+ // "Bearer ${context.tenantId},${context.authToken}",
55858
+ // },
55859
+ // data: {
55860
+ // "&": "$$",
55861
+ // context: "${context}",
55862
+ // objectName: "${objectName}",
55863
+ // recordId: "${recordId}",
55864
+ // },
55865
+ // },
55866
+ // },
55867
+ // expression: "${event.data.value}",
55868
+ // },
55869
+ // {
55870
+ // actionType: "closeDialog",
55871
+ // },
55872
+ // ],
55873
+ // },
55874
+ // },
55875
+ // },
55876
+ // ],
55877
+ // wrapWithPanel: false,
55878
+ // },
55879
+ // ],
55880
+ // showCloseButton: true,
55881
+ // showErrorMsg: true,
55882
+ // showLoading: true,
55883
+ // className: "",
55884
+ // id: "u:ba79188bbf7e",
55885
+ // closeOnEsc: true,
55886
+ // actions: [],
55887
+ // size: "md",
55888
+ // data: {
55889
+ // "&": "$$",
55890
+ // },
55891
+ // dataMap: {},
55892
+ // withDefaultData: true,
55893
+ // dataMapSwitch: true,
55894
+ // bodyClassName: "overflow-hidden",
55895
+ // },
55896
+ // },
55897
+ // ],
55898
+ // },
55899
+ // },
55900
+ // },
55901
+ // ],
55902
+ // regions: ["body"],
55903
+ // data: {
55904
+ // context: {},
55905
+ // dataComponentId: "",
55906
+ // record_id: "",
55907
+ // record: {},
55908
+ // permissions: {},
55909
+ // },
55910
+ // bodyClassName: "p-0",
55911
+ // id: "u:6ac1032391f4",
55912
+ // },
55913
+ // },
55914
+ // standard_view_instance: {
55915
+ // label: "View Instance",
55916
+ // visible: function (object_name, record_id, record_permissions) {
55917
+ // return Steedos.StandardObjects.Base.Actions.standard_view_instance.visible.apply(
55918
+ // this,
55919
+ // arguments,
55920
+ // );
55921
+ // },
55922
+ // on: "record_only",
55923
+ // todo: function () {
55924
+ // return Steedos.StandardObjects.Base.Actions.standard_view_instance.todo.apply(
55925
+ // this,
55926
+ // arguments,
55927
+ // );
55928
+ // },
55929
+ // },
55930
+ // standard_submit_for_approval: {
55931
+ // visible: function (object_name, record_id) {
55932
+ // return Steedos.StandardObjects.Base.Actions.standard_submit_for_approval.visible.apply(
55933
+ // this,
55934
+ // arguments,
55935
+ // );
55936
+ // },
55937
+ // on: "record_only",
55938
+ // type: "amis_button",
55939
+ // amis_schema: {
55940
+ // type: "service",
55941
+ // body: [
55942
+ // {
55943
+ // type: "button",
55944
+ // label: "提请审批",
55945
+ // id: "u:standard_submit_for_approval",
55946
+ // onEvent: {
55947
+ // click: {
55948
+ // actions: [
55949
+ // {
55950
+ // actionType: "dialog",
55951
+ // dialog: {
55952
+ // type: "dialog",
55953
+ // title: "提交待审核",
55954
+ // body: [
55955
+ // {
55956
+ // type: "form",
55957
+ // id: "u:1eb06e6962d8",
55958
+ // title: "表单",
55959
+ // body: [
55960
+ // {
55961
+ // type: "steedos-field",
55962
+ // id: "u:9f4486c22f52",
55963
+ // field:
55964
+ // '{\n "label": "意见",\n "name": "comment",\n "type": "textarea",\n "rows": 3,\n "is_wide": true\n}',
55965
+ // name: "comment",
55966
+ // },
55967
+ // {
55968
+ // type: "steedos-field",
55969
+ // id: "u:9f4486c22f52",
55970
+ // field:
55971
+ // '{\n "label": "选择下一位批准人",\n "name": "approver",\n "type": "lookup",\n "reference_to": "space_users",\n "reference_to_field": "user",\n "required": true,\n "is_wide": true\n}',
55972
+ // name: "approver",
55973
+ // placeholder: "",
55974
+ // visibleOn: "${showApprover === true}",
55975
+ // },
55976
+ // ],
55977
+ // wrapWithPanel: false,
55978
+ // mode: "normal",
55979
+ // api: {
55980
+ // method: "post",
55981
+ // url: "${context.rootUrl}/api/v4/process/submit/${objectName}/${recordId}",
55982
+ // data: {
55983
+ // "&": "$$",
55984
+ // },
55985
+ // requestAdaptor:
55986
+ // "\napi.data = {\n comment: api.body.comment\n};\n\nif (api.body.approver) {\n api.data.approver = api.body.approver;\n}\n\nreturn api;",
55987
+ // adaptor:
55988
+ // "\npayload.data = {};\npayload.data.showApprover = payload.error === 'process_approval_error_needToChooseApprover'\n\nif (payload.state === 'FAILURE') {\n if (payload.data.showApprover) {\n payload.msg = \"请选择下一位批准人\";\n } else { \n payload.msg = window.t(payload.error)\n }\n}\n\n\nreturn payload;",
55989
+ // responseData: {
55990
+ // "&": "$$",
55991
+ // },
55992
+ // headers: {
55993
+ // Authorization:
55994
+ // "Bearer ${context.tenantId},${context.authToken}",
55995
+ // },
55996
+ // },
55997
+ // debug: false,
55998
+ // onEvent: {
55999
+ // submitSucc: {
56000
+ // weight: 0,
56001
+ // actions: [
56002
+ // {
56003
+ // actionType: "custom",
56004
+ // script: `
56005
+ // doAction({
56006
+ // "actionType": "broadcast",
56007
+ // "args": {
56008
+ // "eventName": \`@data.changed.\${event.data.objectName}\`
56009
+ // },
56010
+ // "data": {
56011
+ // "objectName": \`\${event.data.objectName}\`
56012
+ // }
56013
+ // });
56014
+ // `,
56015
+ // },
56016
+ // ],
56017
+ // },
56018
+ // },
56019
+ // },
56020
+ // ],
56021
+ // id: "u:7a3f92e56805",
56022
+ // closeOnEsc: false,
56023
+ // closeOnOutside: false,
56024
+ // showCloseButton: true,
56025
+ // size: "md",
56026
+ // },
56027
+ // },
56028
+ // ],
56029
+ // weight: 0,
56030
+ // },
56031
+ // },
56032
+ // },
56033
+ // ],
56034
+ // regions: ["body"],
56035
+ // data: {},
56036
+ // bodyClassName: "p-0",
56037
+ // id: "u:50444554a302",
56038
+ // },
56039
+ // },
56040
+ standard_export_excel: {
56041
+ label: "Export Excel",
56042
+ visible: function(object_name, record_id, record_permissions) {
56043
+ return Steedos.StandardObjects.Base.Actions.standard_export_excel.visible.apply(
56044
+ this,
56045
+ arguments
56046
+ );
56047
+ },
56048
+ on: "list",
56049
+ todo: function() {
56050
+ return Steedos.StandardObjects.Base.Actions.standard_export_excel.todo.apply(
56051
+ this,
56052
+ arguments
56053
+ );
56054
+ }
56055
+ },
56056
+ standard_print: {
56057
+ label: "Print",
56058
+ visible: false,
56059
+ on: "record_only",
56060
+ type: "amis_button",
56061
+ amis_schema: {
56062
+ type: "service",
56063
+ body: [
56064
+ {
56065
+ type: "service",
56066
+ body: [
56067
+ {
56068
+ type: "dropdown-button",
56069
+ label: "打印",
56070
+ buttons: "${buttonOptions}",
56071
+ id: "u:8cd2cefcaf9b",
56072
+ disabled: false,
56073
+ hidden: false
56074
+ }
56075
+ ],
56076
+ id: "u:2b1dc4682c90",
56077
+ messages: {},
56078
+ api: {
56079
+ url: "${context.rootUrl}/graphql",
56080
+ method: "post",
56081
+ messages: {
56082
+ failed: "打印功能需要企业许可证"
56083
+ },
56084
+ requestAdaptor: "",
56085
+ adaptor: 'const buttonOptions = [];\nfor (const row of payload.data.rows) {\n buttonOptions.push({\n "type": "button",\n "label": row.label,\n "onEvent": {\n "click": {\n "actions": [\n {\n "actionType": "url",\n "args": {\n "url": "${context.rootUrl}/api/page/render",\n "blank": true,\n "params": {\n "schemaApi": "${context.rootUrl}/service/api/@steedos/print-template/getPrintSchema/" + row._id,\n "data": {\n "filters": ["_id", "=", "${recordId}"]\n } \n }\n }\n }\n ]\n }\n }\n })\n}\n\npayload.data = {\n buttonOptions: buttonOptions \n}\nreturn payload',
56086
+ headers: {
56087
+ Authorization: "Bearer ${context.tenantId},${context.authToken}"
56088
+ },
56089
+ data: {
56090
+ "&": "$$",
56091
+ query: '{ rows: object_print(filters: [["object_name", "=", "${objectName}"]]) { _id name label object_name } }'
56092
+ }
56093
+ },
56094
+ initFetch: true,
56095
+ onEvent: {
56096
+ init: {
56097
+ weight: 0,
56098
+ actions: []
56099
+ }
56100
+ },
56101
+ name: "print"
56102
+ }
56103
+ ],
56104
+ regions: ["body"],
56105
+ data: {
56106
+ context: {},
56107
+ dataComponentId: "",
56108
+ record_id: "",
56109
+ record: {},
56110
+ permissions: {}
56111
+ },
56112
+ id: "u:038c6047be31",
56113
+ bodyClassName: "p-0"
56114
+ }
55996
56115
  }
55997
56116
  }
55998
- try {
55999
- promise = dispatchRequest2(newConfig);
56000
- } catch (error) {
56001
- return Promise.reject(error);
56117
+ }
56118
+ };
56119
+ const User = {
56120
+ get: () => {
56121
+ var _a2;
56122
+ return (_a2 = window.Builder.settings.context) == null ? void 0 : _a2.user;
56123
+ }
56124
+ };
56125
+ const Workflow = {
56126
+ // TODO: 初始化对象流程?
56127
+ getObjectWorkflows: () => {
56128
+ return [];
56129
+ }
56130
+ };
56131
+ const ProcessManager = {};
56132
+ class SObject {
56133
+ constructor(objectName, client2) {
56134
+ __publicField(this, "objectName");
56135
+ __publicField(this, "client");
56136
+ this.objectName = objectName;
56137
+ this.client = client2;
56138
+ }
56139
+ // fetches a record or records specified by id(s) in first argument.
56140
+ async retrieve(id2) {
56141
+ if (_.isEmpty(id2)) {
56142
+ return [];
56002
56143
  }
56003
- while (responseInterceptorChain.length) {
56004
- promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
56144
+ if (_.isString(id2)) {
56145
+ return await this.client.getRecord({
56146
+ objectName: this.objectName,
56147
+ id: id2
56148
+ });
56149
+ } else if (_.isArray(id2)) {
56150
+ return await this.client.searchRecords(this.objectName, {
56151
+ filters: [["_id", "in", id2]]
56152
+ });
56005
56153
  }
56006
- return promise;
56007
- };
56008
- Axios.prototype.getUri = function getUri(config2) {
56009
- config2 = mergeConfig2(this.defaults, config2);
56010
- return buildURL2(config2.url, config2.params, config2.paramsSerializer).replace(/^\?/, "");
56011
- };
56012
- utils2.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
56013
- Axios.prototype[method] = function(url2, config2) {
56014
- return this.request(mergeConfig2(config2 || {}, {
56015
- method,
56016
- url: url2,
56017
- data: (config2 || {}).data
56018
- }));
56019
- };
56020
- });
56021
- utils2.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
56022
- Axios.prototype[method] = function(url2, data2, config2) {
56023
- return this.request(mergeConfig2(config2 || {}, {
56024
- method,
56025
- url: url2,
56026
- data: data2
56027
- }));
56028
- };
56029
- });
56030
- Axios_1 = Axios;
56031
- return Axios_1;
56032
- }
56033
- var Cancel_1;
56034
- var hasRequiredCancel;
56035
- function requireCancel() {
56036
- if (hasRequiredCancel) return Cancel_1;
56037
- hasRequiredCancel = 1;
56038
- function Cancel(message2) {
56039
- this.message = message2;
56040
56154
  }
56041
- Cancel.prototype.toString = function toString2() {
56042
- return "Cancel" + (this.message ? ": " + this.message : "");
56043
- };
56044
- Cancel.prototype.__CANCEL__ = true;
56045
- Cancel_1 = Cancel;
56046
- return Cancel_1;
56047
- }
56048
- var CancelToken_1;
56049
- var hasRequiredCancelToken;
56050
- function requireCancelToken() {
56051
- if (hasRequiredCancelToken) return CancelToken_1;
56052
- hasRequiredCancelToken = 1;
56053
- var Cancel = requireCancel();
56054
- function CancelToken(executor) {
56055
- if (typeof executor !== "function") {
56056
- throw new TypeError("executor must be a function.");
56057
- }
56058
- var resolvePromise;
56059
- this.promise = new Promise(function promiseExecutor(resolve) {
56060
- resolvePromise = resolve;
56155
+ async create(doc) {
56156
+ return await this.client.createRecord({
56157
+ objectName: this.objectName,
56158
+ doc
56061
56159
  });
56062
- var token = this;
56063
- executor(function cancel(message2) {
56064
- if (token.reason) {
56065
- return;
56066
- }
56067
- token.reason = new Cancel(message2);
56068
- resolvePromise(token.reason);
56160
+ }
56161
+ async update(id2, doc) {
56162
+ return await this.client.updateRecord({
56163
+ objectName: this.objectName,
56164
+ id: id2,
56165
+ doc
56069
56166
  });
56070
56167
  }
56071
- CancelToken.prototype.throwIfRequested = function throwIfRequested() {
56072
- if (this.reason) {
56073
- throw this.reason;
56074
- }
56075
- };
56076
- CancelToken.source = function source() {
56077
- var cancel;
56078
- var token = new CancelToken(function executor(c) {
56079
- cancel = c;
56168
+ async delete(id2) {
56169
+ return await this.client.deleteRecord({
56170
+ objectName: this.objectName,
56171
+ id: id2
56172
+ });
56173
+ }
56174
+ async find(filters, fields, sort, top, skip) {
56175
+ return await this.client.searchRecords(this.objectName, {
56176
+ filters,
56177
+ fields,
56178
+ sort,
56179
+ top,
56180
+ skip
56080
56181
  });
56081
- return {
56082
- token,
56083
- cancel
56084
- };
56085
- };
56086
- CancelToken_1 = CancelToken;
56087
- return CancelToken_1;
56088
- }
56089
- var spread;
56090
- var hasRequiredSpread;
56091
- function requireSpread() {
56092
- if (hasRequiredSpread) return spread;
56093
- hasRequiredSpread = 1;
56094
- spread = function spread2(callback) {
56095
- return function wrap(arr2) {
56096
- return callback.apply(null, arr2);
56097
- };
56098
- };
56099
- return spread;
56100
- }
56101
- var isAxiosError;
56102
- var hasRequiredIsAxiosError;
56103
- function requireIsAxiosError() {
56104
- if (hasRequiredIsAxiosError) return isAxiosError;
56105
- hasRequiredIsAxiosError = 1;
56106
- isAxiosError = function isAxiosError2(payload) {
56107
- return typeof payload === "object" && payload.isAxiosError === true;
56108
- };
56109
- return isAxiosError;
56110
- }
56111
- var hasRequiredAxios$1;
56112
- function requireAxios$1() {
56113
- if (hasRequiredAxios$1) return axios$2.exports;
56114
- hasRequiredAxios$1 = 1;
56115
- var utils2 = requireUtils();
56116
- var bind2 = requireBind();
56117
- var Axios = requireAxios$2();
56118
- var mergeConfig2 = requireMergeConfig();
56119
- var defaults2 = requireDefaults();
56120
- function createInstance(defaultConfig) {
56121
- var context = new Axios(defaultConfig);
56122
- var instance2 = bind2(Axios.prototype.request, context);
56123
- utils2.extend(instance2, Axios.prototype, context);
56124
- utils2.extend(instance2, context);
56125
- return instance2;
56126
56182
  }
56127
- var axios2 = createInstance(defaults2);
56128
- axios2.Axios = Axios;
56129
- axios2.create = function create(instanceConfig) {
56130
- return createInstance(mergeConfig2(axios2.defaults, instanceConfig));
56131
- };
56132
- axios2.Cancel = requireCancel();
56133
- axios2.CancelToken = requireCancelToken();
56134
- axios2.isCancel = requireIsCancel();
56135
- axios2.all = function all(promises) {
56136
- return Promise.all(promises);
56137
- };
56138
- axios2.spread = requireSpread();
56139
- axios2.isAxiosError = requireIsAxiosError();
56140
- axios$2.exports = axios2;
56141
- axios$2.exports.default = axios2;
56142
- return axios$2.exports;
56143
- }
56144
- var axios$1;
56145
- var hasRequiredAxios;
56146
- function requireAxios() {
56147
- if (hasRequiredAxios) return axios$1;
56148
- hasRequiredAxios = 1;
56149
- axios$1 = requireAxios$1();
56150
- return axios$1;
56151
56183
  }
56152
- var axiosExports = requireAxios();
56153
- const axios = /* @__PURE__ */ getDefaultExportFromCjs(axiosExports);
56154
56184
  class ServiceRecordsApi {
56155
56185
  /**
56156
56186
  * Initializes the ServiceRecordsApi instance.