@atproto/lex-client 0.1.0 → 0.1.2

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 (115) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/client.d.ts +79 -25
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +56 -24
  5. package/dist/client.js.map +1 -1
  6. package/dist/lexicons/com/atproto/repo/applyWrites.d.ts +3 -0
  7. package/dist/lexicons/com/atproto/repo/applyWrites.d.ts.map +1 -0
  8. package/dist/lexicons/com/atproto/repo/applyWrites.defs.d.ts +100 -0
  9. package/dist/lexicons/com/atproto/repo/applyWrites.defs.d.ts.map +1 -0
  10. package/dist/lexicons/com/atproto/repo/applyWrites.defs.js +81 -0
  11. package/dist/lexicons/com/atproto/repo/applyWrites.defs.js.map +1 -0
  12. package/dist/lexicons/com/atproto/repo/applyWrites.js +6 -0
  13. package/dist/lexicons/com/atproto/repo/applyWrites.js.map +1 -0
  14. package/dist/lexicons/com/atproto/repo/createRecord.d.ts +1 -1
  15. package/dist/lexicons/com/atproto/repo/createRecord.d.ts.map +1 -1
  16. package/dist/lexicons/com/atproto/repo/createRecord.defs.d.ts +16 -13
  17. package/dist/lexicons/com/atproto/repo/createRecord.defs.d.ts.map +1 -1
  18. package/dist/lexicons/com/atproto/repo/createRecord.defs.js +10 -10
  19. package/dist/lexicons/com/atproto/repo/createRecord.defs.js.map +1 -1
  20. package/dist/lexicons/com/atproto/repo/createRecord.js +1 -1
  21. package/dist/lexicons/com/atproto/repo/createRecord.js.map +1 -1
  22. package/dist/lexicons/com/atproto/repo/defs.d.ts +0 -1
  23. package/dist/lexicons/com/atproto/repo/defs.d.ts.map +1 -1
  24. package/dist/lexicons/com/atproto/repo/defs.js +0 -1
  25. package/dist/lexicons/com/atproto/repo/defs.js.map +1 -1
  26. package/dist/lexicons/com/atproto/repo/deleteRecord.d.ts +1 -1
  27. package/dist/lexicons/com/atproto/repo/deleteRecord.d.ts.map +1 -1
  28. package/dist/lexicons/com/atproto/repo/deleteRecord.defs.d.ts +16 -13
  29. package/dist/lexicons/com/atproto/repo/deleteRecord.defs.d.ts.map +1 -1
  30. package/dist/lexicons/com/atproto/repo/deleteRecord.defs.js +10 -10
  31. package/dist/lexicons/com/atproto/repo/deleteRecord.defs.js.map +1 -1
  32. package/dist/lexicons/com/atproto/repo/deleteRecord.js +1 -1
  33. package/dist/lexicons/com/atproto/repo/deleteRecord.js.map +1 -1
  34. package/dist/lexicons/com/atproto/repo/getRecord.d.ts +1 -1
  35. package/dist/lexicons/com/atproto/repo/getRecord.d.ts.map +1 -1
  36. package/dist/lexicons/com/atproto/repo/getRecord.defs.d.ts +13 -11
  37. package/dist/lexicons/com/atproto/repo/getRecord.defs.d.ts.map +1 -1
  38. package/dist/lexicons/com/atproto/repo/getRecord.defs.js +7 -9
  39. package/dist/lexicons/com/atproto/repo/getRecord.defs.js.map +1 -1
  40. package/dist/lexicons/com/atproto/repo/getRecord.js +1 -1
  41. package/dist/lexicons/com/atproto/repo/getRecord.js.map +1 -1
  42. package/dist/lexicons/com/atproto/repo/listRecords.d.ts +1 -1
  43. package/dist/lexicons/com/atproto/repo/listRecords.d.ts.map +1 -1
  44. package/dist/lexicons/com/atproto/repo/listRecords.defs.d.ts +13 -11
  45. package/dist/lexicons/com/atproto/repo/listRecords.defs.d.ts.map +1 -1
  46. package/dist/lexicons/com/atproto/repo/listRecords.defs.js +7 -9
  47. package/dist/lexicons/com/atproto/repo/listRecords.defs.js.map +1 -1
  48. package/dist/lexicons/com/atproto/repo/listRecords.js +1 -1
  49. package/dist/lexicons/com/atproto/repo/listRecords.js.map +1 -1
  50. package/dist/lexicons/com/atproto/repo/putRecord.d.ts +1 -1
  51. package/dist/lexicons/com/atproto/repo/putRecord.d.ts.map +1 -1
  52. package/dist/lexicons/com/atproto/repo/putRecord.defs.d.ts +16 -13
  53. package/dist/lexicons/com/atproto/repo/putRecord.defs.d.ts.map +1 -1
  54. package/dist/lexicons/com/atproto/repo/putRecord.defs.js +10 -10
  55. package/dist/lexicons/com/atproto/repo/putRecord.defs.js.map +1 -1
  56. package/dist/lexicons/com/atproto/repo/putRecord.js +1 -1
  57. package/dist/lexicons/com/atproto/repo/putRecord.js.map +1 -1
  58. package/dist/lexicons/com/atproto/repo/uploadBlob.d.ts +1 -1
  59. package/dist/lexicons/com/atproto/repo/uploadBlob.d.ts.map +1 -1
  60. package/dist/lexicons/com/atproto/repo/uploadBlob.defs.d.ts +11 -8
  61. package/dist/lexicons/com/atproto/repo/uploadBlob.defs.d.ts.map +1 -1
  62. package/dist/lexicons/com/atproto/repo/uploadBlob.defs.js +7 -7
  63. package/dist/lexicons/com/atproto/repo/uploadBlob.defs.js.map +1 -1
  64. package/dist/lexicons/com/atproto/repo/uploadBlob.js +1 -1
  65. package/dist/lexicons/com/atproto/repo/uploadBlob.js.map +1 -1
  66. package/dist/lexicons/com/atproto/repo.d.ts +2 -1
  67. package/dist/lexicons/com/atproto/repo.d.ts.map +1 -1
  68. package/dist/lexicons/com/atproto/repo.js +2 -1
  69. package/dist/lexicons/com/atproto/repo.js.map +1 -1
  70. package/dist/lexicons/com/atproto/sync/getBlob.d.ts +1 -1
  71. package/dist/lexicons/com/atproto/sync/getBlob.d.ts.map +1 -1
  72. package/dist/lexicons/com/atproto/sync/getBlob.defs.d.ts +11 -9
  73. package/dist/lexicons/com/atproto/sync/getBlob.defs.d.ts.map +1 -1
  74. package/dist/lexicons/com/atproto/sync/getBlob.defs.js +6 -8
  75. package/dist/lexicons/com/atproto/sync/getBlob.defs.js.map +1 -1
  76. package/dist/lexicons/com/atproto/sync/getBlob.js +1 -1
  77. package/dist/lexicons/com/atproto/sync/getBlob.js.map +1 -1
  78. package/dist/types.d.ts +2 -6
  79. package/dist/types.d.ts.map +1 -1
  80. package/dist/types.js.map +1 -1
  81. package/dist/util.d.ts +9 -0
  82. package/dist/util.d.ts.map +1 -1
  83. package/dist/util.js +23 -0
  84. package/dist/util.js.map +1 -1
  85. package/dist/write-operation-builder.d.ts +19 -0
  86. package/dist/write-operation-builder.d.ts.map +1 -0
  87. package/dist/write-operation-builder.js +35 -0
  88. package/dist/write-operation-builder.js.map +1 -0
  89. package/dist/xrpc.d.ts.map +1 -1
  90. package/dist/xrpc.js +5 -2
  91. package/dist/xrpc.js.map +1 -1
  92. package/package.json +4 -4
  93. package/src/client.ts +122 -82
  94. package/src/lexicons/com/atproto/repo/applyWrites.defs.ts +201 -0
  95. package/src/lexicons/com/atproto/repo/applyWrites.ts +6 -0
  96. package/src/lexicons/com/atproto/repo/createRecord.defs.ts +43 -46
  97. package/src/lexicons/com/atproto/repo/createRecord.ts +1 -1
  98. package/src/lexicons/com/atproto/repo/defs.ts +0 -1
  99. package/src/lexicons/com/atproto/repo/deleteRecord.defs.ts +37 -40
  100. package/src/lexicons/com/atproto/repo/deleteRecord.ts +1 -1
  101. package/src/lexicons/com/atproto/repo/getRecord.defs.ts +23 -26
  102. package/src/lexicons/com/atproto/repo/getRecord.ts +1 -1
  103. package/src/lexicons/com/atproto/repo/listRecords.defs.ts +30 -32
  104. package/src/lexicons/com/atproto/repo/listRecords.ts +1 -1
  105. package/src/lexicons/com/atproto/repo/putRecord.defs.ts +44 -47
  106. package/src/lexicons/com/atproto/repo/putRecord.ts +1 -1
  107. package/src/lexicons/com/atproto/repo/uploadBlob.defs.ts +21 -23
  108. package/src/lexicons/com/atproto/repo/uploadBlob.ts +1 -1
  109. package/src/lexicons/com/atproto/repo.ts +2 -1
  110. package/src/lexicons/com/atproto/sync/getBlob.defs.ts +23 -26
  111. package/src/lexicons/com/atproto/sync/getBlob.ts +1 -1
  112. package/src/types.ts +6 -10
  113. package/src/util.ts +48 -1
  114. package/src/write-operation-builder.ts +110 -0
  115. package/src/xrpc.ts +5 -5
