@atproto/lex-client 0.1.1 → 0.1.3
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 +15 -0
- package/dist/client.d.ts +55 -26
- 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 +4 -4
- package/src/client.ts +61 -44
- 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":"listRecords.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/listRecords.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,uBAAuB,CAAA;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"listRecords.js","sourceRoot":"","sources":["../../../../../src/lexicons/com/atproto/repo/listRecords.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,uBAAuB,CAAA;AACrC,OAAO,EAAE,IAAI,IAAI,OAAO,EAAE,MAAM,uBAAuB,CAAA","sourcesContent":["/*\n * THIS FILE WAS GENERATED BY \"@atproto/lex\". DO NOT EDIT.\n */\n\nexport * from './listRecords.defs.js'\nexport { main as default } from './listRecords.defs.js'\n"]}
|
|
@@ -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.3",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=22"
|
|
6
6
|
},
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"tslib": "^2.8.1",
|
|
39
39
|
"@atproto/lex-data": "^0.1.1",
|
|
40
|
-
"@atproto/lex-
|
|
41
|
-
"@atproto/lex-
|
|
40
|
+
"@atproto/lex-schema": "^0.1.2",
|
|
41
|
+
"@atproto/lex-json": "^0.1.0"
|
|
42
42
|
},
|
|
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,14 +166,21 @@ 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. */
|
|
162
173
|
repo?: AtIdentifierString
|
|
163
174
|
/** Compare-and-swap on the repo commit. If specified, must match current commit. */
|
|
164
175
|
swapCommit?: string
|
|
165
|
-
/**
|
|
176
|
+
/**
|
|
177
|
+
* Whether the PDS should validate the record against its lexicon schema.
|
|
178
|
+
* When `true`, the PDS is asked to explicitly validate the record. When
|
|
179
|
+
* `false`, the PDS is asked to explicitly skip validation. When `undefined`
|
|
180
|
+
* (default), the PDS decides -- typically validating only collections whose
|
|
181
|
+
* schemas it knows. This is server-side validation; for client-side
|
|
182
|
+
* validation before sending, use {@link XrpcRequestProcessingOptions.validateRequest}.
|
|
183
|
+
*/
|
|
166
184
|
validate?: boolean
|
|
167
185
|
}
|
|
168
186
|
|
|
@@ -172,7 +190,7 @@ export type CreateRecordOptions = Omit<
|
|
|
172
190
|
* @see {@link Client.deleteRecord}
|
|
173
191
|
*/
|
|
174
192
|
export type DeleteRecordOptions = Omit<
|
|
175
|
-
XrpcOptions<typeof
|
|
193
|
+
XrpcOptions<typeof deleteRecord>,
|
|
176
194
|
'body'
|
|
177
195
|
> & {
|
|
178
196
|
/** Repository identifier (DID or handle). Defaults to authenticated user's DID. */
|
|
@@ -188,10 +206,7 @@ export type DeleteRecordOptions = Omit<
|
|
|
188
206
|
*
|
|
189
207
|
* @see {@link Client.getRecord}
|
|
190
208
|
*/
|
|
191
|
-
export type GetRecordOptions = Omit<
|
|
192
|
-
XrpcOptions<typeof com.atproto.repo.getRecord.main>,
|
|
193
|
-
'params'
|
|
194
|
-
> & {
|
|
209
|
+
export type GetRecordOptions = Omit<XrpcOptions<typeof getRecord>, 'params'> & {
|
|
195
210
|
/** Repository identifier (DID or handle). Defaults to authenticated user's DID. */
|
|
196
211
|
repo?: AtIdentifierString
|
|
197
212
|
}
|
|
@@ -201,17 +216,21 @@ export type GetRecordOptions = Omit<
|
|
|
201
216
|
*
|
|
202
217
|
* @see {@link Client.putRecord}
|
|
203
218
|
*/
|
|
204
|
-
export type PutRecordOptions = Omit<
|
|
205
|
-
XrpcOptions<typeof com.atproto.repo.putRecord.main>,
|
|
206
|
-
'body'
|
|
207
|
-
> & {
|
|
219
|
+
export type PutRecordOptions = Omit<XrpcOptions<typeof putRecord>, 'body'> & {
|
|
208
220
|
/** Repository identifier (DID or handle). Defaults to authenticated user's DID. */
|
|
209
221
|
repo?: AtIdentifierString
|
|
210
222
|
/** Compare-and-swap on the repo commit. If specified, must match current commit. */
|
|
211
223
|
swapCommit?: string
|
|
212
224
|
/** Compare-and-swap on the record CID. If specified, must match current record. */
|
|
213
225
|
swapRecord?: string
|
|
214
|
-
/**
|
|
226
|
+
/**
|
|
227
|
+
* Whether the PDS should validate the record against its lexicon schema.
|
|
228
|
+
* When `true`, the PDS is asked to explicitly validate the record. When
|
|
229
|
+
* `false`, the PDS is asked to explicitly skip validation. When `undefined`
|
|
230
|
+
* (default), the PDS decides — typically validating only collections whose
|
|
231
|
+
* schemas it knows. This is server-side validation; for client-side
|
|
232
|
+
* validation before sending, use {@link XrpcRequestProcessingOptions.validateRequest}.
|
|
233
|
+
*/
|
|
215
234
|
validate?: boolean
|
|
216
235
|
}
|
|
217
236
|
|
|
@@ -221,7 +240,7 @@ export type PutRecordOptions = Omit<
|
|
|
221
240
|
* @see {@link Client.listRecords}
|
|
222
241
|
*/
|
|
223
242
|
export type ListRecordsOptions = Omit<
|
|
224
|
-
XrpcOptions<typeof
|
|
243
|
+
XrpcOptions<typeof listRecords>,
|
|
225
244
|
'params'
|
|
226
245
|
> & {
|
|
227
246
|
/** Repository identifier (DID or handle). Defaults to authenticated user's DID. */
|
|
@@ -240,26 +259,26 @@ export type ListRecordsOptions = Omit<
|
|
|
240
259
|
* @see {@link Client.applyWrites}
|
|
241
260
|
*/
|
|
242
261
|
export type ApplyWritesOptions = Omit<
|
|
243
|
-
XrpcOptions<typeof
|
|
262
|
+
XrpcOptions<typeof applyWrites>,
|
|
244
263
|
'body'
|
|
245
264
|
> & {
|
|
246
265
|
/** Repository identifier (DID or handle). Defaults to authenticated user's DID. */
|
|
247
266
|
repo?: AtIdentifierString
|
|
248
|
-
/**
|
|
267
|
+
/**
|
|
268
|
+
* Whether the PDS should validate the records against their lexicon schemas.
|
|
269
|
+
* When `true`, the PDS is asked to explicitly validate every record. When
|
|
270
|
+
* `false`, the PDS is asked to explicitly skip validation. When `undefined`
|
|
271
|
+
* (default), the PDS decides — typically validating only collections whose
|
|
272
|
+
* schemas it knows.
|
|
273
|
+
*/
|
|
249
274
|
validate?: boolean
|
|
250
275
|
/** Compare-and-swap on the repo commit. If specified, must match current commit. */
|
|
251
276
|
swapCommit?: CidString
|
|
252
277
|
}
|
|
253
278
|
|
|
254
|
-
export type UploadBlobOptions = Omit<
|
|
255
|
-
XrpcOptions<typeof com.atproto.repo.uploadBlob.main>,
|
|
256
|
-
'body'
|
|
257
|
-
>
|
|
279
|
+
export type UploadBlobOptions = Omit<XrpcOptions<typeof uploadBlob>, 'body'>
|
|
258
280
|
|
|
259
|
-
export type GetBlobOptions = Omit<
|
|
260
|
-
XrpcOptions<typeof com.atproto.sync.getBlob.main>,
|
|
261
|
-
'params'
|
|
262
|
-
>
|
|
281
|
+
export type GetBlobOptions = Omit<XrpcOptions<typeof getBlob>, 'params'>
|
|
263
282
|
|
|
264
283
|
/**
|
|
265
284
|
* Type-safe options for {@link Client.create}, combining record options with key requirements.
|
|
@@ -274,7 +293,7 @@ export type CreateOptions<T extends RecordSchema> = CreateRecordOptions &
|
|
|
274
293
|
* Contains the URI and CID of the newly created record.
|
|
275
294
|
*/
|
|
276
295
|
export type CreateOutput = InferMethodOutputBody<
|
|
277
|
-
typeof
|
|
296
|
+
typeof createRecord,
|
|
278
297
|
Uint8Array
|
|
279
298
|
>
|
|
280
299
|
|
|
@@ -289,7 +308,7 @@ export type DeleteOptions<T extends RecordSchema> = DeleteRecordOptions &
|
|
|
289
308
|
* Output type for record deletion operations.
|
|
290
309
|
*/
|
|
291
310
|
export type DeleteOutput = InferMethodOutputBody<
|
|
292
|
-
typeof
|
|
311
|
+
typeof deleteRecord,
|
|
293
312
|
Uint8Array
|
|
294
313
|
>
|
|
295
314
|
|
|
@@ -306,7 +325,7 @@ export type GetOptions<T extends RecordSchema> = GetRecordOptions &
|
|
|
306
325
|
* @typeParam T - The record schema type
|
|
307
326
|
*/
|
|
308
327
|
export type GetOutput<T extends RecordSchema> = Omit<
|
|
309
|
-
InferMethodOutputBody<typeof
|
|
328
|
+
InferMethodOutputBody<typeof getRecord, Uint8Array>,
|
|
310
329
|
'value'
|
|
311
330
|
> & { value: Infer<T> }
|
|
312
331
|
|
|
@@ -321,10 +340,7 @@ export type PutOptions<T extends RecordSchema> = PutRecordOptions &
|
|
|
321
340
|
* Output type for record put (create/update) operations.
|
|
322
341
|
* Contains the URI and CID of the record.
|
|
323
342
|
*/
|
|
324
|
-
export type PutOutput = InferMethodOutputBody<
|
|
325
|
-
typeof com.atproto.repo.putRecord.main,
|
|
326
|
-
Uint8Array
|
|
327
|
-
>
|
|
343
|
+
export type PutOutput = InferMethodOutputBody<typeof putRecord, Uint8Array>
|
|
328
344
|
|
|
329
345
|
/**
|
|
330
346
|
* Options for {@link Client.list} operations.
|
|
@@ -337,7 +353,7 @@ export type ListOptions = ListRecordsOptions
|
|
|
337
353
|
* @typeParam T - The record schema type
|
|
338
354
|
*/
|
|
339
355
|
export type ListOutput<T extends RecordSchema> = InferMethodOutputBody<
|
|
340
|
-
typeof
|
|
356
|
+
typeof listRecords,
|
|
341
357
|
Uint8Array
|
|
342
358
|
> & {
|
|
343
359
|
/** Records that successfully validated against the schema. */
|
|
@@ -353,10 +369,11 @@ export type ListOutput<T extends RecordSchema> = InferMethodOutputBody<
|
|
|
353
369
|
* A record from a list operation with its value typed to the schema.
|
|
354
370
|
* @typeParam Value - The validated record value type
|
|
355
371
|
*/
|
|
356
|
-
export type ListRecord<Value extends LexMap> =
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
372
|
+
export type ListRecord<Value extends LexMap> = {
|
|
373
|
+
uri: AtUriString
|
|
374
|
+
cid: CidString
|
|
375
|
+
value: Value
|
|
376
|
+
}
|
|
360
377
|
|
|
361
378
|
/**
|
|
362
379
|
* The Client class is the primary interface for interacting with AT Protocol
|
|
@@ -614,7 +631,7 @@ export class Client implements Agent {
|
|
|
614
631
|
rkey?: string,
|
|
615
632
|
options?: CreateRecordOptions,
|
|
616
633
|
) {
|
|
617
|
-
return this.xrpc(
|
|
634
|
+
return this.xrpc(createRecord, {
|
|
618
635
|
...options,
|
|
619
636
|
body: {
|
|
620
637
|
repo: options?.repo ?? this.assertDid,
|
|
@@ -641,7 +658,7 @@ export class Client implements Agent {
|
|
|
641
658
|
rkey: string,
|
|
642
659
|
options?: DeleteRecordOptions,
|
|
643
660
|
) {
|
|
644
|
-
return this.xrpc(
|
|
661
|
+
return this.xrpc(deleteRecord, {
|
|
645
662
|
...options,
|
|
646
663
|
body: {
|
|
647
664
|
repo: options?.repo ?? this.assertDid,
|
|
@@ -667,7 +684,7 @@ export class Client implements Agent {
|
|
|
667
684
|
rkey: string,
|
|
668
685
|
options?: GetRecordOptions,
|
|
669
686
|
) {
|
|
670
|
-
return this.xrpc(
|
|
687
|
+
return this.xrpc(getRecord, {
|
|
671
688
|
...options,
|
|
672
689
|
params: {
|
|
673
690
|
repo: options?.repo ?? this.assertDid,
|
|
@@ -691,7 +708,7 @@ export class Client implements Agent {
|
|
|
691
708
|
rkey: string,
|
|
692
709
|
options?: PutRecordOptions,
|
|
693
710
|
) {
|
|
694
|
-
return this.xrpc(
|
|
711
|
+
return this.xrpc(putRecord, {
|
|
695
712
|
...options,
|
|
696
713
|
body: {
|
|
697
714
|
repo: options?.repo ?? this.assertDid,
|
|
@@ -714,7 +731,7 @@ export class Client implements Agent {
|
|
|
714
731
|
* @see {@link list} for a higher-level typed alternative
|
|
715
732
|
*/
|
|
716
733
|
async listRecords(nsid: NsidString, options?: ListRecordsOptions) {
|
|
717
|
-
return this.xrpc(
|
|
734
|
+
return this.xrpc(listRecords, {
|
|
718
735
|
...options,
|
|
719
736
|
params: {
|
|
720
737
|
repo: options?.repo ?? this.assertDid,
|
|
@@ -753,7 +770,7 @@ export class Client implements Agent {
|
|
|
753
770
|
factory: WriteOperationsFactory,
|
|
754
771
|
options?: ApplyWritesOptions,
|
|
755
772
|
) {
|
|
756
|
-
return this.xrpc(
|
|
773
|
+
return this.xrpc(applyWrites, {
|
|
757
774
|
...options,
|
|
758
775
|
body: {
|
|
759
776
|
repo: options?.repo ?? this.assertDid,
|
|
@@ -781,7 +798,7 @@ export class Client implements Agent {
|
|
|
781
798
|
* ```
|
|
782
799
|
*/
|
|
783
800
|
async uploadBlob(body: BinaryBodyInit, options?: UploadBlobOptions) {
|
|
784
|
-
return this.xrpc(
|
|
801
|
+
return this.xrpc(uploadBlob, { ...options, body })
|
|
785
802
|
}
|
|
786
803
|
|
|
787
804
|
/**
|
|
@@ -792,7 +809,7 @@ export class Client implements Agent {
|
|
|
792
809
|
* @param options - Call options
|
|
793
810
|
*/
|
|
794
811
|
async getBlob(did: DidString, cid: CidString, options?: GetBlobOptions) {
|
|
795
|
-
return this.xrpc(
|
|
812
|
+
return this.xrpc(getBlob, {
|
|
796
813
|
...options,
|
|
797
814
|
params: { did, cid },
|
|
798
815
|
})
|