@atiproto/lexicons 0.2.0 → 0.4.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.
Files changed (28) hide show
  1. package/dist/index.js +400 -98
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +400 -98
  4. package/dist/index.mjs.map +1 -1
  5. package/dist/lexicons/com/atiproto/account/cart/clone.defs.d.ts +6 -6
  6. package/dist/lexicons/com/atiproto/account/cart/create.defs.d.ts +8 -4
  7. package/dist/lexicons/com/atiproto/account/cart/get.defs.d.ts +6 -6
  8. package/dist/lexicons/com/atiproto/account/cart/list.defs.d.ts +7 -3
  9. package/dist/lexicons/com/atiproto/account/profile/get.defs.d.ts +2 -2
  10. package/dist/lexicons/com/atiproto/account/profile/put.defs.d.ts +2 -2
  11. package/dist/lexicons/com/atiproto/cart.defs.d.ts +45 -12
  12. package/dist/lexicons/com/atiproto/feed/list.defs.d.ts +6 -2
  13. package/dist/lexicons/com/atiproto/feed/subscription/cancel.defs.d.ts +2 -2
  14. package/dist/lexicons/com/atiproto/feed/subscription/create.defs.d.ts +32 -16
  15. package/dist/lexicons/com/atiproto/feed/subscription/get.defs.d.ts +2 -2
  16. package/dist/lexicons/com/atiproto/feed/subscription/list.defs.d.ts +7 -3
  17. package/dist/lexicons/com/atiproto/feed/tip/create.defs.d.ts +18 -14
  18. package/dist/lexicons/com/atiproto/feed/tip/get.defs.d.ts +2 -2
  19. package/dist/lexicons/com/atiproto/feed/tip/list.defs.d.ts +8 -4
  20. package/dist/lexicons/com/atiproto/profile.defs.d.ts +28 -0
  21. package/dist/lexicons/com/atiproto/repo/profile/get.defs.d.ts +2 -2
  22. package/dist/lexicons/com/atiproto/repo/subscription/search.defs.d.ts +13 -5
  23. package/dist/lexicons/com/atiproto/repo/subscription/validate.defs.d.ts +12 -4
  24. package/dist/lexicons/com/atiproto/repo/tip/search.defs.d.ts +13 -5
  25. package/dist/lexicons/com/atiproto/repo/tip/validate.defs.d.ts +12 -4
  26. package/dist/lexicons/com/atiproto/subscription.defs.d.ts +68 -24
  27. package/dist/lexicons/com/atiproto/tip.defs.d.ts +41 -1
  28. package/package.json +1 -1
@@ -7,11 +7,15 @@ declare const main: l.Query<"com.atiproto.repo.subscription.search", l.ParamsSch
7
7
  readonly subject: l.StringSchema<{
8
8
  readonly format: "did";
9
9
  }>;
10
- readonly cursor: l.OptionalSchema<l.StringSchema<{}>>;
10
+ readonly cursor: l.OptionalSchema<l.StringSchema<{
11
+ readonly maxLength: 512;
12
+ }>>;
11
13
  readonly limit: l.OptionalSchema<l.WithDefaultSchema<l.IntegerSchema>>;
12
14
  }>, l.Payload<"application/json", l.ObjectSchema<{
13
15
  subscriptions: l.ArraySchema<l.RefSchema<l.Validator<SubscriptionResponse, SubscriptionResponse>>>;
14
- cursor: l.OptionalSchema<l.StringSchema<{}>>;
16
+ cursor: l.OptionalSchema<l.StringSchema<{
17
+ readonly maxLength: 512;
18
+ }>>;
15
19
  }>>, undefined>;
16
20
  export { main };
17
21
  export type $Params = l.InferMethodParams<typeof main>;
@@ -21,11 +25,15 @@ export declare const $lxm: "com.atiproto.repo.subscription.search", $params: l.P
21
25
  readonly subject: l.StringSchema<{
22
26
  readonly format: "did";
23
27
  }>;
24
- readonly cursor: l.OptionalSchema<l.StringSchema<{}>>;
28
+ readonly cursor: l.OptionalSchema<l.StringSchema<{
29
+ readonly maxLength: 512;
30
+ }>>;
25
31
  readonly limit: l.OptionalSchema<l.WithDefaultSchema<l.IntegerSchema>>;
26
32
  }>, $output: l.Payload<"application/json", l.ObjectSchema<{
27
33
  subscriptions: l.ArraySchema<l.RefSchema<l.Validator<SubscriptionResponse, SubscriptionResponse>>>;
28
- cursor: l.OptionalSchema<l.StringSchema<{}>>;
34
+ cursor: l.OptionalSchema<l.StringSchema<{
35
+ readonly maxLength: 512;
36
+ }>>;
29
37
  }>>;
