@tiddlywiki/mws 0.1.14 → 0.2.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/README.md +41 -20
- package/dist/metafile-esm.json +1 -1
- package/dist/mws.js +40120 -20116
- package/dist/mws.js.map +1 -1
- package/mws.run.mjs +28 -8
- package/package.json +20 -33
- package/plugins/client/plugin.info +1 -1
- package/plugins/client/src/multiwikiclientadaptor.ts +6 -34
- package/plugins/client/src/mws.d.ts +2 -1
- package/plugins/client/src/new-multiwikiclientadaptor.ts +634 -0
- package/plugins/client/src/types.d.ts +2531 -1036
- package/plugins/client/tiddlers/managetiddleraction.js +0 -5
- package/plugins/client/tiddlers/syncer/new-multiwikiclientadaptor.js +432 -0
- package/plugins/client/tiddlers/syncer/syncer.js +123 -241
- package/plugins/client/tsconfig.json +5 -1
- package/prisma/browser.ts +2 -0
- package/prisma/client/browser.ts +84 -0
- package/prisma/client/client.ts +108 -0
- package/prisma/client/commonInputTypes.ts +598 -0
- package/prisma/client/enums.ts +42 -0
- package/prisma/client/internal/class.ts +326 -0
- package/prisma/client/internal/prismaNamespace.ts +1870 -0
- package/prisma/client/internal/prismaNamespaceBrowser.ts +259 -0
- package/prisma/client/models/Bag.ts +1701 -0
- package/prisma/client/models/BagPermission.ts +1284 -0
- package/prisma/client/models/Recipe.ts +1722 -0
- package/prisma/client/models/RecipeBag.ts +1518 -0
- package/prisma/client/models/RecipePermission.ts +1284 -0
- package/prisma/client/models/Roles.ts +1316 -0
- package/prisma/client/models/Sessions.ts +1344 -0
- package/prisma/client/models/Settings.ts +1093 -0
- package/prisma/client/models/Template.ts +1477 -0
- package/prisma/client/models/TemplatePermission.ts +1284 -0
- package/prisma/client/models/Tiddler.ts +1434 -0
- package/prisma/client/models/TiddlerEvent.ts +1360 -0
- package/prisma/client/models/Users.ts +1579 -0
- package/prisma/client/models.ts +24 -0
- package/prisma/client/pjtg.ts +183 -0
- package/prisma/index.ts +74 -0
- package/prisma/migrations/20260708160259_init/migration.sql +172 -0
- package/prisma/migrations-v1/migration_lock.toml +3 -0
- package/prisma/package.json +12 -0
- package/prisma/schema.prisma +147 -89
- package/prisma/types.ts +9 -0
- package/public/.default.html +1 -0
- package/public/admin-vanilla/fish.svg +399 -0
- package/public/admin-vanilla/fish2.svg +389 -0
- package/public/admin-vanilla/main-64WYHWYI.js +1791 -0
- package/public/admin-vanilla/main-64WYHWYI.js.map +7 -0
- package/public/admin-vanilla/main-LYDE4NDJ.css +1 -0
- package/public/admin-vanilla/normalize.css +349 -0
- package/public/admin-vanilla/polyfill-ADOI2A4V.js +2 -0
- package/public/admin-vanilla/polyfill-ADOI2A4V.js.map +7 -0
- package/public/{react-admin → admin-vanilla}/site.webmanifest +1 -1
- package/public/admin-vanilla.html +62 -0
- package/public/admin-vanilla.json +1 -0
- package/public/{react-admin → stats}/stats.html +5 -2
- package/public/{react-admin → stats}/stats.js +2 -1
- package/scripts/build-docs.sh +30 -0
- package/scripts/helpers.mjs +107 -0
- package/scripts/json.js +8 -0
- package/scripts/scripts.mjs +114 -0
- package/prisma/client/client.d.ts +0 -1
- package/prisma/client/client.js +0 -3
- package/prisma/client/default.d.ts +0 -1
- package/prisma/client/default.js +0 -3
- package/prisma/client/edge.d.ts +0 -1
- package/prisma/client/edge.js +0 -297
- package/prisma/client/index-browser.js +0 -275
- package/prisma/client/index.d.ts +0 -17770
- package/prisma/client/index.js +0 -324
- package/prisma/client/package.json +0 -173
- package/prisma/client/query_engine_bg.js +0 -811
- package/prisma/client/query_engine_bg.wasm +0 -0
- package/prisma/client/runtime/edge-esm.js +0 -10000
- package/prisma/client/runtime/edge.js +0 -10036
- package/prisma/client/runtime/index-browser.d.ts +0 -370
- package/prisma/client/runtime/index-browser.js +0 -2300
- package/prisma/client/runtime/library.d.ts +0 -3681
- package/prisma/client/runtime/library.js +0 -10604
- package/prisma/client/runtime/react-native.js +0 -10629
- package/prisma/client/runtime/wasm-compiler-edge.js +0 -11238
- package/prisma/client/runtime/wasm-engine-edge.js +0 -7801
- package/prisma/client/schema.prisma +0 -156
- package/prisma/client/wasm-edge-light-loader.mjs +0 -4
- package/prisma/client/wasm-worker-loader.mjs +0 -4
- package/prisma/client/wasm.d.ts +0 -1
- package/prisma/client/wasm.js +0 -304
- package/prisma/global.ts +0 -53
- package/public/react-admin/chunk-YALWN5OT.js +0 -2
- package/public/react-admin/esm-L4WLVWJN.js +0 -3
- package/public/react-admin/esm-L4WLVWJN.js.map +0 -7
- package/public/react-admin/esm-QMNGI3LF.js +0 -3
- package/public/react-admin/esm-QMNGI3LF.js.map +0 -7
- package/public/react-admin/index.html +0 -36
- package/public/react-admin/main.js +0 -268
- package/public/react-admin/main.js.map +0 -7
- package/public/react-admin/stats.json +0 -1
- package/scripts.mjs +0 -142
- /package/prisma/{migrations → migrations-v1}/20250606001949_init/migration.sql +0 -0
- /package/prisma/{migrations → migrations-v1}/20250613000526_remove_group/migration.sql +0 -0
- /package/prisma/{migrations → migrations-v1}/20250620014502_settings/migration.sql +0 -0
- /package/prisma/{migrations → migrations-v1}/20250707205229_recipes/migration.sql +0 -0
- /package/public/{react-admin → admin-vanilla}/android-chrome-192x192.png +0 -0
- /package/public/{react-admin → admin-vanilla}/android-chrome-512x512.png +0 -0
- /package/public/{react-admin → admin-vanilla}/apple-touch-icon.png +0 -0
- /package/public/{react-admin → admin-vanilla}/favicon-16x16.png +0 -0
- /package/public/{react-admin → admin-vanilla}/favicon-32x32.png +0 -0
- /package/public/{react-admin → admin-vanilla}/favicon.ico +0 -0
- /package/public/{react-admin → admin-vanilla}/favicon.png +0 -0
- /package/public/{react-admin/chunk-YALWN5OT.js.map → admin-vanilla/main-LYDE4NDJ.css.map} +0 -0
- /package/public/{react-admin → admin-vanilla}/missing-favicon.png +0 -0
- /package/public/{react-admin → admin-vanilla}/motovun-jack.jpg +0 -0
- /package/public/{react-admin → admin-vanilla}/mws-icon.png +0 -0
- /package/public/{react-admin → admin-vanilla}/vite.svg +0 -0
- /package/public/{react-admin → stats}/stats.css +0 -0
- /package/public/{react-admin → stats}/stats.svg +0 -0
package/prisma/schema.prisma
CHANGED
|
@@ -1,127 +1,160 @@
|
|
|
1
1
|
datasource db {
|
|
2
2
|
provider = "sqlite"
|
|
3
|
-
url = env("DATABASE_URL")
|
|
4
3
|
}
|
|
5
4
|
|
|
6
5
|
generator client {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
previewFeatures = ["
|
|
10
|
-
binaryTargets = []
|
|
11
|
-
output = "client"
|
|
6
|
+
provider = "prisma-client"
|
|
7
|
+
output = "client"
|
|
8
|
+
previewFeatures = ["partialIndexes"]
|
|
12
9
|
}
|
|
13
10
|
|
|
14
11
|
generator json {
|
|
15
|
-
provider
|
|
12
|
+
provider = "prisma-json-types-generator"
|
|
13
|
+
namespace = "PrismaJson"
|
|
16
14
|
}
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Tiddler storage
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
|
|
20
|
+
model Bag {
|
|
21
|
+
id String @id @default(uuid(7))
|
|
22
|
+
name String @unique
|
|
23
|
+
created DateTime @default(now())
|
|
24
|
+
updated DateTime @updatedAt
|
|
25
|
+
description String
|
|
26
|
+
permissions BagPermission[]
|
|
27
|
+
tiddlers Tiddler[]
|
|
28
|
+
recipe_bags RecipeBag[]
|
|
29
|
+
tiddler_events TiddlerEvent[]
|
|
30
|
+
|
|
31
|
+
@@map("bag")
|
|
22
32
|
}
|
|
23
33
|
|
|
24
|
-
//
|
|
25
|
-
//
|
|
34
|
+
// role_id references the auth module's roles table; no FK declared here —
|
|
35
|
+
// permission and auth tables are owned by separate modules.
|
|
36
|
+
model BagPermission {
|
|
37
|
+
bag_id String
|
|
38
|
+
role_id String
|
|
39
|
+
level BagPermissionLevel
|
|
40
|
+
bag Bag @relation(fields: [bag_id], references: [id], onDelete: Cascade)
|
|
26
41
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
42
|
+
@@id([bag_id, role_id])
|
|
43
|
+
@@map("bag_permission")
|
|
44
|
+
}
|
|
30
45
|
|
|
31
|
-
|
|
46
|
+
model Tiddler {
|
|
47
|
+
bag_id String
|
|
48
|
+
title String
|
|
49
|
+
created DateTime @default(now())
|
|
50
|
+
updated DateTime @updatedAt
|
|
51
|
+
revision BigInt @default(0)
|
|
52
|
+
// partition_key String @default("")
|
|
53
|
+
/// [Tiddler_fields]
|
|
54
|
+
fields Json
|
|
55
|
+
bag Bag @relation(fields: [bag_id], references: [id], onDelete: Cascade)
|
|
56
|
+
|
|
57
|
+
@@id([bag_id, title])
|
|
58
|
+
@@index([title])
|
|
59
|
+
@@map("tiddler")
|
|
32
60
|
}
|
|
33
61
|
|
|
34
|
-
model
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/// [Recipes_plugin_names]
|
|
40
|
-
plugin_names Json
|
|
41
|
-
skip_required_plugins Boolean @default(false)
|
|
42
|
-
skip_core Boolean @default(false)
|
|
43
|
-
preload_store Boolean @default(false)
|
|
44
|
-
custom_wiki String?
|
|
45
|
-
recipe_bags Recipe_bags[]
|
|
46
|
-
acl RecipeAcl[]
|
|
62
|
+
model TiddlerEvent {
|
|
63
|
+
seq Int @id @default(autoincrement())
|
|
64
|
+
bag_id String
|
|
65
|
+
title String
|
|
66
|
+
type TiddlerEventType
|
|
47
67
|
|
|
48
|
-
|
|
49
|
-
}
|
|
68
|
+
bag Bag @relation(fields: [bag_id], references: [id], onDelete: Cascade)
|
|
50
69
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
permission Permission
|
|
55
|
-
recipe Recipes @relation(fields: [recipe_id], references: [recipe_id], onDelete: Cascade)
|
|
56
|
-
recipe_id String
|
|
70
|
+
@@index([bag_id, seq])
|
|
71
|
+
@@map("tiddler_event")
|
|
72
|
+
}
|
|
57
73
|
|
|
58
|
-
|
|
74
|
+
enum TiddlerEventType {
|
|
75
|
+
save
|
|
76
|
+
delete
|
|
59
77
|
}
|
|
60
78
|
|
|
61
|
-
model
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
79
|
+
model Template {
|
|
80
|
+
id String @id @default(uuid(7))
|
|
81
|
+
name String @unique
|
|
82
|
+
created DateTime @default(now())
|
|
83
|
+
updated DateTime @updatedAt
|
|
84
|
+
/// [Template_type]
|
|
85
|
+
type String
|
|
86
|
+
/// [Template_definition]
|
|
87
|
+
definition Json
|
|
88
|
+
recipes Recipe[]
|
|
89
|
+
permissions TemplatePermission[]
|
|
90
|
+
|
|
91
|
+
@@map("template")
|
|
92
|
+
}
|
|
67
93
|
|
|
68
|
-
|
|
69
|
-
|
|
94
|
+
model TemplatePermission {
|
|
95
|
+
template_id String
|
|
96
|
+
role_id String
|
|
97
|
+
level TemplatePermissionLevel
|
|
98
|
+
template Template @relation(fields: [template_id], references: [id], onDelete: Cascade)
|
|
70
99
|
|
|
71
|
-
@@
|
|
72
|
-
@@
|
|
73
|
-
@@map("recipe_bags")
|
|
100
|
+
@@id([template_id, role_id])
|
|
101
|
+
@@map("template_permission")
|
|
74
102
|
}
|
|
75
103
|
|
|
76
|
-
model
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
104
|
+
model Recipe {
|
|
105
|
+
id String @id @default(uuid(7))
|
|
106
|
+
slug String @unique
|
|
107
|
+
created DateTime @default(now())
|
|
108
|
+
updated DateTime @updatedAt
|
|
109
|
+
template_id String
|
|
110
|
+
/// [Recipe_definition]
|
|
111
|
+
definition Json
|
|
112
|
+
template Template @relation(fields: [template_id], references: [id], onDelete: Restrict)
|
|
113
|
+
recipe_bags RecipeBag[]
|
|
114
|
+
permissions RecipePermission[]
|
|
115
|
+
/// [Recipe_plugins]
|
|
116
|
+
plugins Json
|
|
117
|
+
compiledAt DateTime
|
|
118
|
+
|
|
119
|
+
@@map("recipe")
|
|
86
120
|
}
|
|
87
121
|
|
|
88
|
-
model
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
permission Permission
|
|
122
|
+
model RecipePermission {
|
|
123
|
+
recipe_id String
|
|
124
|
+
role_id String
|
|
125
|
+
level RecipePermissionLevel
|
|
126
|
+
recipe Recipe @relation(fields: [recipe_id], references: [id], onDelete: Cascade)
|
|
94
127
|
|
|
95
|
-
@@
|
|
128
|
+
@@id([recipe_id, role_id])
|
|
129
|
+
@@map("recipe_permission")
|
|
96
130
|
}
|
|
97
131
|
|
|
98
|
-
model
|
|
99
|
-
|
|
100
|
-
bag_id
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
fields
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
@@
|
|
109
|
-
@@index([bag_id])
|
|
110
|
-
@@map("tiddlers")
|
|
132
|
+
model RecipeBag {
|
|
133
|
+
recipe_id String
|
|
134
|
+
bag_id String
|
|
135
|
+
priority Int
|
|
136
|
+
is_writable Boolean
|
|
137
|
+
prefix String
|
|
138
|
+
recipe Recipe @relation(fields: [recipe_id], references: [id], onDelete: Cascade)
|
|
139
|
+
bag Bag @relation(fields: [bag_id], references: [id], onDelete: Restrict)
|
|
140
|
+
|
|
141
|
+
@@id([recipe_id, bag_id, prefix])
|
|
142
|
+
@@map("recipe_bag")
|
|
111
143
|
}
|
|
112
144
|
|
|
113
|
-
model
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
// Deleting a referenced record (tiddler) will trigger the deletion of referencing record (field).
|
|
118
|
-
tiddler Tiddlers @relation(fields: [revision_id], references: [revision_id], onDelete: Cascade)
|
|
145
|
+
model Settings {
|
|
146
|
+
key String @id
|
|
147
|
+
value String
|
|
148
|
+
updated DateTime @updatedAt
|
|
119
149
|
|
|
120
|
-
@@
|
|
121
|
-
@@index([revision_id])
|
|
122
|
-
@@map("fields")
|
|
150
|
+
@@map("settings")
|
|
123
151
|
}
|
|
124
152
|
|
|
153
|
+
// ---------------------------------------------------------------------------
|
|
154
|
+
// Auth — managed by the auth module, separate from tiddler storage.
|
|
155
|
+
// No FK references cross from auth into tiddler/recipe/bag tables.
|
|
156
|
+
// ---------------------------------------------------------------------------
|
|
157
|
+
|
|
125
158
|
model Roles {
|
|
126
159
|
role_id String @id @default(uuid(7))
|
|
127
160
|
role_name String @unique()
|
|
@@ -136,6 +169,11 @@ model Users {
|
|
|
136
169
|
username String @unique
|
|
137
170
|
email String @unique
|
|
138
171
|
password String
|
|
172
|
+
|
|
173
|
+
// MySQL: multiple NULLs are allowed in unique columns and there is no way to make a partial index.
|
|
174
|
+
// SQL Server: the `where` clause is required to get the "multiple NULLs allowed" behavior.
|
|
175
|
+
// Everything else: multiple nulls are allowed in unique columns and partial indexes also work
|
|
176
|
+
resetCode String? @unique(where: { resetCode: { not: null } })
|
|
139
177
|
created_at DateTime @default(now())
|
|
140
178
|
last_login DateTime?
|
|
141
179
|
sessions Sessions[]
|
|
@@ -154,3 +192,23 @@ model Sessions {
|
|
|
154
192
|
|
|
155
193
|
@@map("sessions")
|
|
156
194
|
}
|
|
195
|
+
|
|
196
|
+
// ---------------------------------------------------------------------------
|
|
197
|
+
// Enums
|
|
198
|
+
// ---------------------------------------------------------------------------
|
|
199
|
+
|
|
200
|
+
enum BagPermissionLevel {
|
|
201
|
+
A_read
|
|
202
|
+
B_write
|
|
203
|
+
C_admin
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
enum RecipePermissionLevel {
|
|
207
|
+
A_read
|
|
208
|
+
B_write
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
enum TemplatePermissionLevel {
|
|
212
|
+
A_read
|
|
213
|
+
B_write
|
|
214
|
+
}
|
package/prisma/types.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Prisma } from "./client/browser";
|
|
2
|
+
export type { PrismaClient } from "./client/client";
|
|
3
|
+
export type PrismaPromise<T> = Prisma.PrismaPromise<T>;
|
|
4
|
+
export type {
|
|
5
|
+
GetResult,
|
|
6
|
+
DefaultArgs,
|
|
7
|
+
Types,
|
|
8
|
+
ITXClientDenyList
|
|
9
|
+
} from "@prisma/client/runtime/client";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!-- esbuild dev fallback -->
|