@atproto/pds 0.4.56 → 0.4.57
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +7 -0
- package/dist/api/com/atproto/repo/applyWrites.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/applyWrites.js +43 -7
- package/dist/api/com/atproto/repo/applyWrites.js.map +1 -1
- package/dist/api/com/atproto/repo/createRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/createRecord.js +10 -2
- package/dist/api/com/atproto/repo/createRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/deleteRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/deleteRecord.js +11 -0
- package/dist/api/com/atproto/repo/deleteRecord.js.map +1 -1
- package/dist/api/com/atproto/repo/putRecord.d.ts.map +1 -1
- package/dist/api/com/atproto/repo/putRecord.js +7 -0
- package/dist/api/com/atproto/repo/putRecord.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +131 -3
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +143 -6
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/com/atproto/repo/applyWrites.d.ts +38 -4
- package/dist/lexicon/types/com/atproto/repo/applyWrites.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/repo/applyWrites.js +31 -1
- package/dist/lexicon/types/com/atproto/repo/applyWrites.js.map +1 -1
- package/dist/lexicon/types/com/atproto/repo/createRecord.d.ts +5 -2
- package/dist/lexicon/types/com/atproto/repo/createRecord.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/repo/defs.d.ts +12 -0
- package/dist/lexicon/types/com/atproto/repo/defs.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/repo/defs.js +16 -0
- package/dist/lexicon/types/com/atproto/repo/defs.js.map +1 -0
- package/dist/lexicon/types/com/atproto/repo/deleteRecord.d.ts +14 -2
- package/dist/lexicon/types/com/atproto/repo/deleteRecord.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/repo/putRecord.d.ts +5 -2
- package/dist/lexicon/types/com/atproto/repo/putRecord.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/communication/createTemplate.d.ts +3 -0
- package/dist/lexicon/types/tools/ozone/communication/createTemplate.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/communication/defs.d.ts +2 -0
- package/dist/lexicon/types/tools/ozone/communication/defs.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/communication/defs.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/communication/updateTemplate.d.ts +3 -0
- package/dist/lexicon/types/tools/ozone/communication/updateTemplate.d.ts.map +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/emitEvent.d.ts +1 -1
- package/dist/lexicon/types/tools/ozone/moderation/emitEvent.d.ts.map +1 -1
- package/dist/repo/prepare.d.ts +4 -2
- package/dist/repo/prepare.d.ts.map +1 -1
- package/dist/repo/prepare.js +30 -14
- package/dist/repo/prepare.js.map +1 -1
- package/dist/repo/types.d.ts +3 -0
- package/dist/repo/types.d.ts.map +1 -1
- package/dist/repo/types.js.map +1 -1
- package/dist/sequencer/events.d.ts +2 -2
- package/package.json +4 -4
- package/src/api/com/atproto/repo/applyWrites.ts +41 -0
- package/src/api/com/atproto/repo/createRecord.ts +16 -7
- package/src/api/com/atproto/repo/deleteRecord.ts +11 -0
- package/src/api/com/atproto/repo/putRecord.ts +7 -0
- package/src/lexicon/lexicons.ts +143 -6
- package/src/lexicon/types/com/atproto/repo/applyWrites.ts +70 -3
- package/src/lexicon/types/com/atproto/repo/createRecord.ts +5 -2
- package/src/lexicon/types/com/atproto/repo/defs.ts +25 -0
- package/src/lexicon/types/com/atproto/repo/deleteRecord.ts +13 -1
- package/src/lexicon/types/com/atproto/repo/putRecord.ts +5 -2
- package/src/lexicon/types/tools/ozone/communication/createTemplate.ts +3 -0
- package/src/lexicon/types/tools/ozone/communication/defs.ts +2 -0
- package/src/lexicon/types/tools/ozone/communication/updateTemplate.ts +3 -0
- package/src/lexicon/types/tools/ozone/moderation/emitEvent.ts +1 -0
- package/src/repo/prepare.ts +31 -13
- package/src/repo/types.ts +4 -0
- package/tests/crud.test.ts +131 -14
@@ -3,29 +3,42 @@
|
|
3
3
|
*/
|
4
4
|
import express from 'express';
|
5
5
|
import { ValidationResult } from '@atproto/lexicon';
|
6
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
6
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
7
|
+
import * as ComAtprotoRepoDefs from './defs';
|
7
8
|
export interface QueryParams {
|
8
9
|
}
|
9
10
|
export interface InputSchema {
|
10
11
|
/** The handle or DID of the repo (aka, current account). */
|
11
12
|
repo: string;
|
12
|
-
/** Can be set to 'false' to skip Lexicon schema validation of record data, for
|
13
|
-
validate
|
13
|
+
/** Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons. */
|
14
|
+
validate?: boolean;
|
14
15
|
writes: (Create | Update | Delete)[];
|
15
16
|
/** If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations. */
|
16
17
|
swapCommit?: string;
|
17
18
|
[k: string]: unknown;
|
18
19
|
}
|
20
|
+
export interface OutputSchema {
|
21
|
+
commit?: ComAtprotoRepoDefs.CommitMeta;
|
22
|
+
results?: (CreateResult | UpdateResult | DeleteResult)[];
|
23
|
+
[k: string]: unknown;
|
24
|
+
}
|
19
25
|
export interface HandlerInput {
|
20
26
|
encoding: 'application/json';
|
21
27
|
body: InputSchema;
|
22
28
|
}
|
29
|
+
export interface HandlerSuccess {
|
30
|
+
encoding: 'application/json';
|
31
|
+
body: OutputSchema;
|
32
|
+
headers?: {
|
33
|
+
[key: string]: string;
|
34
|
+
};
|
35
|
+
}
|
23
36
|
export interface HandlerError {
|
24
37
|
status: number;
|
25
38
|
message?: string;
|
26
39
|
error?: 'InvalidSwap';
|
27
40
|
}
|
28
|
-
export type HandlerOutput = HandlerError |
|
41
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
29
42
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
30
43
|
auth: HA;
|
31
44
|
params: QueryParams;
|
@@ -60,4 +73,25 @@ export interface Delete {
|
|
60
73
|
}
|
61
74
|
export declare function isDelete(v: unknown): v is Delete;
|
62
75
|
export declare function validateDelete(v: unknown): ValidationResult;
|
76
|
+
export interface CreateResult {
|
77
|
+
uri: string;
|
78
|
+
cid: string;
|
79
|
+
validationStatus?: 'valid' | 'unknown' | (string & {});
|
80
|
+
[k: string]: unknown;
|
81
|
+
}
|
82
|
+
export declare function isCreateResult(v: unknown): v is CreateResult;
|
83
|
+
export declare function validateCreateResult(v: unknown): ValidationResult;
|
84
|
+
export interface UpdateResult {
|
85
|
+
uri: string;
|
86
|
+
cid: string;
|
87
|
+
validationStatus?: 'valid' | 'unknown' | (string & {});
|
88
|
+
[k: string]: unknown;
|
89
|
+
}
|
90
|
+
export declare function isUpdateResult(v: unknown): v is UpdateResult;
|
91
|
+
export declare function validateUpdateResult(v: unknown): ValidationResult;
|
92
|
+
export interface DeleteResult {
|
93
|
+
[k: string]: unknown;
|
94
|
+
}
|
95
|
+
export declare function isDeleteResult(v: unknown): v is DeleteResult;
|
96
|
+
export declare function validateDeleteResult(v: unknown): ValidationResult;
|
63
97
|
//# sourceMappingURL=applyWrites.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"applyWrites.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/repo/applyWrites.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAI5D,OAAO,EAAE,WAAW,
|
1
|
+
{"version":3,"file":"applyWrites.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/repo/applyWrites.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM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IAAI,MAAM,CAMhD;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAE3D;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IACtD,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,YAAY,CAM5D;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAEjE;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;IACtD,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,YAAY,CAM5D;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAEjE;AAED,MAAM,WAAW,YAAY;IAC3B,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,YAAY,CAM5D;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAEjE"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.validateDelete = exports.isDelete = exports.validateUpdate = exports.isUpdate = exports.validateCreate = exports.isCreate = void 0;
|
3
|
+
exports.validateDeleteResult = exports.isDeleteResult = exports.validateUpdateResult = exports.isUpdateResult = exports.validateCreateResult = exports.isCreateResult = exports.validateDelete = exports.isDelete = exports.validateUpdate = exports.isUpdate = exports.validateCreate = exports.isCreate = void 0;
|
4
4
|
const lexicons_1 = require("../../../../lexicons");
|
5
5
|
const util_1 = require("../../../../util");
|
6
6
|
function isCreate(v) {
|
@@ -33,4 +33,34 @@ function validateDelete(v) {
|
|
33
33
|
return lexicons_1.lexicons.validate('com.atproto.repo.applyWrites#delete', v);
|
34
34
|
}
|
35
35
|
exports.validateDelete = validateDelete;
|
36
|
+
function isCreateResult(v) {
|
37
|
+
return ((0, util_1.isObj)(v) &&
|
38
|
+
(0, util_1.hasProp)(v, '$type') &&
|
39
|
+
v.$type === 'com.atproto.repo.applyWrites#createResult');
|
40
|
+
}
|
41
|
+
exports.isCreateResult = isCreateResult;
|
42
|
+
function validateCreateResult(v) {
|
43
|
+
return lexicons_1.lexicons.validate('com.atproto.repo.applyWrites#createResult', v);
|
44
|
+
}
|
45
|
+
exports.validateCreateResult = validateCreateResult;
|
46
|
+
function isUpdateResult(v) {
|
47
|
+
return ((0, util_1.isObj)(v) &&
|
48
|
+
(0, util_1.hasProp)(v, '$type') &&
|
49
|
+
v.$type === 'com.atproto.repo.applyWrites#updateResult');
|
50
|
+
}
|
51
|
+
exports.isUpdateResult = isUpdateResult;
|
52
|
+
function validateUpdateResult(v) {
|
53
|
+
return lexicons_1.lexicons.validate('com.atproto.repo.applyWrites#updateResult', v);
|
54
|
+
}
|
55
|
+
exports.validateUpdateResult = validateUpdateResult;
|
56
|
+
function isDeleteResult(v) {
|
57
|
+
return ((0, util_1.isObj)(v) &&
|
58
|
+
(0, util_1.hasProp)(v, '$type') &&
|
59
|
+
v.$type === 'com.atproto.repo.applyWrites#deleteResult');
|
60
|
+
}
|
61
|
+
exports.isDeleteResult = isDeleteResult;
|
62
|
+
function validateDeleteResult(v) {
|
63
|
+
return lexicons_1.lexicons.validate('com.atproto.repo.applyWrites#deleteResult', v);
|
64
|
+
}
|
65
|
+
exports.validateDeleteResult = validateDeleteResult;
|
36
66
|
//# sourceMappingURL=applyWrites.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"applyWrites.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/repo/applyWrites.ts"],"names":[],"mappings":";;;AAKA,mDAA+C;AAC/C,2CAAiD;
|
1
|
+
{"version":3,"file":"applyWrites.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/repo/applyWrites.ts"],"names":[],"mappings":";;;AAKA,mDAA+C;AAC/C,2CAAiD;AA6DjD,SAAgB,QAAQ,CAAC,CAAU;IACjC,OAAO,CACL,IAAA,YAAK,EAAC,CAAC,CAAC;QACR,IAAA,cAAO,EAAC,CAAC,EAAE,OAAO,CAAC;QACnB,CAAC,CAAC,KAAK,KAAK,qCAAqC,CAClD,CAAA;AACH,CAAC;AAND,4BAMC;AAED,SAAgB,cAAc,CAAC,CAAU;IACvC,OAAO,mBAAQ,CAAC,QAAQ,CAAC,qCAAqC,EAAE,CAAC,CAAC,CAAA;AACpE,CAAC;AAFD,wCAEC;AAUD,SAAgB,QAAQ,CAAC,CAAU;IACjC,OAAO,CACL,IAAA,YAAK,EAAC,CAAC,CAAC;QACR,IAAA,cAAO,EAAC,CAAC,EAAE,OAAO,CAAC;QACnB,CAAC,CAAC,KAAK,KAAK,qCAAqC,CAClD,CAAA;AACH,CAAC;AAND,4BAMC;AAED,SAAgB,cAAc,CAAC,CAAU;IACvC,OAAO,mBAAQ,CAAC,QAAQ,CAAC,qCAAqC,EAAE,CAAC,CAAC,CAAA;AACpE,CAAC;AAFD,wCAEC;AASD,SAAgB,QAAQ,CAAC,CAAU;IACjC,OAAO,CACL,IAAA,YAAK,EAAC,CAAC,CAAC;QACR,IAAA,cAAO,EAAC,CAAC,EAAE,OAAO,CAAC;QACnB,CAAC,CAAC,KAAK,KAAK,qCAAqC,CAClD,CAAA;AACH,CAAC;AAND,4BAMC;AAED,SAAgB,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ComAtprotoRepoDefs from './defs';
|
6
7
|
export interface QueryParams {
|
7
8
|
}
|
8
9
|
export interface InputSchema {
|
@@ -12,8 +13,8 @@ export interface InputSchema {
|
|
12
13
|
collection: string;
|
13
14
|
/** The Record Key. */
|
14
15
|
rkey?: string;
|
15
|
-
/** Can be set to 'false' to skip Lexicon schema validation of record data. */
|
16
|
-
validate
|
16
|
+
/** Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. */
|
17
|
+
validate?: boolean;
|
17
18
|
/** The record itself. Must contain a $type field. */
|
18
19
|
record: {};
|
19
20
|
/** Compare and swap with the previous commit by CID. */
|
@@ -23,6 +24,8 @@ export interface InputSchema {
|
|
23
24
|
export interface OutputSchema {
|
24
25
|
uri: string;
|
25
26
|
cid: string;
|
27
|
+
commit?: ComAtprotoRepoDefs.CommitMeta;
|
28
|
+
validationStatus?: 'valid' | 'unknown' | (string & {});
|
26
29
|
[k: string]: unknown;
|
27
30
|
}
|
28
31
|
export interface HandlerInput {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createRecord.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/repo/createRecord.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;
|
1
|
+
{"version":3,"file":"createRecord.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/repo/createRecord.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,kBAAkB,MAAM,QAAQ,CAAA;AAE5C,MAAM,WAAW,WAAW;CAAG;AAE/B,MAAM,WAAW,WAAW;IAC1B,4DAA4D;IAC5D,IAAI,EAAE,MAAM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AAC,OAAO,CAAA;IACpB,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI,CACpD,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,KACnB,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/**
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
3
|
+
*/
|
4
|
+
import { ValidationResult } from '@atproto/lexicon';
|
5
|
+
export interface CommitMeta {
|
6
|
+
cid: string;
|
7
|
+
rev: string;
|
8
|
+
[k: string]: unknown;
|
9
|
+
}
|
10
|
+
export declare function isCommitMeta(v: unknown): v is CommitMeta;
|
11
|
+
export declare function validateCommitMeta(v: unknown): ValidationResult;
|
12
|
+
//# sourceMappingURL=defs.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/repo/defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAK5D,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,UAAU,CAMxD;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAE/D"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.validateCommitMeta = exports.isCommitMeta = void 0;
|
4
|
+
const lexicons_1 = require("../../../../lexicons");
|
5
|
+
const util_1 = require("../../../../util");
|
6
|
+
function isCommitMeta(v) {
|
7
|
+
return ((0, util_1.isObj)(v) &&
|
8
|
+
(0, util_1.hasProp)(v, '$type') &&
|
9
|
+
v.$type === 'com.atproto.repo.defs#commitMeta');
|
10
|
+
}
|
11
|
+
exports.isCommitMeta = isCommitMeta;
|
12
|
+
function validateCommitMeta(v) {
|
13
|
+
return lexicons_1.lexicons.validate('com.atproto.repo.defs#commitMeta', v);
|
14
|
+
}
|
15
|
+
exports.validateCommitMeta = validateCommitMeta;
|
16
|
+
//# sourceMappingURL=defs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"defs.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/repo/defs.ts"],"names":[],"mappings":";;;AAIA,mDAA+C;AAC/C,2CAAiD;AASjD,SAAgB,YAAY,CAAC,CAAU;IACrC,OAAO,CACL,IAAA,YAAK,EAAC,CAAC,CAAC;QACR,IAAA,cAAO,EAAC,CAAC,EAAE,OAAO,CAAC;QACnB,CAAC,CAAC,KAAK,KAAK,kCAAkC,CAC/C,CAAA;AACH,CAAC;AAND,oCAMC;AAED,SAAgB,kBAAkB,CAAC,CAAU;IAC3C,OAAO,mBAAQ,CAAC,QAAQ,CAAC,kCAAkC,EAAE,CAAC,CAAC,CAAA;AACjE,CAAC;AAFD,gDAEC"}
|
@@ -2,7 +2,8 @@
|
|
2
2
|
* GENERATED CODE - DO NOT MODIFY
|
3
3
|
*/
|
4
4
|
import express from 'express';
|
5
|
-
import { HandlerAuth } from '@atproto/xrpc-server';
|
5
|
+
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server';
|
6
|
+
import * as ComAtprotoRepoDefs from './defs';
|
6
7
|
export interface QueryParams {
|
7
8
|
}
|
8
9
|
export interface InputSchema {
|
@@ -18,16 +19,27 @@ export interface InputSchema {
|
|
18
19
|
swapCommit?: string;
|
19
20
|
[k: string]: unknown;
|
20
21
|
}
|
22
|
+
export interface OutputSchema {
|
23
|
+
commit?: ComAtprotoRepoDefs.CommitMeta;
|
24
|
+
[k: string]: unknown;
|
25
|
+
}
|
21
26
|
export interface HandlerInput {
|
22
27
|
encoding: 'application/json';
|
23
28
|
body: InputSchema;
|
24
29
|
}
|
30
|
+
export interface HandlerSuccess {
|
31
|
+
encoding: 'application/json';
|
32
|
+
body: OutputSchema;
|
33
|
+
headers?: {
|
34
|
+
[key: string]: string;
|
35
|
+
};
|
36
|
+
}
|
25
37
|
export interface HandlerError {
|
26
38
|
status: number;
|
27
39
|
message?: string;
|
28
40
|
error?: 'InvalidSwap';
|
29
41
|
}
|
30
|
-
export type HandlerOutput = HandlerError |
|
42
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
31
43
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
32
44
|
auth: HA;
|
33
45
|
params: QueryParams;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deleteRecord.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/repo/deleteRecord.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,
|
1
|
+
{"version":3,"file":"deleteRecord.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/repo/deleteRecord.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,kBAAkB,MAAM,QAAQ,CAAA;AAE5C,MAAM,WAAW,WAAW;CAAG;AAE/B,MAAM,WAAW,WAAW;IAC1B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAA;IACZ,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAA;IAClB,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,wDAAwD;IACxD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,wDAAwD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tprotoRepoDefs from './defs';
|
6
7
|
export interface QueryParams {
|
7
8
|
}
|
8
9
|
export interface InputSchema {
|
@@ -12,8 +13,8 @@ export interface InputSchema {
|
|
12
13
|
collection: string;
|
13
14
|
/** The Record Key. */
|
14
15
|
rkey: string;
|
15
|
-
/** Can be set to 'false' to skip Lexicon schema validation of record data. */
|
16
|
-
validate
|
16
|
+
/** Can be set to 'false' to skip Lexicon schema validation of record data, 'true' to require it, or leave unset to validate only for known Lexicons. */
|
17
|
+
validate?: boolean;
|
17
18
|
/** The record to write. */
|
18
19
|
record: {};
|
19
20
|
/** Compare and swap with the previous record by CID. WARNING: nullable and optional field; may cause problems with golang implementation */
|
@@ -25,6 +26,8 @@ export interface InputSchema {
|
|
25
26
|
export interface OutputSchema {
|
26
27
|
uri: string;
|
27
28
|
cid: string;
|
29
|
+
commit?: ComAtprotoRepoDefs.CommitMeta;
|
30
|
+
validationStatus?: 'valid' | 'unknown' | (string & {});
|
28
31
|
[k: string]: unknown;
|
29
32
|
}
|
30
33
|
export interface HandlerInput {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"putRecord.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/repo/putRecord.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;
|
1
|
+
{"version":3,"file":"putRecord.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/com/atproto/repo/putRecord.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,kBAAkB,MAAM,QAAQ,CAAA;AAE5C,MAAM,WAAW,WAAW;CAAG;AAE/B,MAAM,WAAW,WAAW;IAC1B,4DAA4D;IAC5D,IAA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,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;IACnB,GAAG,EAAE,OAAO,CAAC,OAAO,CAAA;IACpB,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI,CACpD,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,KACnB,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA"}
|
@@ -13,6 +13,8 @@ export interface InputSchema {
|
|
13
13
|
contentMarkdown: string;
|
14
14
|
/** Subject of the message, used in emails. */
|
15
15
|
subject: string;
|
16
|
+
/** Message language. */
|
17
|
+
lang?: string;
|
16
18
|
/** DID of the user who is creating the template. */
|
17
19
|
createdBy?: string;
|
18
20
|
[k: string]: unknown;
|
@@ -32,6 +34,7 @@ export interface HandlerSuccess {
|
|
32
34
|
export interface HandlerError {
|
33
35
|
status: number;
|
34
36
|
message?: string;
|
37
|
+
error?: 'DuplicateTemplateName';
|
35
38
|
}
|
36
39
|
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
37
40
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"createTemplate.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/communication/createTemplate.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,2BAA2B,MAAM,QAAQ,CAAA;AAErD,MAAM,WAAW,WAAW;CAAG;AAE/B,MAAM,WAAW,WAAW;IAC1B,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,sFAAsF;IACtF,eAAe,EAAE,MAAM,CAAA;IACvB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAA;IACf,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,MAAM,MAAM,YAAY,GAAG,2BAA2B,CAAC,YAAY,CAAA;AAEnE,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;
|
1
|
+
{"version":3,"file":"createTemplate.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/communication/createTemplate.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,2BAA2B,MAAM,QAAQ,CAAA;AAErD,MAAM,WAAW,WAAW;CAAG;AAE/B,MAAM,WAAW,WAAW;IAC1B,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,sFAAsF;IACtF,eAAe,EAAE,MAAM,CAAA;IACvB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAA;IACf,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,MAAM,MAAM,YAAY,GAAG,2BAA2B,CAAC,YAAY,CAAA;AAEnE,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,uBAAuB,CAAA;CAChC;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,kBAAkB,CAAA;AAC9E,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI;IAC1D,IAAI,EAAE,EAAE,CAAA;IACR,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;IACnB,GAAG,EAAE,OAAO,CAAC,OAAO,CAAA;IACpB,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI,CACpD,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,KACnB,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA"}
|
@@ -11,6 +11,8 @@ export interface TemplateView {
|
|
11
11
|
/** Subject of the message, used in emails. */
|
12
12
|
contentMarkdown: string;
|
13
13
|
disabled: boolean;
|
14
|
+
/** Message language. */
|
15
|
+
lang?: string;
|
14
16
|
/** DID of the user who last updated the template. */
|
15
17
|
lastUpdatedBy: string;
|
16
18
|
createdAt: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/communication/defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAK5D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,8CAA8C;IAC9C,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;IACjB,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,YAAY,CAM5D;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAEjE"}
|
1
|
+
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/communication/defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAW,MAAM,kBAAkB,CAAA;AAK5D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,8CAA8C;IAC9C,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;IACjB,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,YAAY,CAM5D;AAED,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,OAAO,GAAG,gBAAgB,CAEjE"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"defs.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/communication/defs.ts"],"names":[],"mappings":";;;AAIA,mDAA+C;AAC/C,2CAAiD;
|
1
|
+
{"version":3,"file":"defs.js","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/communication/defs.ts"],"names":[],"mappings":";;;AAIA,mDAA+C;AAC/C,2CAAiD;AAqBjD,SAAgB,cAAc,CAAC,CAAU;IACvC,OAAO,CACL,IAAA,YAAK,EAAC,CAAC,CAAC;QACR,IAAA,cAAO,EAAC,CAAC,EAAE,OAAO,CAAC;QACnB,CAAC,CAAC,KAAK,KAAK,6CAA6C,CAC1D,CAAA;AACH,CAAC;AAND,wCAMC;AAED,SAAgB,oBAAoB,CAAC,CAAU;IAC7C,OAAO,mBAAQ,CAAC,QAAQ,CAAC,6CAA6C,EAAE,CAAC,CAAC,CAAA;AAC5E,CAAC;AAFD,oDAEC"}
|
@@ -11,6 +11,8 @@ export interface InputSchema {
|
|
11
11
|
id: string;
|
12
12
|
/** Name of the template. */
|
13
13
|
name?: string;
|
14
|
+
/** Message language. */
|
15
|
+
lang?: string;
|
14
16
|
/** Content of the template, markdown supported, can contain variable placeholders. */
|
15
17
|
contentMarkdown?: string;
|
16
18
|
/** Subject of the message, used in emails. */
|
@@ -35,6 +37,7 @@ export interface HandlerSuccess {
|
|
35
37
|
export interface HandlerError {
|
36
38
|
status: number;
|
37
39
|
message?: string;
|
40
|
+
error?: 'DuplicateTemplateName';
|
38
41
|
}
|
39
42
|
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough;
|
40
43
|
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"updateTemplate.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/communication/updateTemplate.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAO,KAAK,2BAA2B,MAAM,QAAQ,CAAA;AAErD,MAAM,WAAW,WAAW;CAAG;AAE/B,MAAM,WAAW,WAAW;IAC1B,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAA;IACV,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sFAAsF;IACtF,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,8CAA8C;IAC9C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CACrB;AAED,MAAM,MAAM,YAAY,GAAG,2BAA2B,CAAC,YAAY,CAAA;AAEnE,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,WAAW,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,IAAI,EAAE,YAAY,CAAA;IAClB,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;
|
1
|
+
{"version":3,"file":"updateTemplate.d.ts","sourceRoot":"","sources":["../../../../../../src/lexicon/types/tools/ozone/communication/updateTemplate.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,OAAO,MAAM,SAAS,CAAA;AAK7B,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC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EAAE,OAAO,CAAC,QAAQ,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI,CACpD,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,KACnB,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA"}
|
@@ -9,7 +9,7 @@ import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef';
|
|
9
9
|
export interface QueryParams {
|
10
10
|
}
|
11
11
|
export interface InputSchema {
|
12
|
-
event: ToolsOzoneModerationDefs.ModEventTakedown | ToolsOzoneModerationDefs.ModEventAcknowledge | ToolsOzoneModerationDefs.ModEventEscalate | ToolsOzoneModerationDefs.ModEventComment | ToolsOzoneModerationDefs.ModEventLabel | ToolsOzoneModerationDefs.ModEventReport | ToolsOzoneModerationDefs.ModEventMute | ToolsOzoneModerationDefs.ModEventUnmute | ToolsOzoneModerationDefs.ModEventMuteReporter | ToolsOzoneModerationDefs.ModEventUnmuteReporter | ToolsOzoneModerationDefs.ModEventReverseTakedown | ToolsOzoneModerationDefs.ModEventEmail | ToolsOzoneModerationDefs.ModEventTag | {
|
12
|
+
event: ToolsOzoneModerationDefs.ModEventTakedown | ToolsOzoneModerationDefs.ModEventAcknowledge | ToolsOzoneModerationDefs.ModEventEscalate | ToolsOzoneModerationDefs.ModEventComment | ToolsOzoneModerationDefs.ModEventLabel | ToolsOzoneModerationDefs.ModEventReport | ToolsOzoneModerationDefs.ModEventMute | ToolsOzoneModerationDefs.ModEventUnmute | ToolsOzoneModerationDefs.ModEventMuteReporter | ToolsOzoneModerationDefs.ModEventUnmuteReporter | ToolsOzoneModerationDefs.ModEventReverseTakedown | ToolsOzoneModerationDefs.ModEventResolveAppeal | ToolsOzoneModerationDefs.ModEventEmail | ToolsOzoneModerationDefs.ModEventTag | {
|
13
13
|
$type: string;
|
14
14
|
[k: string]: unknown;
|
15
15
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":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,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,kBAAkB,CAAA;CAC3B;AAED,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,cAAc,GAAG,kBAAkB,CAAA;AAC9E,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI;IAC1D,IAAI,EAAE,EAAE,CAAA;IACR,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;IACnB,GAAG,EAAE,OAAO,CAAC,OAAO,CAAA;IACpB,GAAG,EAAE,OAAO,CAAC,QAAQ,CAAA;CACtB,CAAA;AACD,MAAM,MAAM,OAAO,CAAC,EAAE,SAAS,WAAW,GAAG,KAAK,IAAI,CACpD,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC,KACnB,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAA"}
|
package/dist/repo/prepare.d.ts
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
import { CID } from 'multiformats/cid';
|
2
2
|
import { BlobRef, LexValue, RepoRecord } from '@atproto/lexicon';
|
3
3
|
import { RecordDeleteOp, RecordCreateOp, RecordUpdateOp, RecordWriteOp } from '@atproto/repo';
|
4
|
-
import { PreparedCreate, PreparedUpdate, PreparedDelete, PreparedWrite, PreparedBlobRef } from './types';
|
5
|
-
export declare const
|
4
|
+
import { PreparedCreate, PreparedUpdate, PreparedDelete, PreparedWrite, PreparedBlobRef, ValidationStatus } from './types';
|
5
|
+
export declare const assertValidRecordWithStatus: (record: Record<string, unknown>, opts: {
|
6
|
+
requireLexicon: boolean;
|
7
|
+
}) => ValidationStatus;
|
6
8
|
export declare const assertValidCreatedAt: (record: Record<string, unknown>) => void;
|
7
9
|
export declare const setCollectionName: (collection: string, record: RepoRecord, validate: boolean) => RepoRecord;
|
8
10
|
export declare const prepareCreate: (opts: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../src/repo/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAOtC,OAAO,EACL,OAAO,EACP,QAAQ,EAER,UAAU,EAIX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,EAEd,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,EAEd,aAAa,EACb,eAAe,
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../src/repo/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAOtC,OAAO,EACL,OAAO,EACP,QAAQ,EAER,UAAU,EAIX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEL,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,EAEd,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,cAAc,EACd,cAAc,EACd,cAAc,EAEd,aAAa,EACb,eAAe,EACf,gBAAgB,EACjB,MAAM,SAAS,CAAA;AAUhB,eAAO,MAAM,2BAA2B,WAC9B,OAAO,MAAM,EAAE,OAAO,CAAC,QACzB;IAAE,cAAc,EAAE,OAAO,CAAA;CAAE,KAChC,gBAsBF,CAAA;AAID,eAAO,MAAM,oBAAoB,WAAY,OAAO,MAAM,EAAE,OAAO,CAAC,SAYnE,CAAA;AAED,eAAO,MAAM,iBAAiB,eAChB,MAAM,UACV,UAAU,YACR,OAAO,eAWlB,CAAA;AAED,eAAO,MAAM,aAAa,SAAgB;IACxC,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI,CAAA;IACpB,MAAM,EAAE,UAAU,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,KAAG,QAAQ,cAAc,CAwBzB,CAAA;AAED,eAAO,MAAM,aAAa,SAAgB;IACxC,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI,CAAA;IACpB,MAAM,EAAE,UAAU,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,KAAG,QAAQ,cAAc,CAoBzB,CAAA;AAED,eAAO,MAAM,aAAa,SAAU;IAClC,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI,CAAA;CACrB,KAAG,cAOH,CAAA;AAED,eAAO,MAAM,eAAe,UAAW,cAAc,KAAG,cAKtD,CAAA;AAEF,eAAO,MAAM,eAAe,UAAW,cAAc,KAAG,cAKtD,CAAA;AAEF,eAAO,MAAM,eAAe,UAAW,cAAc,KAAG,cAItD,CAAA;AAEF,eAAO,MAAM,SAAS,UAAW,aAAa,KAAG,aAWhD,CAAA;AA4CD,KAAK,YAAY,GAAG;IAClB,GAAG,EAAE,OAAO,CAAA;IACZ,IAAI,EAAE,MAAM,EAAE,CAAA;CACf,CAAA;AAED,eAAO,MAAM,aAAa,WAChB,UAAU,YACR,OAAO,KAChB,eAAe,EAmBjB,CAAA;AAED,eAAO,MAAM,YAAY,QAClB,QAAQ,SACP,MAAM,EAAE,qBAEb,YAAY,EA6Bd,CAAA"}
|
package/dist/repo/prepare.js
CHANGED
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
23
|
return result;
|
24
24
|
};
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.findBlobRefs = exports.blobsForWrite = exports.writeToOp = exports.deleteWriteToOp = exports.updateWriteToOp = exports.createWriteToOp = exports.prepareDelete = exports.prepareUpdate = exports.prepareCreate = exports.setCollectionName = exports.assertValidCreatedAt = exports.
|
26
|
+
exports.findBlobRefs = exports.blobsForWrite = exports.writeToOp = exports.deleteWriteToOp = exports.updateWriteToOp = exports.createWriteToOp = exports.prepareDelete = exports.prepareUpdate = exports.prepareCreate = exports.setCollectionName = exports.assertValidCreatedAt = exports.assertValidRecordWithStatus = void 0;
|
27
27
|
const cid_1 = require("multiformats/cid");
|
28
28
|
const syntax_1 = require("@atproto/syntax");
|
29
29
|
const common_1 = require("@atproto/common");
|
@@ -38,7 +38,7 @@ const facet_1 = require("../lexicon/types/app/bsky/richtext/facet");
|
|
38
38
|
const list_1 = require("../lexicon/types/app/bsky/graph/list");
|
39
39
|
const profile_1 = require("../lexicon/types/app/bsky/actor/profile");
|
40
40
|
const explicit_slurs_1 = require("../handle/explicit-slurs");
|
41
|
-
const
|
41
|
+
const assertValidRecordWithStatus = (record, opts) => {
|
42
42
|
if (typeof record.$type !== 'string') {
|
43
43
|
throw new types_1.InvalidRecordError('No $type provided');
|
44
44
|
}
|
@@ -48,12 +48,18 @@ const assertValidRecord = (record) => {
|
|
48
48
|
}
|
49
49
|
catch (e) {
|
50
50
|
if (e instanceof lexicon_1.LexiconDefNotFoundError) {
|
51
|
-
|
51
|
+
if (opts.requireLexicon) {
|
52
|
+
throw new types_1.InvalidRecordError(e.message);
|
53
|
+
}
|
54
|
+
else {
|
55
|
+
return 'unknown';
|
56
|
+
}
|
52
57
|
}
|
53
58
|
throw new types_1.InvalidRecordError(`Invalid ${record.$type} record: ${e instanceof Error ? e.message : String(e)}`);
|
54
59
|
}
|
60
|
+
return 'valid';
|
55
61
|
};
|
56
|
-
exports.
|
62
|
+
exports.assertValidRecordWithStatus = assertValidRecordWithStatus;
|
57
63
|
// additional more rigorous check on datetimes
|
58
64
|
// this check will eventually be in the lex sdk, but this will stop the bleed until then
|
59
65
|
const assertValidCreatedAt = (record) => {
|
@@ -80,10 +86,14 @@ const setCollectionName = (collection, record, validate) => {
|
|
80
86
|
};
|
81
87
|
exports.setCollectionName = setCollectionName;
|
82
88
|
const prepareCreate = async (opts) => {
|
83
|
-
const { did, collection, swapCid, validate
|
84
|
-
const
|
85
|
-
|
86
|
-
|
89
|
+
const { did, collection, swapCid, validate } = opts;
|
90
|
+
const maybeValidate = validate !== false;
|
91
|
+
const record = (0, exports.setCollectionName)(collection, opts.record, maybeValidate);
|
92
|
+
let validationStatus;
|
93
|
+
if (maybeValidate) {
|
94
|
+
validationStatus = (0, exports.assertValidRecordWithStatus)(record, {
|
95
|
+
requireLexicon: validate === true,
|
96
|
+
});
|
87
97
|
}
|
88
98
|
const nextRkey = common_1.TID.next();
|
89
99
|
const rkey = opts.rkey || nextRkey.toString();
|
@@ -96,15 +106,20 @@ const prepareCreate = async (opts) => {
|
|
96
106
|
cid: await cidForSafeRecord(record),
|
97
107
|
swapCid,
|
98
108
|
record,
|
99
|
-
blobs: (0, exports.blobsForWrite)(record,
|
109
|
+
blobs: (0, exports.blobsForWrite)(record, maybeValidate),
|
110
|
+
validationStatus,
|
100
111
|
};
|
101
112
|
};
|
102
113
|
exports.prepareCreate = prepareCreate;
|
103
114
|
const prepareUpdate = async (opts) => {
|
104
|
-
const { did, collection, rkey, swapCid, validate
|
105
|
-
const
|
106
|
-
|
107
|
-
|
115
|
+
const { did, collection, rkey, swapCid, validate } = opts;
|
116
|
+
const maybeValidate = validate !== false;
|
117
|
+
const record = (0, exports.setCollectionName)(collection, opts.record, maybeValidate);
|
118
|
+
let validationStatus;
|
119
|
+
if (maybeValidate) {
|
120
|
+
validationStatus = (0, exports.assertValidRecordWithStatus)(record, {
|
121
|
+
requireLexicon: validate === true,
|
122
|
+
});
|
108
123
|
}
|
109
124
|
assertNoExplicitSlurs(rkey, record);
|
110
125
|
return {
|
@@ -113,7 +128,8 @@ const prepareUpdate = async (opts) => {
|
|
113
128
|
cid: await cidForSafeRecord(record),
|
114
129
|
swapCid,
|
115
130
|
record,
|
116
|
-
blobs: (0, exports.blobsForWrite)(record,
|
131
|
+
blobs: (0, exports.blobsForWrite)(record, maybeValidate),
|
132
|
+
validationStatus,
|
117
133
|
};
|
118
134
|
};
|
119
135
|
exports.prepareUpdate = prepareUpdate;
|
package/dist/repo/prepare.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../src/repo/prepare.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAsC;AACtC,4CAIwB;AACxB,4CAA6D;AAC7D,8CAQyB;AACzB,wCAOsB;AACtB,
|
1
|
+
{"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../src/repo/prepare.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAsC;AACtC,4CAIwB;AACxB,4CAA6D;AAC7D,8CAQyB;AACzB,wCAOsB;AACtB,mCAQgB;AAChB,yDAA0C;AAC1C,wEAAsF;AACtF,6EAAuF;AACvF,8DAAwE;AACxE,oEAAgE;AAChE,+DAAyE;AACzE,qEAA+E;AAC/E,6DAA0D;AAEnD,MAAM,2BAA2B,GAAG,CACzC,MAA+B,EAC/B,IAAiC,EACf,EAAE;IACpB,IAAI,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrC,MAAM,IAAI,0BAAkB,CAAC,mBAAmB,CAAC,CAAA;IACnD,CAAC;IACD,IAAI,CAAC;QACH,GAAG,CAAC,QAAQ,CAAC,iBAAiB,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QACpD,IAAA,4BAAoB,EAAC,MAAM,CAAC,CAAA;IAC9B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,iCAAuB,EAAE,CAAC;YACzC,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;gBACxB,MAAM,IAAI,0BAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;YACzC,CAAC;iBAAM,CAAC;gBACN,OAAO,SAAS,CAAA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BAAoB,CAAC,EAAE;QAC9B,MAAM,EACJ,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM;KACzE;IACD,CAAC,GAAG,CAAC,GAAG,CAAC,gBAAgB,CAAC,EAAE;QAC1B,MAAM,EAAE,GAAG,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM;KAC3E;IACD,CAAC,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE;QACzB,oBAAoB,EAClB,GAAG,CAAC,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK;QAC/D,sBAAsB,EACpB,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK;QACpE,0BAA0B,EACxB,GAAG,CAAC,UAAU,CAAC,kBAAkB,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK;QAC/D,4BAA4B,EAC1B,GAAG,CAAC,UAAU,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK;KACrE;CACF,CAAA"}
|
package/dist/repo/types.d.ts
CHANGED
@@ -2,6 +2,7 @@ import { CID } from 'multiformats/cid';
|
|
2
2
|
import { AtUri } from '@atproto/syntax';
|
3
3
|
import { WriteOpAction } from '@atproto/repo';
|
4
4
|
import { RepoRecord } from '@atproto/lexicon';
|
5
|
+
export type ValidationStatus = 'valid' | 'unknown' | undefined;
|
5
6
|
export type BlobConstraint = {
|
6
7
|
accept?: string[];
|
7
8
|
maxSize?: number;
|
@@ -18,6 +19,7 @@ export type PreparedCreate = {
|
|
18
19
|
swapCid?: CID | null;
|
19
20
|
record: RepoRecord;
|
20
21
|
blobs: PreparedBlobRef[];
|
22
|
+
validationStatus: ValidationStatus;
|
21
23
|
};
|
22
24
|
export type PreparedUpdate = {
|
23
25
|
action: WriteOpAction.Update;
|
@@ -26,6 +28,7 @@ export type PreparedUpdate = {
|
|
26
28
|
swapCid?: CID | null;
|
27
29
|
record: RepoRecord;
|
28
30
|
blobs: PreparedBlobRef[];
|
31
|
+
validationStatus: ValidationStatus;
|
29
32
|
};
|
30
33
|
export type PreparedDelete = {
|
31
34
|
action: WriteOpAction.Delete;
|
package/dist/repo/types.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/repo/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,EAAE,GAAG,CAAA;IACR,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,cAAc,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,aAAa,CAAC,MAAM,CAAA;IAC5B,GAAG,EAAE,KAAK,CAAA;IACV,GAAG,EAAE,GAAG,CAAA;IACR,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI,CAAA;IACpB,MAAM,EAAE,UAAU,CAAA;IAClB,KAAK,EAAE,eAAe,EAAE,CAAA;
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/repo/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE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AG,cAAc,GAAG,cAAc,CAAA;AAE5E,qBAAa,kBAAmB,SAAQ,KAAK;CAAG;AAEhD,qBAAa,kBAAmB,SAAQ,KAAK;IACxB,GAAG,EAAE,GAAG;gBAAR,GAAG,EAAE,GAAG;CAG5B;AAED,qBAAa,kBAAmB,SAAQ,KAAK;IACxB,GAAG,EAAE,GAAG,GAAG,IAAI;gBAAf,GAAG,EAAE,GAAG,GAAG,IAAI;CAGnC"}
|
package/dist/repo/types.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/repo/types.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/repo/types.ts"],"names":[],"mappings":";;;AA8CA,MAAa,kBAAmB,SAAQ,KAAK;CAAG;AAAhD,gDAAgD;AAEhD,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAAmB,GAAQ;QACzB,KAAK,CAAC,iBAAiB,GAAG,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;QAD9B;;;;mBAAO,GAAG;WAAK;IAE3B,CAAC;CACF;AAJD,gDAIC;AAED,MAAa,kBAAmB,SAAQ,KAAK;IAC3C,YAAmB,GAAe;QAChC,KAAK,CAAC,iBAAiB,GAAG,EAAE,QAAQ,EAAE,IAAI,MAAM,EAAE,CAAC,CAAA;QADzC;;;;mBAAO,GAAG;WAAY;IAElC,CAAC;CACF;AAJD,gDAIC"}
|