@@ -0,0 +1,201 @@
1
+ /*
2
+ * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
3
+ */
4
+
5
+ import { l } from '@atproto/lex-schema'
6
+ import * as RepoDefs from './defs.defs.js'
7
+
8
+ const $nsid = 'com.atproto.repo.applyWrites'
9
+
10
+ export { $nsid }
11
+
12
+ export const $params = /*#__PURE__*/ l.params()
13
+
14
+ export type $Params = l.InferOutput<typeof $params>
15
+
16
+ export const $input = /*#__PURE__*/ l.jsonPayload({
17
+ repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),
18
+ validate: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),
19
+ writes: /*#__PURE__*/ l.array(
20
+ /*#__PURE__*/ l.typedUnion(
21
+ [
22
+ /*#__PURE__*/ l.typedRef<Create>((() => create) as any),
23
+ /*#__PURE__*/ l.typedRef<Update>((() => update) as any),
24
+ /*#__PURE__*/ l.typedRef<Delete$0>((() => delete$0) as any),
25
+ ],
26
+ true,
27
+ ),
28
+ ),
29
+ swapCommit: /*#__PURE__*/ l.optional(
30
+ /*#__PURE__*/ l.string({ format: 'cid' }),
31
+ ),
32
+ })
33
+
34
+ export type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>
35
+ export type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>
36
+
37
+ export const $output = /*#__PURE__*/ l.jsonPayload({
38
+ commit: /*#__PURE__*/ l.optional(
39
+ /*#__PURE__*/ l.ref<RepoDefs.CommitMeta>(
40
+ (() => RepoDefs.commitMeta) as any,
41
+ ),
42
+ ),
43
+ results: /*#__PURE__*/ l.optional(
44
+ /*#__PURE__*/ l.array(
45
+ /*#__PURE__*/ l.typedUnion(
46
+ [
47
+ /*#__PURE__*/ l.typedRef<CreateResult>((() => createResult) as any),
48
+ /*#__PURE__*/ l.typedRef<UpdateResult>((() => updateResult) as any),
49
+ /*#__PURE__*/ l.typedRef<DeleteResult>((() => deleteResult) as any),
50
+ ],
51
+ true,
52
+ ),
53
+ ),
54
+ ),
55
+ })
56
+
57
+ export type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>
58
+ export type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<
59
+ typeof $output,
60
+ B
61
+ >
62
+
63
+ /** Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS. */
64
+ const main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output, [
65
+ 'InvalidSwap',
66
+ ])
67
+
68
+ export { main }
69
+
70
+ export const $lxm = $nsid
71
+
72
+ /** Operation which creates a new record. */
73
+ type Create = {
74
+ $type?: 'com.atproto.repo.applyWrites#create'
75
+ collection: l.NsidString
76
+
77
+ /**
78
+ * NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility.
79
+ */
80
+ rkey?: l.RecordKeyString
81
+ value: l.LexMap
82
+ }
83
+
84
+ export type { Create }
85
+
86
+ /** Operation which creates a new record. */
87
+ const create = /*#__PURE__*/ l.typedObject<Create>(
88
+ $nsid,
89
+ 'create',
90
+ /*#__PURE__*/ l.object({
91
+ collection: /*#__PURE__*/ l.string({ format: 'nsid' }),
92
+ rkey: /*#__PURE__*/ l.optional(
93
+ /*#__PURE__*/ l.string({ maxLength: 512, format: 'record-key' }),
94
+ ),
95
+ value: /*#__PURE__*/ l.lexMap(),
96
+ }),
97
+ )
98
+
99
+ export { create }
100
+
101
+ /** Operation which updates an existing record. */
102
+ type Update = {
103
+ $type?: 'com.atproto.repo.applyWrites#update'
104
+ collection: l.NsidString
105
+ rkey: l.RecordKeyString
106
+ value: l.LexMap
107
+ }
108
+
109
+ export type { Update }
110
+
111
+ /** Operation which updates an existing record. */
112
+ const update = /*#__PURE__*/ l.typedObject<Update>(
113
+ $nsid,
114
+ 'update',
115
+ /*#__PURE__*/ l.object({
116
+ collection: /*#__PURE__*/ l.string({ format: 'nsid' }),
117
+ rkey: /*#__PURE__*/ l.string({ format: 'record-key' }),
118
+ value: /*#__PURE__*/ l.lexMap(),
119
+ }),
120
+ )
121
+
122
+ export { update }
123
+
124
+ /** Operation which deletes an existing record. */
125
+ type Delete$0 = {
126
+ $type?: 'com.atproto.repo.applyWrites#delete'
127
+ collection: l.NsidString
128
+ rkey: l.RecordKeyString
129
+ }
130
+
131
+ export type { Delete$0 as Delete }
132
+
133
+ /** Operation which deletes an existing record. */
134
+ const delete$0 = /*#__PURE__*/ l.typedObject<Delete$0>(
135
+ $nsid,
136
+ 'delete',
137
+ /*#__PURE__*/ l.object({
138
+ collection: /*#__PURE__*/ l.string({ format: 'nsid' }),
139
+ rkey: /*#__PURE__*/ l.string({ format: 'record-key' }),
140
+ }),
141
+ )
142
+
143
+ export { delete$0 as 'delete' }
144
+
145
+ type CreateResult = {
146
+ $type?: 'com.atproto.repo.applyWrites#createResult'
147
+ uri: l.AtUriString
148
+ cid: l.CidString
149
+ validationStatus?: 'valid' | 'unknown' | l.UnknownString
150
+ }
151
+
152
+ export type { CreateResult }
153
+
154
+ const createResult = /*#__PURE__*/ l.typedObject<CreateResult>(
155
+ $nsid,
156
+ 'createResult',
157
+ /*#__PURE__*/ l.object({
158
+ uri: /*#__PURE__*/ l.string({ format: 'at-uri' }),
159
+ cid: /*#__PURE__*/ l.string({ format: 'cid' }),
160
+ validationStatus: /*#__PURE__*/ l.optional(
161
+ /*#__PURE__*/ l.string<{ knownValues: ['valid', 'unknown'] }>(),
162
+ ),
163
+ }),
164
+ )
165
+
166
+ export { createResult }
167
+
168
+ type UpdateResult = {
169
+ $type?: 'com.atproto.repo.applyWrites#updateResult'
170
+ uri: l.AtUriString
171
+ cid: l.CidString
172
+ validationStatus?: 'valid' | 'unknown' | l.UnknownString
173
+ }
174
+
175
+ export type { UpdateResult }
176
+
177
+ const updateResult = /*#__PURE__*/ l.typedObject<UpdateResult>(
178
+ $nsid,
179
+ 'updateResult',
180
+ /*#__PURE__*/ l.object({
181
+ uri: /*#__PURE__*/ l.string({ format: 'at-uri' }),
182
+ cid: /*#__PURE__*/ l.string({ format: 'cid' }),
183
+ validationStatus: /*#__PURE__*/ l.optional(
184
+ /*#__PURE__*/ l.string<{ knownValues: ['valid', 'unknown'] }>(),
185
+ ),
186
+ }),
187
+ )
188
+
189
+ export { updateResult }
190
+
191
+ type DeleteResult = { $type?: 'com.atproto.repo.applyWrites#deleteResult' }
192
+
193
+ export type { DeleteResult }
194
+
195
+ const deleteResult = /*#__PURE__*/ l.typedObject<DeleteResult>(
196
+ $nsid,
197
+ 'deleteResult',
198
+ /*#__PURE__*/ l.object({}),
199
+ )
200
+
201
+ export { deleteResult }
@@ -0,0 +1,6 @@
1
+ /*
2
+ * THIS FILE WAS GENERATED BY "@atproto/lex". DO NOT EDIT.
3
+ */
4
+
5
+ export * from './applyWrites.defs.js'
6
+ export { main as default } from './applyWrites.defs.js'
@@ -9,53 +9,50 @@ const $nsid = 'com.atproto.repo.createRecord'
9
9
 