30
38
  type SubscriptionResponse = {
31
39
  $type?: 'com.atiproto.repo.subscription.search#subscriptionResponse';
@@ -33,7 +41,7 @@ type SubscriptionResponse = {
33
41
  * AT-URI of the subscription record
34
42
  */
35
43
  uri: l.AtUriString;
36
- record: AtiprotoSubscription.Main;
44
+ record: AtiprotoSubscription.View;
37
45
  };
38
46
  export type { SubscriptionResponse };
39
47
  declare const subscriptionResponse: l.TypedObjectSchema<"com.atiproto.repo.subscription.search#subscriptionResponse", l.Validator<SubscriptionResponse, SubscriptionResponse>>;
@@ -16,8 +16,12 @@ declare const main: l.Query<"com.atiproto.repo.subscription.validate", l.ParamsS
16
16
  }>, l.Payload<"application/json", l.ObjectSchema<{
17
17
  valid: l.BooleanSchema;
18
18
  amount: l.OptionalSchema<l.IntegerSchema>;
19
- currency: l.OptionalSchema<l.StringSchema<{}>>;
20
- reason: l.OptionalSchema<l.StringSchema<{}>>;
19
+ currency: l.OptionalSchema<l.StringSchema<{
20
+ readonly maxLength: 3;
21
+ }>>;
22
+ reason: l.OptionalSchema<l.StringSchema<{
23
+ readonly maxLength: 1024;
24
+ }>>;
21
25
  }>>, undefined>;
22
26
  export { main };
23
27
  export type $Params = l.InferMethodParams<typeof main>;
@@ -37,6 +41,10 @@ export declare const $lxm: "com.atiproto.repo.subscription.validate", $params: l
37
41
  }>, $output: l.Payload<"application/json", l.ObjectSchema<{
38
42
  valid: l.BooleanSchema;
39
43
  amount: l.OptionalSchema<l.IntegerSchema>;
40
- currency: l.OptionalSchema<l.StringSchema<{}>>;
41
- reason: l.OptionalSchema<l.StringSchema<{}>>;
44
+ currency: l.OptionalSchema<l.StringSchema<{
45
+ readonly maxLength: 3;
46
+ }>>;
47
+ reason: l.OptionalSchema<l.StringSchema<{
48
+ readonly maxLength: 1024;
49
+ }>>;
42
50
  }>>;
@@ -7,11 +7,15 @@ declare const main: l.Query<"com.atiproto.repo.tip.search", l.ParamsSchema<{
7
7
  readonly subject: l.StringSchema<{
8
8
  readonly format: "did";
9
9
  }>;
10
- readonly cursor: l.OptionalSchema<l.StringSchema<{}>>;
10
+ readonly cursor: l.OptionalSchema<l.StringSchema<{
11
+ readonly maxLength: 512;
12
+ }>>;
11
13
  readonly limit: l.OptionalSchema<l.WithDefaultSchema<l.IntegerSchema>>;
12
14
  }>, l.Payload<"application/json", l.ObjectSchema<{
13
15
  tips: l.ArraySchema<l.RefSchema<l.Validator<TipResponse, TipResponse>>>;
14
- cursor: l.OptionalSchema<l.StringSchema<{}>>;
16
+ cursor: l.OptionalSchema<l.StringSchema<{
17
+ readonly maxLength: 512;
18
+ }>>;
15
19
  }>>, undefined>;
16
20
  export { main };
17
21
  export type $Params = l.InferMethodParams<typeof main>;
@@ -21,11 +25,15 @@ export declare const $lxm: "com.atiproto.repo.tip.search", $params: l.ParamsSche
21
25
  readonly subject: l.StringSchema<{
22
26
  readonly format: "did";
23
27
  }>;
24
- readonly cursor: l.OptionalSchema<l.StringSchema<{}>>;
28
+ readonly cursor: l.OptionalSchema<l.StringSchema<{
29
+ readonly maxLength: 512;
30
+ }>>;
25
31
  readonly limit: l.OptionalSchema<l.WithDefaultSchema<l.IntegerSchema>>;
26
32
  }>, $output: l.Payload<"application/json", l.ObjectSchema<{
27
33
  tips: l.ArraySchema<l.RefSchema<l.Validator<TipResponse, TipResponse>>>;
28
- cursor: l.OptionalSchema<l.StringSchema<{}>>;
34
+ cursor: l.OptionalSchema<l.StringSchema<{
35
+ readonly maxLength: 512;
36
+ }>>;
29
37
  }>>;
