svelte-ag 1.0.52 → 1.0.53
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/query/query.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,kBAAkB,EAAE,cAAc,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAInH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAG5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEnE,qBAAa,KAAK,CAChB,GAAG,SAAS,YAAY,EACxB,IAAI,SAAS,GAAG,CAAC,MAAM,CAAC,EACxB,MAAM,SAAS,OAAO,CAAC,GAAG,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC,QAAQ,CAAC;;gBAyBzC,EACV,IAAI,EACJ,MAAM,EACN,KAAK,EACL,SAAS,EACT,KAAK,EACN,EAAE;QACD,IAAI,EAAE,IAAI,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACnC,SAAS,EAAE,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACxC,KAAK,EAAE,KAAK,CAAC;QACb,IAAI,CAAC,EAAE;YACL,KAAK,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1C,CAAC;KACH;IAgBK,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,MAA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YACW,eAAe;IAqBvB,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;CAkB3F"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { stringify } from 'devalue';
|
|
2
|
-
import
|
|
2
|
+
import PQueue from 'p-queue';
|
|
3
3
|
import { cacheKey } from './utils.svelte.js';
|
|
4
4
|
export class Query {
|
|
5
5
|
// -------- Constants --------
|
|
@@ -97,9 +97,10 @@ export class Requestor {
|
|
|
97
97
|
this.#path = path;
|
|
98
98
|
this.#method = method;
|
|
99
99
|
this.#request = request;
|
|
100
|
-
this.#limiter = new
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
this.#limiter = new PQueue({
|
|
101
|
+
concurrency: 5,
|
|
102
|
+
interval: 100,
|
|
103
|
+
intervalCap: 1
|
|
103
104
|
});
|
|
104
105
|
// this.#cache = cache;
|
|
105
106
|
// TODO
|
|
@@ -112,7 +113,7 @@ export class Requestor {
|
|
|
112
113
|
// if ('PUBLIC_ENVIRONMENT' in env && env.PUBLIC_ENVIRONMENT === 'development') {
|
|
113
114
|
// await sleep(1000);
|
|
114
115
|
// }
|
|
115
|
-
return await this.#limiter.
|
|
116
|
+
return await this.#limiter.add(() => this.#request(this.#path, this.#method, input));
|
|
116
117
|
}
|
|
117
118
|
/**
|
|
118
119
|
* Empties the batch queue for the id by combining the inputs.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelte-ag",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.53",
|
|
4
4
|
"description": "Useful svelte components",
|
|
5
5
|
"bugs": "https://github.com/ageorgeh/svelte-ag/issues",
|
|
6
6
|
"repository": {
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"@dnd-kit-svelte/svelte": "^0.1.6",
|
|
49
49
|
"@floating-ui/dom": "^1.7.6",
|
|
50
50
|
"bits-ui": "^2.16.3",
|
|
51
|
-
"bottleneck": "^2.19.5",
|
|
52
51
|
"clsx": "^2.1.1",
|
|
53
52
|
"dequal": "^2.0.3",
|
|
54
53
|
"devalue": "^5.6.4",
|
|
55
54
|
"embla-carousel-svelte": "8.6.0",
|
|
56
55
|
"formsnap": "2.0.1",
|
|
56
|
+
"p-queue": "^9.1.0",
|
|
57
57
|
"radash": "12.1.1",
|
|
58
58
|
"runed": "0.37.1",
|
|
59
59
|
"svelte-toolbelt": "^0.10.6",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@actions/languageserver": "^0.3.49",
|
|
68
68
|
"@eslint/js": "^10.0.1",
|
|
69
|
-
"@iconify/json": "^2.2.
|
|
69
|
+
"@iconify/json": "^2.2.453",
|
|
70
70
|
"@iconify/tailwind4": "^1.2.3",
|
|
71
71
|
"@iconify/types": "^2.0.0",
|
|
72
72
|
"@internationalized/date": "^3.12.0",
|
|
@@ -78,10 +78,10 @@
|
|
|
78
78
|
"@tailwindcss/typography": "^0.5.19",
|
|
79
79
|
"@tailwindcss/vite": "^4.2.2",
|
|
80
80
|
"@types/node": "^24.12.0",
|
|
81
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
81
|
+
"@typescript/native-preview": "7.0.0-dev.20260321.1",
|
|
82
82
|
"eslint": "^10.1.0",
|
|
83
83
|
"eslint-plugin-better-tailwindcss": "^4.3.2",
|
|
84
|
-
"eslint-plugin-svelte": "^3.
|
|
84
|
+
"eslint-plugin-svelte": "^3.16.0",
|
|
85
85
|
"globals": "^17.4.0",
|
|
86
86
|
"husky": "^9.1.7",
|
|
87
87
|
"lint-staged": "^16.4.0",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"prettier-plugin-packagejson": "^3.0.1",
|
|
90
90
|
"prettier-plugin-svelte": "^3.5.1",
|
|
91
91
|
"semantic-release": "^25.0.3",
|
|
92
|
-
"svelte": "^5.54.
|
|
92
|
+
"svelte": "^5.54.1",
|
|
93
93
|
"svelte-check": "^4.4.5",
|
|
94
94
|
"tailwindcss": "4.2.2",
|
|
95
95
|
"tw-animate-css": "^1.4.0",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ApiEndpoints, ApiInput, ApiRequestFunction, ApiSuccessBody, ApiErrorBody, ApiResponse } from 'ts-ag';
|
|
2
2
|
|
|
3
3
|
import { stringify } from 'devalue';
|
|
4
|
-
import
|
|
4
|
+
import PQueue from 'p-queue';
|
|
5
5
|
import type { Cache } from './cache.svelte';
|
|
6
6
|
|
|
7
7
|
import { cacheKey } from './utils.svelte.js';
|
|
@@ -139,7 +139,7 @@ export class Requestor<
|
|
|
139
139
|
#batchInput: BatchDetails<API, Path, Method>['batchInput'];
|
|
140
140
|
#unBatchOutput: BatchDetails<API, Path, Method>['unBatchOutput'];
|
|
141
141
|
|
|
142
|
-
#limiter:
|
|
142
|
+
#limiter: PQueue;
|
|
143
143
|
// #cache: Cache;
|
|
144
144
|
|
|
145
145
|
// -------- State --------
|
|
@@ -163,9 +163,10 @@ export class Requestor<
|
|
|
163
163
|
this.#path = path;
|
|
164
164
|
this.#method = method;
|
|
165
165
|
this.#request = request;
|
|
166
|
-
this.#limiter = new
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
this.#limiter = new PQueue({
|
|
167
|
+
concurrency: 5,
|
|
168
|
+
interval: 100,
|
|
169
|
+
intervalCap: 1
|
|
169
170
|
});
|
|
170
171
|
// this.#cache = cache;
|
|
171
172
|
|
|
@@ -180,7 +181,7 @@ export class Requestor<
|
|
|
180
181
|
// if ('PUBLIC_ENVIRONMENT' in env && env.PUBLIC_ENVIRONMENT === 'development') {
|
|
181
182
|
// await sleep(1000);
|
|
182
183
|
// }
|
|
183
|
-
return await this.#limiter.
|
|
184
|
+
return await this.#limiter.add(() => this.#request(this.#path, this.#method, input));
|
|
184
185
|
}
|
|
185
186
|
|
|
186
187
|
/**
|