10
10
  export { $nsid }
11
11
 
12
- /** Create a single new repository record. Requires auth, implemented by PDS. */
13
- const main =
14
- /*#__PURE__*/
15
- l.procedure(
16
- $nsid,
17
- /*#__PURE__*/ l.params(),
18
- /*#__PURE__*/ l.jsonPayload({
19
- repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),
20
- collection: /*#__PURE__*/ l.string({ format: 'nsid' }),
21
- rkey: /*#__PURE__*/ l.optional(
22
- /*#__PURE__*/ l.string({ format: 'record-key', maxLength: 512 }),
23
- ),
24
- validate: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),
25
- record: /*#__PURE__*/ l.lexMap(),
26
- swapCommit: /*#__PURE__*/ l.optional(
27
- /*#__PURE__*/ l.string({ format: 'cid' }),
28
- ),
29
- }),
30
- /*#__PURE__*/ l.jsonPayload({
31
- uri: /*#__PURE__*/ l.string({ format: 'at-uri' }),
32
- cid: /*#__PURE__*/ l.string({ format: 'cid' }),
33
- commit: /*#__PURE__*/ l.optional(
34
- /*#__PURE__*/ l.ref<RepoDefs.CommitMeta>(
35
- (() => RepoDefs.commitMeta) as any,
36
- ),
37
- ),
38
- validationStatus: /*#__PURE__*/ l.optional(
39
- /*#__PURE__*/ l.string<{ knownValues: ['valid', 'unknown'] }>(),
40
- ),
41
- }),
42
- ['InvalidSwap'],
43
- )
44
- export { main }
12
+ export const $params = /*#__PURE__*/ l.params()
45
13
 
