@powersync/service-module-mongodb-storage 0.0.0-dev-20251110132117 → 0.0.0-dev-20251111070830

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/CHANGELOG.md CHANGED
@@ -1,13 +1,15 @@
1
1
  # @powersync/service-module-mongodb-storage
2
2
 
3
- ## 0.0.0-dev-20251110132117
3
+ ## 0.0.0-dev-20251111070830
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - c6bdb4f: [MongoDB storage] Fix migration for indexes on connection_report_events.
7
8
  - 422ae99: General client connections analytics added
9
+ - Updated dependencies [c6bdb4f]
8
10
  - Updated dependencies [422ae99]
9
- - @powersync/service-core@0.0.0-dev-20251110132117
10
- - @powersync/service-types@0.0.0-dev-20251110132117
11
+ - @powersync/service-core@0.0.0-dev-20251111070830
12
+ - @powersync/service-types@0.0.0-dev-20251111070830
11
13
 
12
14
  ## 0.12.9
13
15
 
@@ -1,27 +1,7 @@
1
1
  import * as storage from '../../../storage/storage-index.js';
2
2
  export const up = async (context) => {
3
3
  const { service_context: { configuration } } = context;
4
- const db = storage.createPowerSyncMongo(configuration.storage);
5
- try {
6
- await db.createConnectionReportingCollection();
7
- await db.connection_report_events.createIndex({
8
- connected_at: 1,
9
- jwt_exp: 1,
10
- disconnected_at: 1
11
- }, { name: 'connection_list_index' });
12
- await db.connection_report_events.createIndex({
13
- user_id: 1
14
- }, { name: 'connection_user_id_index' });
15
- await db.connection_report_events.createIndex({
16
- client_id: 1
17
- }, { name: 'connection_client_id_index' });
18
- await db.connection_report_events.createIndex({
19
- sdk: 1
20
- }, { name: 'connection_index' });
21
- }
22
- finally {
23
- await db.client.close();
24
- }
4
+ // No-op - moved to 1762790715147-connection-reporting2
25
5
  };
