@atcute/frontpage 1.0.5 → 2.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 (27) hide show
  1. package/README.md +2 -10
  2. package/dist/lexicons/index.d.ts +4 -0
  3. package/dist/lexicons/index.d.ts.map +1 -1
  4. package/dist/lexicons/index.js +4 -0
  5. package/dist/lexicons/index.js.map +1 -1
  6. package/dist/lexicons/types/fyi/frontpage/feed/comment.d.ts +30 -0
  7. package/dist/lexicons/types/fyi/frontpage/feed/comment.d.ts.map +1 -0
  8. package/dist/lexicons/types/fyi/frontpage/feed/comment.js +29 -0
  9. package/dist/lexicons/types/fyi/frontpage/feed/comment.js.map +1 -0
  10. package/dist/lexicons/types/fyi/frontpage/feed/post.d.ts +41 -0
  11. package/dist/lexicons/types/fyi/frontpage/feed/post.d.ts.map +1 -0
  12. package/dist/lexicons/types/fyi/frontpage/feed/post.js +32 -0
  13. package/dist/lexicons/types/fyi/frontpage/feed/post.js.map +1 -0
  14. package/dist/lexicons/types/fyi/frontpage/feed/vote.d.ts +26 -0
  15. package/dist/lexicons/types/fyi/frontpage/feed/vote.d.ts.map +1 -0
  16. package/dist/lexicons/types/fyi/frontpage/feed/vote.js +19 -0
  17. package/dist/lexicons/types/fyi/frontpage/feed/vote.js.map +1 -0
  18. package/dist/lexicons/types/fyi/frontpage/richtext/block.d.ts +27 -0
  19. package/dist/lexicons/types/fyi/frontpage/richtext/block.d.ts.map +1 -0
  20. package/dist/lexicons/types/fyi/frontpage/richtext/block.js +21 -0
  21. package/dist/lexicons/types/fyi/frontpage/richtext/block.js.map +1 -0
  22. package/lib/lexicons/index.ts +4 -0
  23. package/lib/lexicons/types/fyi/frontpage/feed/comment.ts +45 -0
  24. package/lib/lexicons/types/fyi/frontpage/feed/post.ts +51 -0
  25. package/lib/lexicons/types/fyi/frontpage/feed/vote.ts +35 -0
  26. package/lib/lexicons/types/fyi/frontpage/richtext/block.ts +32 -0
  27. package/package.json +11 -8
package/README.md CHANGED
@@ -44,7 +44,7 @@ import type {} from '@atcute/frontpage';
44
44
 
45
45
  now all the XRPC operations should be visible in the client
46
46
 
47
- ## with `@atcute/lex-cli`
47
+ ### with `@atcute/lex-cli`
48
48
 
49
49
  when building your own lexicons that reference Frontpage types, configure lex-cli to import from
50
50
  this package:
@@ -56,14 +56,6 @@ import { defineLexiconConfig } from '@atcute/lex-cli';
56
56
  export default defineLexiconConfig({
57
57
  files: ['lexicons/**/*.json'],
58
58
  outdir: 'src/lexicons/',
59
- mappings: [
60
- {
61
- nsid: ['fyi.unravel.frontpage.*'],
62
- imports: (nsid) => {
63
- const specifier = nsid.slice('fyi.unravel.frontpage.'.length).replaceAll('.', '/');
64
- return { type: 'namespace', from: `@atcute/frontpage/types/${specifier}` };
65
- },
66
- },
67
- ],
59
+ imports: ['@atcute/frontpage'],
68
60
  });
