@next-core/easyops-runtime 0.9.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,11 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.clearCollectWidgetContract = clearCollectWidgetContract;
7
+ exports.clearDebugContract = clearDebugContract;
7
8
  exports.collectContract = collectContract;
9
+ exports.collectDebugContract = collectDebugContract;
8
10
  exports.collectWidgetContract = collectWidgetContract;
9
11
  exports.getContract = getContract;
10
12
  const contractsMap = new Map();
11
13
  const widgetContractMap = new Map();
14
+ const debugContractMap = new Map();
12
15
  const addContract = (contracts, map) => {
13
16
  contracts === null || contracts === void 0 || contracts.forEach(contract => {
14
17
  map.set(`${contract.namespaceId}.${contract.name}`, contract);
@@ -23,7 +26,13 @@ function collectWidgetContract(contracts) {
23
26
  function clearCollectWidgetContract() {
24
27
  widgetContractMap.clear();
25
28
  }
29
+ function collectDebugContract(contracts) {
30
+ addContract(contracts, debugContractMap);
31
+ }
32
+ function clearDebugContract() {
33
+ debugContractMap.clear();
34
+ }
26
35
  function getContract(name) {
27
- return contractsMap.get(name) || widgetContractMap.get(name);
36
+ return contractsMap.get(name) || widgetContractMap.get(name) || debugContractMap.get(name);
28
37
  }
29
38
  //# sourceMappingURL=CollectContracts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CollectContracts.js","names":["contractsMap","Map","widgetContractMap","addContract","contracts","map","forEach","contract","set","namespaceId","name","collectContract","collectWidgetContract","clearCollectWidgetContract","clear","getContract","get"],"sources":["../../../src/flowApi/CollectContracts.ts"],"sourcesContent":["import { Contract } from \"@next-core/types\";\n\nconst contractsMap: Map<string, Contract> = new Map();\nconst widgetContractMap: Map<string, Contract> = new Map();\n\nconst addContract = (\n contracts: Contract[] | undefined,\n map: Map<string, Contract>\n): void => {\n contracts?.forEach((contract) => {\n map.set(`${contract.namespaceId}.${contract.name}`, contract);\n });\n};\n\nexport function collectContract(contracts: Contract[] | undefined): void {\n addContract(contracts, contractsMap);\n}\n\nexport function collectWidgetContract(contracts: Contract[] | undefined): void {\n addContract(contracts, widgetContractMap);\n}\n\nexport function clearCollectWidgetContract(): void {\n widgetContractMap.clear();\n}\n\nexport function getContract(name: string): Contract | undefined {\n return contractsMap.get(name) || widgetContractMap.get(name);\n}\n"],"mappings":";;;;;;;;;AAEA,MAAMA,YAAmC,GAAG,IAAIC,GAAG,CAAC,CAAC;AACrD,MAAMC,iBAAwC,GAAG,IAAID,GAAG,CAAC,CAAC;AAE1D,MAAME,WAAW,GAAGA,CAClBC,SAAiC,EACjCC,GAA0B,KACjB;EACTD,SAAS,aAATA,SAAS,eAATA,SAAS,CAAEE,OAAO,CAAEC,QAAQ,IAAK;IAC/BF,GAAG,CAACG,GAAG,CAAE,GAAED,QAAQ,CAACE,WAAY,IAAGF,QAAQ,CAACG,IAAK,EAAC,EAAEH,QAAQ,CAAC;EAC/D,CAAC,CAAC;AACJ,CAAC;AAEM,SAASI,eAAeA,CAACP,SAAiC,EAAQ;EACvED,WAAW,CAACC,SAAS,EAAEJ,YAAY,CAAC;AACtC;AAEO,SAASY,qBAAqBA,CAACR,SAAiC,EAAQ;EAC7ED,WAAW,CAACC,SAAS,EAAEF,iBAAiB,CAAC;AAC3C;AAEO,SAASW,0BAA0BA,CAAA,EAAS;EACjDX,iBAAiB,CAACY,KAAK,CAAC,CAAC;AAC3B;AAEO,SAASC,WAAWA,CAACL,IAAY,EAAwB;EAC9D,OAAOV,YAAY,CAACgB,GAAG,CAACN,IAAI,CAAC,IAAIR,iBAAiB,CAACc,GAAG,CAACN,IAAI,CAAC;AAC9D","ignoreList":[]}
1
+ {"version":3,"file":"CollectContracts.js","names":["contractsMap","Map","widgetContractMap","debugContractMap","addContract","contracts","map","forEach","contract","set","namespaceId","name","collectContract","collectWidgetContract","clearCollectWidgetContract","clear","collectDebugContract","clearDebugContract","getContract","get"],"sources":["../../../src/flowApi/CollectContracts.ts"],"sourcesContent":["import { Contract } from \"@next-core/types\";\n\nconst contractsMap: Map<string, Contract> = new Map();\nconst widgetContractMap: Map<string, Contract> = new Map();\nconst debugContractMap: Map<string, Contract> = new Map();\n\nconst addContract = (\n contracts: Contract[] | undefined,\n map: Map<string, Contract>\n): void => {\n contracts?.forEach((contract) => {\n map.set(`${contract.namespaceId}.${contract.name}`, contract);\n });\n};\n\nexport function collectContract(contracts: Contract[] | undefined): void {\n addContract(contracts, contractsMap);\n}\n\nexport function collectWidgetContract(contracts: Contract[] | undefined): void {\n addContract(contracts, widgetContractMap);\n}\n\nexport function clearCollectWidgetContract(): void {\n widgetContractMap.clear();\n}\n\nexport function collectDebugContract(contracts: Contract[] | undefined): void {\n addContract(contracts, debugContractMap);\n}\n\nexport function clearDebugContract() {\n debugContractMap.clear();\n}\n\nexport function getContract(name: string): Contract | undefined {\n return (\n contractsMap.get(name) ||\n widgetContractMap.get(name) ||\n debugContractMap.get(name)\n );\n}\n"],"mappings":";;;;;;;;;;;AAEA,MAAMA,YAAmC,GAAG,IAAIC,GAAG,CAAC,CAAC;AACrD,MAAMC,iBAAwC,GAAG,IAAID,GAAG,CAAC,CAAC;AAC1D,MAAME,gBAAuC,GAAG,IAAIF,GAAG,CAAC,CAAC;AAEzD,MAAMG,WAAW,GAAGA,CAClBC,SAAiC,EACjCC,GAA0B,KACjB;EACTD,SAAS,aAATA,SAAS,eAATA,SAAS,CAAEE,OAAO,CAAEC,QAAQ,IAAK;IAC/BF,GAAG,CAACG,GAAG,CAAE,GAAED,QAAQ,CAACE,WAAY,IAAGF,QAAQ,CAACG,IAAK,EAAC,EAAEH,QAAQ,CAAC;EAC/D,CAAC,CAAC;AACJ,CAAC;AAEM,SAASI,eAAeA,CAACP,SAAiC,EAAQ;EACvED,WAAW,CAACC,SAAS,EAAEL,YAAY,CAAC;AACtC;AAEO,SAASa,qBAAqBA,CAACR,SAAiC,EAAQ;EAC7ED,WAAW,CAACC,SAAS,EAAEH,iBAAiB,CAAC;AAC3C;AAEO,SAASY,0BAA0BA,CAAA,EAAS;EACjDZ,iBAAiB,CAACa,KAAK,CAAC,CAAC;AAC3B;AAEO,SAASC,oBAAoBA,CAACX,SAAiC,EAAQ;EAC5ED,WAAW,CAACC,SAAS,EAAEF,gBAAgB,CAAC;AAC1C;AAEO,SAASc,kBAAkBA,CAAA,EAAG;EACnCd,gBAAgB,CAACY,KAAK,CAAC,CAAC;AAC1B;AAEO,SAASG,WAAWA,CAACP,IAAY,EAAwB;EAC9D,OACEX,YAAY,CAACmB,GAAG,CAACR,IAAI,CAAC,IACtBT,iBAAiB,CAACiB,GAAG,CAACR,IAAI,CAAC,IAC3BR,gBAAgB,CAACgB,GAAG,CAACR,IAAI,CAAC;AAE9B","ignoreList":[]}
@@ -15,12 +15,24 @@ Object.defineProperty(exports, "clearCollectWidgetContract", {
15
15
  return _CollectContracts.clearCollectWidgetContract;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "clearDebugContract", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _CollectContracts.clearDebugContract;
22
+ }
23
+ });
18
24
  Object.defineProperty(exports, "collectContract", {
19
25
  enumerable: true,
20
26
  get: function () {
21
27
  return _CollectContracts.collectContract;
22
28
  }
23
29
  });
30
+ Object.defineProperty(exports, "collectDebugContract", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _CollectContracts.collectDebugContract;
34
+ }
35
+ });
24
36
  Object.defineProperty(exports, "collectWidgetContract", {
25
37
  enumerable: true,
26
38
  get: function () {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_FlowApiProvider","require","_FlowApi","_CollectContracts"],"sources":["../../../src/flowApi/index.ts"],"sourcesContent":["export {\n FLOW_API_PROVIDER,\n registerFlowApiProvider,\n} from \"./FlowApiProvider.js\";\n\nexport { isFlowApiProvider, getArgsOfFlowApi } from \"./FlowApi.js\";\n\nexport {\n collectContract,\n collectWidgetContract,\n clearCollectWidgetContract,\n} from \"./CollectContracts.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,iBAAA,GAAAF,OAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_FlowApiProvider","require","_FlowApi","_CollectContracts"],"sources":["../../../src/flowApi/index.ts"],"sourcesContent":["export {\n FLOW_API_PROVIDER,\n registerFlowApiProvider,\n} from \"./FlowApiProvider.js\";\n\nexport { isFlowApiProvider, getArgsOfFlowApi } from \"./FlowApi.js\";\n\nexport {\n collectContract,\n collectWidgetContract,\n clearCollectWidgetContract,\n collectDebugContract,\n clearDebugContract,\n} from \"./CollectContracts.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,iBAAA,GAAAF,OAAA","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  var contractsMap = new Map();
2
2
  var widgetContractMap = new Map();
3
+ var debugContractMap = new Map();
3
4
  var addContract = (contracts, map) => {
4
5
  contracts === null || contracts === void 0 || contracts.forEach(contract => {
5
6
  map.set("".concat(contract.namespaceId, ".").concat(contract.name), contract);
@@ -14,7 +15,13 @@ export function collectWidgetContract(contracts) {
14
15
  export function clearCollectWidgetContract() {
15
16
  widgetContractMap.clear();
16
17
  }
18
+ export function collectDebugContract(contracts) {
19
+ addContract(contracts, debugContractMap);
20
+ }
21
+ export function clearDebugContract() {
22
+ debugContractMap.clear();
23
+ }
17
24
  export function getContract(name) {
18
- return contractsMap.get(name) || widgetContractMap.get(name);
25
+ return contractsMap.get(name) || widgetContractMap.get(name) || debugContractMap.get(name);
19
26
  }
20
27
  //# sourceMappingURL=CollectContracts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CollectContracts.js","names":["contractsMap","Map","widgetContractMap","addContract","contracts","map","forEach","contract","set","concat","namespaceId","name","collectContract","collectWidgetContract","clearCollectWidgetContract","clear","getContract","get"],"sources":["../../../src/flowApi/CollectContracts.ts"],"sourcesContent":["import { Contract } from \"@next-core/types\";\n\nconst contractsMap: Map<string, Contract> = new Map();\nconst widgetContractMap: Map<string, Contract> = new Map();\n\nconst addContract = (\n contracts: Contract[] | undefined,\n map: Map<string, Contract>\n): void => {\n contracts?.forEach((contract) => {\n map.set(`${contract.namespaceId}.${contract.name}`, contract);\n });\n};\n\nexport function collectContract(contracts: Contract[] | undefined): void {\n addContract(contracts, contractsMap);\n}\n\nexport function collectWidgetContract(contracts: Contract[] | undefined): void {\n addContract(contracts, widgetContractMap);\n}\n\nexport function clearCollectWidgetContract(): void {\n widgetContractMap.clear();\n}\n\nexport function getContract(name: string): Contract | undefined {\n return contractsMap.get(name) || widgetContractMap.get(name);\n}\n"],"mappings":"AAEA,IAAMA,YAAmC,GAAG,IAAIC,GAAG,CAAC,CAAC;AACrD,IAAMC,iBAAwC,GAAG,IAAID,GAAG,CAAC,CAAC;AAE1D,IAAME,WAAW,GAAGA,CAClBC,SAAiC,EACjCC,GAA0B,KACjB;EACTD,SAAS,aAATA,SAAS,eAATA,SAAS,CAAEE,OAAO,CAAEC,QAAQ,IAAK;IAC/BF,GAAG,CAACG,GAAG,IAAAC,MAAA,CAAIF,QAAQ,CAACG,WAAW,OAAAD,MAAA,CAAIF,QAAQ,CAACI,IAAI,GAAIJ,QAAQ,CAAC;EAC/D,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,SAASK,eAAeA,CAACR,SAAiC,EAAQ;EACvED,WAAW,CAACC,SAAS,EAAEJ,YAAY,CAAC;AACtC;AAEA,OAAO,SAASa,qBAAqBA,CAACT,SAAiC,EAAQ;EAC7ED,WAAW,CAACC,SAAS,EAAEF,iBAAiB,CAAC;AAC3C;AAEA,OAAO,SAASY,0BAA0BA,CAAA,EAAS;EACjDZ,iBAAiB,CAACa,KAAK,CAAC,CAAC;AAC3B;AAEA,OAAO,SAASC,WAAWA,CAACL,IAAY,EAAwB;EAC9D,OAAOX,YAAY,CAACiB,GAAG,CAACN,IAAI,CAAC,IAAIT,iBAAiB,CAACe,GAAG,CAACN,IAAI,CAAC;AAC9D","ignoreList":[]}
1
+ {"version":3,"file":"CollectContracts.js","names":["contractsMap","Map","widgetContractMap","debugContractMap","addContract","contracts","map","forEach","contract","set","concat","namespaceId","name","collectContract","collectWidgetContract","clearCollectWidgetContract","clear","collectDebugContract","clearDebugContract","getContract","get"],"sources":["../../../src/flowApi/CollectContracts.ts"],"sourcesContent":["import { Contract } from \"@next-core/types\";\n\nconst contractsMap: Map<string, Contract> = new Map();\nconst widgetContractMap: Map<string, Contract> = new Map();\nconst debugContractMap: Map<string, Contract> = new Map();\n\nconst addContract = (\n contracts: Contract[] | undefined,\n map: Map<string, Contract>\n): void => {\n contracts?.forEach((contract) => {\n map.set(`${contract.namespaceId}.${contract.name}`, contract);\n });\n};\n\nexport function collectContract(contracts: Contract[] | undefined): void {\n addContract(contracts, contractsMap);\n}\n\nexport function collectWidgetContract(contracts: Contract[] | undefined): void {\n addContract(contracts, widgetContractMap);\n}\n\nexport function clearCollectWidgetContract(): void {\n widgetContractMap.clear();\n}\n\nexport function collectDebugContract(contracts: Contract[] | undefined): void {\n addContract(contracts, debugContractMap);\n}\n\nexport function clearDebugContract() {\n debugContractMap.clear();\n}\n\nexport function getContract(name: string): Contract | undefined {\n return (\n contractsMap.get(name) ||\n widgetContractMap.get(name) ||\n debugContractMap.get(name)\n );\n}\n"],"mappings":"AAEA,IAAMA,YAAmC,GAAG,IAAIC,GAAG,CAAC,CAAC;AACrD,IAAMC,iBAAwC,GAAG,IAAID,GAAG,CAAC,CAAC;AAC1D,IAAME,gBAAuC,GAAG,IAAIF,GAAG,CAAC,CAAC;AAEzD,IAAMG,WAAW,GAAGA,CAClBC,SAAiC,EACjCC,GAA0B,KACjB;EACTD,SAAS,aAATA,SAAS,eAATA,SAAS,CAAEE,OAAO,CAAEC,QAAQ,IAAK;IAC/BF,GAAG,CAACG,GAAG,IAAAC,MAAA,CAAIF,QAAQ,CAACG,WAAW,OAAAD,MAAA,CAAIF,QAAQ,CAACI,IAAI,GAAIJ,QAAQ,CAAC;EAC/D,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,SAASK,eAAeA,CAACR,SAAiC,EAAQ;EACvED,WAAW,CAACC,SAAS,EAAEL,YAAY,CAAC;AACtC;AAEA,OAAO,SAASc,qBAAqBA,CAACT,SAAiC,EAAQ;EAC7ED,WAAW,CAACC,SAAS,EAAEH,iBAAiB,CAAC;AAC3C;AAEA,OAAO,SAASa,0BAA0BA,CAAA,EAAS;EACjDb,iBAAiB,CAACc,KAAK,CAAC,CAAC;AAC3B;AAEA,OAAO,SAASC,oBAAoBA,CAACZ,SAAiC,EAAQ;EAC5ED,WAAW,CAACC,SAAS,EAAEF,gBAAgB,CAAC;AAC1C;AAEA,OAAO,SAASe,kBAAkBA,CAAA,EAAG;EACnCf,gBAAgB,CAACa,KAAK,CAAC,CAAC;AAC1B;AAEA,OAAO,SAASG,WAAWA,CAACP,IAAY,EAAwB;EAC9D,OACEZ,YAAY,CAACoB,GAAG,CAACR,IAAI,CAAC,IACtBV,iBAAiB,CAACkB,GAAG,CAACR,IAAI,CAAC,IAC3BT,gBAAgB,CAACiB,GAAG,CAACR,IAAI,CAAC;AAE9B","ignoreList":[]}
@@ -1,4 +1,4 @@
1
1
  export { FLOW_API_PROVIDER, registerFlowApiProvider } from "./FlowApiProvider.js";
2
2
  export { isFlowApiProvider, getArgsOfFlowApi } from "./FlowApi.js";
3
- export { collectContract, collectWidgetContract, clearCollectWidgetContract } from "./CollectContracts.js";
3
+ export { collectContract, collectWidgetContract, clearCollectWidgetContract, collectDebugContract, clearDebugContract } from "./CollectContracts.js";
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["FLOW_API_PROVIDER","registerFlowApiProvider","isFlowApiProvider","getArgsOfFlowApi","collectContract","collectWidgetContract","clearCollectWidgetContract"],"sources":["../../../src/flowApi/index.ts"],"sourcesContent":["export {\n FLOW_API_PROVIDER,\n registerFlowApiProvider,\n} from \"./FlowApiProvider.js\";\n\nexport { isFlowApiProvider, getArgsOfFlowApi } from \"./FlowApi.js\";\n\nexport {\n collectContract,\n collectWidgetContract,\n clearCollectWidgetContract,\n} from \"./CollectContracts.js\";\n"],"mappings":"AAAA,SACEA,iBAAiB,EACjBC,uBAAuB,QAClB,sBAAsB;AAE7B,SAASC,iBAAiB,EAAEC,gBAAgB,QAAQ,cAAc;AAElE,SACEC,eAAe,EACfC,qBAAqB,EACrBC,0BAA0B,QACrB,uBAAuB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["FLOW_API_PROVIDER","registerFlowApiProvider","isFlowApiProvider","getArgsOfFlowApi","collectContract","collectWidgetContract","clearCollectWidgetContract","collectDebugContract","clearDebugContract"],"sources":["../../../src/flowApi/index.ts"],"sourcesContent":["export {\n FLOW_API_PROVIDER,\n registerFlowApiProvider,\n} from \"./FlowApiProvider.js\";\n\nexport { isFlowApiProvider, getArgsOfFlowApi } from \"./FlowApi.js\";\n\nexport {\n collectContract,\n collectWidgetContract,\n clearCollectWidgetContract,\n collectDebugContract,\n clearDebugContract,\n} from \"./CollectContracts.js\";\n"],"mappings":"AAAA,SACEA,iBAAiB,EACjBC,uBAAuB,QAClB,sBAAsB;AAE7B,SAASC,iBAAiB,EAAEC,gBAAgB,QAAQ,cAAc;AAElE,SACEC,eAAe,EACfC,qBAAqB,EACrBC,0BAA0B,EAC1BC,oBAAoB,EACpBC,kBAAkB,QACb,uBAAuB","ignoreList":[]}
@@ -2,4 +2,6 @@ import { Contract } from "@next-core/types";
2
2
  export declare function collectContract(contracts: Contract[] | undefined): void;
3
3
  export declare function collectWidgetContract(contracts: Contract[] | undefined): void;
4
4
  export declare function clearCollectWidgetContract(): void;
5
+ export declare function collectDebugContract(contracts: Contract[] | undefined): void;
6
+ export declare function clearDebugContract(): void;
5
7
  export declare function getContract(name: string): Contract | undefined;
@@ -1,3 +1,3 @@
1
1
  export { FLOW_API_PROVIDER, registerFlowApiProvider, } from "./FlowApiProvider.js";
2
2
  export { isFlowApiProvider, getArgsOfFlowApi } from "./FlowApi.js";
3
- export { collectContract, collectWidgetContract, clearCollectWidgetContract, } from "./CollectContracts.js";
3
+ export { collectContract, collectWidgetContract, clearCollectWidgetContract, collectDebugContract, clearDebugContract, } from "./CollectContracts.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-core/easyops-runtime",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "homepage": "https://github.com/easyops-cn/next-core/tree/v3/packages/easyops-runtime",
5
5
  "license": "GPL-3.0",
6
6
  "repository": {
@@ -47,7 +47,7 @@
47
47
  "@next-core/cook": "^2.2.16",
48
48
  "@next-core/http": "^1.2.2",
49
49
  "@next-core/pipes": "^2.0.20",
50
- "@next-core/runtime": "^1.41.2",
50
+ "@next-core/runtime": "^1.42.0",
51
51
  "@next-core/types": "^1.10.0",
52
52
  "@next-core/utils": "^1.7.2",
53
53
  "js-yaml": "^3.14.1",
@@ -59,5 +59,5 @@
59
59
  "jest-websocket-mock": "^2.5.0",
60
60
  "whatwg-fetch": "^3.6.20"
61
61
  },
62
- "gitHead": "db50cd31e4f0e9ad071aae54d84e5f2c686749cc"
62
+ "gitHead": "0c3b5004d371d18739eaa4b6f30c42763529f7e4"
63
63
  }