@atcute/microcosm 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +95 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +2 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/lexicons/index.d.ts +5 -0
  8. package/dist/lexicons/index.d.ts.map +1 -0
  9. package/dist/lexicons/index.js +5 -0
  10. package/dist/lexicons/index.js.map +1 -0
  11. package/dist/lexicons/types/blue/microcosm/links/getBacklinks.d.ts +71 -0
  12. package/dist/lexicons/types/blue/microcosm/links/getBacklinks.d.ts.map +1 -0
  13. package/dist/lexicons/types/blue/microcosm/links/getBacklinks.js +59 -0
  14. package/dist/lexicons/types/blue/microcosm/links/getBacklinks.js.map +1 -0
  15. package/dist/lexicons/types/blue/microcosm/links/getManyToManyCounts.d.ts +75 -0
  16. package/dist/lexicons/types/blue/microcosm/links/getManyToManyCounts.d.ts.map +1 -0
  17. package/dist/lexicons/types/blue/microcosm/links/getManyToManyCounts.js +64 -0
  18. package/dist/lexicons/types/blue/microcosm/links/getManyToManyCounts.js.map +1 -0
  19. package/dist/lexicons/types/com/bad-example/identity/resolveMiniDoc.d.ts +42 -0
  20. package/dist/lexicons/types/com/bad-example/identity/resolveMiniDoc.d.ts.map +1 -0
  21. package/dist/lexicons/types/com/bad-example/identity/resolveMiniDoc.js +32 -0
  22. package/dist/lexicons/types/com/bad-example/identity/resolveMiniDoc.js.map +1 -0
  23. package/dist/lexicons/types/com/bad-example/repo/getUriRecord.d.ts +42 -0
  24. package/dist/lexicons/types/com/bad-example/repo/getUriRecord.d.ts.map +1 -0
  25. package/dist/lexicons/types/com/bad-example/repo/getUriRecord.js +32 -0
  26. package/dist/lexicons/types/com/bad-example/repo/getUriRecord.js.map +1 -0
  27. package/lib/index.ts +1 -0
  28. package/lib/lexicons/index.ts +4 -0
  29. package/lib/lexicons/types/blue/microcosm/links/getBacklinks.ts +81 -0
  30. package/lib/lexicons/types/blue/microcosm/links/getManyToManyCounts.ts +87 -0
  31. package/lib/lexicons/types/com/bad-example/identity/resolveMiniDoc.ts +48 -0
  32. package/lib/lexicons/types/com/bad-example/repo/getUriRecord.ts +48 -0
  33. package/package.json +46 -0
