Skip to content

Commit c958925

Browse files
author
Moritz Roessler
committed
chore: cleanup
1 parent bb99345 commit c958925

File tree

6 files changed

+116
-90
lines changed

6 files changed

+116
-90
lines changed

.env.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
LOG_LEVEL=debug
22
LOG_WATCH=true
3-
SECRET=thisshouldbeacsecurerandomstring
3+
JWT_SECRET=thisshouldbeacsecurerandomstring
44
VAPID_PUBLIC=BOoXMLQuPJt8qe3ZFYjMonO6LGruvbPgAyszXsMyjip6Vg3nzeFrX8jmnYqLg5x72jQ-k6jWB3TZvzMz-BgrSFs
55
VAPID_PRIVATE=M9DH4y2EcTU3FEsv8fUpF_0FSqwy_AnjSRWv8fCQkfI
66
VAPID_IDENTITY=mailto:[email protected]

dist/index.js

+43-41
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var _graphql = require("graphql");
1616
var _http = require("http");
1717
var _subscriptionsTransportWs = require("subscriptions-transport-ws");
1818
var _reactServer = require("@state-less/react-server");
19+
var _leapBackend = require("@state-less/leap-backend");
1920
var _instances = require("./instances");
2021
var _resolvers = require("./resolvers");
2122
var _schema = require("./schema");
@@ -30,11 +31,11 @@ var _logger = _interopRequireDefault(require("./lib/logger"));
3031
var _Features = require("./components/Features");
3132
var _ViewCounter = require("./components/ViewCounter");
3233
var _ChatRoom = require("./components/ChatRoom");
33-
var _Forum = require("./components/Forum");
3434
var _Lists = require("./components/Lists");
3535
var _WebPushManager = require("./components/WebPushManager");
36+
var _permissions = require("./lib/permissions");
3637
var _jsxRuntime = require("@state-less/react-server/dist/jsxRenderer/jsx-runtime");
37-
var _templateObject, _templateObject2;
38+
var _templateObject, _templateObject2; // import { Forum, ForumPolicies, Platform } from './components/Forum';
3839
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3940
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4041
_reactServer.Dispatcher.getCurrent().setStore(_instances.store);
@@ -60,8 +61,6 @@ var connections = _instances.store.createState(0, {
6061
key: 'connections',
6162
scope: 'global'
6263
});
63-
// Create a WebSocket server for subscriptions
64-
var clients = new WeakMap();
6564
_subscriptionsTransportWs.SubscriptionServer.create({
6665
keepAlive: 10000,
6766
schema: schema,
@@ -129,111 +128,111 @@ var landingList3 = {
129128
},
130129
todos: [{
131130
id: 'history-1',
132-
createdAt: '2024-01-01',
131+
createdAt: +new Date('2024-01-01'),
133132
count: 3,
134133
type: 'Counter',
135134
title: 'Joy',
136-
archived: '2024-01-01'
135+
archived: +new Date('2024-01-01')
137136
}, {
138137
id: 'history-2',
139-
createdAt: '2024-01-01',
138+
createdAt: +new Date('2024-01-01'),
140139
count: 2,
141140
type: 'Counter',
142141
title: 'Coffee',
143-
archived: '2024-01-01'
142+
archived: +new Date('2024-01-01')
144143
}, {
145144
id: 'history-3',
146-
createdAt: '2024-01-02',
145+
createdAt: +new Date('2024-01-02'),
147146
count: 1,
148147
type: 'Counter',
149148
title: 'Joy',
150-
archived: '2024-01-02'
149+
archived: +new Date('2024-01-02')
151150
}, {
152151
id: 'history-4',
153-
createdAt: '2024-01-02',
152+
createdAt: +new Date('2024-01-02'),
154153
count: 4,
155154
type: 'Counter',
156155
title: 'Coffee',
157-
archived: '2024-01-02'
156+
archived: +new Date('2024-01-02')
158157
}, {
159158
id: 'history-5',
160-
createdAt: '2024-01-03',
159+
createdAt: +new Date('2024-01-03'),
161160
count: 0,
162161
type: 'Counter',
163162
title: 'Joy',
164-
archived: '2024-01-03'
163+
archived: +new Date('2024-01-03')
165164
}, {
166165
id: 'history-6',
167-
createdAt: '2024-01-03',
166+
createdAt: +new Date('2024-01-03'),
168167
count: 0,
169168
type: 'Counter',
170169
title: 'Coffee',
171-
archived: '2024-01-03'
170+
archived: +new Date('2024-01-03')
172171
}, {
173172
id: 'history-7',
174-
createdAt: '2024-01-04',
173+
createdAt: +new Date('2024-01-04'),
175174
count: 2,
176175
type: 'Counter',
177176
title: 'Joy',
178-
archived: '2024-01-04'
177+
archived: +new Date('2024-01-04')
179178
}, {
180179
id: 'history-8',
181-
createdAt: '2024-01-04',
180+
createdAt: +new Date('2024-01-04'),
182181
count: 2,
183182
type: 'Counter',
184183
title: 'Coffee',
185-
archived: '2024-01-04'
184+
archived: +new Date('2024-01-04')
186185
}, {
187186
id: 'history-9',
188-
createdAt: '2024-01-05',
187+
createdAt: +new Date('2024-01-05'),
189188
count: 5,
190189
type: 'Counter',
191190
title: 'Joy',
192-
archived: '2024-01-05'
191+
archived: +new Date('2024-01-05')
193192
}, {
194193
id: 'history-10',
195-
createdAt: '2024-01-05',
194+
createdAt: +new Date('2024-01-05'),
196195
count: 2,
197196
type: 'Counter',
198197
title: 'Coffee',
199-
archived: '2024-01-05'
198+
archived: +new Date('2024-01-05')
200199
}, {
201200
id: 'history-11',
202-
createdAt: '2024-01-06',
201+
createdAt: +new Date('2024-01-06'),
203202
count: 3,
204203
type: 'Counter',
205204
title: 'Joy',
206-
archived: '2024-01-06'
205+
archived: +new Date('2024-01-06')
207206
}, {
208207
id: 'history-12',
209-
createdAt: '2024-01-06',
208+
createdAt: +new Date('2024-01-06'),
210209
count: 1,
211210
type: 'Counter',
212211
title: 'Coffee',
213-
archived: '2024-01-06'
212+
archived: +new Date('2024-01-06')
214213
}, {
215214
id: 'history-13',
216-
createdAt: '2024-01-07',
215+
createdAt: +new Date('2024-01-07'),
217216
count: 1,
218217
type: 'Counter',
219218
title: 'Joy',
220-
archived: '2024-01-07'
219+
archived: +new Date('2024-01-07')
221220
}, {
222221
id: 'history-14',
223-
createdAt: '2024-01-07',
222+
createdAt: +new Date('2024-01-07'),
224223
count: 1,
225224
type: 'Counter',
226225
title: 'Coffee',
227-
archived: '2024-01-07'
226+
archived: +new Date('2024-01-07')
228227
}, {
229228
id: 'history-15',
230-
createdAt: '2024-01-08',
229+
createdAt: +new Date('2024-01-08'),
231230
count: 1,
232231
type: 'Counter',
233232
title: 'Joy'
234233
}, {
235234
id: 'history-16',
236-
createdAt: '2024-01-08',
235+
createdAt: +new Date('2024-01-08'),
237236
count: 1,
238237
type: 'Counter',
239238
title: 'Coffee'
@@ -266,22 +265,25 @@ var reactServer = (0, _jsxRuntime.jsxs)(_reactServer.Server, {
266265
policies: [_Poll.PollActions.Revert]
267266
}, "poll-open"), (0, _jsxRuntime.jsx)(_Comments.Comments, {
268267
policies: [_Comments.CommentPolicies.Authenticate]
269-
}, "comments"), (0, _jsxRuntime.jsx)(_Forum.Platform, {}, "platform"), (0, _jsxRuntime.jsx)(_Forum.Forum, {
268+
}, "comments"), (0, _jsxRuntime.jsx)(_leapBackend.Platform, {}, "platform"), (0, _jsxRuntime.jsx)(_leapBackend.Forum, {
270269
id: "community-forum",
271270
name: "Community",
272-
policies: [_Forum.ForumPolicies.PostsNeedApproval]
273-
}, "community-forum"), (0, _jsxRuntime.jsx)(_Forum.Forum, {
271+
policies: [_leapBackend.ForumPolicies.PostsNeedApproval],
272+
users: _permissions.admins
273+
}, "community-forum"), (0, _jsxRuntime.jsx)(_leapBackend.Forum, {
274274
id: "lists-forum",
275275
name: "Lists Forum",
276-
policies: [_Forum.ForumPolicies.PostsNeedApproval]
277-
}, "lists-forum"), (0, _jsxRuntime.jsx)(_Forum.Forum, {
276+
policies: [_leapBackend.ForumPolicies.PostsNeedApproval],
277+
users: _permissions.admins
278+
}, "lists-forum"), (0, _jsxRuntime.jsx)(_leapBackend.Forum, {
278279
id: "javascript-forum",
279280
name: "JavaScript Forum",
280-
policies: [_Forum.ForumPolicies.PostsNeedApproval]
281+
policies: [_leapBackend.ForumPolicies.PostsNeedApproval],
282+
users: _permissions.admins
281283
}, "javascript-forum"), (0, _jsxRuntime.jsx)(_WebPushManager.WebPushManager, {}, "web-push")]
282284
}, "server");
283285
exports.reactServer = reactServer;
284-
var node = (0, _reactServer.render)(reactServer, {
286+
(0, _reactServer.render)(reactServer, {
285287
initiator: _reactServer.Initiator.RenderServer,
286288
context: {
287289
__typename: 'ServerContext',

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@babel/plugin-transform-modules-commonjs": "^7.21.2",
1818
"@babel/plugin-transform-runtime": "^7.21.0",
1919
"@babel/preset-env": "^7.20.2",
20+
"@state-less/leap-backend": "^0.0.1",
2021
"@state-less/react-server": "state-less/react-server#feat/state-deduplication",
2122
"@types/graphql": "^14.5.0",
2223
"@types/node": "^18.15.10",

src/components/Lists.tsx

+13-13
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type TodoObject = {
2626
title?: string;
2727
note?: string;
2828
completed?: boolean;
29-
archived?: boolean;
29+
archived?: number;
3030
lastModified?: number;
3131
lastNotified?: number;
3232
reset?: number;
@@ -628,11 +628,11 @@ export const Expense = (
628628
);
629629
};
630630
type ListSettings = {
631-
defaultValuePoints: number;
632-
pinned: boolean;
633-
defaultType: string;
634-
startOfDay: string;
635-
endOfDay: string;
631+
defaultValuePoints?: number;
632+
pinned?: boolean;
633+
defaultType?: string;
634+
startOfDay?: string;
635+
endOfDay?: string;
636636
};
637637

638638
type Dependency = {
@@ -657,13 +657,13 @@ export const List = (
657657
id: string;
658658
title: string;
659659
todos: TodoObject[];
660-
archived: boolean;
661-
color: string;
662-
pinned: boolean;
663-
createdAt: number;
664-
points: number;
665-
labels: string[];
666-
settings: ListSettings;
660+
archived?: boolean;
661+
color?: string;
662+
pinned?: boolean;
663+
createdAt?: number;
664+
points?: number;
665+
labels?: string[];
666+
settings?: ListSettings;
667667
order: string[];
668668
},
669669
{ key, context }

0 commit comments

Comments
 (0)