69
61
  ```
@@ -1,3 +1,7 @@
1
+ export * as FyiFrontpageFeedComment from './types/fyi/frontpage/feed/comment.js';
2
+ export * as FyiFrontpageFeedPost from './types/fyi/frontpage/feed/post.js';
3
+ export * as FyiFrontpageFeedVote from './types/fyi/frontpage/feed/vote.js';
4
+ export * as FyiFrontpageRichtextBlock from './types/fyi/frontpage/richtext/block.js';
1
5
  export * as FyiUnravelFrontpageComment from './types/fyi/unravel/frontpage/comment.js';
2
6
  export * as FyiUnravelFrontpagePost from './types/fyi/unravel/frontpage/post.js';
3
7
  export * as FyiUnravelFrontpageVote from './types/fyi/unravel/frontpage/vote.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/lexicons/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,0BAA0B,MAAM,0CAA0C,CAAC;AACvF,OAAO,KAAK,uBAAuB,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,uBAAuB,MAAM,uCAAuC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/lexicons/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,uBAAuB,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,oBAAoB,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,oBAAoB,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,yBAAyB,MAAM,yCAAyC,CAAC;AACrF,OAAO,KAAK,0BAA0B,MAAM,0CAA0C,CAAC;AACvF,OAAO,KAAK,uBAAuB,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,uBAAuB,MAAM,uCAAuC,CAAC"}
@@ -1,3 +1,7 @@
1
+ export * as FyiFrontpageFeedComment from './types/fyi/frontpage/feed/comment.js';
2
+ export * as FyiFrontpageFeedPost from './types/fyi/frontpage/feed/post.js';
3
+ export * as FyiFrontpageFeedVote from './types/fyi/frontpage/feed/vote.js';
4
+ export * as FyiFrontpageRichtextBlock from './types/fyi/frontpage/richtext/block.js';
1
5
  export * as FyiUnravelFrontpageComment from './types/fyi/unravel/frontpage/comment.js';
2
6
  export * as FyiUnravelFrontpagePost from './types/fyi/unravel/frontpage/post.js';
3
7
  export * as FyiUnravelFrontpageVote from './types/fyi/unravel/frontpage/vote.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/lexicons/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,0BAA0B,MAAM,0CAA0C,CAAC;AACvF,OAAO,KAAK,uBAAuB,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,uBAAuB,MAAM,uCAAuC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/lexicons/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,uBAAuB,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,oBAAoB,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,oBAAoB,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,yBAAyB,MAAM,yCAAyC,CAAC;AACrF,OAAO,KAAK,0BAA0B,MAAM,0CAA0C,CAAC;AACvF,OAAO,KAAK,uBAAuB,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,uBAAuB,MAAM,uCAAuC,CAAC"}
@@ -0,0 +1,30 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ import * as ComAtprotoRepoStrongRef from '@atcute/atproto/types/repo/strongRef';
3
+ import * as FyiFrontpageRichtextBlock from '../richtext/block.js';
4
+ declare const _mainSchema: v.RecordSchema<v.ObjectSchema<{
5
+ $type: v.LiteralSchema<"fyi.frontpage.feed.comment">;
6
+ /**
7
+ * The content of the comment. Note, there are additional constraints placed on the total size of the content within the Frontpage AppView that are not possible to express in lexicon. Generally a comment can have a maximum length of 10,000 graphemes, the Frontpage AppView will enforce this limit.
8
+ * @maxLength 200
9
+ */
10
+ readonly blocks: v.SchemaWithConstraint<v.ArraySchema<FyiFrontpageRichtextBlock.mainSchema>, readonly [v.ArrayLengthConstraint<0, 200>]>;
11
+ /**
12
+ * Client-declared timestamp when this comment was originally created.
13
+ */
14
+ createdAt: v.FormattedStringSchema<"datetime">;
15
+ readonly parent: v.OptionalSchema<ComAtprotoRepoStrongRef.mainSchema, undefined>;
16
+ readonly post: ComAtprotoRepoStrongRef.mainSchema;
17
+ }>, v.FormattedStringSchema<"tid">>;
18
+ type main$schematype = typeof _mainSchema;
19
+ export interface mainSchema extends main$schematype {
20
+ }
21
+ export declare const mainSchema: mainSchema;
22
+ export interface Main extends v.InferInput<typeof mainSchema> {
23
+ }
24
+ declare module '@atcute/lexicons/ambient' {
25
+ interface Records {
26
+ 'fyi.frontpage.feed.comment': mainSchema;
27
+ }
28
+ }
29
+ export {};
30
+ //# sourceMappingURL=comment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/fyi/frontpage/feed/comment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAElD,OAAO,KAAK,uBAAuB,MAAM,sCAAsC,CAAC;AAChF,OAAO,KAAK,yBAAyB,MAAM,sBAAsB,CAAC;AAElE,QAAA,MAAM,WAAW;;IAIf;;;OAGG;;IAMH;;OAEG;;;;mCASJ,CAAC;AAEF,KAAK,eAAe,GAAG,OAAO,WAAW,CAAC;AAE1C,MAAM,WAAW,UAAW,SAAQ,eAAe;CAAG;AAEtD,eAAO,MAAM,UAAU,EAAkB,UAAU,CAAC;AAEpD,MAAM,WAAW,IAAK,SAAQ,CAAC,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC;CAAG;AAEhE,OAAO,QAAQ,0BAA0B,CAAC;IACzC,UAAU,OAAO;QAChB,4BAA4B,EAAE,UAAU,CAAC;KACzC;CACD"}
@@ -0,0 +1,29 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ import * as ComAtprotoRepoStrongRef from '@atcute/atproto/types/repo/strongRef';
3
+ import * as FyiFrontpageRichtextBlock from '../richtext/block.js';
4
+ const _mainSchema = /*#__PURE__*/ v.record(
5
+ /*#__PURE__*/ v.tidString(),
6
+ /*#__PURE__*/ v.object({
7
+ $type: /*#__PURE__*/ v.literal('fyi.frontpage.feed.comment'),
8
+ /**
9
+ * The content of the comment. Note, there are additional constraints placed on the total size of the content within the Frontpage AppView that are not possible to express in lexicon. Generally a comment can have a maximum length of 10,000 graphemes, the Frontpage AppView will enforce this limit.
10
+ * @maxLength 200
11
+ */
12
+ get blocks() {
13
+ return /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.array(FyiFrontpageRichtextBlock.mainSchema), [
14
+ /*#__PURE__*/ v.arrayLength(0, 200),
15
+ ]);
16
+ },
17
+ /**
18
+ * Client-declared timestamp when this comment was originally created.
19
+ */
20
+ createdAt: /*#__PURE__*/ v.datetimeString(),
21
+ get parent() {
22
+ return /*#__PURE__*/ v.optional(ComAtprotoRepoStrongRef.mainSchema);
23
+ },
24
+ get post() {
25
+ return ComAtprotoRepoStrongRef.mainSchema;
26
+ },
27
+ }));
28
+ export const mainSchema = _mainSchema;
29
+ //# sourceMappingURL=comment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment.js","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/fyi/frontpage/feed/comment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAElD,OAAO,KAAK,uBAAuB,MAAM,sCAAsC,CAAC;AAChF,OAAO,KAAK,yBAAyB,MAAM,sBAAsB,CAAC;AAElE,MAAM,WAAW,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM;AACzC,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE;AAC3B,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;IACtB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,4BAA4B,CAAC;IAC5D;;;OAGG;IACH,IAAI,MAAM;QACT,OAAO,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC,UAAU,CAAC,EAAE;YAC7F,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC;SACnC,CAAC,CAAC;IACJ,CAAC;IACD;;OAEG;IACH,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,cAAc,EAAE;IAC3C,IAAI,MAAM;QACT,OAAO,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC;IACrE,CAAC;IACD,IAAI,IAAI;QACP,OAAO,uBAAuB,CAAC,UAAU,CAAC;IAC3C,CAAC;CACD,CAAC,CACF,CAAC;AAMF,MAAM,CAAC,MAAM,UAAU,GAAG,WAAyB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ declare const _mainSchema: v.RecordSchema<v.ObjectSchema<{
3
+ $type: v.LiteralSchema<"fyi.frontpage.feed.post">;
4
+ /**
5
+ * Client-declared timestamp when this post was originally created.
6
+ */
7
+ createdAt: v.FormattedStringSchema<"datetime">;
8
+ /**
9
+ * The piece of content that this Frontpage post is about.
10
+ */
11
+ readonly subject: v.VariantSchema<readonly [urlSubjectSchema], boolean>;
12
+ /**
13
+ * The title of the post.
14
+ * @maxLength 3000
15
+ * @maxGraphemes 300
16
+ */
17
+ title: v.SchemaWithConstraint<v.StringSchema<string>, readonly [v.StringLengthConstraint<0, 3000>, v.StringGraphemesConstraint<0, 300>]>;
18
+ }>, v.FormattedStringSchema<"tid">>;
19
+ declare const _urlSubjectSchema: v.ObjectSchema<{
20
+ $type: v.OptionalSchema<v.LiteralSchema<"fyi.frontpage.feed.post#urlSubject">, undefined>;
21
+ url: v.FormattedStringSchema<"uri">;
22
+ }>;
23
+ type main$schematype = typeof _mainSchema;
24
+ type urlSubject$schematype = typeof _urlSubjectSchema;
25
+ export interface mainSchema extends main$schematype {
26
+ }
27
+ export interface urlSubjectSchema extends urlSubject$schematype {
28
+ }
29
+ export declare const mainSchema: mainSchema;
30
+ export declare const urlSubjectSchema: urlSubjectSchema;
31
+ export interface Main extends v.InferInput<typeof mainSchema> {
32
+ }
33
+ export interface UrlSubject extends v.InferInput<typeof urlSubjectSchema> {
34
+ }
35
+ declare module '@atcute/lexicons/ambient' {
36
+ interface Records {
37
+ 'fyi.frontpage.feed.post': mainSchema;
38
+ }
39
+ }
40
+ export {};
41
+ //# sourceMappingURL=post.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/fyi/frontpage/feed/post.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAGlD,QAAA,MAAM,WAAW;;IAIf;;OAEG;;IAEH;;OAEG;;IAIH;;;;OAIG;;mCAMJ,CAAC;AACF,QAAA,MAAM,iBAAiB;;;EAGrB,CAAC;AAEH,KAAK,eAAe,GAAG,OAAO,WAAW,CAAC;AAC1C,KAAK,qBAAqB,GAAG,OAAO,iBAAiB,CAAC;AAEtD,MAAM,WAAW,UAAW,SAAQ,eAAe;CAAG;AACtD,MAAM,WAAW,gBAAiB,SAAQ,qBAAqB;CAAG;AAElE,eAAO,MAAM,UAAU,EAAkB,UAAU,CAAC;AACpD,eAAO,MAAM,gBAAgB,EAAwB,gBAAgB,CAAC;AAEtE,MAAM,WAAW,IAAK,SAAQ,CAAC,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC;CAAG;AAChE,MAAM,WAAW,UAAW,SAAQ,CAAC,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC;CAAG;AAE5E,OAAO,QAAQ,0BAA0B,CAAC;IACzC,UAAU,OAAO;QAChB,yBAAyB,EAAE,UAAU,CAAC;KACtC;CACD"}
@@ -0,0 +1,32 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ const _mainSchema = /*#__PURE__*/ v.record(
3
+ /*#__PURE__*/ v.tidString(),
4
+ /*#__PURE__*/ v.object({
5
+ $type: /*#__PURE__*/ v.literal('fyi.frontpage.feed.post'),
6
+ /**
7
+ * Client-declared timestamp when this post was originally created.
8
+ */
9
+ createdAt: /*#__PURE__*/ v.datetimeString(),
10
+ /**
11
+ * The piece of content that this Frontpage post is about.
12
+ */
13
+ get subject() {
14
+ return /*#__PURE__*/ v.variant([urlSubjectSchema]);
15
+ },
16
+ /**
17
+ * The title of the post.
18
+ * @maxLength 3000
19
+ * @maxGraphemes 300
20
+ */
21
+ title: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [
22
+ /*#__PURE__*/ v.stringLength(0, 3000),
23
+ /*#__PURE__*/ v.stringGraphemes(0, 300),
24
+ ]),
25
+ }));
26
+ const _urlSubjectSchema = /*#__PURE__*/ v.object({
27
+ $type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('fyi.frontpage.feed.post#urlSubject')),
28
+ url: /*#__PURE__*/ v.genericUriString(),
29
+ });
30
+ export const mainSchema = _mainSchema;
31
+ export const urlSubjectSchema = _urlSubjectSchema;
32
+ //# sourceMappingURL=post.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"post.js","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/fyi/frontpage/feed/post.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAGlD,MAAM,WAAW,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM;AACzC,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE;AAC3B,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;IACtB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,yBAAyB,CAAC;IACzD;;OAEG;IACH,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,cAAc,EAAE;IAC3C;;OAEG;IACH,IAAI,OAAO;QACV,OAAO,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;IACpD,CAAC;IACD;;;;OAIG;IACH,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE;QAC1D,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,CAAC;QACrC,aAAa,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,EAAE,GAAG,CAAC;KACvC,CAAC;CACF,CAAC,CACF,CAAC;AACF,MAAM,iBAAiB,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;IAChD,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,oCAAoC,CAAC,CAAC;IAC9F,GAAG,EAAE,aAAa,CAAC,CAAC,CAAC,gBAAgB,EAAE;CACvC,CAAC,CAAC;AAQH,MAAM,CAAC,MAAM,UAAU,GAAG,WAAyB,CAAC;AACpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAqC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ import * as ComAtprotoRepoStrongRef from '@atcute/atproto/types/repo/strongRef';
3
+ declare const _mainSchema: v.RecordSchema<v.ObjectSchema<{
4
+ $type: v.LiteralSchema<"fyi.frontpage.feed.vote">;
5
+ /**
6
+ * Client-declared timestamp when this vote was originally created.
7
+ */
8
+ createdAt: v.FormattedStringSchema<"datetime">;
9
+ /**
10
+ * The post or comment that this Frontpage vote is for.
11
+ */
12
+ readonly subject: ComAtprotoRepoStrongRef.mainSchema;
13
+ }>, v.FormattedStringSchema<"tid">>;
14
+ type main$schematype = typeof _mainSchema;
15
+ export interface mainSchema extends main$schematype {
16
+ }
17
+ export declare const mainSchema: mainSchema;
18
+ export interface Main extends v.InferInput<typeof mainSchema> {
19
+ }
20
+ declare module '@atcute/lexicons/ambient' {
21
+ interface Records {
22
+ 'fyi.frontpage.feed.vote': mainSchema;
23
+ }
24
+ }
25
+ export {};
26
+ //# sourceMappingURL=vote.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vote.d.ts","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/fyi/frontpage/feed/vote.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAElD,OAAO,KAAK,uBAAuB,MAAM,sCAAsC,CAAC;AAEhF,QAAA,MAAM,WAAW;;IAIf;;OAEG;;IAEH;;OAEG;;mCAKJ,CAAC;AAEF,KAAK,eAAe,GAAG,OAAO,WAAW,CAAC;AAE1C,MAAM,WAAW,UAAW,SAAQ,eAAe;CAAG;AAEtD,eAAO,MAAM,UAAU,EAAkB,UAAU,CAAC;AAEpD,MAAM,WAAW,IAAK,SAAQ,CAAC,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC;CAAG;AAEhE,OAAO,QAAQ,0BAA0B,CAAC;IACzC,UAAU,OAAO;QAChB,yBAAyB,EAAE,UAAU,CAAC;KACtC;CACD"}
@@ -0,0 +1,19 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ import * as ComAtprotoRepoStrongRef from '@atcute/atproto/types/repo/strongRef';
3
+ const _mainSchema = /*#__PURE__*/ v.record(
4
+ /*#__PURE__*/ v.tidString(),
5
+ /*#__PURE__*/ v.object({
6
+ $type: /*#__PURE__*/ v.literal('fyi.frontpage.feed.vote'),
7
+ /**
8
+ * Client-declared timestamp when this vote was originally created.
9
+ */
10
+ createdAt: /*#__PURE__*/ v.datetimeString(),
11
+ /**
12
+ * The post or comment that this Frontpage vote is for.
13
+ */
14
+ get subject() {
15
+ return ComAtprotoRepoStrongRef.mainSchema;
16
+ },
17
+ }));
18
+ export const mainSchema = _mainSchema;
19
+ //# sourceMappingURL=vote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vote.js","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/fyi/frontpage/feed/vote.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAElD,OAAO,KAAK,uBAAuB,MAAM,sCAAsC,CAAC;AAEhF,MAAM,WAAW,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM;AACzC,aAAa,CAAC,CAAC,CAAC,SAAS,EAAE;AAC3B,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;IACtB,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,yBAAyB,CAAC;IACzD;;OAEG;IACH,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,cAAc,EAAE;IAC3C;;OAEG;IACH,IAAI,OAAO;QACV,OAAO,uBAAuB,CAAC,UAAU,CAAC;IAC3C,CAAC;CACD,CAAC,CACF,CAAC;AAMF,MAAM,CAAC,MAAM,UAAU,GAAG,WAAyB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ declare const _mainSchema: v.ObjectSchema<{
3
+ $type: v.OptionalSchema<v.LiteralSchema<"fyi.frontpage.richtext.block">, undefined>;
4
+ readonly content: v.VariantSchema<readonly [plaintextParagraphSchema], boolean>;
5
+ }>;
6
+ declare const _plaintextParagraphSchema: v.ObjectSchema<{
7
+ $type: v.OptionalSchema<v.LiteralSchema<"fyi.frontpage.richtext.block#plaintextParagraph">, undefined>;
8
+ /**
9
+ * @maxLength 100000
10
+ * @maxGraphemes 10000
11
+ */
12
+ text: v.SchemaWithConstraint<v.StringSchema<string>, readonly [v.StringLengthConstraint<0, 100000>, v.StringGraphemesConstraint<0, 10000>]>;
13
+ }>;
14
+ type main$schematype = typeof _mainSchema;
15
+ type plaintextParagraph$schematype = typeof _plaintextParagraphSchema;
16
+ export interface mainSchema extends main$schematype {
17
+ }
18
+ export interface plaintextParagraphSchema extends plaintextParagraph$schematype {
19
+ }
20
+ export declare const mainSchema: mainSchema;
21
+ export declare const plaintextParagraphSchema: plaintextParagraphSchema;
22
+ export interface Main extends v.InferInput<typeof mainSchema> {
23
+ }
24
+ export interface PlaintextParagraph extends v.InferInput<typeof plaintextParagraphSchema> {
25
+ }
26
+ export {};
27
+ //# sourceMappingURL=block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/fyi/frontpage/richtext/block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAElD,QAAA,MAAM,WAAW;;;EAKf,CAAC;AACH,QAAA,MAAM,yBAAyB;;IAE9B;;;OAGG;;EAKF,CAAC;AAEH,KAAK,eAAe,GAAG,OAAO,WAAW,CAAC;AAC1C,KAAK,6BAA6B,GAAG,OAAO,yBAAyB,CAAC;AAEtE,MAAM,WAAW,UAAW,SAAQ,eAAe;CAAG;AACtD,MAAM,WAAW,wBAAyB,SAAQ,6BAA6B;CAAG;AAElF,eAAO,MAAM,UAAU,EAAkB,UAAU,CAAC;AACpD,eAAO,MAAM,wBAAwB,EAAgC,wBAAwB,CAAC;AAE9F,MAAM,WAAW,IAAK,SAAQ,CAAC,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC;CAAG;AAChE,MAAM,WAAW,kBAAmB,SAAQ,CAAC,CAAC,UAAU,CAAC,OAAO,wBAAwB,CAAC;CAAG"}
@@ -0,0 +1,21 @@
1
+ import * as v from '@atcute/lexicons/validations';
2
+ const _mainSchema = /*#__PURE__*/ v.object({
3
+ $type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('fyi.frontpage.richtext.block')),
4
+ get content() {
5
+ return /*#__PURE__*/ v.variant([plaintextParagraphSchema]);
6
+ },
7
+ });
8
+ const _plaintextParagraphSchema = /*#__PURE__*/ v.object({
9
+ $type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('fyi.frontpage.richtext.block#plaintextParagraph')),
10
+ /**
11
+ * @maxLength 100000
12
+ * @maxGraphemes 10000
13
+ */
14
+ text: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [
15
+ /*#__PURE__*/ v.stringLength(0, 100000),
16
+ /*#__PURE__*/ v.stringGraphemes(0, 10000),
17
+ ]),
18
+ });
19
+ export const mainSchema = _mainSchema;
20
+ export const plaintextParagraphSchema = _plaintextParagraphSchema;
21
+ //# sourceMappingURL=block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block.js","sourceRoot":"","sources":["../../../../../../lib/lexicons/types/fyi/frontpage/richtext/block.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAElD,MAAM,WAAW,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,8BAA8B,CAAC,CAAC;IACxF,IAAI,OAAO;QACV,OAAO,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC;IAC5D,CAAC;CACD,CAAC,CAAC;AACH,MAAM,yBAAyB,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC;IACxD,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,iDAAiD,CAAC,CAAC;IAC3G;;;OAGG;IACH,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE;QACzD,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC;QACvC,aAAa,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC;KACzC,CAAC;CACF,CAAC,CAAC;AAQH,MAAM,CAAC,MAAM,UAAU,GAAG,WAAyB,CAAC;AACpD,MAAM,CAAC,MAAM,wBAAwB,GAAG,yBAAqD,CAAC"}
@@ -1,3 +1,7 @@
1
+ export * as FyiFrontpageFeedComment from './types/fyi/frontpage/feed/comment.js';
2
+ export * as FyiFrontpageFeedPost from './types/fyi/frontpage/feed/post.js';
3
+ export * as FyiFrontpageFeedVote from './types/fyi/frontpage/feed/vote.js';
4
+ export * as FyiFrontpageRichtextBlock from './types/fyi/frontpage/richtext/block.js';
1
5
  export * as FyiUnravelFrontpageComment from './types/fyi/unravel/frontpage/comment.js';
2
6
  export * as FyiUnravelFrontpagePost from './types/fyi/unravel/frontpage/post.js';
3
7
  export * as FyiUnravelFrontpageVote from './types/fyi/unravel/frontpage/vote.js';
@@ -0,0 +1,45 @@
1
+ import type {} from '@atcute/lexicons';
2
+ import * as v from '@atcute/lexicons/validations';
3
+ import type {} from '@atcute/lexicons/ambient';
4
+ import * as ComAtprotoRepoStrongRef from '@atcute/atproto/types/repo/strongRef';
5
+ import * as FyiFrontpageRichtextBlock from '../richtext/block.js';
6
+
7
+ const _mainSchema = /*#__PURE__*/ v.record(
8
+ /*#__PURE__*/ v.tidString(),
9
+ /*#__PURE__*/ v.object({
10
+ $type: /*#__PURE__*/ v.literal('fyi.frontpage.feed.comment'),
11
+ /**
12
+ * The content of the comment. Note, there are additional constraints placed on the total size of the content within the Frontpage AppView that are not possible to express in lexicon. Generally a comment can have a maximum length of 10,000 graphemes, the Frontpage AppView will enforce this limit.
13
+ * @maxLength 200
14
+ */
15
+ get blocks() {
16
+ return /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.array(FyiFrontpageRichtextBlock.mainSchema), [
17
+ /*#__PURE__*/ v.arrayLength(0, 200),
18
+ ]);
19
+ },
20
+ /**
21
+ * Client-declared timestamp when this comment was originally created.
22
+ */
23
+ createdAt: /*#__PURE__*/ v.datetimeString(),
24
+ get parent() {
25
+ return /*#__PURE__*/ v.optional(ComAtprotoRepoStrongRef.mainSchema);
26
+ },
27
+ get post() {
28
+ return ComAtprotoRepoStrongRef.mainSchema;
29
+ },
30
+ }),
31
+ );
32
+
33
+ type main$schematype = typeof _mainSchema;
34
+
35
+ export interface mainSchema extends main$schematype {}
36
+
37
+ export const mainSchema = _mainSchema as mainSchema;
38
+
39
+ export interface Main extends v.InferInput<typeof mainSchema> {}
40
+
41
+ declare module '@atcute/lexicons/ambient' {
42
+ interface Records {
43
+ 'fyi.frontpage.feed.comment': mainSchema;
44
+ }
45
+ }
@@ -0,0 +1,51 @@
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.record(
6
+ /*#__PURE__*/ v.tidString(),
7
+ /*#__PURE__*/ v.object({
8
+ $type: /*#__PURE__*/ v.literal('fyi.frontpage.feed.post'),
9
+ /**
10
+ * Client-declared timestamp when this post was originally created.
11
+ */
12
+ createdAt: /*#__PURE__*/ v.datetimeString(),
13
+ /**
14
+ * The piece of content that this Frontpage post is about.
15
+ */
16
+ get subject() {
17
+ return /*#__PURE__*/ v.variant([urlSubjectSchema]);
18
+ },
19
+ /**
20
+ * The title of the post.
21
+ * @maxLength 3000
22
+ * @maxGraphemes 300
23
+ */
24
+ title: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [
25
+ /*#__PURE__*/ v.stringLength(0, 3000),
26
+ /*#__PURE__*/ v.stringGraphemes(0, 300),
27
+ ]),
28
+ }),
29
+ );
30
+ const _urlSubjectSchema = /*#__PURE__*/ v.object({
31
+ $type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('fyi.frontpage.feed.post#urlSubject')),
32
+ url: /*#__PURE__*/ v.genericUriString(),
33
+ });
34
+
35
+ type main$schematype = typeof _mainSchema;
36
+ type urlSubject$schematype = typeof _urlSubjectSchema;
37
+
38
+ export interface mainSchema extends main$schematype {}
39
+ export interface urlSubjectSchema extends urlSubject$schematype {}
40
+
41
+ export const mainSchema = _mainSchema as mainSchema;
42
+ export const urlSubjectSchema = _urlSubjectSchema as urlSubjectSchema;
43
+
44
+ export interface Main extends v.InferInput<typeof mainSchema> {}
45
+ export interface UrlSubject extends v.InferInput<typeof urlSubjectSchema> {}
46
+
47
+ declare module '@atcute/lexicons/ambient' {
48
+ interface Records {
49
+ 'fyi.frontpage.feed.post': mainSchema;
50
+ }
51
+ }
@@ -0,0 +1,35 @@
1
+ import type {} from '@atcute/lexicons';
2
+ import * as v from '@atcute/lexicons/validations';
3
+ import type {} from '@atcute/lexicons/ambient';
4
+ import * as ComAtprotoRepoStrongRef from '@atcute/atproto/types/repo/strongRef';
5
+
6
+ const _mainSchema = /*#__PURE__*/ v.record(
7
+ /*#__PURE__*/ v.tidString(),
8
+ /*#__PURE__*/ v.object({
9
+ $type: /*#__PURE__*/ v.literal('fyi.frontpage.feed.vote'),
10
+ /**
11
+ * Client-declared timestamp when this vote was originally created.
12
+ */
13
+ createdAt: /*#__PURE__*/ v.datetimeString(),
14
+ /**
15
+ * The post or comment that this Frontpage vote is for.
16
+ */
17
+ get subject() {
18
+ return ComAtprotoRepoStrongRef.mainSchema;
19
+ },
20
+ }),
21
+ );
22
+
23
+ type main$schematype = typeof _mainSchema;
24
+
25
+ export interface mainSchema extends main$schematype {}
26
+
27
+ export const mainSchema = _mainSchema as mainSchema;
28
+
29
+ export interface Main extends v.InferInput<typeof mainSchema> {}
30
+
31
+ declare module '@atcute/lexicons/ambient' {
32
+ interface Records {
33
+ 'fyi.frontpage.feed.vote': mainSchema;
34
+ }
35
+ }
@@ -0,0 +1,32 @@
1
+ import type {} from '@atcute/lexicons';
2
+ import * as v from '@atcute/lexicons/validations';
3
+
4
+ const _mainSchema = /*#__PURE__*/ v.object({
5
+ $type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('fyi.frontpage.richtext.block')),
6
+ get content() {
7
+ return /*#__PURE__*/ v.variant([plaintextParagraphSchema]);
8
+ },
9
+ });
10
+ const _plaintextParagraphSchema = /*#__PURE__*/ v.object({
11
+ $type: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.literal('fyi.frontpage.richtext.block#plaintextParagraph')),
12
+ /**
13
+ * @maxLength 100000
14
+ * @maxGraphemes 10000
15
+ */
16
+ text: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [
17
+ /*#__PURE__*/ v.stringLength(0, 100000),
18
+ /*#__PURE__*/ v.stringGraphemes(0, 10000),
19
+ ]),
20
+ });
21
+
22
+ type main$schematype = typeof _mainSchema;
23
+ type plaintextParagraph$schematype = typeof _plaintextParagraphSchema;
24
+
25
+ export interface mainSchema extends main$schematype {}
26
+ export interface plaintextParagraphSchema extends plaintextParagraph$schematype {}
27
+
28
+ export const mainSchema = _mainSchema as mainSchema;
29
+ export const plaintextParagraphSchema = _plaintextParagraphSchema as plaintextParagraphSchema;
30
+
31
+ export interface Main extends v.InferInput<typeof mainSchema> {}
32
+ export interface PlaintextParagraph extends v.InferInput<typeof plaintextParagraphSchema> {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@atcute/frontpage",
4
- "version": "1.0.5",
4
+ "version": "2.0.0",
5
5
  "description": "Frontpage (fyi.unravel.frontpage.*) schema definitions",
6
6
  "keywords": [
7
7
  "atcute",
@@ -21,28 +21,31 @@
21
21
  ],
22
22
  "exports": {
23
23
  ".": "./dist/index.js",
24
- "./types/*": "./dist/lexicons/types/fyi/unravel/frontpage/*.js"
24
+ "./types/*": "./dist/lexicons/types/*.js"
25
25
  },
26
26
  "dependencies": {
27
- "@atcute/atproto": "^3.1.8",
28
- "@atcute/lexicons": "^1.2.2"
27
+ "@atcute/atproto": "^3.1.9",
28
+ "@atcute/lexicons": "^1.2.5"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@atcute/frontpage": "file:",
32
- "vitest": "^3.2.4",
33
- "@atcute/lex-cli": "^2.3.0"
32
+ "@atcute/lex-cli": "^2.4.0"
34
33
  },
35
34
  "atcute:lexicons": {
36
35
  "mappings": {
37
36
  "fyi.unravel.frontpage.*": {
38
37
  "type": "namespace",
39
- "path": "./types/{{nsid_remainder}}"
38
+ "path": "./types/{{nsid}}"
39
+ },
40
+ "fyi.frontpage.*": {
41
+ "type": "namespace",
42
+ "path": "./types/{{nsid}}"
40
43
  }
41
44
  }
42
45
  },
43
46
  "scripts": {
44
47
  "build": "tsc",
45
- "test": "vitest",
48
+ "pull": "lex-cli pull -c ./lex.config.js",
46
49
  "generate": "rm -r ./lib/lexicons/; lex-cli generate -c ./lex.config.js",
47
50
  "prepublish": "rm -rf dist; pnpm run build"
48
51
  }