46
- export type $Params = l.InferMethodParams<typeof main>
47
- export type $Input<B = l.BinaryData> = l.InferMethodInput<typeof main, B>
48
- export type $InputBody<B = l.BinaryData> = l.InferMethodInputBody<
49
- typeof main,
50
- B
51
- >
52
- export type $Output<B = l.BinaryData> = l.InferMethodOutput<typeof main, B>
53
- export type $OutputBody<B = l.BinaryData> = l.InferMethodOutputBody<
54
- typeof main,
14
+ export type $Params = l.InferOutput<typeof $params>
15
+
16
+ export const $input = /*#__PURE__*/ l.jsonPayload({
17
+ repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),
18
+ collection: /*#__PURE__*/ l.string({ format: 'nsid' }),
19
+ rkey: /*#__PURE__*/ l.optional(
20
+ /*#__PURE__*/ l.string({ format: 'record-key', maxLength: 512 }),
21
+ ),
22
+ validate: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),
23
+ record: /*#__PURE__*/ l.lexMap(),
24
+ swapCommit: /*#__PURE__*/ l.optional(
25
+ /*#__PURE__*/ l.string({ format: 'cid' }),
26
+ ),
27
+ })
28
+
29
+ export type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>
30
+ export type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>
31
+
32
+ export const $output = /*#__PURE__*/ l.jsonPayload({
33
+ uri: /*#__PURE__*/ l.string({ format: 'at-uri' }),
34
+ cid: /*#__PURE__*/ l.string({ format: 'cid' }),
35
+ commit: /*#__PURE__*/ l.optional(
36
+ /*#__PURE__*/ l.ref<RepoDefs.CommitMeta>(
37
+ (() => RepoDefs.commitMeta) as any,
38
+ ),
39
+ ),
40
+ validationStatus: /*#__PURE__*/ l.optional(
41
+ /*#__PURE__*/ l.string<{ knownValues: ['valid', 'unknown'] }>(),
42
+ ),
43
+ })
44
+
45
+ export type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>
46
+ export type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<
47
+ typeof $output,
55
48
  B
