@atproto/lex-document 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/lexicon-document.d.ts +22099 -0
- package/dist/lexicon-document.d.ts.map +1 -0
- package/dist/lexicon-document.js +266 -0
- package/dist/lexicon-document.js.map +1 -0
- package/dist/lexicon-indexer.d.ts +7 -0
- package/dist/lexicon-indexer.d.ts.map +1 -0
- package/dist/lexicon-indexer.js +3 -0
- package/dist/lexicon-indexer.js.map +1 -0
- package/dist/lexicon-iterable-indexer.d.ts +14 -0
- package/dist/lexicon-iterable-indexer.d.ts.map +1 -0
- package/dist/lexicon-iterable-indexer.js +68 -0
- package/dist/lexicon-iterable-indexer.js.map +1 -0
- package/dist/lexicon-schema-builder.d.ts +89 -0
- package/dist/lexicon-schema-builder.d.ts.map +1 -0
- package/dist/lexicon-schema-builder.js +249 -0
- package/dist/lexicon-schema-builder.js.map +1 -0
- package/package.json +46 -0
- package/src/index.ts +7 -0
- package/src/lexicon-document.test.ts +22 -0
- package/src/lexicon-document.ts +427 -0
- package/src/lexicon-indexer.ts +8 -0
- package/src/lexicon-iterable-indexer.ts +82 -0
- package/src/lexicon-schema-builder.test.ts +206 -0
- package/src/lexicon-schema-builder.ts +345 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexicon-document.d.ts","sourceRoot":"","sources":["../src/lexicon-document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AAMvC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAUhC,CAAA;AACD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;EAahC,CAAA;AAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBjC,CAAA;AACD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lexiconDocumentSchema = exports.lexiconIdentifierSchema = exports.lexiconSubscriptionSchema = exports.lexiconProcedureSchema = exports.lexiconQuerySchema = exports.lexiconError = exports.lexiconSubscriptionMessage = exports.lexiconPayload = exports.lexiconParameters = exports.lexiconRecordSchema = exports.lexiconObjectSchema = exports.lexiconArraySchema = exports.lexiconRefUnionSchema = exports.lexiconRefSchema = exports.lexiconTokenSchema = exports.lexiconUnknownSchema = exports.lexiconBlobSchema = exports.lexiconCidLinkSchema = exports.lexiconBytesSchema = exports.lexiconStringSchema = exports.lexiconStringFormatSchema = exports.lexiconIntegerSchema = exports.lexiconBooleanSchema = void 0;
|
|
4
|
+
const lex_schema_1 = require("@atproto/lex-schema");
|
|
5
|
+
// https://atproto.com/specs/lexicon
|
|
6
|
+
// "Concrete" Types
|
|
7
|
+
exports.lexiconBooleanSchema = lex_schema_1.l.object({
|
|
8
|
+
type: lex_schema_1.l.literal('boolean'),
|
|
9
|
+
description: lex_schema_1.l.string(),
|
|
10
|
+
default: lex_schema_1.l.boolean(),
|
|
11
|
+
const: lex_schema_1.l.boolean(),
|
|
12
|
+
}, {
|
|
13
|
+
required: ['type'],
|
|
14
|
+
});
|
|
15
|
+
exports.lexiconIntegerSchema = lex_schema_1.l.object({
|
|
16
|
+
type: lex_schema_1.l.literal('integer'),
|
|
17
|
+
description: lex_schema_1.l.string(),
|
|
18
|
+
default: lex_schema_1.l.integer(),
|
|
19
|
+
minimum: lex_schema_1.l.integer(),
|
|
20
|
+
maximum: lex_schema_1.l.integer(),
|
|
21
|
+
enum: lex_schema_1.l.array(lex_schema_1.l.integer()),
|
|
22
|
+
const: lex_schema_1.l.integer(),
|
|
23
|
+
}, {
|
|
24
|
+
required: ['type'],
|
|
25
|
+
});
|
|
26
|
+
exports.lexiconStringFormatSchema = lex_schema_1.l.enum(lex_schema_1.l.STRING_FORMATS);
|
|
27
|
+
exports.lexiconStringSchema = lex_schema_1.l.object({
|
|
28
|
+
type: lex_schema_1.l.literal('string'),
|
|
29
|
+
format: exports.lexiconStringFormatSchema,
|
|
30
|
+
description: lex_schema_1.l.string(),
|
|
31
|
+
default: lex_schema_1.l.string(),
|
|
32
|
+
minLength: lex_schema_1.l.integer(),
|
|
33
|
+
maxLength: lex_schema_1.l.integer(),
|
|
34
|
+
minGraphemes: lex_schema_1.l.integer(),
|
|
35
|
+
maxGraphemes: lex_schema_1.l.integer(),
|
|
36
|
+
enum: lex_schema_1.l.array(lex_schema_1.l.string()),
|
|
37
|
+
const: lex_schema_1.l.string(),
|
|
38
|
+
knownValues: lex_schema_1.l.array(lex_schema_1.l.string()),
|
|
39
|
+
}, {
|
|
40
|
+
required: ['type'],
|
|
41
|
+
});
|
|
42
|
+
exports.lexiconBytesSchema = lex_schema_1.l.object({
|
|
43
|
+
type: lex_schema_1.l.literal('bytes'),
|
|
44
|
+
description: lex_schema_1.l.string(),
|
|
45
|
+
maxLength: lex_schema_1.l.integer(),
|
|
46
|
+
minLength: lex_schema_1.l.integer(),
|
|
47
|
+
}, {
|
|
48
|
+
required: ['type'],
|
|
49
|
+
});
|
|
50
|
+
exports.lexiconCidLinkSchema = lex_schema_1.l.object({
|
|
51
|
+
type: lex_schema_1.l.literal('cid-link'),
|
|
52
|
+
description: lex_schema_1.l.string(),
|
|
53
|
+
}, {
|
|
54
|
+
required: ['type'],
|
|
55
|
+
});
|
|
56
|
+
exports.lexiconBlobSchema = lex_schema_1.l.object({
|
|
57
|
+
type: lex_schema_1.l.literal('blob'),
|
|
58
|
+
description: lex_schema_1.l.string(),
|
|
59
|
+
accept: lex_schema_1.l.array(lex_schema_1.l.string()),
|
|
60
|
+
maxSize: lex_schema_1.l.integer(),
|
|
61
|
+
}, {
|
|
62
|
+
required: ['type'],
|
|
63
|
+
});
|
|
64
|
+
const CONCRETE_TYPES = [
|
|
65
|
+
exports.lexiconBooleanSchema,
|
|
66
|
+
exports.lexiconIntegerSchema,
|
|
67
|
+
exports.lexiconStringSchema,
|
|
68
|
+
// Lexicon (DAG-CBOR)
|
|
69
|
+
exports.lexiconBytesSchema,
|
|
70
|
+
exports.lexiconCidLinkSchema,
|
|
71
|
+
// Lexicon Specific
|
|
72
|
+
exports.lexiconBlobSchema,
|
|
73
|
+
];
|
|
74
|
+
// Meta types
|
|
75
|
+
exports.lexiconUnknownSchema = lex_schema_1.l.object({
|
|
76
|
+
type: lex_schema_1.l.literal('unknown'),
|
|
77
|
+
description: lex_schema_1.l.string(),
|
|
78
|
+
}, {
|
|
79
|
+
required: ['type'],
|
|
80
|
+
});
|
|
81
|
+
exports.lexiconTokenSchema = lex_schema_1.l.object({
|
|
82
|
+
type: lex_schema_1.l.literal('token'),
|
|
83
|
+
description: lex_schema_1.l.string(),
|
|
84
|
+
}, {
|
|
85
|
+
required: ['type'],
|
|
86
|
+
});
|
|
87
|
+
exports.lexiconRefSchema = lex_schema_1.l.object({
|
|
88
|
+
type: lex_schema_1.l.literal('ref'),
|
|
89
|
+
description: lex_schema_1.l.string(),
|
|
90
|
+
ref: lex_schema_1.l.string(),
|
|
91
|
+
}, {
|
|
92
|
+
required: ['type', 'ref'],
|
|
93
|
+
});
|
|
94
|
+
exports.lexiconRefUnionSchema = lex_schema_1.l.object({
|
|
95
|
+
type: lex_schema_1.l.literal('union'),
|
|
96
|
+
description: lex_schema_1.l.string(),
|
|
97
|
+
refs: lex_schema_1.l.array(lex_schema_1.l.string()),
|
|
98
|
+
closed: lex_schema_1.l.boolean(),
|
|
99
|
+
}, {
|
|
100
|
+
required: ['type', 'refs'],
|
|
101
|
+
});
|
|
102
|
+
// Complex Types
|
|
103
|
+
const ARRAY_ITEMS_SCHEMAS = [
|
|
104
|
+
...CONCRETE_TYPES,
|
|
105
|
+
// Meta
|
|
106
|
+
exports.lexiconUnknownSchema,
|
|
107
|
+
exports.lexiconRefSchema,
|
|
108
|
+
exports.lexiconRefUnionSchema,
|
|
109
|
+
];
|
|
110
|
+
exports.lexiconArraySchema = lex_schema_1.l.object({
|
|
111
|
+
type: lex_schema_1.l.literal('array'),
|
|
112
|
+
description: lex_schema_1.l.string(),
|
|
113
|
+
items: lex_schema_1.l.discriminatedUnion('type', ARRAY_ITEMS_SCHEMAS),
|
|
114
|
+
minLength: lex_schema_1.l.integer(),
|
|
115
|
+
maxLength: lex_schema_1.l.integer(),
|
|
116
|
+
}, {
|
|
117
|
+
required: ['type', 'items'],
|
|
118
|
+
});
|
|
119
|
+
exports.lexiconObjectSchema = lex_schema_1.l.object({
|
|
120
|
+
type: lex_schema_1.l.literal('object'),
|
|
121
|
+
description: lex_schema_1.l.string(),
|
|
122
|
+
required: lex_schema_1.l.array(lex_schema_1.l.string()),
|
|
123
|
+
nullable: lex_schema_1.l.array(lex_schema_1.l.string()),
|
|
124
|
+
properties: lex_schema_1.l.dict(lex_schema_1.l.string(), lex_schema_1.l.discriminatedUnion('type', [
|
|
125
|
+
...ARRAY_ITEMS_SCHEMAS,
|
|
126
|
+
exports.lexiconArraySchema,
|
|
127
|
+
])),
|
|
128
|
+
}, {
|
|
129
|
+
required: ['type', 'properties'],
|
|
130
|
+
});
|
|
131
|
+
// Records
|
|
132
|
+
exports.lexiconRecordSchema = lex_schema_1.l.object({
|
|
133
|
+
type: lex_schema_1.l.literal('record'),
|
|
134
|
+
description: lex_schema_1.l.string(),
|
|
135
|
+
key: lex_schema_1.l.string(),
|
|
136
|
+
record: exports.lexiconObjectSchema,
|
|
137
|
+
}, { required: ['type', 'record'] });
|
|
138
|
+
// XRPC Methods
|
|
139
|
+
exports.lexiconParameters = lex_schema_1.l.object({
|
|
140
|
+
type: lex_schema_1.l.literal('params'),
|
|
141
|
+
description: lex_schema_1.l.string(),
|
|
142
|
+
required: lex_schema_1.l.array(lex_schema_1.l.string()),
|
|
143
|
+
properties: lex_schema_1.l.dict(lex_schema_1.l.string(), lex_schema_1.l.discriminatedUnion('type', [
|
|
144
|
+
exports.lexiconBooleanSchema,
|
|
145
|
+
exports.lexiconIntegerSchema,
|
|
146
|
+
exports.lexiconStringSchema,
|
|
147
|
+
lex_schema_1.l.object({
|
|
148
|
+
type: lex_schema_1.l.literal('array'),
|
|
149
|
+
description: lex_schema_1.l.string(),
|
|
150
|
+
items: lex_schema_1.l.discriminatedUnion('type', [
|
|
151
|
+
exports.lexiconBooleanSchema,
|
|
152
|
+
exports.lexiconIntegerSchema,
|
|
153
|
+
exports.lexiconStringSchema,
|
|
154
|
+
]),
|
|
155
|
+
minLength: lex_schema_1.l.integer(),
|
|
156
|
+
maxLength: lex_schema_1.l.integer(),
|
|
157
|
+
}, {
|
|
158
|
+
required: ['type', 'items'],
|
|
159
|
+
}),
|
|
160
|
+
])),
|
|
161
|
+
}, {
|
|
162
|
+
required: ['type', 'properties'],
|
|
163
|
+
});
|
|
164
|
+
exports.lexiconPayload = lex_schema_1.l.object({
|
|
165
|
+
description: lex_schema_1.l.string(),
|
|
166
|
+
encoding: lex_schema_1.l.string(),
|
|
167
|
+
schema: lex_schema_1.l.discriminatedUnion('type', [
|
|
168
|
+
exports.lexiconRefSchema,
|
|
169
|
+
exports.lexiconRefUnionSchema,
|
|
170
|
+
exports.lexiconObjectSchema,
|
|
171
|
+
]),
|
|
172
|
+
}, {
|
|
173
|
+
required: ['encoding'],
|
|
174
|
+
});
|
|
175
|
+
exports.lexiconSubscriptionMessage = lex_schema_1.l.object({
|
|
176
|
+
description: lex_schema_1.l.string(),
|
|
177
|
+
schema: lex_schema_1.l.discriminatedUnion('type', [
|
|
178
|
+
exports.lexiconRefSchema,
|
|
179
|
+
exports.lexiconRefUnionSchema,
|
|
180
|
+
exports.lexiconObjectSchema,
|
|
181
|
+
]),
|
|
182
|
+
});
|
|
183
|
+
exports.lexiconError = lex_schema_1.l.object({
|
|
184
|
+
name: lex_schema_1.l.string({ minLength: 1 }),
|
|
185
|
+
description: lex_schema_1.l.string(),
|
|
186
|
+
}, {
|
|
187
|
+
required: ['name'],
|
|
188
|
+
});
|
|
189
|
+
exports.lexiconQuerySchema = lex_schema_1.l.object({
|
|
190
|
+
type: lex_schema_1.l.literal('query'),
|
|
191
|
+
description: lex_schema_1.l.string(),
|
|
192
|
+
parameters: exports.lexiconParameters,
|
|
193
|
+
output: exports.lexiconPayload,
|
|
194
|
+
errors: lex_schema_1.l.array(exports.lexiconError),
|
|
195
|
+
}, {
|
|
196
|
+
required: ['type'],
|
|
197
|
+
});
|
|
198
|
+
exports.lexiconProcedureSchema = lex_schema_1.l.object({
|
|
199
|
+
type: lex_schema_1.l.literal('procedure'),
|
|
200
|
+
description: lex_schema_1.l.string(),
|
|
201
|
+
parameters: exports.lexiconParameters,
|
|
202
|
+
input: exports.lexiconPayload,
|
|
203
|
+
output: exports.lexiconPayload,
|
|
204
|
+
errors: lex_schema_1.l.array(exports.lexiconError),
|
|
205
|
+
}, {
|
|
206
|
+
required: ['type'],
|
|
207
|
+
});
|
|
208
|
+
exports.lexiconSubscriptionSchema = lex_schema_1.l.object({
|
|
209
|
+
type: lex_schema_1.l.literal('subscription'),
|
|
210
|
+
description: lex_schema_1.l.string(),
|
|
211
|
+
parameters: exports.lexiconParameters,
|
|
212
|
+
message: exports.lexiconSubscriptionMessage,
|
|
213
|
+
errors: lex_schema_1.l.array(exports.lexiconError),
|
|
214
|
+
}, {
|
|
215
|
+
required: ['type'],
|
|
216
|
+
});
|
|
217
|
+
// Permissions
|
|
218
|
+
const lexiconLanguageSchema = lex_schema_1.l.string({ format: 'language' });
|
|
219
|
+
const lexiconLanguageDict = lex_schema_1.l.dict(lexiconLanguageSchema, lex_schema_1.l.string());
|
|
220
|
+
const lexiconPermissionSchema = lex_schema_1.l.object({
|
|
221
|
+
type: lex_schema_1.l.literal('permission'),
|
|
222
|
+
resource: lex_schema_1.l.string({ minLength: 1 }),
|
|
223
|
+
}, {
|
|
224
|
+
required: ['type', 'resource'],
|
|
225
|
+
unknownProperties: lex_schema_1.l.paramsSchema,
|
|
226
|
+
});
|
|
227
|
+
const lexiconPermissionSetSchema = lex_schema_1.l.object({
|
|
228
|
+
type: lex_schema_1.l.literal('permission-set'),
|
|
229
|
+
description: lex_schema_1.l.string(),
|
|
230
|
+
title: lex_schema_1.l.string(),
|
|
231
|
+
'title:lang': lexiconLanguageDict,
|
|
232
|
+
detail: lex_schema_1.l.string(),
|
|
233
|
+
'detail:lang': lexiconLanguageDict,
|
|
234
|
+
permissions: lex_schema_1.l.array(lexiconPermissionSchema),
|
|
235
|
+
}, {
|
|
236
|
+
required: ['type', 'permissions'],
|
|
237
|
+
});
|
|
238
|
+
// Schemas that can appear anywhere in the defs
|
|
239
|
+
const NAMED_LEXICON_SCHEMAS = [
|
|
240
|
+
...CONCRETE_TYPES,
|
|
241
|
+
exports.lexiconArraySchema,
|
|
242
|
+
exports.lexiconObjectSchema,
|
|
243
|
+
exports.lexiconTokenSchema,
|
|
244
|
+
];
|
|
245
|
+
// Schemas that can only appear as "main" def
|
|
246
|
+
const MAIN_LEXICON_SCHEMAS = [
|
|
247
|
+
lexiconPermissionSetSchema,
|
|
248
|
+
exports.lexiconProcedureSchema,
|
|
249
|
+
exports.lexiconQuerySchema,
|
|
250
|
+
exports.lexiconRecordSchema,
|
|
251
|
+
exports.lexiconSubscriptionSchema,
|
|
252
|
+
...NAMED_LEXICON_SCHEMAS,
|
|
253
|
+
];
|
|
254
|
+
exports.lexiconIdentifierSchema = lex_schema_1.l.string({ format: 'nsid' });
|
|
255
|
+
exports.lexiconDocumentSchema = lex_schema_1.l.object({
|
|
256
|
+
lexicon: lex_schema_1.l.literal(1),
|
|
257
|
+
id: exports.lexiconIdentifierSchema,
|
|
258
|
+
revision: lex_schema_1.l.integer(),
|
|
259
|
+
description: lex_schema_1.l.string(),
|
|
260
|
+
defs: lex_schema_1.l.object({ main: lex_schema_1.l.discriminatedUnion('type', MAIN_LEXICON_SCHEMAS) }, {
|
|
261
|
+
unknownProperties: lex_schema_1.l.dict(lex_schema_1.l.string({ minLength: 1 }), lex_schema_1.l.discriminatedUnion('type', NAMED_LEXICON_SCHEMAS)),
|
|
262
|
+
}),
|
|
263
|
+
}, {
|
|
264
|
+
required: ['lexicon', 'id', 'defs'],
|
|
265
|
+
});
|
|
266
|
+
//# sourceMappingURL=lexicon-document.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexicon-document.js","sourceRoot":"","sources":["../src/lexicon-document.ts"],"names":[],"mappings":";;;AAAA,oDAAuC;AAEvC,oCAAoC;AAEpC,mBAAmB;AAEN,QAAA,oBAAoB,GAAG,cAAC,CAAC,MAAM,CAC1C;IACE,IAAI,EAAE,cAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1B,WAAW,EAAE,cAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,cAAC,CAAC,OAAO,EAAE;IACpB,KAAK,EAAE,cAAC,CAAC,OAAO,EAAE;CACnB,EACD;IACE,QAAQ,EAAE,CAAC,MAAM,CAAC;CACnB,CACF,CAAA;AAGY,QAAA,oBAAoB,GAAG,cAAC,CAAC,MAAM,CAC1C;IACE,IAAI,EAAE,cAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1B,WAAW,EAAE,cAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,cAAC,CAAC,OAAO,EAAE;IACpB,OAAO,EAAE,c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,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,EAC1B,cAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,qBAAqB,CAAC,CACpD;KACF,CACF;CACF,EACD;IACE,QAAQ,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC;CACpC,CACF,CAAA","sourcesContent":["import { l } from '@atproto/lex-schema'\n\n// https://atproto.com/specs/lexicon\n\n// \"Concrete\" Types\n\nexport const lexiconBooleanSchema = l.object(\n {\n type: l.literal('boolean'),\n description: l.string(),\n default: l.boolean(),\n const: l.boolean(),\n },\n {\n required: ['type'],\n },\n)\nexport type LexiconBoolean = l.Infer<typeof lexiconBooleanSchema>\n\nexport const lexiconIntegerSchema = l.object(\n {\n type: l.literal('integer'),\n description: l.string(),\n default: l.integer(),\n minimum: l.integer(),\n maximum: l.integer(),\n enum: l.array(l.integer()),\n const: l.integer(),\n },\n {\n required: ['type'],\n },\n)\nexport type LexiconInteger = l.Infer<typeof lexiconIntegerSchema>\n\nexport type LexiconStringFormat = l.StringFormat\nexport const lexiconStringFormatSchema = l.enum<LexiconStringFormat>(\n l.STRING_FORMATS,\n)\n\nexport const lexiconStringSchema = l.object(\n {\n type: l.literal('string'),\n format: lexiconStringFormatSchema,\n description: l.string(),\n default: l.string(),\n minLength: l.integer(),\n maxLength: l.integer(),\n minGraphemes: l.integer(),\n maxGraphemes: l.integer(),\n enum: l.array(l.string()),\n const: l.string(),\n knownValues: l.array(l.string()),\n },\n {\n required: ['type'],\n },\n)\nexport type LexiconString = l.Infer<typeof lexiconStringSchema>\n\nexport const lexiconBytesSchema = l.object(\n {\n type: l.literal('bytes'),\n description: l.string(),\n maxLength: l.integer(),\n minLength: l.integer(),\n },\n {\n required: ['type'],\n },\n)\nexport type LexiconBytes = l.Infer<typeof lexiconBytesSchema>\n\nexport const lexiconCidLinkSchema = l.object(\n {\n type: l.literal('cid-link'),\n description: l.string(),\n },\n {\n required: ['type'],\n },\n)\nexport type LexiconCid = l.Infer<typeof lexiconCidLinkSchema>\n\nexport const lexiconBlobSchema = l.object(\n {\n type: l.literal('blob'),\n description: l.string(),\n accept: l.array(l.string()),\n maxSize: l.integer(),\n },\n {\n required: ['type'],\n },\n)\nexport type LexiconBlob = l.Infer<typeof lexiconBlobSchema>\n\nconst CONCRETE_TYPES = [\n lexiconBooleanSchema,\n lexiconIntegerSchema,\n lexiconStringSchema,\n // Lexicon (DAG-CBOR)\n lexiconBytesSchema,\n lexiconCidLinkSchema,\n // Lexicon Specific\n lexiconBlobSchema,\n] as const\n\n// Meta types\n\nexport const lexiconUnknownSchema = l.object(\n {\n type: l.literal('unknown'),\n description: l.string(),\n },\n {\n required: ['type'],\n },\n)\nexport type LexiconUnknown = l.Infer<typeof lexiconUnknownSchema>\n\nexport const lexiconTokenSchema = l.object(\n {\n type: l.literal('token'),\n description: l.string(),\n },\n {\n required: ['type'],\n },\n)\nexport type LexiconToken = l.Infer<typeof lexiconTokenSchema>\n\nexport const lexiconRefSchema = l.object(\n {\n type: l.literal('ref'),\n description: l.string(),\n ref: l.string(),\n },\n {\n required: ['type', 'ref'],\n },\n)\nexport type LexiconRef = l.Infer<typeof lexiconRefSchema>\n\nexport const lexiconRefUnionSchema = l.object(\n {\n type: l.literal('union'),\n description: l.string(),\n refs: l.array(l.string()),\n closed: l.boolean(),\n },\n {\n required: ['type', 'refs'],\n },\n)\nexport type LexiconRefUnion = l.Infer<typeof lexiconRefUnionSchema>\n\n// Complex Types\n\nconst ARRAY_ITEMS_SCHEMAS = [\n ...CONCRETE_TYPES,\n // Meta\n lexiconUnknownSchema,\n lexiconRefSchema,\n lexiconRefUnionSchema,\n] as const\n\nexport type LexiconArrayItems = l.Infer<(typeof ARRAY_ITEMS_SCHEMAS)[number]>\n\nexport const lexiconArraySchema = l.object(\n {\n type: l.literal('array'),\n description: l.string(),\n items: l.discriminatedUnion('type', ARRAY_ITEMS_SCHEMAS),\n minLength: l.integer(),\n maxLength: l.integer(),\n },\n {\n required: ['type', 'items'],\n },\n)\nexport type LexiconArray = l.Infer<typeof lexiconArraySchema>\n\nexport const lexiconObjectSchema = l.object(\n {\n type: l.literal('object'),\n description: l.string(),\n required: l.array(l.string()),\n nullable: l.array(l.string()),\n properties: l.dict(\n l.string(),\n l.discriminatedUnion('type', [\n ...ARRAY_ITEMS_SCHEMAS,\n lexiconArraySchema,\n ]),\n ),\n },\n {\n required: ['type', 'properties'],\n },\n)\nexport type LexiconObject = l.Infer<typeof lexiconObjectSchema>\n\n// Records\n\nexport const lexiconRecordSchema = l.object(\n {\n type: l.literal('record'),\n description: l.string(),\n key: l.string(),\n record: lexiconObjectSchema,\n },\n { required: ['type', 'record'] },\n)\nexport type LexiconRecord = l.Infer<typeof lexiconRecordSchema>\n\n// XRPC Methods\n\nexport const lexiconParameters = l.object(\n {\n type: l.literal('params'),\n description: l.string(),\n required: l.array(l.string()),\n properties: l.dict(\n l.string(),\n l.discriminatedUnion('type', [\n lexiconBooleanSchema,\n lexiconIntegerSchema,\n lexiconStringSchema,\n l.object(\n {\n type: l.literal('array'),\n description: l.string(),\n items: l.discriminatedUnion('type', [\n lexiconBooleanSchema,\n lexiconIntegerSchema,\n lexiconStringSchema,\n ]),\n minLength: l.integer(),\n maxLength: l.integer(),\n },\n {\n required: ['type', 'items'],\n },\n ),\n ]),\n ),\n },\n {\n required: ['type', 'properties'],\n },\n)\nexport type LexiconParameters = l.Infer<typeof lexiconParameters>\n\nexport const lexiconPayload = l.object(\n {\n description: l.string(),\n encoding: l.string(),\n schema: l.discriminatedUnion('type', [\n lexiconRefSchema,\n lexiconRefUnionSchema,\n lexiconObjectSchema,\n ]),\n },\n {\n required: ['encoding'],\n },\n)\nexport type LexiconPayload = l.Infer<typeof lexiconPayload>\n\nexport const lexiconSubscriptionMessage = l.object({\n description: l.string(),\n schema: l.discriminatedUnion('type', [\n lexiconRefSchema,\n lexiconRefUnionSchema,\n lexiconObjectSchema,\n ]),\n})\nexport type LexiconSubscriptionMessage = l.Infer<\n typeof lexiconSubscriptionMessage\n>\n\nexport const lexiconError = l.object(\n {\n name: l.string({ minLength: 1 }),\n description: l.string(),\n },\n {\n required: ['name'],\n },\n)\nexport type LexiconError = l.Infer<typeof lexiconError>\n\nexport const lexiconQuerySchema = l.object(\n {\n type: l.literal('query'),\n description: l.string(),\n parameters: lexiconParameters,\n output: lexiconPayload,\n errors: l.array(lexiconError),\n },\n {\n required: ['type'],\n },\n)\nexport type LexiconQuery = l.Infer<typeof lexiconQuerySchema>\n\nexport const lexiconProcedureSchema = l.object(\n {\n type: l.literal('procedure'),\n description: l.string(),\n parameters: lexiconParameters,\n input: lexiconPayload,\n output: lexiconPayload,\n errors: l.array(lexiconError),\n },\n {\n required: ['type'],\n },\n)\nexport type LexiconProcedure = l.Infer<typeof lexiconProcedureSchema>\n\nexport const lexiconSubscriptionSchema = l.object(\n {\n type: l.literal('subscription'),\n description: l.string(),\n parameters: lexiconParameters,\n message: lexiconSubscriptionMessage,\n errors: l.array(lexiconError),\n },\n {\n required: ['type'],\n },\n)\n\nexport type LexiconSubscription = l.Infer<typeof lexiconSubscriptionSchema>\n\n// Permissions\n\nconst lexiconLanguageSchema = l.string({ format: 'language' })\n\nexport type LexiconLanguage = l.Infer<typeof lexiconLanguageSchema>\n\nconst lexiconLanguageDict = l.dict(lexiconLanguageSchema, l.string())\n\nexport type LexiconLanguageDict = l.Infer<typeof lexiconLanguageDict>\n\nconst lexiconPermissionSchema = l.object(\n {\n type: l.literal('permission'),\n resource: l.string({ minLength: 1 }),\n },\n {\n required: ['type', 'resource'],\n unknownProperties: l.paramsSchema,\n },\n)\n\nexport type LexiconPermission = l.Infer<typeof lexiconPermissionSchema>\n\nconst lexiconPermissionSetSchema = l.object(\n {\n type: l.literal('permission-set'),\n description: l.string(),\n title: l.string(),\n 'title:lang': lexiconLanguageDict,\n detail: l.string(),\n 'detail:lang': lexiconLanguageDict,\n permissions: l.array(lexiconPermissionSchema),\n },\n {\n required: ['type', 'permissions'],\n },\n)\n\nexport type LexiconPermissionSet = l.Infer<typeof lexiconPermissionSetSchema>\n\n// Schemas that can appear anywhere in the defs\nconst NAMED_LEXICON_SCHEMAS = [\n ...CONCRETE_TYPES,\n lexiconArraySchema,\n lexiconObjectSchema,\n lexiconTokenSchema,\n] as const\n\nexport type NamedLexiconDefinition = l.Infer<\n (typeof NAMED_LEXICON_SCHEMAS)[number]\n>\n\n// Schemas that can only appear as \"main\" def\nconst MAIN_LEXICON_SCHEMAS = [\n lexiconPermissionSetSchema,\n lexiconProcedureSchema,\n lexiconQuerySchema,\n lexiconRecordSchema,\n lexiconSubscriptionSchema,\n ...NAMED_LEXICON_SCHEMAS,\n] as const\n\nexport type MainLexiconDefinition = l.Infer<\n (typeof MAIN_LEXICON_SCHEMAS)[number]\n>\n\nexport const lexiconIdentifierSchema = l.string({ format: 'nsid' })\nexport type LexiconIdentifier = l.Infer<typeof lexiconIdentifierSchema>\n\nexport const lexiconDocumentSchema = l.object(\n {\n lexicon: l.literal(1),\n id: lexiconIdentifierSchema,\n revision: l.integer(),\n description: l.string(),\n defs: l.object(\n { main: l.discriminatedUnion('type', MAIN_LEXICON_SCHEMAS) },\n {\n unknownProperties: l.dict(\n l.string({ minLength: 1 }),\n l.discriminatedUnion('type', NAMED_LEXICON_SCHEMAS),\n ),\n },\n ),\n },\n {\n required: ['lexicon', 'id', 'defs'],\n },\n)\nexport type LexiconDocument = l.Infer<typeof lexiconDocumentSchema>\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LexiconDocument } from './lexicon-document.js';
|
|
2
|
+
export interface LexiconIndexer {
|
|
3
|
+
get(nsid: string): Promise<LexiconDocument>;
|
|
4
|
+
[Symbol.asyncDispose]?: () => Promise<void>;
|
|
5
|
+
[Symbol.asyncIterator]?: () => AsyncIterator<LexiconDocument, void, unknown>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=lexicon-indexer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexicon-indexer.d.ts","sourceRoot":"","sources":["../src/lexicon-indexer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IAE3C,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3C,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,aAAa,CAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;CAC7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexicon-indexer.js","sourceRoot":"","sources":["../src/lexicon-indexer.ts"],"names":[],"mappings":"","sourcesContent":["import { LexiconDocument } from './lexicon-document.js'\n\nexport interface LexiconIndexer {\n get(nsid: string): Promise<LexiconDocument>\n\n [Symbol.asyncDispose]?: () => Promise<void>\n [Symbol.asyncIterator]?: () => AsyncIterator<LexiconDocument, void, unknown>\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { LexiconDocument } from './lexicon-document.js';
|
|
2
|
+
import { LexiconIndexer } from './lexicon-indexer.js';
|
|
3
|
+
/**
|
|
4
|
+
* (Lazily) indexes lexicon documents from an iterable source.
|
|
5
|
+
*/
|
|
6
|
+
export declare class LexiconIterableIndexer implements LexiconIndexer, AsyncDisposable {
|
|
7
|
+
#private;
|
|
8
|
+
readonly source: AsyncIterable<LexiconDocument> | Iterable<LexiconDocument>;
|
|
9
|
+
constructor(source: AsyncIterable<LexiconDocument> | Iterable<LexiconDocument>);
|
|
10
|
+
get(id: string): Promise<LexiconDocument>;
|
|
11
|
+
[Symbol.asyncIterator](): AsyncIterator<LexiconDocument, void, undefined>;
|
|
12
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=lexicon-iterable-indexer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexicon-iterable-indexer.d.ts","sourceRoot":"","sources":["../src/lexicon-iterable-indexer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD;;GAEG;AACH,qBAAa,sBAAuB,YAAW,cAAc,EAAE,eAAe;;IAO1E,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC;gBAAlE,MAAM,EAAE,aAAa,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC;IAQvE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAaxC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,aAAa,CAC5C,eAAe,EACf,IAAI,EACJ,SAAS,CACV;IAwCK,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7C"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LexiconIterableIndexer = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* (Lazily) indexes lexicon documents from an iterable source.
|
|
6
|
+
*/
|
|
7
|
+
class LexiconIterableIndexer {
|
|
8
|
+
source;
|
|
9
|
+
#lexicons = new Map();
|
|
10
|
+
#iterator;
|
|
11
|
+
constructor(source) {
|
|
12
|
+
this.source = source;
|
|
13
|
+
this.#iterator =
|
|
14
|
+
Symbol.asyncIterator in source
|
|
15
|
+
? source[Symbol.asyncIterator]()
|
|
16
|
+
: source[Symbol.iterator]();
|
|
17
|
+
}
|
|
18
|
+
async get(id) {
|
|
19
|
+
const cached = this.#lexicons.get(id);
|
|
20
|
+
if (cached)
|
|
21
|
+
return cached;
|
|
22
|
+
for await (const doc of this) {
|
|
23
|
+
if (doc.id === id)
|
|
24
|
+
return doc;
|
|
25
|
+
}
|
|
26
|
+
throw Object.assign(new Error(`Lexicon ${id} not found`), {
|
|
27
|
+
code: 'ENOENT',
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
async *[Symbol.asyncIterator]() {
|
|
31
|
+
const returned = new Set();
|
|
32
|
+
for (const doc of this.#lexicons.values()) {
|
|
33
|
+
returned.add(doc.id);
|
|
34
|
+
yield doc;
|
|
35
|
+
}
|
|
36
|
+
do {
|
|
37
|
+
const { value, done } = await this.#iterator.next();
|
|
38
|
+
if (done)
|
|
39
|
+
break;
|
|
40
|
+
if (returned.has(value.id)) {
|
|
41
|
+
const err = new Error(`Duplicate lexicon document id: ${value.id}`);
|
|
42
|
+
this.#iterator.throw?.(err);
|
|
43
|
+
throw err; // In case iterator.throw does not exist or does not throw
|
|
44
|
+
}
|
|
45
|
+
this.#lexicons.set(value.id, value);
|
|
46
|
+
returned.add(value.id);
|
|
47
|
+
yield value;
|
|
48
|
+
} while (true);
|
|
49
|
+
// At this point, the underlying iterator is done. However, there may have
|
|
50
|
+
// been requests (.get()) for documents that caused the iterator to yield
|
|
51
|
+
// those documents during concurrent execution of this loop. If that was the
|
|
52
|
+
// case, new documents may have been added to `#lexicons` that have not yet
|
|
53
|
+
// been yielded. We need to yield those as well. Since we yield control back
|
|
54
|
+
// to the caller, we need to repeat this process until no new documents
|
|
55
|
+
// appear sunce we don't know what happens.
|
|
56
|
+
for (const doc of this.#lexicons.values()) {
|
|
57
|
+
if (!returned.has(doc.id)) {
|
|
58
|
+
returned.add(doc.id);
|
|
59
|
+
yield doc;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async [Symbol.asyncDispose]() {
|
|
64
|
+
await this.#iterator.return?.();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.LexiconIterableIndexer = LexiconIterableIndexer;
|
|
68
|
+
//# sourceMappingURL=lexicon-iterable-indexer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexicon-iterable-indexer.js","sourceRoot":"","sources":["../src/lexicon-iterable-indexer.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACH,MAAa,sBAAsB;IAOtB;IANF,SAAS,GAAiC,IAAI,GAAG,EAAE,CAAA;IACnD,SAAS,CAE0B;IAE5C,YACW,MAAkE;QAAlE,WAAM,GAAN,MAAM,CAA4D;QAE3E,IAAI,CAAC,SAAS;YACZ,MAAM,CAAC,aAAa,IAAI,MAAM;gBAC5B,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;gBAChC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAA;IACjC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACrC,IAAI,MAAM;YAAE,OAAO,MAAM,CAAA;QAEzB,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YAC7B,IAAI,GAAG,CAAC,EAAE,KAAK,EAAE;gBAAE,OAAO,GAAG,CAAA;QAC/B,CAAC;QAED,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,WAAW,EAAE,YAAY,CAAC,EAAE;YACxD,IAAI,EAAE,QAAQ;SACf,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC;QAK3B,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAU,CAAA;QAElC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,CAAC;YAC1C,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;YACpB,MAAM,GAAG,C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.js'\n\n/**\n * (Lazily) indexes lexicon documents from an iterable source.\n */\nexport class LexiconIterableIndexer implements LexiconIndexer, AsyncDisposable {\n readonly #lexicons: Map<string, LexiconDocument> = new Map()\n readonly #iterator:\n | AsyncIterator<LexiconDocument, void, unknown>\n | Iterator<LexiconDocument, void, unknown>\n\n constructor(\n readonly source: AsyncIterable<LexiconDocument> | Iterable<LexiconDocument>,\n ) {\n this.#iterator =\n Symbol.asyncIterator in source\n ? source[Symbol.asyncIterator]()\n : source[Symbol.iterator]()\n }\n\n async get(id: string): Promise<LexiconDocument> {\n const cached = this.#lexicons.get(id)\n if (cached) return cached\n\n for await (const doc of this) {\n if (doc.id === id) return doc\n }\n\n throw Object.assign(new Error(`Lexicon ${id} not found`), {\n code: 'ENOENT',\n })\n }\n\n async *[Symbol.asyncIterator](): AsyncIterator<\n LexiconDocument,\n void,\n undefined\n > {\n const returned = new Set<string>()\n\n for (const doc of this.#lexicons.values()) {\n returned.add(doc.id)\n yield doc\n }\n\n do {\n const { value, done } = await this.#iterator.next()\n\n if (done) break\n\n if (returned.has(value.id)) {\n const err = new Error(`Duplicate lexicon document id: ${value.id}`)\n this.#iterator.throw?.(err)\n throw err // In case iterator.throw does not exist or does not throw\n }\n\n this.#lexicons.set(value.id, value)\n returned.add(value.id)\n yield value\n } while (true)\n\n // At this point, the underlying iterator is done. However, there may have\n // been requests (.get()) for documents that caused the iterator to yield\n // those documents during concurrent execution of this loop. If that was the\n // case, new documents may have been added to `#lexicons` that have not yet\n // been yielded. We need to yield those as well. Since we yield control back\n // to the caller, we need to repeat this process until no new documents\n // appear sunce we don't know what happens.\n\n for (const doc of this.#lexicons.values()) {\n if (!returned.has(doc.id)) {\n returned.add(doc.id)\n yield doc\n }\n }\n }\n\n async [Symbol.asyncDispose](): Promise<void> {\n await this.#iterator.return?.()\n }\n}\n"]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { l } from '@atproto/lex-schema';
|
|
2
|
+
import { LexiconArray, LexiconArrayItems, LexiconDocument, LexiconError, LexiconObject, LexiconParameters, LexiconPayload, LexiconRef, LexiconRefUnion } from './lexicon-document.js';
|
|
3
|
+
import { LexiconIndexer } from './lexicon-indexer.js';
|
|
4
|
+
/**
|
|
5
|
+
* Builds a validator for a given lexicon "ref" from a lexicon indexer.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
*
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { LexiconSchemaBuilder } from '@atproto/lex/doc'
|
|
11
|
+
* import { LexiconStreamIndexer } from '@atproto/lex/doc'
|
|
12
|
+
*
|
|
13
|
+
* const indexer = new LexiconStreamIndexer(lexiconDocs)
|
|
14
|
+
* const validator = await LexiconSchemaBuilder.build(indexer, 'com.example.foo#bar')
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare class LexiconSchemaBuilder {
|
|
18
|
+
#private;
|
|
19
|
+
protected indexer: LexiconIndexer;
|
|
20
|
+
static build(indexer: LexiconIndexer, fullRef: string): Promise<l.Validator<unknown>>;
|
|
21
|
+
static buildAll(indexer: LexiconIndexer): Promise<Map<string, l.Validator<unknown> | l.Query<any, any, any, any> | l.Subscription<any, any, any, any> | l.Procedure<any, any, any, any, any> | l.PermissionSet<any, any, any>>>;
|
|
22
|
+
constructor(indexer: LexiconIndexer);
|
|
23
|
+
done(): Promise<void>;
|
|
24
|
+
buildFullRef: (fullRef: string) => Promise<l.Validator<unknown> | l.PermissionSet<`${string}.${string}.${string}`, l.Permission<string, {
|
|
25
|
+
[x: string]: string | number | boolean | (string | number | boolean)[];
|
|
26
|
+
}>[], {
|
|
27
|
+
type: "permission-set";
|
|
28
|
+
permissions: {
|
|
29
|
+
[x: string]: string | number | boolean | (string | number | boolean)[];
|
|
30
|
+
type: "permission";
|
|
31
|
+
resource: string;
|
|
32
|
+
}[];
|
|
33
|
+
description?: string | undefined;
|
|
34
|
+
title?: string | undefined;
|
|
35
|
+
detail?: string | undefined;
|
|
36
|
+
"title:lang"?: Record<string, string> | undefined;
|
|
37
|
+
"detail:lang"?: Record<string, string> | undefined;
|
|
38
|
+
}> | l.Procedure<`${string}.${string}.${string}`, l.ParamsSchema<{}, l.ParamsSchemaOptions, {}>, l.Payload<string | undefined, l.Validator<any> | undefined>, l.Payload<string | undefined, l.Validator<any> | undefined>, string[]> | l.Query<`${string}.${string}.${string}`, l.ParamsSchema<{}, l.ParamsSchemaOptions, {}>, l.Payload<string | undefined, l.Validator<any> | undefined>, string[]> | l.Subscription<`${string}.${string}.${string}`, l.ParamsSchema<{}, l.ParamsSchemaOptions, {}>, l.RefSchema<unknown> | l.TypedUnionSchema<l.TypedRefSchema<any>[], boolean> | l.ObjectSchema<any, any, {
|
|
39
|
+
[x: string]: any;
|
|
40
|
+
} | {
|
|
41
|
+
[x: string]: any;
|
|
42
|
+
} | {
|
|
43
|
+
[x: string]: any;
|
|
44
|
+
} | {
|
|
45
|
+
[x: string]: any;
|
|
46
|
+
}> | undefined, string[]>>;
|
|
47
|
+
protected buildRefGetter(fullRef: string): () => l.Validator<unknown>;
|
|
48
|
+
protected buildTypedRefGetter(fullRef: string): () => l.TypedObjectSchema | l.RecordSchema;
|
|
49
|
+
protected compileDef(doc: LexiconDocument, hash: string): l.Validator<unknown> | l.PermissionSet<`${string}.${string}.${string}`, l.Permission<string, {
|
|
50
|
+
[x: string]: string | number | boolean | (string | number | boolean)[];
|
|
51
|
+
}>[], {
|
|
52
|
+
type: "permission-set";
|
|
53
|
+
permissions: {
|
|
54
|
+
[x: string]: string | number | boolean | (string | number | boolean)[];
|
|
55
|
+
type: "permission";
|
|
56
|
+
resource: string;
|
|
57
|
+
}[];
|
|
58
|
+
description?: string | undefined;
|
|
59
|
+
title?: string | undefined;
|
|
60
|
+
detail?: string | undefined;
|
|
61
|
+
"title:lang"?: Record<string, string> | undefined;
|
|
62
|
+
"detail:lang"?: Record<string, string> | undefined;
|
|
63
|
+
}> | l.Procedure<`${string}.${string}.${string}`, l.ParamsSchema<{}, l.ParamsSchemaOptions, {}>, l.Payload<string | undefined, l.Validator<any> | undefined>, l.Payload<string | undefined, l.Validator<any> | undefined>, string[]> | l.Query<`${string}.${string}.${string}`, l.ParamsSchema<{}, l.ParamsSchemaOptions, {}>, l.Payload<string | undefined, l.Validator<any> | undefined>, string[]> | l.Subscription<`${string}.${string}.${string}`, l.ParamsSchema<{}, l.ParamsSchemaOptions, {}>, l.RefSchema<unknown> | l.TypedUnionSchema<l.TypedRefSchema<any>[], boolean> | l.ObjectSchema<any, any, {
|
|
64
|
+
[x: string]: any;
|
|
65
|
+
} | {
|
|
66
|
+
[x: string]: any;
|
|
67
|
+
} | {
|
|
68
|
+
[x: string]: any;
|
|
69
|
+
} | {
|
|
70
|
+
[x: string]: any;
|
|
71
|
+
}> | undefined, string[]>;
|
|
72
|
+
protected compileLeaf(doc: LexiconDocument, def: LexiconArray | LexiconArrayItems): l.Validator<unknown>;
|
|
73
|
+
protected compileRef(doc: LexiconDocument, def: LexiconRef | LexiconRefUnion): l.RefSchema<unknown> | l.TypedUnionSchema<l.TypedRefSchema<any>[], boolean>;
|
|
74
|
+
protected compileObject(doc: LexiconDocument, def: LexiconObject): l.ObjectSchema;
|
|
75
|
+
protected compilePayload(doc: LexiconDocument, def: LexiconPayload | undefined): l.Payload;
|
|
76
|
+
protected compileErrors(_doc: LexiconDocument, errors?: readonly LexiconError[]): undefined | string[];
|
|
77
|
+
protected compilePayloadSchema(doc: LexiconDocument, def?: LexiconObject | LexiconRef | LexiconRefUnion): l.ObjectSchema<any, any, {
|
|
78
|
+
[x: string]: any;
|
|
79
|
+
} | {
|
|
80
|
+
[x: string]: any;
|
|
81
|
+
} | {
|
|
82
|
+
[x: string]: any;
|
|
83
|
+
} | {
|
|
84
|
+
[x: string]: any;
|
|
85
|
+
}> | l.RefSchema<unknown> | l.TypedUnionSchema<l.TypedRefSchema<any>[], boolean> | undefined;
|
|
86
|
+
protected compileParams(doc: LexiconDocument, def?: LexiconParameters): l.ParamsSchema<{}, l.ParamsSchemaOptions, {}>;
|
|
87
|
+
}
|
|
88
|
+
export declare function memoize<Fn extends (arg: string) => unknown>(fn: Fn): Fn;
|
|
89
|
+
//# sourceMappingURL=lexicon-schema-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexicon-schema-builder.d.ts","sourceRoot":"","sources":["../src/lexicon-schema-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AACvC,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,eAAe,EAChB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD;;;;;;;;;;;;GAYG;AACH,qBAAa,oBAAoB;;IA8CnB,SAAS,CAAC,OAAO,EAAE,cAAc;WA7ChC,KAAK,CAChB,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;WAanB,QAAQ,CAAC,OAAO,EAAE,cAAc;gBA6BvB,OAAO,EAAE,cAAc;IAEvC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,YAAY,YAA2B,MAAM;;;;;;;;;;;;;;;;;;;;;;+BAO3C;IAEF,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC;IAkBrE,SAAS,CAAC,mBAAmB,CAC3B,OAAO,EAAE,MAAM,GACd,MAAM,CAAC,CAAC,iBAAiB,GAAG,CAAC,CAAC,YAAY;IAqB7C,SAAS,CAAC,UAAU,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;IAqDvD,SAAS,CAAC,WAAW,CACnB,GAAG,EAAE,eAAe,EACpB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