30
38
  type TipResponse = {
31
39
  $type?: 'com.atiproto.repo.tip.search#tipResponse';
@@ -33,7 +41,7 @@ type TipResponse = {
33
41
  * AT-URI of the tip record
34
42
  */
35
43
  uri: l.AtUriString;
36
- record: AtiprotoTip.Main;
44
+ record: AtiprotoTip.View;
37
45
  };
38
46
  export type { TipResponse };
39
47
  declare const tipResponse: l.TypedObjectSchema<"com.atiproto.repo.tip.search#tipResponse", l.Validator<TipResponse, TipResponse>>;
@@ -19,8 +19,12 @@ declare const main: l.Query<"com.atiproto.repo.tip.validate", l.ParamsSchema<{
19
19
  }>, l.Payload<"application/json", l.ObjectSchema<{
20
20
  valid: l.BooleanSchema;
21
21
  amount: l.OptionalSchema<l.IntegerSchema>;
22
- currency: l.OptionalSchema<l.StringSchema<{}>>;
23
- reason: l.OptionalSchema<l.StringSchema<{}>>;
22
+ currency: l.OptionalSchema<l.StringSchema<{
23
+ readonly maxLength: 3;
24
+ }>>;
25
+ reason: l.OptionalSchema<l.StringSchema<{
26
+ readonly maxLength: 1024;
27
+ }>>;
24
28
  }>>, undefined>;
25
29
  export { main };
26
30
  export type $Params = l.InferMethodParams<typeof main>;
@@ -43,6 +47,10 @@ export declare const $lxm: "com.atiproto.repo.tip.validate", $params: l.ParamsSc
43
47
  }>, $output: l.Payload<"application/json", l.ObjectSchema<{
44
48
  valid: l.BooleanSchema;
45
49
  amount: l.OptionalSchema<l.IntegerSchema>;
46
- currency: l.OptionalSchema<l.StringSchema<{}>>;
47
- reason: l.OptionalSchema<l.StringSchema<{}>>;
50
+ currency: l.OptionalSchema<l.StringSchema<{
51
+ readonly maxLength: 3;
52
+ }>>;
53
+ reason: l.OptionalSchema<l.StringSchema<{
54
+ readonly maxLength: 1024;
55
+ }>>;
48
56
  }>>;
