@alessiofrittoli/fetcher 0.1.0-alpha.1 → 1.1.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.
- package/dist/error.d.mts +12 -3
- package/dist/error.d.ts +12 -3
- package/dist/fetch.d.mts +1 -2
- package/dist/fetch.d.ts +1 -2
- package/dist/ping.d.mts +8 -0
- package/dist/ping.d.ts +8 -0
- package/dist/ping.js +1 -0
- package/dist/ping.mjs +1 -0
- package/dist/{types-CVc-rxXe.d.ts → types-B7TKkr2l.d.ts} +1 -1
- package/dist/{types-DuGUXaTD.d.mts → types-DAKtp5Tp.d.mts} +1 -1
- package/dist/types.d.mts +1 -2
- package/dist/types.d.ts +1 -2
- package/dist/xhr/index.d.mts +1 -2
- package/dist/xhr/index.d.ts +1 -2
- package/package.json +78 -46
package/dist/error.d.mts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import { ErrorCode as ErrorCode$1 } from '@alessiofrittoli/exception/code';
|
|
2
|
-
|
|
3
1
|
declare enum Request {
|
|
4
2
|
XHR_NOT_AVAILABLE = "ERR:XHRNOTAVAILABLE",
|
|
5
3
|
XHR_INVALID_STATE = "ERR:XHRINVALIDSTATE"
|
|
6
4
|
}
|
|
7
5
|
declare const ErrorCode: {
|
|
8
|
-
Exception:
|
|
6
|
+
Exception: {
|
|
7
|
+
readonly UNKNOWN: "ERR:UNKNOWN";
|
|
8
|
+
readonly ABORT: "ERR:ABORT";
|
|
9
|
+
readonly EMPTY_VALUE: "ERR:EMPTYVALUE";
|
|
10
|
+
readonly WRONG_VALUE: "ERR:WRONGVALUE";
|
|
11
|
+
readonly EXPIRED: "ERR:EXPIRED";
|
|
12
|
+
readonly TOO_EARLY: "ERR:TOOEARLY";
|
|
13
|
+
readonly TOO_MANY: "ERR:TOOMANY";
|
|
14
|
+
readonly QUOTA_REACHED: "ERR:QUOTAREACHED";
|
|
15
|
+
readonly NOT_FOUND: "ERR:NOTFOUND";
|
|
16
|
+
readonly OFFLINE: "ERR:INTERNETDISCONNECTED";
|
|
17
|
+
};
|
|
9
18
|
Request: typeof Request;
|
|
10
19
|
};
|
|
11
20
|
type ErrorCode = MergedEnumValue<typeof ErrorCode>;
|
package/dist/error.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
import { ErrorCode as ErrorCode$1 } from '@alessiofrittoli/exception/code';
|
|
2
|
-
|
|
3
1
|
declare enum Request {
|
|
4
2
|
XHR_NOT_AVAILABLE = "ERR:XHRNOTAVAILABLE",
|
|
5
3
|
XHR_INVALID_STATE = "ERR:XHRINVALIDSTATE"
|
|
6
4
|
}
|
|
7
5
|
declare const ErrorCode: {
|
|
8
|
-
Exception:
|
|
6
|
+
Exception: {
|
|
7
|
+
readonly UNKNOWN: "ERR:UNKNOWN";
|
|
8
|
+
readonly ABORT: "ERR:ABORT";
|
|
9
|
+
readonly EMPTY_VALUE: "ERR:EMPTYVALUE";
|
|
10
|
+
readonly WRONG_VALUE: "ERR:WRONGVALUE";
|
|
11
|
+
readonly EXPIRED: "ERR:EXPIRED";
|
|
12
|
+
readonly TOO_EARLY: "ERR:TOOEARLY";
|
|
13
|
+
readonly TOO_MANY: "ERR:TOOMANY";
|
|
14
|
+
readonly QUOTA_REACHED: "ERR:QUOTAREACHED";
|
|
15
|
+
readonly NOT_FOUND: "ERR:NOTFOUND";
|
|
16
|
+
readonly OFFLINE: "ERR:INTERNETDISCONNECTED";
|
|
17
|
+
};
|
|
9
18
|
Request: typeof Request;
|
|
10
19
|
};
|
|
11
20
|
type ErrorCode = MergedEnumValue<typeof ErrorCode>;
|
package/dist/fetch.d.mts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { AbortSignal } from '@alessiofrittoli/abort-controller';
|
|
2
|
-
import { F as Fetch } from './types-
|
|
2
|
+
import { F as Fetch } from './types-DAKtp5Tp.mjs';
|
|
3
3
|
import '@alessiofrittoli/event-emitter';
|
|
4
4
|
import '@alessiofrittoli/exception';
|
|
5
5
|
import '@alessiofrittoli/exception/abort';
|
|
6
6
|
import '@alessiofrittoli/url-utils';
|
|
7
7
|
import './error.mjs';
|
|
8
|
-
import '@alessiofrittoli/exception/code';
|
|
9
8
|
|
|
10
9
|
interface RequestInit extends globalThis.RequestInit {
|
|
11
10
|
signal?: AbortSignal;
|
package/dist/fetch.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { AbortSignal } from '@alessiofrittoli/abort-controller';
|
|
2
|
-
import { F as Fetch } from './types-
|
|
2
|
+
import { F as Fetch } from './types-B7TKkr2l.js';
|
|
3
3
|
import '@alessiofrittoli/event-emitter';
|
|
4
4
|
import '@alessiofrittoli/exception';
|
|
5
5
|
import '@alessiofrittoli/exception/abort';
|
|
6
6
|
import '@alessiofrittoli/url-utils';
|
|
7
7
|
import './error.js';
|
|
8
|
-
import '@alessiofrittoli/exception/code';
|
|
9
8
|
|
|
10
9
|
interface RequestInit extends globalThis.RequestInit {
|
|
11
10
|
signal?: AbortSignal;
|
package/dist/ping.d.mts
ADDED
package/dist/ping.d.ts
ADDED
package/dist/ping.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _urlutils = require('@alessiofrittoli/url-utils');var l=(n,t)=>{navigator.sendBeacon(_urlutils.Url.format(n),t)};exports.ping = l;
|
package/dist/ping.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Url as o}from"@alessiofrittoli/url-utils";var a=(n,t)=>{navigator.sendBeacon(o.format(n),t)};export{a as ping};
|
|
@@ -15,7 +15,7 @@ declare class Xhr<TReturn = unknown> extends EventEmitter<XHR.Event.Map<TReturn>
|
|
|
15
15
|
request: XMLHttpRequest;
|
|
16
16
|
url: _alessiofrittoli_url_utils.UrlInput;
|
|
17
17
|
method: RequestMethod;
|
|
18
|
-
body:
|
|
18
|
+
body: Document | XMLHttpRequestBodyInit | undefined;
|
|
19
19
|
headers: Headers;
|
|
20
20
|
credentials: {
|
|
21
21
|
username?: string | null;
|
|
@@ -15,7 +15,7 @@ declare class Xhr<TReturn = unknown> extends EventEmitter<XHR.Event.Map<TReturn>
|
|
|
15
15
|
request: XMLHttpRequest;
|
|
16
16
|
url: _alessiofrittoli_url_utils.UrlInput;
|
|
17
17
|
method: RequestMethod;
|
|
18
|
-
body:
|
|
18
|
+
body: Document | XMLHttpRequestBodyInit | undefined;
|
|
19
19
|
headers: Headers;
|
|
20
20
|
credentials: {
|
|
21
21
|
username?: string | null;
|
package/dist/types.d.mts
CHANGED
|
@@ -4,5 +4,4 @@ import '@alessiofrittoli/exception/abort';
|
|
|
4
4
|
import '@alessiofrittoli/url-utils';
|
|
5
5
|
import '@alessiofrittoli/abort-controller';
|
|
6
6
|
import './error.mjs';
|
|
7
|
-
export { F as Fetch, R as RequestMethod, a as XHR } from './types-
|
|
8
|
-
import '@alessiofrittoli/exception/code';
|
|
7
|
+
export { F as Fetch, R as RequestMethod, a as XHR } from './types-DAKtp5Tp.mjs';
|
package/dist/types.d.ts
CHANGED
|
@@ -4,5 +4,4 @@ import '@alessiofrittoli/exception/abort';
|
|
|
4
4
|
import '@alessiofrittoli/url-utils';
|
|
5
5
|
import '@alessiofrittoli/abort-controller';
|
|
6
6
|
import './error.js';
|
|
7
|
-
export { F as Fetch, R as RequestMethod, a as XHR } from './types-
|
|
8
|
-
import '@alessiofrittoli/exception/code';
|
|
7
|
+
export { F as Fetch, R as RequestMethod, a as XHR } from './types-B7TKkr2l.js';
|
package/dist/xhr/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export { X as Xhr } from '../types-
|
|
1
|
+
export { X as Xhr } from '../types-DAKtp5Tp.mjs';
|
|
2
2
|
import '@alessiofrittoli/url-utils';
|
|
3
3
|
import '@alessiofrittoli/event-emitter';
|
|
4
4
|
import '@alessiofrittoli/exception/abort';
|
|
5
5
|
import '@alessiofrittoli/abort-controller';
|
|
6
6
|
import '../error.mjs';
|
|
7
7
|
import '@alessiofrittoli/exception';
|
|
8
|
-
import '@alessiofrittoli/exception/code';
|
package/dist/xhr/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export { X as Xhr } from '../types-
|
|
1
|
+
export { X as Xhr } from '../types-B7TKkr2l.js';
|
|
2
2
|
import '@alessiofrittoli/url-utils';
|
|
3
3
|
import '@alessiofrittoli/event-emitter';
|
|
4
4
|
import '@alessiofrittoli/exception/abort';
|
|
5
5
|
import '@alessiofrittoli/abort-controller';
|
|
6
6
|
import '../error.js';
|
|
7
7
|
import '@alessiofrittoli/exception';
|
|
8
|
-
import '@alessiofrittoli/exception/code';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alessiofrittoli/fetcher",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Typescript fetch/xhr utilities",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Alessio Frittoli",
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
],
|
|
17
17
|
"keywords": [
|
|
18
18
|
"fetch",
|
|
19
|
-
"ajax"
|
|
19
|
+
"ajax",
|
|
20
|
+
"ping"
|
|
20
21
|
],
|
|
21
22
|
"homepage": "https://github.com/alessiofrittoli/fetcher#readme",
|
|
22
23
|
"bugs": {
|
|
@@ -36,27 +37,62 @@
|
|
|
36
37
|
],
|
|
37
38
|
"exports": {
|
|
38
39
|
".": {
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
"import": {
|
|
41
|
+
"types": "./dist/index.d.mts",
|
|
42
|
+
"default": "./dist/index.mjs"
|
|
43
|
+
},
|
|
44
|
+
"require": {
|
|
45
|
+
"types": "./dist/index.d.ts",
|
|
46
|
+
"default": "./dist/index.js"
|
|
47
|
+
}
|
|
42
48
|
},
|
|
43
49
|
"./fetch": {
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
"import": {
|
|
51
|
+
"types": "./dist/fetch.d.mts",
|
|
52
|
+
"default": "./dist/fetch.mjs"
|
|
53
|
+
},
|
|
54
|
+
"require": {
|
|
55
|
+
"types": "./dist/fetch.d.ts",
|
|
56
|
+
"default": "./dist/fetch.js"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"./ping": {
|
|
60
|
+
"import": {
|
|
61
|
+
"types": "./dist/ping.d.mts",
|
|
62
|
+
"default": "./dist/ping.mjs"
|
|
63
|
+
},
|
|
64
|
+
"require": {
|
|
65
|
+
"types": "./dist/ping.d.ts",
|
|
66
|
+
"default": "./dist/ping.js"
|
|
67
|
+
}
|
|
47
68
|
},
|
|
48
69
|
"./xhr": {
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
70
|
+
"import": {
|
|
71
|
+
"types": "./dist/xhr/index.d.mts",
|
|
72
|
+
"default": "./dist/xhr/index.mjs"
|
|
73
|
+
},
|
|
74
|
+
"require": {
|
|
75
|
+
"types": "./dist/xhr/index.d.ts",
|
|
76
|
+
"default": "./dist/xhr/index.js"
|
|
77
|
+
}
|
|
52
78
|
},
|
|
53
79
|
"./error": {
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
80
|
+
"import": {
|
|
81
|
+
"types": "./dist/error.d.mts",
|
|
82
|
+
"default": "./dist/error.mjs"
|
|
83
|
+
},
|
|
84
|
+
"require": {
|
|
85
|
+
"types": "./dist/error.d.ts",
|
|
86
|
+
"default": "./dist/error.js"
|
|
87
|
+
}
|
|
57
88
|
},
|
|
58
89
|
"./types": {
|
|
59
|
-
"
|
|
90
|
+
"import": {
|
|
91
|
+
"types": "./dist/types.d.mts"
|
|
92
|
+
},
|
|
93
|
+
"require": {
|
|
94
|
+
"types": "./dist/types.d.ts"
|
|
95
|
+
}
|
|
60
96
|
}
|
|
61
97
|
},
|
|
62
98
|
"sideEffects": false,
|
|
@@ -64,11 +100,12 @@
|
|
|
64
100
|
"//1a": "*********************************************************************",
|
|
65
101
|
"//1b": "******************** DEV - BUILD - LINT - RELEASE *******************",
|
|
66
102
|
"//1c": "*********************************************************************",
|
|
67
|
-
"dev": "NODE_ENV=development tsup --watch",
|
|
68
|
-
"build:prod": "NODE_ENV=production tsup",
|
|
103
|
+
"dev": "cross-env NODE_ENV=development tsup --watch",
|
|
104
|
+
"build:prod": "cross-env NODE_ENV=production tsup",
|
|
69
105
|
"build": "pnpm lint && pnpm test:ci && pnpm build:prod",
|
|
70
106
|
"lint": "eslint",
|
|
71
|
-
"
|
|
107
|
+
"postinstall": "node scripts/postinstall/index.js",
|
|
108
|
+
"release": "node scripts/release.js --verbose --npm",
|
|
72
109
|
"//2a": "*********************************************************************",
|
|
73
110
|
"//2b": "***************************** UNIT TESTS ****************************",
|
|
74
111
|
"//2c": "*********************************************************************",
|
|
@@ -88,38 +125,33 @@
|
|
|
88
125
|
"test:fetch": "pnpm test:watch fetch.test.ts"
|
|
89
126
|
},
|
|
90
127
|
"devDependencies": {
|
|
91
|
-
"@alessiofrittoli/crypto-buffer": "^3.
|
|
92
|
-
"@eslint/js": "^
|
|
93
|
-
"@jest/globals": "^
|
|
94
|
-
"@types/jest": "^
|
|
95
|
-
"@types/node": "^
|
|
96
|
-
"concurrently": "^9.1
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
128
|
+
"@alessiofrittoli/crypto-buffer": "^3.11.0",
|
|
129
|
+
"@eslint/js": "^10.0.1",
|
|
130
|
+
"@jest/globals": "^30.2.0",
|
|
131
|
+
"@types/jest": "^30.0.0",
|
|
132
|
+
"@types/node": "^25.2.3",
|
|
133
|
+
"concurrently": "^9.2.1",
|
|
134
|
+
"cross-env": "^10.1.0",
|
|
135
|
+
"dotenv": "^17.3.1",
|
|
136
|
+
"eslint": "^10.0.0",
|
|
137
|
+
"globals": "^17.3.0",
|
|
100
138
|
"http-server": "^14.1.1",
|
|
101
|
-
"jest": "^
|
|
102
|
-
"jest-environment-jsdom": "^
|
|
103
|
-
"ts-jest": "^29.
|
|
139
|
+
"jest": "^30.2.0",
|
|
140
|
+
"jest-environment-jsdom": "^30.2.0",
|
|
141
|
+
"ts-jest": "^29.4.6",
|
|
104
142
|
"ts-node": "^10.9.2",
|
|
105
|
-
"tsup": "^8.5.
|
|
106
|
-
"typescript": "^5.
|
|
107
|
-
"typescript-eslint": "^8.
|
|
143
|
+
"tsup": "^8.5.1",
|
|
144
|
+
"typescript": "^5.9.3",
|
|
145
|
+
"typescript-eslint": "^8.55.0"
|
|
108
146
|
},
|
|
109
147
|
"dependencies": {
|
|
110
148
|
"@alessiofrittoli/abort-controller": "^0.1.0",
|
|
111
|
-
"@alessiofrittoli/chain-functions": "^2.
|
|
112
|
-
"@alessiofrittoli/event-emitter": "^1.
|
|
113
|
-
"@alessiofrittoli/exception": "^3.
|
|
114
|
-
"@alessiofrittoli/node-scripts": "^
|
|
115
|
-
"@alessiofrittoli/type-utils": "^1.
|
|
116
|
-
"@alessiofrittoli/url-utils": "^3.
|
|
117
|
-
"@alessiofrittoli/web-utils": "^1.
|
|
118
|
-
},
|
|
119
|
-
"pnpm": {
|
|
120
|
-
"onlyBuiltDependencies": [
|
|
121
|
-
"@alessiofrittoli/type-utils",
|
|
122
|
-
"esbuild"
|
|
123
|
-
]
|
|
149
|
+
"@alessiofrittoli/chain-functions": "^2.5.0",
|
|
150
|
+
"@alessiofrittoli/event-emitter": "^1.6.0",
|
|
151
|
+
"@alessiofrittoli/exception": "^3.5.0",
|
|
152
|
+
"@alessiofrittoli/node-scripts": "^3.3.0",
|
|
153
|
+
"@alessiofrittoli/type-utils": "^1.9.0",
|
|
154
|
+
"@alessiofrittoli/url-utils": "^3.7.1",
|
|
155
|
+
"@alessiofrittoli/web-utils": "^1.20.0"
|
|
124
156
|
}
|
|
125
157
|
}
|