@atcute/whitewind 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.
package/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ Permission is hereby granted, free of charge, to any person obtaining a copy
2
+ of this software and associated documentation files (the "Software"), to deal
3
+ in the Software without restriction, including without limitation the rights
4
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5
+ copies of the Software, and to permit persons to whom the Software is
6
+ furnished to do so, subject to the following conditions:
7
+
8
+ The above copyright notice and this permission notice shall be included in all
9
+ copies or substantial portions of the Software.
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # @atcute/whitewind
2
+
3
+ [WhiteWind](https://whtwnd.com) type definitions for `@atcute/client`, a lightweight and cute API client for AT Protocol.
4
+
5
+ import the lexicons module to start using it.
6
+
7
+ ```ts
8
+ import '@atcute/whitewind/lexicons';
9
+ ```
@@ -0,0 +1,130 @@
1
+ /**
2
+ * @module
3
+ * Contains type declarations for WhiteWind lexicons
4
+ */
5
+ import '@atcute/client/lexicons';
6
+ declare module '@atcute/client/lexicons' {
7
+ namespace ComWhtwndBlogComment {
8
+ interface Record {
9
+ /** Maximum string length: 1000 */
10
+ content: string;
11
+ entryUri: At.Uri;
12
+ }
13
+ }
14
+ namespace ComWhtwndBlogDefs {
15
+ interface BlobMetadata {
16
+ [Brand.Type]?: 'com.whtwnd.blog.defs#blobMetadata';
17
+ blobref: At.Blob;
18
+ name?: string;
19
+ }
20
+ interface BlogEntry {
21
+ [Brand.Type]?: 'com.whtwnd.blog.defs#blogEntry';
22
+ /** Maximum string length: 100000 */
23
+ content: string;
24
+ createdAt?: string;
25
+ }
26
+ interface Comment {
27
+ [Brand.Type]?: 'com.whtwnd.blog.defs#comment';
28
+ /** Maximum string length: 1000 */
29
+ content: string;
30
+ entryUri: At.Uri;
31
+ }
32
+ interface Ogp {
33
+ [Brand.Type]?: 'com.whtwnd.blog.defs#ogp';
34
+ url: string;
35
+ height?: number;
36
+ width?: number;
37
+ }
38
+ }
39
+ namespace ComWhtwndBlogEntry {
40
+ interface Record {
41
+ /** Maximum string length: 100000 */
42
+ content: string;
43
+ blobs?: ComWhtwndBlogDefs.BlobMetadata[];
44
+ createdAt?: string;
45
+ /** (DEPRECATED) Marks this entry as draft to tell AppViews not to show it to anyone except for the author */
46
+ isDraft?: boolean;
47
+ ogp?: ComWhtwndBlogDefs.Ogp;
48
+ theme?: 'github-light';
49
+ /** Maximum string length: 1000 */
50
+ title?: string;
51
+ /**
52
+ * Tells the visibility of the article to AppView.
53
+ * @default "public"
54
+ */
55
+ visibility?: 'public' | 'url' | 'author';
56
+ }
57
+ }
58
+ /** Get blog posts associated to designated author. */
59
+ namespace ComWhtwndBlogGetAuthorPosts {
60
+ interface Params {
61
+ author: At.DID;
62
+ }
63
+ type Input = undefined;
64
+ interface Output {
65
+ post: ComWhtwndBlogDefs.BlogEntry[];
66
+ }
67
+ }
68
+ /** Get AT URI by blog author and entry name. If there are multiple blog entries associated with the name, return the latest one. */
69
+ namespace ComWhtwndBlogGetEntryMetadataByName {
70
+ interface Params {
71
+ author: string;
72
+ entryTitle: string;
73
+ }
74
+ type Input = undefined;
75
+ interface Output {
76
+ entryUri: At.Uri;
77
+ cid?: At.CID;
78
+ lastUpdate?: string;
79
+ }
80
+ interface Errors {
81
+ NotFound: {};
82
+ }
83
+ }
84
+ /** Get comments associated to designated post. */
85
+ namespace ComWhtwndBlogGetMentionsByEntry {
86
+ interface Params {
87
+ postUri: At.Uri;
88
+ }
89
+ type Input = undefined;
90
+ interface Output {
91
+ mentions: At.Uri[];
92
+ }
93
+ }
94
+ /** Notify AppView of existence of new entry and request indexing */
95
+ namespace ComWhtwndBlogNotifyOfNewEntry {
96
+ interface Params {
97
+ }
98
+ interface Input {
99
+ entryUri: At.Uri;
100
+ }
101
+ interface Output {
102
+ }
103
+ interface Errors {
104
+ }
105
+ }
106
+ interface Records {
107
+ 'com.whtwnd.blog.comment': ComWhtwndBlogComment.Record;
108
+ 'com.whtwnd.blog.entry': ComWhtwndBlogEntry.Record;
109
+ }
110
+ interface Queries {
111
+ 'com.whtwnd.blog.getAuthorPosts': {
112
+ params: ComWhtwndBlogGetAuthorPosts.Params;
113
+ output: ComWhtwndBlogGetAuthorPosts.Output;
114
+ };
115
+ 'com.whtwnd.blog.getEntryMetadataByName': {
116
+ params: ComWhtwndBlogGetEntryMetadataByName.Params;
117
+ output: ComWhtwndBlogGetEntryMetadataByName.Output;
118
+ };
119
+ 'com.whtwnd.blog.getMentionsByEntry': {
120
+ params: ComWhtwndBlogGetMentionsByEntry.Params;
121
+ output: ComWhtwndBlogGetMentionsByEntry.Output;
122
+ };
123
+ }
124
+ interface Procedures {
125
+ 'com.whtwnd.blog.notifyOfNewEntry': {
126
+ input: ComWhtwndBlogNotifyOfNewEntry.Input;
127
+ output: ComWhtwndBlogNotifyOfNewEntry.Output;
128
+ };
129
+ }
130
+ }
@@ -0,0 +1,8 @@
1
+ /* eslint-disable */
2
+ // This file is automatically generated, do not edit!
3
+ /**
4
+ * @module
5
+ * Contains type declarations for WhiteWind lexicons
6
+ */
7
+ import '@atcute/client/lexicons';
8
+ //# sourceMappingURL=lexicons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexicons.js","sourceRoot":"","sources":["../lib/lexicons.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,qDAAqD;AAErD;;;GAGG;AAEH,OAAO,yBAAyB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "type": "module",
3
+ "name": "@atcute/whitewind",
4
+ "version": "1.0.0",
5
+ "description": "WhiteWind type definitions for atcute",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "url": "https://codeberg.org/mary-ext/atcute"
9
+ },
10
+ "files": [
11
+ "dist/"
12
+ ],
13
+ "exports": {
14
+ "./lexicons": "./dist/lexicons.js"
15
+ },
16
+ "peerDependencies": {
17
+ "@atcute/client": "^1.0.0"
18
+ },
19
+ "devDependencies": {
20
+ "@atcute/client": "^1.0.0",
21
+ "@atcute/lex-cli": "^1.0.0"
22
+ },
23
+ "scripts": {
24
+ "build": "tsc",
25
+ "generate": "./scripts/generate-lexicons.sh",
26
+ "prepublish": "rm -rf dist; pnpm run build"
27
+ }
28
+ }