56
49
  >
57
50
 
58
- export const $lxm = /*#__PURE__*/ main.nsid,
59
- $params = /*#__PURE__*/ main.parameters,
60
- $input = /*#__PURE__*/ main.input,
61
- $output = /*#__PURE__*/ main.output
51
+ /** Create a single new repository record. Requires auth, implemented by PDS. */
52
+ const main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output, [
53
+ 'InvalidSwap',
54
+ ])
55
+
56
+ export { main }
57
+
58
+ export const $lxm = $nsid
@@ -3,4 +3,4 @@
3
3
  */
4
4
 
5
5
  export * from './createRecord.defs.js'
6
- export * as $defs from './createRecord.defs.js'
6
+ export { main as default } from './createRecord.defs.js'
@@ -3,4 +3,3 @@
3
3
  */
4
4
 
5
5
  export * from './defs.defs.js'
6
- export * as $defs from './defs.defs.js'
@@ -9,47 +9,44 @@ const $nsid = 'com.atproto.repo.deleteRecord'
9
9
 
10
10
  export { $nsid }
11
11
 
12
- /** Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS. */
13
- const main =
14
- /*#__PURE__*/
15
- l.procedure(
16
- $nsid,
17
- /*#__PURE__*/ l.params(),
18
- /*#__PURE__*/ l.jsonPayload({
19
- repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),
20
- collection: /*#__PURE__*/ l.string({ format: 'nsid' }),
21
- rkey: /*#__PURE__*/ l.string({ format: 'record-key' }),
22
- swapRecord: /*#__PURE__*/ l.optional(
23
- /*#__PURE__*/ l.string({ format: 'cid' }),
24
- ),
25
- swapCommit: /*#__PURE__*/ l.optional(
26
- /*#__PURE__*/ l.string({ format: 'cid' }),
27
- ),
28
- }),
29
- /*#__PURE__*/ l.jsonPayload({
30
- commit: /*#__PURE__*/ l.optional(
31
- /*#__PURE__*/ l.ref<RepoDefs.CommitMeta>(
32
- (() => RepoDefs.commitMeta) as any,
33
- ),
34
- ),
35
- }),
36
- ['InvalidSwap'],
37
- )
38
- export { main }
12
+ export const $params = /*#__PURE__*/ l.params()
39
13
 
