oipage 1.7.0-alpha.7 → 1.7.0-rc.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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * json of OIPage v1.7.0-alpha.7
2
+ * json of OIPage v1.7.0-rc.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
  const {reader} = require("../reader/index.js");
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * logform of OIPage v1.7.0-alpha.7
2
+ * logform of OIPage v1.7.0-rc.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
  const {linelog} = require("../cmdlog/index.js");
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * reader of OIPage v1.7.0-alpha.7
2
+ * reader of OIPage v1.7.0-rc.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * throttle of OIPage v1.7.0-alpha.7
2
+ * throttle of OIPage v1.7.0-rc.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
package/package.json CHANGED
@@ -1,46 +1,46 @@
1
- {
2
- "name": "oipage",
3
- "version": "1.7.0-alpha.7",
4
- "description": "前端网页或应用快速开发助手,包括开发服务器、辅助命令、实用API等",
5
- "sideEffects": false,
6
- "typings": "./types/index.d.ts",
7
- "scripts": {
8
- "dev": "node ./bin/run run \"node ./build/index.js watch\" \"npm run serve\"",
9
- "build": "node ./build/index.js",
10
- "serve": "node ./bin/run serve --config ./oipage.config.js",
11
- "dev:issue10": "node ./bin/run serve --proxy /proxydemo http://127.0.0.1:8080/docs -p 20000",
12
- "bug:issue5": "node ./bin/run run \"node ./bin/run serve\"",
13
- "bug:issue4": "node ./bin/run run \"node ./test/logform/index.spec.js\""
14
- },
15
- "bin": {
16
- "oipage-cli": "bin/run"
17
- },
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/oi-contrib/OIPage.git"
21
- },
22
- "keywords": [
23
- "dev",
24
- "server",
25
- "style",
26
- "css",
27
- "nodejs",
28
- "core",
29
- "oipage",
30
- "browser"
31
- ],
32
- "author": {
33
- "name": "zxl20070701",
34
- "url": "https://zxl20070701.github.io/notebook/home.html"
35
- },
36
- "license": "MIT",
37
- "bugs": {
38
- "url": "https://github.com/oi-contrib/OIPage/issues"
39
- },
40
- "homepage": "https://oi-contrib.github.io/OIPage",
41
- "dependencies": {
42
- "vislite": "^1.5.0",
43
- "xhtml-to-json": "^0.1.0",
44
- "zipaper": "^0.2.0"
45
- }
1
+ {
2
+ "name": "oipage",
3
+ "version": "1.7.0-rc.0",
4
+ "description": "前端网页或应用快速开发助手,包括开发服务器、辅助命令、实用API等",
5
+ "sideEffects": false,
6
+ "typings": "./types/index.d.ts",
7
+ "scripts": {
8
+ "dev": "node ./bin/run run \"node ./build/index.js watch\" \"npm run serve\"",
9
+ "build": "node ./build/index.js",
10
+ "serve": "node ./bin/run serve --config ./oipage.config.js",
11
+ "dev:issue10": "node ./bin/run serve --proxy /proxydemo http://127.0.0.1:8080/docs -p 20000",
12
+ "bug:issue5": "node ./bin/run run \"node ./bin/run serve\"",
13
+ "bug:issue4": "node ./bin/run run \"node ./test/logform/index.spec.js\""
14
+ },
15
+ "bin": {
16
+ "oipage-cli": "bin/run"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/oi-contrib/OIPage.git"
21
+ },
22
+ "keywords": [
23
+ "dev",
24
+ "server",
25
+ "style",
26
+ "css",
27
+ "nodejs",
28
+ "core",
29
+ "oipage",
30
+ "browser"
31
+ ],
32
+ "author": {
33
+ "name": "zxl20070701",
34
+ "url": "https://zxl20070701.github.io/notebook/home.html"
35
+ },
36
+ "license": "MIT",
37
+ "bugs": {
38
+ "url": "https://github.com/oi-contrib/OIPage/issues"
39
+ },
40
+ "homepage": "https://oi-contrib.github.io/OIPage",
41
+ "dependencies": {
42
+ "vislite": "^1.5.0",
43
+ "xhtml-to-json": "^0.1.0",
44
+ "zipaper": "^0.2.0"
45
+ }
46
46
  }
package/types/index.d.ts CHANGED
@@ -13,12 +13,8 @@ import "../nodejs/logform/index";
13
13
  declare module "oipage/nodejs/logform/index.js" {}
14
14
  import "../nodejs/reader/index";
15
15
  declare module "oipage/nodejs/reader/index.js" {}
16
- import "../nodejs/remote/index";
17
- declare module "oipage/nodejs/remote/index.js" {}
18
16
  import "../nodejs/throttle/index";
19
17
  declare module "oipage/nodejs/throttle/index.js" {}
20
- import "../web/XMLHttpRequest/index";
21
- declare module "oipage/web/XMLHttpRequest/index.js" {}
22
18
  import "../web/animation/index";
23
19
  declare module "oipage/web/animation/index.js" {}
24
20
  import "../web/format/index";
