@brandup/ui-ajax 2.0.1 → 2.0.2
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 +1 -1
- package/dist/cjs/ajax-request.js +125 -0
- package/dist/cjs/ajax-request.js.map +1 -0
- package/dist/cjs/helpers.js +69 -0
- package/dist/cjs/helpers.js.map +1 -0
- package/dist/cjs/index.js +7 -495
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/internals.js +82 -0
- package/dist/cjs/internals.js.map +1 -0
- package/dist/cjs/queue.js +138 -0
- package/dist/cjs/queue.js.map +1 -0
- package/dist/cjs/request.js +108 -0
- package/dist/cjs/request.js.map +1 -0
- package/dist/mjs/ajax-request.js +123 -0
- package/dist/mjs/ajax-request.js.map +1 -0
- package/dist/mjs/helpers.js +65 -0
- package/dist/mjs/helpers.js.map +1 -0
- package/dist/mjs/index.js +5 -496
- package/dist/mjs/index.js.map +1 -1
- package/dist/mjs/internals.js +78 -0
- package/dist/mjs/internals.js.map +1 -0
- package/dist/mjs/queue.js +136 -0
- package/dist/mjs/queue.js.map +1 -0
- package/dist/mjs/request.js +106 -0
- package/dist/mjs/request.js.map +1 -0
- package/package.json +9 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { request } from './request.js';
|
|
2
|
+
|
|
3
|
+
/** Queue that executes AJAX requests one at a time, in the order they were added. */
|
|
4
|
+
class AjaxQueue {
|
|
5
|
+
_options;
|
|
6
|
+
_requests = [];
|
|
7
|
+
_current = null;
|
|
8
|
+
_destroyed = false;
|
|
9
|
+
/** @param options Optional queue-wide hooks. */
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this._options = options ?? {};
|
|
12
|
+
}
|
|
13
|
+
/** Number of requests waiting in the queue (excluding the one currently executing). */
|
|
14
|
+
get length() { return this._requests.length; }
|
|
15
|
+
/** `true` when nothing is queued and no request is currently executing. */
|
|
16
|
+
get isFree() { return !this._requests.length && !this._current; }
|
|
17
|
+
/** `true` when no requests are waiting in the queue (a request may still be executing). */
|
|
18
|
+
get isEmpty() { return !this._requests.length; }
|
|
19
|
+
/**
|
|
20
|
+
* Adds a request to the queue. Starts executing immediately if the queue is idle.
|
|
21
|
+
*
|
|
22
|
+
* @param request Request options; its `success`/`error` callbacks are invoked as usual.
|
|
23
|
+
* @param abortSignal Optional signal used to cancel this specific request.
|
|
24
|
+
* @throws If the queue has been destroyed.
|
|
25
|
+
*/
|
|
26
|
+
push(request, abortSignal) {
|
|
27
|
+
if (this._destroyed)
|
|
28
|
+
throw new Error("AjaxQueue is destroyed.");
|
|
29
|
+
this._requests.push({ request, cancel: abortSignal });
|
|
30
|
+
if (!this._current)
|
|
31
|
+
this.__execute();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Adds a request to the queue and returns a promise for its response.
|
|
35
|
+
*
|
|
36
|
+
* Wraps {@link push}; the request's own `success`/`error` callbacks are still invoked,
|
|
37
|
+
* then the promise resolves with the response or rejects with the failure reason.
|
|
38
|
+
*
|
|
39
|
+
* @param request Request options.
|
|
40
|
+
* @param abortSignal Optional signal used to cancel this specific request.
|
|
41
|
+
* @returns A promise resolving with the {@link AjaxResponse}.
|
|
42
|
+
*/
|
|
43
|
+
enqueue(request, abortSignal) {
|
|
44
|
+
const { success, error } = request;
|
|
45
|
+
return new Promise((resolve, reject) => {
|
|
46
|
+
request.success = (response) => {
|
|
47
|
+
if (success)
|
|
48
|
+
success(response);
|
|
49
|
+
resolve(response);
|
|
50
|
+
};
|
|
51
|
+
request.error = (request, reason) => {
|
|
52
|
+
if (error)
|
|
53
|
+
error(request, reason);
|
|
54
|
+
reject(reason);
|
|
55
|
+
};
|
|
56
|
+
this.push(request, abortSignal);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/** @deprecated Renamed to {@link enqueue}. */
|
|
60
|
+
enque(request, abortSignal) {
|
|
61
|
+
return this.enqueue(request, abortSignal);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Clears all queued (not-yet-started) requests.
|
|
65
|
+
*
|
|
66
|
+
* @param cancelCurrentRequest When `true`, also aborts the request currently executing.
|
|
67
|
+
*/
|
|
68
|
+
reset(cancelCurrentRequest = false) {
|
|
69
|
+
this._requests = [];
|
|
70
|
+
const current = this._current;
|
|
71
|
+
this._current = null;
|
|
72
|
+
if (cancelCurrentRequest && current)
|
|
73
|
+
current.abort?.abort("ResetAjaxQueue");
|
|
74
|
+
}
|
|
75
|
+
/** Destroys the queue: clears pending requests and aborts the current one. Subsequent {@link push} calls throw. */
|
|
76
|
+
destroy() {
|
|
77
|
+
if (this._destroyed)
|
|
78
|
+
return;
|
|
79
|
+
this._destroyed = true;
|
|
80
|
+
this._requests = [];
|
|
81
|
+
if (this._current) {
|
|
82
|
+
this._current.abort?.abort("DestroyAjaxQueue");
|
|
83
|
+
this._current = null;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
__execute() {
|
|
87
|
+
if (this._destroyed)
|
|
88
|
+
return;
|
|
89
|
+
if (this._current)
|
|
90
|
+
throw new Error("AjaxQueue currently is executing.");
|
|
91
|
+
const task = this._current = this._requests.shift() ?? null;
|
|
92
|
+
if (task) {
|
|
93
|
+
if (this._options.canRequest && this._options.canRequest(task.request) === false) {
|
|
94
|
+
this.__next(task);
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
if (task.request.abort?.aborted || task.cancel?.aborted) {
|
|
98
|
+
const err = new Error("Request cancelled");
|
|
99
|
+
task.request.error?.(task.request, err);
|
|
100
|
+
task.result = Promise.reject(err);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
task.abort = new AbortController();
|
|
104
|
+
task.result = request(task.request, task.cancel ? AbortSignal.any([task.abort.signal, task.cancel]) : task.abort.signal);
|
|
105
|
+
}
|
|
106
|
+
task.result
|
|
107
|
+
.then(response => {
|
|
108
|
+
if (this._destroyed)
|
|
109
|
+
return;
|
|
110
|
+
if (this._options.successRequest)
|
|
111
|
+
this._options.successRequest(task.request, response);
|
|
112
|
+
})
|
|
113
|
+
.catch(reason => {
|
|
114
|
+
if (this._destroyed)
|
|
115
|
+
return;
|
|
116
|
+
if (this._options.errorRequest)
|
|
117
|
+
this._options.errorRequest(task.request, reason);
|
|
118
|
+
})
|
|
119
|
+
.finally(() => this.__next(task));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// completedTask is the task that finished — if _current already changed
|
|
123
|
+
// (e.g. reset(true) was called and a new push() started a new task), bail out
|
|
124
|
+
// to avoid clearing the new task's reference or double-executing the queue.
|
|
125
|
+
__next(completedTask) {
|
|
126
|
+
if (this._destroyed)
|
|
127
|
+
return;
|
|
128
|
+
if (this._current !== completedTask)
|
|
129
|
+
return;
|
|
130
|
+
this._current = null;
|
|
131
|
+
this.__execute();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export { AjaxQueue };
|
|
136
|
+
//# sourceMappingURL=queue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.js","sources":["../../../source/queue.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAGA;MACa,SAAS,CAAA;AACb,IAAA,QAAQ;IACR,SAAS,GAAuB,EAAE;IAClC,QAAQ,GAAuB,IAAI;IACnC,UAAU,GAAG,KAAK;;AAG1B,IAAA,WAAA,CAAY,OAA0B,EAAA;AACrC,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAI,EAAE;IAC9B;;IAGA,IAAI,MAAM,GAAA,EAAa,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;;AAErD,IAAA,IAAI,MAAM,GAAA,EAAc,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;;IAEzE,IAAI,OAAO,GAAA,EAAc,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;AAExD;;;;;;AAMG;IACH,IAAI,CA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AAE;AAClC,gBAAA,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;YACzH;AAEA,YAAA,IAAI,CAAC;iBACH,IAAI,CAAC,QAAQ,IAAG;gBAChB,IAAI,IAAI,CAAC,UAAU;oBAClB;AAED,gBAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc;oBAC/B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;AACtD,YAAA,CAAC;iBACA,KAAK,CAAC,MAAM,IAAG;gBACf,IAAI,IAAI,CAAC,UAAU;oBAClB;AAED,gBAAA,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY;oBAC7B,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC;AAClD,YAAA,CAAC;iBACA,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACnC;IACD;;;;AAKQ,IAAA,MAAM,CAAC,aAA0B,EAAA;QACxC,IAAI,IAAI,CAAC,UAAU;YAClB;AACD,QAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,aAAa;YAClC;AAED,QAAA,IAAI,CAAC,QAAQ,GAAG,IAAI;QACpB,IAAI,CAAC,SAAS,EAAE;IACjB;AACA;;;;"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { addQuery } from './helpers.js';
|
|
2
|
+
import internals from './internals.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Performs an AJAX request using the Fetch API.
|
|
6
|
+
*
|
|
7
|
+
* The response body is parsed according to its `Content-Type`: JSON, `text/html`,
|
|
8
|
+
* `text/plain`, otherwise a `Blob`. `disableCache` maps to `cache: "no-store"`.
|
|
9
|
+
* The request is aborted when its `timeout` elapses (defaults to 30000 ms), or when
|
|
10
|
+
* `options.abort` or the `abortSignal` argument signals.
|
|
11
|
+
*
|
|
12
|
+
* @param options Request options. `GET`/`HEAD` requests must not carry `data`.
|
|
13
|
+
* @param abortSignal Optional additional signal used to cancel the request.
|
|
14
|
+
* @returns The parsed response. `options.success` is also invoked before resolving.
|
|
15
|
+
* @throws On network/abort/timeout errors, or for unsupported (opaque) response types; `options.error` is invoked before re-throwing.
|
|
16
|
+
*/
|
|
17
|
+
async function request(options, abortSignal) {
|
|
18
|
+
let { mode, credentials = "include" } = options;
|
|
19
|
+
let url = options.url || location.href;
|
|
20
|
+
url = addQuery(url, options.query);
|
|
21
|
+
const method = options.method ? options.method.toUpperCase() : "GET";
|
|
22
|
+
let body = options.data;
|
|
23
|
+
if (body && (method === "GET" || method === "HEAD"))
|
|
24
|
+
throw new Error(`${method} method does not support a request body.`);
|
|
25
|
+
internals.detectRequestType(options);
|
|
26
|
+
const prepared = internals.prepareRequest(options, body);
|
|
27
|
+
const abortSignals = [AbortSignal.timeout(options.timeout ?? internals.DEFAULT_TIMEOUT)];
|
|
28
|
+
if (options.abort)
|
|
29
|
+
abortSignals.push(options.abort);
|
|
30
|
+
if (abortSignal)
|
|
31
|
+
abortSignals.push(abortSignal);
|
|
32
|
+
try {
|
|
33
|
+
const response = await fetch(url, {
|
|
34
|
+
method,
|
|
35
|
+
headers: new Headers(prepared.headers),
|
|
36
|
+
cache: options.disableCache ? "no-store" : "default",
|
|
37
|
+
mode,
|
|
38
|
+
credentials,
|
|
39
|
+
redirect: "follow",
|
|
40
|
+
signal: AbortSignal.any(abortSignals),
|
|
41
|
+
body: prepared.body
|
|
42
|
+
});
|
|
43
|
+
let result;
|
|
44
|
+
switch (response.type) {
|
|
45
|
+
case "basic":
|
|
46
|
+
case "default":
|
|
47
|
+
case "cors": {
|
|
48
|
+
let responseData = null;
|
|
49
|
+
let responseType = "none";
|
|
50
|
+
let contentType = response.headers.get("content-type");
|
|
51
|
+
if (!response.redirected && response.body) {
|
|
52
|
+
if (contentType) {
|
|
53
|
+
const ctSplitIndex = contentType.indexOf(";");
|
|
54
|
+
if (ctSplitIndex > 0)
|
|
55
|
+
contentType = contentType.substring(0, ctSplitIndex);
|
|
56
|
+
if (contentType.includes("json")) {
|
|
57
|
+
responseType = "json";
|
|
58
|
+
responseData = await response.json();
|
|
59
|
+
}
|
|
60
|
+
else if (contentType.includes("text/html")) {
|
|
61
|
+
responseType = "html";
|
|
62
|
+
responseData = await response.text();
|
|
63
|
+
}
|
|
64
|
+
else if (contentType.includes("text/plain")) {
|
|
65
|
+
responseType = "text";
|
|
66
|
+
responseData = await response.text();
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
responseType = "blob";
|
|
70
|
+
responseData = await response.blob();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
result = {
|
|
75
|
+
status: response.status,
|
|
76
|
+
url: response.url,
|
|
77
|
+
redirected: response.redirected,
|
|
78
|
+
type: responseType,
|
|
79
|
+
contentType,
|
|
80
|
+
headers: response.headers,
|
|
81
|
+
data: responseData,
|
|
82
|
+
state: options.state
|
|
83
|
+
};
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
case "opaqueredirect":
|
|
87
|
+
case "opaque":
|
|
88
|
+
throw new Error(`Not supported response type: ${response.type}`);
|
|
89
|
+
case "error":
|
|
90
|
+
throw new Error("Response error.");
|
|
91
|
+
default:
|
|
92
|
+
throw new Error(`Unknown response type: ${response.type}`);
|
|
93
|
+
}
|
|
94
|
+
if (options.success)
|
|
95
|
+
options.success(result);
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
if (options.error)
|
|
100
|
+
options.error(options, error);
|
|
101
|
+
throw error;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { request };
|
|
106
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sources":["../../../source/request.ts"],"sourcesContent":[null],"names":["helpers.addQuery"],"mappings":";;;AAIA;;;;;;;;;;;;AAYG;AACI,eAAe,OAAO,CAA4B,OAA4B,EAAE,WAAyB,EAAA;IAC/G,IAAI,EAAE,IAAI,EAAE,WAAW,GAAG,SAAS,EAAE,GAAG,OAAO;IAC/C,IAAI,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,QAAQ,CAAC,IAAI;IACtC,GAAG,GAAGA,QAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,KAAK,CAAC;AAE1C,IAAA,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,KAAK;AAEpE,IAAA,IAAI,IAAI,GAAQ,OAAO,CAAC,IAAI;IAC5B,IAAI,IAAI,KAAK,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,MAAM,CAAC;AAClD,QAAA,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,CAAA,wCAAA,CAA0C,CAAC;AAErE,IAAA,SAAS,CAAC,iBAAiB,CAAC,OAAO,CAAC;IACpC,MAAM,QAAQ,GAAG,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC;AAExD,IAAA,MAAM,YAAY,GAAG,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,IAAI,SAAS,CAAC,eAAe,CAAC,CAAC;IACxF,IAAI,OAAO,CAAC,KAAK;AAChB,QAAA,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;AACjC,IAAA,IAAI,WAAW;AACd,QAAA,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC;AAE/B,IAAA,IAAI;AACH,QAAA,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;YACjC,MAAM;AACN,YAAA,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AM,QAAQ,CAAC,IAAI,EAAE;wBACrC;6BACK;4BACJ,YAAY,GAAG,MAAM;AACrB,4BAAA,YAAY,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE;wBACrC;oBACD;gBACD;AAEA,gBAAA,MAAM,GAAG;oBACR,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,GAAG,EAAE,QAAQ,CAAC,GAAG;oBACjB,UAAU,EAAE,QAAQ,CAAC,UAAU;AAC/B,oBAAA,IAAI,EAAE,YAAY;oBAClB,WAAW;oBACX,OAAO,EAAE,QAAQ,CAAC,OAAO;AACzB,oBAAA,IAAI,EAAE,YAAY;oBAClB,KAAK,EAAE,OAAO,CAAC;iBACf;gBAED;YACD;AACA,YAAA,KAAK,gBAAgB;AACrB,YAAA,KAAK,QAAQ;gBACZ,MAAM,IAAI,KAAK,CAAC,CAAA,6BAAA,EAAgC,QAAQ,CAAC,IAAI,CAAA,CAAE,CAAC;AACjE,YAAA,KAAK,OAAO;AACX,gBAAA,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC;AACnC,YAAA;gBACC,MAAM,IAAI,KAAK,CAAC,CAAA,uBAAA,EAA0B,QAAQ,CAAC,IAAI,CAAA,CAAE,CAAC;;QAG5D,IAAI,OAAO,CAAC,OAAO;AAClB,YAAA,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;AAExB,QAAA,OAAO,MAAM;IACd;IACA,OAAO,KAAU,EAAE;QAClB,IAAI,OAAO,CAAC,KAAK;AAChB,YAAA,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC;AAE9B,QAAA,MAAM,KAAK;IACZ;AACD;;;;"}
|
package/package.json
CHANGED
|
@@ -21,10 +21,18 @@
|
|
|
21
21
|
"email": "it@brandup.online"
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
|
-
"version": "2.0.
|
|
24
|
+
"version": "2.0.2",
|
|
25
25
|
"main": "dist/cjs/index.js",
|
|
26
26
|
"module": "dist/mjs/index.js",
|
|
27
27
|
"types": "dist/types.d.ts",
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/types.d.ts",
|
|
32
|
+
"import": "./dist/mjs/index.js",
|
|
33
|
+
"require": "./dist/cjs/index.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
28
36
|
"files": [
|
|
29
37
|
"dist",
|
|
30
38
|
"README.md"
|