40
- export type $Params = l.InferMethodParams<typeof main>
41
- export type $Input<B = l.BinaryData> = l.InferMethodInput<typeof main, B>
42
- export type $InputBody<B = l.BinaryData> = l.InferMethodInputBody<
43
- typeof main,
44
- B
45
- >
46
- export type $Output<B = l.BinaryData> = l.InferMethodOutput<typeof main, B>
47
- export type $OutputBody<B = l.BinaryData> = l.InferMethodOutputBody<
48
- typeof main,
14
+ export type $Params = l.InferOutput<typeof $params>
15
+
16
+ export const $input = /*#__PURE__*/ l.jsonPayload({
17
+ repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),
18
+ collection: /*#__PURE__*/ l.string({ format: 'nsid' }),
19
+ rkey: /*#__PURE__*/ l.string({ format: 'record-key' }),
20
+ swapRecord: /*#__PURE__*/ l.optional(
21
+ /*#__PURE__*/ l.string({ format: 'cid' }),
22
+ ),
23
+ swapCommit: /*#__PURE__*/ l.optional(
24
+ /*#__PURE__*/ l.string({ format: 'cid' }),
25
+ ),
26
+ })
27
+
28
+ export type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>
29
+ export type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>
30
+
31
+ export const $output = /*#__PURE__*/ l.jsonPayload({
32
+ commit: /*#__PURE__*/ l.optional(
33
+ /*#__PURE__*/ l.ref<RepoDefs.CommitMeta>(
34
+ (() => RepoDefs.commitMeta) as any,
35
+ ),
36
+ ),
37
+ })
38
+
39
+ export type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>
40
+ export type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<
41
+ typeof $output,
49
42
  B
50
43
  >
51
44
 
52
- export const $lxm = /*#__PURE__*/ main.nsid,
53
- $params = /*#__PURE__*/ main.parameters,
54
- $input = /*#__PURE__*/ main.input,
55
- $output = /*#__PURE__*/ main.output
45
+ /** Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS. */
46
+ const main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output, [
47
+ 'InvalidSwap',
48
+ ])
49
+
50
+ export { main }
51
+
52
+ export const $lxm = $nsid
@@ -3,4 +3,4 @@
3
3
  */
4
4
 
5
5
  export * from './deleteRecord.defs.js'
6
- export * as $defs from './deleteRecord.defs.js'
6
+ export { main as default } from './deleteRecord.defs.js'
@@ -8,33 +8,30 @@ const $nsid = 'com.atproto.repo.getRecord'
8
8
 
9
9
  export { $nsid }
10
10
 
11
- /** Get a single record from a repository. Does not require auth. */
12
- const main =
13
- /*#__PURE__*/
14
- l.query(
15
- $nsid,
16
- /*#__PURE__*/ l.params({
17
- repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),
18
- collection: /*#__PURE__*/ l.string({ format: 'nsid' }),
19
- rkey: /*#__PURE__*/ l.string({ format: 'record-key' }),
20
- cid: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'cid' })),
21
- }),
22
- /*#__PURE__*/ l.jsonPayload({
23
- uri: /*#__PURE__*/ l.string({ format: 'at-uri' }),
24
- cid: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'cid' })),
25
- value: /*#__PURE__*/ l.lexMap(),
26
- }),
27
- ['RecordNotFound'],
28
- )
29
- export { main }
11
+ export const $params = /*#__PURE__*/ l.params({
12
+ repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),
13
+ collection: /*#__PURE__*/ l.string({ format: 'nsid' }),
14
+ rkey: /*#__PURE__*/ l.string({ format: 'record-key' }),
15
+ cid: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'cid' })),
16
+ })
17
+
18
+ export type $Params = l.InferOutput<typeof $params>
19
+
20
+ export const $output = /*#__PURE__*/ l.jsonPayload({
21
+ uri: /*#__PURE__*/ l.string({ format: 'at-uri' }),
22
+ cid: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string({ format: 'cid' })),
23
+ value: /*#__PURE__*/ l.lexMap(),
24
+ })
30
25
 