26
6
  export const down = async (context) => {
27
7
  const { service_context: { configuration } } = context;
@@ -1 +1 @@
1
- {"version":3,"file":"1752661449910-connection-reporting.js","sourceRoot":"","sources":["../../../../src/migrations/db/migrations/1752661449910-connection-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AAC,CAAC;IAErF,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,0BAA0B,CAAC,CAAC;IACzD,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;AACH,CAAC,CAAC"}
1
+ {"version":3,"file":"1752661449910-connection-reporting.js","sourceRoot":"","sources":["../../../../src/migrations/db/migrations/1752661449910-connection-reporting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,mCAAmC,CAAC;AAG7D,MAAM,CAAC,MAAM,EAAE,GAA0C,KAAK,EAAE,OAAO,EAAE,EAAE;IACzE,MAAM,EACJ,eAAe,EAAE,EAAE,aAAa,EAAE,EACnC,GAAG,OAAO,CAAC;IACZ,uDAAuD;AACzD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAA0C,KAAK,EAAE,OAAO,EAAE,EAAE;IAC3E,MAAM,EACJ,eAAe,EAAE,EAAE,aAAa,EAAE,EACnC,GAAG,OAAO,CAAC;IAEZ,MAAM,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,aAAa,CAAC,OAA6B,CAAC,CAAC;IAErF,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,0BAA0B,CAAC,CAAC;IACzD,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { migrations } from '@powersync/service-core';
2
+ export declare const up: migrations.PowerSyncMigrationFunction;
3
+ export declare const down: migrations.PowerSyncMigrationFunction;
@@ -0,0 +1,36 @@
1
+ import * as storage from '../../../storage/storage-index.js';
2
+ export const up = async (context) => {
3
+ const { service_context: { configuration } } = context;
4
+ const db = storage.createPowerSyncMongo(configuration.storage);
5
+ try {
6
+ await db.createConnectionReportingCollection();
7
+ await db.connection_report_events.createIndex({
8
+ connected_at: 1,
9
+ jwt_exp: 1,
10
+ disconnected_at: 1
11
+ }, { name: 'connection_list_index' });
12
+ await db.connection_report_events.createIndex({
13
+ user_id: 1
14
+ }, { name: 'connection_user_id_index' });
15
+ await db.connection_report_events.createIndex({
16
+ client_id: 1
17
+ }, { name: 'connection_client_id_index' });
18
+ await db.connection_report_events.createIndex({
19
+ sdk: 1
20
+ }, { name: 'connection_index' });
21
+ }
22
+ finally {
23
+ await db.client.close();
24
+ }
25
+ };
26
+ export const down = async (context) => {
27
+ const { service_context: { configuration } } = context;
28
+ const db = storage.createPowerSyncMongo(configuration.storage);
29
+ try {
30
+ await db.db.dropCollection('connection_report_events');
31
+ }
32
+ finally {
33
+ await db.client.close();
34
+ }
35
+ };
36
+ //# sourceMappingURL=1762790715147-connection-reporting2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"1762790715147-connection-reporting2.js","sourceRoot":"","sources":["../../../../src/migrations/db/migrations/1762790715147-connection-reporting2.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,mCAAmC,CAAC;AAG7D,MAAM,CAAC,MAAM,EAAE,GAA0C,KAAK,EAAE,OAAO,EAAE,EAAE;IACzE,MAAM,EACJ,eAAe,EAAE,EAAE,aAAa,EAAE,EACnC,GAAG,OAAO,CAAC;IACZ,MAAM,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,aAAa,CAAC,OAA6B,CAAC,CAAC;IAErF,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,mCAAmC,EAAE,CAAC;QAE/C,MAAM,EAAE,CAAC,wBAAwB,CAAC,WAAW,CAC3C;YACE,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,CAAC;YACV,eAAe,EAAE,CAAC;SACnB,EACD,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAClC,CAAC;QAEF,MAAM,EAAE,CAAC,wBAAwB,CAAC,WAAW,CAC3C;YACE,OAAO,EAAE,CAAC;SACX,EACD,EAAE,IAAI,EAAE,0BAA0B,EAAE,CACrC,CAAC;QACF,MAAM,EAAE,CAAC,wBAAwB,CAAC,WAAW,CAC3C;YACE,SAAS,EAAE,CAAC;SACb,EACD,EAAE,IAAI,EAAE,4BAA4B,EAAE,CACvC,CAAC;QACF,MAAM,EAAE,CAAC,wBAAwB,CAAC,WAAW,CAC3C;YACE,GAAG,EAAE,CAAC;SACP,EACD,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAC7B,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,IAAI,GAA0C,KAAK,EAAE,OAAO,EAAE,EAAE;IAC3E,MAAM,EACJ,eAAe,EAAE,EAAE,aAAa,EAAE,EACnC,GAAG,OAAO,CAAC;IAEZ,MAAM,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,aAAa,CAAC,OAA6B,CAAC,CAAC;IAErF,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,EAAE,CAAC,cAAc,CAAC,0BAA0B,CAAC,CAAC;IACzD,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;AACH,CAAC,CAAC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@powersync/service-module-mongodb-storage",
3
3
  "repository": "https://github.com/powersync-ja/powersync-service",
4
4
  "types": "dist/index.d.ts",
5
- "version": "0.0.0-dev-20251110132117",
5
+ "version": "0.0.0-dev-20251111070830",
6
6
  "main": "dist/index.js",
7
7
  "license": "FSL-1.1-ALv2",
8
8
  "type": "module",
@@ -29,13 +29,13 @@
29
29
  "uuid": "^11.1.0",
30
30
  "@powersync/lib-service-mongodb": "0.6.11",
31
31
  "@powersync/lib-services-framework": "0.7.9",
32
- "@powersync/service-core": "0.0.0-dev-20251110132117",
32
+ "@powersync/service-core": "0.0.0-dev-20251111070830",
33
33
  "@powersync/service-jsonbig": "0.17.12",
34
34
  "@powersync/service-sync-rules": "0.29.6",
35
- "@powersync/service-types": "0.0.0-dev-20251110132117"
35
+ "@powersync/service-types": "0.0.0-dev-20251111070830"
36
36
  },
37
37
  "devDependencies": {
38
- "@powersync/service-core-tests": "0.0.0-dev-20251110132117"
38
+ "@powersync/service-core-tests": "0.0.0-dev-20251111070830"
39
39
  },
40
40
  "scripts": {
41
41
  "build": "tsc -b",
@@ -6,41 +6,7 @@ export const up: migrations.PowerSyncMigrationFunction = async (context) => {
6
6
  const {
7
7
  service_context: { configuration }
8
8
  } = context;
9
- const db = storage.createPowerSyncMongo(configuration.storage as MongoStorageConfig);
10
-
11
- try {
12
- await db.createConnectionReportingCollection();
13
-
14
- await db.connection_report_events.createIndex(
15
- {
16
- connected_at: 1,
17
- jwt_exp: 1,
18
- disconnected_at: 1
19
- },
20
- { name: 'connection_list_index' }
21
- );
22
-
23
- await db.connection_report_events.createIndex(
24
- {
25
- user_id: 1
26
- },
27
- { name: 'connection_user_id_index' }
28
- );
29
- await db.connection_report_events.createIndex(
30
- {
31
- client_id: 1
32
- },
33
- { name: 'connection_client_id_index' }
34
- );
35
- await db.connection_report_events.createIndex(
36
- {
37
- sdk: 1
38
- },
39
- { name: 'connection_index' }
40
- );
41
- } finally {
42
- await db.client.close();
43
- }
9
+ // No-op - moved to 1762790715147-connection-reporting2
44
10
  };
45
11
 
46
12
  export const down: migrations.PowerSyncMigrationFunction = async (context) => {
@@ -0,0 +1,58 @@
1
+ import { migrations } from '@powersync/service-core';
2
+ import * as storage from '../../../storage/storage-index.js';
3
+ import { MongoStorageConfig } from '../../../types/types.js';
4
+
5
+ export const up: migrations.PowerSyncMigrationFunction = async (context) => {
6
+ const {
7
+ service_context: { configuration }
8
+ } = context;
9
+ const db = storage.createPowerSyncMongo(configuration.storage as MongoStorageConfig);
10
+
11
+ try {
12
+ await db.createConnectionReportingCollection();
13
+
14
+ await db.connection_report_events.createIndex(
15
+ {
16
+ connected_at: 1,
17
+ jwt_exp: 1,
18
+ disconnected_at: 1
19
+ },
20
+ { name: 'connection_list_index' }
21
+ );
22
+
23
+ await db.connection_report_events.createIndex(
24
+ {
25
+ user_id: 1
26
+ },
27
+ { name: 'connection_user_id_index' }
28
+ );
29
+ await db.connection_report_events.createIndex(
30
+ {
31
+ client_id: 1
32
+ },
33
+ { name: 'connection_client_id_index' }
34
+ );
35
+ await db.connection_report_events.createIndex(
36
+ {
37
+ sdk: 1
38
+ },
39
+ { name: 'connection_index' }
40
+ );
41
+ } finally {
42
+ await db.client.close();
43
+ }
44
+ };
45
+
46
+ export const down: migrations.PowerSyncMigrationFunction = async (context) => {
47
+ const {
48
+ service_context: { configuration }
49
+ } = context;
50
+
51
+ const db = storage.createPowerSyncMongo(configuration.storage as MongoStorageConfig);
52
+
53
+ try {
54
+ await db.db.dropCollection('connection_report_events');
55
+ } finally {
56
+ await db.client.close();
57
+ }
58
+ };