@atproto/bsync 0.0.2-next.0 → 0.0.2
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 +3 -3
- package/babel.config.js +3 -0
- package/build.js +18 -0
- package/dist/client.d.ts +0 -1
- package/dist/config.d.ts +0 -1
- package/dist/context.d.ts +1 -5
- package/dist/db/index.d.ts +0 -1
- package/dist/db/migrations/20240108T220751294Z-init.d.ts +0 -1
- package/dist/db/migrations/index.d.ts +0 -1
- package/dist/db/migrations/provider.d.ts +0 -1
- package/dist/db/schema/index.d.ts +0 -1
- package/dist/db/schema/mute_item.d.ts +0 -1
- package/dist/db/schema/mute_op.d.ts +0 -1
- package/dist/db/types.d.ts +0 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.js +76723 -129
- package/dist/index.js.map +7 -1
- package/dist/logger.d.ts +0 -1
- package/dist/proto/bsync_connect.d.ts +1 -18
- package/dist/proto/bsync_pb.d.ts +0 -75
- package/dist/routes/add-mute-operation.d.ts +0 -1
- package/dist/routes/auth.d.ts +0 -1
- package/dist/routes/index.d.ts +0 -1
- package/dist/routes/scan-mute-operations.d.ts +0 -1
- package/jest.config.js +3 -3
- package/package.json +9 -9
- package/src/context.ts +1 -5
- package/src/db/index.ts +31 -33
- package/src/index.ts +2 -6
- package/src/proto/bsync_connect.ts +1 -1
- package/src/routes/scan-mute-operations.ts +1 -20
- package/tsconfig.build.json +2 -6
- package/tsconfig.json +10 -3
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -17
- package/dist/client.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -53
- package/dist/config.js.map +0 -1
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -54
- package/dist/context.js.map +0 -1
- package/dist/db/index.d.ts.map +0 -1
- package/dist/db/index.js +0 -216
- package/dist/db/index.js.map +0 -1
- package/dist/db/migrations/20240108T220751294Z-init.d.ts.map +0 -1
- package/dist/db/migrations/20240108T220751294Z-init.js +0 -28
- package/dist/db/migrations/20240108T220751294Z-init.js.map +0 -1
- package/dist/db/migrations/index.d.ts.map +0 -1
- package/dist/db/migrations/index.js +0 -31
- package/dist/db/migrations/index.js.map +0 -1
- package/dist/db/migrations/provider.d.ts.map +0 -1
- package/dist/db/migrations/provider.js +0 -18
- package/dist/db/migrations/provider.js.map +0 -1
- package/dist/db/schema/index.d.ts.map +0 -1
- package/dist/db/schema/index.js +0 -3
- package/dist/db/schema/index.js.map +0 -1
- package/dist/db/schema/mute_item.d.ts.map +0 -1
- package/dist/db/schema/mute_item.js +0 -5
- package/dist/db/schema/mute_item.js.map +0 -1
- package/dist/db/schema/mute_op.d.ts.map +0 -1
- package/dist/db/schema/mute_op.js +0 -6
- package/dist/db/schema/mute_op.js.map +0 -1
- package/dist/db/types.d.ts.map +0 -1
- package/dist/db/types.js +0 -3
- package/dist/db/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -25
- package/dist/logger.js.map +0 -1
- package/dist/proto/bsync_connect.d.ts.map +0 -1
- package/dist/proto/bsync_connect.js +0 -49
- package/dist/proto/bsync_connect.js.map +0 -1
- package/dist/proto/bsync_pb.d.ts.map +0 -1
- package/dist/proto/bsync_pb.js +0 -461
- package/dist/proto/bsync_pb.js.map +0 -1
- package/dist/routes/add-mute-operation.d.ts.map +0 -1
- package/dist/routes/add-mute-operation.js +0 -136
- package/dist/routes/add-mute-operation.js.map +0 -1
- package/dist/routes/auth.d.ts.map +0 -1
- package/dist/routes/auth.js +0 -17
- package/dist/routes/auth.js.map +0 -1
- package/dist/routes/index.d.ts.map +0 -1
- package/dist/routes/index.js +0 -21
- package/dist/routes/index.js.map +0 -1
- package/dist/routes/scan-mute-operations.d.ts.map +0 -1
- package/dist/routes/scan-mute-operations.js +0 -80
- package/dist/routes/scan-mute-operations.js.map +0 -1
- package/tsconfig.tests.json +0 -7
package/dist/logger.d.ts
CHANGED
|
@@ -2,4 +2,3 @@ import { subsystemLogger } from '@atproto/common';
|
|
|
2
2
|
export declare const dbLogger: ReturnType<typeof subsystemLogger>;
|
|
3
3
|
export declare const httpLogger: ReturnType<typeof subsystemLogger>;
|
|
4
4
|
export declare const loggerMiddleware: import("pino-http").HttpLogger;
|
|
5
|
-
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1,36 +1,20 @@
|
|
|
1
|
-
import { AddMuteOperationRequest, AddMuteOperationResponse, PingRequest, PingResponse, ScanMuteOperationsRequest, ScanMuteOperationsResponse } from './bsync_pb';
|
|
1
|
+
import { AddMuteOperationRequest, AddMuteOperationResponse, PingRequest, PingResponse, ScanMuteOperationsRequest, ScanMuteOperationsResponse } from './bsync_pb.ts';
|
|
2
2
|
import { MethodKind } from '@bufbuild/protobuf';
|
|
3
|
-
/**
|
|
4
|
-
* @generated from service bsync.Service
|
|
5
|
-
*/
|
|
6
3
|
export declare const Service: {
|
|
7
4
|
readonly typeName: "bsync.Service";
|
|
8
5
|
readonly methods: {
|
|
9
|
-
/**
|
|
10
|
-
* Sync
|
|
11
|
-
*
|
|
12
|
-
* @generated from rpc bsync.Service.AddMuteOperation
|
|
13
|
-
*/
|
|
14
6
|
readonly addMuteOperation: {
|
|
15
7
|
readonly name: "AddMuteOperation";
|
|
16
8
|
readonly I: typeof AddMuteOperationRequest;
|
|
17
9
|
readonly O: typeof AddMuteOperationResponse;
|
|
18
10
|
readonly kind: MethodKind.Unary;
|
|
19
11
|
};
|
|
20
|
-
/**
|
|
21
|
-
* @generated from rpc bsync.Service.ScanMuteOperations
|
|
22
|
-
*/
|
|
23
12
|
readonly scanMuteOperations: {
|
|
24
13
|
readonly name: "ScanMuteOperations";
|
|
25
14
|
readonly I: typeof ScanMuteOperationsRequest;
|
|
26
15
|
readonly O: typeof ScanMuteOperationsResponse;
|
|
27
16
|
readonly kind: MethodKind.Unary;
|
|
28
17
|
};
|
|
29
|
-
/**
|
|
30
|
-
* Ping
|
|
31
|
-
*
|
|
32
|
-
* @generated from rpc bsync.Service.Ping
|
|
33
|
-
*/
|
|
34
18
|
readonly ping: {
|
|
35
19
|
readonly name: "Ping";
|
|
36
20
|
readonly I: typeof PingRequest;
|
|
@@ -39,4 +23,3 @@ export declare const Service: {
|
|
|
39
23
|
};
|
|
40
24
|
};
|
|
41
25
|
};
|
|
42
|
-
//# sourceMappingURL=bsync_connect.d.ts.map
|
package/dist/proto/bsync_pb.d.ts
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
1
|
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from '@bufbuild/protobuf';
|
|
2
2
|
import { Message, proto3 } from '@bufbuild/protobuf';
|
|
3
|
-
/**
|
|
4
|
-
* @generated from message bsync.MuteOperation
|
|
5
|
-
*/
|
|
6
3
|
export declare class MuteOperation extends Message<MuteOperation> {
|
|
7
|
-
/**
|
|
8
|
-
* @generated from field: string id = 1;
|
|
9
|
-
*/
|
|
10
4
|
id: string;
|
|
11
|
-
/**
|
|
12
|
-
* @generated from field: bsync.MuteOperation.Type type = 2;
|
|
13
|
-
*/
|
|
14
5
|
type: MuteOperation_Type;
|
|
15
|
-
/**
|
|
16
|
-
* @generated from field: string actor_did = 3;
|
|
17
|
-
*/
|
|
18
6
|
actorDid: string;
|
|
19
|
-
/**
|
|
20
|
-
* @generated from field: string subject = 4;
|
|
21
|
-
*/
|
|
22
7
|
subject: string;
|
|
23
8
|
constructor(data?: PartialMessage<MuteOperation>);
|
|
24
9
|
static readonly runtime: typeof proto3;
|
|
@@ -29,42 +14,15 @@ export declare class MuteOperation extends Message<MuteOperation> {
|
|
|
29
14
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MuteOperation;
|
|
30
15
|
static equals(a: MuteOperation | PlainMessage<MuteOperation> | undefined, b: MuteOperation | PlainMessage<MuteOperation> | undefined): boolean;
|
|
31
16
|
}
|
|
32
|
-
/**
|
|
33
|
-
* @generated from enum bsync.MuteOperation.Type
|
|
34
|
-
*/
|
|
35
17
|
export declare enum MuteOperation_Type {
|
|
36
|
-
/**
|
|
37
|
-
* @generated from enum value: TYPE_UNSPECIFIED = 0;
|
|
38
|
-
*/
|
|
39
18
|
UNSPECIFIED = 0,
|
|
40
|
-
/**
|
|
41
|
-
* @generated from enum value: TYPE_ADD = 1;
|
|
42
|
-
*/
|
|
43
19
|
ADD = 1,
|
|
44
|
-
/**
|
|
45
|
-
* @generated from enum value: TYPE_REMOVE = 2;
|
|
46
|
-
*/
|
|
47
20
|
REMOVE = 2,
|
|
48
|
-
/**
|
|
49
|
-
* @generated from enum value: TYPE_CLEAR = 3;
|
|
50
|
-
*/
|
|
51
21
|
CLEAR = 3
|
|
52
22
|
}
|
|
53
|
-
/**
|
|
54
|
-
* @generated from message bsync.AddMuteOperationRequest
|
|
55
|
-
*/
|
|
56
23
|
export declare class AddMuteOperationRequest extends Message<AddMuteOperationRequest> {
|
|
57
|
-
/**
|
|
58
|
-
* @generated from field: bsync.MuteOperation.Type type = 1;
|
|
59
|
-
*/
|
|
60
24
|
type: MuteOperation_Type;
|
|
61
|
-
/**
|
|
62
|
-
* @generated from field: string actor_did = 2;
|
|
63
|
-
*/
|
|
64
25
|
actorDid: string;
|
|
65
|
-
/**
|
|
66
|
-
* @generated from field: string subject = 3;
|
|
67
|
-
*/
|
|
68
26
|
subject: string;
|
|
69
27
|
constructor(data?: PartialMessage<AddMuteOperationRequest>);
|
|
70
28
|
static readonly runtime: typeof proto3;
|
|
@@ -75,13 +33,7 @@ export declare class AddMuteOperationRequest extends Message<AddMuteOperationReq
|
|
|
75
33
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AddMuteOperationRequest;
|
|
76
34
|
static equals(a: AddMuteOperationRequest | PlainMessage<AddMuteOperationRequest> | undefined, b: AddMuteOperationRequest | PlainMessage<AddMuteOperationRequest> | undefined): boolean;
|
|
77
35
|
}
|
|
78
|
-
/**
|
|
79
|
-
* @generated from message bsync.AddMuteOperationResponse
|
|
80
|
-
*/
|
|
81
36
|
export declare class AddMuteOperationResponse extends Message<AddMuteOperationResponse> {
|
|
82
|
-
/**
|
|
83
|
-
* @generated from field: bsync.MuteOperation operation = 1;
|
|
84
|
-
*/
|
|
85
37
|
operation?: MuteOperation;
|
|
86
38
|
constructor(data?: PartialMessage<AddMuteOperationResponse>);
|
|
87
39
|
static readonly runtime: typeof proto3;
|
|
@@ -92,17 +44,8 @@ export declare class AddMuteOperationResponse extends Message<AddMuteOperationRe
|
|
|
92
44
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): AddMuteOperationResponse;
|
|
93
45
|
static equals(a: AddMuteOperationResponse | PlainMessage<AddMuteOperationResponse> | undefined, b: AddMuteOperationResponse | PlainMessage<AddMuteOperationResponse> | undefined): boolean;
|
|
94
46
|
}
|
|
95
|
-
/**
|
|
96
|
-
* @generated from message bsync.ScanMuteOperationsRequest
|
|
97
|
-
*/
|
|
98
47
|
export declare class ScanMuteOperationsRequest extends Message<ScanMuteOperationsRequest> {
|
|
99
|
-
/**
|
|
100
|
-
* @generated from field: string cursor = 1;
|
|
101
|
-
*/
|
|
102
48
|
cursor: string;
|
|
103
|
-
/**
|
|
104
|
-
* @generated from field: int32 limit = 2;
|
|
105
|
-
*/
|
|
106
49
|
limit: number;
|
|
107
50
|
constructor(data?: PartialMessage<ScanMuteOperationsRequest>);
|
|
108
51
|
static readonly runtime: typeof proto3;
|
|
@@ -113,17 +56,8 @@ export declare class ScanMuteOperationsRequest extends Message<ScanMuteOperation
|
|
|
113
56
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ScanMuteOperationsRequest;
|
|
114
57
|
static equals(a: ScanMuteOperationsRequest | PlainMessage<ScanMuteOperationsRequest> | undefined, b: ScanMuteOperationsRequest | PlainMessage<ScanMuteOperationsRequest> | undefined): boolean;
|
|
115
58
|
}
|
|
116
|
-
/**
|
|
117
|
-
* @generated from message bsync.ScanMuteOperationsResponse
|
|
118
|
-
*/
|
|
119
59
|
export declare class ScanMuteOperationsResponse extends Message<ScanMuteOperationsResponse> {
|
|
120
|
-
/**
|
|
121
|
-
* @generated from field: repeated bsync.MuteOperation operations = 1;
|
|
122
|
-
*/
|
|
123
60
|
operations: MuteOperation[];
|
|
124
|
-
/**
|
|
125
|
-
* @generated from field: string cursor = 2;
|
|
126
|
-
*/
|
|
127
61
|
cursor: string;
|
|
128
62
|
constructor(data?: PartialMessage<ScanMuteOperationsResponse>);
|
|
129
63
|
static readonly runtime: typeof proto3;
|
|
@@ -134,11 +68,6 @@ export declare class ScanMuteOperationsResponse extends Message<ScanMuteOperatio
|
|
|
134
68
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): ScanMuteOperationsResponse;
|
|
135
69
|
static equals(a: ScanMuteOperationsResponse | PlainMessage<ScanMuteOperationsResponse> | undefined, b: ScanMuteOperationsResponse | PlainMessage<ScanMuteOperationsResponse> | undefined): boolean;
|
|
136
70
|
}
|
|
137
|
-
/**
|
|
138
|
-
* Ping
|
|
139
|
-
*
|
|
140
|
-
* @generated from message bsync.PingRequest
|
|
141
|
-
*/
|
|
142
71
|
export declare class PingRequest extends Message<PingRequest> {
|
|
143
72
|
constructor(data?: PartialMessage<PingRequest>);
|
|
144
73
|
static readonly runtime: typeof proto3;
|
|
@@ -149,9 +78,6 @@ export declare class PingRequest extends Message<PingRequest> {
|
|
|
149
78
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): PingRequest;
|
|
150
79
|
static equals(a: PingRequest | PlainMessage<PingRequest> | undefined, b: PingRequest | PlainMessage<PingRequest> | undefined): boolean;
|
|
151
80
|
}
|
|
152
|
-
/**
|
|
153
|
-
* @generated from message bsync.PingResponse
|
|
154
|
-
*/
|
|
155
81
|
export declare class PingResponse extends Message<PingResponse> {
|
|
156
82
|
constructor(data?: PartialMessage<PingResponse>);
|
|
157
83
|
static readonly runtime: typeof proto3;
|
|
@@ -162,4 +88,3 @@ export declare class PingResponse extends Message<PingResponse> {
|
|
|
162
88
|
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): PingResponse;
|
|
163
89
|
static equals(a: PingResponse | PlainMessage<PingResponse> | undefined, b: PingResponse | PlainMessage<PingResponse> | undefined): boolean;
|
|
164
90
|
}
|
|
165
|
-
//# sourceMappingURL=bsync_pb.d.ts.map
|
package/dist/routes/auth.d.ts
CHANGED
package/dist/routes/index.d.ts
CHANGED
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/bsync",
|
|
3
|
-
"version": "0.0.2
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Sychronizing service for app.bsky App View (Bluesky API)",
|
|
6
6
|
"keywords": [
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
"directory": "packages/bsync"
|
|
15
15
|
},
|
|
16
16
|
"main": "dist/index.js",
|
|
17
|
-
"types": "dist/index.d.ts",
|
|
18
17
|
"dependencies": {
|
|
19
18
|
"@bufbuild/protobuf": "^1.5.0",
|
|
20
19
|
"@connectrpc/connect": "^1.1.4",
|
|
@@ -26,24 +25,25 @@
|
|
|
26
25
|
"pino": "^8.15.0",
|
|
27
26
|
"pino-http": "^8.2.1",
|
|
28
27
|
"typed-emitter": "^2.1.0",
|
|
29
|
-
"@atproto/common": "^0.3.4
|
|
30
|
-
"@atproto/syntax": "^0.2.1
|
|
28
|
+
"@atproto/common": "^0.3.4",
|
|
29
|
+
"@atproto/syntax": "^0.2.1"
|
|
31
30
|
},
|
|
32
31
|
"devDependencies": {
|
|
33
32
|
"@bufbuild/buf": "^1.28.1",
|
|
34
33
|
"@bufbuild/protoc-gen-es": "^1.5.0",
|
|
35
34
|
"@connectrpc/protoc-gen-connect-es": "^1.1.4",
|
|
36
|
-
"@types/pg": "^8.6.6"
|
|
37
|
-
"jest": "^28.1.2",
|
|
38
|
-
"ts-node": "^10.8.2"
|
|
35
|
+
"@types/pg": "^8.6.6"
|
|
39
36
|
},
|
|
40
37
|
"scripts": {
|
|
41
|
-
"build": "
|
|
38
|
+
"build": "node ./build.js",
|
|
39
|
+
"postbuild": "tsc --build tsconfig.build.json",
|
|
40
|
+
"update-main-to-dist": "node ../../update-main-to-dist.js packages/bsync",
|
|
42
41
|
"start": "node --enable-source-maps dist/bin.js",
|
|
43
42
|
"test": "../dev-infra/with-test-db.sh jest",
|
|
44
43
|
"test:log": "tail -50 test.log | pino-pretty",
|
|
45
44
|
"test:updateSnapshot": "jest --updateSnapshot",
|
|
46
45
|
"migration:create": "ts-node ./bin/migration-create.ts",
|
|
47
46
|
"buf:gen": "buf generate proto"
|
|
48
|
-
}
|
|
47
|
+
},
|
|
48
|
+
"types": "dist/index.d.ts"
|
|
49
49
|
}
|
package/src/context.ts
CHANGED
|
@@ -7,25 +7,21 @@ import { EventEmitter } from 'stream'
|
|
|
7
7
|
export type AppContextOptions = {
|
|
8
8
|
db: Database
|
|
9
9
|
cfg: ServerConfig
|
|
10
|
-
shutdown: AbortSignal
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
export class AppContext {
|
|
14
13
|
db: Database
|
|
15
14
|
cfg: ServerConfig
|
|
16
|
-
shutdown: AbortSignal
|
|
17
15
|
events: TypedEventEmitter<AppEvents>
|
|
18
16
|
|
|
19
17
|
constructor(opts: AppContextOptions) {
|
|
20
18
|
this.db = opts.db
|
|
21
19
|
this.cfg = opts.cfg
|
|
22
|
-
this.shutdown = opts.shutdown
|
|
23
20
|
this.events = new EventEmitter() as TypedEventEmitter<AppEvents>
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
static async fromConfig(
|
|
27
24
|
cfg: ServerConfig,
|
|
28
|
-
shutdown: AbortSignal,
|
|
29
25
|
overrides?: Partial<AppContextOptions>,
|
|
30
26
|
): Promise<AppContext> {
|
|
31
27
|
const db = new Database({
|
|
@@ -35,7 +31,7 @@ export class AppContext {
|
|
|
35
31
|
poolMaxUses: cfg.db.poolMaxUses,
|
|
36
32
|
poolIdleTimeoutMs: cfg.db.poolIdleTimeoutMs,
|
|
37
33
|
})
|
|
38
|
-
return new AppContext({ db, cfg,
|
|
34
|
+
return new AppContext({ db, cfg, ...overrides })
|
|
39
35
|
}
|
|
40
36
|
}
|
|
41
37
|
|
package/src/db/index.ts
CHANGED
|
@@ -34,43 +34,41 @@ export class Database {
|
|
|
34
34
|
if (instances) {
|
|
35
35
|
this.db = instances.db
|
|
36
36
|
this.pool = instances.pool
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const { schema, url } = opts
|
|
40
|
-
const pool =
|
|
41
|
-
opts.pool ??
|
|
42
|
-
new PgPool({
|
|
43
|
-
connectionString: url,
|
|
44
|
-
max: opts.poolSize,
|
|
45
|
-
maxUses: opts.poolMaxUses,
|
|
46
|
-
idleTimeoutMillis: opts.poolIdleTimeoutMs,
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
// Select count(*) and other pg bigints as js integer
|
|
50
|
-
pgTypes.setTypeParser(pgTypes.builtins.INT8, (n) => parseInt(n, 10))
|
|
51
|
-
|
|
52
|
-
// Setup schema usage, primarily for test parallelism (each test suite runs in its own pg schema)
|
|
53
|
-
if (schema && !/^[a-z_]+$/i.test(schema)) {
|
|
54
|
-
throw new Error(
|
|
55
|
-
`Postgres schema must only contain [A-Za-z_]: ${schema}`,
|
|
56
|
-
)
|
|
57
|
-
}
|
|
37
|
+
return
|
|
38
|
+
}
|
|
58
39
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
40
|
+
// else create a pool & connect
|
|
41
|
+
const { schema, url } = opts
|
|
42
|
+
const pool =
|
|
43
|
+
opts.pool ??
|
|
44
|
+
new PgPool({
|
|
45
|
+
connectionString: url,
|
|
46
|
+
max: opts.poolSize,
|
|
47
|
+
maxUses: opts.poolMaxUses,
|
|
48
|
+
idleTimeoutMillis: opts.poolIdleTimeoutMs,
|
|
66
49
|
})
|
|
67
50
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
51
|
+
// Select count(*) and other pg bigints as js integer
|
|
52
|
+
pgTypes.setTypeParser(pgTypes.builtins.INT8, (n) => parseInt(n, 10))
|
|
53
|
+
|
|
54
|
+
// Setup schema usage, primarily for test parallelism (each test suite runs in its own pg schema)
|
|
55
|
+
if (schema && !/^[a-z_]+$/i.test(schema)) {
|
|
56
|
+
throw new Error(`Postgres schema must only contain [A-Za-z_]: ${schema}`)
|
|
72
57
|
}
|
|
73
58
|
|
|
59
|
+
pool.on('error', onPoolError)
|
|
60
|
+
pool.on('connect', (client) => {
|
|
61
|
+
client.on('error', onClientError)
|
|
62
|
+
if (schema) {
|
|
63
|
+
// Shared objects such as extensions will go in the public schema
|
|
64
|
+
client.query(`SET search_path TO "${schema}",public;`)
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
this.pool = pool
|
|
69
|
+
this.db = new Kysely<DatabaseSchemaType>({
|
|
70
|
+
dialect: new PostgresDialect({ pool }),
|
|
71
|
+
})
|
|
74
72
|
this.migrator = new Migrator({
|
|
75
73
|
db: this.db,
|
|
76
74
|
migrationTableSchema: opts.schema,
|
|
@@ -167,7 +165,7 @@ const onClientError = (err: Error) => dbLogger.error({ err }, 'db client error')
|
|
|
167
165
|
// -------
|
|
168
166
|
|
|
169
167
|
class LeakyTxPlugin implements KyselyPlugin {
|
|
170
|
-
private txOver
|
|
168
|
+
private txOver: boolean
|
|
171
169
|
|
|
172
170
|
endTx() {
|
|
173
171
|
this.txOver = true
|
package/src/index.ts
CHANGED
|
@@ -19,7 +19,7 @@ export class BsyncService {
|
|
|
19
19
|
public server: http.Server
|
|
20
20
|
private ac: AbortController
|
|
21
21
|
private terminator: HttpTerminator
|
|
22
|
-
private dbStatsInterval
|
|
22
|
+
private dbStatsInterval: NodeJS.Timer
|
|
23
23
|
|
|
24
24
|
constructor(opts: {
|
|
25
25
|
ctx: AppContext
|
|
@@ -36,8 +36,8 @@ export class BsyncService {
|
|
|
36
36
|
cfg: ServerConfig,
|
|
37
37
|
overrides?: Partial<AppContextOptions>,
|
|
38
38
|
): Promise<BsyncService> {
|
|
39
|
+
const ctx = await AppContext.fromConfig(cfg, overrides)
|
|
39
40
|
const ac = new AbortController()
|
|
40
|
-
const ctx = await AppContext.fromConfig(cfg, ac.signal, overrides)
|
|
41
41
|
const handler = connectNodeAdapter({
|
|
42
42
|
routes: routes(ctx),
|
|
43
43
|
shutdownSignal: ac.signal,
|
|
@@ -55,9 +55,6 @@ export class BsyncService {
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
async start(): Promise<http.Server> {
|
|
58
|
-
if (this.dbStatsInterval) {
|
|
59
|
-
throw new Error(`${this.constructor.name} already started`)
|
|
60
|
-
}
|
|
61
58
|
this.dbStatsInterval = setInterval(() => {
|
|
62
59
|
dbLogger.info(
|
|
63
60
|
{
|
|
@@ -80,7 +77,6 @@ export class BsyncService {
|
|
|
80
77
|
await this.terminator.terminate()
|
|
81
78
|
await this.ctx.db.close()
|
|
82
79
|
clearInterval(this.dbStatsInterval)
|
|
83
|
-
this.dbStatsInterval = undefined
|
|
84
80
|
}
|
|
85
81
|
|
|
86
82
|
async setupAppEvents() {
|
|
@@ -13,10 +13,7 @@ export default (ctx: AppContext): Partial<ServiceImpl<typeof Service>> => ({
|
|
|
13
13
|
const limit = req.limit || 1000
|
|
14
14
|
const cursor = validCursor(req.cursor)
|
|
15
15
|
const nextMuteOpPromise = once(events, createMuteOpChannel, {
|
|
16
|
-
signal:
|
|
17
|
-
ctx.shutdown,
|
|
18
|
-
AbortSignal.timeout(ctx.cfg.service.longPollTimeoutMs),
|
|
19
|
-
),
|
|
16
|
+
signal: AbortSignal.timeout(ctx.cfg.service.longPollTimeoutMs),
|
|
20
17
|
})
|
|
21
18
|
nextMuteOpPromise.catch(() => null) // ensure timeout is always handled
|
|
22
19
|
|
|
@@ -34,7 +31,6 @@ export default (ctx: AppContext): Partial<ServiceImpl<typeof Service>> => ({
|
|
|
34
31
|
try {
|
|
35
32
|
await nextMuteOpPromise
|
|
36
33
|
} catch (err) {
|
|
37
|
-
ctx.shutdown.throwIfAborted()
|
|
38
34
|
return new ScanMuteOperationsResponse({
|
|
39
35
|
operations: [],
|
|
40
36
|
cursor: req.cursor,
|
|
@@ -71,18 +67,3 @@ const validCursor = (cursor: string): number | null => {
|
|
|
71
67
|
}
|
|
72
68
|
return int
|
|
73
69
|
}
|
|
74
|
-
|
|
75
|
-
const combineSignals = (a: AbortSignal, b: AbortSignal) => {
|
|
76
|
-
const controller = new AbortController()
|
|
77
|
-
for (const signal of [a, b]) {
|
|
78
|
-
if (signal.aborted) {
|
|
79
|
-
controller.abort()
|
|
80
|
-
return signal
|
|
81
|
-
}
|
|
82
|
-
signal.addEventListener('abort', () => controller.abort(signal.reason), {
|
|
83
|
-
// @ts-ignore https://github.com/DefinitelyTyped/DefinitelyTyped/pull/68625
|
|
84
|
-
signal: controller.signal,
|
|
85
|
-
})
|
|
86
|
-
}
|
|
87
|
-
return controller.signal
|
|
88
|
-
}
|
package/tsconfig.build.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"extends": "../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": "./src",
|
|
5
|
+
"outDir": "./dist",
|
|
6
|
+
"emitDeclarationOnly": true
|
|
7
|
+
},
|
|
8
|
+
"module": "nodenext",
|
|
9
|
+
"include": ["./src", "__tests__/**/**.ts"],
|
|
3
10
|
"references": [
|
|
4
|
-
{ "path": "
|
|
5
|
-
{ "path": "
|
|
11
|
+
{ "path": "../common/tsconfig.build.json" },
|
|
12
|
+
{ "path": "../common-web/tsconfig.build.json" }
|
|
6
13
|
]
|
|
7
14
|
}
|
package/dist/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EAEd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,uBAAuB,EAExB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE/C,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC,OAAO,OAAO,CAAC,CAAA;AAEvD,eAAO,MAAM,YAAY,SAAU,uBAAuB,KAAG,WAG5D,CAAA;AAED,eAAO,MAAM,cAAc,WAChB,MAAM,KAAG,WAKjB,CAAA"}
|
package/dist/client.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.authWithApiKey = exports.createClient = void 0;
|
|
4
|
-
const connect_1 = require("@connectrpc/connect");
|
|
5
|
-
const connect_node_1 = require("@connectrpc/connect-node");
|
|
6
|
-
const bsync_connect_1 = require("./proto/bsync_connect");
|
|
7
|
-
const createClient = (opts) => {
|
|
8
|
-
const transport = (0, connect_node_1.createConnectTransport)(opts);
|
|
9
|
-
return (0, connect_1.createPromiseClient)(bsync_connect_1.Service, transport);
|
|
10
|
-
};
|
|
11
|
-
exports.createClient = createClient;
|
|
12
|
-
const authWithApiKey = (apiKey) => (next) => (req) => {
|
|
13
|
-
req.header.set('authorization', `Bearer ${apiKey}`);
|
|
14
|
-
return next(req);
|
|
15
|
-
};
|
|
16
|
-
exports.authWithApiKey = authWithApiKey;
|
|
17
|
-
//# sourceMappingURL=client.js.map
|
package/dist/client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AAAA,iDAI4B;AAC5B,2DAGiC;AACjC,yDAA+C;AAIxC,MAAM,YAAY,GAAG,CAAC,IAA6B,EAAe,EAAE;IACzE,MAAM,SAAS,GAAG,IAAA,qCAAsB,EAAC,IAAI,CAAC,CAAA;IAC9C,OAAO,IAAA,6BAAmB,EAAC,uBAAO,EAAE,SAAS,CAAC,CAAA;AAChD,CAAC,CAAA;AAHY,QAAA,YAAY,gBAGxB;AAEM,MAAM,cAAc,GACzB,CAAC,MAAc,EAAe,EAAE,CAChC,CAAC,IAAI,EAAE,EAAE,CACT,CAAC,GAAG,EAAE,EAAE;IACN,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,MAAM,EAAE,CAAC,CAAA;IACnD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAA;AAClB,CAAC,CAAA;AANU,QAAA,cAAc,kBAMxB"}
|
package/dist/config.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,QAAS,iBAAiB,KAAG,YA2BjD,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,aAAa,CAAA;IACtB,EAAE,EAAE,cAAc,CAAA;IAClB,IAAI,EAAE,UAAU,CAAA;CACjB,CAAA;AAED,KAAK,aAAa,GAAG;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,OAAO,QAAO,iBAgB1B,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAE9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB,CAAA"}
|
package/dist/config.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.readEnv = exports.envToCfg = void 0;
|
|
7
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
8
|
-
const common_1 = require("@atproto/common");
|
|
9
|
-
const envToCfg = (env) => {
|
|
10
|
-
const serviceCfg = {
|
|
11
|
-
port: env.port ?? 2585,
|
|
12
|
-
version: env.version ?? 'unknown',
|
|
13
|
-
longPollTimeoutMs: env.longPollTimeoutMs ?? 10000,
|
|
14
|
-
};
|
|
15
|
-
(0, node_assert_1.default)(env.dbUrl, 'missing postgres url');
|
|
16
|
-
const dbCfg = {
|
|
17
|
-
url: env.dbUrl,
|
|
18
|
-
schema: env.dbSchema,
|
|
19
|
-
poolSize: env.dbPoolSize,
|
|
20
|
-
poolMaxUses: env.dbPoolMaxUses,
|
|
21
|
-
poolIdleTimeoutMs: env.dbPoolIdleTimeoutMs,
|
|
22
|
-
migrate: env.dbMigrate,
|
|
23
|
-
};
|
|
24
|
-
(0, node_assert_1.default)(env.apiKeys.length > 0, 'missing api keys');
|
|
25
|
-
const authCfg = {
|
|
26
|
-
apiKeys: new Set(env.apiKeys),
|
|
27
|
-
};
|
|
28
|
-
return {
|
|
29
|
-
service: serviceCfg,
|
|
30
|
-
db: dbCfg,
|
|
31
|
-
auth: authCfg,
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
exports.envToCfg = envToCfg;
|
|
35
|
-
const readEnv = () => {
|
|
36
|
-
return {
|
|
37
|
-
// service
|
|
38
|
-
port: (0, common_1.envInt)('BSYNC_PORT'),
|
|
39
|
-
version: (0, common_1.envStr)('BSYNC_VERSION'),
|
|
40
|
-
longPollTimeoutMs: (0, common_1.envInt)('BSYNC_LONG_POLL_TIMEOUT_MS'),
|
|
41
|
-
// database
|
|
42
|
-
dbUrl: (0, common_1.envStr)('BSYNC_DB_POSTGRES_URL'),
|
|
43
|
-
dbSchema: (0, common_1.envStr)('BSYNC_DB_POSTGRES_SCHEMA'),
|
|
44
|
-
dbPoolSize: (0, common_1.envInt)('BSYNC_DB_POOL_SIZE'),
|
|
45
|
-
dbPoolMaxUses: (0, common_1.envInt)('BSYNC_DB_POOL_MAX_USES'),
|
|
46
|
-
dbPoolIdleTimeoutMs: (0, common_1.envInt)('BSYNC_DB_POOL_IDLE_TIMEOUT_MS'),
|
|
47
|
-
dbMigrate: (0, common_1.envBool)('BSYNC_DB_MIGRATE'),
|
|
48
|
-
// secrets
|
|
49
|
-
apiKeys: (0, common_1.envList)('BSYNC_API_KEYS'),
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
exports.readEnv = readEnv;
|
|
53
|
-
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAgC;AAChC,4CAAkE;AAE3D,MAAM,QAAQ,GAAG,CAAC,GAAsB,EAAgB,EAAE;IAC/D,MAAM,UAAU,GAA4B;QAC1C,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,IAAI;QACtB,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,SAAS;QACjC,iBAAiB,EAAE,GAAG,CAAC,iBAAiB,IAAI,KAAK;KAClD,CAAA;IAED,IAAA,qBAAM,EAAC,GAAG,CAAC,KAAK,EAAE,sBAAsB,CAAC,CAAA;IACzC,MAAM,KAAK,GAAuB;QAChC,GAAG,EAAE,GAAG,CAAC,KAAK;QACd,MAAM,EAAE,GAAG,CAAC,QAAQ;QACpB,QAAQ,EAAE,GAAG,CAAC,UAAU;QACxB,WAAW,EAAE,GAAG,CAAC,aAAa;QAC9B,iBAAiB,EAAE,GAAG,CAAC,mBAAmB;QAC1C,OAAO,EAAE,GAAG,CAAC,SAAS;KACvB,CAAA;IAED,IAAA,qBAAM,EAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,kBAAkB,CAAC,CAAA;IAClD,MAAM,OAAO,GAAyB;QACpC,OAAO,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC;KAC9B,CAAA;IAED,OAAO;QACL,OAAO,EAAE,UAAU;QACnB,EAAE,EAAE,KAAK;QACT,IAAI,EAAE,OAAO;KACd,CAAA;AACH,CAAC,CAAA;AA3BY,QAAA,QAAQ,YA2BpB;AA2BM,MAAM,OAAO,GAAG,GAAsB,EAAE;IAC7C,OAAO;QACL,UAAU;QACV,IAAI,EAAE,IAAA,eAAM,EAAC,YAAY,CAAC;QAC1B,OAAO,EAAE,IAAA,eAAM,EAAC,eAAe,CAAC;QAChC,iBAAiB,EAAE,IAAA,eAAM,EAAC,4BAA4B,CAAC;QACvD,WAAW;QACX,KAAK,EAAE,IAAA,eAAM,EAAC,uBAAuB,CAAC;QACtC,QAAQ,EAAE,IAAA,eAAM,EAAC,0BAA0B,CAAC;QAC5C,UAAU,EAAE,IAAA,eAAM,EAAC,oBAAoB,CAAC;QACxC,aAAa,EAAE,IAAA,eAAM,EAAC,wBAAwB,CAAC;QAC/C,mBAAmB,EAAE,IAAA,eAAM,EAAC,+BAA+B,CAAC;QAC5D,SAAS,EAAE,IAAA,gBAAO,EAAC,kBAAkB,CAAC;QACtC,UAAU;QACV,OAAO,EAAE,IAAA,gBAAO,EAAC,gBAAgB,CAAC;KACnC,CAAA;AACH,CAAC,CAAA;AAhBY,QAAA,OAAO,WAgBnB"}
|
package/dist/context.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.ts"],"names":[],"mappings":";AAAA,OAAO,iBAAiB,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,QAAQ,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAGzD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,QAAQ,CAAA;IACZ,GAAG,EAAE,YAAY,CAAA;IACjB,QAAQ,EAAE,WAAW,CAAA;CACtB,CAAA;AAED,qBAAa,UAAU;IACrB,EAAE,EAAE,QAAQ,CAAA;IACZ,GAAG,EAAE,YAAY,CAAA;IACjB,QAAQ,EAAE,WAAW,CAAA;IACrB,MAAM,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAA;gBAExB,IAAI,EAAE,iBAAiB;WAOtB,UAAU,CACrB,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,WAAW,EACrB,SAAS,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACrC,OAAO,CAAC,UAAU,CAAC;CAUvB;AAED,eAAe,UAAU,CAAA;AAEzB,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAA;CAClC,CAAA"}
|
package/dist/context.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.AppContext = void 0;
|
|
7
|
-
const db_1 = __importDefault(require("./db"));
|
|
8
|
-
const mute_op_1 = require("./db/schema/mute_op");
|
|
9
|
-
const stream_1 = require("stream");
|
|
10
|
-
class AppContext {
|
|
11
|
-
constructor(opts) {
|
|
12
|
-
Object.defineProperty(this, "db", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
configurable: true,
|
|
15
|
-
writable: true,
|
|
16
|
-
value: void 0
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(this, "cfg", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
configurable: true,
|
|
21
|
-
writable: true,
|
|
22
|
-
value: void 0
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(this, "shutdown", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
configurable: true,
|
|
27
|
-
writable: true,
|
|
28
|
-
value: void 0
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(this, "events", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
configurable: true,
|
|
33
|
-
writable: true,
|
|
34
|
-
value: void 0
|
|
35
|
-
});
|
|
36
|
-
this.db = opts.db;
|
|
37
|
-
this.cfg = opts.cfg;
|
|
38
|
-
this.shutdown = opts.shutdown;
|
|
39
|
-
this.events = new stream_1.EventEmitter();
|
|
40
|
-
}
|
|
41
|
-
static async fromConfig(cfg, shutdown, overrides) {
|
|
42
|
-
const db = new db_1.default({
|
|
43
|
-
url: cfg.db.url,
|
|
44
|
-
schema: cfg.db.schema,
|
|
45
|
-
poolSize: cfg.db.poolSize,
|
|
46
|
-
poolMaxUses: cfg.db.poolMaxUses,
|
|
47
|
-
poolIdleTimeoutMs: cfg.db.poolIdleTimeoutMs,
|
|
48
|
-
});
|
|
49
|
-
return new AppContext({ db, cfg, shutdown, ...overrides });
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.AppContext = AppContext;
|
|
53
|
-
exports.default = AppContext;
|
|
54
|
-
//# sourceMappingURL=context.js.map
|