@atproto/lex-schema 0.0.11 → 0.0.12
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 +19 -0
- package/dist/core/$type.d.ts +149 -0
- package/dist/core/$type.d.ts.map +1 -1
- package/dist/core/$type.js +44 -0
- package/dist/core/$type.js.map +1 -1
- package/dist/core/record-key.d.ts +44 -0
- package/dist/core/record-key.d.ts.map +1 -1
- package/dist/core/record-key.js +30 -0
- package/dist/core/record-key.js.map +1 -1
- package/dist/core/result.d.ts +85 -4
- package/dist/core/result.d.ts.map +1 -1
- package/dist/core/result.js +60 -4
- package/dist/core/result.js.map +1 -1
- package/dist/core/schema.d.ts +229 -2
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +197 -4
- package/dist/core/schema.js.map +1 -1
- package/dist/core/string-format.d.ts +244 -11
- package/dist/core/string-format.d.ts.map +1 -1
- package/dist/core/string-format.js +150 -0
- package/dist/core/string-format.js.map +1 -1
- package/dist/core/types.d.ts +90 -3
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/validation-error.d.ts +60 -0
- package/dist/core/validation-error.d.ts.map +1 -1
- package/dist/core/validation-error.js +60 -0
- package/dist/core/validation-error.js.map +1 -1
- package/dist/core/validation-issue.d.ts +61 -0
- package/dist/core/validation-issue.d.ts.map +1 -1
- package/dist/core/validation-issue.js +51 -0
- package/dist/core/validation-issue.js.map +1 -1
- package/dist/core/validator.d.ts +347 -10
- package/dist/core/validator.d.ts.map +1 -1
- package/dist/core/validator.js +184 -3
- package/dist/core/validator.js.map +1 -1
- package/dist/helpers.d.ts +9 -24
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js.map +1 -1
- package/dist/schema/array.d.ts +45 -0
- package/dist/schema/array.d.ts.map +1 -1
- package/dist/schema/array.js +14 -0
- package/dist/schema/array.js.map +1 -1
- package/dist/schema/blob.d.ts +46 -0
- package/dist/schema/blob.d.ts.map +1 -1
- package/dist/schema/blob.js +39 -0
- package/dist/schema/blob.js.map +1 -1
- package/dist/schema/boolean.d.ts +28 -0
- package/dist/schema/boolean.d.ts.map +1 -1
- package/dist/schema/boolean.js +28 -0
- package/dist/schema/boolean.js.map +1 -1
- package/dist/schema/bytes.d.ts +38 -0
- package/dist/schema/bytes.d.ts.map +1 -1
- package/dist/schema/bytes.js +32 -0
- package/dist/schema/bytes.js.map +1 -1
- package/dist/schema/cid.d.ts +38 -0
- package/dist/schema/cid.d.ts.map +1 -1
- package/dist/schema/cid.js +33 -0
- package/dist/schema/cid.js.map +1 -1
- package/dist/schema/custom.d.ts +66 -1
- package/dist/schema/custom.d.ts.map +1 -1
- package/dist/schema/custom.js +54 -0
- package/dist/schema/custom.js.map +1 -1
- package/dist/schema/dict.d.ts +44 -0
- package/dist/schema/dict.d.ts.map +1 -1
- package/dist/schema/dict.js +44 -0
- package/dist/schema/dict.js.map +1 -1
- package/dist/schema/discriminated-union.d.ts +58 -0
- package/dist/schema/discriminated-union.d.ts.map +1 -1
- package/dist/schema/discriminated-union.js +45 -0
- package/dist/schema/discriminated-union.js.map +1 -1
- package/dist/schema/enum.d.ts +48 -0
- package/dist/schema/enum.d.ts.map +1 -1
- package/dist/schema/enum.js +48 -0
- package/dist/schema/enum.js.map +1 -1
- package/dist/schema/integer.d.ts +42 -0
- package/dist/schema/integer.d.ts.map +1 -1
- package/dist/schema/integer.js +36 -0
- package/dist/schema/integer.js.map +1 -1
- package/dist/schema/intersection.d.ts +54 -0
- package/dist/schema/intersection.d.ts.map +1 -1
- package/dist/schema/intersection.js +49 -0
- package/dist/schema/intersection.js.map +1 -1
- package/dist/schema/literal.d.ts +44 -0
- package/dist/schema/literal.d.ts.map +1 -1
- package/dist/schema/literal.js +44 -0
- package/dist/schema/literal.js.map +1 -1
- package/dist/schema/never.d.ts +42 -0
- package/dist/schema/never.d.ts.map +1 -1
- package/dist/schema/never.js +42 -0
- package/dist/schema/never.js.map +1 -1
- package/dist/schema/null.d.ts +29 -0
- package/dist/schema/null.d.ts.map +1 -1
- package/dist/schema/null.js +29 -0
- package/dist/schema/null.js.map +1 -1
- package/dist/schema/nullable.d.ts +41 -0
- package/dist/schema/nullable.d.ts.map +1 -1
- package/dist/schema/nullable.js +41 -0
- package/dist/schema/nullable.js.map +1 -1
- package/dist/schema/object.d.ts +56 -0
- package/dist/schema/object.d.ts.map +1 -1
- package/dist/schema/object.js +51 -0
- package/dist/schema/object.js.map +1 -1
- package/dist/schema/optional.d.ts +42 -0
- package/dist/schema/optional.d.ts.map +1 -1
- package/dist/schema/optional.js +42 -0
- package/dist/schema/optional.js.map +1 -1
- package/dist/schema/params.d.ts +90 -10
- package/dist/schema/params.d.ts.map +1 -1
- package/dist/schema/params.js +84 -10
- package/dist/schema/params.js.map +1 -1
- package/dist/schema/payload.d.ts +111 -15
- package/dist/schema/payload.d.ts.map +1 -1
- package/dist/schema/payload.js +70 -0
- package/dist/schema/payload.js.map +1 -1
- package/dist/schema/permission-set.d.ts +58 -0
- package/dist/schema/permission-set.d.ts.map +1 -1
- package/dist/schema/permission-set.js +50 -0
- package/dist/schema/permission-set.js.map +1 -1
- package/dist/schema/permission.d.ts +42 -0
- package/dist/schema/permission.d.ts.map +1 -1
- package/dist/schema/permission.js +39 -0
- package/dist/schema/permission.js.map +1 -1
- package/dist/schema/procedure.d.ts +64 -0
- package/dist/schema/procedure.d.ts.map +1 -1
- package/dist/schema/procedure.js +64 -0
- package/dist/schema/procedure.js.map +1 -1
- package/dist/schema/query.d.ts +55 -0
- package/dist/schema/query.d.ts.map +1 -1
- package/dist/schema/query.js +55 -0
- package/dist/schema/query.js.map +1 -1
- package/dist/schema/record.d.ts +63 -8
- package/dist/schema/record.d.ts.map +1 -1
- package/dist/schema/record.js +20 -0
- package/dist/schema/record.js.map +1 -1
- package/dist/schema/ref.d.ts +50 -0
- package/dist/schema/ref.d.ts.map +1 -1
- package/dist/schema/ref.js +17 -0
- package/dist/schema/ref.js.map +1 -1
- package/dist/schema/refine.d.ts +58 -9
- package/dist/schema/refine.d.ts.map +1 -1
- package/dist/schema/refine.js.map +1 -1
- package/dist/schema/regexp.d.ts +44 -0
- package/dist/schema/regexp.d.ts.map +1 -1
- package/dist/schema/regexp.js +44 -0
- package/dist/schema/regexp.js.map +1 -1
- package/dist/schema/string.d.ts +50 -0
- package/dist/schema/string.d.ts.map +1 -1
- package/dist/schema/string.js +41 -0
- package/dist/schema/string.js.map +1 -1
- package/dist/schema/subscription.d.ts +72 -2
- package/dist/schema/subscription.d.ts.map +1 -1
- package/dist/schema/subscription.js +59 -0
- package/dist/schema/subscription.js.map +1 -1
- package/dist/schema/token.d.ts +47 -0
- package/dist/schema/token.d.ts.map +1 -1
- package/dist/schema/token.js +47 -0
- package/dist/schema/token.js.map +1 -1
- package/dist/schema/typed-object.d.ts +62 -8
- package/dist/schema/typed-object.d.ts.map +1 -1
- package/dist/schema/typed-object.js +18 -0
- package/dist/schema/typed-object.js.map +1 -1
- package/dist/schema/typed-ref.d.ts +53 -0
- package/dist/schema/typed-ref.d.ts.map +1 -1
- package/dist/schema/typed-ref.js +15 -0
- package/dist/schema/typed-ref.js.map +1 -1
- package/dist/schema/typed-union.d.ts +50 -1
- package/dist/schema/typed-union.d.ts.map +1 -1
- package/dist/schema/typed-union.js +50 -1
- package/dist/schema/typed-union.js.map +1 -1
- package/dist/schema/union.d.ts +45 -0
- package/dist/schema/union.d.ts.map +1 -1
- package/dist/schema/union.js +40 -0
- package/dist/schema/union.js.map +1 -1
- package/dist/schema/unknown-object.d.ts +34 -0
- package/dist/schema/unknown-object.d.ts.map +1 -1
- package/dist/schema/unknown-object.js +31 -0
- package/dist/schema/unknown-object.js.map +1 -1
- package/dist/schema/unknown.d.ts +33 -0
- package/dist/schema/unknown.d.ts.map +1 -1
- package/dist/schema/unknown.js +33 -0
- package/dist/schema/unknown.js.map +1 -1
- package/dist/schema/with-default.d.ts +44 -0
- package/dist/schema/with-default.d.ts.map +1 -1
- package/dist/schema/with-default.js +44 -0
- package/dist/schema/with-default.js.map +1 -1
- package/package.json +3 -3
- package/src/core/$type.ts +150 -18
- package/src/core/record-key.ts +44 -0
- package/src/core/result.ts +86 -4
- package/src/core/schema.ts +236 -7
- package/src/core/string-format.ts +259 -13
- package/src/core/types.ts +91 -3
- package/src/core/validation-error.ts +60 -0
- package/src/core/validation-issue.ts +65 -0
- package/src/core/validator.ts +351 -10
- package/src/helpers.test.ts +110 -29
- package/src/helpers.ts +9 -14
- package/src/schema/array.test.ts +94 -79
- package/src/schema/array.ts +45 -0
- package/src/schema/blob.ts +46 -0
- package/src/schema/boolean.ts +28 -0
- package/src/schema/bytes.ts +38 -0
- package/src/schema/cid.ts +38 -0
- package/src/schema/custom.ts +66 -1
- package/src/schema/dict.ts +44 -0
- package/src/schema/discriminated-union.ts +58 -0
- package/src/schema/enum.ts +48 -0
- package/src/schema/integer.ts +42 -0
- package/src/schema/intersection.ts +54 -0
- package/src/schema/literal.ts +44 -0
- package/src/schema/never.ts +42 -0
- package/src/schema/null.ts +29 -0
- package/src/schema/nullable.ts +41 -0
- package/src/schema/object.ts +56 -0
- package/src/schema/optional.ts +42 -0
- package/src/schema/params.test.ts +58 -2
- package/src/schema/params.ts +125 -19
- package/src/schema/payload.test.ts +3 -3
- package/src/schema/payload.ts +142 -38
- package/src/schema/permission-set.ts +58 -0
- package/src/schema/permission.ts +42 -0
- package/src/schema/procedure.ts +64 -0
- package/src/schema/query.ts +55 -0
- package/src/schema/record.ts +63 -8
- package/src/schema/ref.ts +50 -0
- package/src/schema/refine.ts +58 -9
- package/src/schema/regexp.ts +44 -0
- package/src/schema/string.ts +50 -0
- package/src/schema/subscription.ts +72 -2
- package/src/schema/token.ts +47 -0
- package/src/schema/typed-object.ts +62 -8
- package/src/schema/typed-ref.ts +53 -0
- package/src/schema/typed-union.ts +55 -2
- package/src/schema/union.ts +45 -0
- package/src/schema/unknown-object.ts +34 -0
- package/src/schema/unknown.ts +33 -0
- package/src/schema/with-default.ts +44 -0
package/dist/schema/payload.d.ts
CHANGED
|
@@ -1,24 +1,120 @@
|
|
|
1
1
|
import { LexValue } from '@atproto/lex-data';
|
|
2
|
-
import { Infer, Schema } from '../core.js';
|
|
3
|
-
import { ObjectSchema
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { Infer, Schema, Validator } from '../core.js';
|
|
3
|
+
import { ObjectSchema } from './object.js';
|
|
4
|
+
export type { LexValue };
|
|
5
|
+
type ToBodyMime<TEncoding extends string> = TEncoding extends '*/*' ? `${string}/${string}` : TEncoding extends `${infer T extends string}/*` ? `${T}/${string}` : TEncoding;
|
|
6
|
+
type ToBodyType<TEncoding extends string, TSchema, TBinary> = TSchema extends Schema ? Infer<TSchema> : TEncoding extends `application/json` ? LexValue : TBinary;
|
|
7
|
+
/**
|
|
8
|
+
* Infers the type of a Payload's encoding and body.
|
|
9
|
+
*
|
|
10
|
+
* @template TPayload - The Payload type
|
|
11
|
+
* @template TBody - Fallback body type for non-JSON encodings
|
|
12
|
+
*/
|
|
13
|
+
export type InferPayload<TPayload extends Payload, TBinary> = TPayload extends Payload<infer TEncoding, infer TSchema> ? TEncoding extends string ? {
|
|
14
|
+
encoding: ToBodyMime<TEncoding>;
|
|
15
|
+
body: ToBodyType<TEncoding, TSchema, TBinary>;
|
|
16
|
+
} : undefined : never;
|
|
17
|
+
/**
|
|
18
|
+
* Converts schema encoding patterns to data encoding types.
|
|
19
|
+
*
|
|
20
|
+
* Handles wildcards like '*\/*' and 'image/*' in MIME types.
|
|
21
|
+
*
|
|
22
|
+
* @template TPayload - The Payload type
|
|
23
|
+
*/
|
|
24
|
+
export type InferPayloadEncoding<TPayload extends Payload> = TPayload extends Payload<infer TEncoding, any> ? TEncoding extends string ? ToBodyMime<TEncoding> : undefined : never;
|
|
25
|
+
/**
|
|
26
|
+
* Infers the body type from a Payload and fallback type.
|
|
27
|
+
*
|
|
28
|
+
* @template TPayload - The Payload type
|
|
29
|
+
* @template TBody - Fallback body type for non-JSON encodings without schema
|
|
30
|
+
*/
|
|
31
|
+
export type InferPayloadBody<TPayload extends Payload, TBinary> = TPayload extends Payload<infer TEncoding, infer TSchema> ? TEncoding extends string ? ToBodyType<TEncoding, TSchema, TBinary> : undefined : never;
|
|
32
|
+
/**
|
|
33
|
+
* Determines valid schema type based on encoding presence.
|
|
34
|
+
*
|
|
35
|
+
* @template E - The encoding string type, or undefined
|
|
36
|
+
*/
|
|
37
|
+
export type PayloadSchema<E extends string | undefined> = E extends undefined ? undefined : Schema<LexValue> | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Represents a payload definition for Lexicon endpoints.
|
|
40
|
+
*
|
|
41
|
+
* Payloads define the body format for HTTP requests and responses.
|
|
42
|
+
* They consist of an encoding (MIME type) and an optional schema
|
|
43
|
+
* for validating the body content.
|
|
44
|
+
*
|
|
45
|
+
* @template TEncoding - The MIME type string, or undefined for no body
|
|
46
|
+
* @template TPayload - The schema type for body validation
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const jsonPayload = new Payload('application/json', l.object({ data: l.string() }))
|
|
51
|
+
* const binaryPayload = new Payload('image/*', undefined)
|
|
52
|
+
* const noPayload = new Payload(undefined, undefined)
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare class Payload<const TEncoding extends string | undefined = string | undefined, const TSchema extends PayloadSchema<TEncoding> = PayloadSchema<TEncoding>> {
|
|
13
56
|
readonly encoding: TEncoding;
|
|
14
|
-
readonly schema:
|
|
15
|
-
constructor(encoding: TEncoding, schema:
|
|
57
|
+
readonly schema: TSchema;
|
|
58
|
+
constructor(encoding: TEncoding, schema: TSchema);
|
|
16
59
|
/**
|
|
17
60
|
* Checks whether the given content-type matches the expected payload schema's
|
|
18
61
|
* encoding.
|
|
19
62
|
*/
|
|
20
63
|
matchesEncoding(contentType: string | undefined): boolean;
|
|
21
64
|
}
|
|
22
|
-
|
|
23
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Creates a payload definition for Lexicon endpoint bodies.
|
|
67
|
+
*
|
|
68
|
+
* Defines the expected MIME type and optional validation schema for
|
|
69
|
+
* request or response bodies.
|
|
70
|
+
*
|
|
71
|
+
* @param encoding - MIME type string (e.g., 'application/json', 'image/*'), or undefined for no body
|
|
72
|
+
* @param validator - Optional schema for validating the body content. Must be undefined if encoding is undefined.
|
|
73
|
+
* @returns A new {@link Payload} instance
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* // JSON payload with schema
|
|
78
|
+
* const output = l.payload('application/json', l.object({
|
|
79
|
+
* posts: l.array(postSchema),
|
|
80
|
+
* cursor: l.optional(l.string()),
|
|
81
|
+
* }))
|
|
82
|
+
*
|
|
83
|
+
* // Binary payload (no schema validation)
|
|
84
|
+
* const blobInput = l.payload('*\/*', undefined)
|
|
85
|
+
*
|
|
86
|
+
* // Image payload with wildcard
|
|
87
|
+
* const imageInput = l.payload('image/*', undefined)
|
|
88
|
+
*
|
|
89
|
+
* // No payload (for endpoints without body)
|
|
90
|
+
* const noBody = l.payload()
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare function payload<const E extends string | undefined = undefined, const S extends PayloadSchema<E> = undefined>(encoding?: E, validator?: S): Payload<E, S>;
|
|
94
|
+
/**
|
|
95
|
+
* Creates a JSON payload with an object schema.
|
|
96
|
+
*
|
|
97
|
+
* Convenience function for the common case of JSON request/response bodies.
|
|
98
|
+
* Equivalent to `l.payload('application/json', l.object(properties))`.
|
|
99
|
+
*
|
|
100
|
+
* @param properties - Object mapping property names to validators
|
|
101
|
+
* @returns A new {@link Payload} instance with 'application/json' encoding
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* // Query output
|
|
106
|
+
* const profileOutput = l.jsonPayload({
|
|
107
|
+
* did: l.string({ format: 'did' }),
|
|
108
|
+
* handle: l.string({ format: 'handle' }),
|
|
109
|
+
* displayName: l.optional(l.string()),
|
|
110
|
+
* })
|
|
111
|
+
*
|
|
112
|
+
* // Procedure input
|
|
113
|
+
* const createPostInput = l.jsonPayload({
|
|
114
|
+
* text: l.string({ maxGraphemes: 300 }),
|
|
115
|
+
* createdAt: l.string({ format: 'datetime' }),
|
|
116
|
+
* })
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
export declare function jsonPayload<P extends Record<string, Validator<undefined | LexValue>>>(properties: P): Payload<'application/json', ObjectSchema<P>>;
|
|
24
120
|
//# sourceMappingURL=payload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/schema/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/schema/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,EAAE,YAAY,EAAU,MAAM,aAAa,CAAA;AAElD,YAAY,EAAE,QAAQ,EAAE,CAAA;AAExB,KAAK,UAAU,CAAC,SAAS,SAAS,MAAM,IAAI,SAAS,SAAS,KAAK,GAC/D,GAAG,MAAM,IAAI,MAAM,EAAE,GACrB,SAAS,SAAS,GAAG,MAAM,CAAC,SAAS,MAAM,IAAI,GAC7C,GAAG,CAAC,IAAI,MAAM,EAAE,GAChB,SAAS,CAAA;AAEf,KAAK,UAAU,CACb,SAAS,SAAS,MAAM,EACxB,OAAO,EACP,OAAO,IACL,OAAO,SAAS,MAAM,GACtB,KAAK,CAAC,OAAO,CAAC,GACd,SAAS,SAAS,kBAAkB,GAClC,QAAQ,GACR,OAAO,CAAA;AAEb;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,QAAQ,SAAS,OAAO,EAAE,OAAO,IACxD,QAAQ,SAAS,OAAO,CAAC,MAAM,SAAS,EAAE,MAAM,OAAO,CAAC,GACpD,SAAS,SAAS,MAAM,GACtB;IACE,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;IAC/B,IAAI,EAAE,UAAU,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;CAC9C,GACD,SAAS,GACX,KAAK,CAAA;AAEX;;;;;;GAMG;AACH,MAAM,MAAM,oBAAoB,CAAC,QAAQ,SAAS,OAAO,IACvD,QAAQ,SAAS,OAAO,CAAC,MAAM,SAAS,EAAE,GAAG,CAAC,GAC1C,SAAS,SAAS,MAAM,GACtB,UAAU,CAAC,SAAS,CAAC,GACrB,SAAS,GACX,KAAK,CAAA;AAEX;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,CAAC,QAAQ,SAAS,OAAO,EAAE,OAAO,IAC5D,QAAQ,SAAS,OAAO,CAAC,MAAM,SAAS,EAAE,MAAM,OAAO,CAAC,GACpD,SAAS,SAAS,MAAM,GACtB,UAAU,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,GACvC,SAAS,GACX,KAAK,CAAA;AAEX;;;;GAIG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,SAAS,IAAI,CAAC,SAAS,SAAS,GACzE,SAAS,GACT,MAAM,CAAC,QAAQ,CAAC,GAAG,SAAS,CAAA;AAEhC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,OAAO,CAClB,KAAK,CAAC,SAAS,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,EAC/D,KAAK,CAAC,OAAO,SAAS,aAAa,CAAC,SAAS,CAAC,GAAG,aAAa,CAAC,SAAS,CAAC;IAGvE,QAAQ,CAAC,QAAQ,EAAE,SAAS;IAC5B,QAAQ,CAAC,MAAM,EAAE,OAAO;gBADf,QAAQ,EAAE,SAAS,EACnB,MAAM,EAAE,OAAO;IAO1B;;;OAGG;IACH,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO;CA6B1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,wBAAgB,OAAO,CACrB,KAAK,CAAC,CAAC,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EAC9C,KAAK,CAAC,CAAC,SAAS,aAAa,CAAC,CAAC,CAAC,GAAG,SAAS,EAC5C,QAAQ,GAAE,CAAkB,EAAE,SAAS,GAAE,CAAkB,iBAE5D;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,wBAAgB,WAAW,CACzB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,SAAS,GAAG,QAAQ,CAAC,CAAC,EACzD,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAE7D"}
|
package/dist/schema/payload.js
CHANGED
|
@@ -4,6 +4,23 @@ exports.Payload = void 0;
|
|
|
4
4
|
exports.payload = payload;
|
|
5
5
|
exports.jsonPayload = jsonPayload;
|
|
6
6
|
const object_js_1 = require("./object.js");
|
|
7
|
+
/**
|
|
8
|
+
* Represents a payload definition for Lexicon endpoints.
|
|
9
|
+
*
|
|
10
|
+
* Payloads define the body format for HTTP requests and responses.
|
|
11
|
+
* They consist of an encoding (MIME type) and an optional schema
|
|
12
|
+
* for validating the body content.
|
|
13
|
+
*
|
|
14
|
+
* @template TEncoding - The MIME type string, or undefined for no body
|
|
15
|
+
* @template TPayload - The schema type for body validation
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const jsonPayload = new Payload('application/json', l.object({ data: l.string() }))
|
|
20
|
+
* const binaryPayload = new Payload('image/*', undefined)
|
|
21
|
+
* const noPayload = new Payload(undefined, undefined)
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
7
24
|
class Payload {
|
|
8
25
|
encoding;
|
|
9
26
|
schema;
|
|
@@ -44,10 +61,63 @@ class Payload {
|
|
|
44
61
|
}
|
|
45
62
|
}
|
|
46
63
|
exports.Payload = Payload;
|
|
64
|
+
/**
|
|
65
|
+
* Creates a payload definition for Lexicon endpoint bodies.
|
|
66
|
+
*
|
|
67
|
+
* Defines the expected MIME type and optional validation schema for
|
|
68
|
+
* request or response bodies.
|
|
69
|
+
*
|
|
70
|
+
* @param encoding - MIME type string (e.g., 'application/json', 'image/*'), or undefined for no body
|
|
71
|
+
* @param validator - Optional schema for validating the body content. Must be undefined if encoding is undefined.
|
|
72
|
+
* @returns A new {@link Payload} instance
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* // JSON payload with schema
|
|
77
|
+
* const output = l.payload('application/json', l.object({
|
|
78
|
+
* posts: l.array(postSchema),
|
|
79
|
+
* cursor: l.optional(l.string()),
|
|
80
|
+
* }))
|
|
81
|
+
*
|
|
82
|
+
* // Binary payload (no schema validation)
|
|
83
|
+
* const blobInput = l.payload('*\/*', undefined)
|
|
84
|
+
*
|
|
85
|
+
* // Image payload with wildcard
|
|
86
|
+
* const imageInput = l.payload('image/*', undefined)
|
|
87
|
+
*
|
|
88
|
+
* // No payload (for endpoints without body)
|
|
89
|
+
* const noBody = l.payload()
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
47
92
|
/*@__NO_SIDE_EFFECTS__*/
|
|
48
93
|
function payload(encoding = undefined, validator = undefined) {
|
|
49
94
|
return new Payload(encoding, validator);
|
|
50
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* Creates a JSON payload with an object schema.
|
|
98
|
+
*
|
|
99
|
+
* Convenience function for the common case of JSON request/response bodies.
|
|
100
|
+
* Equivalent to `l.payload('application/json', l.object(properties))`.
|
|
101
|
+
*
|
|
102
|
+
* @param properties - Object mapping property names to validators
|
|
103
|
+
* @returns A new {@link Payload} instance with 'application/json' encoding
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* // Query output
|
|
108
|
+
* const profileOutput = l.jsonPayload({
|
|
109
|
+
* did: l.string({ format: 'did' }),
|
|
110
|
+
* handle: l.string({ format: 'handle' }),
|
|
111
|
+
* displayName: l.optional(l.string()),
|
|
112
|
+
* })
|
|
113
|
+
*
|
|
114
|
+
* // Procedure input
|
|
115
|
+
* const createPostInput = l.jsonPayload({
|
|
116
|
+
* text: l.string({ maxGraphemes: 300 }),
|
|
117
|
+
* createdAt: l.string({ format: 'datetime' }),
|
|
118
|
+
* })
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
51
121
|
/*@__NO_SIDE_EFFECTS__*/
|
|
52
122
|
function jsonPayload(properties) {
|
|
53
123
|
return payload('application/json', (0, object_js_1.object)(properties));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../src/schema/payload.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"payload.js","sourceRoot":"","sources":["../../src/schema/payload.ts"],"names":[],"mappings":";;;AAwKA,0BAKC;AA4BD,kCAIC;AA3MD,2CAAkD;AAwElD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,OAAO;IAKP;IACA;IAFX,YACW,QAAmB,EACnB,MAAe;QADf,aAAQ,GAAR,QAAQ,CAAW;QACnB,WAAM,GAAN,MAAM,CAAS;QAExB,IAAI,QAAQ,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACnD,MAAM,IAAI,SAAS,CAAC,qDAAqD,CAAC,CAAA;QAC5E,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,eAAe,CAAC,WAA+B;QAC7C,MAAM,IAAI,GAAG,WAAW,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QAEjD,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAA;QAEzB,yBAAyB;QACzB,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,oBAAoB;YACpB,OAAO,IAAI,KAAK,SAAS,CAAA;QAC3B,CAAC;aAAM,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YAC9B,4CAA4C;YAC5C,OAAO,KAAK,CAAA;QACd,CAAC;QAED,IAAI,QAAQ,KAAK,KAAK,EAAE,CAAC;YACvB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;QAC/C,CAAC;QAED,gEAAgE;QAChE,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3B,OAAO,KAAK,CAAA;QACd,CAAC;QAED,OAAO,QAAQ,KAAK,IAAI,CAAA;IAC1B,CAAC;CACF;AA9CD,0BA8CC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAwB;AACxB,SAAgB,OAAO,CAGrB,WAAc,SAAc,EAAE,YAAe,SAAc;IAC3D,OAAO,IAAI,OAAO,CAAO,QAAQ,EAAE,SAAS,CAAC,CAAA;AAC/C,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAwB;AACxB,SAAgB,WAAW,CAEzB,UAAa;IACb,OAAO,OAAO,CAAC,kBAAkB,EAAE,IAAA,kBAAM,EAAC,UAAU,CAAC,CAAC,CAAA;AACxD,CAAC","sourcesContent":["import { LexValue } from '@atproto/lex-data'\nimport { Infer, Schema, Validator } from '../core.js'\nimport { ObjectSchema, object } from './object.js'\n\nexport type { LexValue }\n\ntype ToBodyMime<TEncoding extends string> = TEncoding extends '*/*'\n ? `${string}/${string}`\n : TEncoding extends `${infer T extends string}/*`\n ? `${T}/${string}`\n : TEncoding\n\ntype ToBodyType<\n TEncoding extends string,\n TSchema,\n TBinary,\n> = TSchema extends Schema\n ? Infer<TSchema>\n : TEncoding extends `application/json`\n ? LexValue\n : TBinary\n\n/**\n * Infers the type of a Payload's encoding and body.\n *\n * @template TPayload - The Payload type\n * @template TBody - Fallback body type for non-JSON encodings\n */\nexport type InferPayload<TPayload extends Payload, TBinary> =\n TPayload extends Payload<infer TEncoding, infer TSchema>\n ? TEncoding extends string\n ? {\n encoding: ToBodyMime<TEncoding>\n body: ToBodyType<TEncoding, TSchema, TBinary>\n }\n : undefined\n : never\n\n/**\n * Converts schema encoding patterns to data encoding types.\n *\n * Handles wildcards like '*\\/*' and 'image/*' in MIME types.\n *\n * @template TPayload - The Payload type\n */\nexport type InferPayloadEncoding<TPayload extends Payload> =\n TPayload extends Payload<infer TEncoding, any>\n ? TEncoding extends string\n ? ToBodyMime<TEncoding>\n : undefined\n : never\n\n/**\n * Infers the body type from a Payload and fallback type.\n *\n * @template TPayload - The Payload type\n * @template TBody - Fallback body type for non-JSON encodings without schema\n */\nexport type InferPayloadBody<TPayload extends Payload, TBinary> =\n TPayload extends Payload<infer TEncoding, infer TSchema>\n ? TEncoding extends string\n ? ToBodyType<TEncoding, TSchema, TBinary>\n : undefined\n : never\n\n/**\n * Determines valid schema type based on encoding presence.\n *\n * @template E - The encoding string type, or undefined\n */\nexport type PayloadSchema<E extends string | undefined> = E extends undefined\n ? undefined\n : Schema<LexValue> | undefined\n\n/**\n * Represents a payload definition for Lexicon endpoints.\n *\n * Payloads define the body format for HTTP requests and responses.\n * They consist of an encoding (MIME type) and an optional schema\n * for validating the body content.\n *\n * @template TEncoding - The MIME type string, or undefined for no body\n * @template TPayload - The schema type for body validation\n *\n * @example\n * ```ts\n * const jsonPayload = new Payload('application/json', l.object({ data: l.string() }))\n * const binaryPayload = new Payload('image/*', undefined)\n * const noPayload = new Payload(undefined, undefined)\n * ```\n */\nexport class Payload<\n const TEncoding extends string | undefined = string | undefined,\n const TSchema extends PayloadSchema<TEncoding> = PayloadSchema<TEncoding>,\n> {\n constructor(\n readonly encoding: TEncoding,\n readonly schema: TSchema,\n ) {\n if (encoding === undefined && schema !== undefined) {\n throw new TypeError('schema cannot be defined when encoding is undefined')\n }\n }\n\n /**\n * Checks whether the given content-type matches the expected payload schema's\n * encoding.\n */\n matchesEncoding(contentType: string | undefined): boolean {\n const mime = contentType?.split(';', 1)[0].trim()\n\n const { encoding } = this\n\n // Handle undefined cases\n if (encoding === undefined) {\n // Expecting no body\n return mime === undefined\n } else if (mime === undefined) {\n // Expecting a body, but got no content-type\n return false\n }\n\n if (encoding === '*/*') {\n return true\n }\n\n if (encoding.endsWith('/*')) {\n return mime.startsWith(encoding.slice(0, -1))\n }\n\n // Invalid: Lexicon can only specify \"*/*\" or \"type/*\" wildcards\n if (encoding.includes('*')) {\n return false\n }\n\n return encoding === mime\n }\n}\n\n/**\n * Creates a payload definition for Lexicon endpoint bodies.\n *\n * Defines the expected MIME type and optional validation schema for\n * request or response bodies.\n *\n * @param encoding - MIME type string (e.g., 'application/json', 'image/*'), or undefined for no body\n * @param validator - Optional schema for validating the body content. Must be undefined if encoding is undefined.\n * @returns A new {@link Payload} instance\n *\n * @example\n * ```ts\n * // JSON payload with schema\n * const output = l.payload('application/json', l.object({\n * posts: l.array(postSchema),\n * cursor: l.optional(l.string()),\n * }))\n *\n * // Binary payload (no schema validation)\n * const blobInput = l.payload('*\\/*', undefined)\n *\n * // Image payload with wildcard\n * const imageInput = l.payload('image/*', undefined)\n *\n * // No payload (for endpoints without body)\n * const noBody = l.payload()\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function payload<\n const E extends string | undefined = undefined,\n const S extends PayloadSchema<E> = undefined,\n>(encoding: E = undefined as E, validator: S = undefined as S) {\n return new Payload<E, S>(encoding, validator)\n}\n\n/**\n * Creates a JSON payload with an object schema.\n *\n * Convenience function for the common case of JSON request/response bodies.\n * Equivalent to `l.payload('application/json', l.object(properties))`.\n *\n * @param properties - Object mapping property names to validators\n * @returns A new {@link Payload} instance with 'application/json' encoding\n *\n * @example\n * ```ts\n * // Query output\n * const profileOutput = l.jsonPayload({\n * did: l.string({ format: 'did' }),\n * handle: l.string({ format: 'handle' }),\n * displayName: l.optional(l.string()),\n * })\n *\n * // Procedure input\n * const createPostInput = l.jsonPayload({\n * text: l.string({ maxGraphemes: 300 }),\n * createdAt: l.string({ format: 'datetime' }),\n * })\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function jsonPayload<\n P extends Record<string, Validator<undefined | LexValue>>,\n>(properties: P): Payload<'application/json', ObjectSchema<P>> {\n return payload('application/json', object(properties))\n}\n"]}
|
|
@@ -1,16 +1,74 @@
|
|
|
1
1
|
import { NsidString } from '../core.js';
|
|
2
2
|
import { Permission } from './permission.js';
|
|
3
|
+
/**
|
|
4
|
+
* Configuration options for a permission set.
|
|
5
|
+
*
|
|
6
|
+
* @property title - Human-readable title for the permission set
|
|
7
|
+
* @property title:lang - Localized titles by language code
|
|
8
|
+
* @property detail - Detailed description of the permission set
|
|
9
|
+
* @property detail:lang - Localized descriptions by language code
|
|
10
|
+
*/
|
|
3
11
|
export type PermissionSetOptions = {
|
|
4
12
|
title?: string;
|
|
5
13
|
'title:lang'?: Record<string, undefined | string>;
|
|
6
14
|
detail?: string;
|
|
7
15
|
'detail:lang'?: Record<string, undefined | string>;
|
|
8
16
|
};
|
|
17
|
+
/**
|
|
18
|
+
* Represents a collection of related permissions in AT Protocol.
|
|
19
|
+
*
|
|
20
|
+
* Permission sets group permissions together with metadata for OAuth
|
|
21
|
+
* authorization flows. They are identified by an NSID.
|
|
22
|
+
*
|
|
23
|
+
* @template TNsid - The NSID identifying this permission set
|
|
24
|
+
* @template TPermissions - Tuple type of the included permissions
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const feedAccess = new PermissionSet(
|
|
29
|
+
* 'app.bsky.feed.access',
|
|
30
|
+
* [readPermission, writePermission],
|
|
31
|
+
* { title: 'Feed Access', detail: 'Read and write to your feed' }
|
|
32
|
+
* )
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
9
35
|
export declare class PermissionSet<const TNsid extends NsidString = any, const TPermissions extends readonly Permission[] = any> {
|
|
10
36
|
readonly nsid: TNsid;
|
|
11
37
|
readonly permissions: TPermissions;
|
|
12
38
|
readonly options: PermissionSetOptions;
|
|
13
39
|
constructor(nsid: TNsid, permissions: TPermissions, options?: PermissionSetOptions);
|
|
14
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Creates a permission set grouping related permissions.
|
|
43
|
+
*
|
|
44
|
+
* Permission sets define OAuth scopes that applications can request.
|
|
45
|
+
* They include human-readable metadata for authorization UIs.
|
|
46
|
+
*
|
|
47
|
+
* @param nsid - The NSID identifying this permission set
|
|
48
|
+
* @param permissions - Array of permissions included in this set
|
|
49
|
+
* @param options - Optional metadata (title, detail, localization)
|
|
50
|
+
* @returns A new {@link PermissionSet} instance
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* // Define individual permissions
|
|
55
|
+
* const readPosts = l.permission('read', { collection: 'app.bsky.feed.post' })
|
|
56
|
+
* const writePosts = l.permission('write', { collection: 'app.bsky.feed.post' })
|
|
57
|
+
*
|
|
58
|
+
* // Group into a permission set
|
|
59
|
+
* const postManagement = l.permissionSet(
|
|
60
|
+
* 'app.bsky.feed.postManagement',
|
|
61
|
+
* [readPosts, writePosts],
|
|
62
|
+
* {
|
|
63
|
+
* title: 'Post Management',
|
|
64
|
+
* detail: 'View and create posts on your behalf',
|
|
65
|
+
* 'title:lang': {
|
|
66
|
+
* 'es': 'Gestion de publicaciones',
|
|
67
|
+
* 'fr': 'Gestion des publications',
|
|
68
|
+
* },
|
|
69
|
+
* }
|
|
70
|
+
* )
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
15
73
|
export declare function permissionSet<const N extends NsidString, const P extends readonly Permission[]>(nsid: N, permissions: P, options?: PermissionSetOptions): PermissionSet<N, P>;
|
|
16
74
|
//# sourceMappingURL=permission-set.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission-set.d.ts","sourceRoot":"","sources":["../../src/schema/permission-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,CAAA;IACjD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,CAAA;CACnD,CAAA;AAED,qBAAa,aAAa,CACxB,KAAK,CAAC,KAAK,SAAS,UAAU,GAAG,GAAG,EACpC,KAAK,CAAC,YAAY,SAAS,SAAS,UAAU,EAAE,GAAG,GAAG;IAGpD,QAAQ,CAAC,IAAI,EAAE,KAAK;IACpB,QAAQ,CAAC,WAAW,EAAE,YAAY;IAClC,QAAQ,CAAC,OAAO,EAAE,oBAAoB;gBAF7B,IAAI,EAAE,KAAK,EACX,WAAW,EAAE,YAAY,EACzB,OAAO,GAAE,oBAAyB;CAE9C;
|
|
1
|
+
{"version":3,"file":"permission-set.d.ts","sourceRoot":"","sources":["../../src/schema/permission-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C;;;;;;;GAOG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,CAAA;IACjD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAAC,CAAA;CACnD,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,aAAa,CACxB,KAAK,CAAC,KAAK,SAAS,UAAU,GAAG,GAAG,EACpC,KAAK,CAAC,YAAY,SAAS,SAAS,UAAU,EAAE,GAAG,GAAG;IAGpD,QAAQ,CAAC,IAAI,EAAE,KAAK;IACpB,QAAQ,CAAC,WAAW,EAAE,YAAY;IAClC,QAAQ,CAAC,OAAO,EAAE,oBAAoB;gBAF7B,IAAI,EAAE,KAAK,EACX,WAAW,EAAE,YAAY,EACzB,OAAO,GAAE,oBAAyB;CAE9C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,wBAAgB,aAAa,CAC3B,KAAK,CAAC,CAAC,SAAS,UAAU,EAC1B,KAAK,CAAC,CAAC,SAAS,SAAS,UAAU,EAAE,EACrC,IAAI,EAAE,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,oBAAoB,uBAExD"}
|
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PermissionSet = void 0;
|
|
4
4
|
exports.permissionSet = permissionSet;
|
|
5
|
+
/**
|
|
6
|
+
* Represents a collection of related permissions in AT Protocol.
|
|
7
|
+
*
|
|
8
|
+
* Permission sets group permissions together with metadata for OAuth
|
|
9
|
+
* authorization flows. They are identified by an NSID.
|
|
10
|
+
*
|
|
11
|
+
* @template TNsid - The NSID identifying this permission set
|
|
12
|
+
* @template TPermissions - Tuple type of the included permissions
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const feedAccess = new PermissionSet(
|
|
17
|
+
* 'app.bsky.feed.access',
|
|
18
|
+
* [readPermission, writePermission],
|
|
19
|
+
* { title: 'Feed Access', detail: 'Read and write to your feed' }
|
|
20
|
+
* )
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
5
23
|
class PermissionSet {
|
|
6
24
|
nsid;
|
|
7
25
|
permissions;
|
|
@@ -13,6 +31,38 @@ class PermissionSet {
|
|
|
13
31
|
}
|
|
14
32
|
}
|
|
15
33
|
exports.PermissionSet = PermissionSet;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a permission set grouping related permissions.
|
|
36
|
+
*
|
|
37
|
+
* Permission sets define OAuth scopes that applications can request.
|
|
38
|
+
* They include human-readable metadata for authorization UIs.
|
|
39
|
+
*
|
|
40
|
+
* @param nsid - The NSID identifying this permission set
|
|
41
|
+
* @param permissions - Array of permissions included in this set
|
|
42
|
+
* @param options - Optional metadata (title, detail, localization)
|
|
43
|
+
* @returns A new {@link PermissionSet} instance
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* // Define individual permissions
|
|
48
|
+
* const readPosts = l.permission('read', { collection: 'app.bsky.feed.post' })
|
|
49
|
+
* const writePosts = l.permission('write', { collection: 'app.bsky.feed.post' })
|
|
50
|
+
*
|
|
51
|
+
* // Group into a permission set
|
|
52
|
+
* const postManagement = l.permissionSet(
|
|
53
|
+
* 'app.bsky.feed.postManagement',
|
|
54
|
+
* [readPosts, writePosts],
|
|
55
|
+
* {
|
|
56
|
+
* title: 'Post Management',
|
|
57
|
+
* detail: 'View and create posts on your behalf',
|
|
58
|
+
* 'title:lang': {
|
|
59
|
+
* 'es': 'Gestion de publicaciones',
|
|
60
|
+
* 'fr': 'Gestion des publications',
|
|
61
|
+
* },
|
|
62
|
+
* }
|
|
63
|
+
* )
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
16
66
|
/*@__NO_SIDE_EFFECTS__*/
|
|
17
67
|
function permissionSet(nsid, permissions, options) {
|
|
18
68
|
return new PermissionSet(nsid, permissions, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission-set.js","sourceRoot":"","sources":["../../src/schema/permission-set.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"permission-set.js","sourceRoot":"","sources":["../../src/schema/permission-set.ts"],"names":[],"mappings":";;;AAgFA,sCAKC;AAnED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAa,aAAa;IAKb;IACA;IACA;IAHX,YACW,IAAW,EACX,WAAyB,EACzB,UAAgC,EAAE;QAFlC,SAAI,GAAJ,IAAI,CAAO;QACX,gBAAW,GAAX,WAAW,CAAc;QACzB,YAAO,GAAP,OAAO,CAA2B;IAC1C,CAAC;CACL;AATD,sCASC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAwB;AACxB,SAAgB,aAAa,CAG3B,IAAO,EAAE,WAAc,EAAE,OAA8B;IACvD,OAAO,IAAI,aAAa,CAAO,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA;AAC5D,CAAC","sourcesContent":["import { NsidString } from '../core.js'\nimport { Permission } from './permission.js'\n\n/**\n * Configuration options for a permission set.\n *\n * @property title - Human-readable title for the permission set\n * @property title:lang - Localized titles by language code\n * @property detail - Detailed description of the permission set\n * @property detail:lang - Localized descriptions by language code\n */\nexport type PermissionSetOptions = {\n title?: string\n 'title:lang'?: Record<string, undefined | string>\n detail?: string\n 'detail:lang'?: Record<string, undefined | string>\n}\n\n/**\n * Represents a collection of related permissions in AT Protocol.\n *\n * Permission sets group permissions together with metadata for OAuth\n * authorization flows. They are identified by an NSID.\n *\n * @template TNsid - The NSID identifying this permission set\n * @template TPermissions - Tuple type of the included permissions\n *\n * @example\n * ```ts\n * const feedAccess = new PermissionSet(\n * 'app.bsky.feed.access',\n * [readPermission, writePermission],\n * { title: 'Feed Access', detail: 'Read and write to your feed' }\n * )\n * ```\n */\nexport class PermissionSet<\n const TNsid extends NsidString = any,\n const TPermissions extends readonly Permission[] = any,\n> {\n constructor(\n readonly nsid: TNsid,\n readonly permissions: TPermissions,\n readonly options: PermissionSetOptions = {},\n ) {}\n}\n\n/**\n * Creates a permission set grouping related permissions.\n *\n * Permission sets define OAuth scopes that applications can request.\n * They include human-readable metadata for authorization UIs.\n *\n * @param nsid - The NSID identifying this permission set\n * @param permissions - Array of permissions included in this set\n * @param options - Optional metadata (title, detail, localization)\n * @returns A new {@link PermissionSet} instance\n *\n * @example\n * ```ts\n * // Define individual permissions\n * const readPosts = l.permission('read', { collection: 'app.bsky.feed.post' })\n * const writePosts = l.permission('write', { collection: 'app.bsky.feed.post' })\n *\n * // Group into a permission set\n * const postManagement = l.permissionSet(\n * 'app.bsky.feed.postManagement',\n * [readPosts, writePosts],\n * {\n * title: 'Post Management',\n * detail: 'View and create posts on your behalf',\n * 'title:lang': {\n * 'es': 'Gestion de publicaciones',\n * 'fr': 'Gestion des publications',\n * },\n * }\n * )\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function permissionSet<\n const N extends NsidString,\n const P extends readonly Permission[],\n>(nsid: N, permissions: P, options?: PermissionSetOptions) {\n return new PermissionSet<N, P>(nsid, permissions, options)\n}\n"]}
|
|
@@ -1,9 +1,51 @@
|
|
|
1
1
|
import { Params } from './params.js';
|
|
2
|
+
/**
|
|
3
|
+
* Type alias for permission options (same as Params).
|
|
4
|
+
*/
|
|
2
5
|
export type PermissionOptions = Params;
|
|
6
|
+
/**
|
|
7
|
+
* Represents a single permission in an AT Protocol permission set.
|
|
8
|
+
*
|
|
9
|
+
* Permissions define access rights to specific resources with optional
|
|
10
|
+
* parameters for fine-grained control.
|
|
11
|
+
*
|
|
12
|
+
* @template TResource - The resource identifier string type
|
|
13
|
+
* @template TOptions - The options type (must be valid Params)
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const readPermission = new Permission('read', { collection: 'app.bsky.feed.post' })
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
3
20
|
export declare class Permission<const TResource extends string = any, const TOptions extends PermissionOptions = any> {
|
|
4
21
|
readonly resource: TResource;
|
|
5
22
|
readonly options: TOptions;
|
|
6
23
|
constructor(resource: TResource, options: TOptions);
|
|
7
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates a permission definition for AT Protocol authorization.
|
|
27
|
+
*
|
|
28
|
+
* Permissions specify what resources an application can access.
|
|
29
|
+
* Used in permission sets to define OAuth scopes.
|
|
30
|
+
*
|
|
31
|
+
* @param resource - The resource identifier (e.g., 'read', 'write', 'admin')
|
|
32
|
+
* @param options - Optional parameters for the permission
|
|
33
|
+
* @returns A new {@link Permission} instance
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* // Simple permission
|
|
38
|
+
* const readPermission = l.permission('read')
|
|
39
|
+
*
|
|
40
|
+
* // Permission with options
|
|
41
|
+
* const writePostsPermission = l.permission('write', {
|
|
42
|
+
* collection: 'app.bsky.feed.post',
|
|
43
|
+
* })
|
|
44
|
+
*
|
|
45
|
+
* // Multiple permissions with different scopes
|
|
46
|
+
* const readProfile = l.permission('read', { collection: 'app.bsky.actor.profile' })
|
|
47
|
+
* const readFeed = l.permission('read', { collection: 'app.bsky.feed.*' })
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
8
50
|
export declare function permission<const R extends string, const O extends PermissionOptions>(resource: R, options?: PermissionOptions & O): Permission<R, O>;
|
|
9
51
|
//# sourceMappingURL=permission.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../src/schema/permission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAA;AAEtC,qBAAa,UAAU,CACrB,KAAK,CAAC,SAAS,SAAS,MAAM,GAAG,GAAG,EACpC,KAAK,CAAC,QAAQ,SAAS,iBAAiB,GAAG,GAAG;IAG5C,QAAQ,CAAC,QAAQ,EAAE,SAAS;IAC5B,QAAQ,CAAC,OAAO,EAAE,QAAQ;gBADjB,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,QAAQ;CAE7B;
|
|
1
|
+
{"version":3,"file":"permission.d.ts","sourceRoot":"","sources":["../../src/schema/permission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAA;AAEtC;;;;;;;;;;;;;GAaG;AACH,qBAAa,UAAU,CACrB,KAAK,CAAC,SAAS,SAAS,MAAM,GAAG,GAAG,EACpC,KAAK,CAAC,QAAQ,SAAS,iBAAiB,GAAG,GAAG;IAG5C,QAAQ,CAAC,QAAQ,EAAE,SAAS;IAC5B,QAAQ,CAAC,OAAO,EAAE,QAAQ;gBADjB,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,QAAQ;CAE7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,wBAAgB,UAAU,CACxB,KAAK,CAAC,CAAC,SAAS,MAAM,EACtB,KAAK,CAAC,CAAC,SAAS,iBAAiB,EACjC,QAAQ,EAAE,CAAC,EAAE,OAAO,GAAE,iBAAiB,GAAG,CAAW,oBAEtD"}
|
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Permission = void 0;
|
|
4
4
|
exports.permission = permission;
|
|
5
|
+
/**
|
|
6
|
+
* Represents a single permission in an AT Protocol permission set.
|
|
7
|
+
*
|
|
8
|
+
* Permissions define access rights to specific resources with optional
|
|
9
|
+
* parameters for fine-grained control.
|
|
10
|
+
*
|
|
11
|
+
* @template TResource - The resource identifier string type
|
|
12
|
+
* @template TOptions - The options type (must be valid Params)
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const readPermission = new Permission('read', { collection: 'app.bsky.feed.post' })
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
5
19
|
class Permission {
|
|
6
20
|
resource;
|
|
7
21
|
options;
|
|
@@ -11,6 +25,31 @@ class Permission {
|
|
|
11
25
|
}
|
|
12
26
|
}
|
|
13
27
|
exports.Permission = Permission;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a permission definition for AT Protocol authorization.
|
|
30
|
+
*
|
|
31
|
+
* Permissions specify what resources an application can access.
|
|
32
|
+
* Used in permission sets to define OAuth scopes.
|
|
33
|
+
*
|
|
34
|
+
* @param resource - The resource identifier (e.g., 'read', 'write', 'admin')
|
|
35
|
+
* @param options - Optional parameters for the permission
|
|
36
|
+
* @returns A new {@link Permission} instance
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* // Simple permission
|
|
41
|
+
* const readPermission = l.permission('read')
|
|
42
|
+
*
|
|
43
|
+
* // Permission with options
|
|
44
|
+
* const writePostsPermission = l.permission('write', {
|
|
45
|
+
* collection: 'app.bsky.feed.post',
|
|
46
|
+
* })
|
|
47
|
+
*
|
|
48
|
+
* // Multiple permissions with different scopes
|
|
49
|
+
* const readProfile = l.permission('read', { collection: 'app.bsky.actor.profile' })
|
|
50
|
+
* const readFeed = l.permission('read', { collection: 'app.bsky.feed.*' })
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
14
53
|
/*@__NO_SIDE_EFFECTS__*/
|
|
15
54
|
function permission(resource, options = {}) {
|
|
16
55
|
return new Permission(resource, options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission.js","sourceRoot":"","sources":["../../src/schema/permission.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"permission.js","sourceRoot":"","sources":["../../src/schema/permission.ts"],"names":[],"mappings":";;;AAyDA,gCAKC;AAvDD;;;;;;;;;;;;;GAaG;AACH,MAAa,UAAU;IAKV;IACA;IAFX,YACW,QAAmB,EACnB,OAAiB;QADjB,aAAQ,GAAR,QAAQ,CAAW;QACnB,YAAO,GAAP,OAAO,CAAU;IACzB,CAAC;CACL;AARD,gCAQC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAwB;AACxB,SAAgB,UAAU,CAGxB,QAAW,EAAE,UAAiC,EAAO;IACrD,OAAO,IAAI,UAAU,CAAO,QAAQ,EAAE,OAAO,CAAC,CAAA;AAChD,CAAC","sourcesContent":["import { Params } from './params.js'\n\n/**\n * Type alias for permission options (same as Params).\n */\nexport type PermissionOptions = Params\n\n/**\n * Represents a single permission in an AT Protocol permission set.\n *\n * Permissions define access rights to specific resources with optional\n * parameters for fine-grained control.\n *\n * @template TResource - The resource identifier string type\n * @template TOptions - The options type (must be valid Params)\n *\n * @example\n * ```ts\n * const readPermission = new Permission('read', { collection: 'app.bsky.feed.post' })\n * ```\n */\nexport class Permission<\n const TResource extends string = any,\n const TOptions extends PermissionOptions = any,\n> {\n constructor(\n readonly resource: TResource,\n readonly options: TOptions,\n ) {}\n}\n\n/**\n * Creates a permission definition for AT Protocol authorization.\n *\n * Permissions specify what resources an application can access.\n * Used in permission sets to define OAuth scopes.\n *\n * @param resource - The resource identifier (e.g., 'read', 'write', 'admin')\n * @param options - Optional parameters for the permission\n * @returns A new {@link Permission} instance\n *\n * @example\n * ```ts\n * // Simple permission\n * const readPermission = l.permission('read')\n *\n * // Permission with options\n * const writePostsPermission = l.permission('write', {\n * collection: 'app.bsky.feed.post',\n * })\n *\n * // Multiple permissions with different scopes\n * const readProfile = l.permission('read', { collection: 'app.bsky.actor.profile' })\n * const readFeed = l.permission('read', { collection: 'app.bsky.feed.*' })\n * ```\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function permission<\n const R extends string,\n const O extends PermissionOptions,\n>(resource: R, options: PermissionOptions & O = {} as O) {\n return new Permission<R, O>(resource, options)\n}\n"]}
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import { NsidString } from '../core.js';
|
|
2
2
|
import { ParamsSchema } from './params.js';
|
|
3
3
|
import { Payload } from './payload.js';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a Lexicon procedure (HTTP POST) endpoint definition.
|
|
6
|
+
*
|
|
7
|
+
* Procedures are operations that may modify state on the server.
|
|
8
|
+
* They have parameters, an input payload (request body), an output
|
|
9
|
+
* payload (response body), and optional error types.
|
|
10
|
+
*
|
|
11
|
+
* @template TNsid - The NSID identifying this procedure
|
|
12
|
+
* @template TParameters - The parameters schema type
|
|
13
|
+
* @template TInputPayload - The request body payload type
|
|
14
|
+
* @template TOutputPayload - The response body payload type
|
|
15
|
+
* @template TErrors - Array of error type strings, or undefined
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const createPost = new Procedure(
|
|
20
|
+
* 'app.bsky.feed.post',
|
|
21
|
+
* l.params({}),
|
|
22
|
+
* l.jsonPayload({ text: l.string() }),
|
|
23
|
+
* l.jsonPayload({ uri: l.string(), cid: l.string() }),
|
|
24
|
+
* ['InvalidRecord']
|
|
25
|
+
* )
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
4
28
|
export declare class Procedure<const TNsid extends NsidString = NsidString, const TParameters extends ParamsSchema = ParamsSchema, const TInputPayload extends Payload = Payload, const TOutputPayload extends Payload = Payload, const TErrors extends undefined | readonly string[] = undefined | readonly string[]> {
|
|
5
29
|
readonly nsid: TNsid;
|
|
6
30
|
readonly parameters: TParameters;
|
|
@@ -10,5 +34,45 @@ export declare class Procedure<const TNsid extends NsidString = NsidString, cons
|
|
|
10
34
|
readonly type: "procedure";
|
|
11
35
|
constructor(nsid: TNsid, parameters: TParameters, input: TInputPayload, output: TOutputPayload, errors: TErrors);
|
|
12
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates a procedure definition for a Lexicon POST endpoint.
|
|
39
|
+
*
|
|
40
|
+
* Procedures can modify server state. They accept both URL parameters
|
|
41
|
+
* and a request body (input payload).
|
|
42
|
+
*
|
|
43
|
+
* @param nsid - The NSID identifying this procedure endpoint
|
|
44
|
+
* @param parameters - Schema for URL query parameters
|
|
45
|
+
* @param input - Schema for request body payload
|
|
46
|
+
* @param output - Schema for response body payload
|
|
47
|
+
* @param errors - Optional array of error type strings
|
|
48
|
+
* @returns A new {@link Procedure} instance
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* // Create record procedure
|
|
53
|
+
* const createRecord = l.procedure(
|
|
54
|
+
* 'com.atproto.repo.createRecord',
|
|
55
|
+
* l.params({}),
|
|
56
|
+
* l.jsonPayload({
|
|
57
|
+
* repo: l.string({ format: 'at-identifier' }),
|
|
58
|
+
* collection: l.string({ format: 'nsid' }),
|
|
59
|
+
* record: l.unknown(),
|
|
60
|
+
* }),
|
|
61
|
+
* l.jsonPayload({
|
|
62
|
+
* uri: l.string({ format: 'at-uri' }),
|
|
63
|
+
* cid: l.string({ format: 'cid' }),
|
|
64
|
+
* }),
|
|
65
|
+
* ['InvalidRecord', 'RepoNotFound'],
|
|
66
|
+
* )
|
|
67
|
+
*
|
|
68
|
+
* // Procedure with binary input
|
|
69
|
+
* const uploadBlob = l.procedure(
|
|
70
|
+
* 'com.atproto.repo.uploadBlob',
|
|
71
|
+
* l.params({}),
|
|
72
|
+
* l.payload('*\/*', undefined), // Accept any content type
|
|
73
|
+
* l.jsonPayload({ blob: l.blob() }),
|
|
74
|
+
* )
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
13
77
|
export declare function procedure<const N extends NsidString, const P extends ParamsSchema, const I extends Payload, const O extends Payload, const E extends undefined | readonly string[] = undefined>(nsid: N, parameters: P, input: I, output: O, errors?: E): Procedure<N, P, I, O, E>;
|
|
14
78
|
//# sourceMappingURL=procedure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"procedure.d.ts","sourceRoot":"","sources":["../../src/schema/procedure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,qBAAa,SAAS,CACpB,KAAK,CAAC,KAAK,SAAS,UAAU,GAAG,UAAU,EAC3C,KAAK,CAAC,WAAW,SAAS,YAAY,GAAG,YAAY,EACrD,KAAK,CAAC,aAAa,SAAS,OAAO,GAAG,OAAO,EAC7C,KAAK,CAAC,cAAc,SAAS,OAAO,GAAG,OAAO,EAC9C,KAAK,CAAC,OAAO,SAAS,SAAS,GAAG,SAAS,MAAM,EAAE,GAC/C,SAAS,GACT,SAAS,MAAM,EAAE;IAKnB,QAAQ,CAAC,IAAI,EAAE,KAAK;IACpB,QAAQ,CAAC,UAAU,EAAE,WAAW;IAChC,QAAQ,CAAC,KAAK,EAAE,aAAa;IAC7B,QAAQ,CAAC,MAAM,EAAE,cAAc;IAC/B,QAAQ,CAAC,MAAM,EAAE,OAAO;IAP1B,QAAQ,CAAC,IAAI,EAAG,WAAW,CAAS;gBAGzB,IAAI,EAAE,KAAK,EACX,UAAU,EAAE,WAAW,EACvB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,OAAO;CAE3B;
|
|
1
|
+
{"version":3,"file":"procedure.d.ts","sourceRoot":"","sources":["../../src/schema/procedure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,SAAS,CACpB,KAAK,CAAC,KAAK,SAAS,UAAU,GAAG,UAAU,EAC3C,KAAK,CAAC,WAAW,SAAS,YAAY,GAAG,YAAY,EACrD,KAAK,CAAC,aAAa,SAAS,OAAO,GAAG,OAAO,EAC7C,KAAK,CAAC,cAAc,SAAS,OAAO,GAAG,OAAO,EAC9C,KAAK,CAAC,OAAO,SAAS,SAAS,GAAG,SAAS,MAAM,EAAE,GAC/C,SAAS,GACT,SAAS,MAAM,EAAE;IAKnB,QAAQ,CAAC,IAAI,EAAE,KAAK;IACpB,QAAQ,CAAC,UAAU,EAAE,WAAW;IAChC,QAAQ,CAAC,KAAK,EAAE,aAAa;IAC7B,QAAQ,CAAC,MAAM,EAAE,cAAc;IAC/B,QAAQ,CAAC,MAAM,EAAE,OAAO;IAP1B,QAAQ,CAAC,IAAI,EAAG,WAAW,CAAS;gBAGzB,IAAI,EAAE,KAAK,EACX,UAAU,EAAE,WAAW,EACvB,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,OAAO;CAE3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,wBAAgB,SAAS,CACvB,KAAK,CAAC,CAAC,SAAS,UAAU,EAC1B,KAAK,CAAC,CAAC,SAAS,YAAY,EAC5B,KAAK,CAAC,CAAC,SAAS,OAAO,EACvB,KAAK,CAAC,CAAC,SAAS,OAAO,EACvB,KAAK,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,EACzD,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAE,CAAkB,4BAExE"}
|