@pisell/core 1.0.24 → 1.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/app/app.d.ts CHANGED
@@ -22,7 +22,7 @@ export interface AppOptions {
22
22
  history?: HistoryOptions;
23
23
  storage?: StorageOptions;
24
24
  locales?: LocalesOptions;
25
- pisellos?: any;
25
+ getPisellos?: () => any;
26
26
  }
27
27
  declare class App {
28
28
  private static instance;
@@ -67,7 +67,7 @@ declare class App {
67
67
  cmd: CMD;
68
68
  aws: AWS;
69
69
  tasksManager: TasksManager;
70
- pisellos: any;
70
+ getPisellos: any;
71
71
  dbManager: IndexDBManager | null;
72
72
  constants: {
73
73
  channel: string;
package/es/app/app.js CHANGED
@@ -67,8 +67,8 @@ var App = /*#__PURE__*/function () {
67
67
  _defineProperty(this, "aws", void 0);
68
68
  // 任务管理
69
69
  _defineProperty(this, "tasksManager", void 0);
70
- // pisellos
71
- _defineProperty(this, "pisellos", void 0);
70
+ // getPisellos
71
+ _defineProperty(this, "getPisellos", void 0);
72
72
  _defineProperty(this, "dbManager", null);
73
73
  _defineProperty(this, "constants", {
74
74
  channel: ""
@@ -89,7 +89,7 @@ var App = /*#__PURE__*/function () {
89
89
  this.tasksManager = new TasksManager(this);
90
90
  this.cmd = new CMD(this, options === null || options === void 0 ? void 0 : options.cmd);
91
91
  this.aws = new AWS(this, options === null || options === void 0 ? void 0 : options.aws);
92
- this.pisellos = options === null || options === void 0 ? void 0 : options.pisellos;
92
+ this.getPisellos = options === null || options === void 0 ? void 0 : options.getPisellos;
93
93
  if (options !== null && options !== void 0 && options.constants) {
94
94
  this.constants = options.constants || {};
95
95
  }
@@ -70,11 +70,12 @@ export var request = function request(props) {
70
70
 
71
71
  // 使用os服务层
72
72
  if (config !== null && config !== void 0 && config.osServer) {
73
- var _app$pisellos, _app$pisellos2, _app$pisellos2$hasRou;
73
+ var _app$getPisellos, _pisellos$server, _pisellos$server$hasR;
74
74
  var app = getApp();
75
- if (app !== null && app !== void 0 && (_app$pisellos = app.pisellos) !== null && _app$pisellos !== void 0 && _app$pisellos.server && (_app$pisellos2 = app.pisellos) !== null && _app$pisellos2 !== void 0 && (_app$pisellos2 = _app$pisellos2.server) !== null && _app$pisellos2 !== void 0 && (_app$pisellos2$hasRou = _app$pisellos2.hasRoute) !== null && _app$pisellos2$hasRou !== void 0 && _app$pisellos2$hasRou.call(_app$pisellos2, method, url)) {
76
- var _app$pisellos3, _app$pisellos3$handle;
77
- return (_app$pisellos3 = app.pisellos) === null || _app$pisellos3 === void 0 || (_app$pisellos3 = _app$pisellos3.server) === null || _app$pisellos3 === void 0 || (_app$pisellos3$handle = _app$pisellos3.handleRoute) === null || _app$pisellos3$handle === void 0 ? void 0 : _app$pisellos3$handle.call(_app$pisellos3, method, url, props);
75
+ var pisellos = (_app$getPisellos = app.getPisellos) === null || _app$getPisellos === void 0 ? void 0 : _app$getPisellos.call(app);
76
+ if (pisellos !== null && pisellos !== void 0 && pisellos.server && pisellos !== null && pisellos !== void 0 && (_pisellos$server = pisellos.server) !== null && _pisellos$server !== void 0 && (_pisellos$server$hasR = _pisellos$server.hasRoute) !== null && _pisellos$server$hasR !== void 0 && _pisellos$server$hasR.call(_pisellos$server, method, url)) {
77
+ var _pisellos$server2, _pisellos$server2$han;
78
+ return pisellos === null || pisellos === void 0 || (_pisellos$server2 = pisellos.server) === null || _pisellos$server2 === void 0 || (_pisellos$server2$han = _pisellos$server2.handleRoute) === null || _pisellos$server2$han === void 0 ? void 0 : _pisellos$server2$han.call(_pisellos$server2, method, url, props);
78
79
  }
79
80
  }
80
81
 
package/lib/app/app.d.ts CHANGED
@@ -22,7 +22,7 @@ export interface AppOptions {
22
22
  history?: HistoryOptions;
23
23
  storage?: StorageOptions;
24
24
  locales?: LocalesOptions;
25
- pisellos?: any;
25
+ getPisellos?: () => any;
26
26
  }
27
27
  declare class App {
28
28
  private static instance;
@@ -67,7 +67,7 @@ declare class App {
67
67
  cmd: CMD;
68
68
  aws: AWS;
69
69
  tasksManager: TasksManager;
70
- pisellos: any;
70
+ getPisellos: any;
71
71
  dbManager: IndexDBManager | null;
72
72
  constants: {
73
73
  channel: string;
package/lib/app/app.js CHANGED
@@ -92,8 +92,8 @@ var App = class _App {
92
92
  aws;
93
93
  // 任务管理
94
94
  tasksManager;
95
- // pisellos
96
- pisellos;
95
+ // getPisellos
96
+ getPisellos;
97
97
  dbManager = null;
98
98
  constants = {
99
99
  channel: ""
@@ -115,7 +115,7 @@ var App = class _App {
115
115
  this.tasksManager = new import_tasks.TasksManager(this);
116
116
  this.cmd = new import_cmd.default(this, options == null ? void 0 : options.cmd);
117
117
  this.aws = new import_aws.default(this, options == null ? void 0 : options.aws);
118
- this.pisellos = options == null ? void 0 : options.pisellos;
118
+ this.getPisellos = options == null ? void 0 : options.getPisellos;
119
119
  if (options == null ? void 0 : options.constants) {
120
120
  this.constants = options.constants || {};
121
121
  }
@@ -75,7 +75,7 @@ var createRequest = (props) => {
75
75
  });
76
76
  };
77
77
  var request = (props) => {
78
- var _a, _b, _c, _d, _e, _f, _g;
78
+ var _a, _b, _c, _d, _e;
79
79
  const { config, url, method } = props;
80
80
  if (config == null ? void 0 : config.abort) {
81
81
  let signal = (0, import_cancelToken.createSignal)(config.abort, url);
@@ -83,8 +83,9 @@ var request = (props) => {
83
83
  }
84
84
  if (config == null ? void 0 : config.osServer) {
85
85
  const app = (0, import_app.getApp)();
86
- if (((_a = app == null ? void 0 : app.pisellos) == null ? void 0 : _a.server) && ((_d = (_c = (_b = app.pisellos) == null ? void 0 : _b.server) == null ? void 0 : _c.hasRoute) == null ? void 0 : _d.call(_c, method, url))) {
87
- return (_g = (_f = (_e = app.pisellos) == null ? void 0 : _e.server) == null ? void 0 : _f.handleRoute) == null ? void 0 : _g.call(_f, method, url, props);
86
+ const pisellos = (_a = app.getPisellos) == null ? void 0 : _a.call(app);
87
+ if ((pisellos == null ? void 0 : pisellos.server) && ((_c = (_b = pisellos == null ? void 0 : pisellos.server) == null ? void 0 : _b.hasRoute) == null ? void 0 : _c.call(_b, method, url))) {
88
+ return (_e = (_d = pisellos == null ? void 0 : pisellos.server) == null ? void 0 : _d.handleRoute) == null ? void 0 : _e.call(_d, method, url, props);
88
89
  }
89
90
  }
90
91
  return (0, import_cache.cacheFn)(props, createRequest);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/core",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "sideEffects": false,
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",