alinea 1.6.0 → 1.6.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/dist/.init/content/pages/welcome.json +1 -1
- package/dist/LICENSES.md +69 -69
- package/dist/adapter/core/cms.d.ts +2 -1
- package/dist/adapter/core/cms.js +1 -1
- package/dist/backend/Handler.js +2 -4
- package/dist/backend/api/BasicAuth.d.ts +1 -3
- package/dist/backend/api/BasicAuth.js +1 -5
- package/dist/backend/util/ExecGit.d.ts +0 -1
- package/dist/bundled.d.ts +7 -177
- package/dist/chunks/{chunk-AAGK4MLU.js → chunk-HELH3PKC.js} +1 -1
- package/dist/cli/Serve.js +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cloud/CloudRemote.js +9 -10
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -2
- package/dist/core/Config.d.ts +0 -3
- package/dist/core/Config.js +0 -2
- package/dist/core/Scope.d.ts +0 -1
- package/dist/core/Scope.js +0 -3
- package/dist/core/User.d.ts +0 -2
- package/dist/core/User.js +1 -2
- package/dist/core/db/EntryIndex.js +3 -1
- package/dist/core/db/EntryTransaction.d.ts +1 -2
- package/dist/core/db/EntryTransaction.js +14 -23
- package/dist/core/db/LocalDB.d.ts +1 -2
- package/dist/core/db/LocalDB.js +2 -8
- package/dist/core/db/WriteableGraph.d.ts +0 -2
- package/dist/core/db/WriteableGraph.js +0 -15
- package/dist/dashboard/App.js +15 -33
- package/dist/dashboard/atoms/DashboardAtoms.js +1 -1
- package/dist/dashboard/atoms/EntryAtoms.js +8 -21
- package/dist/dashboard/atoms/EntryEditorAtoms.js +1 -6
- package/dist/dashboard/atoms/NavigationAtoms.js +5 -22
- package/dist/dashboard/pages/ContentView.js +1 -12
- package/dist/dashboard/view/ErrorBoundary.js +18 -2
- package/dist/dashboard/view/MediaExplorer.js +4 -4
- package/dist/dashboard/view/Sidebar.js +1 -5
- package/dist/dashboard/view/entry/EntryHeader.d.ts +2 -1
- package/dist/dashboard/view/entry/EntryHeader.js +14 -24
- package/dist/dashboard/view/entry/NewEntry.js +5 -19
- package/dist/dashboard/view/sidebar/SidebarSettings.js +9 -45
- package/dist/index.css +0 -19
- package/dist/test/example.js +3 -1
- package/package.json +1 -1
- package/dist/core/Role.d.ts +0 -124
- package/dist/core/Role.js +0 -246
- package/dist/core/Role.test.d.ts +0 -1
- package/dist/dashboard/atoms/PolicyAtom.d.ts +0 -6
- package/dist/dashboard/atoms/PolicyAtom.js +0 -29
- package/dist/dashboard/hook/UsePolicy.d.ts +0 -1
- package/dist/dashboard/hook/UsePolicy.js +0 -14
- package/dist/test/roles.test.d.ts +0 -1
package/dist/LICENSES.md
CHANGED
|
@@ -2,11 +2,11 @@ This file contains the licenses of the bundled modules in this distribution.
|
|
|
2
2
|
|
|
3
3
|
===
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# react-query@3.39.3 (MIT)
|
|
6
6
|
|
|
7
7
|
MIT License
|
|
8
8
|
|
|
9
|
-
Copyright (c)
|
|
9
|
+
Copyright (c) 2019 Tanner Linsley
|
|
10
10
|
|
|
11
11
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
12
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -26,13 +26,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
26
26
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
27
|
SOFTWARE.
|
|
28
28
|
|
|
29
|
+
|
|
29
30
|
===
|
|
30
31
|
|
|
31
|
-
#
|
|
32
|
+
# rado@1.0.15 (MIT)
|
|
32
33
|
|
|
33
|
-
|
|
34
|
+
MIT License
|
|
34
35
|
|
|
35
|
-
Copyright (c)
|
|
36
|
+
Copyright (c) 2024 Ben Merckx
|
|
36
37
|
|
|
37
38
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
38
39
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -52,14 +53,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
52
53
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
53
54
|
SOFTWARE.
|
|
54
55
|
|
|
55
|
-
|
|
56
56
|
===
|
|
57
57
|
|
|
58
|
-
# react
|
|
58
|
+
# @headlessui/react@2.2.0 (MIT)
|
|
59
59
|
|
|
60
60
|
MIT License
|
|
61
61
|
|
|
62
|
-
Copyright (c)
|
|
62
|
+
Copyright (c) 2020 Tailwind Labs
|
|
63
63
|
|
|
64
64
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
65
65
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -79,14 +79,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
79
79
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
80
80
|
SOFTWARE.
|
|
81
81
|
|
|
82
|
-
|
|
83
82
|
===
|
|
84
83
|
|
|
85
|
-
# @
|
|
84
|
+
# lib0@0.2.88 (MIT)
|
|
86
85
|
|
|
87
|
-
MIT License
|
|
86
|
+
The MIT License (MIT)
|
|
88
87
|
|
|
89
|
-
Copyright (c)
|
|
88
|
+
Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
|
|
90
89
|
|
|
91
90
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
92
91
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -106,6 +105,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
106
105
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
107
106
|
SOFTWARE.
|
|
108
107
|
|
|
108
|
+
|
|
109
109
|
===
|
|
110
110
|
|
|
111
111
|
# htmlparser2@9.1.0 (MIT)
|
|
@@ -129,32 +129,6 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
129
129
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
130
130
|
IN THE SOFTWARE.
|
|
131
131
|
|
|
132
|
-
===
|
|
133
|
-
|
|
134
|
-
# @popperjs/core@2.11.8 (MIT)
|
|
135
|
-
|
|
136
|
-
The MIT License (MIT)
|
|
137
|
-
|
|
138
|
-
Copyright (c) 2019 Federico Zivolo
|
|
139
|
-
|
|
140
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
141
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
142
|
-
the Software without restriction, including without limitation the rights to
|
|
143
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
144
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
145
|
-
subject to the following conditions:
|
|
146
|
-
|
|
147
|
-
The above copyright notice and this permission notice shall be included in all
|
|
148
|
-
copies or substantial portions of the Software.
|
|
149
|
-
|
|
150
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
151
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
152
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
153
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
154
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
155
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
156
|
-
|
|
157
|
-
|
|
158
132
|
===
|
|
159
133
|
|
|
160
134
|
# domutils@3.1.0 (BSD-2-Clause)
|
|
@@ -189,6 +163,32 @@ THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRE
|
|
|
189
163
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
190
164
|
|
|
191
165
|
|
|
166
|
+
===
|
|
167
|
+
|
|
168
|
+
# @popperjs/core@2.11.8 (MIT)
|
|
169
|
+
|
|
170
|
+
The MIT License (MIT)
|
|
171
|
+
|
|
172
|
+
Copyright (c) 2019 Federico Zivolo
|
|
173
|
+
|
|
174
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
175
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
176
|
+
the Software without restriction, including without limitation the rights to
|
|
177
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
178
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
179
|
+
subject to the following conditions:
|
|
180
|
+
|
|
181
|
+
The above copyright notice and this permission notice shall be included in all
|
|
182
|
+
copies or substantial portions of the Software.
|
|
183
|
+
|
|
184
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
185
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
186
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
187
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
188
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
189
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
190
|
+
|
|
191
|
+
|
|
192
192
|
===
|
|
193
193
|
|
|
194
194
|
# entities@4.5.0 (BSD-2-Clause)
|
|
@@ -208,11 +208,11 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
208
208
|
|
|
209
209
|
===
|
|
210
210
|
|
|
211
|
-
#
|
|
211
|
+
# prop-types@15.8.1 (MIT)
|
|
212
212
|
|
|
213
213
|
MIT License
|
|
214
214
|
|
|
215
|
-
Copyright (c)
|
|
215
|
+
Copyright (c) 2013-present, Facebook, Inc.
|
|
216
216
|
|
|
217
217
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
218
218
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -442,11 +442,11 @@ SOFTWARE.
|
|
|
442
442
|
|
|
443
443
|
===
|
|
444
444
|
|
|
445
|
-
#
|
|
445
|
+
# @badgateway/oauth2-client@3.2.0 (MIT)
|
|
446
446
|
|
|
447
447
|
MIT License
|
|
448
448
|
|
|
449
|
-
Copyright (c)
|
|
449
|
+
Copyright (c) 2019-2023 Evert Pot
|
|
450
450
|
|
|
451
451
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
452
452
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -523,33 +523,6 @@ MIT
|
|
|
523
523
|
|
|
524
524
|
MIT
|
|
525
525
|
|
|
526
|
-
===
|
|
527
|
-
|
|
528
|
-
# y-prosemirror@1.2.15 (MIT)
|
|
529
|
-
|
|
530
|
-
The MIT License (MIT)
|
|
531
|
-
|
|
532
|
-
Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
|
|
533
|
-
|
|
534
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
535
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
536
|
-
in the Software without restriction, including without limitation the rights
|
|
537
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
538
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
539
|
-
furnished to do so, subject to the following conditions:
|
|
540
|
-
|
|
541
|
-
The above copyright notice and this permission notice shall be included in all
|
|
542
|
-
copies or substantial portions of the Software.
|
|
543
|
-
|
|
544
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
545
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
546
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
547
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
548
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
549
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
550
|
-
SOFTWARE.
|
|
551
|
-
|
|
552
|
-
|
|
553
526
|
===
|
|
554
527
|
|
|
555
528
|
# @babel/runtime@7.25.4 (MIT)
|
|
@@ -578,6 +551,33 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
578
551
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
579
552
|
|
|
580
553
|
|
|
554
|
+
===
|
|
555
|
+
|
|
556
|
+
# y-prosemirror@1.2.15 (MIT)
|
|
557
|
+
|
|
558
|
+
The MIT License (MIT)
|
|
559
|
+
|
|
560
|
+
Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
|
|
561
|
+
|
|
562
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
563
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
564
|
+
in the Software without restriction, including without limitation the rights
|
|
565
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
566
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
567
|
+
furnished to do so, subject to the following conditions:
|
|
568
|
+
|
|
569
|
+
The above copyright notice and this permission notice shall be included in all
|
|
570
|
+
copies or substantial portions of the Software.
|
|
571
|
+
|
|
572
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
573
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
574
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
575
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
576
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
577
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
578
|
+
SOFTWARE.
|
|
579
|
+
|
|
580
|
+
|
|
581
581
|
===
|
|
582
582
|
|
|
583
583
|
# @react-aria/focus@3.19.1 (Apache-2.0)
|
|
@@ -2,10 +2,11 @@ import { CMS } from 'alinea/core/CMS';
|
|
|
2
2
|
import type { Config } from 'alinea/core/Config';
|
|
3
3
|
import type { UploadResponse } from 'alinea/core/Connection';
|
|
4
4
|
import type { AnyQueryResult, GraphQuery } from 'alinea/core/Graph';
|
|
5
|
+
import type { Mutation } from 'alinea/core/db/Mutation';
|
|
5
6
|
export declare class CoreCMS<Definition extends Config = Config> extends CMS<Definition> {
|
|
6
7
|
sync(): Promise<string>;
|
|
7
8
|
resolve<Query extends GraphQuery>(query: Query): Promise<AnyQueryResult<Query>>;
|
|
8
|
-
mutate(): Promise<{
|
|
9
|
+
mutate(mutations: Array<Mutation>): Promise<{
|
|
9
10
|
sha: string;
|
|
10
11
|
}>;
|
|
11
12
|
prepareUpload(file: string): Promise<UploadResponse>;
|
package/dist/adapter/core/cms.js
CHANGED
package/dist/backend/Handler.js
CHANGED
|
@@ -97,7 +97,6 @@ function createHandler({
|
|
|
97
97
|
}
|
|
98
98
|
const expectUser = () => {
|
|
99
99
|
if (!userCtx) throw new Response("Unauthorized", { status: 401 });
|
|
100
|
-
return userCtx.user;
|
|
101
100
|
};
|
|
102
101
|
const body = PLazy.from(() => {
|
|
103
102
|
const isJson = request.headers.get("content-type")?.includes("application/json");
|
|
@@ -124,13 +123,12 @@ function createHandler({
|
|
|
124
123
|
return Response.json(await local.resolve(query) ?? null);
|
|
125
124
|
}
|
|
126
125
|
if (action === HandleAction.Mutate && request.method === "POST") {
|
|
127
|
-
|
|
126
|
+
expectUser();
|
|
128
127
|
expectJson();
|
|
129
|
-
const policy = await local.createPolicy(user.roles);
|
|
130
128
|
const mutations = await body;
|
|
131
129
|
const attempt = async (retry = 0) => {
|
|
132
130
|
await local.syncWith(cnx);
|
|
133
|
-
const request2 = await local.request(mutations
|
|
131
|
+
const request2 = await local.request(mutations);
|
|
134
132
|
try {
|
|
135
133
|
let { sha } = await cnx.write(request2);
|
|
136
134
|
if (sha === request2.intoSha) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { AuthApi, AuthedContext, RequestContext } from 'alinea/core/Connection';
|
|
2
|
-
import type { User } from 'alinea/core/User';
|
|
3
|
-
export type Details = boolean | User | undefined;
|
|
4
2
|
export interface Verifier {
|
|
5
|
-
(username: string, password: string):
|
|
3
|
+
(username: string, password: string): boolean | Promise<boolean>;
|
|
6
4
|
}
|
|
7
5
|
export declare class BasicAuth implements AuthApi {
|
|
8
6
|
#private;
|
|
@@ -44,13 +44,9 @@ var BasicAuth = class {
|
|
|
44
44
|
const [username, password] = atob(token).split(":");
|
|
45
45
|
const authorized = await this.#verify(username, password);
|
|
46
46
|
if (!authorized) throw new InvalidCredentialsError("Invalid credentials");
|
|
47
|
-
const user = typeof authorized === "boolean" ? {
|
|
48
|
-
sub: username,
|
|
49
|
-
roles: ["admin"]
|
|
50
|
-
} : authorized;
|
|
51
47
|
return {
|
|
52
48
|
...ctx,
|
|
53
|
-
user,
|
|
49
|
+
user: { sub: username },
|
|
54
50
|
token
|
|
55
51
|
};
|
|
56
52
|
}
|
package/dist/bundled.d.ts
CHANGED
|
@@ -4,10 +4,11 @@ declare module 'alinea/adapter/core/cms' {
|
|
|
4
4
|
import type { Config } from 'alinea/core/Config';
|
|
5
5
|
import type { UploadResponse } from 'alinea/core/Connection';
|
|
6
6
|
import type { AnyQueryResult, GraphQuery } from 'alinea/core/Graph';
|
|
7
|
+
import type { Mutation } from 'alinea/core/db/Mutation';
|
|
7
8
|
export class CoreCMS<Definition extends Config = Config> extends CMS<Definition> {
|
|
8
9
|
sync(): Promise<string>;
|
|
9
10
|
resolve<Query extends GraphQuery>(query: Query): Promise<AnyQueryResult<Query>>;
|
|
10
|
-
mutate(): Promise<{
|
|
11
|
+
mutate(mutations: Array<Mutation>): Promise<{
|
|
11
12
|
sha: string;
|
|
12
13
|
}>;
|
|
13
14
|
prepareUpload(file: string): Promise<UploadResponse>;
|
|
@@ -120,10 +121,8 @@ declare module 'alinea/adapter/next/with-alinea' {
|
|
|
120
121
|
declare module 'alinea/backend/api/BasicAuth' {
|
|
121
122
|
|
|
122
123
|
import type { AuthApi, AuthedContext, RequestContext } from 'alinea/core/Connection';
|
|
123
|
-
import type { User } from 'alinea/core/User';
|
|
124
|
-
export type Details = boolean | User | undefined;
|
|
125
124
|
export interface Verifier {
|
|
126
|
-
(username: string, password: string):
|
|
125
|
+
(username: string, password: string): boolean | Promise<boolean>;
|
|
127
126
|
}
|
|
128
127
|
export class BasicAuth implements AuthApi {
|
|
129
128
|
#private;
|
|
@@ -541,7 +540,6 @@ declare module 'alinea/backend/util/ExecGit' {
|
|
|
541
540
|
name: string;
|
|
542
541
|
email: string;
|
|
543
542
|
sub: string;
|
|
544
|
-
roles: string[];
|
|
545
543
|
}>;
|
|
546
544
|
|
|
547
545
|
}
|
|
@@ -1119,7 +1117,6 @@ declare module 'alinea/config' {
|
|
|
1119
1117
|
export { schema } from 'alinea/core/Schema';
|
|
1120
1118
|
export { track } from 'alinea/core/Tracker';
|
|
1121
1119
|
export { type } from 'alinea/core/Type';
|
|
1122
|
-
export { role } from 'alinea/core/Role';
|
|
1123
1120
|
export { workspace } from 'alinea/core/Workspace';
|
|
1124
1121
|
|
|
1125
1122
|
}
|
|
@@ -1220,7 +1217,6 @@ declare module 'alinea/core/Config' {
|
|
|
1220
1217
|
|
|
1221
1218
|
import type { Preview } from 'alinea/core/Preview';
|
|
1222
1219
|
import type { Auth } from 'alinea/core/Auth';
|
|
1223
|
-
import { type Role } from 'alinea/core/Role';
|
|
1224
1220
|
import { Root } from 'alinea/core/Root';
|
|
1225
1221
|
import { Schema } from 'alinea/core/Schema';
|
|
1226
1222
|
import { Type } from 'alinea/core/Type';
|
|
@@ -1231,8 +1227,6 @@ declare module 'alinea/core/Config' {
|
|
|
1231
1227
|
schema: Schema;
|
|
1232
1228
|
/** A record containing workspace configurations */
|
|
1233
1229
|
workspaces: Record<string, Workspace>;
|
|
1234
|
-
/** A record containing roles */
|
|
1235
|
-
roles?: Record<string, Role>;
|
|
1236
1230
|
/** A url which will be embedded in the dashboard for live previews */
|
|
1237
1231
|
preview?: Preview;
|
|
1238
1232
|
/** Every edit will pass through a draft status before being published */
|
|
@@ -1627,7 +1621,6 @@ declare module 'alinea/core/db/EntryTarget' {
|
|
|
1627
1621
|
declare module 'alinea/core/db/EntryTransaction' {
|
|
1628
1622
|
|
|
1629
1623
|
import { Config } from 'alinea/core/Config';
|
|
1630
|
-
import { Policy } from 'alinea/core/Role';
|
|
1631
1624
|
import type { Source } from 'alinea/core/source/Source';
|
|
1632
1625
|
import type { ReadonlyTree } from 'alinea/core/source/Tree';
|
|
1633
1626
|
import { type CommitChange } from 'alinea/core/db/CommitRequest';
|
|
@@ -1636,7 +1629,7 @@ declare module 'alinea/core/db/EntryTransaction' {
|
|
|
1636
1629
|
type Op<T> = Omit<T, 'op'>;
|
|
1637
1630
|
export class EntryTransaction {
|
|
1638
1631
|
#private;
|
|
1639
|
-
constructor(config: Config, index: EntryIndex, source: Source, from: ReadonlyTree
|
|
1632
|
+
constructor(config: Config, index: EntryIndex, source: Source, from: ReadonlyTree);
|
|
1640
1633
|
get empty(): boolean;
|
|
1641
1634
|
create({ locale, type, data, root, workspace, fromSeed, parentId, id, insertOrder, status, overwrite }: Op<CreateMutation>): this;
|
|
1642
1635
|
update({ id, locale, status, set }: Op<UpdateMutation>): this;
|
|
@@ -1703,7 +1696,6 @@ declare module 'alinea/core/db/LocalDB' {
|
|
|
1703
1696
|
import type { Config } from 'alinea/core/Config';
|
|
1704
1697
|
import type { SyncApi, UploadResponse } from 'alinea/core/Connection';
|
|
1705
1698
|
import type { AnyQueryResult, GraphQuery } from 'alinea/core/Graph';
|
|
1706
|
-
import type { Policy } from 'alinea/core/Role';
|
|
1707
1699
|
import type { ChangesBatch } from 'alinea/core/source/Change';
|
|
1708
1700
|
import type { Source } from 'alinea/core/source/Source';
|
|
1709
1701
|
import { type CommitRequest } from 'alinea/core/db/CommitRequest';
|
|
@@ -1725,7 +1717,7 @@ declare module 'alinea/core/db/LocalDB' {
|
|
|
1725
1717
|
sync(): Promise<string>;
|
|
1726
1718
|
syncWith(remote: SyncApi): Promise<string>;
|
|
1727
1719
|
logEntries(): Promise<void>;
|
|
1728
|
-
request(mutations: Array<Mutation
|
|
1720
|
+
request(mutations: Array<Mutation>): Promise<{
|
|
1729
1721
|
fromSha: string;
|
|
1730
1722
|
intoSha: string;
|
|
1731
1723
|
description: string;
|
|
@@ -1944,7 +1936,6 @@ declare module 'alinea/core/db/WriteableGraph' {
|
|
|
1944
1936
|
import type { UploadResponse } from 'alinea/core/Connection';
|
|
1945
1937
|
import type { EntryFields } from 'alinea/core/EntryFields';
|
|
1946
1938
|
import { Graph } from 'alinea/core/Graph';
|
|
1947
|
-
import { Policy } from 'alinea/core/Role';
|
|
1948
1939
|
import type { Mutation } from 'alinea/core/db/Mutation';
|
|
1949
1940
|
import { type ArchiveQuery, type CreateQuery, type DiscardQuery, type MoveQuery, type Operation, type PublishQuery, type UnpublishQuery, type UpdateQuery, type UploadQuery } from 'alinea/core/db/Operation';
|
|
1950
1941
|
export abstract class WriteableGraph extends Graph {
|
|
@@ -1992,7 +1983,6 @@ declare module 'alinea/core/db/WriteableGraph' {
|
|
|
1992
1983
|
thumbHash: string;
|
|
1993
1984
|
}>;
|
|
1994
1985
|
commit(...operations: Array<Operation>): Promise<void>;
|
|
1995
|
-
createPolicy(forRoles: Array<string>): Promise<Policy>;
|
|
1996
1986
|
}
|
|
1997
1987
|
|
|
1998
1988
|
}
|
|
@@ -3053,141 +3043,6 @@ declare module 'alinea/core/Resolver' {
|
|
|
3053
3043
|
|
|
3054
3044
|
}
|
|
3055
3045
|
|
|
3056
|
-
declare module 'alinea/core/Role' {
|
|
3057
|
-
|
|
3058
|
-
import type { Graph } from 'alinea/core/Graph';
|
|
3059
|
-
import type { HasRoot, HasType, HasWorkspace } from 'alinea/core/Internal';
|
|
3060
|
-
import { type Scope } from 'alinea/core/Scope';
|
|
3061
|
-
interface SetPermissions {
|
|
3062
|
-
workspace?: never;
|
|
3063
|
-
root?: never;
|
|
3064
|
-
type?: never;
|
|
3065
|
-
id?: never;
|
|
3066
|
-
locale?: never;
|
|
3067
|
-
/**
|
|
3068
|
-
* Specifies the permission evaluation strategy.
|
|
3069
|
-
* - 'inherit' (default): Permissions granted at a higher level (e.g., workspace) are sufficient.
|
|
3070
|
-
* - 'explicit': A specific 'allow' permission must exist on the target entity itself.
|
|
3071
|
-
*/
|
|
3072
|
-
grant?: 'inherit' | 'explicit';
|
|
3073
|
-
allow?: Partial<Permissions>;
|
|
3074
|
-
deny?: Partial<Permissions>;
|
|
3075
|
-
}
|
|
3076
|
-
interface WorkspacePermission extends Omit<SetPermissions, 'workspace'> {
|
|
3077
|
-
workspace: HasWorkspace;
|
|
3078
|
-
}
|
|
3079
|
-
interface RootPermission extends Omit<SetPermissions, 'root'> {
|
|
3080
|
-
root: HasRoot;
|
|
3081
|
-
}
|
|
3082
|
-
interface TypePermission extends Omit<SetPermissions, 'type'> {
|
|
3083
|
-
type: HasType;
|
|
3084
|
-
}
|
|
3085
|
-
interface IdPermission extends Omit<SetPermissions, 'id'> {
|
|
3086
|
-
id: string;
|
|
3087
|
-
}
|
|
3088
|
-
interface LocalePermission extends Omit<SetPermissions, 'locale'> {
|
|
3089
|
-
locale: string | null;
|
|
3090
|
-
}
|
|
3091
|
-
export type PermissionInput = SetPermissions | WorkspacePermission | RootPermission | TypePermission | IdPermission | LocalePermission;
|
|
3092
|
-
export interface Permissions {
|
|
3093
|
-
create: boolean;
|
|
3094
|
-
read: boolean;
|
|
3095
|
-
update: boolean;
|
|
3096
|
-
delete: boolean;
|
|
3097
|
-
reorder: boolean;
|
|
3098
|
-
move: boolean;
|
|
3099
|
-
publish: boolean;
|
|
3100
|
-
archive: boolean;
|
|
3101
|
-
upload: boolean;
|
|
3102
|
-
explore: boolean;
|
|
3103
|
-
all: boolean;
|
|
3104
|
-
}
|
|
3105
|
-
export enum Permission {
|
|
3106
|
-
None = 0,
|
|
3107
|
-
Create,
|
|
3108
|
-
Read,
|
|
3109
|
-
Update,
|
|
3110
|
-
Delete,
|
|
3111
|
-
Reorder,
|
|
3112
|
-
Move,
|
|
3113
|
-
Publish,
|
|
3114
|
-
Archive,
|
|
3115
|
-
Upload,
|
|
3116
|
-
Explore,
|
|
3117
|
-
All,
|
|
3118
|
-
Explicit
|
|
3119
|
-
}
|
|
3120
|
-
export interface Resource {
|
|
3121
|
-
workspace?: string;
|
|
3122
|
-
root?: string;
|
|
3123
|
-
type?: string;
|
|
3124
|
-
id?: string;
|
|
3125
|
-
parents?: Array<string>;
|
|
3126
|
-
locale?: string | null;
|
|
3127
|
-
}
|
|
3128
|
-
export class ACL extends Map<string, number> {
|
|
3129
|
-
root: Permission;
|
|
3130
|
-
constructor(acl?: ACL);
|
|
3131
|
-
get(resource: string): number;
|
|
3132
|
-
equals(that: ACL): boolean;
|
|
3133
|
-
}
|
|
3134
|
-
export class Policy {
|
|
3135
|
-
#private;
|
|
3136
|
-
static ALLOW_ALL: Policy;
|
|
3137
|
-
static ALLOW_NONE: Policy;
|
|
3138
|
-
protected acl: ACL;
|
|
3139
|
-
constructor(root?: Permission);
|
|
3140
|
-
static from(policy: Policy): Policy;
|
|
3141
|
-
equals(that: Policy): boolean;
|
|
3142
|
-
concat(that: Policy): Policy;
|
|
3143
|
-
check(permission: Permission, resource?: Resource): boolean;
|
|
3144
|
-
assert(permission: Permission, resource?: Resource): void;
|
|
3145
|
-
get(resource?: Resource): Permissions;
|
|
3146
|
-
canRead(resource?: Resource): boolean;
|
|
3147
|
-
canCreate(resource?: Resource): boolean;
|
|
3148
|
-
canUpdate(resource?: Resource): boolean;
|
|
3149
|
-
canDelete(resource?: Resource): boolean;
|
|
3150
|
-
canReorder(resource?: Resource): boolean;
|
|
3151
|
-
canMove(resource?: Resource): boolean;
|
|
3152
|
-
canPublish(resource?: Resource): boolean;
|
|
3153
|
-
canArchive(resource?: Resource): boolean;
|
|
3154
|
-
canUpload(resource?: Resource): boolean;
|
|
3155
|
-
canExplore(resource?: Resource): boolean;
|
|
3156
|
-
canAll(resource?: Resource): boolean;
|
|
3157
|
-
}
|
|
3158
|
-
export class WriteablePolicy extends Policy {
|
|
3159
|
-
#private;
|
|
3160
|
-
constructor(scope: Scope);
|
|
3161
|
-
allowAll(): this;
|
|
3162
|
-
set(...inputs: Array<PermissionInput>): this;
|
|
3163
|
-
}
|
|
3164
|
-
export interface RoleOptions {
|
|
3165
|
-
description?: string;
|
|
3166
|
-
permissions(policy: WriteablePolicy, graph: Graph): void | Promise<void>;
|
|
3167
|
-
}
|
|
3168
|
-
export interface Role extends RoleOptions {
|
|
3169
|
-
label: string;
|
|
3170
|
-
}
|
|
3171
|
-
export function role(label: string, config: RoleOptions): {
|
|
3172
|
-
description?: string;
|
|
3173
|
-
permissions(policy: WriteablePolicy, graph: Graph): void | Promise<void>;
|
|
3174
|
-
label: string;
|
|
3175
|
-
};
|
|
3176
|
-
export const admin: {
|
|
3177
|
-
description?: string;
|
|
3178
|
-
permissions(policy: WriteablePolicy, graph: Graph): void | Promise<void>;
|
|
3179
|
-
label: string;
|
|
3180
|
-
};
|
|
3181
|
-
export {};
|
|
3182
|
-
|
|
3183
|
-
}
|
|
3184
|
-
|
|
3185
|
-
declare module 'alinea/core/Role.test' {
|
|
3186
|
-
|
|
3187
|
-
export {};
|
|
3188
|
-
|
|
3189
|
-
}
|
|
3190
|
-
|
|
3191
3046
|
declare module 'alinea/core/Root' {
|
|
3192
3047
|
|
|
3193
3048
|
import type { ComponentType } from 'react';
|
|
@@ -3285,7 +3140,6 @@ declare module 'alinea/core/Scope' {
|
|
|
3285
3140
|
type(type: string): string;
|
|
3286
3141
|
field(type: string, field: string): string;
|
|
3287
3142
|
entry(entryId: string): string;
|
|
3288
|
-
locale(locale: string | null): string;
|
|
3289
3143
|
};
|
|
3290
3144
|
export class Scope {
|
|
3291
3145
|
#private;
|
|
@@ -4197,14 +4051,12 @@ declare module 'alinea/core/User' {
|
|
|
4197
4051
|
|
|
4198
4052
|
export interface User {
|
|
4199
4053
|
sub: string;
|
|
4200
|
-
roles: Array<string>;
|
|
4201
4054
|
email?: string;
|
|
4202
4055
|
name?: string;
|
|
4203
4056
|
}
|
|
4204
4057
|
export const localUser: {
|
|
4205
4058
|
sub: string;
|
|
4206
4059
|
name: string;
|
|
4207
|
-
roles: string[];
|
|
4208
4060
|
};
|
|
4209
4061
|
|
|
4210
4062
|
}
|
|
@@ -5409,17 +5261,6 @@ declare module 'alinea/dashboard/atoms/NavigationAtoms' {
|
|
|
5409
5261
|
|
|
5410
5262
|
}
|
|
5411
5263
|
|
|
5412
|
-
declare module 'alinea/dashboard/atoms/PolicyAtom' {
|
|
5413
|
-
|
|
5414
|
-
import type { Policy } from 'alinea/core/Role';
|
|
5415
|
-
import { type Atom } from 'jotai';
|
|
5416
|
-
export const policyTrigger: Atom<Promise<Policy>> & {
|
|
5417
|
-
current: Atom<Policy | undefined>;
|
|
5418
|
-
};
|
|
5419
|
-
export const policyAtom: Atom<Policy>;
|
|
5420
|
-
|
|
5421
|
-
}
|
|
5422
|
-
|
|
5423
5264
|
declare module 'alinea/dashboard/atoms/PreferencesAtoms' {
|
|
5424
5265
|
|
|
5425
5266
|
export type ColorScheme = 'light' | 'dark' | undefined;
|
|
@@ -5891,12 +5732,6 @@ declare module 'alinea/dashboard/hook/UseNav' {
|
|
|
5891
5732
|
|
|
5892
5733
|
}
|
|
5893
5734
|
|
|
5894
|
-
declare module 'alinea/dashboard/hook/UsePolicy' {
|
|
5895
|
-
|
|
5896
|
-
export function usePolicy(): import("alinea/core/Role").Policy;
|
|
5897
|
-
|
|
5898
|
-
}
|
|
5899
|
-
|
|
5900
5735
|
declare module 'alinea/dashboard/hook/UsePreferences' {
|
|
5901
5736
|
|
|
5902
5737
|
export const usePreferences: () => import("alinea/dashboard/atoms/PreferencesAtoms").Preferences;
|
|
@@ -6382,9 +6217,10 @@ declare module 'alinea/dashboard/view/entry/EntryHeader' {
|
|
|
6382
6217
|
|
|
6383
6218
|
import { type EntryEditor } from 'alinea/dashboard/atoms/EntryEditorAtoms';
|
|
6384
6219
|
export interface EntryHeaderProps {
|
|
6220
|
+
editable?: boolean;
|
|
6385
6221
|
editor: EntryEditor;
|
|
6386
6222
|
}
|
|
6387
|
-
export function EntryHeader({ editor }: EntryHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
6223
|
+
export function EntryHeader({ editor, editable }: EntryHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
6388
6224
|
|
|
6389
6225
|
}
|
|
6390
6226
|
|
|
@@ -8880,12 +8716,6 @@ declare module 'alinea/test/renames.test' {
|
|
|
8880
8716
|
|
|
8881
8717
|
}
|
|
8882
8718
|
|
|
8883
|
-
declare module 'alinea/test/roles.test' {
|
|
8884
|
-
|
|
8885
|
-
export {};
|
|
8886
|
-
|
|
8887
|
-
}
|
|
8888
|
-
|
|
8889
8719
|
declare module 'alinea/test/schema/DemoHome' {
|
|
8890
8720
|
|
|
8891
8721
|
export const DemoHome: import("alinea").Type<{
|
package/dist/cli/Serve.js
CHANGED