@atiproto/lexicons 0.2.0 → 0.3.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.js CHANGED
@@ -112,9 +112,9 @@ var main = import_lex.l.record(
112
112
  $nsid,
113
113
  import_lex.l.object({
114
114
  items: import_lex.l.array(import_lex.l.ref((() => cartItem))),
115
- currency: import_lex.l.string(),
115
+ currency: import_lex.l.string({ maxLength: 3 }),
116
116
  total: import_lex.l.integer(),
117
- status: import_lex.l.string(),
117
+ status: import_lex.l.enum(["open", "completed", "expired", "abandoned"]),
118
118
  createdAt: import_lex.l.string({ format: "datetime" }),
119
119
  expiresAt: import_lex.l.string({ format: "datetime" }),
120
120
  completedAt: import_lex.l.optional(import_lex.l.string({ format: "datetime" }))
@@ -168,7 +168,7 @@ var main2 = import_lex2.l.record(
168
168
  subject: import_lex2.l.string({ format: "did" }),
169
169
  recordUri: import_lex2.l.optional(import_lex2.l.string({ format: "at-uri" })),
170
170
  amount: import_lex2.l.integer({ minimum: 0 }),
171
- currency: import_lex2.l.string(),
171
+ currency: import_lex2.l.string({ maxLength: 3 }),
172
172
  status: import_lex2.l.enum([
173
173
  "pending",
174
174
  "authorized",
@@ -220,9 +220,9 @@ var main3 = import_lex3.l.record(
220
220
  import_lex3.l.object({
221
221
  subject: import_lex3.l.string({ format: "did" }),
222
222
  amount: import_lex3.l.integer({ minimum: 0 }),
223
- currency: import_lex3.l.string(),
224
- interval: import_lex3.l.string(),
225
- status: import_lex3.l.string(),
223
+ currency: import_lex3.l.string({ maxLength: 3 }),
224
+ interval: import_lex3.l.enum(["monthly", "yearly"]),
225
+ status: import_lex3.l.enum(["pending", "active", "past_due", "cancelled", "expired"]),
226
226
  billingStartDate: import_lex3.l.string({ format: "datetime" }),
227
227
  cancelledAt: import_lex3.l.optional(import_lex3.l.string({ format: "datetime" })),
228
228
  accessUntil: import_lex3.l.optional(import_lex3.l.string({ format: "datetime" })),
@@ -296,7 +296,7 @@ var main5 = import_lex5.l.procedure(
296
296
  $nsid5,
297
297
  import_lex5.l.params(),
298
298
  import_lex5.l.jsonPayload({
299
- currency: import_lex5.l.string(),
299
+ currency: import_lex5.l.string({ maxLength: 3 }),
300
300
  redirectUrl: import_lex5.l.optional(import_lex5.l.string({ format: "uri" }))
301
301
  }),
302
302
  import_lex5.l.jsonPayload({
@@ -381,7 +381,7 @@ var main7 = import_lex7.l.query(
381
381
  import_lex7.l.params(),
382
382
  import_lex7.l.jsonPayload({
383
383
  carts: import_lex7.l.array(import_lex7.l.ref((() => cartResponse))),
384
- cursor: import_lex7.l.optional(import_lex7.l.string())
384
+ cursor: import_lex7.l.optional(import_lex7.l.string({ maxLength: 512 }))
385
385
  })
386
386
  );
387
387
  var $lxm4 = main7.nsid;
@@ -601,7 +601,7 @@ var main12 = import_lex12.l.permissionSet(
601
601
  ]
602
602
  }),
603
603
  import_lex12.l.permission("rpc", {
604
- aud: "did:web:atiproto.com#payments",
604
+ inheritAud: true,
605
605
  lxm: [
606
606
  "com.atiproto.account.cart.clone",
607
607
  "com.atiproto.account.cart.create",
@@ -661,7 +661,7 @@ var main13 = import_lex13.l.permissionSet(
661
661
  ]
662
662
  }),
663
663
  import_lex13.l.permission("rpc", {
664
- aud: "did:web:atiproto.com#payments",
664
+ inheritAud: true,
665
665
  lxm: [
666
666
  "com.atiproto.account.cart.clone",
667
667
  "com.atiproto.account.cart.create",
@@ -688,7 +688,7 @@ var main13 = import_lex13.l.permissionSet(
688
688
  ],
689
689
  {
690
690
  title: "General Access",
691
- detail: "Write access to cart, subscription, and tip records, plus RPC access to all non-profile endpoints."
691
+ detail: "Write access to cart, subscription, and tip records, plus RPC access to payment, feed, and public profile lookup endpoints."
692
692
  }
693
693
  );
694
694
 
@@ -758,7 +758,7 @@ var main14 = import_lex14.l.query(
758
758
  false
759
759
  )
760
760
  ),
761
- cursor: import_lex14.l.optional(import_lex14.l.string())
761
+ cursor: import_lex14.l.optional(import_lex14.l.string({ maxLength: 512 }))
762
762
  })
763
763
  );
764
764
  var $lxm8 = main14.nsid;
@@ -846,17 +846,21 @@ var main16 = import_lex16.l.procedure(
846
846
  import_lex16.l.jsonPayload({
847
847
  subject: import_lex16.l.string({ format: "did" }),
848
848
  amount: import_lex16.l.optional(import_lex16.l.integer()),
849
- currency: import_lex16.l.string(),
850
- interval: import_lex16.l.string()
849
+ currency: import_lex16.l.string({ maxLength: 3 }),
850
+ interval: import_lex16.l.enum(["monthly", "yearly"]),
851
+ cartUri: import_lex16.l.optional(import_lex16.l.string({ format: "at-uri" })),
852
+ redirectUrl: import_lex16.l.optional(import_lex16.l.string({ format: "uri" }))
851
853
  }),
852
854
  import_lex16.l.jsonPayload({
853
855
  subscriptionUri: import_lex16.l.string({ format: "at-uri" }),
854
856
  subscription: import_lex16.l.ref(
855
857
  (() => main3)
856
858
  ),
857
- cartUri: import_lex16.l.string({ format: "at-uri" }),
858
- cart: import_lex16.l.ref((() => main)),
859
- checkoutUrl: import_lex16.l.string({ format: "uri" })
859
+ cartUri: import_lex16.l.optional(import_lex16.l.string({ format: "at-uri" })),
860
+ cart: import_lex16.l.optional(
861
+ import_lex16.l.ref((() => main))
862
+ ),
863
+ checkoutUrl: import_lex16.l.optional(import_lex16.l.string({ format: "uri" }))
860
864
  })
861
865
  );
862
866
  var $lxm10 = main16.nsid;
@@ -932,7 +936,7 @@ var main18 = import_lex18.l.query(
932
936
  subscriptions: import_lex18.l.array(
933
937
  import_lex18.l.ref((() => subscriptionResponse))
934
938
  ),
935
- cursor: import_lex18.l.optional(import_lex18.l.string())
939
+ cursor: import_lex18.l.optional(import_lex18.l.string({ maxLength: 512 }))
936
940
  })
937
941
  );
938
942
  var $lxm12 = main18.nsid;
@@ -1032,7 +1036,7 @@ var main20 = import_lex20.l.procedure(
1032
1036
  subject: import_lex20.l.string({ format: "did" }),
1033
1037
  recordUri: import_lex20.l.optional(import_lex20.l.string({ format: "at-uri" })),
1034
1038
  amount: import_lex20.l.integer(),
1035
- currency: import_lex20.l.string(),
1039
+ currency: import_lex20.l.string({ maxLength: 3 }),
1036
1040
  cartUri: import_lex20.l.optional(import_lex20.l.string({ format: "at-uri" })),
1037
1041
  redirectUrl: import_lex20.l.optional(import_lex20.l.string({ format: "uri" })),
1038
1042
  message: import_lex20.l.optional(import_lex20.l.string({ maxGraphemes: 500, maxLength: 5e3 }))
@@ -1040,9 +1044,11 @@ var main20 = import_lex20.l.procedure(
1040
1044
  import_lex20.l.jsonPayload({
1041
1045
  tipUri: import_lex20.l.string({ format: "at-uri" }),
1042
1046
  tip: import_lex20.l.ref((() => main2)),
1043
- cartUri: import_lex20.l.string({ format: "at-uri" }),
1044
- cart: import_lex20.l.ref((() => main)),
1045
- checkoutUrl: import_lex20.l.string({ format: "uri" })
1047
+ cartUri: import_lex20.l.optional(import_lex20.l.string({ format: "at-uri" })),
1048
+ cart: import_lex20.l.optional(
1049
+ import_lex20.l.ref((() => main))
1050
+ ),
1051
+ checkoutUrl: import_lex20.l.optional(import_lex20.l.string({ format: "uri" }))
1046
1052
  })
1047
1053
  );
1048
1054
  var $lxm14 = main20.nsid;
@@ -1112,7 +1118,7 @@ var main22 = import_lex22.l.query(
1112
1118
  import_lex22.l.params(),
1113
1119
  import_lex22.l.jsonPayload({
1114
1120
  records: import_lex22.l.array(import_lex22.l.ref((() => main2))),
1115
- cursor: import_lex22.l.optional(import_lex22.l.string())
1121
+ cursor: import_lex22.l.optional(import_lex22.l.string({ maxLength: 512 }))
1116
1122
  })
1117
1123
  );
1118
1124
  var $lxm16 = main22.nsid;
@@ -1263,7 +1269,7 @@ var main25 = import_lex25.l.query(
1263
1269
  $nsid25,
1264
1270
  import_lex25.l.params({
1265
1271
  subject: import_lex25.l.string({ format: "did" }),
1266
- cursor: import_lex25.l.optional(import_lex25.l.string()),
1272
+ cursor: import_lex25.l.optional(import_lex25.l.string({ maxLength: 512 })),
1267
1273
  limit: import_lex25.l.optional(
1268
1274
  import_lex25.l.withDefault(import_lex25.l.integer({ minimum: 1, maximum: 100 }), 50)
1269
1275
  )
@@ -1272,7 +1278,7 @@ var main25 = import_lex25.l.query(
1272
1278
  subscriptions: import_lex25.l.array(
1273
1279
  import_lex25.l.ref((() => subscriptionResponse2))
1274
1280
  ),
1275
- cursor: import_lex25.l.optional(import_lex25.l.string())
1281
+ cursor: import_lex25.l.optional(import_lex25.l.string({ maxLength: 512 }))
1276
1282
  })
1277
1283
  );
1278
1284
  var $lxm19 = main25.nsid;
@@ -1322,8 +1328,8 @@ var main26 = import_lex26.l.query(
1322
1328
  import_lex26.l.jsonPayload({
1323
1329
  valid: import_lex26.l.boolean(),
1324
1330
  amount: import_lex26.l.optional(import_lex26.l.integer()),
1325
- currency: import_lex26.l.optional(import_lex26.l.string()),
1326
- reason: import_lex26.l.optional(import_lex26.l.string())
1331
+ currency: import_lex26.l.optional(import_lex26.l.string({ maxLength: 3 })),
1332
+ reason: import_lex26.l.optional(import_lex26.l.string({ maxLength: 1024 }))
1327
1333
  })
1328
1334
  );
1329
1335
  var $lxm20 = main26.nsid;
@@ -1365,14 +1371,14 @@ var main27 = import_lex27.l.query(
1365
1371
  $nsid27,
1366
1372
  import_lex27.l.params({
1367
1373
  subject: import_lex27.l.string({ format: "did" }),
1368
- cursor: import_lex27.l.optional(import_lex27.l.string()),
1374
+ cursor: import_lex27.l.optional(import_lex27.l.string({ maxLength: 512 })),
1369
1375
  limit: import_lex27.l.optional(
1370
1376
  import_lex27.l.withDefault(import_lex27.l.integer({ minimum: 1, maximum: 100 }), 50)
1371
1377
  )
1372
1378
  }),
1373
1379
  import_lex27.l.jsonPayload({
1374
1380
  tips: import_lex27.l.array(import_lex27.l.ref((() => tipResponse))),
1375
- cursor: import_lex27.l.optional(import_lex27.l.string())
1381
+ cursor: import_lex27.l.optional(import_lex27.l.string({ maxLength: 512 }))
1376
1382
  })
1377
1383
  );
1378
1384
  var $lxm21 = main27.nsid;
@@ -1421,8 +1427,8 @@ var main28 = import_lex28.l.query(
1421
1427
  import_lex28.l.jsonPayload({
1422
1428
  valid: import_lex28.l.boolean(),
1423
1429
  amount: import_lex28.l.optional(import_lex28.l.integer()),
1424
- currency: import_lex28.l.optional(import_lex28.l.string()),
1425
- reason: import_lex28.l.optional(import_lex28.l.string())
1430
+ currency: import_lex28.l.optional(import_lex28.l.string({ maxLength: 3 })),
1431
+ reason: import_lex28.l.optional(import_lex28.l.string({ maxLength: 1024 }))
1426
1432
  })
1427
1433
  );
1428
1434
  var $lxm22 = main28.nsid;
@@ -1562,6 +1568,7 @@ var create_default = {
1562
1568
  properties: {
1563
1569
  currency: {
1564
1570
  type: "string",
1571
+ maxLength: 3,
1565
1572
  description: "ISO 4217 currency code"
1566
1573
  },
1567
1574
  redirectUrl: {
@@ -1683,10 +1690,13 @@ var list_default = {
1683
1690
  properties: {
1684
1691
  status: {
1685
1692
  type: "string",
1686
- description: "Filter: open, completed, expired, abandoned"
1693
+ maxLength: 64,
1694
+ enum: ["open", "completed", "expired", "abandoned"],
1695
+ description: "Filter by cart status"
1687
1696
  },
1688
1697
  cursor: {
1689
1698
  type: "string",
1699
+ maxLength: 512,
1690
1700
  description: "Pagination cursor"
1691
1701
  },
1692
1702
  limit: {
@@ -1713,6 +1723,7 @@ var list_default = {
1713
1723
  },
1714
1724
  cursor: {
1715
1725
  type: "string",
1726
+ maxLength: 512,
1716
1727
  description: "Pagination cursor for next page"
1717
1728
  }
1718
1729
  },
@@ -1935,6 +1946,7 @@ var cart_default = {
1935
1946
  },
1936
1947
  currency: {
1937
1948
  type: "string",
1949
+ maxLength: 3,
1938
1950
  description: "ISO 4217 currency code"
1939
1951
  },
1940
1952
  total: {
@@ -1943,7 +1955,9 @@ var cart_default = {
1943
1955
  },
1944
1956
  status: {
1945
1957
  type: "string",
1946
- description: "Cart status: open, completed, expired, abandoned"
1958
+ maxLength: 64,
1959
+ enum: ["open", "completed", "expired", "abandoned"],
1960
+ description: "Cart status"
1947
1961
  },
1948
1962
  createdAt: {
1949
1963
  type: "string",
@@ -1969,6 +1983,7 @@ var cart_default = {
1969
1983
  properties: {
1970
1984
  type: {
1971
1985
  type: "string",
1986
+ maxLength: 128,
1972
1987
  description: "Item type: tip or subscription",
1973
1988
  enum: ["com.atiproto.tip", "com.atiproto.subscription"]
1974
1989
  },
@@ -1997,6 +2012,7 @@ var list_default2 = {
1997
2012
  properties: {
1998
2013
  cursor: {
1999
2014
  type: "string",
2015
+ maxLength: 512,
2000
2016
  description: "Pagination cursor"
2001
2017
  },
2002
2018
  limit: {
@@ -2024,6 +2040,7 @@ var list_default2 = {
2024
2040
  },
2025
2041
  cursor: {
2026
2042
  type: "string",
2043
+ maxLength: 512,
2027
2044
  description: "Pagination cursor for next page"
2028
2045
  }
2029
2046
  }
@@ -2103,10 +2120,23 @@ var create_default2 = {
2103
2120
  },
2104
2121
  currency: {
2105
2122
  description: "ISO 4217 currency code",
2123
+ maxLength: 3,
2106
2124
  type: "string"
2107
2125
  },
2108
2126
  interval: {
2109
- description: "Billing interval: monthly or yearly",
2127
+ description: "Billing interval",
2128
+ maxLength: 64,
2129
+ enum: ["monthly", "yearly"],
2130
+ type: "string"
2131
+ },
2132
+ cartUri: {
2133
+ description: "AT-URI of an existing cart to add this subscription to. If omitted, a new cart is created.",
2134
+ format: "at-uri",
2135
+ type: "string"
2136
+ },
2137
+ redirectUrl: {
2138
+ description: "URL to redirect to after checkout completes",
2139
+ format: "uri",
2110
2140
  type: "string"
2111
2141
  }
2112
2142
  },
@@ -2144,13 +2174,7 @@ var create_default2 = {
2144
2174
  type: "string"
2145
2175
  }
2146
2176
  },
2147
- required: [
2148
- "subscriptionUri",
2149
- "subscription",
2150
- "cartUri",
2151
- "cart",
2152
- "checkoutUrl"
2153
- ],
2177
+ required: ["subscriptionUri", "subscription"],
2154
2178
  type: "object"
2155
2179
  }
2156
2180
  },
@@ -2223,6 +2247,7 @@ var list_default3 = {
2223
2247
  properties: {
2224
2248
  cursor: {
2225
2249
  type: "string",
2250
+ maxLength: 512,
2226
2251
  description: "Pagination cursor"
2227
2252
  },
2228
2253
  limit: {
@@ -2250,6 +2275,7 @@ var list_default3 = {
2250
2275
  },
2251
2276
  cursor: {
2252
2277
  type: "string",
2278
+ maxLength: 512,
2253
2279
  description: "Pagination cursor for next page"
2254
2280
  }
2255
2281
  }
@@ -2353,6 +2379,7 @@ var create_default3 = {
2353
2379
  },
2354
2380
  currency: {
2355
2381
  type: "string",
2382
+ maxLength: 3,
2356
2383
  description: "ISO 4217 currency code"
2357
2384
  },
2358
2385
  cartUri: {
@@ -2378,7 +2405,7 @@ var create_default3 = {
2378
2405
  encoding: "application/json",
2379
2406
  schema: {
2380
2407
  type: "object",
2381
- required: ["tipUri", "tip", "cartUri", "cart", "checkoutUrl"],
2408
+ required: ["tipUri", "tip"],
2382
2409
  properties: {
2383
2410
  tipUri: {
2384
2411
  type: "string",
@@ -2474,6 +2501,7 @@ var list_default4 = {
2474
2501
  properties: {
2475
2502
  cursor: {
2476
2503
  type: "string",
2504
+ maxLength: 512,
2477
2505
  description: "Pagination cursor"
2478
2506
  },
2479
2507
  limit: {
@@ -2501,6 +2529,7 @@ var list_default4 = {
2501
2529
  },
2502
2530
  cursor: {
2503
2531
  type: "string",
2532
+ maxLength: 512,
2504
2533
  description: "Pagination cursor for next page"
2505
2534
  }
2506
2535
  }
@@ -2660,6 +2689,7 @@ var search_default = {
2660
2689
  },
2661
2690
  cursor: {
2662
2691
  type: "string",
2692
+ maxLength: 512,
2663
2693
  description: "Pagination cursor"
2664
2694
  },
2665
2695
  limit: {
@@ -2687,6 +2717,7 @@ var search_default = {
2687
2717
  },
2688
2718
  cursor: {
2689
2719
  type: "string",
2720
+ maxLength: 512,
2690
2721
  description: "Pagination cursor for next page"
2691
2722
  }
2692
2723
  }
@@ -2760,10 +2791,12 @@ var validate_default = {
2760
2791
  },
2761
2792
  currency: {
2762
2793
  type: "string",
2794
+ maxLength: 3,
2763
2795
  description: "Currency of the subscription"
2764
2796
  },
2765
2797
  reason: {
2766
2798
  type: "string",
2799
+ maxLength: 1024,
2767
2800
  description: "If invalid, reason for rejection"
2768
2801
  }
2769
2802
  }
@@ -2791,6 +2824,7 @@ var search_default2 = {
2791
2824
  },
2792
2825
  cursor: {
2793
2826
  type: "string",
2827
+ maxLength: 512,
2794
2828
  description: "Pagination cursor"
2795
2829
  },
2796
2830
  limit: {
@@ -2818,6 +2852,7 @@ var search_default2 = {
2818
2852
  },
2819
2853
  cursor: {
2820
2854
  type: "string",
2855
+ maxLength: 512,
2821
2856
  description: "Pagination cursor for next page"
2822
2857
  }
2823
2858
  }
@@ -2896,10 +2931,12 @@ var validate_default2 = {
2896
2931
  },
2897
2932
  currency: {
2898
2933
  type: "string",
2934
+ maxLength: 3,
2899
2935
  description: "Currency of the tips"
2900
2936
  },
2901
2937
  reason: {
2902
2938
  type: "string",
2939
+ maxLength: 1024,
2903
2940
  description: "If invalid, reason for rejection"
2904
2941
  }
2905
2942
  }
@@ -2932,7 +2969,7 @@ var authEnhanced_default = {
2932
2969
  {
2933
2970
  type: "permission",
2934
2971
  resource: "rpc",
2935
- aud: "did:web:atiproto.com#payments",
2972
+ inheritAud: true,
2936
2973
  lxm: [
2937
2974
  "com.atiproto.account.cart.clone",
2938
2975
  "com.atiproto.account.cart.create",
@@ -2971,7 +3008,7 @@ var authGeneral_default = {
2971
3008
  main: {
2972
3009
  type: "permission-set",
2973
3010
  title: "General Access",
2974
- detail: "Write access to cart, subscription, and tip records, plus RPC access to all non-profile endpoints.",
3011
+ detail: "Write access to cart, subscription, and tip records, plus RPC access to payment, feed, and public profile lookup endpoints.",
2975
3012
  permissions: [
2976
3013
  {
2977
3014
  type: "permission",
@@ -2985,7 +3022,7 @@ var authGeneral_default = {
2985
3022
  {
2986
3023
  type: "permission",
2987
3024
  resource: "rpc",
2988
- aud: "did:web:atiproto.com#payments",
3025
+ inheritAud: true,
2989
3026
  lxm: [
2990
3027
  "com.atiproto.account.cart.clone",
2991
3028
  "com.atiproto.account.cart.create",
@@ -3034,14 +3071,19 @@ var subscription_default = {
3034
3071
  },
3035
3072
  currency: {
3036
3073
  description: "ISO 4217 currency code",
3074
+ maxLength: 3,
3037
3075
  type: "string"
3038
3076
  },
3039
3077
  interval: {
3040
- description: "Billing interval: monthly or yearly",
3078
+ description: "Billing interval",
3079
+ maxLength: 64,
3080
+ enum: ["monthly", "yearly"],
3041
3081
  type: "string"
3042
3082
  },
3043
3083
  status: {
3044
- description: "Subscription status: pending, active, past_due, cancelled, expired",
3084
+ description: "Subscription status",
3085
+ maxLength: 64,
3086
+ enum: ["pending", "active", "past_due", "cancelled", "expired"],
3045
3087
  type: "string"
3046
3088
  },
3047
3089
  billingStartDate: {
@@ -3108,10 +3150,12 @@ var tip_default = {
3108
3150
  },
3109
3151
  currency: {
3110
3152
  description: "ISO 4217 currency code",
3153
+ maxLength: 3,
3111
3154
  type: "string"
3112
3155
  },
3113
3156
  status: {
3114
- description: "Tip status: pending, authorized (payment held), completed, failed, refunded",
3157
+ description: "Tip status",
3158
+ maxLength: 64,
3115
3159
  type: "string",
3116
3160
  enum: ["pending", "authorized", "completed", "failed", "refunded"]
3117
3161
  },