@@ -35,3 +31,5 @@ import "../web/style/index";
35
31
  declare module "oipage/web/style/index.js" {}
36
32
  import "../web/throttle/index";
37
33
  declare module "oipage/web/throttle/index.js" {}
34
+ import "../web/XMLHttpRequest/index";
35
+ declare module "oipage/web/XMLHttpRequest/index.js" {}
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * XMLHttpRequest of OIPage v1.7.0-alpha.7
2
+ * XMLHttpRequest of OIPage v1.7.0-rc.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * animation of OIPage v1.7.0-alpha.7
2
+ * animation of OIPage v1.7.0-rc.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * format of OIPage v1.7.0-alpha.7
2
+ * format of OIPage v1.7.0-rc.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
package/web/json/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * json of OIPage v1.7.0-alpha.7
2
+ * json of OIPage v1.7.0-rc.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
  import {reader} from "../reader/index.js";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * onReady of OIPage v1.7.0-alpha.7
2
+ * onReady of OIPage v1.7.0-rc.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * performChunk of OIPage v1.7.0-alpha.7
2
+ * performChunk of OIPage v1.7.0-rc.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * reader of OIPage v1.7.0-alpha.7
2
+ * reader of OIPage v1.7.0-rc.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * style of OIPage v1.7.0-alpha.7
2
+ * style of OIPage v1.7.0-rc.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * throttle of OIPage v1.7.0-alpha.7
2
+ * throttle of OIPage v1.7.0-rc.0
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,39 +0,0 @@
1
- interface resType {
2
-
3
- /**
4
- * 响应码
5
- */
6
- status: number
7
-
8
- type: "string" | "json" | "binary"
9
-
10
- /**
11
- * 响应体
12
- */
13
- data: string
14
-
15
- /**
16
- * 响应头
17
- */
18
- headers: {
19
- [key: string]: any
20
- }
21
- }
22
-
23
- export interface getType {
24
- (url: string, headers?: {
25
- [key: string]: any
26
- }): Promise<resType>
27
- }
28
-
29
- export let get: getType
30
-
31
- export interface postType {
32
- (url: string, headers?: {
33
- [key: string]: any
34
- }, params?: {
35
- [key: string]: any
36
- }): Promise<resType>
37
- }
38
-
39
- export let post: postType
@@ -1,91 +0,0 @@
1
- /*!
2
- * remote of OIPage v1.7.0-alpha.7
3
- * git+https://github.com/oi-contrib/OIPage.git
4
- */
5
-
6
- const https = require('https');
7
- const http = require('http');
8
-
9
- function remote(method, url, headers, param) {
10
- return new Promise((resolve, reject) => {
11
- let handler = /^https/.test(url) ? https : http;
12
-
13
- let execArray = /https*:\/\/([^\/]+)(.+)?/.exec(url);
14
- let hostport = execArray[1].split(":");
15
-
16
- // https://nodejs.org/download/release/v16.8.0/docs/api/http.html#http_http_request_options_callback
17
- const req = handler.request({
18
- hostname: hostport[0],
19
- port: hostport[1] || 80,
20
- path: execArray[2] || "/",
21
- method,
22
- headers
23
- }, (res) => {
24
-
25
- let _temp = (res.headers["content-type"] + "").split(";");
26
-
27
- // 数据类型
28
- let contentType = _temp[0];
29
-
30
- // 数据编码
31
- let contentEncoding = "";
32
- if (_temp[1]) contentEncoding = _temp[1].replace("charset=", "")
33
- else res.setEncoding("binary"); // 二进制
34
-
35
- const chunks = []; // 用于存储接收到的数据块
36
- let size = 0; // 用于跟踪接收到的数据总量
37
-
38
- res.on('data', (chunk) => {
39
- chunks.push(chunk); // 将接收到的数据块添加到数组中
40
- size += chunk.length; // 更新已接收的数据总量
41
- });
42
-
43
- res.on('end', () => {
44
- let data = Buffer.concat(chunks, size); // 将所有数据块合并为一个Buffer
45
- let type = "binary"
46
-
47
- // 如果有编码,认为是文本
48
- if (contentEncoding) {
49
- data = data.toString('utf8');
50
- type = "string";
51
- }
52
-
53
- // JSON文件
54
- if (contentType === "application/json") {
55
- try {
56
- data = JSON.parse(data);
57
- type = "json";
58
- } catch (e) { }
59
- }
60
-
61
- resolve({
62
- status: res.statusCode,
63
- type,
64
- data,
65
- headers: res.headers
66
- });
67
- });
68
-
69
- });
70
-
71
- if (param) req.write(param);
72
-
73
- req.on('error', (e) => {
74
- reject(e);
75
- });
76
- req.end();
77
- });
78
- }
79
-
80
- // GET请求
81
- function get(url, headers = {}) {
82
- return remote("GET", url, headers)
83
- };
84
-
85
- // POST请求
86
- function post(url, headers = {}, params = {}) {
87
- return remote("POST", url, headers, JSON.stringify(params));
88
- };
89
-
90
- exports.get = get;
91
- exports.post = post;