alinea 1.6.0 → 1.6.1

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.
Files changed (50) hide show
  1. package/dist/.init/content/pages/welcome.json +1 -1
  2. package/dist/LICENSES.md +95 -95
  3. package/dist/adapter/core/cms.d.ts +2 -1
  4. package/dist/adapter/core/cms.js +1 -1
  5. package/dist/backend/Handler.js +2 -4
  6. package/dist/backend/api/BasicAuth.d.ts +1 -3
  7. package/dist/backend/api/BasicAuth.js +1 -5
  8. package/dist/backend/util/ExecGit.d.ts +0 -1
  9. package/dist/bundled.d.ts +7 -177
  10. package/dist/chunks/{chunk-AAGK4MLU.js → chunk-FYKOIMF4.js} +1 -1
  11. package/dist/cli/Serve.js +1 -1
  12. package/dist/cli/bin.js +1 -1
  13. package/dist/cloud/CloudRemote.js +9 -10
  14. package/dist/config.d.ts +0 -1
  15. package/dist/config.js +0 -2
  16. package/dist/core/Config.d.ts +0 -3
  17. package/dist/core/Config.js +0 -2
  18. package/dist/core/Scope.d.ts +0 -1
  19. package/dist/core/Scope.js +0 -3
  20. package/dist/core/User.d.ts +0 -2
  21. package/dist/core/User.js +1 -2
  22. package/dist/core/db/EntryTransaction.d.ts +1 -2
  23. package/dist/core/db/EntryTransaction.js +2 -22
  24. package/dist/core/db/LocalDB.d.ts +1 -2
  25. package/dist/core/db/LocalDB.js +2 -8
  26. package/dist/core/db/WriteableGraph.d.ts +0 -2
  27. package/dist/core/db/WriteableGraph.js +0 -15
  28. package/dist/dashboard/App.js +15 -33
  29. package/dist/dashboard/atoms/DashboardAtoms.js +1 -1
  30. package/dist/dashboard/atoms/EntryAtoms.js +7 -18
  31. package/dist/dashboard/atoms/EntryEditorAtoms.js +1 -6
  32. package/dist/dashboard/atoms/NavigationAtoms.js +5 -22
  33. package/dist/dashboard/pages/ContentView.js +1 -12
  34. package/dist/dashboard/view/ErrorBoundary.js +18 -2
  35. package/dist/dashboard/view/MediaExplorer.js +4 -4
  36. package/dist/dashboard/view/Sidebar.js +1 -5
  37. package/dist/dashboard/view/entry/EntryHeader.d.ts +2 -1
  38. package/dist/dashboard/view/entry/EntryHeader.js +14 -24
  39. package/dist/dashboard/view/entry/NewEntry.js +5 -19
  40. package/dist/dashboard/view/sidebar/SidebarSettings.js +9 -45
  41. package/dist/index.css +0 -19
  42. package/package.json +1 -1
  43. package/dist/core/Role.d.ts +0 -124
  44. package/dist/core/Role.js +0 -246
  45. package/dist/core/Role.test.d.ts +0 -1
  46. package/dist/dashboard/atoms/PolicyAtom.d.ts +0 -6
  47. package/dist/dashboard/atoms/PolicyAtom.js +0 -29
  48. package/dist/dashboard/hook/UsePolicy.d.ts +0 -1
  49. package/dist/dashboard/hook/UsePolicy.js +0 -14
  50. package/dist/test/roles.test.d.ts +0 -1
