@kulupu-linku/sona 0.3.7 → 2.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.
- package/dist/index-7uKIarVW.d.mts +1495 -0
- package/dist/index-N8h8E1s6.d.mts +398 -0
- package/dist/index-nmyNJa57.d.mts +300 -0
- package/dist/lib/v1/client.d.mts +1610 -0
- package/dist/lib/v1/client.mjs +8 -0
- package/dist/lib/v1/client.test.d.mts +30 -0
- package/dist/lib/v1/client.test.mjs +2 -0
- package/dist/lib/v1/index.d.mts +2 -0
- package/dist/lib/v1/index.mjs +137 -0
- package/dist/lib/v1/types.d.mts +2 -0
- package/dist/lib/v1/types.mjs +1 -0
- package/dist/lib/v1/utils.d.mts +26 -0
- package/dist/lib/v1/utils.mjs +35 -0
- package/dist/lib/v2/client.d.mts +1610 -0
- package/dist/lib/v2/client.mjs +8 -0
- package/dist/lib/v2/client.test.d.mts +35 -0
- package/dist/lib/v2/client.test.mjs +2 -0
- package/dist/lib/v2/index.d.mts +2 -0
- package/dist/lib/v2/index.mjs +192 -0
- package/dist/lib/v2/types.d.mts +2 -0
- package/dist/lib/v2/types.mjs +1 -0
- package/dist/lib/v2/utils.d.mts +44 -0
- package/dist/lib/v2/utils.mjs +38 -0
- package/dist/server/index.d.mts +2 -0
- package/dist/server/index.mjs +35 -0
- package/dist/server/utils.d.mts +27 -0
- package/dist/server/utils.mjs +31 -0
- package/dist/server/v1/index.d.mts +902 -0
- package/dist/server/v1/index.mjs +2 -0
- package/dist/server/v2/index.d.mts +1112 -0
- package/dist/server/v2/index.mjs +2 -0
- package/dist/server/versioning.d.mts +2019 -0
- package/dist/server/versioning.mjs +2 -0
- package/dist/v1-Da4_o5R1.mjs +261 -0
- package/generated/{commentary_translation.json → v1/commentary_translation.json} +1 -1
- package/generated/{definition_translation.json → v1/definition_translation.json} +1 -1
- package/generated/{etymology_translation.json → v1/etymology_translation.json} +2 -4
- package/generated/{fingerspelling.json → v1/fingerspelling.json} +5 -20
- package/generated/{fingerspelling_sign.json → v1/fingerspelling_sign.json} +4 -16
- package/generated/{font.json → v1/font.json} +1 -1
- package/generated/{fonts.json → v1/fonts.json} +1 -1
- package/generated/{icon_translation.json → v1/icon_translation.json} +1 -1
- package/generated/{languages.json → v1/languages.json} +4 -14
- package/generated/{parameters_translation.json → v1/parameters_translation.json} +1 -1
- package/generated/{sign.json → v1/sign.json} +3 -8
- package/generated/{signs.json → v1/signs.json} +4 -12
- package/generated/{sitelen_pona_translation.json → v1/sitelen_pona_translation.json} +1 -1
- package/generated/{word.json → v1/word.json} +6 -29
- package/generated/v2/fingerspelling.json +184 -0
- package/generated/v2/fingerspellings.json +198 -0
- package/generated/v2/font.json +164 -0
- package/generated/v2/fonts.json +178 -0
- package/generated/v2/glyph.json +186 -0
- package/generated/v2/glyphs.json +196 -0
- package/generated/v2/language.json +76 -0
- package/generated/v2/languages.json +86 -0
- package/generated/v2/sign.json +221 -0
- package/generated/v2/signs.json +235 -0
- package/generated/v2/word.json +449 -0
- package/generated/v2/words.json +459 -0
- package/package.json +66 -35
- package/dist/client.d.ts +0 -2
- package/dist/client.js +0 -172
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -223
- package/dist/lib/client.d.ts +0 -743
- package/dist/lib/client.test.d.ts +0 -27
- package/dist/lib/index.d.ts +0 -962
- package/dist/lib/types.d.ts +0 -17
- package/dist/lib/utils.d.ts +0 -13
- package/dist/server/index.d.ts +0 -685
- package/dist/server/utils.d.ts +0 -19
- package/dist/server/v1/index.d.ts +0 -677
- package/dist/server/versioning.d.ts +0 -2423
- package/dist/utils-B3Jq5OVZ.js +0 -2899
- package/dist/utils.d.ts +0 -2
- package/dist/utils.js +0 -9
- package/generated/words.json +0 -315
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { Fingerspelling, Fonts, Languages, Signs, Words } from "./lib/v1/index.mjs";
|
|
2
|
+
import { filterObject, joinPath, keys, langIdCoalesce, langValidator, mergeToKey } from "./server/utils.mjs";
|
|
3
|
+
import { Fingerspellings, Fonts as Fonts$1, Glyphs, Languages as Languages$1, Signs as Signs$1, Words as Words$1 } from "./lib/v2/index.mjs";
|
|
4
|
+
import { Hono } from "hono";
|
|
5
|
+
import { z } from "zod/v4";
|
|
6
|
+
import { zValidator } from "@hono/zod-validator";
|
|
7
|
+
import { HTTPException } from "hono/http-exception";
|
|
8
|
+
import PLazy from "p-lazy";
|
|
9
|
+
//#region src/server/v2/index.ts
|
|
10
|
+
const API_VERSION$1 = "v2";
|
|
11
|
+
const config$1 = {
|
|
12
|
+
words: {
|
|
13
|
+
root: "/",
|
|
14
|
+
filename: "words.json",
|
|
15
|
+
schema: Words$1,
|
|
16
|
+
translations: true
|
|
17
|
+
},
|
|
18
|
+
glyphs: {
|
|
19
|
+
root: "/",
|
|
20
|
+
filename: "glyphs.json",
|
|
21
|
+
schema: Glyphs,
|
|
22
|
+
translations: true
|
|
23
|
+
},
|
|
24
|
+
sandbox_words: {
|
|
25
|
+
root: "sandbox/",
|
|
26
|
+
filename: "words.json",
|
|
27
|
+
schema: Words$1,
|
|
28
|
+
translations: true
|
|
29
|
+
},
|
|
30
|
+
sandbox_glyphs: {
|
|
31
|
+
root: "sandbox/",
|
|
32
|
+
filename: "glyphs.json",
|
|
33
|
+
schema: Glyphs,
|
|
34
|
+
translations: true
|
|
35
|
+
},
|
|
36
|
+
signs: {
|
|
37
|
+
root: "luka_pona/",
|
|
38
|
+
filename: "signs.json",
|
|
39
|
+
schema: Signs$1,
|
|
40
|
+
translations: true
|
|
41
|
+
},
|
|
42
|
+
fingerspellings: {
|
|
43
|
+
root: "luka_pona/",
|
|
44
|
+
filename: "fingerspellings.json",
|
|
45
|
+
schema: Fingerspellings,
|
|
46
|
+
translations: true
|
|
47
|
+
},
|
|
48
|
+
fonts: {
|
|
49
|
+
root: "/",
|
|
50
|
+
filename: "fonts.json",
|
|
51
|
+
schema: Fonts$1,
|
|
52
|
+
translations: false
|
|
53
|
+
},
|
|
54
|
+
languages: {
|
|
55
|
+
root: "/",
|
|
56
|
+
filename: "languages.json",
|
|
57
|
+
schema: Languages$1,
|
|
58
|
+
translations: false
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
let CACHE = {};
|
|
62
|
+
const fetchData = async (key, langcode = "en") => {
|
|
63
|
+
if (CACHE && CACHE[key] && CACHE[key][langcode]) return CACHE[key][langcode];
|
|
64
|
+
const file = await fetchFile(API_VERSION$1, config$1[key], langcode);
|
|
65
|
+
if (!file.success) throw new HTTPException(500, { message: z.prettifyError(file.error) });
|
|
66
|
+
CACHE[key] ??= {};
|
|
67
|
+
CACHE[key][langcode] = file.data;
|
|
68
|
+
return file.data;
|
|
69
|
+
};
|
|
70
|
+
const langParamtoLangcode = async (langParam) => {
|
|
71
|
+
if (!langParam) return "en";
|
|
72
|
+
return langIdCoalesce(langParam, await fetchData("languages"));
|
|
73
|
+
};
|
|
74
|
+
const datasetEndpoint = (key) => {
|
|
75
|
+
return async (c) => {
|
|
76
|
+
const data = await fetchData(key, await langParamtoLangcode(c.req.query("lang")));
|
|
77
|
+
return c.json(data, 200);
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
const singleItemEndpoint = (key, param, descriptor) => {
|
|
81
|
+
return async (c) => {
|
|
82
|
+
const data = await fetchData(key, await langParamtoLangcode(c.req.query("lang")));
|
|
83
|
+
const id = c.req.param(param);
|
|
84
|
+
const itemData = data[id];
|
|
85
|
+
return itemData ? c.json({
|
|
86
|
+
success: true,
|
|
87
|
+
data: itemData
|
|
88
|
+
}, 200) : c.json({
|
|
89
|
+
success: false,
|
|
90
|
+
message: `Could not find the ${descriptor} ${id}`
|
|
91
|
+
}, 400);
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
const app$1 = new Hono().get("/", (c) => c.redirect("/v2/words")).get("/words", langValidator, datasetEndpoint("words")).get("/words/:word", langValidator, zValidator("param", z.object({ word: z.string() })), singleItemEndpoint("words", "word", "word")).get("/glyphs", langValidator, datasetEndpoint("glyphs")).get("/glyphs/:glyph", langValidator, zValidator("param", z.object({ glyph: z.string() })), singleItemEndpoint("glyphs", "glyph", "glyph")).get("/sandbox", (c) => c.redirect("/v2/sandbox/words")).get("/sandbox/words", langValidator, datasetEndpoint("sandbox_words")).get("/sandbox/words/:word", langValidator, zValidator("param", z.object({ word: z.string() })), singleItemEndpoint("sandbox_words", "word", "sandbox word")).get("/sandbox/glyphs", langValidator, datasetEndpoint("sandbox_glyphs")).get("/sandbox/glyphs/:glyph", langValidator, zValidator("param", z.object({ glyph: z.string() })), singleItemEndpoint("sandbox_glyphs", "glyph", "sandbox glyph")).get("/luka_pona/signs", langValidator, datasetEndpoint("signs")).get("/luka_pona/signs/:sign", langValidator, zValidator("param", z.object({ sign: z.string() })), singleItemEndpoint("signs", "sign", "sign")).get("/luka_pona/fingerspellings", langValidator, datasetEndpoint("fingerspellings")).get("/luka_pona/fingerspellings/:fingerspelling", langValidator, zValidator("param", z.object({ sign: z.string() })), singleItemEndpoint("fingerspellings", "fingerspelling", "fingerspelling")).get("/fonts", datasetEndpoint("fonts")).get("/fonts/:font", zValidator("param", z.object({ font: z.string() })), singleItemEndpoint("fonts", "font", "font")).get("/languages", datasetEndpoint("languages")).get("/languages/:language", zValidator("param", z.object({ language: z.string() })), singleItemEndpoint("languages", "language", "language"));
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/server/versioning.ts
|
|
97
|
+
const IMPORT_ROOT = "/src/raw/";
|
|
98
|
+
const DATA = import.meta.glob("@raw/**/*.json", {
|
|
99
|
+
import: "default",
|
|
100
|
+
eager: true
|
|
101
|
+
});
|
|
102
|
+
const versions = {
|
|
103
|
+
v1: config,
|
|
104
|
+
v2: config$1
|
|
105
|
+
};
|
|
106
|
+
const apps = {
|
|
107
|
+
v1: app,
|
|
108
|
+
v2: app$1
|
|
109
|
+
};
|
|
110
|
+
const assertImport = async (imports, file, path) => {
|
|
111
|
+
if (!file) throw new Error(`Missing file: ${path}. Available: [${Object.keys(imports).slice(0, 10)}]`);
|
|
112
|
+
if (typeof file !== "object") console.error(`Unexpected file type for ${path}:`, typeof file, file);
|
|
113
|
+
};
|
|
114
|
+
const fetchFile = async (version, config, langcode = "en") => {
|
|
115
|
+
const { root = "/", filename, schema, translations = false } = config;
|
|
116
|
+
let path = "/" + joinPath(IMPORT_ROOT, version, root, filename);
|
|
117
|
+
let file = DATA[path];
|
|
118
|
+
await assertImport(DATA, file, path);
|
|
119
|
+
if (version === "v2" && translations === true) {
|
|
120
|
+
let translationPath = "/" + joinPath(IMPORT_ROOT, version, root, "translations", langcode, filename);
|
|
121
|
+
let translationFile = DATA[translationPath];
|
|
122
|
+
await assertImport(DATA, translationFile, translationPath);
|
|
123
|
+
file = mergeToKey(file, "translations", translationFile);
|
|
124
|
+
}
|
|
125
|
+
const parsed = await schema.safeParseAsync(file);
|
|
126
|
+
if (!parsed.success) throw new Error(`Invalid input in ${filename}: ${parsed.error.message}`);
|
|
127
|
+
return parsed;
|
|
128
|
+
};
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/server/v1/index.ts
|
|
131
|
+
const API_VERSION = "v1";
|
|
132
|
+
const config = {
|
|
133
|
+
words: {
|
|
134
|
+
filename: "words.json",
|
|
135
|
+
schema: Words
|
|
136
|
+
},
|
|
137
|
+
sandbox: {
|
|
138
|
+
filename: "sandbox.json",
|
|
139
|
+
schema: Words
|
|
140
|
+
},
|
|
141
|
+
fingerspellings: {
|
|
142
|
+
filename: "fingerspelling.json",
|
|
143
|
+
schema: Fingerspelling
|
|
144
|
+
},
|
|
145
|
+
signs: {
|
|
146
|
+
filename: "signs.json",
|
|
147
|
+
schema: Signs
|
|
148
|
+
},
|
|
149
|
+
fonts: {
|
|
150
|
+
filename: "fonts.json",
|
|
151
|
+
schema: Fonts
|
|
152
|
+
},
|
|
153
|
+
languages: {
|
|
154
|
+
filename: "languages.json",
|
|
155
|
+
schema: Languages
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
const rawData = PLazy.from(async () => {
|
|
159
|
+
const res = {};
|
|
160
|
+
for (const key of keys(config)) {
|
|
161
|
+
const file = await fetchFile(API_VERSION, config[key]);
|
|
162
|
+
if (!file.success) throw new HTTPException(500, { message: z.prettifyError(file.error) });
|
|
163
|
+
res[key] = file.data;
|
|
164
|
+
}
|
|
165
|
+
return res;
|
|
166
|
+
});
|
|
167
|
+
const languagesFilter = (nested) => async (c, next) => {
|
|
168
|
+
await next();
|
|
169
|
+
const body = await c.res.clone().json();
|
|
170
|
+
if ("ok" in body && body.ok === false) return body;
|
|
171
|
+
const requestedLanguages = c.req.query("lang")?.split(",") ?? ["en"];
|
|
172
|
+
if (requestedLanguages.length === 1 && requestedLanguages[0] === "*") return;
|
|
173
|
+
const languages = (await rawData).languages;
|
|
174
|
+
const mappedLangs = requestedLanguages.map((lang) => langIdCoalesce(lang, languages));
|
|
175
|
+
if (mappedLangs.includes(void 0)) throw new HTTPException(400, { message: `Cannot find one or more of the requested languages: ${requestedLanguages.join(", ")}` });
|
|
176
|
+
if (nested) c.res = new Response(JSON.stringify(Object.fromEntries(Object.entries(body).filter((e) => typeof e[1] === "object" && !!e[1] && "translations" in e[1] && typeof e[1]["translations"] === "object").map(([k, v]) => {
|
|
177
|
+
return [k, {
|
|
178
|
+
...v,
|
|
179
|
+
translations: filterObject(v["translations"], ([k]) => mappedLangs.includes(k))
|
|
180
|
+
}];
|
|
181
|
+
}))), c.res);
|
|
182
|
+
else c.res = new Response(JSON.stringify({
|
|
183
|
+
...body.data,
|
|
184
|
+
translations: filterObject(body.data["translations"], ([k]) => mappedLangs.includes(k.toString()))
|
|
185
|
+
}), c.res);
|
|
186
|
+
};
|
|
187
|
+
const app = new Hono().get("/", (c) => c.redirect("/v1/words")).get("/words", langValidator, languagesFilter(true), async (c) => {
|
|
188
|
+
const data = (await rawData).words;
|
|
189
|
+
return c.json(data, 200);
|
|
190
|
+
}).get("/words/:word", langValidator, zValidator("param", z.object({ word: z.string() })), languagesFilter(false), async (c) => {
|
|
191
|
+
const word = (await rawData).words[c.req.param("word")];
|
|
192
|
+
return word ? c.json({
|
|
193
|
+
ok: true,
|
|
194
|
+
data: word
|
|
195
|
+
}, 200) : c.json({
|
|
196
|
+
ok: false,
|
|
197
|
+
message: `Could not find the word ${c.req.param("word")}`
|
|
198
|
+
}, 400);
|
|
199
|
+
}).get("/sandbox", langValidator, languagesFilter(true), async (c) => {
|
|
200
|
+
const data = (await rawData).sandbox;
|
|
201
|
+
return c.json(data, 200);
|
|
202
|
+
}).get("/sandbox/:word", langValidator, zValidator("param", z.object({ word: z.string() })), languagesFilter(false), async (c) => {
|
|
203
|
+
const word = (await rawData).sandbox[c.req.param("word")];
|
|
204
|
+
return word ? c.json({
|
|
205
|
+
ok: true,
|
|
206
|
+
data: word
|
|
207
|
+
}, 200) : c.json({
|
|
208
|
+
ok: false,
|
|
209
|
+
message: `Could not find the sandbox word "${c.req.param("word")}"`
|
|
210
|
+
}, 400);
|
|
211
|
+
}).get("/luka_pona", (c) => {
|
|
212
|
+
return c.redirect("/v1/luka_pona/signs");
|
|
213
|
+
}).get("/luka_pona/fingerspelling", langValidator, languagesFilter(true), async (c) => {
|
|
214
|
+
return c.json((await rawData).fingerspellings, 200);
|
|
215
|
+
}).get("/luka_pona/fingerspelling/:sign", langValidator, zValidator("param", z.object({ sign: z.string() })), languagesFilter(true), async (c) => {
|
|
216
|
+
const sign = (await rawData).fingerspellings[c.req.param("sign")];
|
|
217
|
+
return sign ? c.json({
|
|
218
|
+
ok: true,
|
|
219
|
+
data: sign
|
|
220
|
+
}, 200) : c.json({
|
|
221
|
+
ok: false,
|
|
222
|
+
message: `Could not find a sign named ${sign}`
|
|
223
|
+
}, 400);
|
|
224
|
+
}).get("/luka_pona/signs", langValidator, languagesFilter(true), async (c) => {
|
|
225
|
+
return c.json((await rawData).signs, 200);
|
|
226
|
+
}).get("/luka_pona/signs/:sign", langValidator, zValidator("param", z.object({ sign: z.string() })), languagesFilter(true), async (c) => {
|
|
227
|
+
const sign = (await rawData).signs[c.req.param("sign")];
|
|
228
|
+
return sign ? c.json({
|
|
229
|
+
ok: true,
|
|
230
|
+
data: sign
|
|
231
|
+
}, 200) : c.json({
|
|
232
|
+
ok: false,
|
|
233
|
+
message: `Could not find a sign named ${sign}`
|
|
234
|
+
}, 400);
|
|
235
|
+
}).get("/fonts", async (c) => {
|
|
236
|
+
return c.json((await rawData).fonts, 200);
|
|
237
|
+
}).get("/fonts/:font", zValidator("param", z.object({ font: z.string() })), async (c) => {
|
|
238
|
+
const font = (await rawData).fonts[c.req.param("font")];
|
|
239
|
+
return font ? c.json({
|
|
240
|
+
ok: true,
|
|
241
|
+
data: font
|
|
242
|
+
}, 200) : c.json({
|
|
243
|
+
ok: false,
|
|
244
|
+
message: `Could not find a font named ${font}`
|
|
245
|
+
}, 400);
|
|
246
|
+
}).get("/languages", async (c) => {
|
|
247
|
+
return c.json((await rawData).languages, 200);
|
|
248
|
+
}).get("/languages/:language", zValidator("param", z.object({ language: z.string() })), async (c) => {
|
|
249
|
+
const language = c.req.param("language");
|
|
250
|
+
const languages = (await rawData).languages;
|
|
251
|
+
const langId = langIdCoalesce(language, languages);
|
|
252
|
+
return langId ? c.json({
|
|
253
|
+
ok: true,
|
|
254
|
+
data: languages[langId]
|
|
255
|
+
}, 200) : c.json({
|
|
256
|
+
ok: false,
|
|
257
|
+
message: `Could not find a language named ${language}`
|
|
258
|
+
}, 400);
|
|
259
|
+
});
|
|
260
|
+
//#endregion
|
|
261
|
+
export { fetchFile as a, config$1 as c, apps as i, fetchData as l, config as n, versions as o, languagesFilter as r, app$1 as s, app as t };
|
|
@@ -17,9 +17,7 @@
|
|
|
17
17
|
"description": "The localized name of the language this word originated from"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
-
"required": [
|
|
21
|
-
"language"
|
|
22
|
-
],
|
|
20
|
+
"required": ["language"],
|
|
23
21
|
"additionalProperties": false
|
|
24
22
|
}
|
|
25
23
|
},
|
|
@@ -30,4 +28,4 @@
|
|
|
30
28
|
}
|
|
31
29
|
},
|
|
32
30
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
33
|
-
}
|
|
31
|
+
}
|
|
@@ -28,10 +28,7 @@
|
|
|
28
28
|
"description": "The name of the sign such that it could be found in a sign language dictionary."
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
"required": [
|
|
32
|
-
"language",
|
|
33
|
-
"sign"
|
|
34
|
-
],
|
|
31
|
+
"required": ["language", "sign"],
|
|
35
32
|
"additionalProperties": false
|
|
36
33
|
},
|
|
37
34
|
"description": "Unlocalized etymological values regarding this sign's origin"
|
|
@@ -48,10 +45,7 @@
|
|
|
48
45
|
"description": "The Sign Writing with Unicode representation of hte sign."
|
|
49
46
|
}
|
|
50
47
|
},
|
|
51
|
-
"required": [
|
|
52
|
-
"fsw",
|
|
53
|
-
"swu"
|
|
54
|
-
],
|
|
48
|
+
"required": ["fsw", "swu"],
|
|
55
49
|
"additionalProperties": false,
|
|
56
50
|
"description": "Scripts for representing a sign as characters."
|
|
57
51
|
},
|
|
@@ -98,21 +92,12 @@
|
|
|
98
92
|
"additionalProperties": false
|
|
99
93
|
}
|
|
100
94
|
},
|
|
101
|
-
"required": [
|
|
102
|
-
"parameters"
|
|
103
|
-
],
|
|
95
|
+
"required": ["parameters"],
|
|
104
96
|
"additionalProperties": false
|
|
105
97
|
}
|
|
106
98
|
}
|
|
107
99
|
},
|
|
108
|
-
"required": [
|
|
109
|
-
"id",
|
|
110
|
-
"is_two_handed",
|
|
111
|
-
"etymology",
|
|
112
|
-
"signwriting",
|
|
113
|
-
"video",
|
|
114
|
-
"translations"
|
|
115
|
-
],
|
|
100
|
+
"required": ["id", "is_two_handed", "etymology", "signwriting", "video", "translations"],
|
|
116
101
|
"additionalProperties": false,
|
|
117
102
|
"description": "Unlocalized info on a fingerspelling sign."
|
|
118
103
|
},
|
|
@@ -123,4 +108,4 @@
|
|
|
123
108
|
}
|
|
124
109
|
},
|
|
125
110
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
126
|
-
}
|
|
111
|
+
}
|
|
@@ -26,10 +26,7 @@
|
|
|
26
26
|
"description": "The name of the sign such that it could be found in a sign language dictionary."
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
|
-
"required": [
|
|
30
|
-
"language",
|
|
31
|
-
"sign"
|
|
32
|
-
],
|
|
29
|
+
"required": ["language", "sign"],
|
|
33
30
|
"additionalProperties": false
|
|
34
31
|
},
|
|
35
32
|
"description": "Unlocalized etymological values regarding this sign's origin"
|
|
@@ -46,10 +43,7 @@
|
|
|
46
43
|
"description": "The Sign Writing with Unicode representation of hte sign."
|
|
47
44
|
}
|
|
48
45
|
},
|
|
49
|
-
"required": [
|
|
50
|
-
"fsw",
|
|
51
|
-
"swu"
|
|
52
|
-
],
|
|
46
|
+
"required": ["fsw", "swu"],
|
|
53
47
|
"additionalProperties": false,
|
|
54
48
|
"description": "Scripts for representing a sign as characters."
|
|
55
49
|
},
|
|
@@ -69,16 +63,10 @@
|
|
|
69
63
|
"description": "Videos of the sign being performed, by format."
|
|
70
64
|
}
|
|
71
65
|
},
|
|
72
|
-
"required": [
|
|
73
|
-
"id",
|
|
74
|
-
"is_two_handed",
|
|
75
|
-
"etymology",
|
|
76
|
-
"signwriting",
|
|
77
|
-
"video"
|
|
78
|
-
],
|
|
66
|
+
"required": ["id", "is_two_handed", "etymology", "signwriting", "video"],
|
|
79
67
|
"additionalProperties": false,
|
|
80
68
|
"description": "Unlocalized info on a fingerspelling sign."
|
|
81
69
|
}
|
|
82
70
|
},
|
|
83
71
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
84
|
-
}
|
|
72
|
+
}
|
|
@@ -17,10 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"direction": {
|
|
19
19
|
"type": "string",
|
|
20
|
-
"enum": [
|
|
21
|
-
"ltr",
|
|
22
|
-
"rtl"
|
|
23
|
-
],
|
|
20
|
+
"enum": ["ltr", "rtl"],
|
|
24
21
|
"description": "The direction of the language's script."
|
|
25
22
|
},
|
|
26
23
|
"name": {
|
|
@@ -39,18 +36,11 @@
|
|
|
39
36
|
"description": "The name of the language in that language."
|
|
40
37
|
}
|
|
41
38
|
},
|
|
42
|
-
"required": [
|
|
43
|
-
"en"
|
|
44
|
-
],
|
|
39
|
+
"required": ["en"],
|
|
45
40
|
"additionalProperties": false
|
|
46
41
|
}
|
|
47
42
|
},
|
|
48
|
-
"required": [
|
|
49
|
-
"id",
|
|
50
|
-
"locale",
|
|
51
|
-
"direction",
|
|
52
|
-
"name"
|
|
53
|
-
],
|
|
43
|
+
"required": ["id", "locale", "direction", "name"],
|
|
54
44
|
"additionalProperties": false,
|
|
55
45
|
"description": "The languages offered by sona Linku."
|
|
56
46
|
},
|
|
@@ -60,4 +50,4 @@
|
|
|
60
50
|
}
|
|
61
51
|
},
|
|
62
52
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
63
|
-
}
|
|
53
|
+
}
|
|
@@ -38,9 +38,7 @@
|
|
|
38
38
|
"description": "The name of the sign such that it could be found in a sign language dictionary."
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
|
-
"required": [
|
|
42
|
-
"language"
|
|
43
|
-
],
|
|
41
|
+
"required": ["language"],
|
|
44
42
|
"additionalProperties": false
|
|
45
43
|
},
|
|
46
44
|
"description": "Unlocalized etymological values regarding this sign's origin"
|
|
@@ -57,10 +55,7 @@
|
|
|
57
55
|
"description": "The [SignWriting with Unicode](https://en.wikipedia.org/wiki/SignWriting) representation of the sign."
|
|
58
56
|
}
|
|
59
57
|
},
|
|
60
|
-
"required": [
|
|
61
|
-
"fsw",
|
|
62
|
-
"swu"
|
|
63
|
-
],
|
|
58
|
+
"required": ["fsw", "swu"],
|
|
64
59
|
"additionalProperties": false,
|
|
65
60
|
"description": "Scripts for representing a sign as characters."
|
|
66
61
|
},
|
|
@@ -95,4 +90,4 @@
|
|
|
95
90
|
}
|
|
96
91
|
},
|
|
97
92
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
98
|
-
}
|
|
93
|
+
}
|
|
@@ -40,9 +40,7 @@
|
|
|
40
40
|
"description": "The name of the sign such that it could be found in a sign language dictionary."
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
|
-
"required": [
|
|
44
|
-
"language"
|
|
45
|
-
],
|
|
43
|
+
"required": ["language"],
|
|
46
44
|
"additionalProperties": false
|
|
47
45
|
},
|
|
48
46
|
"description": "Unlocalized etymological values regarding this sign's origin"
|
|
@@ -59,10 +57,7 @@
|
|
|
59
57
|
"description": "The [SignWriting with Unicode](https://en.wikipedia.org/wiki/SignWriting) representation of the sign."
|
|
60
58
|
}
|
|
61
59
|
},
|
|
62
|
-
"required": [
|
|
63
|
-
"fsw",
|
|
64
|
-
"swu"
|
|
65
|
-
],
|
|
60
|
+
"required": ["fsw", "swu"],
|
|
66
61
|
"additionalProperties": false,
|
|
67
62
|
"description": "Scripts for representing a sign as characters."
|
|
68
63
|
},
|
|
@@ -112,10 +107,7 @@
|
|
|
112
107
|
"type": "string"
|
|
113
108
|
}
|
|
114
109
|
},
|
|
115
|
-
"required": [
|
|
116
|
-
"parameters",
|
|
117
|
-
"icons"
|
|
118
|
-
],
|
|
110
|
+
"required": ["parameters", "icons"],
|
|
119
111
|
"additionalProperties": false
|
|
120
112
|
}
|
|
121
113
|
}
|
|
@@ -141,4 +133,4 @@
|
|
|
141
133
|
}
|
|
142
134
|
},
|
|
143
135
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
144
|
-
}
|
|
136
|
+
}
|
|
@@ -19,23 +19,14 @@
|
|
|
19
19
|
},
|
|
20
20
|
"book": {
|
|
21
21
|
"type": "string",
|
|
22
|
-
"enum": [
|
|
23
|
-
"pu",
|
|
24
|
-
"ku suli",
|
|
25
|
-
"ku lili",
|
|
26
|
-
"none"
|
|
27
|
-
],
|
|
22
|
+
"enum": ["pu", "ku suli", "ku lili", "none"],
|
|
28
23
|
"description": "Which official Toki Pona book was this word featured in, if any."
|
|
29
24
|
},
|
|
30
25
|
"coined_era": {
|
|
31
26
|
"anyOf": [
|
|
32
27
|
{
|
|
33
28
|
"type": "string",
|
|
34
|
-
"enum": [
|
|
35
|
-
"pre-pu",
|
|
36
|
-
"post-pu",
|
|
37
|
-
"post-ku"
|
|
38
|
-
]
|
|
29
|
+
"enum": ["pre-pu", "post-pu", "post-ku"]
|
|
39
30
|
},
|
|
40
31
|
{
|
|
41
32
|
"type": "string",
|
|
@@ -137,13 +128,7 @@
|
|
|
137
128
|
},
|
|
138
129
|
"usage_category": {
|
|
139
130
|
"type": "string",
|
|
140
|
-
"enum": [
|
|
141
|
-
"core",
|
|
142
|
-
"common",
|
|
143
|
-
"uncommon",
|
|
144
|
-
"obscure",
|
|
145
|
-
"sandbox"
|
|
146
|
-
],
|
|
131
|
+
"enum": ["core", "common", "uncommon", "obscure", "sandbox"],
|
|
147
132
|
"description": "The word's usage category, according to a survey performed by the Linku Project"
|
|
148
133
|
},
|
|
149
134
|
"word": {
|
|
@@ -187,10 +172,7 @@
|
|
|
187
172
|
"description": "A link to the audio file for the word, pronounced by `author`."
|
|
188
173
|
}
|
|
189
174
|
},
|
|
190
|
-
"required": [
|
|
191
|
-
"author",
|
|
192
|
-
"link"
|
|
193
|
-
],
|
|
175
|
+
"required": ["author", "link"],
|
|
194
176
|
"additionalProperties": false,
|
|
195
177
|
"description": "Audio files of the words pronounced out loud"
|
|
196
178
|
}
|
|
@@ -215,12 +197,7 @@
|
|
|
215
197
|
"description": "The original definition in the Esperanto version of pu"
|
|
216
198
|
}
|
|
217
199
|
},
|
|
218
|
-
"required": [
|
|
219
|
-
"en",
|
|
220
|
-
"fr",
|
|
221
|
-
"de",
|
|
222
|
-
"eo"
|
|
223
|
-
],
|
|
200
|
+
"required": ["en", "fr", "de", "eo"],
|
|
224
201
|
"additionalProperties": false,
|
|
225
202
|
"description": "The original definition of the word in pu, the first official Toki Pona book"
|
|
226
203
|
},
|
|
@@ -259,4 +236,4 @@
|
|
|
259
236
|
}
|
|
260
237
|
},
|
|
261
238
|
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
262
|
-
}
|
|
239
|
+
}
|