@lapis-notes/api 0.1.0 → 0.1.2
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/CHANGELOG.md +18 -0
- package/README.md +5 -0
- package/dist/app-database-host.d.ts +1 -0
- package/dist/app-database-host.js +1 -0
- package/dist/browser-sync-security.d.ts +45 -0
- package/dist/browser-sync-security.js +189 -0
- package/dist/build-tools/vite.d.ts +15 -0
- package/dist/build-tools/vite.js +36 -0
- package/dist/cache.svelte.d.ts +1 -1
- package/dist/cache.svelte.js +4 -1
- package/dist/components/editor/editor.css +54 -2
- package/dist/components/editor/extensions/lint/lapis-lint-tooltip.svelte +18 -5
- package/dist/components/editor/extensions/lint/lint-tooltip-actions.d.ts +0 -2
- package/dist/components/editor/extensions/lint/lint-tooltip-actions.js +0 -14
- package/dist/components/editor/language-service/index.js +23 -2
- package/dist/components/icon/icon-list.svelte.d.ts +1 -1
- package/dist/components/select/select.svelte.d.ts +1 -1
- package/dist/context.svelte.d.ts +11 -1
- package/dist/context.svelte.js +38 -1
- package/dist/docs-api.d.ts +2 -0
- package/dist/docs-api.js +1 -0
- package/dist/generated/plugin-host-modules.schema.generated.d.ts +443 -13
- package/dist/generated/plugin-host-modules.schema.generated.js +970 -306
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/language-service/manager.d.ts +5 -0
- package/dist/language-service/manager.js +58 -14
- package/dist/lapis-extension.d.ts +1 -1
- package/dist/lapis-extension.js +12 -0
- package/dist/nostr-signer.d.ts +68 -0
- package/dist/nostr-signer.js +49 -0
- package/dist/plugin-asset-server.d.ts +1 -0
- package/dist/plugin-asset-server.js +3 -0
- package/dist/plugin-capability-facade.d.ts +1 -1
- package/dist/plugin-capability-facade.js +6 -0
- package/dist/plugin-distribution/catalog-media.d.ts +4 -0
- package/dist/plugin-distribution/catalog-media.js +40 -0
- package/dist/plugin-distribution/download-stats.d.ts +4 -0
- package/dist/plugin-distribution/download-stats.js +19 -0
- package/dist/plugin-distribution/index.d.ts +4 -0
- package/dist/plugin-distribution/index.js +4 -0
- package/dist/plugin-distribution/installer.d.ts +3 -0
- package/dist/plugin-distribution/installer.js +9 -2
- package/dist/plugin-distribution/manager.d.ts +71 -5
- package/dist/plugin-distribution/manager.js +376 -37
- package/dist/plugin-distribution/nostr-registry-adapter.d.ts +29 -0
- package/dist/plugin-distribution/nostr-registry-adapter.js +152 -0
- package/dist/plugin-distribution/plugin-bundle-verifier.d.ts +43 -0
- package/dist/plugin-distribution/plugin-bundle-verifier.js +64 -1
- package/dist/plugin-distribution/plugin-bundle.d.ts +14 -0
- package/dist/plugin-distribution/plugin-bundle.js +46 -7
- package/dist/plugin-distribution/plugin-markdown.d.ts +6 -0
- package/dist/plugin-distribution/plugin-markdown.js +94 -0
- package/dist/plugin-distribution/registry-client.d.ts +6 -1
- package/dist/plugin-distribution/registry-client.js +32 -10
- package/dist/plugin-distribution/registry-source-state.d.ts +15 -0
- package/dist/plugin-distribution/registry-source-state.js +42 -0
- package/dist/plugin-distribution/schemas.d.ts +2511 -2824
- package/dist/plugin-distribution/schemas.js +111 -42
- package/dist/plugin-distribution/types.d.ts +116 -5
- package/dist/plugin-distribution-host.d.ts +4 -0
- package/dist/plugin-distribution-host.js +2 -0
- package/dist/plugin-install-progress.js +1 -1
- package/dist/plugin-manager.d.ts +3 -0
- package/dist/plugin-manager.js +21 -13
- package/dist/plugin-settings.d.ts +21 -0
- package/dist/plugin-settings.js +41 -0
- package/dist/plugin.d.ts +13 -0
- package/dist/plugin.js +56 -0
- package/dist/registry-schema/catalog-v1.d.ts +4143 -0
- package/dist/registry-schema/catalog-v1.js +172 -0
- package/dist/registry-schema/catalog-v2.d.ts +5275 -0
- package/dist/registry-schema/catalog-v2.js +137 -0
- package/dist/registry-schema/index.d.ts +1 -0
- package/dist/registry-schema/index.js +1 -0
- package/dist/registry-schema/release-notes.d.ts +5 -0
- package/dist/registry-schema/release-notes.js +21 -0
- package/dist/server-host.d.ts +28 -0
- package/dist/server-host.js +17 -0
- package/dist/storage/app-database.d.ts +37 -2
- package/dist/storage/app-database.js +41 -1
- package/dist/storage/browser-coordinated-app-database.d.ts +3 -1
- package/dist/storage/browser-coordinated-app-database.js +8 -0
- package/dist/storage/browser.d.ts +4 -1
- package/dist/storage/browser.js +84 -0
- package/dist/storage/desktop-native.d.ts +4 -2
- package/dist/storage/desktop-native.js +90 -1
- package/dist/storage/fs.d.ts +17 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.js +1 -0
- package/dist/storage/memory-vault-adapter.d.ts +3 -1
- package/dist/storage/memory-vault-adapter.js +60 -0
- package/dist/storage/remote-app-database.d.ts +19 -0
- package/dist/storage/remote-app-database.js +130 -0
- package/dist/storage/task-projection.d.ts +2 -1
- package/dist/storage/task-projection.js +7 -2
- package/dist/storage/turso-app-database.d.ts +3 -1
- package/dist/storage/turso-app-database.js +45 -0
- package/dist/storage/vault-session.js +11 -0
- package/dist/storage/vault-state.d.ts +1 -1
- package/dist/storage/vault.svelte.d.ts +3 -1
- package/dist/storage/vault.svelte.js +76 -3
- package/dist/sync-host-security.d.ts +285 -0
- package/dist/sync-host-security.js +2237 -0
- package/dist/sync-host.d.ts +179 -0
- package/dist/sync-host.js +769 -0
- package/dist/workspace.svelte.d.ts +1 -1
- package/dist/workspace.svelte.js +1 -1
- package/package.json +48 -10
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const nonEmptyString = z.string().min(1);
|
|
3
|
+
const sha256 = z.string().regex(/^[0-9a-f]{64}$/u);
|
|
4
|
+
export const registryCatalogStatusSchema = z.enum([
|
|
5
|
+
"active",
|
|
6
|
+
"pending",
|
|
7
|
+
"deprecated",
|
|
8
|
+
"disabled",
|
|
9
|
+
"revoked",
|
|
10
|
+
]);
|
|
11
|
+
export const registryImageReferenceSchema = z.object({
|
|
12
|
+
url: nonEmptyString,
|
|
13
|
+
sourceUrl: z.string().url(),
|
|
14
|
+
sha256,
|
|
15
|
+
size: z.number().int().nonnegative(),
|
|
16
|
+
mediaType: z.enum(["image/png", "image/webp", "image/svg+xml"]),
|
|
17
|
+
width: z.number().int().positive(),
|
|
18
|
+
height: z.number().int().positive(),
|
|
19
|
+
});
|
|
20
|
+
export const registryAppearanceSchema = z.object({
|
|
21
|
+
icon: nonEmptyString,
|
|
22
|
+
accent: nonEmptyString,
|
|
23
|
+
logo: registryImageReferenceSchema
|
|
24
|
+
.extend({
|
|
25
|
+
alt: z.string(),
|
|
26
|
+
images: z
|
|
27
|
+
.object({
|
|
28
|
+
full: registryImageReferenceSchema.optional(),
|
|
29
|
+
light: registryImageReferenceSchema.optional(),
|
|
30
|
+
dark: registryImageReferenceSchema.optional(),
|
|
31
|
+
})
|
|
32
|
+
.optional(),
|
|
33
|
+
})
|
|
34
|
+
.optional(),
|
|
35
|
+
});
|
|
36
|
+
export const registryGalleryItemSchema = z.object({
|
|
37
|
+
id: nonEmptyString,
|
|
38
|
+
alt: nonEmptyString,
|
|
39
|
+
images: z.object({
|
|
40
|
+
preview: registryImageReferenceSchema,
|
|
41
|
+
full: registryImageReferenceSchema,
|
|
42
|
+
light: registryImageReferenceSchema,
|
|
43
|
+
dark: registryImageReferenceSchema,
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
46
|
+
export const registryMediaItemSchema = z.object({
|
|
47
|
+
alt: nonEmptyString,
|
|
48
|
+
images: registryGalleryItemSchema.shape.images,
|
|
49
|
+
});
|
|
50
|
+
export const registryChangelogTagSchema = z.enum([
|
|
51
|
+
"feature",
|
|
52
|
+
"improvement",
|
|
53
|
+
"fix",
|
|
54
|
+
"security",
|
|
55
|
+
"breaking",
|
|
56
|
+
"deprecation",
|
|
57
|
+
"removal",
|
|
58
|
+
]);
|
|
59
|
+
export const registryReleaseChangelogSchema = z
|
|
60
|
+
.object({
|
|
61
|
+
title: nonEmptyString.max(200),
|
|
62
|
+
description: z.string().min(1).max(4_000).optional(),
|
|
63
|
+
tags: z
|
|
64
|
+
.array(registryChangelogTagSchema)
|
|
65
|
+
.max(8)
|
|
66
|
+
.refine((tags) => new Set(tags).size === tags.length, "Changelog tags must be unique")
|
|
67
|
+
.optional(),
|
|
68
|
+
})
|
|
69
|
+
.strict();
|
|
70
|
+
export const registryReleaseSchema = z.object({
|
|
71
|
+
version: nonEmptyString,
|
|
72
|
+
releaseEventId: sha256.optional(),
|
|
73
|
+
manifestSha256: sha256.optional(),
|
|
74
|
+
releaseSequence: z
|
|
75
|
+
.string()
|
|
76
|
+
.regex(/^[1-9][0-9]*$/u)
|
|
77
|
+
.optional(),
|
|
78
|
+
minAppVersion: nonEmptyString,
|
|
79
|
+
releasedAt: z.string().datetime({ offset: true }),
|
|
80
|
+
platforms: z.array(nonEmptyString).min(1),
|
|
81
|
+
changelog: registryReleaseChangelogSchema.optional(),
|
|
82
|
+
releasePost: z.string().min(1).optional(),
|
|
83
|
+
bundle: z.object({
|
|
84
|
+
url: nonEmptyString,
|
|
85
|
+
downloadUrl: nonEmptyString.optional(),
|
|
86
|
+
sha256,
|
|
87
|
+
size: z.number().int().nonnegative(),
|
|
88
|
+
pending: z.boolean().optional(),
|
|
89
|
+
}),
|
|
90
|
+
});
|
|
91
|
+
const registryOwnerSchema = z.object({
|
|
92
|
+
name: nonEmptyString,
|
|
93
|
+
verified: z.boolean(),
|
|
94
|
+
url: z.string().url().optional(),
|
|
95
|
+
});
|
|
96
|
+
const registryContributionsSchema = z
|
|
97
|
+
.object({
|
|
98
|
+
editorViews: z
|
|
99
|
+
.array(z
|
|
100
|
+
.object({
|
|
101
|
+
id: nonEmptyString,
|
|
102
|
+
label: nonEmptyString.optional(),
|
|
103
|
+
filenamePatterns: z.array(nonEmptyString).optional(),
|
|
104
|
+
})
|
|
105
|
+
.passthrough())
|
|
106
|
+
.optional(),
|
|
107
|
+
})
|
|
108
|
+
.passthrough();
|
|
109
|
+
export const registryCatalogEntrySchema = z.object({
|
|
110
|
+
schemaVersion: z.literal(1).optional(),
|
|
111
|
+
id: z.string().regex(/^[a-z0-9][a-z0-9-]{0,127}$/u),
|
|
112
|
+
name: nonEmptyString,
|
|
113
|
+
description: nonEmptyString,
|
|
114
|
+
author: nonEmptyString,
|
|
115
|
+
authorUrl: z.string().url().optional(),
|
|
116
|
+
authorAvatarUrl: z.string().url().optional(),
|
|
117
|
+
appearance: registryAppearanceSchema.optional(),
|
|
118
|
+
channel: z.enum(["official", "community"]),
|
|
119
|
+
status: registryCatalogStatusSchema,
|
|
120
|
+
latestVersion: nonEmptyString,
|
|
121
|
+
minAppVersion: nonEmptyString,
|
|
122
|
+
platforms: z.array(nonEmptyString).min(1),
|
|
123
|
+
categories: z.array(nonEmptyString),
|
|
124
|
+
badges: z.array(nonEmptyString).default([]),
|
|
125
|
+
owner: registryOwnerSchema,
|
|
126
|
+
latestRelease: z
|
|
127
|
+
.object({
|
|
128
|
+
releasedAt: z.string().datetime({ offset: true }),
|
|
129
|
+
bundleSize: z.number().int().nonnegative(),
|
|
130
|
+
})
|
|
131
|
+
.optional(),
|
|
132
|
+
detail: nonEmptyString,
|
|
133
|
+
contributes: registryContributionsSchema.optional(),
|
|
134
|
+
});
|
|
135
|
+
export const registryCatalogIndexSchema = z.object({
|
|
136
|
+
schemaVersion: z.literal(1),
|
|
137
|
+
generatedAt: z.string().datetime({ offset: true }),
|
|
138
|
+
plugins: z.array(registryCatalogEntrySchema),
|
|
139
|
+
});
|
|
140
|
+
export const registryCatalogDetailSchema = z.object({
|
|
141
|
+
schemaVersion: z.literal(1),
|
|
142
|
+
id: z.string().regex(/^[a-z0-9][a-z0-9-]{0,127}$/u),
|
|
143
|
+
name: nonEmptyString,
|
|
144
|
+
description: nonEmptyString,
|
|
145
|
+
author: nonEmptyString,
|
|
146
|
+
authorUrl: z.string().url().optional(),
|
|
147
|
+
authorAvatarUrl: z.string().url().optional(),
|
|
148
|
+
appearance: registryAppearanceSchema.optional(),
|
|
149
|
+
media: z
|
|
150
|
+
.object({
|
|
151
|
+
banner: registryMediaItemSchema.optional(),
|
|
152
|
+
overview: registryMediaItemSchema.optional(),
|
|
153
|
+
})
|
|
154
|
+
.optional(),
|
|
155
|
+
gallery: z.array(registryGalleryItemSchema).optional(),
|
|
156
|
+
channel: z.enum(["official", "community"]),
|
|
157
|
+
status: registryCatalogStatusSchema,
|
|
158
|
+
owner: registryOwnerSchema,
|
|
159
|
+
latestVersion: nonEmptyString,
|
|
160
|
+
license: nonEmptyString.optional(),
|
|
161
|
+
links: z
|
|
162
|
+
.object({
|
|
163
|
+
homepage: z.string().url().optional(),
|
|
164
|
+
repository: z.string().url().optional(),
|
|
165
|
+
documentation: z.string().url().optional(),
|
|
166
|
+
issues: z.string().url().optional(),
|
|
167
|
+
})
|
|
168
|
+
.optional(),
|
|
169
|
+
highlights: z.array(nonEmptyString).optional(),
|
|
170
|
+
contributes: registryContributionsSchema.optional(),
|
|
171
|
+
versions: z.record(nonEmptyString, registryReleaseSchema),
|
|
172
|
+
});
|