@atproto/lex-client 0.1.1 → 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.
- package/CHANGELOG.md +6 -0
- package/dist/client.d.ts +32 -23
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +19 -9
- package/dist/client.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/applyWrites.d.ts +1 -1
- package/dist/lexicons/com/atproto/repo/applyWrites.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/applyWrites.defs.d.ts +6 -6
- package/dist/lexicons/com/atproto/repo/applyWrites.defs.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/applyWrites.defs.js +1 -1
- package/dist/lexicons/com/atproto/repo/applyWrites.defs.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/applyWrites.js +1 -1
- package/dist/lexicons/com/atproto/repo/applyWrites.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/createRecord.d.ts +1 -1
- package/dist/lexicons/com/atproto/repo/createRecord.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/createRecord.defs.d.ts +6 -6
- package/dist/lexicons/com/atproto/repo/createRecord.defs.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/createRecord.defs.js +1 -1
- package/dist/lexicons/com/atproto/repo/createRecord.defs.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/createRecord.js +1 -1
- package/dist/lexicons/com/atproto/repo/createRecord.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/defs.d.ts +0 -1
- package/dist/lexicons/com/atproto/repo/defs.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/defs.js +0 -1
- package/dist/lexicons/com/atproto/repo/defs.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/deleteRecord.d.ts +1 -1
- package/dist/lexicons/com/atproto/repo/deleteRecord.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/deleteRecord.defs.d.ts +6 -6
- package/dist/lexicons/com/atproto/repo/deleteRecord.defs.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/deleteRecord.defs.js +1 -1
- package/dist/lexicons/com/atproto/repo/deleteRecord.defs.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/deleteRecord.js +1 -1
- package/dist/lexicons/com/atproto/repo/deleteRecord.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/getRecord.d.ts +1 -1
- package/dist/lexicons/com/atproto/repo/getRecord.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/getRecord.defs.d.ts +4 -4
- package/dist/lexicons/com/atproto/repo/getRecord.defs.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/getRecord.defs.js +1 -1
- package/dist/lexicons/com/atproto/repo/getRecord.defs.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/getRecord.js +1 -1
- package/dist/lexicons/com/atproto/repo/getRecord.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/listRecords.d.ts +1 -1
- package/dist/lexicons/com/atproto/repo/listRecords.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/listRecords.defs.d.ts +4 -4
- package/dist/lexicons/com/atproto/repo/listRecords.defs.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/listRecords.defs.js +1 -1
- package/dist/lexicons/com/atproto/repo/listRecords.defs.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/listRecords.js +1 -1
- package/dist/lexicons/com/atproto/repo/listRecords.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/putRecord.d.ts +1 -1
- package/dist/lexicons/com/atproto/repo/putRecord.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/putRecord.defs.d.ts +6 -6
- package/dist/lexicons/com/atproto/repo/putRecord.defs.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/putRecord.defs.js +1 -1
- package/dist/lexicons/com/atproto/repo/putRecord.defs.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/putRecord.js +1 -1
- package/dist/lexicons/com/atproto/repo/putRecord.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/uploadBlob.d.ts +1 -1
- package/dist/lexicons/com/atproto/repo/uploadBlob.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/uploadBlob.defs.d.ts +6 -6
- package/dist/lexicons/com/atproto/repo/uploadBlob.defs.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/repo/uploadBlob.defs.js +1 -1
- package/dist/lexicons/com/atproto/repo/uploadBlob.defs.js.map +1 -1
- package/dist/lexicons/com/atproto/repo/uploadBlob.js +1 -1
- package/dist/lexicons/com/atproto/repo/uploadBlob.js.map +1 -1
- package/dist/lexicons/com/atproto/sync/getBlob.d.ts +1 -1
- package/dist/lexicons/com/atproto/sync/getBlob.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/sync/getBlob.defs.d.ts +4 -4
- package/dist/lexicons/com/atproto/sync/getBlob.defs.d.ts.map +1 -1
- package/dist/lexicons/com/atproto/sync/getBlob.defs.js +1 -1
- package/dist/lexicons/com/atproto/sync/getBlob.defs.js.map +1 -1
- package/dist/lexicons/com/atproto/sync/getBlob.js +1 -1
- package/dist/lexicons/com/atproto/sync/getBlob.js.map +1 -1
- package/package.json +2 -2
- package/src/client.ts +38 -41
- package/src/lexicons/com/atproto/repo/applyWrites.defs.ts +16 -12
- package/src/lexicons/com/atproto/repo/applyWrites.ts +1 -1
- package/src/lexicons/com/atproto/repo/createRecord.defs.ts +15 -12
- package/src/lexicons/com/atproto/repo/createRecord.ts +1 -1
- package/src/lexicons/com/atproto/repo/defs.ts +0 -1
- package/src/lexicons/com/atproto/repo/deleteRecord.defs.ts +15 -12
- package/src/lexicons/com/atproto/repo/deleteRecord.ts +1 -1
- package/src/lexicons/com/atproto/repo/getRecord.defs.ts +11 -7
- package/src/lexicons/com/atproto/repo/getRecord.ts +1 -1
- package/src/lexicons/com/atproto/repo/listRecords.defs.ts +12 -7
- package/src/lexicons/com/atproto/repo/listRecords.ts +1 -1
- package/src/lexicons/com/atproto/repo/putRecord.defs.ts +15 -12
- package/src/lexicons/com/atproto/repo/putRecord.ts +1 -1
- package/src/lexicons/com/atproto/repo/uploadBlob.defs.ts +15 -12
- package/src/lexicons/com/atproto/repo/uploadBlob.ts +1 -1
- package/src/lexicons/com/atproto/sync/getBlob.defs.ts +11 -7
- package/src/lexicons/com/atproto/sync/getBlob.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"putRecord.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/putRecord.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAA;AACnC,OAAO,
|
|
1
|
+
{"version":3,"file":"putRecord.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/putRecord.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAA;AACnC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -2,8 +2,8 @@ import { l } from '@atproto/lex-schema';
|
|
|
2
2
|
import * as RepoDefs from './defs.defs.js';
|
|
3
3
|
declare const $nsid = "com.atproto.repo.putRecord";
|
|
4
4
|
export { $nsid };
|
|
5
|
-
export declare const $lxm = "com.atproto.repo.putRecord";
|
|
6
5
|
export declare const $params: l.ParamsSchema<{}>;
|
|
6
|
+
export type $Params = l.InferOutput<typeof $params>;
|
|
7
7
|
export declare const $input: l.Payload<"application/json", l.ObjectSchema<{
|
|
8
8
|
repo: l.StringSchema<{
|
|
9
9
|
readonly format: "at-identifier";
|
|
@@ -24,6 +24,8 @@ export declare const $input: l.Payload<"application/json", l.ObjectSchema<{
|
|
|
24
24
|
readonly format: "cid";
|
|
25
25
|
}>>;
|
|
26
26
|
}>>;
|
|
27
|
+
export type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>;
|
|
28
|
+
export type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>;
|
|
27
29
|
export declare const $output: l.Payload<"application/json", l.ObjectSchema<{
|
|
28
30
|
uri: l.StringSchema<{
|
|
29
31
|
readonly format: "at-uri";
|
|
@@ -36,6 +38,8 @@ export declare const $output: l.Payload<"application/json", l.ObjectSchema<{
|
|
|
36
38
|
knownValues: ["valid", "unknown"];
|
|
37
39
|
}>>;
|
|
38
40
|
}>>;
|
|
41
|
+
export type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>;
|
|
42
|
+
export type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $output, B>;
|
|
39
43
|
/** Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS. */
|
|
40
44
|
declare const main: l.Procedure<"com.atproto.repo.putRecord", l.ParamsSchema<{}>, l.Payload<"application/json", l.ObjectSchema<{
|
|
41
45
|
repo: l.StringSchema<{
|
|
@@ -69,9 +73,5 @@ declare const main: l.Procedure<"com.atproto.repo.putRecord", l.ParamsSchema<{}>
|
|
|
69
73
|
}>>;
|
|
70
74
|
}>>, readonly ["InvalidSwap"]>;
|
|
71
75
|
export { main };
|
|
72
|
-
export
|
|
73
|
-
export type $Input<B = l.BinaryData> = l.InferMethodInput<typeof main, B>;
|
|
74
|
-
export type $InputBody<B = l.BinaryData> = l.InferMethodInputBody<typeof main, B>;
|
|
75
|
-
export type $Output<B = l.BinaryData> = l.InferMethodOutput<typeof main, B>;
|
|
76
|
-
export type $OutputBody<B = l.BinaryData> = l.InferMethodOutputBody<typeof main, B>;
|
|
76
|
+
export declare const $lxm = "com.atproto.repo.putRecord";
|
|
77
77
|
//# sourceMappingURL=putRecord.defs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"putRecord.defs.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/putRecord.defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAA;AAE1C,QAAA,MAAM,KAAK,+BAA+B,CAAA;AAE1C,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"putRecord.defs.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/putRecord.defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAA;AAE1C,QAAA,MAAM,KAAK,+BAA+B,CAAA;AAE1C,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,eAAO,MAAM,OAAO,oBAA2B,CAAA;AAE/C,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,CAAA;AAEnD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;GAYjB,CAAA;AAEF,MAAM,MAAM,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,YAAY,CAAC,OAAO,MAAM,EAAE,CAAC,CAAC,CAAA;AACvE,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,gBAAgB,CAAC,OAAO,MAAM,EAAE,CAAC,CAAC,CAAA;AAE/E,eAAO,MAAM,OAAO;;;;;;;;;;;GAWlB,CAAA;AAEF,MAAM,MAAM,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,YAAY,CAAC,OAAO,OAAO,EAAE,CAAC,CAAC,CAAA;AACzE,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,gBAAgB,CAC5D,OAAO,OAAO,EACd,CAAC,CACF,CAAA;AAED,uGAAuG;AACvG,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAER,CAAA;AAEF,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,eAAO,MAAM,IAAI,+BAAQ,CAAA"}
|
|
@@ -5,7 +5,6 @@ import { l } from '@atproto/lex-schema';
|
|
|
5
5
|
import * as RepoDefs from './defs.defs.js';
|
|
6
6
|
const $nsid = 'com.atproto.repo.putRecord';
|
|
7
7
|
export { $nsid };
|
|
8
|
-
export const $lxm = $nsid;
|
|
9
8
|
export const $params = /*#__PURE__*/ l.params();
|
|
10
9
|
export const $input = /*#__PURE__*/ l.jsonPayload({
|
|
11
10
|
repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),
|
|
@@ -31,4 +30,5 @@ const main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output, [
|
|
|
31
30
|
'InvalidSwap',
|
|
32
31
|
]);
|
|
33
32
|
export { main };
|
|
33
|
+
export const $lxm = $nsid;
|
|
34
34
|
//# sourceMappingURL=putRecord.defs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"putRecord.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/putRecord.defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAA;AAE1C,MAAM,KAAK,GAAG,4BAA4B,CAAA;AAE1C,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"putRecord.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/putRecord.defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AACvC,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAA;AAE1C,MAAM,KAAK,GAAG,4BAA4B,CAAA;AAE1C,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAA;AAI/C,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC;IAChD,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;IACzD,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACtD,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC;IACtE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAC7D,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE;IAChC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ;IAClC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,CACpE;IACD,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ;IAClC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAC1C;CACF,CAAC,CAAA;AAKF,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC;IACjD,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IACjD,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC9C,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ;IAC9B,aAAa,CAAC,CAAC,CAAC,GAAG,CACjB,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAQ,CACnC,CACF;IACD,gBAAgB,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ;IACxC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAyC,CAChE;CACF,CAAC,CAAA;AAQF,uGAAuG;AACvG,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE;IACtE,aAAa;CACd,CAAC,CAAA;AAEF,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAA","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nimport { l } from '@atproto/lex-schema'\nimport * as RepoDefs from './defs.defs.js'\n\nconst $nsid = 'com.atproto.repo.putRecord'\n\nexport { $nsid }\n\nexport const $params = /*#__PURE__*/ l.params()\n\nexport type $Params = l.InferOutput<typeof $params>\n\nexport const $input = /*#__PURE__*/ l.jsonPayload({\n repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),\n collection: /*#__PURE__*/ l.string({ format: 'nsid' }),\n rkey: /*#__PURE__*/ l.string({ format: 'record-key', maxLength: 512 }),\n validate: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),\n record: /*#__PURE__*/ l.lexMap(),\n swapRecord: /*#__PURE__*/ l.optional(\n /*#__PURE__*/ l.nullable(/*#__PURE__*/ l.string({ format: 'cid' })),\n ),\n swapCommit: /*#__PURE__*/ l.optional(\n /*#__PURE__*/ l.string({ format: 'cid' }),\n ),\n})\n\nexport type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>\nexport type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>\n\nexport const $output = /*#__PURE__*/ l.jsonPayload({\n uri: /*#__PURE__*/ l.string({ format: 'at-uri' }),\n cid: /*#__PURE__*/ l.string({ format: 'cid' }),\n commit: /*#__PURE__*/ l.optional(\n /*#__PURE__*/ l.ref<RepoDefs.CommitMeta>(\n (() => RepoDefs.commitMeta) as any,\n ),\n ),\n validationStatus: /*#__PURE__*/ l.optional(\n /*#__PURE__*/ l.string<{ knownValues: ['valid', 'unknown'] }>(),\n ),\n})\n\nexport type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>\nexport type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<\n typeof $output,\n B\n>\n\n/** Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS. */\nconst main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output, [\n 'InvalidSwap',\n])\n\nexport { main }\n\nexport const $lxm = $nsid\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"putRecord.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/putRecord.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,qBAAqB,CAAA;AACnC,OAAO,
|
|
1
|
+
{"version":3,"file":"putRecord.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/putRecord.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,qBAAqB,CAAA;AACnC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,qBAAqB,CAAA","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nexport * from './putRecord.defs.js'\nexport { main as default } from './putRecord.defs.js'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadBlob.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/uploadBlob.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAA;AACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"uploadBlob.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/uploadBlob.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAA;AACpC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { l } from '@atproto/lex-schema';
|
|
2
2
|
declare const $nsid = "com.atproto.repo.uploadBlob";
|
|
3
3
|
export { $nsid };
|
|
4
|
-
export declare const $lxm = "com.atproto.repo.uploadBlob";
|
|
5
4
|
export declare const $params: l.ParamsSchema<{}>;
|
|
5
|
+
export type $Params = l.InferOutput<typeof $params>;
|
|
6
6
|
export declare const $input: l.Payload<"*/*", undefined>;
|
|
7
|
+
export type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>;
|
|
8
|
+
export type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>;
|
|
7
9
|
export declare const $output: l.Payload<"application/json", l.ObjectSchema<{
|
|
8
10
|
blob: l.BlobSchema<{}>;
|
|
9
11
|
}>>;
|
|
12
|
+
export type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>;
|
|
13
|
+
export type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $output, B>;
|
|
10
14
|
/** Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS. */
|
|
11
15
|
declare const main: l.Procedure<"com.atproto.repo.uploadBlob", l.ParamsSchema<{}>, l.Payload<"*/*", undefined>, l.Payload<"application/json", l.ObjectSchema<{
|
|
12
16
|
blob: l.BlobSchema<{}>;
|
|
13
17
|
}>>, undefined>;
|
|
14
18
|
export { main };
|
|
15
|
-
export
|
|
16
|
-
export type $Input<B = l.BinaryData> = l.InferMethodInput<typeof main, B>;
|
|
17
|
-
export type $InputBody<B = l.BinaryData> = l.InferMethodInputBody<typeof main, B>;
|
|
18
|
-
export type $Output<B = l.BinaryData> = l.InferMethodOutput<typeof main, B>;
|
|
19
|
-
export type $OutputBody<B = l.BinaryData> = l.InferMethodOutputBody<typeof main, B>;
|
|
19
|
+
export declare const $lxm = "com.atproto.repo.uploadBlob";
|
|
20
20
|
//# sourceMappingURL=uploadBlob.defs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadBlob.defs.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/uploadBlob.defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AAEvC,QAAA,MAAM,KAAK,gCAAgC,CAAA;AAE3C,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"uploadBlob.defs.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/uploadBlob.defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AAEvC,QAAA,MAAM,KAAK,gCAAgC,CAAA;AAE3C,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,eAAO,MAAM,OAAO,oBAA2B,CAAA;AAE/C,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,CAAA;AAEnD,eAAO,MAAM,MAAM,6BAAiC,CAAA;AAEpD,MAAM,MAAM,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,YAAY,CAAC,OAAO,MAAM,EAAE,CAAC,CAAC,CAAA;AACvE,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,gBAAgB,CAAC,OAAO,MAAM,EAAE,CAAC,CAAC,CAAA;AAE/E,eAAO,MAAM,OAAO;;GAElB,CAAA;AAEF,MAAM,MAAM,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,YAAY,CAAC,OAAO,OAAO,EAAE,CAAC,CAAC,CAAA;AACzE,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,gBAAgB,CAC5D,OAAO,OAAO,EACd,CAAC,CACF,CAAA;AAED,gRAAgR;AAChR,QAAA,MAAM,IAAI;;eAA6D,CAAA;AAEvE,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,eAAO,MAAM,IAAI,gCAAQ,CAAA"}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { l } from '@atproto/lex-schema';
|
|
5
5
|
const $nsid = 'com.atproto.repo.uploadBlob';
|
|
6
6
|
export { $nsid };
|
|
7
|
-
export const $lxm = $nsid;
|
|
8
7
|
export const $params = /*#__PURE__*/ l.params();
|
|
9
8
|
export const $input = /*#__PURE__*/ l.payload('*/*');
|
|
10
9
|
export const $output = /*#__PURE__*/ l.jsonPayload({
|
|
@@ -13,4 +12,5 @@ export const $output = /*#__PURE__*/ l.jsonPayload({
|
|
|
13
12
|
/** Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS. */
|
|
14
13
|
const main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output);
|
|
15
14
|
export { main };
|
|
15
|
+
export const $lxm = $nsid;
|
|
16
16
|
//# sourceMappingURL=uploadBlob.defs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadBlob.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/uploadBlob.defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AAEvC,MAAM,KAAK,GAAG,6BAA6B,CAAA;AAE3C,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"uploadBlob.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/uploadBlob.defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AAEvC,MAAM,KAAK,GAAG,6BAA6B,CAAA;AAE3C,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAA;AAI/C,MAAM,CAAC,MAAM,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAKpD,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC;IACjD,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE;CAC7B,CAAC,CAAA;AAQF,gRAAgR;AAChR,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;AAEvE,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAA","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nimport { l } from '@atproto/lex-schema'\n\nconst $nsid = 'com.atproto.repo.uploadBlob'\n\nexport { $nsid }\n\nexport const $params = /*#__PURE__*/ l.params()\n\nexport type $Params = l.InferOutput<typeof $params>\n\nexport const $input = /*#__PURE__*/ l.payload('*/*')\n\nexport type $Input<B = l.BinaryData> = l.InferPayload<typeof $input, B>\nexport type $InputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $input, B>\n\nexport const $output = /*#__PURE__*/ l.jsonPayload({\n blob: /*#__PURE__*/ l.blob(),\n})\n\nexport type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>\nexport type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<\n typeof $output,\n B\n>\n\n/** Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS. */\nconst main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output)\n\nexport { main }\n\nexport const $lxm = $nsid\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uploadBlob.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/uploadBlob.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,sBAAsB,CAAA;AACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"uploadBlob.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/uploadBlob.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,sBAAsB,CAAA;AACpC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAA","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nexport * from './uploadBlob.defs.js'\nexport { main as default } from './uploadBlob.defs.js'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBlob.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/sync/getBlob.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAA;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"getBlob.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/sync/getBlob.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { l } from '@atproto/lex-schema';
|
|
2
2
|
declare const $nsid = "com.atproto.sync.getBlob";
|
|
3
3
|
export { $nsid };
|
|
4
|
-
export declare const $lxm = "com.atproto.sync.getBlob";
|
|
5
4
|
export declare const $params: l.ParamsSchema<{
|
|
6
5
|
readonly did: l.StringSchema<{
|
|
7
6
|
readonly format: "did";
|
|
@@ -10,7 +9,10 @@ export declare const $params: l.ParamsSchema<{
|
|
|
10
9
|
readonly format: "cid";
|
|
11
10
|
}>;
|
|
12
11
|
}>;
|
|
12
|
+
export type $Params = l.InferOutput<typeof $params>;
|
|
13
13
|
export declare const $output: l.Payload<"*/*", undefined>;
|
|
14
|
+
export type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>;
|
|
15
|
+
export type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<typeof $output, B>;
|
|
14
16
|
/** Get a blob associated with a given account. Returns the full blob as originally uploaded. Does not require auth; implemented by PDS. */
|
|
15
17
|
declare const main: l.Query<"com.atproto.sync.getBlob", l.ParamsSchema<{
|
|
16
18
|
readonly did: l.StringSchema<{
|
|
@@ -21,7 +23,5 @@ declare const main: l.Query<"com.atproto.sync.getBlob", l.ParamsSchema<{
|
|
|
21
23
|
}>;
|
|
22
24
|
}>, l.Payload<"*/*", undefined>, readonly ["BlobNotFound", "RepoNotFound", "RepoTakendown", "RepoSuspended", "RepoDeactivated"]>;
|
|
23
25
|
export { main };
|
|
24
|
-
export
|
|
25
|
-
export type $Output<B = l.BinaryData> = l.InferMethodOutput<typeof main, B>;
|
|
26
|
-
export type $OutputBody<B = l.BinaryData> = l.InferMethodOutputBody<typeof main, B>;
|
|
26
|
+
export declare const $lxm = "com.atproto.sync.getBlob";
|
|
27
27
|
//# sourceMappingURL=getBlob.defs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBlob.defs.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/sync/getBlob.defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AAEvC,QAAA,MAAM,KAAK,6BAA6B,CAAA;AAExC,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"getBlob.defs.d.ts","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/sync/getBlob.defs.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AAEvC,QAAA,MAAM,KAAK,6BAA6B,CAAA;AAExC,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,eAAO,MAAM,OAAO;;;;;;;EAGlB,CAAA;AAEF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,OAAO,CAAC,CAAA;AAEnD,eAAO,MAAM,OAAO,6BAAiC,CAAA;AAErD,MAAM,MAAM,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,YAAY,CAAC,OAAO,OAAO,EAAE,CAAC,CAAC,CAAA;AACzE,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,gBAAgB,CAC5D,OAAO,OAAO,EACd,CAAC,CACF,CAAA;AAED,2IAA2I;AAC3I,QAAA,MAAM,IAAI;;;;;;;gIAMR,CAAA;AAEF,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,eAAO,MAAM,IAAI,6BAAQ,CAAA"}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { l } from '@atproto/lex-schema';
|
|
5
5
|
const $nsid = 'com.atproto.sync.getBlob';
|
|
6
6
|
export { $nsid };
|
|
7
|
-
export const $lxm = $nsid;
|
|
8
7
|
export const $params = /*#__PURE__*/ l.params({
|
|
9
8
|
did: /*#__PURE__*/ l.string({ format: 'did' }),
|
|
10
9
|
cid: /*#__PURE__*/ l.string({ format: 'cid' }),
|
|
@@ -19,4 +18,5 @@ const main = /*#__PURE__*/ l.query($nsid, $params, $output, [
|
|
|
19
18
|
'RepoDeactivated',
|
|
20
19
|
]);
|
|
21
20
|
export { main };
|
|
21
|
+
export const $lxm = $nsid;
|
|
22
22
|
//# sourceMappingURL=getBlob.defs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBlob.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/sync/getBlob.defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AAEvC,MAAM,KAAK,GAAG,0BAA0B,CAAA;AAExC,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"getBlob.defs.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/sync/getBlob.defs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAA;AAEvC,MAAM,KAAK,GAAG,0BAA0B,CAAA;AAExC,OAAO,EAAE,KAAK,EAAE,CAAA;AAEhB,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;IAC5C,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC9C,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;CAC/C,CAAC,CAAA;AAIF,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAQrD,2IAA2I;AAC3I,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE;IAC1D,cAAc;IACd,cAAc;IACd,eAAe;IACf,eAAe;IACf,iBAAiB;CAClB,CAAC,CAAA;AAEF,OAAO,EAAE,IAAI,EAAE,CAAA;AAEf,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,CAAA","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nimport { l } from '@atproto/lex-schema'\n\nconst $nsid = 'com.atproto.sync.getBlob'\n\nexport { $nsid }\n\nexport const $params = /*#__PURE__*/ l.params({\n did: /*#__PURE__*/ l.string({ format: 'did' }),\n cid: /*#__PURE__*/ l.string({ format: 'cid' }),\n})\n\nexport type $Params = l.InferOutput<typeof $params>\n\nexport const $output = /*#__PURE__*/ l.payload('*/*')\n\nexport type $Output<B = l.BinaryData> = l.InferPayload<typeof $output, B>\nexport type $OutputBody<B = l.BinaryData> = l.InferPayloadBody<\n typeof $output,\n B\n>\n\n/** Get a blob associated with a given account. Returns the full blob as originally uploaded. Does not require auth; implemented by PDS. */\nconst main = /*#__PURE__*/ l.query($nsid, $params, $output, [\n 'BlobNotFound',\n 'RepoNotFound',\n 'RepoTakendown',\n 'RepoSuspended',\n 'RepoDeactivated',\n])\n\nexport { main }\n\nexport const $lxm = $nsid\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBlob.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/sync/getBlob.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,mBAAmB,CAAA;AACjC,OAAO,
|
|
1
|
+
{"version":3,"file":"getBlob.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/sync/getBlob.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAA","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nexport * from './getBlob.defs.js'\nexport { main as default } from './getBlob.defs.js'\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/lex-client",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=22"
|
|
6
6
|
},
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"vitest": "^4.0.16",
|
|
45
45
|
"@atproto/lex-cbor": "^0.1.0",
|
|
46
|
-
"@atproto/lex-builder": "^0.1.
|
|
46
|
+
"@atproto/lex-builder": "^0.1.2"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"prebuild": "node ./scripts/lex-build.mjs",
|
package/src/client.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LexMap, LexValue, TypedLexMap } from '@atproto/lex-data'
|
|
2
2
|
import {
|
|
3
3
|
AtIdentifierString,
|
|
4
|
+
AtUriString,
|
|
4
5
|
CidString,
|
|
5
6
|
DidString,
|
|
6
7
|
Infer,
|
|
@@ -19,7 +20,17 @@ import {
|
|
|
19
20
|
} from '@atproto/lex-schema'
|
|
20
21
|
import { Agent, AgentOptions, buildAgent } from './agent.js'
|
|
21
22
|
import { XrpcFailure } from './errors.js'
|
|
22
|
-
import { com } from
|
|
23
|
+
// @NOTE We could use import { com } from "./lexicons/index.js" here, but some
|
|
24
|
+
// consumers might not know how to properly tree-shake that, so we import only
|
|
25
|
+
// the needed lexicon schemas directly.
|
|
26
|
+
import applyWrites from './lexicons/com/atproto/repo/applyWrites.js'
|
|
27
|
+
import createRecord from './lexicons/com/atproto/repo/createRecord.js'
|
|
28
|
+
import deleteRecord from './lexicons/com/atproto/repo/deleteRecord.js'
|
|
29
|
+
import getRecord from './lexicons/com/atproto/repo/getRecord.js'
|
|
30
|
+
import listRecords from './lexicons/com/atproto/repo/listRecords.js'
|
|
31
|
+
import putRecord from './lexicons/com/atproto/repo/putRecord.js'
|
|
32
|
+
import uploadBlob from './lexicons/com/atproto/repo/uploadBlob.js'
|
|
33
|
+
import getBlob from './lexicons/com/atproto/sync/getBlob.js'
|
|
23
34
|
import {
|
|
24
35
|
XrpcResponse,
|
|
25
36
|
XrpcResponseBody,
|
|
@@ -155,7 +166,7 @@ export type InferActionOutput<A extends Action> =
|
|
|
155
166
|
* @see {@link Client.createRecord}
|
|
156
167
|
*/
|
|
157
168
|
export type CreateRecordOptions = Omit<
|
|
158
|
-
XrpcOptions<typeof
|
|
169
|
+
XrpcOptions<typeof createRecord>,
|
|
159
170
|
'body'
|
|
160
171
|
> & {
|
|
161
172
|
/** Repository identifier (DID or handle). Defaults to authenticated user's DID. */
|
|
@@ -172,7 +183,7 @@ export type CreateRecordOptions = Omit<
|
|
|
172
183
|
* @see {@link Client.deleteRecord}
|
|
173
184
|
*/
|
|
174
185
|
export type DeleteRecordOptions = Omit<
|
|
175
|
-
XrpcOptions<typeof
|
|
186
|
+
XrpcOptions<typeof deleteRecord>,
|
|
176
187
|
'body'
|
|
177
188
|
> & {
|
|
178
189
|
/** Repository identifier (DID or handle). Defaults to authenticated user's DID. */
|
|
@@ -188,10 +199,7 @@ export type DeleteRecordOptions = Omit<
|
|
|
188
199
|
*
|
|
189
200
|
* @see {@link Client.getRecord}
|
|
190
201
|
*/
|
|
191
|
-
export type GetRecordOptions = Omit<
|
|
192
|
-
XrpcOptions<typeof com.atproto.repo.getRecord.main>,
|
|
193
|
-
'params'
|
|
194
|
-
> & {
|
|
202
|
+
export type GetRecordOptions = Omit<XrpcOptions<typeof getRecord>, 'params'> & {
|
|
195
203
|
/** Repository identifier (DID or handle). Defaults to authenticated user's DID. */
|
|
196
204
|
repo?: AtIdentifierString
|
|
197
205
|
}
|
|
@@ -201,10 +209,7 @@ export type GetRecordOptions = Omit<
|
|
|
201
209
|
*
|
|
202
210
|
* @see {@link Client.putRecord}
|
|
203
211
|
*/
|
|
204
|
-
export type PutRecordOptions = Omit<
|
|
205
|
-
XrpcOptions<typeof com.atproto.repo.putRecord.main>,
|
|
206
|
-
'body'
|
|
207
|
-
> & {
|
|
212
|
+
export type PutRecordOptions = Omit<XrpcOptions<typeof putRecord>, 'body'> & {
|
|
208
213
|
/** Repository identifier (DID or handle). Defaults to authenticated user's DID. */
|
|
209
214
|
repo?: AtIdentifierString
|
|
210
215
|
/** Compare-and-swap on the repo commit. If specified, must match current commit. */
|
|
@@ -221,7 +226,7 @@ export type PutRecordOptions = Omit<
|
|
|
221
226
|
* @see {@link Client.listRecords}
|
|
222
227
|
*/
|
|
223
228
|
export type ListRecordsOptions = Omit<
|
|
224
|
-
XrpcOptions<typeof
|
|
229
|
+
XrpcOptions<typeof listRecords>,
|
|
225
230
|
'params'
|
|
226
231
|
> & {
|
|
227
232
|
/** Repository identifier (DID or handle). Defaults to authenticated user's DID. */
|
|
@@ -240,7 +245,7 @@ export type ListRecordsOptions = Omit<
|
|
|
240
245
|
* @see {@link Client.applyWrites}
|
|
241
246
|
*/
|
|
242
247
|
export type ApplyWritesOptions = Omit<
|
|
243
|
-
XrpcOptions<typeof
|
|
248
|
+
XrpcOptions<typeof applyWrites>,
|
|
244
249
|
'body'
|
|
245
250
|
> & {
|
|
246
251
|
/** Repository identifier (DID or handle). Defaults to authenticated user's DID. */
|
|
@@ -251,15 +256,9 @@ export type ApplyWritesOptions = Omit<
|
|
|
251
256
|
swapCommit?: CidString
|
|
252
257
|
}
|
|
253
258
|
|
|
254
|
-
export type UploadBlobOptions = Omit<
|
|
255
|
-
XrpcOptions<typeof com.atproto.repo.uploadBlob.main>,
|
|
256
|
-
'body'
|
|
257
|
-
>
|
|
259
|
+
export type UploadBlobOptions = Omit<XrpcOptions<typeof uploadBlob>, 'body'>
|
|
258
260
|
|
|
259
|
-
export type GetBlobOptions = Omit<
|
|
260
|
-
XrpcOptions<typeof com.atproto.sync.getBlob.main>,
|
|
261
|
-
'params'
|
|
262
|
-
>
|
|
261
|
+
export type GetBlobOptions = Omit<XrpcOptions<typeof getBlob>, 'params'>
|
|
263
262
|
|
|
264
263
|
/**
|
|
265
264
|
* Type-safe options for {@link Client.create}, combining record options with key requirements.
|
|
@@ -274,7 +273,7 @@ export type CreateOptions<T extends RecordSchema> = CreateRecordOptions &
|
|
|
274
273
|
* Contains the URI and CID of the newly created record.
|
|
275
274
|
*/
|
|
276
275
|
export type CreateOutput = InferMethodOutputBody<
|
|
277
|
-
typeof
|
|
276
|
+
typeof createRecord,
|
|
278
277
|
Uint8Array
|
|
279
278
|
>
|
|
280
279
|
|
|
@@ -289,7 +288,7 @@ export type DeleteOptions<T extends RecordSchema> = DeleteRecordOptions &
|
|
|
289
288
|
* Output type for record deletion operations.
|
|
290
289
|
*/
|
|
291
290
|
export type DeleteOutput = InferMethodOutputBody<
|
|
292
|
-
typeof
|
|
291
|
+
typeof deleteRecord,
|
|
293
292
|
Uint8Array
|
|
294
293
|
>
|
|
295
294
|
|
|
@@ -306,7 +305,7 @@ export type GetOptions<T extends RecordSchema> = GetRecordOptions &
|
|
|
306
305
|
* @typeParam T - The record schema type
|
|
307
306
|
*/
|
|
308
307
|
export type GetOutput<T extends RecordSchema> = Omit<
|
|
309
|
-
InferMethodOutputBody<typeof
|
|
308
|
+
InferMethodOutputBody<typeof getRecord, Uint8Array>,
|
|
310
309
|
'value'
|
|
311
310
|
> & { value: Infer<T> }
|
|
312
311
|
|
|
@@ -321,10 +320,7 @@ export type PutOptions<T extends RecordSchema> = PutRecordOptions &
|
|
|
321
320
|
* Output type for record put (create/update) operations.
|
|
322
321
|
* Contains the URI and CID of the record.
|
|
323
322
|
*/
|
|
324
|
-
export type PutOutput = InferMethodOutputBody<
|
|
325
|
-
typeof com.atproto.repo.putRecord.main,
|
|
326
|
-
Uint8Array
|
|
327
|
-
>
|
|
323
|
+
export type PutOutput = InferMethodOutputBody<typeof putRecord, Uint8Array>
|
|
328
324
|
|
|
329
325
|
/**
|
|
330
326
|
* Options for {@link Client.list} operations.
|
|
@@ -337,7 +333,7 @@ export type ListOptions = ListRecordsOptions
|
|
|
337
333
|
* @typeParam T - The record schema type
|
|
338
334
|
*/
|
|
339
335
|
export type ListOutput<T extends RecordSchema> = InferMethodOutputBody<
|
|
340
|
-
typeof
|
|
336
|
+
typeof listRecords,
|
|
341
337
|
Uint8Array
|
|
342
338
|
> & {
|
|
343
339
|
/** Records that successfully validated against the schema. */
|
|
@@ -353,10 +349,11 @@ export type ListOutput<T extends RecordSchema> = InferMethodOutputBody<
|
|
|
353
349
|
* A record from a list operation with its value typed to the schema.
|
|
354
350
|
* @typeParam Value - The validated record value type
|
|
355
351
|
*/
|
|
356
|
-
export type ListRecord<Value extends LexMap> =
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
352
|
+
export type ListRecord<Value extends LexMap> = {
|
|
353
|
+
uri: AtUriString
|
|
354
|
+
cid: CidString
|
|
355
|
+
value: Value
|
|
356
|
+
}
|
|
360
357
|
|
|
361
358
|
/**
|
|
362
359
|
* The Client class is the primary interface for interacting with AT Protocol
|
|
@@ -614,7 +611,7 @@ export class Client implements Agent {
|
|
|
614
611
|
rkey?: string,
|
|
615
612
|
options?: CreateRecordOptions,
|
|
616
613
|
) {
|
|
617
|
-
return this.xrpc(
|
|
614
|
+
return this.xrpc(createRecord, {
|
|
618
615
|
...options,
|
|
619
616
|
body: {
|
|
620
617
|
repo: options?.repo ?? this.assertDid,
|
|
@@ -641,7 +638,7 @@ export class Client implements Agent {
|
|
|
641
638
|
rkey: string,
|
|
642
639
|
options?: DeleteRecordOptions,
|
|
643
640
|
) {
|
|
644
|
-
return this.xrpc(
|
|
641
|
+
return this.xrpc(deleteRecord, {
|
|
645
642
|
...options,
|
|
646
643
|
body: {
|
|
647
644
|
repo: options?.repo ?? this.assertDid,
|
|
@@ -667,7 +664,7 @@ export class Client implements Agent {
|
|
|
667
664
|
rkey: string,
|
|
668
665
|
options?: GetRecordOptions,
|
|
669
666
|
) {
|
|
670
|
-
return this.xrpc(
|
|
667
|
+
return this.xrpc(getRecord, {
|
|
671
668
|
...options,
|
|
672
669
|
params: {
|
|
673
670
|
repo: options?.repo ?? this.assertDid,
|
|
@@ -691,7 +688,7 @@ export class Client implements Agent {
|
|
|
691
688
|
rkey: string,
|
|
692
689
|
options?: PutRecordOptions,
|
|
693
690
|
) {
|
|
694
|
-
return this.xrpc(
|
|
691
|
+
return this.xrpc(putRecord, {
|
|
695
692
|
...options,
|
|
696
693
|
body: {
|
|
697
694
|
repo: options?.repo ?? this.assertDid,
|
|
@@ -714,7 +711,7 @@ export class Client implements Agent {
|
|
|
714
711
|
* @see {@link list} for a higher-level typed alternative
|
|
715
712
|
*/
|
|
716
713
|
async listRecords(nsid: NsidString, options?: ListRecordsOptions) {
|
|
717
|
-
return this.xrpc(
|
|
714
|
+
return this.xrpc(listRecords, {
|
|
718
715
|
...options,
|
|
719
716
|
params: {
|
|
720
717
|
repo: options?.repo ?? this.assertDid,
|
|
@@ -753,7 +750,7 @@ export class Client implements Agent {
|
|
|
753
750
|
factory: WriteOperationsFactory,
|
|
754
751
|
options?: ApplyWritesOptions,
|
|
755
752
|
) {
|
|
756
|
-
return this.xrpc(
|
|
753
|
+
return this.xrpc(applyWrites, {
|
|
757
754
|
...options,
|
|
758
755
|
body: {
|
|
759
756
|
repo: options?.repo ?? this.assertDid,
|
|
@@ -781,7 +778,7 @@ export class Client implements Agent {
|
|
|
781
778
|
* ```
|
|
782
779
|
*/
|
|
783
780
|
async uploadBlob(body: BinaryBodyInit, options?: UploadBlobOptions) {
|
|
784
|
-
return this.xrpc(
|
|
781
|
+
return this.xrpc(uploadBlob, { ...options, body })
|
|
785
782
|
}
|
|
786
783
|
|
|
787
784
|
/**
|
|
@@ -792,7 +789,7 @@ export class Client implements Agent {
|
|
|
792
789
|
* @param options - Call options
|
|
793
790
|
*/
|
|
794
791
|
async getBlob(did: DidString, cid: CidString, options?: GetBlobOptions) {
|
|
795
|
-
return this.xrpc(
|
|
792
|
+
return this.xrpc(getBlob, {
|
|
796
793
|
...options,
|
|
797
794
|
params: { did, cid },
|
|
798
795
|
})
|
|
@@ -9,8 +9,10 @@ const $nsid = 'com.atproto.repo.applyWrites'
|
|
|
9
9
|
|
|
10
10
|
export { $nsid }
|
|
11
11
|
|
|
12
|
-
export const $lxm = $nsid
|
|
13
12
|
export const $params = /*#__PURE__*/ l.params()
|
|
13
|
+
|
|
14
|
+
export type $Params = l.InferOutput<typeof $params>
|
|
15
|
+
|
|
14
16
|
export const $input = /*#__PURE__*/ l.jsonPayload({
|
|
15
17
|
repo: /*#__PURE__*/ l.string({ format: 'at-identifier' }),
|
|
16
18
|
validate: /*#__PURE__*/ l.optional(/*#__PURE__*/ l.boolean()),
|
|
@@ -28,6 +30,10 @@ export const $input = /*#__PURE__*/ l.jsonPayload({
|
|
|
28
30
|
/*#__PURE__*/ l.string({ format: 'cid' }),
|
|
29
31
|
),
|
|
30
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
|
+
|
|
31
37
|
export const $output = /*#__PURE__*/ l.jsonPayload({
|
|
32
38
|
commit: /*#__PURE__*/ l.optional(
|
|
33
39
|
/*#__PURE__*/ l.ref<RepoDefs.CommitMeta>(
|
|
@@ -47,6 +53,13 @@ export const $output = /*#__PURE__*/ l.jsonPayload({
|
|
|
47
53
|
),
|
|
48
54
|
),
|
|
49
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
|
+
|
|
50
63
|
/** Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS. */
|
|
51
64
|
const main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output, [
|
|
52
65
|
'InvalidSwap',
|
|
@@ -54,17 +67,8 @@ const main = /*#__PURE__*/ l.procedure($nsid, $params, $input, $output, [
|
|
|
54
67
|
|
|
55
68
|
export { main }
|
|
56
69
|
|
|
57
|
-
export
|
|
58
|
-
|
|
59
|
-
export type $InputBody<B = l.BinaryData> = l.InferMethodInputBody<
|
|
60
|
-
typeof main,
|
|
61
|
-
B
|
|
62
|
-
>
|
|
63
|
-
export type $Output<B = l.BinaryData> = l.InferMethodOutput<typeof main, B>
|
|
64
|
-
export type $OutputBody<B = l.BinaryData> = l.InferMethodOutputBody<
|
|
65
|
-
typeof main,
|
|
66
|
-
B
|
|
67
|
-
>
|
|
70
|
+
export const $lxm = $nsid
|
|
71
|
+
|
|
68
72
|
/** Operation which creates a new record. */
|
|
69
73
|
type Create = {
|
|
70
74
|
$type?: 'com.atproto.repo.applyWrites#create'
|