@@ -1,5 +1,5 @@
1
1
  {
2
- "_id": "373x8BfX3ySCGKUUMIDSK3VRY5l",
2
+ "_id": "373yWLU9KFZpAOuYXOfaRVWYAMP",
3
3
  "_type": "Page",
4
4
  "_index": "a0",
5
5
  "_seeded": "welcome.json",
package/dist/LICENSES.md CHANGED
@@ -28,11 +28,11 @@ SOFTWARE.
28
28
 
29
29
  ===
30
30
 
31
- # lib0@0.2.88 (MIT)
31
+ # react-query@3.39.3 (MIT)
32
32
 
33
- The MIT License (MIT)
33
+ MIT License
34
34
 
35
- Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
35
+ Copyright (c) 2019 Tanner Linsley
36
36
 
37
37
  Permission is hereby granted, free of charge, to any person obtaining a copy
38
38
  of this software and associated documentation files (the "Software"), to deal
@@ -55,11 +55,11 @@ SOFTWARE.
55
55
 
56
56
  ===
57
57
 
58
- # react-query@3.39.3 (MIT)
58
+ # @headlessui/react@2.2.0 (MIT)
59
59
 
60
60
  MIT License
61
61
 
62
- Copyright (c) 2019 Tanner Linsley
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
- # @headlessui/react@2.2.0 (MIT)
84
+ # lib0@0.2.88 (MIT)
86
85
 
87
- MIT License
86
+ The MIT License (MIT)
88
87
 
89
- Copyright (c) 2020 Tailwind Labs
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,6 +129,23 @@ 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
+ # domutils@3.1.0 (BSD-2-Clause)
135
+
136
+ Copyright (c) Felix Böhm
137
+ All rights reserved.
138
+
139
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
140
+
141
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
142
+
143
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
144
+
145
+ THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
146
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
147
+
148
+
132
149
  ===
133
150
 
134
151
  # @popperjs/core@2.11.8 (MIT)
@@ -155,23 +172,6 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
155
172
  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
156
173
 
157
174
 
158
- ===
159
-
160
- # domutils@3.1.0 (BSD-2-Clause)
161
-
162
- Copyright (c) Felix Böhm
163
- All rights reserved.
164
-
165
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
166
-
167
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
168
-
169
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
170
-
171
- THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
172
- EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
173
-
174
-
175
175
  ===
176
176
 
177
177
  # domhandler@5.0.3 (BSD-2-Clause)
@@ -467,33 +467,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
467
467
  SOFTWARE.
468
468
 
469
469
 
470
- ===
471
-
472
- # react-is@16.13.1 (MIT)
473
-
474
- MIT License
475
-
476
- Copyright (c) Facebook, Inc. and its affiliates.
477
-
478
- Permission is hereby granted, free of charge, to any person obtaining a copy
479
- of this software and associated documentation files (the "Software"), to deal
480
- in the Software without restriction, including without limitation the rights
481
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
482
- copies of the Software, and to permit persons to whom the Software is
483
- furnished to do so, subject to the following conditions:
484
-
485
- The above copyright notice and this permission notice shall be included in all
486
- copies or substantial portions of the Software.
487
-
488
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
489
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
490
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
491
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
492
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
493
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
494
- SOFTWARE.
495
-
496
-
497
470
  ===
498
471
 
499
472
  # dom-serializer@2.0.0 (MIT)
@@ -513,23 +486,11 @@ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
513
486
 
514
487
  ===
515
488
 
516
- # @headless-tree/core@0.0.15 (MIT)
517
-
518
- MIT
519
-
520
- ===
521
-
522
- # @headless-tree/react@0.0.15 (MIT)
523
-
524
- MIT
525
-
526
- ===
527
-
528
- # y-prosemirror@1.2.15 (MIT)
489
+ # react-is@16.13.1 (MIT)
529
490
 
530
- The MIT License (MIT)
491
+ MIT License
531
492
 
532
- Copyright (c) 2019 Kevin Jahns <kevin.jahns@protonmail.com>.
493
+ Copyright (c) Facebook, Inc. and its affiliates.
533
494
 
534
495
  Permission is hereby granted, free of charge, to any person obtaining a copy
535
496
  of this software and associated documentation files (the "Software"), to deal
@@ -550,6 +511,18 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
550
511
  SOFTWARE.
551
512
 
552
513
 
514
+ ===
515
+
516
+ # @headless-tree/core@0.0.15 (MIT)
517
+
518
+ MIT
519
+
520
+ ===
521
+
522
+ # @headless-tree/react@0.0.15 (MIT)
523
+
524
+ MIT
525
+
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)
@@ -1612,6 +1612,33 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1612
1612
  See the License for the specific language governing permissions and
1613
1613
  limitations under the License.
1614
1614
 
1615
+ ===
1616
+
1617
+ # @tanstack/virtual-core@3.10.6 (MIT)
1618
+
1619
+ MIT License
1620
+
1621
+ Copyright (c) 2021-present Tanner Linsley
1622
+
1623
+ Permission is hereby granted, free of charge, to any person obtaining a copy
1624
+ of this software and associated documentation files (the "Software"), to deal
1625
+ in the Software without restriction, including without limitation the rights
1626
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1627
+ copies of the Software, and to permit persons to whom the Software is
1628
+ furnished to do so, subject to the following conditions:
1629
+
1630
+ The above copyright notice and this permission notice shall be included in all
1631
+ copies or substantial portions of the Software.
1632
+
1633
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1634
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1635
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1636
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1637
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1638
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1639
+ SOFTWARE.
1640
+
1641
+
1615
1642
  ===
1616
1643
 
1617
1644
  # @react-stately/utils@3.10.5 (Apache-2.0)
@@ -1817,30 +1844,3 @@ limitations under the License.
1817
1844
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1818
1845
  See the License for the specific language governing permissions and
1819
1846
  limitations under the License.
1820
-
1821
-
1822
- ===
1823
-
1824
- # @tanstack/virtual-core@3.10.6 (MIT)
1825
-
1826
- MIT License
1827
-
1828
- Copyright (c) 2021-present Tanner Linsley
1829
-
1830
- Permission is hereby granted, free of charge, to any person obtaining a copy
1831
- of this software and associated documentation files (the "Software"), to deal
1832
- in the Software without restriction, including without limitation the rights
1833
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1834
- copies of the Software, and to permit persons to whom the Software is
1835
- furnished to do so, subject to the following conditions:
1836
-
1837
- The above copyright notice and this permission notice shall be included in all
1838
- copies or substantial portions of the Software.
1839
-
1840
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1841
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1842
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1843
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1844
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1845
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1846
- SOFTWARE.
@@ -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>;
@@ -9,7 +9,7 @@ var CoreCMS = class extends CMS {
9
9
  async resolve(query) {
10
10
  throw new Error("Not implemented");
11
11
  }
12
- async mutate() {
12
+ async mutate(mutations) {
13
13
  throw new Error("Not implemented");
14
14
  }
15
15
  async prepareUpload(file) {
@@ -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
- const user = expectUser();
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, policy);
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): Details | Promise<Details>;
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
  }
@@ -4,5 +4,4 @@ export declare function gitUser(cwd: string): PLazy<{
4
4
  name: string;
5
5
  email: string;
6
6
  sub: string;
7
- roles: string[];
8
7
  }>;