s3db.js 7.0.2 → 7.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/s3db.cjs.js +3684 -3668
- package/dist/s3db.cjs.min.js +1 -1
- package/dist/s3db.es.js +3683 -3663
- package/dist/s3db.es.min.js +1 -1
- package/dist/s3db.iife.js +3686 -3669
- package/dist/s3db.iife.min.js +1 -1
- package/package.json +2 -1
- package/src/index.js +27 -11
- package/src/plugins/consumers/rabbitmq-consumer.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "s3db.js",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Use AWS S3, the world's most reliable document storage, as a database with this ORM.",
|
|
5
5
|
"main": "dist/s3db.cjs.js",
|
|
6
6
|
"module": "dist/s3db.es.js",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"database"
|
|
25
25
|
],
|
|
26
26
|
"type": "module",
|
|
27
|
+
"sideEffects": false,
|
|
27
28
|
"exports": {
|
|
28
29
|
".": {
|
|
29
30
|
"import": "./dist/s3db.es.js",
|
package/src/index.js
CHANGED
|
@@ -1,17 +1,33 @@
|
|
|
1
|
-
// directories
|
|
2
|
-
export * from './behaviors/index.js'
|
|
1
|
+
// directories (keep wildcard exports for these)
|
|
3
2
|
export * from './concerns/index.js'
|
|
4
3
|
export * from './plugins/index.js'
|
|
5
|
-
export * from './stream/index.js'
|
|
6
|
-
|
|
7
|
-
// single
|
|
8
|
-
export * from './client.class.js'
|
|
9
|
-
export * from './connection-string.class.js'
|
|
10
|
-
export * from './database.class.js'
|
|
11
4
|
export * from './errors.js'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
5
|
+
|
|
6
|
+
// main classes (explicit named exports for better tree-shaking)
|
|
7
|
+
export { Database as S3db } from './database.class.js'
|
|
8
|
+
export { Database } from './database.class.js'
|
|
9
|
+
export { Client } from './client.class.js'
|
|
10
|
+
export { Resource } from './resource.class.js'
|
|
11
|
+
export { Schema } from './schema.class.js'
|
|
12
|
+
export { Validator } from './validator.class.js'
|
|
13
|
+
export { ConnectionString } from './connection-string.class.js'
|
|
14
|
+
|
|
15
|
+
// stream classes
|
|
16
|
+
export {
|
|
17
|
+
ResourceReader,
|
|
18
|
+
ResourceWriter,
|
|
19
|
+
ResourceIdsReader,
|
|
20
|
+
ResourceIdsPageReader,
|
|
21
|
+
streamToString
|
|
22
|
+
} from './stream/index.js'
|
|
23
|
+
|
|
24
|
+
// behaviors
|
|
25
|
+
export {
|
|
26
|
+
behaviors,
|
|
27
|
+
getBehavior,
|
|
28
|
+
AVAILABLE_BEHAVIORS,
|
|
29
|
+
DEFAULT_BEHAVIOR
|
|
30
|
+
} from './behaviors/index.js'
|
|
15
31
|
|
|
16
32
|
// default
|
|
17
33
|
export { S3db as default } from './database.class.js'
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import amqp from 'amqplib';
|
|
2
1
|
import tryFn from "../../concerns/try-fn.js";
|
|
3
2
|
|
|
4
3
|
export class RabbitMqConsumer {
|
|
@@ -21,13 +20,14 @@ export class RabbitMqConsumer {
|
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
async stop() {
|
|
24
|
-
this._stopped = true;
|
|
23
|
+
this._stopped = true;
|
|
25
24
|
if (this.channel) await this.channel.close();
|
|
26
25
|
if (this.connection) await this.connection.close();
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
async _connect() {
|
|
30
29
|
const [ok, err] = await tryFn(async () => {
|
|
30
|
+
const amqp = (await import('amqplib')).default;
|
|
31
31
|
this.connection = await amqp.connect(this.amqpUrl);
|
|
32
32
|
this.channel = await this.connection.createChannel();
|
|
33
33
|
await this.channel.assertQueue(this.queue, { durable: true });
|