31
- export type $Params = l.InferMethodParams<typeof main>
32
- export type $Output<B = l.BinaryData> = l.InferMethodOutput<typeof main, B>
33
- export type $OutputBody<B = l.BinaryData> = l.InferMethodOutputBody<
34
- typeof main,
26
+ export type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>
27
+ export type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<
28
+ typeof $output,
35
29
  B
36
30
  >
37
31
 
38
- export const $lxm = /*#__PURE__*/ main.nsid,
39
- $params = main.parameters,
40
- $output = main.output
32
+ /** Get a single record from a repository. Does not require auth. */
33
+ const main = /*#__PURE__*/ l.query($nsid, $params, $output, ['RecordNotFound'])
34
+
35
+ export { main }
36
+
37
+ export const $lxm = $nsid
@@ -3,4 +3,4 @@
3
3
  */
4
4
 
5
5
  export * from './getRecord.defs.js'
6
- export * as $defs from './getRecord.defs.js'
6
+ export { main as default } from './getRecord.defs.js'
@@ -8,42 +8,40 @@ const $nsid = 'com.atproto.repo.listRecords'
8
8
 
9
9
  export { $nsid }
10
10
 
11
- /** List a range of records in a repository, matching a specific collection. Does not require auth. */
12
- const main =
13
- /*#__PURE__*/
14
- l.query(
15
- $nsid,
16
- /*#__PURE__*/ l.params({
17
- repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),
18
- collection: /*#__PURE__*/ l.string({ format: 'nsid' }),
19
- limit: /*#__PURE__*/ l.optional(
20
- /*#__PURE__*/ l.withDefault(
21
- /*#__PURE__*/ l.integer({ minimum: 1, maximum: 100 }),
22
- 50,
23
- ),
24
- ),
25
- cursor: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),
26
- reverse: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),
27
- }),
28
- /*#__PURE__*/ l.jsonPayload({
29
- cursor: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),
30
- records: /*#__PURE__*/ l.array(
31
- /*#__PURE__*/ l.ref<Record$0>((() => record$0) as any),
32
- ),
33
- }),
34
- )
35
- export { main }
11
+ export const $params = /*#__PURE__*/ l.params({
12
+ repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),
13
+ collection: /*#__PURE__*/ l.string({ format: 'nsid' }),
14
+ limit: /*#__PURE__*/ l.optional(
15
+ /*#__PURE__*/ l.withDefault(
16
+ /*#__PURE__*/ l.integer({ minimum: 1, maximum: 100 }),
17
+ 50,
18
+ ),
19
+ ),
20
+ cursor: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),
21
+ reverse: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),
22
+ })
23
+
24
+ export type $Params = l.InferOutput<typeof $params>
25
+
26
+ export const $output = /*#__PURE__*/ l.jsonPayload({
27
+ cursor: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.string()),
28
+ records: /*#__PURE__*/ l.array(
29
+ /*#__PURE__*/ l.ref<Record$0>((() => record$0) as any),
30
+ ),
31
+ })
36
32
 
37
- export type $Params = l.InferMethodParams<typeof main>
38
- export type $Output<B = l.BinaryData> = l.InferMethodOutput<typeof main, B>
39
- export type $OutputBody<B = l.BinaryData> = l.InferMethodOutputBody<
40
- typeof main,
33
+ export type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>
34
+ export type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<
35
+ typeof $output,
41
36
  B
42
37
  >
43
38
 
44
- export const $lxm = /*#__PURE__*/ main.nsid,
45
- $params = main.parameters,
46
- $output = main.output
39
+ /** List a range of records in a repository, matching a specific collection. Does not require auth. */
40
+ const main = /*#__PURE__*/ l.query($nsid, $params, $output)
41
+
42
+ export { main }
43
+
44
+ export const $lxm = $nsid
47
45
 
