@croct/sdk 0.18.0 → 0.18.1
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 +13 -15
- package/channel/queuedChannel.cjs +5 -1
- package/channel/queuedChannel.js +5 -1
- package/constants.cjs +1 -1
- package/constants.d.cts +2 -2
- package/constants.d.ts +2 -2
- package/constants.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
<a href="https://croct.com" target="_blank">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(min-width: 769px) and (prefers-color-scheme: light)" srcset="https://github.com/croct-tech/plug-js/blob/master/.github/assets/header-light.svg">
|
|
5
|
+
<source media="(min-width: 769px) and (prefers-color-scheme: dark)" srcset="https://github.com/croct-tech/plug-js/blob/master/.github/assets/header-dark.svg">
|
|
6
|
+
<source media="(max-width: 768px) and (prefers-color-scheme: dark)" srcset="https://github.com/croct-tech/plug-js/blob/master/.github/assets/header-dark-mobile.svg">
|
|
7
|
+
<source media="(max-width: 768px) and (prefers-color-scheme: light)" srcset="https://github.com/croct-tech/plug-js/blob/master/.github/assets/header-light-mobile.svg">
|
|
8
|
+
<img src="https://github.com/croct-tech/plug-js/blob/master/.github/assets/header-light-mobile.svg" alt="Croct JavaScript SDK" title="Croct JavaScript SDK" width="100%">
|
|
9
|
+
</picture>
|
|
10
|
+
</a>
|
|
11
|
+
<br/>
|
|
12
|
+
<strong>SDK JS</strong><br/>
|
|
13
|
+
The official Croct SDK for JavaScript.
|
|
9
14
|
</p>
|
|
15
|
+
|
|
10
16
|
<p align="center">
|
|
11
17
|
<a href="https://www.npmjs.com/package/@croct/sdk"><img alt="Version" src="https://img.shields.io/npm/v/@croct/sdk"/></a>
|
|
12
18
|
<a href="https://github.com/croct-tech/sdk-js/actions?query=workflow%3AValidations"><img alt="Build" src="https://github.com/croct-tech/sdk-js/workflows/Validations/badge.svg"/></a>
|
|
13
|
-
<a href="https://codeclimate.com/repos/5e7251b3172af05fe9000e27/maintainability"><img alt="Maintainability" src="https://api.codeclimate.com/v1/badges/c44df78a3ed891af11bb/maintainability"/></a>
|
|
14
19
|
<a href="https://codeclimate.com/repos/5e7251b3172af05fe9000e27/test_coverage"><img alt="Coverage" src="https://api.codeclimate.com/v1/badges/c44df78a3ed891af11bb/test_coverage"/></a>
|
|
15
|
-
<br />
|
|
16
|
-
<br />
|
|
17
|
-
<a href="https://github.com/croct-tech/sdk-js/releases">📦Releases</a>
|
|
18
|
-
·
|
|
19
|
-
<a href="https://github.com/croct-tech/sdk-js/issues/new?labels=bug&template=bug-report.md">🐞Report Bug</a>
|
|
20
|
-
·
|
|
21
|
-
<a href="https://github.com/croct-tech/sdk-js/issues/new?labels=enhancement&template=feature-request.md">✨Request Feature</a>
|
|
22
20
|
</p>
|
|
23
21
|
|
|
24
22
|
## Installation
|
|
@@ -57,7 +57,11 @@ class QueuedChannel {
|
|
|
57
57
|
dequeue() {
|
|
58
58
|
this.logger.debug("Dequeuing message...");
|
|
59
59
|
this.logger.debug(`Queue length: ${Math.max(0, this.queue.length() - 1)}`);
|
|
60
|
-
this.queue.
|
|
60
|
+
if (this.queue.length() === 0) {
|
|
61
|
+
this.logger.debug("Queue unexpectedly empty, possibly due to concurrent modification.");
|
|
62
|
+
} else {
|
|
63
|
+
this.queue.shift();
|
|
64
|
+
}
|
|
61
65
|
}
|
|
62
66
|
requeue() {
|
|
63
67
|
if (this.closed) {
|
package/channel/queuedChannel.js
CHANGED
|
@@ -35,7 +35,11 @@ class QueuedChannel {
|
|
|
35
35
|
dequeue() {
|
|
36
36
|
this.logger.debug("Dequeuing message...");
|
|
37
37
|
this.logger.debug(`Queue length: ${Math.max(0, this.queue.length() - 1)}`);
|
|
38
|
-
this.queue.
|
|
38
|
+
if (this.queue.length() === 0) {
|
|
39
|
+
this.logger.debug("Queue unexpectedly empty, possibly due to concurrent modification.");
|
|
40
|
+
} else {
|
|
41
|
+
this.queue.shift();
|
|
42
|
+
}
|
|
39
43
|
}
|
|
40
44
|
requeue() {
|
|
41
45
|
if (this.closed) {
|
package/constants.cjs
CHANGED
|
@@ -25,7 +25,7 @@ __export(constants_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(constants_exports);
|
|
26
26
|
const BASE_ENDPOINT_URL = "https://api.croct.io";
|
|
27
27
|
const MAX_QUERY_LENGTH = parseInt("<@maxQueryLength@>", 10);
|
|
28
|
-
const VERSION = "0.18.
|
|
28
|
+
const VERSION = "0.18.1";
|
|
29
29
|
const CLIENT_LIBRARY = `Croct SDK JS v${VERSION}`;
|
|
30
30
|
// Annotate the CommonJS export names for ESM import in node:
|
|
31
31
|
0 && (module.exports = {
|
package/constants.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const BASE_ENDPOINT_URL = "https://api.croct.io";
|
|
2
2
|
declare const MAX_QUERY_LENGTH: number;
|
|
3
|
-
declare const VERSION = "0.18.
|
|
4
|
-
declare const CLIENT_LIBRARY = "Croct SDK JS v0.18.
|
|
3
|
+
declare const VERSION = "0.18.1";
|
|
4
|
+
declare const CLIENT_LIBRARY = "Croct SDK JS v0.18.1";
|
|
5
5
|
|
|
6
6
|
export { BASE_ENDPOINT_URL, CLIENT_LIBRARY, MAX_QUERY_LENGTH, VERSION };
|
package/constants.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const BASE_ENDPOINT_URL = "https://api.croct.io";
|
|
2
2
|
declare const MAX_QUERY_LENGTH: number;
|
|
3
|
-
declare const VERSION = "0.18.
|
|
4
|
-
declare const CLIENT_LIBRARY = "Croct SDK JS v0.18.
|
|
3
|
+
declare const VERSION = "0.18.1";
|
|
4
|
+
declare const CLIENT_LIBRARY = "Croct SDK JS v0.18.1";
|
|
5
5
|
|
|
6
6
|
export { BASE_ENDPOINT_URL, CLIENT_LIBRARY, MAX_QUERY_LENGTH, VERSION };
|
package/constants.js
CHANGED