@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 CHANGED
@@ -1,24 +1,22 @@
1
1
  <p align="center">
2
- <a href="https://croct.com">
3
- <img src="https://cdn.croct.io/brand/logo/repo-icon-green.svg" alt="Croct" height="80" />
4
- </a>
5
- <br />
6
- <strong>SDK JS</strong>
7
- <br />
8
- The official Croct SDK for JavaScript.
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.shift();
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) {
@@ -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.shift();
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.0";
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.0";
4
- declare const CLIENT_LIBRARY = "Croct SDK JS v0.18.0";
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.0";
4
- declare const CLIENT_LIBRARY = "Croct SDK JS v0.18.0";
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
@@ -1,6 +1,6 @@
1
1
  const BASE_ENDPOINT_URL = "https://api.croct.io";
2
2
  const MAX_QUERY_LENGTH = parseInt("<@maxQueryLength@>", 10);
3
- const VERSION = "0.18.0";
3
+ const VERSION = "0.18.1";
4
4
  const CLIENT_LIBRARY = `Croct SDK JS v${VERSION}`;
5
5
  export {
6
6
  BASE_ENDPOINT_URL,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@croct/sdk",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "Croct SDK for JavaScript.",
5
5
  "license": "MIT",
6
6
  "author": {