package/LICENSE ADDED
@@ -0,0 +1,14 @@
1
+ BSD Zero Clause License
2
+
3
+ Copyright (c) 2025 Mary
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,95 @@
1
+ # @atcute/microcosm
2
+
3
+ [Microcosm](https://www.microcosm.blue/) (blue.microcosm.\*, com.bad-example.\*) schema definitions
4
+
5
+ Microcosm is a collection of services and independent community-run infrastructure for AT Protocol,
6
+ including:
7
+
8
+ - [Constellation](https://constellation.microcosm.blue/): global backlink index for tracking social
9
+ interactions
10
+ - [Slingshot](https://slingshot.microcosm.blue/): edge record cache for improved performance and
11
+ reliability
12
+
13
+ ## usage
14
+
15
+ ```ts
16
+ import { Client, ok, simpleFetchHandler } from '@atcute/client';
17
+ import type {} from '@atcute/microcosm';
18
+
19
+ {
20
+ const constellation = new Client({
21
+ handler: simpleFetchHandler({ service: 'https://constellation.microcosm.blue' }),
22
+ });
23
+
24
+ const backlinks = await ok(
25
+ constellation.get('blue.microcosm.links.getBacklinks', {
26
+ params: {
27
+ subject: 'at://did:plc:example/app.bsky.feed.post/123',
28
+ source: 'app.bsky.feed.like:subject.uri',
29
+ limit: 50,
30
+ },
31
+ }),
32
+ );
33
+
34
+ console.log(backlinks.total);
35
+ // -> 42
36
+ }
37
+
38
+ {
39
+ const slingshot = new Client({
40
+ handler: simpleFetchHandler({ service: 'https://slingshot.microcosm.blue' }),
41
+ });
42
+
43
+ const resolved = await ok(
44
+ slingshot.get('com.bad-example.identity.resolveMiniDoc', {
45
+ params: {
46
+ identifier: 'microcosm.blue',
47
+ },
48
+ }),
49
+ );
50
+
51
+ console.log(resolved.pds);
52
+ // -> 'https://dapperling.us-west.host.bsky.network'
53
+ }
54
+ ```
55
+
56
+ ### with `@atcute/client`
57
+
58
+ pick either one of these 3 options to register the ambient declarations
59
+
60
+ ```jsonc
61
+ // tsconfig.json
62
+ {
63
+ "compilerOptions": {
64
+ "types": ["@atcute/microcosm"],
65
+ },
66
+ }
67
+ ```
68
+
69
+ ```ts
70
+ // env.d.ts
71
+ /// <reference types="@atcute/microcosm" />
72
+ ```
73
+
74
+ ```ts
75
+ // index.ts
76
+ import type {} from '@atcute/microcosm';
77
+ ```
78
+
79
+ now all the XRPC operations should be visible in the client
80
+
81
+ ## with `@atcute/lex-cli`
82
+
83
+ when building your own lexicons that reference Microcosm types, configure lex-cli to import from
84
+ this package:
85
+
86
+ ```ts
87
+ // file: lex.config.js
88
+ import { defineLexiconConfig } from '@atcute/lex-cli';
89
+
90
+ export default defineLexiconConfig({
91
+ files: ['lexicons/**/*.json'],
92
+ outdir: 'src/lexicons/',
93
+ imports: ['@atcute/microcosm'],
94
+ });
95
+ ```
@@ -0,0 +1,2 @@
1
+ export * from './lexicons/index.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './lexicons/index.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * as BlueMicrocosmLinksGetBacklinks from './types/blue/microcosm/links/getBacklinks.js';
2
+ export * as BlueMicrocosmLinksGetManyToManyCounts from './types/blue/microcosm/links/getManyToManyCounts.js';
3
+ export * as ComBadExampleIdentityResolveMiniDoc from './types/com/bad-example/identity/resolveMiniDoc.js';
4
+ export * as ComBadExampleRepoGetUriRecord from './types/com/bad-example/repo/getUriRecord.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/lexicons/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,8BAA8B,MAAM,8CAA8C,CAAC;AAC/F,OAAO,KAAK,qCAAqC,MAAM,qDAAqD,CAAC;AAC7G,OAAO,KAAK,mCAAmC,MAAM,oDAAoD,CAAC;AAC1G,OAAO,KAAK,6BAA6B,MAAM,8CAA8C,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * as BlueMicrocosmLinksGetBacklinks from './types/blue/microcosm/links/getBacklinks.js';
2
+ export * as BlueMicrocosmLinksGetManyToManyCounts from './types/blue/microcosm/links/getManyToManyCounts.js';
3
+ export * as ComBadExampleIdentityResolveMiniDoc from './types/com/bad-example/identity/resolveMiniDoc.js';
4
+ export * as ComBadExampleRepoGetUriRecord from './types/com/bad-example/repo/getUriRecord.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/lexicons/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,8BAA8B,MAAM,8CAA8C,CAAC;AAC/F,OAAO,KAAK,qCAAqC,MAAM,qDAAqD,CAAC;AAC7G,OAAO,KAAK,mCAAmC,MAAM,oDAAoD,CAAC;AAC1G,OAAO,KAAK,6BAA6B,MAAM,8CAA8C,CAAC"}
@@ -0,0 +1,71 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ declare const _linkRecordSchema: v.ObjectSchema<{
3
+ $type: v.OptionalSchema<v.LiteralSchema<"blue.microcosm.links.getBacklinks#linkRecord">, undefined>;
4
+ /**
5
+ * the collection of the linking record
6
+ */
7
+ collection: v.FormattedStringSchema<"nsid">;
8
+ /**
9
+ * the DID of the linking record's repository
10
+ */
11
+ did: v.FormattedStringSchema<"did">;
12
+ /**
13
+ * the record key of the linking record
14
+ */
15
+ rkey: v.FormattedStringSchema<"record-key">;
16
+ }>;
17
+ declare const _mainSchema: v.XRPCQueryMetadata<v.ObjectSchema<{
18
+ /**
19
+ * filter links to those from specific users
20
+ */
21
+ did: v.OptionalSchema<v.ArraySchema<v.FormattedStringSchema<"did">>, undefined>;
22
+ /**
23
+ * number of results to return
24
+ * @minimum 1
25
+ * @maximum 100
26
+ * @default 16
27
+ */
28
+ limit: v.OptionalSchema<v.SchemaWithConstraint<v.IntegerSchema, readonly [v.IntegerRangeConstraint<1, 100>]>, 16>;
29
+ /**
30
+ * collection and path specification (e.g., 'app.bsky.feed.like:subject.uri')
31
+ */
32
+ source: v.StringSchema<string>;
33
+ /**
34
+ * the target being linked to (at-uri, did, or uri)
35
+ */
36
+ subject: v.FormattedStringSchema<"uri">;
37
+ }>, {
38
+ type: "lex";
39
+ schema: v.ObjectSchema<{
40
+ /**
41
+ * pagination cursor
42
+ */
43
+ cursor: v.OptionalSchema<v.StringSchema<string>, undefined>;
44
+ readonly records: v.ArraySchema<linkRecordSchema>;
45
+ /**
46
+ * total number of matching links
47
+ */
48
+ total: v.IntegerSchema;
49
+ }>;
50
+ }, "blue.microcosm.links.getBacklinks">;
51
+ type linkRecord$schematype = typeof _linkRecordSchema;
52
+ type main$schematype = typeof _mainSchema;
53
+ export interface linkRecordSchema extends linkRecord$schematype {
54
+ }
55
+ export interface mainSchema extends main$schematype {
56
+ }
57
+ export declare const linkRecordSchema: linkRecordSchema;
58
+ export declare const mainSchema: mainSchema;
59
+ export interface LinkRecord extends v.InferInput<typeof linkRecordSchema> {
60
+ }
61
+ export interface $params extends v.InferInput<mainSchema['params']> {
62
+ }
63
+ export interface $output extends v.InferXRPCBodyInput<mainSchema['output']> {
64
+ }
65
+ declare module '@atcute/lexicons/ambient' {
66
+ interface XRPCQueries {
67
+ 'blue.microcosm.links.getBacklinks': mainSchema;
68
+ }
69
+ }
70
+ export {};
71
+ //# sourceMappingURL=getBacklinks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBacklinks.d.ts","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/blue/microcosm/links/getBacklinks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAGlD,QAAA,MAAM,iBAAiB;;IAEtB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;EAEF,CAAC;AACH,QAAA,MAAM,WAAW;IAEf;;OAEG;;IAEH;;;;;OAKG;;IAKH;;OAEG;;IAEH;;OAEG;;;;;QAMF;;WAEG;;;QAKH;;WAEG;;;uCAIJ,CAAC;AAEH,KAAK,qBAAqB,GAAG,OAAO,iBAAiB,CAAC;AACtD,KAAK,eAAe,GAAG,OAAO,WAAW,CAAC;AAE1C,MAAM,WAAW,gBAAiB,SAAQ,qBAAqB;CAAG;AAClE,MAAM,WAAW,UAAW,SAAQ,eAAe;CAAG;AAEtD,eAAO,MAAM,gBAAgB,EAAwB,gBAAgB,CAAC;AACtE,eAAO,MAAM,UAAU,EAAkB,UAAU,CAAC;AAEpD,MAAM,WAAW,UAAW,SAAQ,CAAC,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC;CAAG;AAE5E,MAAM,WAAW,OAAQ,SAAQ,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;CAAG;AACtE,MAAM,WAAW,OAAQ,SAAQ,CAAC,CAAC,kBAAkB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;CAAG;AAE9E,OAAO,QAAQ,0BAA0B,CAAC;IACzC,UAAU,WAAW;QACpB,mCAAmC,EAAE,UAAU,CAAC;KAChD;CACD"}
@@ -0,0 +1,59 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ const _linkRecordSchema = /*#__PURE__*/ v.object({
3
+ $type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('blue.microcosm.links.getBacklinks#linkRecord')),
4
+ /**
5
+ * the collection of the linking record
6
+ */
7
+ collection: /*#__PURE__*/ v.nsidString(),
8
+ /**
9
+ * the DID of the linking record's repository
10
+ */
11
+ did: /*#__PURE__*/ v.didString(),
12
+ /**
13
+ * the record key of the linking record
14
+ */
15
+ rkey: /*#__PURE__*/ v.recordKeyString(),
16
+ });
17
+ const _mainSchema = /*#__PURE__*/ v.query('blue.microcosm.links.getBacklinks', {
18
+ params: /*#__PURE__*/ v.object({
19
+ /**
20
+ * filter links to those from specific users
21
+ */
22
+ did: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.array(/*#__PURE__*/ v.didString())),
23
+ /**
24
+ * number of results to return
25
+ * @minimum 1
26
+ * @maximum 100
27
+ * @default 16
28
+ */
29
+ limit: /*#__PURE__*/ v.optional(
30
+ /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [/*#__PURE__*/ v.integerRange(1, 100)]), 16),
31
+ /**
32
+ * collection and path specification (e.g., 'app.bsky.feed.like:subject.uri')
33
+ */
34
+ source: /*#__PURE__*/ v.string(),
35
+ /**
36
+ * the target being linked to (at-uri, did, or uri)
37
+ */
38
+ subject: /*#__PURE__*/ v.genericUriString(),
39
+ }),
40
+ output: {
41
+ type: 'lex',
42
+ schema: /*#__PURE__*/ v.object({
43
+ /**
44
+ * pagination cursor
45
+ */
46
+ cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
47
+ get records() {
48
+ return /*#__PURE__*/ v.array(linkRecordSchema);
49
+ },
50
+ /**
51
+ * total number of matching links
52
+ */
53
+ total: /*#__PURE__*/ v.integer(),
54
+ }),
55
+ },
56
+ });
57
+ export const linkRecordSchema = _linkRecordSchema;
58
+ export const mainSchema = _mainSchema;
59
+ //# sourceMappingURL=getBacklinks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBacklinks.js","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/blue/microcosm/links/getBacklinks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAGlD,MAAM,iBAAiB,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;IAChD,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,8CAA8C,CAAC,CAAC;IACxG;;OAEG;IACH,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,UAAU,EAAE;IACxC;;OAEG;IACH,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE;IAChC;;OAEG;IACH,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,eAAe,EAAE;CACvC,CAAC,CAAC;AACH,MAAM,WAAW,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,mCAAmC,EAAE;IAC9E,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9B;;WAEG;QACH,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;QACjF;;;;;WAKG;QACH,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ;QAC9B,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAC5F,EAAE,CACF;QACD;;WAEG;QACH,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE;QAChC;;WAEG;QACH,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,gBAAgB,EAAE;KAC3C,CAAC;IACF,MAAM,EAAE;QACP,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;YAC9B;;eAEG;YACH,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;YAC1D,IAAI,OAAO;gBACV,OAAO,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;YAChD,CAAC;YACD;;eAEG;YACH,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE;SAChC,CAAC;KACF;CACD,CAAC,CAAC;AAQH,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAqC,CAAC;AACtE,MAAM,CAAC,MAAM,UAAU,GAAG,WAAyB,CAAC"}
@@ -0,0 +1,75 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ declare const _countBySubjectSchema: v.ObjectSchema<{
3
+ $type: v.OptionalSchema<v.LiteralSchema<"blue.microcosm.links.getManyToManyCounts#countBySubject">, undefined>;
4
+ /**
5
+ * number of distinct DIDs linking to this subject
6
+ */
7
+ distinct: v.IntegerSchema;
8
+ /**
9
+ * the secondary subject being counted
10
+ */
11
+ subject: v.StringSchema<string>;
12
+ /**
13
+ * total number of links to this subject
14
+ */
15
+ total: v.IntegerSchema;
16
+ }>;
17
+ declare const _mainSchema: v.XRPCQueryMetadata<v.ObjectSchema<{
18
+ /**
19
+ * filter links to those from specific users
20
+ */
21
+ did: v.OptionalSchema<v.ArraySchema<v.FormattedStringSchema<"did">>, undefined>;
22
+ /**
23
+ * number of results to return
24
+ * @minimum 1
25
+ * @maximum 100
26
+ * @default 16
27
+ */
28
+ limit: v.OptionalSchema<v.SchemaWithConstraint<v.IntegerSchema, readonly [v.IntegerRangeConstraint<1, 100>]>, 16>;
29
+ /**
30
+ * filter secondary links to specific subjects
31
+ */
32
+ otherSubject: v.OptionalSchema<v.ArraySchema<v.StringSchema<string>>, undefined>;
33
+ /**
34
+ * path to the secondary link in the many-to-many record (e.g., 'otherThing.uri')
35
+ */
36
+ pathToOther: v.StringSchema<string>;
37
+ /**
38
+ * collection and path specification for the primary link
39
+ */
40
+ source: v.StringSchema<string>;
41
+ /**
42
+ * the primary target being linked to (at-uri, did, or uri)
43
+ */
44
+ subject: v.FormattedStringSchema<"uri">;
45
+ }>, {
46
+ type: "lex";
47
+ schema: v.ObjectSchema<{
48
+ readonly counts_by_other_subject: v.ArraySchema<countBySubjectSchema>;
49
+ /**
50
+ * pagination cursor
51
+ */
52
+ cursor: v.OptionalSchema<v.StringSchema<string>, undefined>;
53
+ }>;
54
+ }, "blue.microcosm.links.getManyToManyCounts">;
55
+ type countBySubject$schematype = typeof _countBySubjectSchema;
56
+ type main$schematype = typeof _mainSchema;
57
+ export interface countBySubjectSchema extends countBySubject$schematype {
58
+ }
59
+ export interface mainSchema extends main$schematype {
60
+ }
61
+ export declare const countBySubjectSchema: countBySubjectSchema;
62
+ export declare const mainSchema: mainSchema;
63
+ export interface CountBySubject extends v.InferInput<typeof countBySubjectSchema> {
64
+ }
65
+ export interface $params extends v.InferInput<mainSchema['params']> {
66
+ }
67
+ export interface $output extends v.InferXRPCBodyInput<mainSchema['output']> {
68
+ }
69
+ declare module '@atcute/lexicons/ambient' {
70
+ interface XRPCQueries {
71
+ 'blue.microcosm.links.getManyToManyCounts': mainSchema;
72
+ }
73
+ }
74
+ export {};
75
+ //# sourceMappingURL=getManyToManyCounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getManyToManyCounts.d.ts","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/blue/microcosm/links/getManyToManyCounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAGlD,QAAA,MAAM,qBAAqB;;IAI1B;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;EAEF,CAAC;AACH,QAAA,MAAM,WAAW;IAEf;;OAEG;;IAEH;;;;;OAKG;;IAKH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;QASF;;WAEG;;;8CAIJ,CAAC;AAEH,KAAK,yBAAyB,GAAG,OAAO,qBAAqB,CAAC;AAC9D,KAAK,eAAe,GAAG,OAAO,WAAW,CAAC;AAE1C,MAAM,WAAW,oBAAqB,SAAQ,yBAAyB;CAAG;AAC1E,MAAM,WAAW,UAAW,SAAQ,eAAe;CAAG;AAEtD,eAAO,MAAM,oBAAoB,EAA4B,oBAAoB,CAAC;AAClF,eAAO,MAAM,UAAU,EAAkB,UAAU,CAAC;AAEpD,MAAM,WAAW,cAAe,SAAQ,CAAC,CAAC,UAAU,CAAC,OAAO,oBAAoB,CAAC;CAAG;AAEpF,MAAM,WAAW,OAAQ,SAAQ,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;CAAG;AACtE,MAAM,WAAW,OAAQ,SAAQ,CAAC,CAAC,kBAAkB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;CAAG;AAE9E,OAAO,QAAQ,0BAA0B,CAAC;IACzC,UAAU,WAAW;QACpB,0CAA0C,EAAE,UAAU,CAAC;KACvD;CACD"}
@@ -0,0 +1,64 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ const _countBySubjectSchema = /*#__PURE__*/ v.object({
3
+ $type: /*#__PURE__*/ v.optional(
4
+ /*#__PURE__*/ v.literal('blue.microcosm.links.getManyToManyCounts#countBySubject')),
5
+ /**
6
+ * number of distinct DIDs linking to this subject
7
+ */
8
+ distinct: /*#__PURE__*/ v.integer(),
9
+ /**
10
+ * the secondary subject being counted
11
+ */
12
+ subject: /*#__PURE__*/ v.string(),
13
+ /**
14
+ * total number of links to this subject
15
+ */
16
+ total: /*#__PURE__*/ v.integer(),
17
+ });
18
+ const _mainSchema = /*#__PURE__*/ v.query('blue.microcosm.links.getManyToManyCounts', {
19
+ params: /*#__PURE__*/ v.object({
20
+ /**
21
+ * filter links to those from specific users
22
+ */
23
+ did: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.array(/*#__PURE__*/ v.didString())),
24
+ /**
25
+ * number of results to return
26
+ * @minimum 1
27
+ * @maximum 100
28
+ * @default 16
29
+ */
30
+ limit: /*#__PURE__*/ v.optional(
31
+ /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [/*#__PURE__*/ v.integerRange(1, 100)]), 16),
32
+ /**
33
+ * filter secondary links to specific subjects
34
+ */
35
+ otherSubject: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.array(/*#__PURE__*/ v.string())),
36
+ /**
37
+ * path to the secondary link in the many-to-many record (e.g., 'otherThing.uri')
38
+ */
39
+ pathToOther: /*#__PURE__*/ v.string(),
40
+ /**
41
+ * collection and path specification for the primary link
42
+ */
43
+ source: /*#__PURE__*/ v.string(),
44
+ /**
45
+ * the primary target being linked to (at-uri, did, or uri)
46
+ */
47
+ subject: /*#__PURE__*/ v.genericUriString(),
48
+ }),
49
+ output: {
50
+ type: 'lex',
51
+ schema: /*#__PURE__*/ v.object({
52
+ get counts_by_other_subject() {
53
+ return /*#__PURE__*/ v.array(countBySubjectSchema);
54
+ },
55
+ /**
56
+ * pagination cursor
57
+ */
58
+ cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
59
+ }),
60
+ },
61
+ });
62
+ export const countBySubjectSchema = _countBySubjectSchema;
63
+ export const mainSchema = _mainSchema;
64
+ //# sourceMappingURL=getManyToManyCounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getManyToManyCounts.js","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/blue/microcosm/links/getManyToManyCounts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAGlD,MAAM,qBAAqB,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;IACpD,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ;IAC9B,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,yDAAyD,CAAC,CAClF;IACD;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE;IACnC;;OAEG;IACH,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE;IACjC;;OAEG;IACH,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE;CAChC,CAAC,CAAC;AACH,MAAM,WAAW,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,0CAA0C,EAAE;IACrF,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9B;;WAEG;QACH,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;QACjF;;;;;WAKG;QACH,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ;QAC9B,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAC5F,EAAE,CACF;QACD;;WAEG;QACH,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QACvF;;WAEG;QACH,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE;QACrC;;WAEG;QACH,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE;QAChC;;WAEG;QACH,OAAO,EAAE,aAAa,CAAC,CAAC,CAAC,gBAAgB,EAAE;KAC3C,CAAC;IACF,MAAM,EAAE;QACP,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;YAC9B,IAAI,uBAAuB;gBAC1B,OAAO,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;YACpD,CAAC;YACD;;eAEG;YACH,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SAC1D,CAAC;KACF;CACD,CAAC,CAAC;AAQH,MAAM,CAAC,MAAM,oBAAoB,GAAG,qBAA6C,CAAC;AAClF,MAAM,CAAC,MAAM,UAAU,GAAG,WAAyB,CAAC"}
@@ -0,0 +1,42 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ declare const _mainSchema: v.XRPCQueryMetadata<v.ObjectSchema<{
3
+ /**
4
+ * handle or DID to resolve
5
+ */
6
+ identifier: v.FormattedStringSchema<"at-identifier">;
7
+ }>, {
8
+ type: "lex";
9
+ schema: v.ObjectSchema<{
10
+ /**
11
+ * DID, bi-directionally verified if a handle was provided in the query
12
+ */
13
+ did: v.FormattedStringSchema<"did">;
14
+ /**
15
+ * the validated handle of the account or 'handle.invalid' if the handle did not bi-directionally match the DID document
16
+ */
17
+ handle: v.FormattedStringSchema<"handle">;
18
+ /**
19
+ * the identity's PDS URL
20
+ */
21
+ pds: v.FormattedStringSchema<"uri">;
22
+ /**
23
+ * the atproto signing key publicKeyMultibase
24
+ */
25
+ signing_key: v.StringSchema<string>;
26
+ }>;
27
+ }, "com.bad-example.identity.resolveMiniDoc">;
28
+ type main$schematype = typeof _mainSchema;
29
+ export interface mainSchema extends main$schematype {
30
+ }
31
+ export declare const mainSchema: mainSchema;
32
+ export interface $params extends v.InferInput<mainSchema['params']> {
33
+ }
34
+ export interface $output extends v.InferXRPCBodyInput<mainSchema['output']> {
35
+ }
36
+ declare module '@atcute/lexicons/ambient' {
37
+ interface XRPCQueries {
38
+ 'com.bad-example.identity.resolveMiniDoc': mainSchema;
39
+ }
40
+ }
41
+ export {};
42
+ //# sourceMappingURL=resolveMiniDoc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveMiniDoc.d.ts","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/com/bad-example/identity/resolveMiniDoc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAGlD,QAAA,MAAM,WAAW;IAEf;;OAEG;;;;;QAMF;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;;6CAIJ,CAAC;AAEH,KAAK,eAAe,GAAG,OAAO,WAAW,CAAC;AAE1C,MAAM,WAAW,UAAW,SAAQ,eAAe;CAAG;AAEtD,eAAO,MAAM,UAAU,EAAkB,UAAU,CAAC;AAEpD,MAAM,WAAW,OAAQ,SAAQ,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;CAAG;AACtE,MAAM,WAAW,OAAQ,SAAQ,CAAC,CAAC,kBAAkB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;CAAG;AAE9E,OAAO,QAAQ,0BAA0B,CAAC;IACzC,UAAU,WAAW;QACpB,yCAAyC,EAAE,UAAU,CAAC;KACtD;CACD"}
@@ -0,0 +1,32 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ const _mainSchema = /*#__PURE__*/ v.query('com.bad-example.identity.resolveMiniDoc', {
3
+ params: /*#__PURE__*/ v.object({
4
+ /**
5
+ * handle or DID to resolve
6
+ */
7
+ identifier: /*#__PURE__*/ v.actorIdentifierString(),
8
+ }),
9
+ output: {
10
+ type: 'lex',
11
+ schema: /*#__PURE__*/ v.object({
12
+ /**
13
+ * DID, bi-directionally verified if a handle was provided in the query
14
+ */
15
+ did: /*#__PURE__*/ v.didString(),
16
+ /**
17
+ * the validated handle of the account or 'handle.invalid' if the handle did not bi-directionally match the DID document
18
+ */
19
+ handle: /*#__PURE__*/ v.handleString(),
20
+ /**
21
+ * the identity's PDS URL
22
+ */
23
+ pds: /*#__PURE__*/ v.genericUriString(),
24
+ /**
25
+ * the atproto signing key publicKeyMultibase
26
+ */
27
+ signing_key: /*#__PURE__*/ v.string(),
28
+ }),
29
+ },
30
+ });
31
+ export const mainSchema = _mainSchema;
32
+ //# sourceMappingURL=resolveMiniDoc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveMiniDoc.js","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/com/bad-example/identity/resolveMiniDoc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAGlD,MAAM,WAAW,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,yCAAyC,EAAE;IACpF,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9B;;WAEG;QACH,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,qBAAqB,EAAE;KACnD,CAAC;IACF,MAAM,EAAE;QACP,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;YAC9B;;eAEG;YACH,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE;YAChC;;eAEG;YACH,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,YAAY,EAAE;YACtC;;eAEG;YACH,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,gBAAgB,EAAE;YACvC;;eAEG;YACH,WAAW,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE;SACrC,CAAC;KACF;CACD,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,UAAU,GAAG,WAAyB,CAAC"}
@@ -0,0 +1,42 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ declare const _mainSchema: v.XRPCQueryMetadata<v.ObjectSchema<{
3
+ /**
4
+ * the at-uri of the record (identifier can be a DID or handle)
5
+ */
6
+ at_uri: v.FormattedStringSchema<"at-uri">;
7
+ /**
8
+ * optional CID of the version of the record. if not specified, return the most recent version. if specified and a newer version exists, returns 404.
9
+ */
10
+ cid: v.OptionalSchema<v.FormattedStringSchema<"cid">, undefined>;
11
+ }>, {
12
+ type: "lex";
13
+ schema: v.ObjectSchema<{
14
+ /**
15
+ * CID for this exact version of the record
16
+ */
17
+ cid: v.OptionalSchema<v.FormattedStringSchema<"cid">, undefined>;
18
+ /**
19
+ * at-uri for this record
20
+ */
21
+ uri: v.FormattedStringSchema<"at-uri">;
22
+ /**
23
+ * the record itself
24
+ */
25
+ value: v.UnknownSchema;
26
+ }>;
27
+ }, "com.bad-example.repo.getUriRecord">;
28
+ type main$schematype = typeof _mainSchema;
29
+ export interface mainSchema extends main$schematype {
30
+ }
31
+ export declare const mainSchema: mainSchema;
32
+ export interface $params extends v.InferInput<mainSchema['params']> {
33
+ }
34
+ export interface $output extends v.InferXRPCBodyInput<mainSchema['output']> {
35
+ }
36
+ declare module '@atcute/lexicons/ambient' {
37
+ interface XRPCQueries {
38
+ 'com.bad-example.repo.getUriRecord': mainSchema;
39
+ }
40
+ }
41
+ export {};
42
+ //# sourceMappingURL=getUriRecord.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUriRecord.d.ts","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/com/bad-example/repo/getUriRecord.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAGlD,QAAA,MAAM,WAAW;IAEf;;OAEG;;IAEH;;OAEG;;;;;QAMF;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;;uCAIJ,CAAC;AAEH,KAAK,eAAe,GAAG,OAAO,WAAW,CAAC;AAE1C,MAAM,WAAW,UAAW,SAAQ,eAAe;CAAG;AAEtD,eAAO,MAAM,UAAU,EAAkB,UAAU,CAAC;AAEpD,MAAM,WAAW,OAAQ,SAAQ,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;CAAG;AACtE,MAAM,WAAW,OAAQ,SAAQ,CAAC,CAAC,kBAAkB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;CAAG;AAE9E,OAAO,QAAQ,0BAA0B,CAAC;IACzC,UAAU,WAAW;QACpB,mCAAmC,EAAE,UAAU,CAAC;KAChD;CACD"}
@@ -0,0 +1,32 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ const _mainSchema = /*#__PURE__*/ v.query('com.bad-example.repo.getUriRecord', {
3
+ params: /*#__PURE__*/ v.object({
4
+ /**
5
+ * the at-uri of the record (identifier can be a DID or handle)
6
+ */
7
+ at_uri: /*#__PURE__*/ v.resourceUriString(),
8
+ /**
9
+ * optional CID of the version of the record. if not specified, return the most recent version. if specified and a newer version exists, returns 404.
10
+ */
11
+ cid: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.cidString()),
12
+ }),
13
+ output: {
14
+ type: 'lex',
15
+ schema: /*#__PURE__*/ v.object({
16
+ /**
17
+ * CID for this exact version of the record
18
+ */
19
+ cid: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.cidString()),
20
+ /**
21
+ * at-uri for this record
22
+ */
23
+ uri: /*#__PURE__*/ v.resourceUriString(),
24
+ /**
25
+ * the record itself
26
+ */
27
+ value: /*#__PURE__*/ v.unknown(),
28
+ }),
29
+ },
30
+ });
31
+ export const mainSchema = _mainSchema;
32
+ //# sourceMappingURL=getUriRecord.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUriRecord.js","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/com/bad-example/repo/getUriRecord.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAGlD,MAAM,WAAW,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,mCAAmC,EAAE;IAC9E,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9B;;WAEG;QACH,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,iBAAiB,EAAE;QAC3C;;WAEG;QACH,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;KAC1D,CAAC;IACF,MAAM,EAAE;QACP,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;YAC9B;;eAEG;YACH,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;YAC1D;;eAEG;YACH,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,iBAAiB,EAAE;YACxC;;eAEG;YACH,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,OAAO,EAAE;SAChC,CAAC;KACF;CACD,CAAC,CAAC;AAMH,MAAM,CAAC,MAAM,UAAU,GAAG,WAAyB,CAAC"}
package/lib/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './lexicons/index.js';
@@ -0,0 +1,4 @@
1
+ export * as BlueMicrocosmLinksGetBacklinks from './types/blue/microcosm/links/getBacklinks.js';
2
+ export * as BlueMicrocosmLinksGetManyToManyCounts from './types/blue/microcosm/links/getManyToManyCounts.js';
3
+ export * as ComBadExampleIdentityResolveMiniDoc from './types/com/bad-example/identity/resolveMiniDoc.js';
4
+ export * as ComBadExampleRepoGetUriRecord from './types/com/bad-example/repo/getUriRecord.js';
@@ -0,0 +1,81 @@
1
+ import type {} from '@atcute/lexicons';
2
+ import * as v from '@atcute/lexicons/validations';
3
+ import type {} from '@atcute/lexicons/ambient';
4
+
5
+ const _linkRecordSchema = /*#__PURE__*/ v.object({
6
+ $type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('blue.microcosm.links.getBacklinks#linkRecord')),
7
+ /**
8
+ * the collection of the linking record
9
+ */
10
+ collection: /*#__PURE__*/ v.nsidString(),
11
+ /**
12
+ * the DID of the linking record's repository
13
+ */
14
+ did: /*#__PURE__*/ v.didString(),
15
+ /**
16
+ * the record key of the linking record
17
+ */
18
+ rkey: /*#__PURE__*/ v.recordKeyString(),
19
+ });
20
+ const _mainSchema = /*#__PURE__*/ v.query('blue.microcosm.links.getBacklinks', {
21
+ params: /*#__PURE__*/ v.object({
22
+ /**
23
+ * filter links to those from specific users
24
+ */
25
+ did: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.array(/*#__PURE__*/ v.didString())),
26
+ /**
27
+ * number of results to return
28
+ * @minimum 1
29
+ * @maximum 100
30
+ * @default 16
31
+ */
32
+ limit: /*#__PURE__*/ v.optional(
33
+ /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [/*#__PURE__*/ v.integerRange(1, 100)]),
34
+ 16,
35
+ ),
36
+ /**
37
+ * collection and path specification (e.g., 'app.bsky.feed.like:subject.uri')
38
+ */
39
+ source: /*#__PURE__*/ v.string(),
40
+ /**
41
+ * the target being linked to (at-uri, did, or uri)
42
+ */
43
+ subject: /*#__PURE__*/ v.genericUriString(),
44
+ }),
45
+ output: {
46
+ type: 'lex',
47
+ schema: /*#__PURE__*/ v.object({
48
+ /**
49
+ * pagination cursor
50
+ */
51
+ cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
52
+ get records() {
53
+ return /*#__PURE__*/ v.array(linkRecordSchema);
54
+ },
55
+ /**
56
+ * total number of matching links
57
+ */
58
+ total: /*#__PURE__*/ v.integer(),
59
+ }),
60
+ },
61
+ });
62
+
63
+ type linkRecord$schematype = typeof _linkRecordSchema;
64
+ type main$schematype = typeof _mainSchema;
65
+
66
+ export interface linkRecordSchema extends linkRecord$schematype {}
67
+ export interface mainSchema extends main$schematype {}
68
+
69
+ export const linkRecordSchema = _linkRecordSchema as linkRecordSchema;
70
+ export const mainSchema = _mainSchema as mainSchema;
71
+
72
+ export interface LinkRecord extends v.InferInput<typeof linkRecordSchema> {}
73
+
74
+ export interface $params extends v.InferInput<mainSchema['params']> {}
75
+ export interface $output extends v.InferXRPCBodyInput<mainSchema['output']> {}
76
+
77
+ declare module '@atcute/lexicons/ambient' {
78
+ interface XRPCQueries {
79
+ 'blue.microcosm.links.getBacklinks': mainSchema;
80
+ }
81
+ }
@@ -0,0 +1,87 @@
1
+ import type {} from '@atcute/lexicons';
2
+ import * as v from '@atcute/lexicons/validations';
3
+ import type {} from '@atcute/lexicons/ambient';
4
+
5
+ const _countBySubjectSchema = /*#__PURE__*/ v.object({
6
+ $type: /*#__PURE__*/ v.optional(
7
+ /*#__PURE__*/ v.literal('blue.microcosm.links.getManyToManyCounts#countBySubject'),
8
+ ),
9
+ /**
10
+ * number of distinct DIDs linking to this subject
11
+ */
12
+ distinct: /*#__PURE__*/ v.integer(),
13
+ /**
14
+ * the secondary subject being counted
15
+ */
16
+ subject: /*#__PURE__*/ v.string(),
17
+ /**
18
+ * total number of links to this subject
19
+ */
20
+ total: /*#__PURE__*/ v.integer(),
21
+ });
22
+ const _mainSchema = /*#__PURE__*/ v.query('blue.microcosm.links.getManyToManyCounts', {
23
+ params: /*#__PURE__*/ v.object({
24
+ /**
25
+ * filter links to those from specific users
26
+ */
27
+ did: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.array(/*#__PURE__*/ v.didString())),
28
+ /**
29
+ * number of results to return
30
+ * @minimum 1
31
+ * @maximum 100
32
+ * @default 16
33
+ */
34
+ limit: /*#__PURE__*/ v.optional(
35
+ /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [/*#__PURE__*/ v.integerRange(1, 100)]),
36
+ 16,
37
+ ),
38
+ /**
39
+ * filter secondary links to specific subjects
40
+ */
41
+ otherSubject: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.array(/*#__PURE__*/ v.string())),
42
+ /**
43
+ * path to the secondary link in the many-to-many record (e.g., 'otherThing.uri')
44
+ */
45
+ pathToOther: /*#__PURE__*/ v.string(),
46
+ /**
47
+ * collection and path specification for the primary link
48
+ */
49
+ source: /*#__PURE__*/ v.string(),
50
+ /**
51
+ * the primary target being linked to (at-uri, did, or uri)
52
+ */
53
+ subject: /*#__PURE__*/ v.genericUriString(),
54
+ }),
55
+ output: {
56
+ type: 'lex',
57
+ schema: /*#__PURE__*/ v.object({
58
+ get counts_by_other_subject() {
59
+ return /*#__PURE__*/ v.array(countBySubjectSchema);
60
+ },
61
+ /**
62
+ * pagination cursor
63
+ */
64
+ cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()),
65
+ }),
66
+ },
67
+ });
68
+
69
+ type countBySubject$schematype = typeof _countBySubjectSchema;
70
+ type main$schematype = typeof _mainSchema;
71
+
72
+ export interface countBySubjectSchema extends countBySubject$schematype {}
73
+ export interface mainSchema extends main$schematype {}
74
+
75
+ export const countBySubjectSchema = _countBySubjectSchema as countBySubjectSchema;
76
+ export const mainSchema = _mainSchema as mainSchema;
77
+
78
+ export interface CountBySubject extends v.InferInput<typeof countBySubjectSchema> {}
79
+
80
+ export interface $params extends v.InferInput<mainSchema['params']> {}
81
+ export interface $output extends v.InferXRPCBodyInput<mainSchema['output']> {}
82
+
83
+ declare module '@atcute/lexicons/ambient' {
84
+ interface XRPCQueries {
85
+ 'blue.microcosm.links.getManyToManyCounts': mainSchema;
86
+ }
87
+ }
@@ -0,0 +1,48 @@
1
+ import type {} from '@atcute/lexicons';
2
+ import * as v from '@atcute/lexicons/validations';
3
+ import type {} from '@atcute/lexicons/ambient';
4
+
5
+ const _mainSchema = /*#__PURE__*/ v.query('com.bad-example.identity.resolveMiniDoc', {
6
+ params: /*#__PURE__*/ v.object({
7
+ /**
8
+ * handle or DID to resolve
9
+ */
10
+ identifier: /*#__PURE__*/ v.actorIdentifierString(),
11
+ }),
12
+ output: {
13
+ type: 'lex',
14
+ schema: /*#__PURE__*/ v.object({
15
+ /**
16
+ * DID, bi-directionally verified if a handle was provided in the query
17
+ */
18
+ did: /*#__PURE__*/ v.didString(),
19
+ /**
20
+ * the validated handle of the account or 'handle.invalid' if the handle did not bi-directionally match the DID document
21
+ */
22
+ handle: /*#__PURE__*/ v.handleString(),
23
+ /**
24
+ * the identity's PDS URL
25
+ */
26
+ pds: /*#__PURE__*/ v.genericUriString(),
27
+ /**
28
+ * the atproto signing key publicKeyMultibase
29
+ */
30
+ signing_key: /*#__PURE__*/ v.string(),
31
+ }),
32
+ },
33
+ });
34
+
35
+ type main$schematype = typeof _mainSchema;
36
+
37
+ export interface mainSchema extends main$schematype {}
38
+
39
+ export const mainSchema = _mainSchema as mainSchema;
40
+
41
+ export interface $params extends v.InferInput<mainSchema['params']> {}
42
+ export interface $output extends v.InferXRPCBodyInput<mainSchema['output']> {}
43
+
44
+ declare module '@atcute/lexicons/ambient' {
45
+ interface XRPCQueries {
46
+ 'com.bad-example.identity.resolveMiniDoc': mainSchema;
47
+ }
48
+ }
@@ -0,0 +1,48 @@
1
+ import type {} from '@atcute/lexicons';
2
+ import * as v from '@atcute/lexicons/validations';
3
+ import type {} from '@atcute/lexicons/ambient';
4
+
5
+ const _mainSchema = /*#__PURE__*/ v.query('com.bad-example.repo.getUriRecord', {
6
+ params: /*#__PURE__*/ v.object({
7
+ /**
8
+ * the at-uri of the record (identifier can be a DID or handle)
9
+ */
10
+ at_uri: /*#__PURE__*/ v.resourceUriString(),
11
+ /**
12
+ * optional CID of the version of the record. if not specified, return the most recent version. if specified and a newer version exists, returns 404.
13
+ */
14
+ cid: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.cidString()),
15
+ }),
16
+ output: {
17
+ type: 'lex',
18
+ schema: /*#__PURE__*/ v.object({
19
+ /**
20
+ * CID for this exact version of the record
21
+ */
22
+ cid: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.cidString()),
23
+ /**
24
+ * at-uri for this record
25
+ */
26
+ uri: /*#__PURE__*/ v.resourceUriString(),
27
+ /**
28
+ * the record itself
29
+ */
30
+ value: /*#__PURE__*/ v.unknown(),
31
+ }),
32
+ },
33
+ });
34
+
35
+ type main$schematype = typeof _mainSchema;
36
+
37
+ export interface mainSchema extends main$schematype {}
38
+
39
+ export const mainSchema = _mainSchema as mainSchema;
40
+
41
+ export interface $params extends v.InferInput<mainSchema['params']> {}
42
+ export interface $output extends v.InferXRPCBodyInput<mainSchema['output']> {}
43
+
44
+ declare module '@atcute/lexicons/ambient' {
45
+ interface XRPCQueries {
46
+ 'com.bad-example.repo.getUriRecord': mainSchema;
47
+ }
48
+ }
package/package.json ADDED
@@ -0,0 +1,46 @@
1
+ {
2
+ "type": "module",
3
+ "name": "@atcute/microcosm",
4
+ "version": "1.0.0",
5
+ "description": "Microcosm (blue.microcosm.*, com.bad-example.*) schema definitions",
6
+ "license": "0BSD",
7
+ "repository": {
8
+ "url": "https://github.com/mary-ext/atcute",
9
+ "directory": "packages/definitions/microcosm"
10
+ },
11
+ "files": [
12
+ "dist/",
13
+ "lib/",
14
+ "!lib/**/*.bench.ts",
15
+ "!lib/**/*.test.ts"
16
+ ],
17
+ "exports": {
18
+ ".": "./dist/index.js",
19
+ "./types/blue/microcosm/*": "./dist/lexicons/types/blue/microcosm/*.js",
20
+ "./types/com/bad-example/*": "./dist/lexicons/types/com/bad-example/*.js"
21
+ },
22
+ "dependencies": {
23
+ "@atcute/lexicons": "^1.2.3"
24
+ },
25
+ "devDependencies": {
26
+ "@atcute/microcosm": "file:",
27
+ "@atcute/lex-cli": "^2.3.2"
28
+ },
29
+ "atcute:lexicons": {
30
+ "mappings": {
31
+ "blue.microcosm.*": {
32
+ "type": "namespace",
33
+ "path": "./types/blue/microcosm/{{nsid_remainder}}"
34
+ },
35
+ "com.bad-example.*": {
36
+ "type": "namespace",
37
+ "path": "./types/com/bad-example/{{nsid_remainder}}"
38
+ }
39
+ }
40
+ },
41
+ "scripts": {
42
+ "build": "tsc",
43
+ "generate": "rm -r ./lib/lexicons/; lex-cli generate -c ./lex.config.js",
44
+ "prepublish": "rm -rf dist; pnpm run build"
45
+ }
46
+ }