@atproto/ozone 0.0.2 → 0.0.5
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 +21 -0
- package/dist/api/admin/listCommunicationTemplates.d.ts +3 -0
- package/dist/api/admin/updateCommunicationTemplate.d.ts +3 -0
- package/dist/communication-service/template.d.ts +18 -0
- package/dist/context.d.ts +3 -0
- package/dist/db/index.js +18 -1
- package/dist/db/index.js.map +3 -3
- package/dist/db/migrations/20240116T085607200Z-communication-template.d.ts +3 -0
- package/dist/db/migrations/index.d.ts +1 -0
- package/dist/db/schema/communication_template.d.ts +15 -0
- package/dist/db/schema/index.d.ts +2 -1
- package/dist/index.js +971 -240
- package/dist/index.js.map +3 -3
- package/dist/lexicon/index.d.ts +10 -0
- package/dist/lexicon/lexicons.d.ts +230 -0
- package/dist/lexicon/types/app/bsky/unspecced/{getPopular.d.ts → getTaggedSuggestions.d.ts} +10 -6
- package/dist/lexicon/types/{app/bsky/moderation/getService.d.ts → com/atproto/admin/createCommunicationTemplate.d.ts} +13 -5
- package/dist/lexicon/types/com/atproto/admin/defs.d.ts +13 -0
- package/dist/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.d.ts +25 -0
- package/dist/lexicon/types/{app/bsky/moderation/getServices.d.ts → com/atproto/admin/listCommunicationTemplates.d.ts} +2 -3
- package/dist/lexicon/types/com/atproto/admin/updateCommunicationTemplate.d.ts +39 -0
- package/package.json +8 -8
- package/src/api/admin/createCommunicationTemplate.ts +37 -0
- package/src/api/admin/deleteCommunicationTemplate.ts +23 -0
- package/src/api/admin/listCommunicationTemplates.ts +31 -0
- package/src/api/admin/updateCommunicationTemplate.ts +40 -0
- package/src/api/index.ts +8 -0
- package/src/communication-service/template.ts +105 -0
- package/src/context.ts +12 -0
- package/src/db/migrations/20240116T085607200Z-communication-template.ts +23 -0
- package/src/db/migrations/index.ts +1 -0
- package/src/db/schema/communication_template.ts +18 -0
- package/src/db/schema/index.ts +3 -1
- package/src/lexicon/index.ts +60 -0
- package/src/lexicon/lexicons.ts +249 -0
- package/src/lexicon/types/app/bsky/unspecced/getTaggedSuggestions.ts +65 -0
- package/src/lexicon/types/com/atproto/admin/createCommunicationTemplate.ts +54 -0
- package/src/lexicon/types/com/atproto/admin/defs.ts +35 -0
- package/src/lexicon/types/com/atproto/admin/deleteCommunicationTemplate.ts +38 -0
- package/src/lexicon/types/com/atproto/admin/listCommunicationTemplates.ts +44 -0
- package/src/lexicon/types/com/atproto/admin/updateCommunicationTemplate.ts +57 -0
- package/tests/communication-templates.test.ts +131 -0
- package/dist/api/com/atproto/admin/emitModerationEvent.d.ts +0 -3
- package/dist/api/com/atproto/admin/getModerationEvent.d.ts +0 -3
- package/dist/api/com/atproto/admin/getRecord.d.ts +0 -3
- package/dist/api/com/atproto/admin/getRepo.d.ts +0 -3
- package/dist/api/com/atproto/admin/queryModerationEvents.d.ts +0 -3
- package/dist/api/com/atproto/admin/queryModerationStatuses.d.ts +0 -3
- package/dist/api/com/atproto/admin/searchRepos.d.ts +0 -3
- package/dist/api/com/atproto/admin/util.d.ts +0 -5
- package/dist/api/com/atproto/moderation/createReport.d.ts +0 -3
- package/dist/api/com/atproto/moderation/util.d.ts +0 -4
- package/dist/api/com/atproto/temp/fetchLabels.d.ts +0 -3
- package/dist/api/util.d.ts +0 -2
- package/dist/auth-verifier.d.ts +0 -47
- package/dist/config.d.ts +0 -42
- package/dist/daemon/config.d.ts +0 -23
- package/dist/lexicon/types/app/bsky/moderation/defs.d.ts +0 -49
- package/dist/lexicon/types/app/bsky/moderation/service.d.ts +0 -17
- package/dist/sequencer/index.d.ts +0 -2
- package/dist/sequencer/outbox.d.ts +0 -16
- package/dist/sequencer/sequencer.d.ts +0 -35
- package/dist/services/index.d.ts +0 -7
- package/dist/services/moderation/index.d.ts +0 -144
- package/dist/services/moderation/status.d.ts +0 -12
- package/dist/services/moderation/subject.d.ts +0 -60
- package/dist/services/moderation/types.d.ts +0 -19
- package/dist/services/moderation/views.d.ts +0 -42
- package/dist/services/types.d.ts +0 -2
- package/dist/util/date.d.ts +0 -1
- package/dist/util/debug.d.ts +0 -1
- package/dist/util/retry.d.ts +0 -3
- package/test.log +0 -0
- /package/dist/api/{label/queryLabels.d.ts → admin/createCommunicationTemplate.d.ts} +0 -0
- /package/dist/api/{label/subscribeLabels.d.ts → admin/deleteCommunicationTemplate.d.ts} +0 -0
package/src/lexicon/lexicons.ts
CHANGED
|
@@ -4,6 +4,51 @@
|
|
|
4
4
|
import { LexiconDoc, Lexicons } from '@atproto/lexicon'
|
|
5
5
|
|
|
6
6
|
export const schemaDict = {
|
|
7
|
+
ComAtprotoAdminCreateCommunicationTemplate: {
|
|
8
|
+
lexicon: 1,
|
|
9
|
+
id: 'com.atproto.admin.createCommunicationTemplate',
|
|
10
|
+
defs: {
|
|
11
|
+
main: {
|
|
12
|
+
type: 'procedure',
|
|
13
|
+
description:
|
|
14
|
+
'Administrative action to create a new, re-usable communication (email for now) template.',
|
|
15
|
+
input: {
|
|
16
|
+
encoding: 'application/json',
|
|
17
|
+
schema: {
|
|
18
|
+
type: 'object',
|
|
19
|
+
required: ['subject', 'contentMarkdown', 'name'],
|
|
20
|
+
properties: {
|
|
21
|
+
name: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Name of the template.',
|
|
24
|
+
},
|
|
25
|
+
contentMarkdown: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description:
|
|
28
|
+
'Content of the template, markdown supported, can contain variable placeholders.',
|
|
29
|
+
},
|
|
30
|
+
subject: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
description: 'Subject of the message, used in emails.',
|
|
33
|
+
},
|
|
34
|
+
createdBy: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
format: 'did',
|
|
37
|
+
description: 'DID of the user who is creating the template.',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
output: {
|
|
43
|
+
encoding: 'application/json',
|
|
44
|
+
schema: {
|
|
45
|
+
type: 'ref',
|
|
46
|
+
ref: 'lex:com.atproto.admin.defs#communicationTemplateView',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
7
52
|
ComAtprotoAdminDefs: {
|
|
8
53
|
lexicon: 1,
|
|
9
54
|
id: 'com.atproto.admin.defs',
|
|
@@ -850,6 +895,52 @@ export const schemaDict = {
|
|
|
850
895
|
},
|
|
851
896
|
},
|
|
852
897
|
},
|
|
898
|
+
communicationTemplateView: {
|
|
899
|
+
type: 'object',
|
|
900
|
+
required: [
|
|
901
|
+
'id',
|
|
902
|
+
'name',
|
|
903
|
+
'contentMarkdown',
|
|
904
|
+
'disabled',
|
|
905
|
+
'lastUpdatedBy',
|
|
906
|
+
'createdAt',
|
|
907
|
+
'updatedAt',
|
|
908
|
+
],
|
|
909
|
+
properties: {
|
|
910
|
+
id: {
|
|
911
|
+
type: 'string',
|
|
912
|
+
},
|
|
913
|
+
name: {
|
|
914
|
+
type: 'string',
|
|
915
|
+
description: 'Name of the template.',
|
|
916
|
+
},
|
|
917
|
+
subject: {
|
|
918
|
+
type: 'string',
|
|
919
|
+
description:
|
|
920
|
+
'Content of the template, can contain markdown and variable placeholders.',
|
|
921
|
+
},
|
|
922
|
+
contentMarkdown: {
|
|
923
|
+
type: 'string',
|
|
924
|
+
description: 'Subject of the message, used in emails.',
|
|
925
|
+
},
|
|
926
|
+
disabled: {
|
|
927
|
+
type: 'boolean',
|
|
928
|
+
},
|
|
929
|
+
lastUpdatedBy: {
|
|
930
|
+
type: 'string',
|
|
931
|
+
format: 'did',
|
|
932
|
+
description: 'DID of the user who last updated the template.',
|
|
933
|
+
},
|
|
934
|
+
createdAt: {
|
|
935
|
+
type: 'string',
|
|
936
|
+
format: 'datetime',
|
|
937
|
+
},
|
|
938
|
+
updatedAt: {
|
|
939
|
+
type: 'string',
|
|
940
|
+
format: 'datetime',
|
|
941
|
+
},
|
|
942
|
+
},
|
|
943
|
+
},
|
|
853
944
|
},
|
|
854
945
|
},
|
|
855
946
|
ComAtprotoAdminDeleteAccount: {
|
|
@@ -875,6 +966,28 @@ export const schemaDict = {
|
|
|
875
966
|
},
|
|
876
967
|
},
|
|
877
968
|
},
|
|
969
|
+
ComAtprotoAdminDeleteCommunicationTemplate: {
|
|
970
|
+
lexicon: 1,
|
|
971
|
+
id: 'com.atproto.admin.deleteCommunicationTemplate',
|
|
972
|
+
defs: {
|
|
973
|
+
main: {
|
|
974
|
+
type: 'procedure',
|
|
975
|
+
description: 'Delete a communication template.',
|
|
976
|
+
input: {
|
|
977
|
+
encoding: 'application/json',
|
|
978
|
+
schema: {
|
|
979
|
+
type: 'object',
|
|
980
|
+
required: ['id'],
|
|
981
|
+
properties: {
|
|
982
|
+
id: {
|
|
983
|
+
type: 'string',
|
|
984
|
+
},
|
|
985
|
+
},
|
|
986
|
+
},
|
|
987
|
+
},
|
|
988
|
+
},
|
|
989
|
+
},
|
|
990
|
+
},
|
|
878
991
|
ComAtprotoAdminDisableAccountInvites: {
|
|
879
992
|
lexicon: 1,
|
|
880
993
|
id: 'com.atproto.admin.disableAccountInvites',
|
|
@@ -1282,6 +1395,32 @@ export const schemaDict = {
|
|
|
1282
1395
|
},
|
|
1283
1396
|
},
|
|
1284
1397
|
},
|
|
1398
|
+
ComAtprotoAdminListCommunicationTemplates: {
|
|
1399
|
+
lexicon: 1,
|
|
1400
|
+
id: 'com.atproto.admin.listCommunicationTemplates',
|
|
1401
|
+
defs: {
|
|
1402
|
+
main: {
|
|
1403
|
+
type: 'query',
|
|
1404
|
+
description: 'Get list of all communication templates.',
|
|
1405
|
+
output: {
|
|
1406
|
+
encoding: 'application/json',
|
|
1407
|
+
schema: {
|
|
1408
|
+
type: 'object',
|
|
1409
|
+
required: ['communicationTemplates'],
|
|
1410
|
+
properties: {
|
|
1411
|
+
communicationTemplates: {
|
|
1412
|
+
type: 'array',
|
|
1413
|
+
items: {
|
|
1414
|
+
type: 'ref',
|
|
1415
|
+
ref: 'lex:com.atproto.admin.defs#communicationTemplateView',
|
|
1416
|
+
},
|
|
1417
|
+
},
|
|
1418
|
+
},
|
|
1419
|
+
},
|
|
1420
|
+
},
|
|
1421
|
+
},
|
|
1422
|
+
},
|
|
1423
|
+
},
|
|
1285
1424
|
ComAtprotoAdminQueryModerationEvents: {
|
|
1286
1425
|
lexicon: 1,
|
|
1287
1426
|
id: 'com.atproto.admin.queryModerationEvents',
|
|
@@ -1619,6 +1758,58 @@ export const schemaDict = {
|
|
|
1619
1758
|
},
|
|
1620
1759
|
},
|
|
1621
1760
|
},
|
|
1761
|
+
ComAtprotoAdminUpdateCommunicationTemplate: {
|
|
1762
|
+
lexicon: 1,
|
|
1763
|
+
id: 'com.atproto.admin.updateCommunicationTemplate',
|
|
1764
|
+
defs: {
|
|
1765
|
+
main: {
|
|
1766
|
+
type: 'procedure',
|
|
1767
|
+
description:
|
|
1768
|
+
'Administrative action to update an existing communication template. Allows passing partial fields to patch specific fields only.',
|
|
1769
|
+
input: {
|
|
1770
|
+
encoding: 'application/json',
|
|
1771
|
+
schema: {
|
|
1772
|
+
type: 'object',
|
|
1773
|
+
required: ['id'],
|
|
1774
|
+
properties: {
|
|
1775
|
+
id: {
|
|
1776
|
+
type: 'string',
|
|
1777
|
+
description: 'ID of the template to be updated.',
|
|
1778
|
+
},
|
|
1779
|
+
name: {
|
|
1780
|
+
type: 'string',
|
|
1781
|
+
description: 'Name of the template.',
|
|
1782
|
+
},
|
|
1783
|
+
contentMarkdown: {
|
|
1784
|
+
type: 'string',
|
|
1785
|
+
description:
|
|
1786
|
+
'Content of the template, markdown supported, can contain variable placeholders.',
|
|
1787
|
+
},
|
|
1788
|
+
subject: {
|
|
1789
|
+
type: 'string',
|
|
1790
|
+
description: 'Subject of the message, used in emails.',
|
|
1791
|
+
},
|
|
1792
|
+
updatedBy: {
|
|
1793
|
+
type: 'string',
|
|
1794
|
+
format: 'did',
|
|
1795
|
+
description: 'DID of the user who is updating the template.',
|
|
1796
|
+
},
|
|
1797
|
+
disabled: {
|
|
1798
|
+
type: 'boolean',
|
|
1799
|
+
},
|
|
1800
|
+
},
|
|
1801
|
+
},
|
|
1802
|
+
},
|
|
1803
|
+
output: {
|
|
1804
|
+
encoding: 'application/json',
|
|
1805
|
+
schema: {
|
|
1806
|
+
type: 'ref',
|
|
1807
|
+
ref: 'lex:com.atproto.admin.defs#communicationTemplateView',
|
|
1808
|
+
},
|
|
1809
|
+
},
|
|
1810
|
+
},
|
|
1811
|
+
},
|
|
1812
|
+
},
|
|
1622
1813
|
ComAtprotoAdminUpdateSubjectStatus: {
|
|
1623
1814
|
lexicon: 1,
|
|
1624
1815
|
id: 'com.atproto.admin.updateSubjectStatus',
|
|
@@ -7717,6 +7908,54 @@ export const schemaDict = {
|
|
|
7717
7908
|
},
|
|
7718
7909
|
},
|
|
7719
7910
|
},
|
|
7911
|
+
AppBskyUnspeccedGetTaggedSuggestions: {
|
|
7912
|
+
lexicon: 1,
|
|
7913
|
+
id: 'app.bsky.unspecced.getTaggedSuggestions',
|
|
7914
|
+
defs: {
|
|
7915
|
+
main: {
|
|
7916
|
+
type: 'query',
|
|
7917
|
+
description:
|
|
7918
|
+
'Get a list of suggestions (feeds and users) tagged with categories',
|
|
7919
|
+
parameters: {
|
|
7920
|
+
type: 'params',
|
|
7921
|
+
properties: {},
|
|
7922
|
+
},
|
|
7923
|
+
output: {
|
|
7924
|
+
encoding: 'application/json',
|
|
7925
|
+
schema: {
|
|
7926
|
+
type: 'object',
|
|
7927
|
+
required: ['suggestions'],
|
|
7928
|
+
properties: {
|
|
7929
|
+
suggestions: {
|
|
7930
|
+
type: 'array',
|
|
7931
|
+
items: {
|
|
7932
|
+
type: 'ref',
|
|
7933
|
+
ref: 'lex:app.bsky.unspecced.getTaggedSuggestions#suggestion',
|
|
7934
|
+
},
|
|
7935
|
+
},
|
|
7936
|
+
},
|
|
7937
|
+
},
|
|
7938
|
+
},
|
|
7939
|
+
},
|
|
7940
|
+
suggestion: {
|
|
7941
|
+
type: 'object',
|
|
7942
|
+
required: ['tag', 'subjectType', 'subject'],
|
|
7943
|
+
properties: {
|
|
7944
|
+
tag: {
|
|
7945
|
+
type: 'string',
|
|
7946
|
+
},
|
|
7947
|
+
subjectType: {
|
|
7948
|
+
type: 'string',
|
|
7949
|
+
knownValues: ['actor', 'feed'],
|
|
7950
|
+
},
|
|
7951
|
+
subject: {
|
|
7952
|
+
type: 'string',
|
|
7953
|
+
format: 'uri',
|
|
7954
|
+
},
|
|
7955
|
+
},
|
|
7956
|
+
},
|
|
7957
|
+
},
|
|
7958
|
+
},
|
|
7720
7959
|
AppBskyUnspeccedGetTimelineSkeleton: {
|
|
7721
7960
|
lexicon: 1,
|
|
7722
7961
|
id: 'app.bsky.unspecced.getTimelineSkeleton',
|
|
@@ -7896,8 +8135,12 @@ export const schemaDict = {
|
|
|
7896
8135
|
export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[]
|
|
7897
8136
|
export const lexicons: Lexicons = new Lexicons(schemas)
|
|
7898
8137
|
export const ids = {
|
|
8138
|
+
ComAtprotoAdminCreateCommunicationTemplate:
|
|
8139
|
+
'com.atproto.admin.createCommunicationTemplate',
|
|
7899
8140
|
ComAtprotoAdminDefs: 'com.atproto.admin.defs',
|
|
7900
8141
|
ComAtprotoAdminDeleteAccount: 'com.atproto.admin.deleteAccount',
|
|
8142
|
+
ComAtprotoAdminDeleteCommunicationTemplate:
|
|
8143
|
+
'com.atproto.admin.deleteCommunicationTemplate',
|
|
7901
8144
|
ComAtprotoAdminDisableAccountInvites:
|
|
7902
8145
|
'com.atproto.admin.disableAccountInvites',
|
|
7903
8146
|
ComAtprotoAdminDisableInviteCodes: 'com.atproto.admin.disableInviteCodes',
|
|
@@ -7910,6 +8153,8 @@ export const ids = {
|
|
|
7910
8153
|
ComAtprotoAdminGetRecord: 'com.atproto.admin.getRecord',
|
|
7911
8154
|
ComAtprotoAdminGetRepo: 'com.atproto.admin.getRepo',
|
|
7912
8155
|
ComAtprotoAdminGetSubjectStatus: 'com.atproto.admin.getSubjectStatus',
|
|
8156
|
+
ComAtprotoAdminListCommunicationTemplates:
|
|
8157
|
+
'com.atproto.admin.listCommunicationTemplates',
|
|
7913
8158
|
ComAtprotoAdminQueryModerationEvents:
|
|
7914
8159
|
'com.atproto.admin.queryModerationEvents',
|
|
7915
8160
|
ComAtprotoAdminQueryModerationStatuses:
|
|
@@ -7918,6 +8163,8 @@ export const ids = {
|
|
|
7918
8163
|
ComAtprotoAdminSendEmail: 'com.atproto.admin.sendEmail',
|
|
7919
8164
|
ComAtprotoAdminUpdateAccountEmail: 'com.atproto.admin.updateAccountEmail',
|
|
7920
8165
|
ComAtprotoAdminUpdateAccountHandle: 'com.atproto.admin.updateAccountHandle',
|
|
8166
|
+
ComAtprotoAdminUpdateCommunicationTemplate:
|
|
8167
|
+
'com.atproto.admin.updateCommunicationTemplate',
|
|
7921
8168
|
ComAtprotoAdminUpdateSubjectStatus: 'com.atproto.admin.updateSubjectStatus',
|
|
7922
8169
|
ComAtprotoIdentityResolveHandle: 'com.atproto.identity.resolveHandle',
|
|
7923
8170
|
ComAtprotoIdentityUpdateHandle: 'com.atproto.identity.updateHandle',
|
|
@@ -8043,6 +8290,8 @@ export const ids = {
|
|
|
8043
8290
|
AppBskyUnspeccedDefs: 'app.bsky.unspecced.defs',
|
|
8044
8291
|
AppBskyUnspeccedGetPopularFeedGenerators:
|
|
8045
8292
|
'app.bsky.unspecced.getPopularFeedGenerators',
|
|
8293
|
+
AppBskyUnspeccedGetTaggedSuggestions:
|
|
8294
|
+
'app.bsky.unspecced.getTaggedSuggestions',
|
|
8046
8295
|
AppBskyUnspeccedGetTimelineSkeleton: 'app.bsky.unspecced.getTimelineSkeleton',
|
|
8047
8296
|
AppBskyUnspeccedSearchActorsSkeleton:
|
|
8048
8297
|
'app.bsky.unspecced.searchActorsSkeleton',
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth } from '@atproto/xrpc-server'
|
|
10
|
+
|
|
11
|
+
export interface QueryParams {}
|
|
12
|
+
|
|
13
|
+
export type InputSchema = undefined
|
|
14
|
+
|
|
15
|
+
export interface OutputSchema {
|
|
16
|
+
suggestions: Suggestion[]
|
|
17
|
+
[k: string]: unknown
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type HandlerInput = undefined
|
|
21
|
+
|
|
22
|
+
export interface HandlerSuccess {
|
|
23
|
+
encoding: 'application/json'
|
|
24
|
+
body: OutputSchema
|
|
25
|
+
headers?: { [key: string]: string }
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface HandlerError {
|
|
29
|
+
status: number
|
|
30
|
+
message?: string
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
34
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
35
|
+
auth: HA
|
|
36
|
+
params: QueryParams
|
|
37
|
+
input: HandlerInput
|
|
38
|
+
req: express.Request
|
|
39
|
+
res: express.Response
|
|
40
|
+
}
|
|
41
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
42
|
+
ctx: HandlerReqCtx<HA>,
|
|
43
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
44
|
+
|
|
45
|
+
export interface Suggestion {
|
|
46
|
+
tag: string
|
|
47
|
+
subjectType: 'actor' | 'feed' | (string & {})
|
|
48
|
+
subject: string
|
|
49
|
+
[k: string]: unknown
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function isSuggestion(v: unknown): v is Suggestion {
|
|
53
|
+
return (
|
|
54
|
+
isObj(v) &&
|
|
55
|
+
hasProp(v, '$type') &&
|
|
56
|
+
v.$type === 'app.bsky.unspecced.getTaggedSuggestions#suggestion'
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function validateSuggestion(v: unknown): ValidationResult {
|
|
61
|
+
return lexicons.validate(
|
|
62
|
+
'app.bsky.unspecced.getTaggedSuggestions#suggestion',
|
|
63
|
+
v,
|
|
64
|
+
)
|
|
65
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth } from '@atproto/xrpc-server'
|
|
10
|
+
import * as ComAtprotoAdminDefs from './defs'
|
|
11
|
+
|
|
12
|
+
export interface QueryParams {}
|
|
13
|
+
|
|
14
|
+
export interface InputSchema {
|
|
15
|
+
/** Name of the template. */
|
|
16
|
+
name: string
|
|
17
|
+
/** Content of the template, markdown supported, can contain variable placeholders. */
|
|
18
|
+
contentMarkdown: string
|
|
19
|
+
/** Subject of the message, used in emails. */
|
|
20
|
+
subject: string
|
|
21
|
+
/** DID of the user who is creating the template. */
|
|
22
|
+
createdBy?: string
|
|
23
|
+
[k: string]: unknown
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type OutputSchema = ComAtprotoAdminDefs.CommunicationTemplateView
|
|
27
|
+
|
|
28
|
+
export interface HandlerInput {
|
|
29
|
+
encoding: 'application/json'
|
|
30
|
+
body: InputSchema
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface HandlerSuccess {
|
|
34
|
+
encoding: 'application/json'
|
|
35
|
+
body: OutputSchema
|
|
36
|
+
headers?: { [key: string]: string }
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface HandlerError {
|
|
40
|
+
status: number
|
|
41
|
+
message?: string
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
45
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
46
|
+
auth: HA
|
|
47
|
+
params: QueryParams
|
|
48
|
+
input: HandlerInput
|
|
49
|
+
req: express.Request
|
|
50
|
+
res: express.Response
|
|
51
|
+
}
|
|
52
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
53
|
+
ctx: HandlerReqCtx<HA>,
|
|
54
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
@@ -717,3 +717,38 @@ export function isModEventEmail(v: unknown): v is ModEventEmail {
|
|
|
717
717
|
export function validateModEventEmail(v: unknown): ValidationResult {
|
|
718
718
|
return lexicons.validate('com.atproto.admin.defs#modEventEmail', v)
|
|
719
719
|
}
|
|
720
|
+
|
|
721
|
+
export interface CommunicationTemplateView {
|
|
722
|
+
id: string
|
|
723
|
+
/** Name of the template. */
|
|
724
|
+
name: string
|
|
725
|
+
/** Content of the template, can contain markdown and variable placeholders. */
|
|
726
|
+
subject?: string
|
|
727
|
+
/** Subject of the message, used in emails. */
|
|
728
|
+
contentMarkdown: string
|
|
729
|
+
disabled: boolean
|
|
730
|
+
/** DID of the user who last updated the template. */
|
|
731
|
+
lastUpdatedBy: string
|
|
732
|
+
createdAt: string
|
|
733
|
+
updatedAt: string
|
|
734
|
+
[k: string]: unknown
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
export function isCommunicationTemplateView(
|
|
738
|
+
v: unknown,
|
|
739
|
+
): v is CommunicationTemplateView {
|
|
740
|
+
return (
|
|
741
|
+
isObj(v) &&
|
|
742
|
+
hasProp(v, '$type') &&
|
|
743
|
+
v.$type === 'com.atproto.admin.defs#communicationTemplateView'
|
|
744
|
+
)
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
export function validateCommunicationTemplateView(
|
|
748
|
+
v: unknown,
|
|
749
|
+
): ValidationResult {
|
|
750
|
+
return lexicons.validate(
|
|
751
|
+
'com.atproto.admin.defs#communicationTemplateView',
|
|
752
|
+
v,
|
|
753
|
+
)
|
|
754
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth } from '@atproto/xrpc-server'
|
|
10
|
+
|
|
11
|
+
export interface QueryParams {}
|
|
12
|
+
|
|
13
|
+
export interface InputSchema {
|
|
14
|
+
id: string
|
|
15
|
+
[k: string]: unknown
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface HandlerInput {
|
|
19
|
+
encoding: 'application/json'
|
|
20
|
+
body: InputSchema
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface HandlerError {
|
|
24
|
+
status: number
|
|
25
|
+
message?: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type HandlerOutput = HandlerError | void
|
|
29
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
30
|
+
auth: HA
|
|
31
|
+
params: QueryParams
|
|
32
|
+
input: HandlerInput
|
|
33
|
+
req: express.Request
|
|
34
|
+
res: express.Response
|
|
35
|
+
}
|
|
36
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
37
|
+
ctx: HandlerReqCtx<HA>,
|
|
38
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth } from '@atproto/xrpc-server'
|
|
10
|
+
import * as ComAtprotoAdminDefs from './defs'
|
|
11
|
+
|
|
12
|
+
export interface QueryParams {}
|
|
13
|
+
|
|
14
|
+
export type InputSchema = undefined
|
|
15
|
+
|
|
16
|
+
export interface OutputSchema {
|
|
17
|
+
communicationTemplates: ComAtprotoAdminDefs.CommunicationTemplateView[]
|
|
18
|
+
[k: string]: unknown
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type HandlerInput = undefined
|
|
22
|
+
|
|
23
|
+
export interface HandlerSuccess {
|
|
24
|
+
encoding: 'application/json'
|
|
25
|
+
body: OutputSchema
|
|
26
|
+
headers?: { [key: string]: string }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface HandlerError {
|
|
30
|
+
status: number
|
|
31
|
+
message?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
35
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
36
|
+
auth: HA
|
|
37
|
+
params: QueryParams
|
|
38
|
+
input: HandlerInput
|
|
39
|
+
req: express.Request
|
|
40
|
+
res: express.Response
|
|
41
|
+
}
|
|
42
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
43
|
+
ctx: HandlerReqCtx<HA>,
|
|
44
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import express from 'express'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
|
+
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { isObj, hasProp } from '../../../../util'
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import { HandlerAuth } from '@atproto/xrpc-server'
|
|
10
|
+
import * as ComAtprotoAdminDefs from './defs'
|
|
11
|
+
|
|
12
|
+
export interface QueryParams {}
|
|
13
|
+
|
|
14
|
+
export interface InputSchema {
|
|
15
|
+
/** ID of the template to be updated. */
|
|
16
|
+
id: string
|
|
17
|
+
/** Name of the template. */
|
|
18
|
+
name?: string
|
|
19
|
+
/** Content of the template, markdown supported, can contain variable placeholders. */
|
|
20
|
+
contentMarkdown?: string
|
|
21
|
+
/** Subject of the message, used in emails. */
|
|
22
|
+
subject?: string
|
|
23
|
+
/** DID of the user who is updating the template. */
|
|
24
|
+
updatedBy?: string
|
|
25
|
+
disabled?: boolean
|
|
26
|
+
[k: string]: unknown
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type OutputSchema = ComAtprotoAdminDefs.CommunicationTemplateView
|
|
30
|
+
|
|
31
|
+
export interface HandlerInput {
|
|
32
|
+
encoding: 'application/json'
|
|
33
|
+
body: InputSchema
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface HandlerSuccess {
|
|
37
|
+
encoding: 'application/json'
|
|
38
|
+
body: OutputSchema
|
|
39
|
+
headers?: { [key: string]: string }
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface HandlerError {
|
|
43
|
+
status: number
|
|
44
|
+
message?: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type HandlerOutput = HandlerError | HandlerSuccess
|
|
48
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
49
|
+
auth: HA
|
|
50
|
+
params: QueryParams
|
|
51
|
+
input: HandlerInput
|
|
52
|
+
req: express.Request
|
|
53
|
+
res: express.Response
|
|
54
|
+
}
|
|
55
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
56
|
+
ctx: HandlerReqCtx<HA>,
|
|
57
|
+
) => Promise<HandlerOutput> | HandlerOutput
|