@atproto/api 0.13.5 → 0.13.6
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 +6 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +19 -8
- package/dist/client/index.js.map +1 -1
- package/dist/client/lexicons.d.ts +131 -3
- package/dist/client/lexicons.d.ts.map +1 -1
- package/dist/client/lexicons.js +143 -6
- package/dist/client/lexicons.js.map +1 -1
- package/dist/client/types/com/atproto/repo/applyWrites.d.ts +29 -1
- package/dist/client/types/com/atproto/repo/applyWrites.d.ts.map +1 -1
- package/dist/client/types/com/atproto/repo/applyWrites.js +31 -1
- package/dist/client/types/com/atproto/repo/applyWrites.js.map +1 -1
- package/dist/client/types/com/atproto/repo/createRecord.d.ts +4 -1
- package/dist/client/types/com/atproto/repo/createRecord.d.ts.map +1 -1
- package/dist/client/types/com/atproto/repo/createRecord.js.map +1 -1
- package/dist/client/types/com/atproto/repo/defs.d.ts +12 -0
- package/dist/client/types/com/atproto/repo/defs.d.ts.map +1 -0
- package/dist/client/types/com/atproto/repo/defs.js +16 -0
- package/dist/client/types/com/atproto/repo/defs.js.map +1 -0
- package/dist/client/types/com/atproto/repo/deleteRecord.d.ts +6 -0
- package/dist/client/types/com/atproto/repo/deleteRecord.d.ts.map +1 -1
- package/dist/client/types/com/atproto/repo/deleteRecord.js.map +1 -1
- package/dist/client/types/com/atproto/repo/putRecord.d.ts +4 -1
- package/dist/client/types/com/atproto/repo/putRecord.d.ts.map +1 -1
- package/dist/client/types/com/atproto/repo/putRecord.js.map +1 -1
- package/dist/client/types/tools/ozone/communication/createTemplate.d.ts +6 -1
- package/dist/client/types/tools/ozone/communication/createTemplate.d.ts.map +1 -1
- package/dist/client/types/tools/ozone/communication/createTemplate.js +15 -1
- package/dist/client/types/tools/ozone/communication/createTemplate.js.map +1 -1
- package/dist/client/types/tools/ozone/communication/defs.d.ts +2 -0
- package/dist/client/types/tools/ozone/communication/defs.d.ts.map +1 -1
- package/dist/client/types/tools/ozone/communication/defs.js.map +1 -1
- package/dist/client/types/tools/ozone/communication/updateTemplate.d.ts +6 -1
- package/dist/client/types/tools/ozone/communication/updateTemplate.d.ts.map +1 -1
- package/dist/client/types/tools/ozone/communication/updateTemplate.js +15 -1
- package/dist/client/types/tools/ozone/communication/updateTemplate.js.map +1 -1
- package/dist/client/types/tools/ozone/moderation/emitEvent.d.ts +1 -1
- package/dist/client/types/tools/ozone/moderation/emitEvent.d.ts.map +1 -1
- package/dist/client/types/tools/ozone/moderation/emitEvent.js.map +1 -1
- package/package.json +1 -1
- package/src/client/index.ts +12 -12
- package/src/client/lexicons.ts +143 -6
- package/src/client/types/com/atproto/repo/applyWrites.ts +63 -1
- package/src/client/types/com/atproto/repo/createRecord.ts +4 -1
- package/src/client/types/com/atproto/repo/defs.ts +25 -0
- package/src/client/types/com/atproto/repo/deleteRecord.ts +7 -0
- package/src/client/types/com/atproto/repo/putRecord.ts +4 -1
- package/src/client/types/tools/ozone/communication/createTemplate.ts +13 -0
- package/src/client/types/tools/ozone/communication/defs.ts +2 -0
- package/src/client/types/tools/ozone/communication/updateTemplate.ts +13 -0
- package/src/client/types/tools/ozone/moderation/emitEvent.ts +1 -0
package/src/client/lexicons.ts
CHANGED
|
@@ -1254,9 +1254,8 @@ export const schemaDict = {
|
|
|
1254
1254
|
},
|
|
1255
1255
|
validate: {
|
|
1256
1256
|
type: 'boolean',
|
|
1257
|
-
default: true,
|
|
1258
1257
|
description:
|
|
1259
|
-
"Can be set to 'false' to skip Lexicon schema validation of record data, for
|
|
1258
|
+
"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.",
|
|
1260
1259
|
},
|
|
1261
1260
|
writes: {
|
|
1262
1261
|
type: 'array',
|
|
@@ -1279,6 +1278,31 @@ export const schemaDict = {
|
|
|
1279
1278
|
},
|
|
1280
1279
|
},
|
|
1281
1280
|
},
|
|
1281
|
+
output: {
|
|
1282
|
+
encoding: 'application/json',
|
|
1283
|
+
schema: {
|
|
1284
|
+
type: 'object',
|
|
1285
|
+
required: [],
|
|
1286
|
+
properties: {
|
|
1287
|
+
commit: {
|
|
1288
|
+
type: 'ref',
|
|
1289
|
+
ref: 'lex:com.atproto.repo.defs#commitMeta',
|
|
1290
|
+
},
|
|
1291
|
+
results: {
|
|
1292
|
+
type: 'array',
|
|
1293
|
+
items: {
|
|
1294
|
+
type: 'union',
|
|
1295
|
+
refs: [
|
|
1296
|
+
'lex:com.atproto.repo.applyWrites#createResult',
|
|
1297
|
+
'lex:com.atproto.repo.applyWrites#updateResult',
|
|
1298
|
+
'lex:com.atproto.repo.applyWrites#deleteResult',
|
|
1299
|
+
],
|
|
1300
|
+
closed: true,
|
|
1301
|
+
},
|
|
1302
|
+
},
|
|
1303
|
+
},
|
|
1304
|
+
},
|
|
1305
|
+
},
|
|
1282
1306
|
errors: [
|
|
1283
1307
|
{
|
|
1284
1308
|
name: 'InvalidSwap',
|
|
@@ -1336,6 +1360,47 @@ export const schemaDict = {
|
|
|
1336
1360
|
},
|
|
1337
1361
|
},
|
|
1338
1362
|
},
|
|
1363
|
+
createResult: {
|
|
1364
|
+
type: 'object',
|
|
1365
|
+
required: ['uri', 'cid'],
|
|
1366
|
+
properties: {
|
|
1367
|
+
uri: {
|
|
1368
|
+
type: 'string',
|
|
1369
|
+
format: 'at-uri',
|
|
1370
|
+
},
|
|
1371
|
+
cid: {
|
|
1372
|
+
type: 'string',
|
|
1373
|
+
format: 'cid',
|
|
1374
|
+
},
|
|
1375
|
+
validationStatus: {
|
|
1376
|
+
type: 'string',
|
|
1377
|
+
knownValues: ['valid', 'unknown'],
|
|
1378
|
+
},
|
|
1379
|
+
},
|
|
1380
|
+
},
|
|
1381
|
+
updateResult: {
|
|
1382
|
+
type: 'object',
|
|
1383
|
+
required: ['uri', 'cid'],
|
|
1384
|
+
properties: {
|
|
1385
|
+
uri: {
|
|
1386
|
+
type: 'string',
|
|
1387
|
+
format: 'at-uri',
|
|
1388
|
+
},
|
|
1389
|
+
cid: {
|
|
1390
|
+
type: 'string',
|
|
1391
|
+
format: 'cid',
|
|
1392
|
+
},
|
|
1393
|
+
validationStatus: {
|
|
1394
|
+
type: 'string',
|
|
1395
|
+
knownValues: ['valid', 'unknown'],
|
|
1396
|
+
},
|
|
1397
|
+
},
|
|
1398
|
+
},
|
|
1399
|
+
deleteResult: {
|
|
1400
|
+
type: 'object',
|
|
1401
|
+
required: [],
|
|
1402
|
+
properties: {},
|
|
1403
|
+
},
|
|
1339
1404
|
},
|
|
1340
1405
|
},
|
|
1341
1406
|
ComAtprotoRepoCreateRecord: {
|
|
@@ -1370,9 +1435,8 @@ export const schemaDict = {
|
|
|
1370
1435
|
},
|
|
1371
1436
|
validate: {
|
|
1372
1437
|
type: 'boolean',
|
|
1373
|
-
default: true,
|
|
1374
1438
|
description:
|
|
1375
|
-
"Can be set to 'false' to skip Lexicon schema validation of record data.",
|
|
1439
|
+
"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.",
|
|
1376
1440
|
},
|
|
1377
1441
|
record: {
|
|
1378
1442
|
type: 'unknown',
|
|
@@ -1401,6 +1465,14 @@ export const schemaDict = {
|
|
|
1401
1465
|
type: 'string',
|
|
1402
1466
|
format: 'cid',
|
|
1403
1467
|
},
|
|
1468
|
+
commit: {
|
|
1469
|
+
type: 'ref',
|
|
1470
|
+
ref: 'lex:com.atproto.repo.defs#commitMeta',
|
|
1471
|
+
},
|
|
1472
|
+
validationStatus: {
|
|
1473
|
+
type: 'string',
|
|
1474
|
+
knownValues: ['valid', 'unknown'],
|
|
1475
|
+
},
|
|
1404
1476
|
},
|
|
1405
1477
|
},
|
|
1406
1478
|
},
|
|
@@ -1414,6 +1486,25 @@ export const schemaDict = {
|
|
|
1414
1486
|
},
|
|
1415
1487
|
},
|
|
1416
1488
|
},
|
|
1489
|
+
ComAtprotoRepoDefs: {
|
|
1490
|
+
lexicon: 1,
|
|
1491
|
+
id: 'com.atproto.repo.defs',
|
|
1492
|
+
defs: {
|
|
1493
|
+
commitMeta: {
|
|
1494
|
+
type: 'object',
|
|
1495
|
+
required: ['cid', 'rev'],
|
|
1496
|
+
properties: {
|
|
1497
|
+
cid: {
|
|
1498
|
+
type: 'string',
|
|
1499
|
+
format: 'cid',
|
|
1500
|
+
},
|
|
1501
|
+
rev: {
|
|
1502
|
+
type: 'string',
|
|
1503
|
+
},
|
|
1504
|
+
},
|
|
1505
|
+
},
|
|
1506
|
+
},
|
|
1507
|
+
},
|
|
1417
1508
|
ComAtprotoRepoDeleteRecord: {
|
|
1418
1509
|
lexicon: 1,
|
|
1419
1510
|
id: 'com.atproto.repo.deleteRecord',
|
|
@@ -1458,6 +1549,18 @@ export const schemaDict = {
|
|
|
1458
1549
|
},
|
|
1459
1550
|
},
|
|
1460
1551
|
},
|
|
1552
|
+
output: {
|
|
1553
|
+
encoding: 'application/json',
|
|
1554
|
+
schema: {
|
|
1555
|
+
type: 'object',
|
|
1556
|
+
properties: {
|
|
1557
|
+
commit: {
|
|
1558
|
+
type: 'ref',
|
|
1559
|
+
ref: 'lex:com.atproto.repo.defs#commitMeta',
|
|
1560
|
+
},
|
|
1561
|
+
},
|
|
1562
|
+
},
|
|
1563
|
+
},
|
|
1461
1564
|
errors: [
|
|
1462
1565
|
{
|
|
1463
1566
|
name: 'InvalidSwap',
|
|
@@ -1778,9 +1881,8 @@ export const schemaDict = {
|
|
|
1778
1881
|
},
|
|
1779
1882
|
validate: {
|
|
1780
1883
|
type: 'boolean',
|
|
1781
|
-
default: true,
|
|
1782
1884
|
description:
|
|
1783
|
-
"Can be set to 'false' to skip Lexicon schema validation of record data.",
|
|
1885
|
+
"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.",
|
|
1784
1886
|
},
|
|
1785
1887
|
record: {
|
|
1786
1888
|
type: 'unknown',
|
|
@@ -1815,6 +1917,14 @@ export const schemaDict = {
|
|
|
1815
1917
|
type: 'string',
|
|
1816
1918
|
format: 'cid',
|
|
1817
1919
|
},
|
|
1920
|
+
commit: {
|
|
1921
|
+
type: 'ref',
|
|
1922
|
+
ref: 'lex:com.atproto.repo.defs#commitMeta',
|
|
1923
|
+
},
|
|
1924
|
+
validationStatus: {
|
|
1925
|
+
type: 'string',
|
|
1926
|
+
knownValues: ['valid', 'unknown'],
|
|
1927
|
+
},
|
|
1818
1928
|
},
|
|
1819
1929
|
},
|
|
1820
1930
|
},
|
|
@@ -10356,6 +10466,11 @@ export const schemaDict = {
|
|
|
10356
10466
|
type: 'string',
|
|
10357
10467
|
description: 'Subject of the message, used in emails.',
|
|
10358
10468
|
},
|
|
10469
|
+
lang: {
|
|
10470
|
+
type: 'string',
|
|
10471
|
+
format: 'language',
|
|
10472
|
+
description: 'Message language.',
|
|
10473
|
+
},
|
|
10359
10474
|
createdBy: {
|
|
10360
10475
|
type: 'string',
|
|
10361
10476
|
format: 'did',
|
|
@@ -10371,6 +10486,11 @@ export const schemaDict = {
|
|
|
10371
10486
|
ref: 'lex:tools.ozone.communication.defs#templateView',
|
|
10372
10487
|
},
|
|
10373
10488
|
},
|
|
10489
|
+
errors: [
|
|
10490
|
+
{
|
|
10491
|
+
name: 'DuplicateTemplateName',
|
|
10492
|
+
},
|
|
10493
|
+
],
|
|
10374
10494
|
},
|
|
10375
10495
|
},
|
|
10376
10496
|
},
|
|
@@ -10409,6 +10529,11 @@ export const schemaDict = {
|
|
|
10409
10529
|
disabled: {
|
|
10410
10530
|
type: 'boolean',
|
|
10411
10531
|
},
|
|
10532
|
+
lang: {
|
|
10533
|
+
type: 'string',
|
|
10534
|
+
format: 'language',
|
|
10535
|
+
description: 'Message language.',
|
|
10536
|
+
},
|
|
10412
10537
|
lastUpdatedBy: {
|
|
10413
10538
|
type: 'string',
|
|
10414
10539
|
format: 'did',
|
|
@@ -10496,6 +10621,11 @@ export const schemaDict = {
|
|
|
10496
10621
|
type: 'string',
|
|
10497
10622
|
description: 'Name of the template.',
|
|
10498
10623
|
},
|
|
10624
|
+
lang: {
|
|
10625
|
+
type: 'string',
|
|
10626
|
+
format: 'language',
|
|
10627
|
+
description: 'Message language.',
|
|
10628
|
+
},
|
|
10499
10629
|
contentMarkdown: {
|
|
10500
10630
|
type: 'string',
|
|
10501
10631
|
description:
|
|
@@ -10523,6 +10653,11 @@ export const schemaDict = {
|
|
|
10523
10653
|
ref: 'lex:tools.ozone.communication.defs#templateView',
|
|
10524
10654
|
},
|
|
10525
10655
|
},
|
|
10656
|
+
errors: [
|
|
10657
|
+
{
|
|
10658
|
+
name: 'DuplicateTemplateName',
|
|
10659
|
+
},
|
|
10660
|
+
],
|
|
10526
10661
|
},
|
|
10527
10662
|
},
|
|
10528
10663
|
},
|
|
@@ -11322,6 +11457,7 @@ export const schemaDict = {
|
|
|
11322
11457
|
'lex:tools.ozone.moderation.defs#modEventMuteReporter',
|
|
11323
11458
|
'lex:tools.ozone.moderation.defs#modEventUnmuteReporter',
|
|
11324
11459
|
'lex:tools.ozone.moderation.defs#modEventReverseTakedown',
|
|
11460
|
+
'lex:tools.ozone.moderation.defs#modEventResolveAppeal',
|
|
11325
11461
|
'lex:tools.ozone.moderation.defs#modEventEmail',
|
|
11326
11462
|
'lex:tools.ozone.moderation.defs#modEventTag',
|
|
11327
11463
|
],
|
|
@@ -12084,6 +12220,7 @@ export const ids = {
|
|
|
12084
12220
|
ComAtprotoModerationDefs: 'com.atproto.moderation.defs',
|
|
12085
12221
|
ComAtprotoRepoApplyWrites: 'com.atproto.repo.applyWrites',
|
|
12086
12222
|
ComAtprotoRepoCreateRecord: 'com.atproto.repo.createRecord',
|
|
12223
|
+
ComAtprotoRepoDefs: 'com.atproto.repo.defs',
|
|
12087
12224
|
ComAtprotoRepoDeleteRecord: 'com.atproto.repo.deleteRecord',
|
|
12088
12225
|
ComAtprotoRepoDescribeRepo: 'com.atproto.repo.describeRepo',
|
|
12089
12226
|
ComAtprotoRepoGetRecord: 'com.atproto.repo.getRecord',
|
|
@@ -6,13 +6,14 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
|
6
6
|
import { isObj, hasProp } from '../../../../util'
|
|
7
7
|
import { lexicons } from '../../../../lexicons'
|
|
8
8
|
import { CID } from 'multiformats/cid'
|
|
9
|
+
import * as ComAtprotoRepoDefs from './defs'
|
|
9
10
|
|
|
10
11
|
export interface QueryParams {}
|
|
11
12
|
|
|
12
13
|
export interface InputSchema {
|
|
13
14
|
/** The handle or DID of the repo (aka, current account). */
|
|
14
15
|
repo: string
|
|
15
|
-
/** Can be set to 'false' to skip Lexicon schema validation of record data, for
|
|
16
|
+
/** 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. */
|
|
16
17
|
validate?: boolean
|
|
17
18
|
writes: (Create | Update | Delete)[]
|
|
18
19
|
/** If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations. */
|
|
@@ -20,6 +21,12 @@ export interface InputSchema {
|
|
|
20
21
|
[k: string]: unknown
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
export interface OutputSchema {
|
|
25
|
+
commit?: ComAtprotoRepoDefs.CommitMeta
|
|
26
|
+
results?: (CreateResult | UpdateResult | DeleteResult)[]
|
|
27
|
+
[k: string]: unknown
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
export interface CallOptions {
|
|
24
31
|
signal?: AbortSignal
|
|
25
32
|
headers?: HeadersMap
|
|
@@ -30,6 +37,7 @@ export interface CallOptions {
|
|
|
30
37
|
export interface Response {
|
|
31
38
|
success: boolean
|
|
32
39
|
headers: HeadersMap
|
|
40
|
+
data: OutputSchema
|
|
33
41
|
}
|
|
34
42
|
|
|
35
43
|
export class InvalidSwapError extends XRPCError {
|
|
@@ -104,3 +112,57 @@ export function isDelete(v: unknown): v is Delete {
|
|
|
104
112
|
export function validateDelete(v: unknown): ValidationResult {
|
|
105
113
|
return lexicons.validate('com.atproto.repo.applyWrites#delete', v)
|
|
106
114
|
}
|
|
115
|
+
|
|
116
|
+
export interface CreateResult {
|
|
117
|
+
uri: string
|
|
118
|
+
cid: string
|
|
119
|
+
validationStatus?: 'valid' | 'unknown' | (string & {})
|
|
120
|
+
[k: string]: unknown
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function isCreateResult(v: unknown): v is CreateResult {
|
|
124
|
+
return (
|
|
125
|
+
isObj(v) &&
|
|
126
|
+
hasProp(v, '$type') &&
|
|
127
|
+
v.$type === 'com.atproto.repo.applyWrites#createResult'
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function validateCreateResult(v: unknown): ValidationResult {
|
|
132
|
+
return lexicons.validate('com.atproto.repo.applyWrites#createResult', v)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface UpdateResult {
|
|
136
|
+
uri: string
|
|
137
|
+
cid: string
|
|
138
|
+
validationStatus?: 'valid' | 'unknown' | (string & {})
|
|
139
|
+
[k: string]: unknown
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function isUpdateResult(v: unknown): v is UpdateResult {
|
|
143
|
+
return (
|
|
144
|
+
isObj(v) &&
|
|
145
|
+
hasProp(v, '$type') &&
|
|
146
|
+
v.$type === 'com.atproto.repo.applyWrites#updateResult'
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export function validateUpdateResult(v: unknown): ValidationResult {
|
|
151
|
+
return lexicons.validate('com.atproto.repo.applyWrites#updateResult', v)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface DeleteResult {
|
|
155
|
+
[k: string]: unknown
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function isDeleteResult(v: unknown): v is DeleteResult {
|
|
159
|
+
return (
|
|
160
|
+
isObj(v) &&
|
|
161
|
+
hasProp(v, '$type') &&
|
|
162
|
+
v.$type === 'com.atproto.repo.applyWrites#deleteResult'
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function validateDeleteResult(v: unknown): ValidationResult {
|
|
167
|
+
return lexicons.validate('com.atproto.repo.applyWrites#deleteResult', v)
|
|
168
|
+
}
|
|
@@ -6,6 +6,7 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
|
6
6
|
import { isObj, hasProp } from '../../../../util'
|
|
7
7
|
import { lexicons } from '../../../../lexicons'
|
|
8
8
|
import { CID } from 'multiformats/cid'
|
|
9
|
+
import * as ComAtprotoRepoDefs from './defs'
|
|
9
10
|
|
|
10
11
|
export interface QueryParams {}
|
|
11
12
|
|
|
@@ -16,7 +17,7 @@ export interface InputSchema {
|
|
|
16
17
|
collection: string
|
|
17
18
|
/** The Record Key. */
|
|
18
19
|
rkey?: string
|
|
19
|
-
/** Can be set to 'false' to skip Lexicon schema validation of record data. */
|
|
20
|
+
/** 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. */
|
|
20
21
|
validate?: boolean
|
|
21
22
|
/** The record itself. Must contain a $type field. */
|
|
22
23
|
record: {}
|
|
@@ -28,6 +29,8 @@ export interface InputSchema {
|
|
|
28
29
|
export interface OutputSchema {
|
|
29
30
|
uri: string
|
|
30
31
|
cid: string
|
|
32
|
+
commit?: ComAtprotoRepoDefs.CommitMeta
|
|
33
|
+
validationStatus?: 'valid' | 'unknown' | (string & {})
|
|
31
34
|
[k: string]: unknown
|
|
32
35
|
}
|
|
33
36
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { isObj, hasProp } from '../../../../util'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { CID } from 'multiformats/cid'
|
|
8
|
+
|
|
9
|
+
export interface CommitMeta {
|
|
10
|
+
cid: string
|
|
11
|
+
rev: string
|
|
12
|
+
[k: string]: unknown
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function isCommitMeta(v: unknown): v is CommitMeta {
|
|
16
|
+
return (
|
|
17
|
+
isObj(v) &&
|
|
18
|
+
hasProp(v, '$type') &&
|
|
19
|
+
v.$type === 'com.atproto.repo.defs#commitMeta'
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function validateCommitMeta(v: unknown): ValidationResult {
|
|
24
|
+
return lexicons.validate('com.atproto.repo.defs#commitMeta', v)
|
|
25
|
+
}
|
|
@@ -6,6 +6,7 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
|
6
6
|
import { isObj, hasProp } from '../../../../util'
|
|
7
7
|
import { lexicons } from '../../../../lexicons'
|
|
8
8
|
import { CID } from 'multiformats/cid'
|
|
9
|
+
import * as ComAtprotoRepoDefs from './defs'
|
|
9
10
|
|
|
10
11
|
export interface QueryParams {}
|
|
11
12
|
|
|
@@ -23,6 +24,11 @@ export interface InputSchema {
|
|
|
23
24
|
[k: string]: unknown
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
export interface OutputSchema {
|
|
28
|
+
commit?: ComAtprotoRepoDefs.CommitMeta
|
|
29
|
+
[k: string]: unknown
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
export interface CallOptions {
|
|
27
33
|
signal?: AbortSignal
|
|
28
34
|
headers?: HeadersMap
|
|
@@ -33,6 +39,7 @@ export interface CallOptions {
|
|
|
33
39
|
export interface Response {
|
|
34
40
|
success: boolean
|
|
35
41
|
headers: HeadersMap
|
|
42
|
+
data: OutputSchema
|
|
36
43
|
}
|
|
37
44
|
|
|
38
45
|
export class InvalidSwapError extends XRPCError {
|
|
@@ -6,6 +6,7 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
|
6
6
|
import { isObj, hasProp } from '../../../../util'
|
|
7
7
|
import { lexicons } from '../../../../lexicons'
|
|
8
8
|
import { CID } from 'multiformats/cid'
|
|
9
|
+
import * as ComAtprotoRepoDefs from './defs'
|
|
9
10
|
|
|
10
11
|
export interface QueryParams {}
|
|
11
12
|
|
|
@@ -16,7 +17,7 @@ export interface InputSchema {
|
|
|
16
17
|
collection: string
|
|
17
18
|
/** The Record Key. */
|
|
18
19
|
rkey: string
|
|
19
|
-
/** Can be set to 'false' to skip Lexicon schema validation of record data. */
|
|
20
|
+
/** 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. */
|
|
20
21
|
validate?: boolean
|
|
21
22
|
/** The record to write. */
|
|
22
23
|
record: {}
|
|
@@ -30,6 +31,8 @@ export interface InputSchema {
|
|
|
30
31
|
export interface OutputSchema {
|
|
31
32
|
uri: string
|
|
32
33
|
cid: string
|
|
34
|
+
commit?: ComAtprotoRepoDefs.CommitMeta
|
|
35
|
+
validationStatus?: 'valid' | 'unknown' | (string & {})
|
|
33
36
|
[k: string]: unknown
|
|
34
37
|
}
|
|
35
38
|
|
|
@@ -17,6 +17,8 @@ export interface InputSchema {
|
|
|
17
17
|
contentMarkdown: string
|
|
18
18
|
/** Subject of the message, used in emails. */
|
|
19
19
|
subject: string
|
|
20
|
+
/** Message language. */
|
|
21
|
+
lang?: string
|
|
20
22
|
/** DID of the user who is creating the template. */
|
|
21
23
|
createdBy?: string
|
|
22
24
|
[k: string]: unknown
|
|
@@ -37,6 +39,17 @@ export interface Response {
|
|
|
37
39
|
data: OutputSchema
|
|
38
40
|
}
|
|
39
41
|
|
|
42
|
+
export class DuplicateTemplateNameError extends XRPCError {
|
|
43
|
+
constructor(src: XRPCError) {
|
|
44
|
+
super(src.status, src.error, src.message, src.headers, { cause: src })
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
40
48
|
export function toKnownErr(e: any) {
|
|
49
|
+
if (e instanceof XRPCError) {
|
|
50
|
+
if (e.error === 'DuplicateTemplateName')
|
|
51
|
+
return new DuplicateTemplateNameError(e)
|
|
52
|
+
}
|
|
53
|
+
|
|
41
54
|
return e
|
|
42
55
|
}
|
|
@@ -15,6 +15,8 @@ export interface TemplateView {
|
|
|
15
15
|
/** Subject of the message, used in emails. */
|
|
16
16
|
contentMarkdown: string
|
|
17
17
|
disabled: boolean
|
|
18
|
+
/** Message language. */
|
|
19
|
+
lang?: string
|
|
18
20
|
/** DID of the user who last updated the template. */
|
|
19
21
|
lastUpdatedBy: string
|
|
20
22
|
createdAt: string
|
|
@@ -15,6 +15,8 @@ export interface InputSchema {
|
|
|
15
15
|
id: string
|
|
16
16
|
/** Name of the template. */
|
|
17
17
|
name?: string
|
|
18
|
+
/** Message language. */
|
|
19
|
+
lang?: string
|
|
18
20
|
/** Content of the template, markdown supported, can contain variable placeholders. */
|
|
19
21
|
contentMarkdown?: string
|
|
20
22
|
/** Subject of the message, used in emails. */
|
|
@@ -40,6 +42,17 @@ export interface Response {
|
|
|
40
42
|
data: OutputSchema
|
|
41
43
|
}
|
|
42
44
|
|
|
45
|
+
export class DuplicateTemplateNameError extends XRPCError {
|
|
46
|
+
constructor(src: XRPCError) {
|
|
47
|
+
super(src.status, src.error, src.message, src.headers, { cause: src })
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
43
51
|
export function toKnownErr(e: any) {
|
|
52
|
+
if (e instanceof XRPCError) {
|
|
53
|
+
if (e.error === 'DuplicateTemplateName')
|
|
54
|
+
return new DuplicateTemplateNameError(e)
|
|
55
|
+
}
|
|
56
|
+
|
|
44
57
|
return e
|
|
45
58
|
}
|
|
@@ -25,6 +25,7 @@ export interface InputSchema {
|
|
|
25
25
|
| ToolsOzoneModerationDefs.ModEventMuteReporter
|
|
26
26
|
| ToolsOzoneModerationDefs.ModEventUnmuteReporter
|
|
27
27
|
| ToolsOzoneModerationDefs.ModEventReverseTakedown
|
|
28
|
+
| ToolsOzoneModerationDefs.ModEventResolveAppeal
|
|
28
29
|
| ToolsOzoneModerationDefs.ModEventEmail
|
|
29
30
|
| ToolsOzoneModerationDefs.ModEventTag
|
|
30
31
|
| { $type: string; [k: string]: unknown }
|