@kulupu-linku/sona 0.1.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.
@@ -0,0 +1,299 @@
1
+ {
2
+ "$ref": "#/definitions/words",
3
+ "definitions": {
4
+ "words": {
5
+ "type": "object",
6
+ "additionalProperties": {
7
+ "type": "object",
8
+ "properties": {
9
+ "author_verbatim": {
10
+ "type": "string",
11
+ "description": "The author's original definition, taken verbatim in their words"
12
+ },
13
+ "author_verbatim_source": {
14
+ "type": "string",
15
+ "description": "Where the author's original definition is located (usually Discord)"
16
+ },
17
+ "book": {
18
+ "type": "string",
19
+ "enum": [
20
+ "pu",
21
+ "ku suli",
22
+ "ku lili",
23
+ "none"
24
+ ],
25
+ "description": "Which official Toki Pona book was this word featured in, if any."
26
+ },
27
+ "coined_era": {
28
+ "anyOf": [
29
+ {
30
+ "type": "string",
31
+ "enum": [
32
+ "pre-pu",
33
+ "post-pu",
34
+ "post-ku"
35
+ ]
36
+ },
37
+ {
38
+ "type": "string",
39
+ "const": ""
40
+ }
41
+ ],
42
+ "description": "When this word was coined (relative to the publication dates of the official Toki Pona books, if known)"
43
+ },
44
+ "coined_year": {
45
+ "type": "string",
46
+ "description": "The year when this word was coined (if known)"
47
+ },
48
+ "creator": {
49
+ "type": "array",
50
+ "items": {
51
+ "type": "string"
52
+ },
53
+ "description": "The person who created this word (if known)"
54
+ },
55
+ "ku_data": {
56
+ "type": "object",
57
+ "additionalProperties": {
58
+ "type": "number",
59
+ "minimum": 0,
60
+ "maximum": 100
61
+ },
62
+ "description": "The usage data of the word as described in ku (the official Toki Pona dictionary)"
63
+ },
64
+ "see_also": {
65
+ "type": "array",
66
+ "items": {
67
+ "type": "string"
68
+ },
69
+ "description": "A list of related words"
70
+ },
71
+ "representations": {
72
+ "type": "object",
73
+ "properties": {
74
+ "sitelen_emosi": {
75
+ "anyOf": [
76
+ {
77
+ "type": "string",
78
+ "pattern": "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$"
79
+ },
80
+ {
81
+ "type": "string",
82
+ "const": ""
83
+ }
84
+ ],
85
+ "description": "The sitelen emosi representation of this word, a script for writing Toki Pona using emoji"
86
+ },
87
+ "sitelen_pona": {
88
+ "type": "array",
89
+ "items": {
90
+ "type": "string"
91
+ },
92
+ "description": "A list of sitelen Lasina representations of this word, to be converted into sitelen pona glyphs"
93
+ },
94
+ "sitelen_sitelen": {
95
+ "anyOf": [
96
+ {
97
+ "type": "string",
98
+ "format": "uri"
99
+ },
100
+ {
101
+ "type": "string",
102
+ "const": ""
103
+ }
104
+ ],
105
+ "description": "A URL pointing to an image of this word's sitelen sitelen hieroglyphic block"
106
+ },
107
+ "ucsur": {
108
+ "anyOf": [
109
+ {
110
+ "type": "string",
111
+ "pattern": "^U\\+[\\da-fA-F]{4,6}$"
112
+ },
113
+ {
114
+ "type": "string",
115
+ "const": ""
116
+ }
117
+ ],
118
+ "description": "The word's UCSUR codepoint, as defined in https://www.kreativekorp.com/ucsur/charts/sitelen.html"
119
+ }
120
+ },
121
+ "required": [
122
+ "sitelen_emosi",
123
+ "sitelen_pona",
124
+ "sitelen_sitelen",
125
+ "ucsur"
126
+ ],
127
+ "additionalProperties": false,
128
+ "description": "Ways of representing this word in the real world, via text/computers"
129
+ },
130
+ "source_language": {
131
+ "type": "string",
132
+ "description": "The language this word originated from"
133
+ },
134
+ "usage_category": {
135
+ "type": "string",
136
+ "enum": [
137
+ "core",
138
+ "widespread",
139
+ "common",
140
+ "uncommon",
141
+ "rare",
142
+ "obscure"
143
+ ],
144
+ "description": "The word's usage category, according to a survey performed by the Linku Project"
145
+ },
146
+ "word": {
147
+ "type": "string",
148
+ "description": "The word's actual text, in case of a word with multiple definitions (like \"we\")"
149
+ },
150
+ "etymology": {
151
+ "type": "array",
152
+ "items": {
153
+ "type": "object",
154
+ "properties": {
155
+ "word": {
156
+ "type": "string",
157
+ "description": "One of the root words of this word, as written out in its language of origin"
158
+ },
159
+ "alt": {
160
+ "type": "string",
161
+ "description": "A latinized representation of the \"word\" field"
162
+ }
163
+ },
164
+ "additionalProperties": false
165
+ },
166
+ "description": "Unlocalized etymological values regarding this word's origin"
167
+ },
168
+ "audio": {
169
+ "type": "object",
170
+ "properties": {
171
+ "jan_lakuse": {
172
+ "type": "string",
173
+ "format": "uri",
174
+ "description": "jan Lakuse's pronounciation of the word, made for jan Sonja's Memrise course: https://archive.org/details/toki-pona-audio-by-jan-lakuse"
175
+ },
176
+ "kala_asi": {
177
+ "type": "string",
178
+ "format": "uri",
179
+ "description": "kala Asi's pronounciation of the word, made for the Linku Project"
180
+ }
181
+ },
182
+ "required": [
183
+ "kala_asi"
184
+ ],
185
+ "additionalProperties": false,
186
+ "description": "Audio files of the words pronounced out loud"
187
+ },
188
+ "pu_verbatim": {
189
+ "type": "object",
190
+ "properties": {
191
+ "en": {
192
+ "type": "string",
193
+ "description": "The original definition in the English version of pu"
194
+ },
195
+ "fr": {
196
+ "type": "string",
197
+ "description": "The original definition in the French version of pu"
198
+ },
199
+ "de": {
200
+ "type": "string",
201
+ "description": "The original definition in the German version of pu"
202
+ },
203
+ "eo": {
204
+ "type": "string",
205
+ "description": "The original definition in the Esperanto version of pu"
206
+ }
207
+ },
208
+ "required": [
209
+ "en",
210
+ "fr",
211
+ "de",
212
+ "eo"
213
+ ],
214
+ "additionalProperties": false,
215
+ "description": "The original definition of the word in pu, the first official Toki Pona book"
216
+ },
217
+ "recognition": {
218
+ "type": "object",
219
+ "additionalProperties": {
220
+ "type": "number",
221
+ "minimum": 0,
222
+ "maximum": 100
223
+ },
224
+ "propertyNames": {
225
+ "pattern": "^20\\d{2}-(0[1-9]|1[0-2])$"
226
+ },
227
+ "description": "The percentage of people in the Toki Pona community who recognize this word, according to surveys performed by the Linku Project"
228
+ },
229
+ "translations": {
230
+ "type": "object",
231
+ "additionalProperties": {
232
+ "type": "object",
233
+ "properties": {
234
+ "commentary": {
235
+ "type": "string"
236
+ },
237
+ "definitions": {
238
+ "type": "string",
239
+ "minLength": 1
240
+ },
241
+ "etymology": {
242
+ "type": "array",
243
+ "items": {
244
+ "type": "object",
245
+ "properties": {
246
+ "definition": {
247
+ "type": "string",
248
+ "description": "The localized definition of the root word in its origin language"
249
+ },
250
+ "language": {
251
+ "type": "string",
252
+ "description": "The localized name of the language this word originated from"
253
+ }
254
+ },
255
+ "required": [
256
+ "language"
257
+ ],
258
+ "additionalProperties": false
259
+ }
260
+ },
261
+ "sp_etymology": {
262
+ "type": "string"
263
+ }
264
+ },
265
+ "required": [
266
+ "commentary",
267
+ "definitions",
268
+ "etymology",
269
+ "sp_etymology"
270
+ ],
271
+ "additionalProperties": false
272
+ }
273
+ }
274
+ },
275
+ "required": [
276
+ "author_verbatim",
277
+ "author_verbatim_source",
278
+ "book",
279
+ "coined_era",
280
+ "coined_year",
281
+ "creator",
282
+ "see_also",
283
+ "representations",
284
+ "source_language",
285
+ "usage_category",
286
+ "word",
287
+ "etymology",
288
+ "audio",
289
+ "recognition",
290
+ "translations"
291
+ ],
292
+ "additionalProperties": false,
293
+ "description": "General info on a Toki Pona word"
294
+ },
295
+ "description": "A raw data object containing dictionary info about Toki Pona words"
296
+ }
297
+ },
298
+ "$schema": "http://json-schema.org/draft-07/schema#"
299
+ }
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@kulupu-linku/sona",
3
+ "version": "0.1.0",
4
+ "description": "A library providing TypeScript types and Zod schemas for the sona API",
5
+ "homepage": "https://linku.la/",
6
+ "bugs": {
7
+ "url": "https://github.com/lipu-linku/sona/issues/"
8
+ },
9
+ "license": "GPL-3.0-or-later",
10
+ "contributors": [
11
+ {
12
+ "name": "TheOnlyTails",
13
+ "url": "https://theonlytails.com/",
14
+ "email": "theonlytails@theonlytails.com"
15
+ },
16
+ {
17
+ "name": "gregdan3 (jan Kekan San)",
18
+ "url": "https://gregdan3.dev/",
19
+ "email": "gregdan3@protonmail.com"
20
+ }
21
+ ],
22
+ "repository": {
23
+ "url": "https://github.com/lipu-linku/sona.git",
24
+ "directory": "schemas",
25
+ "type": "git"
26
+ },
27
+ "dependencies": {
28
+ "zod": "^3.22.4"
29
+ },
30
+ "devDependencies": {
31
+ "@types/node": "^20.11.5",
32
+ "prettier": "^3.2.4",
33
+ "tsup": "^8.0.1",
34
+ "tsx": "^4.7.0",
35
+ "typescript": "^5.3.3",
36
+ "zod-to-json-schema": "^3.22.3"
37
+ },
38
+ "engines": {
39
+ "pnpm": ">=8"
40
+ },
41
+ "files": [
42
+ "/dist",
43
+ "/generated"
44
+ ],
45
+ "main": "./dist/index.js",
46
+ "exports": {
47
+ ".": {
48
+ "import": "./dist/index.js",
49
+ "node": "./dist/index.js",
50
+ "types": "./dist/index.d.ts"
51
+ },
52
+ "./utils": {
53
+ "import": "./dist/utils.js",
54
+ "node": "./dist/utils.js",
55
+ "types": "./dist/utils.d.ts"
56
+ }
57
+ },
58
+ "packageManager": "pnpm@8.11.0",
59
+ "type": "module",
60
+ "scripts": {
61
+ "generate": "tsx ./generateSchemas.ts",
62
+ "generate:watch": "tsx ./generateSchemas.ts --watch-path=./**/*.ts",
63
+ "build": "tsup ./src/**/*.ts --dts --format esm"
64
+ }
65
+ }