@apiquest/plugin-http 1.0.2 → 1.0.5
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/README.md +154 -0
- package/dist/index.js +3167 -2953
- package/dist/index.js.map +1 -1
- package/esbuild.config.js +34 -34
- package/package.json +66 -62
- package/rollup.config.js +31 -31
- package/tsconfig.json +20 -20
- package/tsconfig.test.json +5 -5
- package/vitest.config.ts +12 -12
- package/dist/src/index.d.ts +0 -4
- package/dist/src/index.d.ts.map +0 -1
- package/src/index.ts +0 -420
package/esbuild.config.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import esbuild from 'esbuild';
|
|
2
|
-
|
|
3
|
-
await esbuild.build({
|
|
4
|
-
entryPoints: ['src/index.ts'],
|
|
5
|
-
bundle: true,
|
|
6
|
-
outfile: 'dist/index.js',
|
|
7
|
-
format: 'esm',
|
|
8
|
-
platform: 'node',
|
|
9
|
-
target: 'node18',
|
|
10
|
-
// Externalize peerDependencies and Node.js built-ins
|
|
11
|
-
external: [
|
|
12
|
-
'@apiquest/fracture',
|
|
13
|
-
// Node.js built-in modules (got depends on these)
|
|
14
|
-
'http',
|
|
15
|
-
'https',
|
|
16
|
-
'http2',
|
|
17
|
-
'net',
|
|
18
|
-
'tls',
|
|
19
|
-
'stream',
|
|
20
|
-
'util',
|
|
21
|
-
'url',
|
|
22
|
-
'zlib',
|
|
23
|
-
'events',
|
|
24
|
-
'buffer',
|
|
25
|
-
'querystring',
|
|
26
|
-
'dns',
|
|
27
|
-
'fs',
|
|
28
|
-
'path',
|
|
29
|
-
],
|
|
30
|
-
minify: false,
|
|
31
|
-
sourcemap: true,
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
console.log('✓ Built plugin-http');
|
|
1
|
+
import esbuild from 'esbuild';
|
|
2
|
+
|
|
3
|
+
await esbuild.build({
|
|
4
|
+
entryPoints: ['src/index.ts'],
|
|
5
|
+
bundle: true,
|
|
6
|
+
outfile: 'dist/index.js',
|
|
7
|
+
format: 'esm',
|
|
8
|
+
platform: 'node',
|
|
9
|
+
target: 'node18',
|
|
10
|
+
// Externalize peerDependencies and Node.js built-ins
|
|
11
|
+
external: [
|
|
12
|
+
'@apiquest/fracture',
|
|
13
|
+
// Node.js built-in modules (got depends on these)
|
|
14
|
+
'http',
|
|
15
|
+
'https',
|
|
16
|
+
'http2',
|
|
17
|
+
'net',
|
|
18
|
+
'tls',
|
|
19
|
+
'stream',
|
|
20
|
+
'util',
|
|
21
|
+
'url',
|
|
22
|
+
'zlib',
|
|
23
|
+
'events',
|
|
24
|
+
'buffer',
|
|
25
|
+
'querystring',
|
|
26
|
+
'dns',
|
|
27
|
+
'fs',
|
|
28
|
+
'path',
|
|
29
|
+
],
|
|
30
|
+
minify: false,
|
|
31
|
+
sourcemap: true,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
console.log('✓ Built plugin-http');
|
package/package.json
CHANGED
|
@@ -1,62 +1,66 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@apiquest/plugin-http",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "HTTP protocol plugin for
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@apiquest/plugin-http",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "HTTP protocol plugin for ApiQuest",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/hh-apiquest/fracture.git",
|
|
11
|
+
"directory": "packages/plugin-http"
|
|
12
|
+
},
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "rollup -c && tsc --emitDeclarationOnly",
|
|
15
|
+
"dev": "rollup -c --watch",
|
|
16
|
+
"test": "vitest"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"api",
|
|
20
|
+
"http",
|
|
21
|
+
"quest",
|
|
22
|
+
"plugin"
|
|
23
|
+
],
|
|
24
|
+
"author": "ApiQuest",
|
|
25
|
+
"license": "AGPL-3.0-or-later",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"got": "^14.6.6",
|
|
28
|
+
"hpagent": "^1.2.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@apiquest/types": "workspace:*",
|
|
32
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
33
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
34
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
35
|
+
"@types/node": "^25.2.3",
|
|
36
|
+
"rollup": "^4.57.1",
|
|
37
|
+
"typescript": "^5.3.3",
|
|
38
|
+
"vitest": "^4.0.18"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@apiquest/types": "^1.0.0"
|
|
42
|
+
},
|
|
43
|
+
"apiquest": {
|
|
44
|
+
"type": "protocol",
|
|
45
|
+
"runtime": [
|
|
46
|
+
"fracture"
|
|
47
|
+
],
|
|
48
|
+
"capabilities": {
|
|
49
|
+
"provides": {
|
|
50
|
+
"protocols": [
|
|
51
|
+
"http"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"supports": {
|
|
55
|
+
"authTypes": [
|
|
56
|
+
"bearer",
|
|
57
|
+
"basic",
|
|
58
|
+
"oauth2",
|
|
59
|
+
"apikey",
|
|
60
|
+
"digest",
|
|
61
|
+
"ntlm"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
package/rollup.config.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import typescript from '@rollup/plugin-typescript';
|
|
2
|
-
import resolve from '@rollup/plugin-node-resolve';
|
|
3
|
-
import commonjs from '@rollup/plugin-commonjs';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
input: 'src/index.ts',
|
|
7
|
-
output: {
|
|
8
|
-
file: 'dist/index.js',
|
|
9
|
-
format: 'esm',
|
|
10
|
-
sourcemap: true,
|
|
11
|
-
},
|
|
12
|
-
external: [
|
|
13
|
-
// Externalize peer dependencies
|
|
14
|
-
'@apiquest/fracture',
|
|
15
|
-
],
|
|
16
|
-
plugins: [
|
|
17
|
-
// Resolve node modules
|
|
18
|
-
resolve({
|
|
19
|
-
preferBuiltins: true, // Prefer Node.js built-in modules
|
|
20
|
-
exportConditions: ['node', 'import', 'default'],
|
|
21
|
-
}),
|
|
22
|
-
// Convert CommonJS to ESM (for any CJS dependencies)
|
|
23
|
-
commonjs(),
|
|
24
|
-
// Compile TypeScript
|
|
25
|
-
typescript({
|
|
26
|
-
tsconfig: './tsconfig.json',
|
|
27
|
-
sourceMap: true,
|
|
28
|
-
declaration: false, // We'll use tsc for declarations
|
|
29
|
-
}),
|
|
30
|
-
],
|
|
31
|
-
};
|
|
1
|
+
import typescript from '@rollup/plugin-typescript';
|
|
2
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
3
|
+
import commonjs from '@rollup/plugin-commonjs';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
input: 'src/index.ts',
|
|
7
|
+
output: {
|
|
8
|
+
file: 'dist/index.js',
|
|
9
|
+
format: 'esm',
|
|
10
|
+
sourcemap: true,
|
|
11
|
+
},
|
|
12
|
+
external: [
|
|
13
|
+
// Externalize peer dependencies
|
|
14
|
+
'@apiquest/fracture',
|
|
15
|
+
],
|
|
16
|
+
plugins: [
|
|
17
|
+
// Resolve node modules
|
|
18
|
+
resolve({
|
|
19
|
+
preferBuiltins: true, // Prefer Node.js built-in modules
|
|
20
|
+
exportConditions: ['node', 'import', 'default'],
|
|
21
|
+
}),
|
|
22
|
+
// Convert CommonJS to ESM (for any CJS dependencies)
|
|
23
|
+
commonjs(),
|
|
24
|
+
// Compile TypeScript
|
|
25
|
+
typescript({
|
|
26
|
+
tsconfig: './tsconfig.json',
|
|
27
|
+
sourceMap: true,
|
|
28
|
+
declaration: false, // We'll use tsc for declarations
|
|
29
|
+
}),
|
|
30
|
+
],
|
|
31
|
+
};
|
package/tsconfig.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ES2022",
|
|
5
|
-
"lib": ["ES2022"],
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"outDir": "./dist",
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"declarationMap": true,
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"strict": true,
|
|
12
|
-
"esModuleInterop": true,
|
|
13
|
-
"skipLibCheck": true,
|
|
14
|
-
"forceConsistentCasingInFileNames": true,
|
|
15
|
-
"resolveJsonModule": true,
|
|
16
|
-
"allowSyntheticDefaultImports": true
|
|
17
|
-
},
|
|
18
|
-
"include": ["src/**/*"],
|
|
19
|
-
"exclude": ["node_modules", "dist", "tests"]
|
|
20
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ES2022",
|
|
5
|
+
"lib": ["ES2022"],
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"declarationMap": true,
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"skipLibCheck": true,
|
|
14
|
+
"forceConsistentCasingInFileNames": true,
|
|
15
|
+
"resolveJsonModule": true,
|
|
16
|
+
"allowSyntheticDefaultImports": true
|
|
17
|
+
},
|
|
18
|
+
"include": ["src/**/*"],
|
|
19
|
+
"exclude": ["node_modules", "dist", "tests"]
|
|
20
|
+
}
|
package/tsconfig.test.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"include": ["tests/**/*"],
|
|
4
|
-
"exclude": []
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"include": ["tests/**/*"],
|
|
4
|
+
"exclude": []
|
|
5
|
+
}
|
package/vitest.config.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineConfig } from 'vitest/config';
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
test: {
|
|
5
|
-
globals: true,
|
|
6
|
-
environment: 'node',
|
|
7
|
-
coverage: {
|
|
8
|
-
provider: 'v8',
|
|
9
|
-
reporter: ['text', 'json', 'html'],
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
});
|
|
1
|
+
import { defineConfig } from 'vitest/config';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
globals: true,
|
|
6
|
+
environment: 'node',
|
|
7
|
+
coverage: {
|
|
8
|
+
provider: 'v8',
|
|
9
|
+
reporter: ['text', 'json', 'html'],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
});
|
package/dist/src/index.d.ts
DELETED
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAA2G,MAAM,iBAAiB,CAAC;AAmBhK,eAAO,MAAM,UAAU,EAAE,eAmRxB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|