@atproto/bsync 0.0.1 → 0.0.2-next.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/CHANGELOG.md +8 -0
- package/dist/client.d.ts +1 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +17 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +53 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +5 -1
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +54 -0
- package/dist/context.js.map +1 -0
- package/dist/db/index.d.ts +1 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +216 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations/20240108T220751294Z-init.d.ts +1 -0
- package/dist/db/migrations/20240108T220751294Z-init.d.ts.map +1 -0
- package/dist/db/migrations/20240108T220751294Z-init.js +28 -0
- package/dist/db/migrations/20240108T220751294Z-init.js.map +1 -0
- package/dist/db/migrations/index.d.ts +1 -0
- package/dist/db/migrations/index.d.ts.map +1 -0
- package/dist/db/migrations/index.js +31 -0
- package/dist/db/migrations/index.js.map +1 -0
- package/dist/db/migrations/provider.d.ts +1 -0
- package/dist/db/migrations/provider.d.ts.map +1 -0
- package/dist/db/migrations/provider.js +18 -0
- package/dist/db/migrations/provider.js.map +1 -0
- package/dist/db/schema/index.d.ts +1 -0
- package/dist/db/schema/index.d.ts.map +1 -0
- package/dist/db/schema/index.js +3 -0
- package/dist/db/schema/index.js.map +1 -0
- package/dist/db/schema/mute_item.d.ts +1 -0
- package/dist/db/schema/mute_item.d.ts.map +1 -0
- package/dist/db/schema/mute_item.js +5 -0
- package/dist/db/schema/mute_item.js.map +1 -0
- package/dist/db/schema/mute_op.d.ts +1 -0
- package/dist/db/schema/mute_op.d.ts.map +1 -0
- package/dist/db/schema/mute_op.js +6 -0
- package/dist/db/schema/mute_op.js.map +1 -0
- package/dist/db/types.d.ts +1 -0
- package/dist/db/types.d.ts.map +1 -0
- package/dist/db/types.js +3 -0
- package/dist/db/types.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +130 -76724
- package/dist/index.js.map +1 -7
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +25 -0
- package/dist/logger.js.map +1 -0
- package/dist/proto/bsync_connect.d.ts +18 -1
- package/dist/proto/bsync_connect.d.ts.map +1 -0
- package/dist/proto/bsync_connect.js +49 -0
- package/dist/proto/bsync_connect.js.map +1 -0
- package/dist/proto/bsync_pb.d.ts +75 -0
- package/dist/proto/bsync_pb.d.ts.map +1 -0
- package/dist/proto/bsync_pb.js +461 -0
- package/dist/proto/bsync_pb.js.map +1 -0
- package/dist/routes/add-mute-operation.d.ts +1 -0
- package/dist/routes/add-mute-operation.d.ts.map +1 -0
- package/dist/routes/add-mute-operation.js +136 -0
- package/dist/routes/add-mute-operation.js.map +1 -0
- package/dist/routes/auth.d.ts +1 -0
- package/dist/routes/auth.d.ts.map +1 -0
- package/dist/routes/auth.js +17 -0
- package/dist/routes/auth.js.map +1 -0
- package/dist/routes/index.d.ts +1 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +21 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/scan-mute-operations.d.ts +1 -0
- package/dist/routes/scan-mute-operations.d.ts.map +1 -0
- package/dist/routes/scan-mute-operations.js +80 -0
- package/dist/routes/scan-mute-operations.js.map +1 -0
- package/jest.config.js +3 -3
- package/package.json +9 -9
- package/src/context.ts +5 -1
- package/src/db/index.ts +33 -31
- package/src/index.ts +6 -2
- package/src/proto/bsync_connect.ts +1 -1
- package/src/routes/scan-mute-operations.ts +20 -1
- package/tsconfig.build.json +6 -2
- package/tsconfig.json +3 -10
- package/tsconfig.tests.json +7 -0
- package/babel.config.js +0 -3
- package/build.js +0 -18
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @generated by protoc-gen-es v1.6.0 with parameter "target=ts,import_extension=.ts"
|
|
3
|
+
// @generated from file bsync.proto (package bsync, syntax proto3)
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
// @ts-nocheck
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.PingResponse = exports.PingRequest = exports.ScanMuteOperationsResponse = exports.ScanMuteOperationsRequest = exports.AddMuteOperationResponse = exports.AddMuteOperationRequest = exports.MuteOperation_Type = exports.MuteOperation = void 0;
|
|
8
|
+
const protobuf_1 = require("@bufbuild/protobuf");
|
|
9
|
+
/**
|
|
10
|
+
* @generated from message bsync.MuteOperation
|
|
11
|
+
*/
|
|
12
|
+
class MuteOperation extends protobuf_1.Message {
|
|
13
|
+
constructor(data) {
|
|
14
|
+
super();
|
|
15
|
+
/**
|
|
16
|
+
* @generated from field: string id = 1;
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(this, "id", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: ''
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* @generated from field: bsync.MuteOperation.Type type = 2;
|
|
26
|
+
*/
|
|
27
|
+
Object.defineProperty(this, "type", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
configurable: true,
|
|
30
|
+
writable: true,
|
|
31
|
+
value: MuteOperation_Type.UNSPECIFIED
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* @generated from field: string actor_did = 3;
|
|
35
|
+
*/
|
|
36
|
+
Object.defineProperty(this, "actorDid", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
configurable: true,
|
|
39
|
+
writable: true,
|
|
40
|
+
value: ''
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* @generated from field: string subject = 4;
|
|
44
|
+
*/
|
|
45
|
+
Object.defineProperty(this, "subject", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
configurable: true,
|
|
48
|
+
writable: true,
|
|
49
|
+
value: ''
|
|
50
|
+
});
|
|
51
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
52
|
+
}
|
|
53
|
+
static fromBinary(bytes, options) {
|
|
54
|
+
return new MuteOperation().fromBinary(bytes, options);
|
|
55
|
+
}
|
|
56
|
+
static fromJson(jsonValue, options) {
|
|
57
|
+
return new MuteOperation().fromJson(jsonValue, options);
|
|
58
|
+
}
|
|
59
|
+
static fromJsonString(jsonString, options) {
|
|
60
|
+
return new MuteOperation().fromJsonString(jsonString, options);
|
|
61
|
+
}
|
|
62
|
+
static equals(a, b) {
|
|
63
|
+
return protobuf_1.proto3.util.equals(MuteOperation, a, b);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.MuteOperation = MuteOperation;
|
|
67
|
+
Object.defineProperty(MuteOperation, "runtime", {
|
|
68
|
+
enumerable: true,
|
|
69
|
+
configurable: true,
|
|
70
|
+
writable: true,
|
|
71
|
+
value: protobuf_1.proto3
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(MuteOperation, "typeName", {
|
|
74
|
+
enumerable: true,
|
|
75
|
+
configurable: true,
|
|
76
|
+
writable: true,
|
|
77
|
+
value: 'bsync.MuteOperation'
|
|
78
|
+
});
|
|
79
|
+
Object.defineProperty(MuteOperation, "fields", {
|
|
80
|
+
enumerable: true,
|
|
81
|
+
configurable: true,
|
|
82
|
+
writable: true,
|
|
83
|
+
value: protobuf_1.proto3.util.newFieldList(() => [
|
|
84
|
+
{ no: 1, name: 'id', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
|
85
|
+
{
|
|
86
|
+
no: 2,
|
|
87
|
+
name: 'type',
|
|
88
|
+
kind: 'enum',
|
|
89
|
+
T: protobuf_1.proto3.getEnumType(MuteOperation_Type),
|
|
90
|
+
},
|
|
91
|
+
{ no: 3, name: 'actor_did', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
|
92
|
+
{ no: 4, name: 'subject', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
|
93
|
+
])
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* @generated from enum bsync.MuteOperation.Type
|
|
97
|
+
*/
|
|
98
|
+
var MuteOperation_Type;
|
|
99
|
+
(function (MuteOperation_Type) {
|
|
100
|
+
/**
|
|
101
|
+
* @generated from enum value: TYPE_UNSPECIFIED = 0;
|
|
102
|
+
*/
|
|
103
|
+
MuteOperation_Type[MuteOperation_Type["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
104
|
+
/**
|
|
105
|
+
* @generated from enum value: TYPE_ADD = 1;
|
|
106
|
+
*/
|
|
107
|
+
MuteOperation_Type[MuteOperation_Type["ADD"] = 1] = "ADD";
|
|
108
|
+
/**
|
|
109
|
+
* @generated from enum value: TYPE_REMOVE = 2;
|
|
110
|
+
*/
|
|
111
|
+
MuteOperation_Type[MuteOperation_Type["REMOVE"] = 2] = "REMOVE";
|
|
112
|
+
/**
|
|
113
|
+
* @generated from enum value: TYPE_CLEAR = 3;
|
|
114
|
+
*/
|
|
115
|
+
MuteOperation_Type[MuteOperation_Type["CLEAR"] = 3] = "CLEAR";
|
|
116
|
+
})(MuteOperation_Type || (exports.MuteOperation_Type = MuteOperation_Type = {}));
|
|
117
|
+
// Retrieve enum metadata with: proto3.getEnumType(MuteOperation_Type)
|
|
118
|
+
protobuf_1.proto3.util.setEnumType(MuteOperation_Type, 'bsync.MuteOperation.Type', [
|
|
119
|
+
{ no: 0, name: 'TYPE_UNSPECIFIED' },
|
|
120
|
+
{ no: 1, name: 'TYPE_ADD' },
|
|
121
|
+
{ no: 2, name: 'TYPE_REMOVE' },
|
|
122
|
+
{ no: 3, name: 'TYPE_CLEAR' },
|
|
123
|
+
]);
|
|
124
|
+
/**
|
|
125
|
+
* @generated from message bsync.AddMuteOperationRequest
|
|
126
|
+
*/
|
|
127
|
+
class AddMuteOperationRequest extends protobuf_1.Message {
|
|
128
|
+
constructor(data) {
|
|
129
|
+
super();
|
|
130
|
+
/**
|
|
131
|
+
* @generated from field: bsync.MuteOperation.Type type = 1;
|
|
132
|
+
*/
|
|
133
|
+
Object.defineProperty(this, "type", {
|
|
134
|
+
enumerable: true,
|
|
135
|
+
configurable: true,
|
|
136
|
+
writable: true,
|
|
137
|
+
value: MuteOperation_Type.UNSPECIFIED
|
|
138
|
+
});
|
|
139
|
+
/**
|
|
140
|
+
* @generated from field: string actor_did = 2;
|
|
141
|
+
*/
|
|
142
|
+
Object.defineProperty(this, "actorDid", {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
configurable: true,
|
|
145
|
+
writable: true,
|
|
146
|
+
value: ''
|
|
147
|
+
});
|
|
148
|
+
/**
|
|
149
|
+
* @generated from field: string subject = 3;
|
|
150
|
+
*/
|
|
151
|
+
Object.defineProperty(this, "subject", {
|
|
152
|
+
enumerable: true,
|
|
153
|
+
configurable: true,
|
|
154
|
+
writable: true,
|
|
155
|
+
value: ''
|
|
156
|
+
});
|
|
157
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
158
|
+
}
|
|
159
|
+
static fromBinary(bytes, options) {
|
|
160
|
+
return new AddMuteOperationRequest().fromBinary(bytes, options);
|
|
161
|
+
}
|
|
162
|
+
static fromJson(jsonValue, options) {
|
|
163
|
+
return new AddMuteOperationRequest().fromJson(jsonValue, options);
|
|
164
|
+
}
|
|
165
|
+
static fromJsonString(jsonString, options) {
|
|
166
|
+
return new AddMuteOperationRequest().fromJsonString(jsonString, options);
|
|
167
|
+
}
|
|
168
|
+
static equals(a, b) {
|
|
169
|
+
return protobuf_1.proto3.util.equals(AddMuteOperationRequest, a, b);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
exports.AddMuteOperationRequest = AddMuteOperationRequest;
|
|
173
|
+
Object.defineProperty(AddMuteOperationRequest, "runtime", {
|
|
174
|
+
enumerable: true,
|
|
175
|
+
configurable: true,
|
|
176
|
+
writable: true,
|
|
177
|
+
value: protobuf_1.proto3
|
|
178
|
+
});
|
|
179
|
+
Object.defineProperty(AddMuteOperationRequest, "typeName", {
|
|
180
|
+
enumerable: true,
|
|
181
|
+
configurable: true,
|
|
182
|
+
writable: true,
|
|
183
|
+
value: 'bsync.AddMuteOperationRequest'
|
|
184
|
+
});
|
|
185
|
+
Object.defineProperty(AddMuteOperationRequest, "fields", {
|
|
186
|
+
enumerable: true,
|
|
187
|
+
configurable: true,
|
|
188
|
+
writable: true,
|
|
189
|
+
value: protobuf_1.proto3.util.newFieldList(() => [
|
|
190
|
+
{
|
|
191
|
+
no: 1,
|
|
192
|
+
name: 'type',
|
|
193
|
+
kind: 'enum',
|
|
194
|
+
T: protobuf_1.proto3.getEnumType(MuteOperation_Type),
|
|
195
|
+
},
|
|
196
|
+
{ no: 2, name: 'actor_did', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
|
197
|
+
{ no: 3, name: 'subject', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
|
198
|
+
])
|
|
199
|
+
});
|
|
200
|
+
/**
|
|
201
|
+
* @generated from message bsync.AddMuteOperationResponse
|
|
202
|
+
*/
|
|
203
|
+
class AddMuteOperationResponse extends protobuf_1.Message {
|
|
204
|
+
constructor(data) {
|
|
205
|
+
super();
|
|
206
|
+
/**
|
|
207
|
+
* @generated from field: bsync.MuteOperation operation = 1;
|
|
208
|
+
*/
|
|
209
|
+
Object.defineProperty(this, "operation", {
|
|
210
|
+
enumerable: true,
|
|
211
|
+
configurable: true,
|
|
212
|
+
writable: true,
|
|
213
|
+
value: void 0
|
|
214
|
+
});
|
|
215
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
216
|
+
}
|
|
217
|
+
static fromBinary(bytes, options) {
|
|
218
|
+
return new AddMuteOperationResponse().fromBinary(bytes, options);
|
|
219
|
+
}
|
|
220
|
+
static fromJson(jsonValue, options) {
|
|
221
|
+
return new AddMuteOperationResponse().fromJson(jsonValue, options);
|
|
222
|
+
}
|
|
223
|
+
static fromJsonString(jsonString, options) {
|
|
224
|
+
return new AddMuteOperationResponse().fromJsonString(jsonString, options);
|
|
225
|
+
}
|
|
226
|
+
static equals(a, b) {
|
|
227
|
+
return protobuf_1.proto3.util.equals(AddMuteOperationResponse, a, b);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
exports.AddMuteOperationResponse = AddMuteOperationResponse;
|
|
231
|
+
Object.defineProperty(AddMuteOperationResponse, "runtime", {
|
|
232
|
+
enumerable: true,
|
|
233
|
+
configurable: true,
|
|
234
|
+
writable: true,
|
|
235
|
+
value: protobuf_1.proto3
|
|
236
|
+
});
|
|
237
|
+
Object.defineProperty(AddMuteOperationResponse, "typeName", {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
configurable: true,
|
|
240
|
+
writable: true,
|
|
241
|
+
value: 'bsync.AddMuteOperationResponse'
|
|
242
|
+
});
|
|
243
|
+
Object.defineProperty(AddMuteOperationResponse, "fields", {
|
|
244
|
+
enumerable: true,
|
|
245
|
+
configurable: true,
|
|
246
|
+
writable: true,
|
|
247
|
+
value: protobuf_1.proto3.util.newFieldList(() => [
|
|
248
|
+
{ no: 1, name: 'operation', kind: 'message', T: MuteOperation },
|
|
249
|
+
])
|
|
250
|
+
});
|
|
251
|
+
/**
|
|
252
|
+
* @generated from message bsync.ScanMuteOperationsRequest
|
|
253
|
+
*/
|
|
254
|
+
class ScanMuteOperationsRequest extends protobuf_1.Message {
|
|
255
|
+
constructor(data) {
|
|
256
|
+
super();
|
|
257
|
+
/**
|
|
258
|
+
* @generated from field: string cursor = 1;
|
|
259
|
+
*/
|
|
260
|
+
Object.defineProperty(this, "cursor", {
|
|
261
|
+
enumerable: true,
|
|
262
|
+
configurable: true,
|
|
263
|
+
writable: true,
|
|
264
|
+
value: ''
|
|
265
|
+
});
|
|
266
|
+
/**
|
|
267
|
+
* @generated from field: int32 limit = 2;
|
|
268
|
+
*/
|
|
269
|
+
Object.defineProperty(this, "limit", {
|
|
270
|
+
enumerable: true,
|
|
271
|
+
configurable: true,
|
|
272
|
+
writable: true,
|
|
273
|
+
value: 0
|
|
274
|
+
});
|
|
275
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
276
|
+
}
|
|
277
|
+
static fromBinary(bytes, options) {
|
|
278
|
+
return new ScanMuteOperationsRequest().fromBinary(bytes, options);
|
|
279
|
+
}
|
|
280
|
+
static fromJson(jsonValue, options) {
|
|
281
|
+
return new ScanMuteOperationsRequest().fromJson(jsonValue, options);
|
|
282
|
+
}
|
|
283
|
+
static fromJsonString(jsonString, options) {
|
|
284
|
+
return new ScanMuteOperationsRequest().fromJsonString(jsonString, options);
|
|
285
|
+
}
|
|
286
|
+
static equals(a, b) {
|
|
287
|
+
return protobuf_1.proto3.util.equals(ScanMuteOperationsRequest, a, b);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
exports.ScanMuteOperationsRequest = ScanMuteOperationsRequest;
|
|
291
|
+
Object.defineProperty(ScanMuteOperationsRequest, "runtime", {
|
|
292
|
+
enumerable: true,
|
|
293
|
+
configurable: true,
|
|
294
|
+
writable: true,
|
|
295
|
+
value: protobuf_1.proto3
|
|
296
|
+
});
|
|
297
|
+
Object.defineProperty(ScanMuteOperationsRequest, "typeName", {
|
|
298
|
+
enumerable: true,
|
|
299
|
+
configurable: true,
|
|
300
|
+
writable: true,
|
|
301
|
+
value: 'bsync.ScanMuteOperationsRequest'
|
|
302
|
+
});
|
|
303
|
+
Object.defineProperty(ScanMuteOperationsRequest, "fields", {
|
|
304
|
+
enumerable: true,
|
|
305
|
+
configurable: true,
|
|
306
|
+
writable: true,
|
|
307
|
+
value: protobuf_1.proto3.util.newFieldList(() => [
|
|
308
|
+
{ no: 1, name: 'cursor', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
|
309
|
+
{ no: 2, name: 'limit', kind: 'scalar', T: 5 /* ScalarType.INT32 */ },
|
|
310
|
+
])
|
|
311
|
+
});
|
|
312
|
+
/**
|
|
313
|
+
* @generated from message bsync.ScanMuteOperationsResponse
|
|
314
|
+
*/
|
|
315
|
+
class ScanMuteOperationsResponse extends protobuf_1.Message {
|
|
316
|
+
constructor(data) {
|
|
317
|
+
super();
|
|
318
|
+
/**
|
|
319
|
+
* @generated from field: repeated bsync.MuteOperation operations = 1;
|
|
320
|
+
*/
|
|
321
|
+
Object.defineProperty(this, "operations", {
|
|
322
|
+
enumerable: true,
|
|
323
|
+
configurable: true,
|
|
324
|
+
writable: true,
|
|
325
|
+
value: []
|
|
326
|
+
});
|
|
327
|
+
/**
|
|
328
|
+
* @generated from field: string cursor = 2;
|
|
329
|
+
*/
|
|
330
|
+
Object.defineProperty(this, "cursor", {
|
|
331
|
+
enumerable: true,
|
|
332
|
+
configurable: true,
|
|
333
|
+
writable: true,
|
|
334
|
+
value: ''
|
|
335
|
+
});
|
|
336
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
337
|
+
}
|
|
338
|
+
static fromBinary(bytes, options) {
|
|
339
|
+
return new ScanMuteOperationsResponse().fromBinary(bytes, options);
|
|
340
|
+
}
|
|
341
|
+
static fromJson(jsonValue, options) {
|
|
342
|
+
return new ScanMuteOperationsResponse().fromJson(jsonValue, options);
|
|
343
|
+
}
|
|
344
|
+
static fromJsonString(jsonString, options) {
|
|
345
|
+
return new ScanMuteOperationsResponse().fromJsonString(jsonString, options);
|
|
346
|
+
}
|
|
347
|
+
static equals(a, b) {
|
|
348
|
+
return protobuf_1.proto3.util.equals(ScanMuteOperationsResponse, a, b);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
exports.ScanMuteOperationsResponse = ScanMuteOperationsResponse;
|
|
352
|
+
Object.defineProperty(ScanMuteOperationsResponse, "runtime", {
|
|
353
|
+
enumerable: true,
|
|
354
|
+
configurable: true,
|
|
355
|
+
writable: true,
|
|
356
|
+
value: protobuf_1.proto3
|
|
357
|
+
});
|
|
358
|
+
Object.defineProperty(ScanMuteOperationsResponse, "typeName", {
|
|
359
|
+
enumerable: true,
|
|
360
|
+
configurable: true,
|
|
361
|
+
writable: true,
|
|
362
|
+
value: 'bsync.ScanMuteOperationsResponse'
|
|
363
|
+
});
|
|
364
|
+
Object.defineProperty(ScanMuteOperationsResponse, "fields", {
|
|
365
|
+
enumerable: true,
|
|
366
|
+
configurable: true,
|
|
367
|
+
writable: true,
|
|
368
|
+
value: protobuf_1.proto3.util.newFieldList(() => [
|
|
369
|
+
{
|
|
370
|
+
no: 1,
|
|
371
|
+
name: 'operations',
|
|
372
|
+
kind: 'message',
|
|
373
|
+
T: MuteOperation,
|
|
374
|
+
repeated: true,
|
|
375
|
+
},
|
|
376
|
+
{ no: 2, name: 'cursor', kind: 'scalar', T: 9 /* ScalarType.STRING */ },
|
|
377
|
+
])
|
|
378
|
+
});
|
|
379
|
+
/**
|
|
380
|
+
* Ping
|
|
381
|
+
*
|
|
382
|
+
* @generated from message bsync.PingRequest
|
|
383
|
+
*/
|
|
384
|
+
class PingRequest extends protobuf_1.Message {
|
|
385
|
+
constructor(data) {
|
|
386
|
+
super();
|
|
387
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
388
|
+
}
|
|
389
|
+
static fromBinary(bytes, options) {
|
|
390
|
+
return new PingRequest().fromBinary(bytes, options);
|
|
391
|
+
}
|
|
392
|
+
static fromJson(jsonValue, options) {
|
|
393
|
+
return new PingRequest().fromJson(jsonValue, options);
|
|
394
|
+
}
|
|
395
|
+
static fromJsonString(jsonString, options) {
|
|
396
|
+
return new PingRequest().fromJsonString(jsonString, options);
|
|
397
|
+
}
|
|
398
|
+
static equals(a, b) {
|
|
399
|
+
return protobuf_1.proto3.util.equals(PingRequest, a, b);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
exports.PingRequest = PingRequest;
|
|
403
|
+
Object.defineProperty(PingRequest, "runtime", {
|
|
404
|
+
enumerable: true,
|
|
405
|
+
configurable: true,
|
|
406
|
+
writable: true,
|
|
407
|
+
value: protobuf_1.proto3
|
|
408
|
+
});
|
|
409
|
+
Object.defineProperty(PingRequest, "typeName", {
|
|
410
|
+
enumerable: true,
|
|
411
|
+
configurable: true,
|
|
412
|
+
writable: true,
|
|
413
|
+
value: 'bsync.PingRequest'
|
|
414
|
+
});
|
|
415
|
+
Object.defineProperty(PingRequest, "fields", {
|
|
416
|
+
enumerable: true,
|
|
417
|
+
configurable: true,
|
|
418
|
+
writable: true,
|
|
419
|
+
value: protobuf_1.proto3.util.newFieldList(() => [])
|
|
420
|
+
});
|
|
421
|
+
/**
|
|
422
|
+
* @generated from message bsync.PingResponse
|
|
423
|
+
*/
|
|
424
|
+
class PingResponse extends protobuf_1.Message {
|
|
425
|
+
constructor(data) {
|
|
426
|
+
super();
|
|
427
|
+
protobuf_1.proto3.util.initPartial(data, this);
|
|
428
|
+
}
|
|
429
|
+
static fromBinary(bytes, options) {
|
|
430
|
+
return new PingResponse().fromBinary(bytes, options);
|
|
431
|
+
}
|
|
432
|
+
static fromJson(jsonValue, options) {
|
|
433
|
+
return new PingResponse().fromJson(jsonValue, options);
|
|
434
|
+
}
|
|
435
|
+
static fromJsonString(jsonString, options) {
|
|
436
|
+
return new PingResponse().fromJsonString(jsonString, options);
|
|
437
|
+
}
|
|
438
|
+
static equals(a, b) {
|
|
439
|
+
return protobuf_1.proto3.util.equals(PingResponse, a, b);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
exports.PingResponse = PingResponse;
|
|
443
|
+
Object.defineProperty(PingResponse, "runtime", {
|
|
444
|
+
enumerable: true,
|
|
445
|
+
configurable: true,
|
|
446
|
+
writable: true,
|
|
447
|
+
value: protobuf_1.proto3
|
|
448
|
+
});
|
|
449
|
+
Object.defineProperty(PingResponse, "typeName", {
|
|
450
|
+
enumerable: true,
|
|
451
|
+
configurable: true,
|
|
452
|
+
writable: true,
|
|
453
|
+
value: 'bsync.PingResponse'
|
|
454
|
+
});
|
|
455
|
+
Object.defineProperty(PingResponse, "fields", {
|
|
456
|
+
enumerable: true,
|
|
457
|
+
configurable: true,
|
|
458
|
+
writable: true,
|
|
459
|
+
value: protobuf_1.proto3.util.newFieldList(() => [])
|
|
460
|
+
});
|
|
461
|
+
//# sourceMappingURL=bsync_pb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bsync_pb.js","sourceRoot":"","sources":["../../src/proto/bsync_pb.ts"],"names":[],"mappings":";AAAA,qFAAqF;AACrF,kEAAkE;AAClE,oBAAoB;AACpB,cAAc;;;AAUd,iDAAoD;AAEpD;;GAEG;AACH,MAAa,aAAc,SAAQ,kBAAsB;IAqBvD,YAAY,IAAoC;QAC9C,KAAK,EAAE,CAAA;QArBT;;WAEG;QACH;;;;mBAAK,EAAE;WAAA;QAEP;;WAEG;QACH;;;;mBAAO,kBAAkB,CAAC,WAAW;WAAA;QAErC;;WAEG;QACH;;;;mBAAW,EAAE;WAAA;QAEb;;WAEG;QACH;;;;mBAAU,EAAE;WAAA;QAIV,iBAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACrC,CAAC;IAgBD,MAAM,CAAC,UAAU,CACf,KAAiB,EACjB,OAAoC;QAEpC,OAAO,IAAI,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IACvD,CAAC;IAED,MAAM,CAAC,QAAQ,CACb,SAAoB,EACpB,OAAkC;QAElC,OAAO,IAAI,aAAa,EAAE,CAAC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IACzD,CAAC;IAED,MAAM,CAAC,cAAc,CACnB,UAAkB,EAClB,OAAkC;QAElC,OAAO,IAAI,aAAa,EAAE,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;IAChE,CAAC;IAED,MAAM,CAAC,MAAM,CACX,CAA0D,EAC1D,CAA0D;QAE1D,OAAO,iBAAM,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAChD,CAAC;;AAlEH,sCA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 -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const kysely_1 = require("kysely");
|
|
4
|
+
const syntax_1 = require("@atproto/syntax");
|
|
5
|
+
const connect_1 = require("@connectrpc/connect");
|
|
6
|
+
const bsync_pb_1 = require("../proto/bsync_pb");
|
|
7
|
+
const mute_op_1 = require("../db/schema/mute_op");
|
|
8
|
+
const auth_1 = require("./auth");
|
|
9
|
+
exports.default = (ctx) => ({
|
|
10
|
+
async addMuteOperation(req, handlerCtx) {
|
|
11
|
+
(0, auth_1.authWithApiKey)(ctx, handlerCtx);
|
|
12
|
+
const { db } = ctx;
|
|
13
|
+
const op = validMuteOp(req);
|
|
14
|
+
const id = await db.transaction(async (txn) => {
|
|
15
|
+
// create mute op
|
|
16
|
+
const id = await createMuteOp(txn, op);
|
|
17
|
+
// update mute state
|
|
18
|
+
if (op.type === bsync_pb_1.MuteOperation_Type.ADD) {
|
|
19
|
+
await addMuteItem(txn, id, op);
|
|
20
|
+
}
|
|
21
|
+
else if (op.type === bsync_pb_1.MuteOperation_Type.REMOVE) {
|
|
22
|
+
await removeMuteItem(txn, op);
|
|
23
|
+
}
|
|
24
|
+
else if (op.type === bsync_pb_1.MuteOperation_Type.CLEAR) {
|
|
25
|
+
await clearMuteItems(txn, op);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
const exhaustiveCheck = op.type;
|
|
29
|
+
throw new Error(`unreachable: ${exhaustiveCheck}`);
|
|
30
|
+
}
|
|
31
|
+
return id;
|
|
32
|
+
});
|
|
33
|
+
return new bsync_pb_1.AddMuteOperationResponse({
|
|
34
|
+
operation: {
|
|
35
|
+
id: String(id),
|
|
36
|
+
type: op.type,
|
|
37
|
+
actorDid: op.actorDid,
|
|
38
|
+
subject: op.subject,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
const createMuteOp = async (db, op) => {
|
|
44
|
+
const { ref } = db.db.dynamic;
|
|
45
|
+
const { id } = await db.db
|
|
46
|
+
.insertInto('mute_op')
|
|
47
|
+
.values({
|
|
48
|
+
type: op.type,
|
|
49
|
+
actorDid: op.actorDid,
|
|
50
|
+
subject: op.subject,
|
|
51
|
+
})
|
|
52
|
+
.returning('id')
|
|
53
|
+
.executeTakeFirstOrThrow();
|
|
54
|
+
await (0, kysely_1.sql) `notify ${ref(mute_op_1.createMuteOpChannel)}`.execute(db.db); // emitted transactionally
|
|
55
|
+
return id;
|
|
56
|
+
};
|
|
57
|
+
const addMuteItem = async (db, fromId, op) => {
|
|
58
|
+
const { ref } = db.db.dynamic;
|
|
59
|
+
await db.db
|
|
60
|
+
.insertInto('mute_item')
|
|
61
|
+
.values({
|
|
62
|
+
actorDid: op.actorDid,
|
|
63
|
+
subject: op.subject,
|
|
64
|
+
fromId,
|
|
65
|
+
})
|
|
66
|
+
.onConflict((oc) => oc
|
|
67
|
+
.constraint('mute_item_pkey')
|
|
68
|
+
.doUpdateSet({ fromId: (0, kysely_1.sql) `${ref('excluded.fromId')}` }))
|
|
69
|
+
.execute();
|
|
70
|
+
};
|
|
71
|
+
const removeMuteItem = async (db, op) => {
|
|
72
|
+
await db.db
|
|
73
|
+
.deleteFrom('mute_item')
|
|
74
|
+
.where('actorDid', '=', op.actorDid)
|
|
75
|
+
.where('subject', '=', op.subject)
|
|
76
|
+
.execute();
|
|
77
|
+
};
|
|
78
|
+
const clearMuteItems = async (db, op) => {
|
|
79
|
+
await db.db
|
|
80
|
+
.deleteFrom('mute_item')
|
|
81
|
+
.where('actorDid', '=', op.actorDid)
|
|
82
|
+
.execute();
|
|
83
|
+
};
|
|
84
|
+
const validMuteOp = (op) => {
|
|
85
|
+
if (!Object.values(bsync_pb_1.MuteOperation_Type).includes(op.type)) {
|
|
86
|
+
throw new connect_1.ConnectError('bad mute operation type', connect_1.Code.InvalidArgument);
|
|
87
|
+
}
|
|
88
|
+
if (op.type === bsync_pb_1.MuteOperation_Type.UNSPECIFIED) {
|
|
89
|
+
throw new connect_1.ConnectError('unspecified mute operation type', connect_1.Code.InvalidArgument);
|
|
90
|
+
}
|
|
91
|
+
if (!isValidDid(op.actorDid)) {
|
|
92
|
+
throw new connect_1.ConnectError('actor_did must be a valid did', connect_1.Code.InvalidArgument);
|
|
93
|
+
}
|
|
94
|
+
if (op.type === bsync_pb_1.MuteOperation_Type.CLEAR) {
|
|
95
|
+
if (op.subject !== '') {
|
|
96
|
+
throw new connect_1.ConnectError('subject must not be set on a clear op', connect_1.Code.InvalidArgument);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
if (isValidDid(op.subject)) {
|
|
101
|
+
// all good
|
|
102
|
+
}
|
|
103
|
+
else if (isValidAtUri(op.subject)) {
|
|
104
|
+
const uri = new syntax_1.AtUri(op.subject);
|
|
105
|
+
if (uri.collection !== 'app.bsky.graph.list') {
|
|
106
|
+
throw new connect_1.ConnectError('subject aturis must reference a list record', connect_1.Code.InvalidArgument);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
throw new connect_1.ConnectError('subject must be a did or aturi on add or remove op', connect_1.Code.InvalidArgument);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return op; // op.type has been checked
|
|
114
|
+
};
|
|
115
|
+
const isValidDid = (did) => {
|
|
116
|
+
try {
|
|
117
|
+
(0, syntax_1.ensureValidDid)(did);
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
catch (err) {
|
|
121
|
+
if (err instanceof syntax_1.InvalidDidError) {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
throw err;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const isValidAtUri = (uri) => {
|
|
128
|
+
try {
|
|
129
|
+
(0, syntax_1.ensureValidAtUri)(uri);
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
catch {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=add-mute-operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-mute-operation.js","sourceRoot":"","sources":["../../src/routes/add-mute-operation.ts"],"names":[],"mappings":";;AAAA,mCAA4B;AAC5B,4CAKwB;AACxB,iDAAqE;AAErE,gDAAgF;AAEhF,kDAA0D;AAC1D,iCAAuC;AAGvC,kBAAe,CAAC,GAAe,EAAwC,EAAE,CAAC,CAAC;IACzE,KAAK,CAAC,gBAAgB,CAAC,GAAG,EAAE,UAAU;QACpC,IAAA,qBAAc,EAAC,GAAG,EAAE,UAAU,CAAC,CAAA;QAC/B,MAAM,EAAE,EAAE,EAAE,GAAG,GAAG,CAAA;QAClB,MAAM,EAAE,GAAG,WAAW,CAAC,GAAG,CAAC,CAAA;QAC3B,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAC5C,iBAAiB;YACjB,MAAM,EAAE,GAAG,MAAM,YAAY,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;YACtC,oBAAoB;YACpB,IAAI,EAAE,CAAC,IAAI,KAAK,6BAAkB,CAAC,GAAG,EAAE,CAAC;gBACvC,MAAM,WAAW,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA;YAChC,CAAC;iBAAM,IAAI,EAAE,CAAC,IAAI,KAAK,6BAAkB,CAAC,MAAM,EAAE,CAAC;gBACjD,MAAM,cAAc,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;YAC/B,CAAC;iBAAM,IAAI,EAAE,CAAC,IAAI,KAAK,6BAAkB,CAAC,KAAK,EAAE,CAAC;gBAChD,MAAM,cAAc,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;YAC/B,CAAC;iBAAM,CAAC;gBACN,MAAM,eAAe,GAAU,EAAE,CAAC,IAAI,CAAA;gBACtC,MAAM,IAAI,KAAK,CAAC,gB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EAAE,EAAE;IACnC,IAAI,CAAC;QACH,IAAA,yBAAgB,EAAC,GAAG,CAAC,CAAA;QACrB,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA"}
|
package/dist/routes/auth.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/routes/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACxE,OAAO,UAAU,MAAM,YAAY,CAAA;AAInC,eAAO,MAAM,cAAc,QAAS,UAAU,cAAc,cAAc,SASzE,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.authWithApiKey = void 0;
|
|
4
|
+
const connect_1 = require("@connectrpc/connect");
|
|
5
|
+
const BEARER = 'Bearer ';
|
|
6
|
+
const authWithApiKey = (ctx, handlerCtx) => {
|
|
7
|
+
const authorization = handlerCtx.requestHeader.get('authorization');
|
|
8
|
+
if (!authorization?.startsWith(BEARER)) {
|
|
9
|
+
throw new connect_1.ConnectError('missing auth', connect_1.Code.Unauthenticated);
|
|
10
|
+
}
|
|
11
|
+
const key = authorization.slice(BEARER.length);
|
|
12
|
+
if (!ctx.cfg.auth.apiKeys.has(key)) {
|
|
13
|
+
throw new connect_1.ConnectError('invalid api key', connect_1.Code.Unauthenticated);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
exports.authWithApiKey = authWithApiKey;
|
|
17
|
+
//# sourceMappingURL=auth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/routes/auth.ts"],"names":[],"mappings":";;;AAAA,iDAAwE;AAGxE,MAAM,MAAM,GAAG,SAAS,CAAA;AAEjB,MAAM,cAAc,GAAG,CAAC,GAAe,EAAE,UAA0B,EAAE,EAAE;IAC5E,MAAM,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;IACnE,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,sBAAY,CAAC,cAAc,EAAE,cAAI,CAAC,eAAe,CAAC,CAAA;IAC9D,CAAC;IACD,MAAM,GAAG,GAAG,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC9C,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,sBAAY,CAAC,iBAAiB,EAAE,cAAI,CAAC,eAAe,CAAC,CAAA;IACjE,CAAC;AACH,CAAC,CAAA;AATY,QAAA,cAAc,kBAS1B"}
|
package/dist/routes/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,OAAO,UAAU,MAAM,YAAY,CAAA;8BAId,UAAU,cAAc,aAAa;AAA1D,wBAUC"}
|