@@ -17,13 +17,13 @@ type Main = {
17
17
  */
18
18
  currency: string;
19
19
  /**
20
- * Billing interval: monthly or yearly
20
+ * Billing interval
21
21
  */
22
- interval: string;
22
+ interval: 'monthly' | 'yearly';
23
23
  /**
24
- * Subscription status: pending, active, past_due, cancelled, expired
24
+ * Subscription status
25
25
  */
26
- status: string;
26
+ status: 'pending' | 'active' | 'past_due' | 'cancelled' | 'expired';
27
27
  /**
28
28
  * First billing period, can be used to determine recurrence
29
29
  */
@@ -50,11 +50,11 @@ export declare const $isTypeOf: <TValue extends {
50
50
  }>(value: TValue) => value is l.TypedRecord<"com.atiproto.subscription", TValue>, $build: {
51
51
  (input: Omit<Omit<Main, "$type">, "$type">): {
52
52
  currency: string;
53
- status: string;
53
+ status: "pending" | "active" | "past_due" | "cancelled" | "expired";
54
54
  createdAt: l.DatetimeString;
55
55
  subject: l.DidString;
56
56
  amount: number;
57
- interval: string;
57
+ interval: "monthly" | "yearly";
58
58
  billingStartDate: l.DatetimeString;
59
59
  cancelledAt?: l.DatetimeString
60
60
  /**
@@ -70,11 +70,11 @@ export declare const $isTypeOf: <TValue extends {
70
70
  };
71
71
  (input: Omit<Omit<Main, "$type">, "$type">): {
72
72
  currency: string;
73
- status: string;
73
+ status: "pending" | "active" | "past_due" | "cancelled" | "expired";
74
74
  createdAt: l.DatetimeString;
75
75
  subject: l.DidString;
76
76
  amount: number;
77
- interval: string;
77
+ interval: "monthly" | "yearly";
78
78
  billingStartDate: l.DatetimeString;
79
79
  cancelledAt?: l.DatetimeString
80
80
  /**
@@ -91,11 +91,11 @@ export declare const $isTypeOf: <TValue extends {
91
91
  }, $type: "com.atiproto.subscription";
92
92
  export declare const $assert: (input: unknown, options?: l.ValidateOptions) => asserts input is {
93
93
  currency: string;
94
- status: string;
94
+ status: "pending" | "active" | "past_due" | "cancelled" | "expired";
95
95
  createdAt: l.DatetimeString;
96
96
  subject: l.DidString;
97
97
  amount: number;
98
- interval: string;
98
+ interval: "monthly" | "yearly";
99
99
  billingStartDate: l.DatetimeString;
100
100
  cancelledAt?: l.DatetimeString
101
101
  /**
@@ -110,11 +110,11 @@ export declare const $assert: (input: unknown, options?: l.ValidateOptions) => a
110
110
  $type: "com.atiproto.subscription";
111
111
  }, $check: (input: unknown, options?: l.ValidateOptions) => void, $cast: <I>(input: I, options?: l.ValidateOptions) => I & {
112
112
  currency: string;
113
- status: string;
113
+ status: "pending" | "active" | "past_due" | "cancelled" | "expired";
114
114
  createdAt: l.DatetimeString;
115
115
  subject: l.DidString;
116
116
  amount: number;
117
- interval: string;
117
+ interval: "monthly" | "yearly";
118
118
  billingStartDate: l.DatetimeString;
119
119
  cancelledAt?: l.DatetimeString
120
120
  /**
@@ -129,11 +129,11 @@ export declare const $assert: (input: unknown, options?: l.ValidateOptions) => a
129
129
  $type: "com.atiproto.subscription";
130
130
  }, $ifMatches: <I>(input: I, options?: l.ValidateOptions) => (I & {
131
131
  currency: string;
132
- status: string;
132
+ status: "pending" | "active" | "past_due" | "cancelled" | "expired";
133
133
  createdAt: l.DatetimeString;
134
134
  subject: l.DidString;
135
135
  amount: number;
136
- interval: string;
136
+ interval: "monthly" | "yearly";
137
137
  billingStartDate: l.DatetimeString;
138
138
  cancelledAt?: l.DatetimeString
139
139
  /**
@@ -148,11 +148,11 @@ export declare const $assert: (input: unknown, options?: l.ValidateOptions) => a
148
148
  $type: "com.atiproto.subscription";
149
149
  }) | undefined, $matches: <I>(input: I, options?: l.ValidateOptions) => input is I & {
150
150
  currency: string;
151
- status: string;
151
+ status: "pending" | "active" | "past_due" | "cancelled" | "expired";
152
152
  createdAt: l.DatetimeString;
153
153
  subject: l.DidString;
154
154
  amount: number;
155
- interval: string;
155
+ interval: "monthly" | "yearly";
156
156
  billingStartDate: l.DatetimeString;
157
157
  cancelledAt?: l.DatetimeString
158
158
  /**
@@ -167,11 +167,11 @@ export declare const $assert: (input: unknown, options?: l.ValidateOptions) => a
167
167
  $type: "com.atiproto.subscription";
168
168
  }, $parse: (input: unknown, options?: l.ParseOptions) => {
169
169
  currency: string;
170
- status: string;
170
+ status: "pending" | "active" | "past_due" | "cancelled" | "expired";
171
171
  createdAt: l.DatetimeString;
172
172
  subject: l.DidString;
173
173
  amount: number;
174
- interval: string;
174
+ interval: "monthly" | "yearly";
175
175
  billingStartDate: l.DatetimeString;
176
176
  cancelledAt?: l.DatetimeString
177
177
  /**
@@ -186,11 +186,11 @@ export declare const $assert: (input: unknown, options?: l.ValidateOptions) => a
186
186
  $type: "com.atiproto.subscription";
187
187
  }, $safeParse: (input: unknown, options?: l.ParseOptions) => l.ValidationResult<{
188
188
  currency: string;
189
- status: string;
189
+ status: "pending" | "active" | "past_due" | "cancelled" | "expired";
190
190
  createdAt: l.DatetimeString;
191
191
  subject: l.DidString;
192
192
  amount: number;
193
- interval: string;
193
+ interval: "monthly" | "yearly";
194
194
  billingStartDate: l.DatetimeString;
195
195
  cancelledAt?: l.DatetimeString
196
196
  /**
@@ -205,11 +205,11 @@ export declare const $assert: (input: unknown, options?: l.ValidateOptions) => a
205
205
  $type: "com.atiproto.subscription";
206
206
  }>, $validate: <I>(input: I, options?: l.ValidateOptions) => I & {
207
207
  currency: string;
208
- status: string;
208
+ status: "pending" | "active" | "past_due" | "cancelled" | "expired";
209
209
  createdAt: l.DatetimeString;
210
210
  subject: l.DidString;
211
211
  amount: number;
212
- interval: string;
212
+ interval: "monthly" | "yearly";
213
213
  billingStartDate: l.DatetimeString;
214
214
  cancelledAt?: l.DatetimeString
215
215
  /**
@@ -224,11 +224,11 @@ export declare const $assert: (input: unknown, options?: l.ValidateOptions) => a
224
224
  $type: "com.atiproto.subscription";
225
225
  }, $safeValidate: <I>(input: I, options?: l.ValidateOptions) => l.ValidationResult<I & {
226
226
  currency: string;
227
- status: string;
227
+ status: "pending" | "active" | "past_due" | "cancelled" | "expired";
228
228
  createdAt: l.DatetimeString;
229
229
  subject: l.DidString;
230
230
  amount: number;
231
- interval: string;
231
+ interval: "monthly" | "yearly";
232
232
  billingStartDate: l.DatetimeString;
233
233
  cancelledAt?: l.DatetimeString
234
234
  /**
@@ -242,3 +242,47 @@ export declare const $assert: (input: unknown, options?: l.ValidateOptions) => a
242
242
  | undefined;
243
243
  $type: "com.atiproto.subscription";
244
244
  }>;
245
+ /** View of a subscription record for use in API responses */
246
+ type View = {
247
+ $type?: 'com.atiproto.subscription#view';
248
+ /**
249
+ * DID of the user being subscribed to
250
+ */
251
+ subject: l.DidString;
252
+ /**
253
+ * Subscription amount in cents (0 for free subscriptions)
254
+ */
255
+ amount: number;
256
+ /**
257
+ * ISO 4217 currency code
258
+ */
259
+ currency: string;
260
+ /**
261
+ * Billing interval
262
+ */
263
+ interval: 'monthly' | 'yearly';
264
+ /**
265
+ * Subscription status
266
+ */
267
+ status: 'pending' | 'active' | 'past_due' | 'cancelled' | 'expired';
268
+ /**
269
+ * First billing period, can be used to determine recurrence
270
+ */
271
+ billingStartDate: l.DatetimeString;
272
+ /**
273
+ * Cancellation timestamp
274
+ */
275
+ cancelledAt?: l.DatetimeString;
276
+ /**
277
+ * Date until which the subscriber retains access after cancellation
278
+ */
279
+ accessUntil?: l.DatetimeString;
280
+ /**
281
+ * Creation timestamp
282
+ */
283
+ createdAt: l.DatetimeString;
284
+ };
285
+ export type { View };
286
+ /** View of a subscription record for use in API responses */
287
+ declare const view: l.TypedObjectSchema<"com.atiproto.subscription#view", l.Validator<View, View>>;
288
+ export { view };
@@ -21,7 +21,7 @@ type Main = {
21
21
  */
22
22
  currency: string;
23
23
  /**
24
- * Tip status: pending, authorized (payment held), completed, failed, refunded
24
+ * Tip status
25
25
  */
26
26
  status: 'pending' | 'authorized' | 'completed' | 'failed' | 'refunded';
27
27
  /**
@@ -228,3 +228,43 @@ export declare const $assert: (input: unknown, options?: l.ValidateOptions) => a
228
228
  | undefined;
229
229
  $type: "com.atiproto.tip";
230
230
  }>;
231
+ /** View of a tip record for use in API responses */
232
+ type View = {
233
+ $type?: 'com.atiproto.tip#view';
234
+ /**
235
+ * DID of the user receiving the tip
236
+ */
237
+ subject: l.DidString;
238
+ /**
239
+ * AT-URI of specific record being tipped
240
+ */
241
+ recordUri?: l.AtUriString;
242
+ /**
243
+ * Tip amount in cents (0 when recipient allows zero tips)
244
+ */
245
+ amount: number;
246
+ /**
247
+ * ISO 4217 currency code
248
+ */
249
+ currency: string;
250
+ /**
251
+ * Tip status
252
+ */
253
+ status: 'pending' | 'authorized' | 'completed' | 'failed' | 'refunded';
254
+ /**
255
+ * Optional message (max 500 chars)
256
+ */
257
+ message?: string;
258
+ /**
259
+ * Creation timestamp
260
+ */
261
+ createdAt: l.DatetimeString;
262
+ /**
263
+ * Completion timestamp
264
+ */
265
+ completedAt?: l.DatetimeString;
266
+ };
267
+ export type { View };
268
+ /** View of a tip record for use in API responses */
269
+ declare const view: l.TypedObjectSchema<"com.atiproto.tip#view", l.Validator<View, View>>;
270
+ export { view };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atiproto/lexicons",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "ATProto lexicon types and utilities",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",