@atproto/bsync 0.0.0 → 0.0.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/CHANGELOG.md +8 -0
- package/LICENSE.txt +1 -1
- package/buf.gen.yaml +2 -3
- package/dist/client.d.ts +1 -1
- package/dist/db/schema/mute_op.d.ts +1 -1
- package/dist/index.js +293 -17
- package/dist/index.js.map +3 -3
- package/dist/routes/add-mute-operation.d.ts +1 -1
- package/dist/routes/scan-mute-operations.d.ts +1 -1
- package/package.json +2 -2
- package/src/client.ts +1 -1
- package/src/db/schema/mute_op.ts +1 -1
- package/src/index.ts +11 -0
- package/src/routes/add-mute-operation.ts +2 -2
- package/src/routes/index.ts +1 -1
- package/src/routes/scan-mute-operations.ts +2 -2
- package/tests/mutes.test.ts +1 -1
- /package/dist/{gen → proto}/bsync_connect.d.ts +0 -0
- /package/dist/{gen → proto}/bsync_pb.d.ts +0 -0
- /package/src/{gen → proto}/bsync_connect.ts +0 -0
- /package/src/{gen → proto}/bsync_pb.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ServiceImpl } from '@connectrpc/connect';
|
|
2
|
-
import { Service } from '../
|
|
2
|
+
import { Service } from '../proto/bsync_connect';
|
|
3
3
|
import AppContext from '../context';
|
|
4
4
|
declare const _default: (ctx: AppContext) => Partial<ServiceImpl<typeof Service>>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ServiceImpl } from '@connectrpc/connect';
|
|
2
|
-
import { Service } from '../
|
|
2
|
+
import { Service } from '../proto/bsync_connect';
|
|
3
3
|
import AppContext from '../context';
|
|
4
4
|
declare const _default: (ctx: AppContext) => Partial<ServiceImpl<typeof Service>>;
|
|
5
5
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/bsync",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Sychronizing service for app.bsky App View (Bluesky API)",
|
|
6
6
|
"keywords": [
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"pino-http": "^8.2.1",
|
|
27
27
|
"typed-emitter": "^2.1.0",
|
|
28
28
|
"@atproto/common": "^0.3.3",
|
|
29
|
-
"@atproto/syntax": "^0.
|
|
29
|
+
"@atproto/syntax": "^0.2.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@bufbuild/buf": "^1.28.1",
|
package/src/client.ts
CHANGED
package/src/db/schema/mute_op.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -44,6 +44,11 @@ export class BsyncService {
|
|
|
44
44
|
})
|
|
45
45
|
const server = http.createServer((req, res) => {
|
|
46
46
|
loggerMiddleware(req, res)
|
|
47
|
+
if (isHealth(req.url)) {
|
|
48
|
+
res.statusCode = 200
|
|
49
|
+
res.setHeader('content-type', 'application/json')
|
|
50
|
+
return res.end(JSON.stringify({ version: cfg.service.version }))
|
|
51
|
+
}
|
|
47
52
|
handler(req, res)
|
|
48
53
|
})
|
|
49
54
|
return new BsyncService({ ctx, server, ac })
|
|
@@ -89,3 +94,9 @@ export class BsyncService {
|
|
|
89
94
|
}
|
|
90
95
|
|
|
91
96
|
export default BsyncService
|
|
97
|
+
|
|
98
|
+
const isHealth = (urlStr: string | undefined) => {
|
|
99
|
+
if (!urlStr) return false
|
|
100
|
+
const url = new URL(urlStr, 'http://host')
|
|
101
|
+
return url.pathname === '/_health'
|
|
102
|
+
}
|
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
ensureValidDid,
|
|
7
7
|
} from '@atproto/syntax'
|
|
8
8
|
import { Code, ConnectError, ServiceImpl } from '@connectrpc/connect'
|
|
9
|
-
import { Service } from '../
|
|
10
|
-
import { AddMuteOperationResponse, MuteOperation_Type } from '../
|
|
9
|
+
import { Service } from '../proto/bsync_connect'
|
|
10
|
+
import { AddMuteOperationResponse, MuteOperation_Type } from '../proto/bsync_pb'
|
|
11
11
|
import AppContext from '../context'
|
|
12
12
|
import { createMuteOpChannel } from '../db/schema/mute_op'
|
|
13
13
|
import { authWithApiKey } from './auth'
|
package/src/routes/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sql } from 'kysely'
|
|
2
2
|
import { ConnectRouter } from '@connectrpc/connect'
|
|
3
|
-
import { Service } from '../
|
|
3
|
+
import { Service } from '../proto/bsync_connect'
|
|
4
4
|
import AppContext from '../context'
|
|
5
5
|
import addMuteOperation from './add-mute-operation'
|
|
6
6
|
import scanMuteOperations from './scan-mute-operations'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { once } from 'node:events'
|
|
2
2
|
import { Code, ConnectError, ServiceImpl } from '@connectrpc/connect'
|
|
3
|
-
import { Service } from '../
|
|
4
|
-
import { ScanMuteOperationsResponse } from '../
|
|
3
|
+
import { Service } from '../proto/bsync_connect'
|
|
4
|
+
import { ScanMuteOperationsResponse } from '../proto/bsync_pb'
|
|
5
5
|
import AppContext from '../context'
|
|
6
6
|
import { createMuteOpChannel } from '../db/schema/mute_op'
|
|
7
7
|
import { authWithApiKey } from './auth'
|
package/tests/mutes.test.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
createClient,
|
|
9
9
|
envToCfg,
|
|
10
10
|
} from '../src'
|
|
11
|
-
import { MuteOperation, MuteOperation_Type } from '../src/
|
|
11
|
+
import { MuteOperation, MuteOperation_Type } from '../src/proto/bsync_pb'
|
|
12
12
|
|
|
13
13
|
describe('mutes', () => {
|
|
14
14
|
let bsync: BsyncService
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|