48
46
  type Record$0 = {
49
47
  $type?: 'com.atproto.repo.listRecords#record'
@@ -3,4 +3,4 @@
3
3
  */
4
4
 
5
5
  export * from './listRecords.defs.js'
6
- export * as $defs from './listRecords.defs.js'
6
+ export { main as default } from './listRecords.defs.js'
@@ -9,54 +9,51 @@ const $nsid = 'com.atproto.repo.putRecord'
9
9
 
10
10
  export { $nsid }
11
11
 
12
- /** Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS. */
13
- const main =
14
- /*#__PURE__*/
15
- l.procedure(
16
- $nsid,
17
- /*#__PURE__*/ l.params(),
18
- /*#__PURE__*/ l.jsonPayload({
19
- repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),
20
- collection: /*#__PURE__*/ l.string({ format: 'nsid' }),
21
- rkey: /*#__PURE__*/ l.string({ format: 'record-key', maxLength: 512 }),
22
- validate: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),
23
- record: /*#__PURE__*/ l.lexMap(),
24
- swapRecord: /*#__PURE__*/ l.optional(
25
- /*#__PURE__*/ l.nullable(/*#__PURE__*/ l.string({ format: 'cid' })),
26
- ),
27
- swapCommit: /*#__PURE__*/ l.optional(
28
- /*#__PURE__*/ l.string({ format: 'cid' }),
29
- ),
30
- }),
31
- /*#__PURE__*/ l.jsonPayload({
32
- uri: /*#__PURE__*/ l.string({ format: 'at-uri' }),
33
- cid: /*#__PURE__*/ l.string({ format: 'cid' }),
34
- commit: /*#__PURE__*/ l.optional(
35
- /*#__PURE__*/ l.ref<RepoDefs.CommitMeta>(
36
- (() => RepoDefs.commitMeta) as any,
37
- ),
38
- ),
39
- validationStatus: /*#__PURE__*/ l.optional(
40
- /*#__PURE__*/ l.string<{ knownValues: ['valid', 'unknown'] }>(),
41
- ),
42
- }),
43
- ['InvalidSwap'],
44
- )
45
- export { main }
12
+ export const $params = /*#__PURE__*/ l.params()
46
13
 
47
- export type $Params = l.InferMethodParams<typeof main>
48
- export type $Input<B = l.BinaryData> = l.InferMethodInput<typeof main, B>
49
- export type $InputBody<B = l.BinaryData> = l.InferMethodInputBody<
50
- typeof main,
51
- B
52
- >
53
- export type $Output<B = l.BinaryData> = l.InferMethodOutput<typeof main, B>
54
- export type $OutputBody<B = l.BinaryData> = l.InferMethodOutputBody<
55
- typeof main,
14
+ export type $Params = l.InferOutput<typeof $params>
15
+
16
+ export const $input = /*#__PURE__*/ l.jsonPayload({
17
+ repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),
18
+ collection: /*#__PURE__*/ l.string({ format: 'nsid' }),
19
+ rkey: /*#__PURE__*/ l.string({ format: 'record-key', maxLength: 512 }),
20
+ validate: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),
21
+ record: /*#__PURE__*/ l.lexMap(),
22
+ swapRecord: /*#__PURE__*/ l.optional(
23
+ /*#__PURE__*/ l.nullable(/*#__PURE__*/ l.string({ format: 'cid' })),
24
+ ),
25
+ swapCommit: /*#__PURE__*/ l.optional(
26
+ /*#__PURE__*/ l.string({ format: 'cid' }),
27
+ ),
28
+ })
29
+
30
+ export type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>
31
+ export type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>
32
+
33
+ export const $output = /*#__PURE__*/ l.jsonPayload({
34
+ uri: /*#__PURE__*/ l.string({ format: 'at-uri' }),
35
+ cid: /*#__PURE__*/ l.string({ format: 'cid' }),
36
+ commit: /*#__PURE__*/ l.optional(
37
+ /*#__PURE__*/ l.ref<RepoDefs.CommitMeta>(
38
+ (() => RepoDefs.commitMeta) as any,
39
+ ),
40
+ ),
41
+ validationStatus: /*#__PURE__*/ l.optional(
42
+ /*#__PURE__*/ l.string<{ knownValues: ['valid', 'unknown'] }>(),
43
+ ),
44
+ })
45
+
46
+ export type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>
47
+ export type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<
48
+ typeof $output,
56
49
  B
57
50
  >
58
51
 
59
- export const $lxm = /*#__PURE__*/ main.nsid,
60
- $params = /*#__PURE__*/ main.parameters,
61
- $input = /*#__PURE__*/ main.input,
62
- $output = /*#__PURE__*/ main.output
52
+ /** Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS. */
53
+ const main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output, [
54
+ 'InvalidSwap',
55
+ ])
56
+
57
+ export { main }
58
+
59
+ export const $lxm = $nsid
@@ -3,4 +3,4 @@
3
3
  */
4
4
 
5
5
  export * from './putRecord.defs.js'
6
- export * as $defs from './putRecord.defs.js'
6
+ export { main as default } from './putRecord.defs.js'