@aerogel/plugin-local-first 0.0.0-next.004d5deedf15bedf609a660bfd4543d3c0df9d9d
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/aerogel-plugin-local-first.d.ts +299 -0
- package/dist/aerogel-plugin-local-first.js +1661 -0
- package/dist/aerogel-plugin-local-first.js.map +1 -0
- package/package.json +50 -0
- package/src/components/Account.vue +9 -0
- package/src/components/AccountLoggedIn.vue +85 -0
- package/src/components/AccountLoggedOut.vue +26 -0
- package/src/components/AccountLoginModal.vue +36 -0
- package/src/components/AccountModal.vue +206 -0
- package/src/components/index.ts +5 -0
- package/src/components/settings/PurgeData.vue +43 -0
- package/src/components/settings/index.ts +10 -0
- package/src/index.css +1 -0
- package/src/index.ts +33 -0
- package/src/jobs/Backup.ts +98 -0
- package/src/jobs/Migrate.test.ts +217 -0
- package/src/jobs/Migrate.ts +186 -0
- package/src/jobs/Sync.test.ts +1198 -0
- package/src/jobs/Sync.ts +696 -0
- package/src/jobs/mixins/LoadsChildren.ts +229 -0
- package/src/jobs/mixins/LoadsTypeIndex.ts +25 -0
- package/src/jobs/mixins/TracksLocalModels.ts +32 -0
- package/src/lib/SyncQueue.ts +94 -0
- package/src/lib/inference.ts +124 -0
- package/src/lib/mirroring.ts +352 -0
- package/src/lib/utils.ts +21 -0
- package/src/services/Cloud.state.ts +111 -0
- package/src/services/Cloud.ts +494 -0
- package/src/services/DocumentsCache.ts +39 -0
- package/src/testing/cloud.ts +193 -0
- package/src/testing/mocks/Solid.mock.ts +34 -0
- package/src/testing/setup.ts +33 -0
- package/src/testing/stubs/LegacyTask.schema.ts +15 -0
- package/src/testing/stubs/Movie.schema.ts +15 -0
- package/src/testing/stubs/Movie.ts +3 -0
- package/src/testing/stubs/MoviesContainer.ts +20 -0
- package/src/testing/stubs/Person.schema.ts +9 -0
- package/src/testing/stubs/Person.ts +18 -0
- package/src/testing/stubs/Post.schema.ts +17 -0
- package/src/testing/stubs/Post.ts +18 -0
- package/src/testing/stubs/Task.schema.ts +12 -0
- package/src/testing/stubs/Task.ts +3 -0
- package/src/testing/stubs/TasksList.ts +20 -0
- package/src/testing/stubs/Workspace.ts +15 -0
- package/src/types/shims.d.ts +7 -0
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { App } from '@aerogel/core';
|
|
2
|
+
import { bootSolidModels } from 'soukai-solid';
|
|
3
|
+
import { uuid } from '@noeldemartin/utils';
|
|
4
|
+
import { InMemoryEngine, bootModels, resetModelListeners, setEngine } from 'soukai';
|
|
5
|
+
import { it } from 'vitest';
|
|
6
|
+
import { resetTrackedModels } from '@aerogel/plugin-soukai';
|
|
7
|
+
import { Solid } from '@aerogel/plugin-solid';
|
|
8
|
+
import type { App as AppInstance } from 'vue';
|
|
9
|
+
|
|
10
|
+
import Cloud from '@aerogel/plugin-local-first/services/Cloud';
|
|
11
|
+
|
|
12
|
+
import Movie from '@aerogel/plugin-local-first/testing/stubs/Movie';
|
|
13
|
+
import MoviesContainer from '@aerogel/plugin-local-first/testing/stubs/MoviesContainer';
|
|
14
|
+
import SolidMock from '@aerogel/plugin-local-first/testing/mocks/Solid.mock';
|
|
15
|
+
import Task from '@aerogel/plugin-local-first/testing/stubs/Task';
|
|
16
|
+
import TaskSchema from '@aerogel/plugin-local-first/testing/stubs/Task.schema';
|
|
17
|
+
import TasksList from '@aerogel/plugin-local-first/testing/stubs/TasksList';
|
|
18
|
+
import Workspace from '@aerogel/plugin-local-first/testing/stubs/Workspace';
|
|
19
|
+
import { FakeResponse, mock } from '@noeldemartin/testing';
|
|
20
|
+
|
|
21
|
+
export async function setupCloudTests(): Promise<void> {
|
|
22
|
+
bootSolidModels();
|
|
23
|
+
bootModels({ Movie, MoviesContainer, Task, TasksList, Workspace });
|
|
24
|
+
setEngine(new InMemoryEngine());
|
|
25
|
+
resetTrackedModels();
|
|
26
|
+
resetModelListeners();
|
|
27
|
+
|
|
28
|
+
await Task.updateSchema(TaskSchema);
|
|
29
|
+
|
|
30
|
+
App.instance = mock<AppInstance>({ config: { globalProperties: { $cloud: Cloud } } });
|
|
31
|
+
|
|
32
|
+
Solid.mock();
|
|
33
|
+
Cloud.reset();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function testVariants<T, Variants extends Record<string, T>>(
|
|
37
|
+
description: string,
|
|
38
|
+
variants: Variants,
|
|
39
|
+
test: (variantData: T, variantName: keyof Variants) => unknown,
|
|
40
|
+
options: { skip?: boolean; only?: boolean | keyof Variants } = {},
|
|
41
|
+
): void {
|
|
42
|
+
const only = typeof options.only === 'string' ? [options.only] : options.only ? Object.keys(variants) : [];
|
|
43
|
+
const skip = typeof options.skip === 'string' ? [options.skip] : options.skip ? Object.keys(variants) : [];
|
|
44
|
+
|
|
45
|
+
for (const [name, data] of Object.entries(variants)) {
|
|
46
|
+
if (only.includes(name)) {
|
|
47
|
+
it.only(`[${name}] ${description}`, () => test(data, name));
|
|
48
|
+
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (skip.includes(name)) {
|
|
53
|
+
it.skip(`[${name}] ${description}`, () => test(data, name));
|
|
54
|
+
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
it(`[${name}] ${description}`, () => test(data, name));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function testRegisterVariants(
|
|
63
|
+
description: string,
|
|
64
|
+
test: (registerModels: () => unknown, variant: 'model registration' | 'container registration') => unknown,
|
|
65
|
+
options: { skip?: boolean; only?: boolean | 'model registration' | 'container registration' } = {},
|
|
66
|
+
): void {
|
|
67
|
+
testVariants(
|
|
68
|
+
description,
|
|
69
|
+
{
|
|
70
|
+
'model registration': () => Cloud.register(Movie),
|
|
71
|
+
'container registration': () => Cloud.register(MoviesContainer),
|
|
72
|
+
},
|
|
73
|
+
test,
|
|
74
|
+
options,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function typeIndexResponse(containers?: Record<string, string>): Response {
|
|
79
|
+
const typeIndexUrl = SolidMock.requireUser().privateTypeIndexUrl ?? '';
|
|
80
|
+
const registrations = Object.entries(containers ?? []).map(
|
|
81
|
+
([containerUrl, forClass]) => `
|
|
82
|
+
<#${uuid()}>
|
|
83
|
+
a solid:TypeRegistration ;
|
|
84
|
+
solid:forClass ${forClass} ;
|
|
85
|
+
solid:instanceContainer <${containerUrl}> .
|
|
86
|
+
`,
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
return FakeResponse.success(`
|
|
90
|
+
@prefix solid: <http://www.w3.org/ns/solid/terms#>.
|
|
91
|
+
|
|
92
|
+
<${typeIndexUrl}> a solid:TypeIndex .
|
|
93
|
+
|
|
94
|
+
${registrations.join('\n')}
|
|
95
|
+
`);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function containerResponse(
|
|
99
|
+
options: { name?: string; documentUrls?: string[]; createdAt?: Date; updatedAt?: Date; append?: string } = {},
|
|
100
|
+
): Response {
|
|
101
|
+
const name = options.name ?? 'Movies';
|
|
102
|
+
const documentUrls = options.documentUrls ?? [];
|
|
103
|
+
const createdAt = options.createdAt ?? new Date();
|
|
104
|
+
const updatedAt = options.updatedAt ?? new Date();
|
|
105
|
+
|
|
106
|
+
return FakeResponse.success(`
|
|
107
|
+
@prefix dc: <http://purl.org/dc/terms/>.
|
|
108
|
+
@prefix ldp: <http://www.w3.org/ns/ldp#>.
|
|
109
|
+
@prefix posix: <http://www.w3.org/ns/posix/stat#>.
|
|
110
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
|
|
111
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
|
|
112
|
+
@prefix crdt: <https://vocab.noeldemartin.com/crdt/>.
|
|
113
|
+
|
|
114
|
+
<./> a ldp:Container, ldp:BasicContainer, ldp:Resource;
|
|
115
|
+
rdfs:label "${name}";
|
|
116
|
+
dc:created "2024-02-05T12:28:42Z"^^xsd:dateTime;
|
|
117
|
+
dc:modified "2024-02-05T12:28:42Z"^^xsd:dateTime;
|
|
118
|
+
${documentUrls.length > 0 ? `ldp:contains ${documentUrls.map((url) => `<${url}>`).join(',')};` : ''}
|
|
119
|
+
posix:mtime 1707136122.
|
|
120
|
+
|
|
121
|
+
<./#metadata>
|
|
122
|
+
a crdt:Metadata ;
|
|
123
|
+
crdt:resource <./> ;
|
|
124
|
+
crdt:createdAt "${createdAt.toISOString()}"^^xsd:dateTime ;
|
|
125
|
+
crdt:updatedAt "${updatedAt.toISOString()}"^^xsd:dateTime .
|
|
126
|
+
|
|
127
|
+
${options.append ?? ''}
|
|
128
|
+
`);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function movieResponse(title: string = 'Spirited Away'): Response {
|
|
132
|
+
return FakeResponse.success(`
|
|
133
|
+
@prefix schema: <https://schema.org/>.
|
|
134
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
|
|
135
|
+
@prefix crdt: <https://vocab.noeldemartin.com/crdt/> .
|
|
136
|
+
|
|
137
|
+
<#it>
|
|
138
|
+
a schema:Movie;
|
|
139
|
+
schema:datePublished "2001-07-20T00:00:00Z"^^xsd:dateTime;
|
|
140
|
+
schema:name "${title}".
|
|
141
|
+
|
|
142
|
+
<#it-metadata> a crdt:Metadata;
|
|
143
|
+
crdt:resource <#it>;
|
|
144
|
+
crdt:createdAt "2024-02-10T00:00:00Z"^^xsd:dateTime;
|
|
145
|
+
crdt:updatedAt "2024-02-10T00:00:00Z"^^xsd:dateTime.
|
|
146
|
+
`);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function taskResponse(name?: string): Response {
|
|
150
|
+
return FakeResponse.success(`
|
|
151
|
+
@prefix schema: <https://schema.org/>.
|
|
152
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
|
|
153
|
+
@prefix crdt: <https://vocab.noeldemartin.com/crdt/> .
|
|
154
|
+
|
|
155
|
+
<#it>
|
|
156
|
+
a schema:Action;
|
|
157
|
+
schema:name "${name ?? 'Task'}".
|
|
158
|
+
|
|
159
|
+
<#it-metadata> a crdt:Metadata;
|
|
160
|
+
crdt:resource <#it>;
|
|
161
|
+
crdt:createdAt "2024-02-10T00:00:00Z"^^xsd:dateTime;
|
|
162
|
+
crdt:updatedAt "2024-02-10T00:00:00Z"^^xsd:dateTime.
|
|
163
|
+
`);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function legacyTaskResponse(name?: string): Response {
|
|
167
|
+
return FakeResponse.success(`
|
|
168
|
+
@prefix ical: <http://www.w3.org/2002/12/cal/ical#>.
|
|
169
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
|
|
170
|
+
@prefix crdt: <https://vocab.noeldemartin.com/crdt/> .
|
|
171
|
+
|
|
172
|
+
<#it>
|
|
173
|
+
a ical:Vtodo;
|
|
174
|
+
ical:summary "${name ?? 'Task'}".
|
|
175
|
+
|
|
176
|
+
<#it-metadata> a crdt:Metadata;
|
|
177
|
+
crdt:resource <#it>;
|
|
178
|
+
crdt:createdAt "2024-02-10T00:00:00Z"^^xsd:dateTime;
|
|
179
|
+
crdt:updatedAt "2024-02-10T00:00:00Z"^^xsd:dateTime.
|
|
180
|
+
`);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export function tombstoneResponse(): Response {
|
|
184
|
+
return FakeResponse.success(`
|
|
185
|
+
@prefix crdt: <https://vocab.noeldemartin.com/crdt/> .
|
|
186
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
187
|
+
|
|
188
|
+
<#it-metadata>
|
|
189
|
+
a crdt:Tombstone ;
|
|
190
|
+
crdt:resource <#it> ;
|
|
191
|
+
crdt:deletedAt "2025-03-03T00:00:00Z"^^xsd:dateTime .
|
|
192
|
+
`);
|
|
193
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { FakeServer, fakeContainerUrl, fakeDocumentUrl, mock } from '@noeldemartin/testing';
|
|
2
|
+
import { facade } from '@noeldemartin/utils';
|
|
3
|
+
import { SolidACLAuthorization, SolidDocument, SolidEngine, SolidTypeIndex } from 'soukai-solid';
|
|
4
|
+
import { SolidService } from '@aerogel/plugin-solid';
|
|
5
|
+
import type { AuthSession } from '@aerogel/plugin-solid';
|
|
6
|
+
|
|
7
|
+
export class SolidMockService extends SolidService {
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
|
|
12
|
+
const engine = new SolidEngine(FakeServer.fetch);
|
|
13
|
+
|
|
14
|
+
this.setState('session', {
|
|
15
|
+
user: mock({
|
|
16
|
+
privateTypeIndexUrl: fakeDocumentUrl(),
|
|
17
|
+
storageUrls: [fakeContainerUrl()],
|
|
18
|
+
}),
|
|
19
|
+
authenticator: mock({
|
|
20
|
+
engine,
|
|
21
|
+
requireAuthenticatedFetch: () => FakeServer.fetch,
|
|
22
|
+
}),
|
|
23
|
+
} as unknown as AuthSession);
|
|
24
|
+
|
|
25
|
+
SolidACLAuthorization.setEngine(engine);
|
|
26
|
+
SolidTypeIndex.setEngine(engine);
|
|
27
|
+
SolidDocument.setEngine(engine);
|
|
28
|
+
|
|
29
|
+
this.booted.resolve();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default facade(SolidMockService);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import 'fake-indexeddb/auto';
|
|
2
|
+
|
|
3
|
+
import { installVitestSolidMatchers } from '@noeldemartin/solid-utils/vitest';
|
|
4
|
+
import { FakeLocalStorage, FakeServer, mock, setupFacadeMocks } from '@noeldemartin/testing';
|
|
5
|
+
import { resetAsyncMemo } from '@noeldemartin/utils';
|
|
6
|
+
import { beforeEach, vi } from 'vitest';
|
|
7
|
+
|
|
8
|
+
setupFacadeMocks();
|
|
9
|
+
installVitestSolidMatchers();
|
|
10
|
+
globalThis.location = mock<Location>({ href: 'https://example.com' });
|
|
11
|
+
|
|
12
|
+
beforeEach(async () => {
|
|
13
|
+
const { Solid } = await import('@aerogel/plugin-solid');
|
|
14
|
+
const { default: SolidMock } = await import('./mocks/Solid.mock');
|
|
15
|
+
const { resetPiniaStore } = await import('@aerogel/core');
|
|
16
|
+
const { resetTrackedModels } = await import('@aerogel/plugin-soukai');
|
|
17
|
+
|
|
18
|
+
FakeLocalStorage.requireInstance().clear();
|
|
19
|
+
Solid.setMockFacade(SolidMock);
|
|
20
|
+
FakeServer.reset();
|
|
21
|
+
|
|
22
|
+
resetAsyncMemo();
|
|
23
|
+
resetPiniaStore();
|
|
24
|
+
resetTrackedModels();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
vi.mock('@aerogel/core', async () => {
|
|
28
|
+
const original = (await vi.importActual('@aerogel/core')) as object;
|
|
29
|
+
|
|
30
|
+
FakeLocalStorage.patchGlobal();
|
|
31
|
+
|
|
32
|
+
return original;
|
|
33
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FieldType } from 'soukai';
|
|
2
|
+
import { defineSolidModelSchema } from 'soukai-solid';
|
|
3
|
+
|
|
4
|
+
export default defineSolidModelSchema({
|
|
5
|
+
rdfContext: 'http://www.w3.org/2002/12/cal/ical#',
|
|
6
|
+
rdfsClass: 'Vtodo',
|
|
7
|
+
history: true,
|
|
8
|
+
tombstone: false,
|
|
9
|
+
fields: {
|
|
10
|
+
name: {
|
|
11
|
+
type: FieldType.String,
|
|
12
|
+
rdfProperty: 'summary',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FieldType } from 'soukai';
|
|
2
|
+
import { defineSolidModelSchema } from 'soukai-solid';
|
|
3
|
+
|
|
4
|
+
export default defineSolidModelSchema({
|
|
5
|
+
rdfContext: 'https://schema.org/',
|
|
6
|
+
history: true,
|
|
7
|
+
tombstone: false,
|
|
8
|
+
fields: {
|
|
9
|
+
name: FieldType.String,
|
|
10
|
+
releaseDate: {
|
|
11
|
+
type: FieldType.Date,
|
|
12
|
+
rdfProperty: 'schema:datePublished',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SolidContainer } from 'soukai-solid';
|
|
2
|
+
import type { Relation } from 'soukai';
|
|
3
|
+
import type { SolidContainsRelation } from 'soukai-solid';
|
|
4
|
+
|
|
5
|
+
import Movie from './Movie';
|
|
6
|
+
|
|
7
|
+
export default class MoviesContainer extends SolidContainer {
|
|
8
|
+
|
|
9
|
+
public static override history = true;
|
|
10
|
+
public static override timestamps = true;
|
|
11
|
+
public static override tombstone = false;
|
|
12
|
+
|
|
13
|
+
declare public movies?: Movie[];
|
|
14
|
+
declare public relatedMovies: SolidContainsRelation<this, Movie, typeof Movie>;
|
|
15
|
+
|
|
16
|
+
public moviesRelationship(): Relation {
|
|
17
|
+
return this.contains(Movie);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SolidHasManyRelation } from 'soukai-solid';
|
|
2
|
+
import type { Relation } from 'soukai';
|
|
3
|
+
|
|
4
|
+
import Model from './Person.schema';
|
|
5
|
+
import Post from './Post';
|
|
6
|
+
|
|
7
|
+
export default class Person extends Model {
|
|
8
|
+
|
|
9
|
+
public static override timestamps = false;
|
|
10
|
+
|
|
11
|
+
declare public posts?: Post[];
|
|
12
|
+
declare public relatedPosts: SolidHasManyRelation<Person, Post, typeof Post>;
|
|
13
|
+
|
|
14
|
+
public postsRelationship(): Relation {
|
|
15
|
+
return this.hasMany(Post, 'authorUrl');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FieldType } from 'soukai';
|
|
2
|
+
import { defineSolidModelSchema } from 'soukai-solid';
|
|
3
|
+
|
|
4
|
+
export default defineSolidModelSchema({
|
|
5
|
+
rdfContext: 'https://schema.org/',
|
|
6
|
+
rdfsClass: 'Article',
|
|
7
|
+
fields: {
|
|
8
|
+
title: {
|
|
9
|
+
type: FieldType.String,
|
|
10
|
+
rdfProperty: 'name',
|
|
11
|
+
},
|
|
12
|
+
authorUrl: {
|
|
13
|
+
type: FieldType.Key,
|
|
14
|
+
rdfProperty: 'author',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Relation } from 'soukai';
|
|
2
|
+
import type { SolidBelongsToOneRelation } from 'soukai-solid';
|
|
3
|
+
|
|
4
|
+
import Model from './Post.schema';
|
|
5
|
+
import Person from './Person';
|
|
6
|
+
|
|
7
|
+
export default class Post extends Model {
|
|
8
|
+
|
|
9
|
+
public static override timestamps = false;
|
|
10
|
+
|
|
11
|
+
declare public author?: Person;
|
|
12
|
+
declare public relatedAuthor: SolidBelongsToOneRelation<Post, Person, typeof Person>;
|
|
13
|
+
|
|
14
|
+
public authorRelationship(): Relation {
|
|
15
|
+
return this.belongsToOne(Person, 'authorUrl');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FieldType } from 'soukai';
|
|
2
|
+
import { defineSolidModelSchema } from 'soukai-solid';
|
|
3
|
+
|
|
4
|
+
export default defineSolidModelSchema({
|
|
5
|
+
rdfContext: 'https://schema.org/',
|
|
6
|
+
rdfsClass: 'Action',
|
|
7
|
+
history: true,
|
|
8
|
+
tombstone: false,
|
|
9
|
+
fields: {
|
|
10
|
+
name: FieldType.String,
|
|
11
|
+
},
|
|
12
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SolidContainer } from 'soukai-solid';
|
|
2
|
+
import type { Relation } from 'soukai';
|
|
3
|
+
import type { SolidContainsRelation } from 'soukai-solid';
|
|
4
|
+
|
|
5
|
+
import Task from './Task';
|
|
6
|
+
|
|
7
|
+
export default class TasksList extends SolidContainer {
|
|
8
|
+
|
|
9
|
+
public static override history = true;
|
|
10
|
+
public static override timestamps = true;
|
|
11
|
+
public static override tombstone = false;
|
|
12
|
+
|
|
13
|
+
declare public tasks?: Task[];
|
|
14
|
+
declare public relatedTasks: SolidContainsRelation<this, Task, typeof Task>;
|
|
15
|
+
|
|
16
|
+
public tasksRelationship(): Relation {
|
|
17
|
+
return this.contains(Task);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Relation } from 'soukai';
|
|
2
|
+
import type { SolidContainsRelation } from 'soukai-solid';
|
|
3
|
+
|
|
4
|
+
import TasksList from './TasksList';
|
|
5
|
+
|
|
6
|
+
export default class Workspace extends TasksList {
|
|
7
|
+
|
|
8
|
+
declare public lists?: TasksList[];
|
|
9
|
+
declare public relatedLists: SolidContainsRelation<this, TasksList, typeof TasksList>;
|
|
10
|
+
|
|
11
|
+
public listsRelationship(): Relation {
|
|
12
|
+
return this.contains(TasksList);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|