@@ -16,6 +16,7 @@ var _graphql = require("graphql");
16
16
var _http = require ( "http" ) ;
17
17
var _subscriptionsTransportWs = require ( "subscriptions-transport-ws" ) ;
18
18
var _reactServer = require ( "@state-less/react-server" ) ;
19
+ var _leapBackend = require ( "@state-less/leap-backend" ) ;
19
20
var _instances = require ( "./instances" ) ;
20
21
var _resolvers = require ( "./resolvers" ) ;
21
22
var _schema = require ( "./schema" ) ;
@@ -30,11 +31,11 @@ var _logger = _interopRequireDefault(require("./lib/logger"));
30
31
var _Features = require ( "./components/Features" ) ;
31
32
var _ViewCounter = require ( "./components/ViewCounter" ) ;
32
33
var _ChatRoom = require ( "./components/ChatRoom" ) ;
33
- var _Forum = require ( "./components/Forum" ) ;
34
34
var _Lists = require ( "./components/Lists" ) ;
35
35
var _WebPushManager = require ( "./components/WebPushManager" ) ;
36
+ var _permissions = require ( "./lib/permissions" ) ;
36
37
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';
38
39
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 ; }
39
40
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 ; }
40
41
_reactServer . Dispatcher . getCurrent ( ) . setStore ( _instances . store ) ;
@@ -60,8 +61,6 @@ var connections = _instances.store.createState(0, {
60
61
key : 'connections' ,
61
62
scope : 'global'
62
63
} ) ;
63
- // Create a WebSocket server for subscriptions
64
- var clients = new WeakMap ( ) ;
65
64
_subscriptionsTransportWs . SubscriptionServer . create ( {
66
65
keepAlive : 10000 ,
67
66
schema : schema ,
@@ -129,111 +128,111 @@ var landingList3 = {
129
128
} ,
130
129
todos : [ {
131
130
id : 'history-1' ,
132
- createdAt : '2024-01-01' ,
131
+ createdAt : + new Date ( '2024-01-01' ) ,
133
132
count : 3 ,
134
133
type : 'Counter' ,
135
134
title : 'Joy' ,
136
- archived : '2024-01-01'
135
+ archived : + new Date ( '2024-01-01' )
137
136
} , {
138
137
id : 'history-2' ,
139
- createdAt : '2024-01-01' ,
138
+ createdAt : + new Date ( '2024-01-01' ) ,
140
139
count : 2 ,
141
140
type : 'Counter' ,
142
141
title : 'Coffee' ,
143
- archived : '2024-01-01'
142
+ archived : + new Date ( '2024-01-01' )
144
143
} , {
145
144
id : 'history-3' ,
146
- createdAt : '2024-01-02' ,
145
+ createdAt : + new Date ( '2024-01-02' ) ,
147
146
count : 1 ,
148
147
type : 'Counter' ,
149
148
title : 'Joy' ,
150
- archived : '2024-01-02'
149
+ archived : + new Date ( '2024-01-02' )
151
150
} , {
152
151
id : 'history-4' ,
153
- createdAt : '2024-01-02' ,
152
+ createdAt : + new Date ( '2024-01-02' ) ,
154
153
count : 4 ,
155
154
type : 'Counter' ,
156
155
title : 'Coffee' ,
157
- archived : '2024-01-02'
156
+ archived : + new Date ( '2024-01-02' )
158
157
} , {
159
158
id : 'history-5' ,
160
- createdAt : '2024-01-03' ,
159
+ createdAt : + new Date ( '2024-01-03' ) ,
161
160
count : 0 ,
162
161
type : 'Counter' ,
163
162
title : 'Joy' ,
164
- archived : '2024-01-03'
163
+ archived : + new Date ( '2024-01-03' )
165
164
} , {
166
165
id : 'history-6' ,
167
- createdAt : '2024-01-03' ,
166
+ createdAt : + new Date ( '2024-01-03' ) ,
168
167
count : 0 ,
169
168
type : 'Counter' ,
170
169
title : 'Coffee' ,
171
- archived : '2024-01-03'
170
+ archived : + new Date ( '2024-01-03' )
172
171
} , {
173
172
id : 'history-7' ,
174
- createdAt : '2024-01-04' ,
173
+ createdAt : + new Date ( '2024-01-04' ) ,
175
174
count : 2 ,
176
175
type : 'Counter' ,
177
176
title : 'Joy' ,
178
- archived : '2024-01-04'
177
+ archived : + new Date ( '2024-01-04' )
179
178
} , {
180
179
id : 'history-8' ,
181
- createdAt : '2024-01-04' ,
180
+ createdAt : + new Date ( '2024-01-04' ) ,
182
181
count : 2 ,
183
182
type : 'Counter' ,
184
183
title : 'Coffee' ,
185
- archived : '2024-01-04'
184
+ archived : + new Date ( '2024-01-04' )
186
185
} , {
187
186
id : 'history-9' ,
188
- createdAt : '2024-01-05' ,
187
+ createdAt : + new Date ( '2024-01-05' ) ,
189
188
count : 5 ,
190
189
type : 'Counter' ,
191
190
title : 'Joy' ,
192
- archived : '2024-01-05'
191
+ archived : + new Date ( '2024-01-05' )
193
192
} , {
194
193
id : 'history-10' ,
195
- createdAt : '2024-01-05' ,
194
+ createdAt : + new Date ( '2024-01-05' ) ,
196
195
count : 2 ,
197
196
type : 'Counter' ,
198
197
title : 'Coffee' ,
199
- archived : '2024-01-05'
198
+ archived : + new Date ( '2024-01-05' )
200
199
} , {
201
200
id : 'history-11' ,
202
- createdAt : '2024-01-06' ,
201
+ createdAt : + new Date ( '2024-01-06' ) ,
203
202
count : 3 ,
204
203
type : 'Counter' ,
205
204
title : 'Joy' ,
206
- archived : '2024-01-06'
205
+ archived : + new Date ( '2024-01-06' )
207
206
} , {
208
207
id : 'history-12' ,
209
- createdAt : '2024-01-06' ,
208
+ createdAt : + new Date ( '2024-01-06' ) ,
210
209
count : 1 ,
211
210
type : 'Counter' ,
212
211
title : 'Coffee' ,
213
- archived : '2024-01-06'
212
+ archived : + new Date ( '2024-01-06' )
214
213
} , {
215
214
id : 'history-13' ,
216
- createdAt : '2024-01-07' ,
215
+ createdAt : + new Date ( '2024-01-07' ) ,
217
216
count : 1 ,
218
217
type : 'Counter' ,
219
218
title : 'Joy' ,
220
- archived : '2024-01-07'
219
+ archived : + new Date ( '2024-01-07' )
221
220
} , {
222
221
id : 'history-14' ,
223
- createdAt : '2024-01-07' ,
222
+ createdAt : + new Date ( '2024-01-07' ) ,
224
223
count : 1 ,
225
224
type : 'Counter' ,
226
225
title : 'Coffee' ,
227
- archived : '2024-01-07'
226
+ archived : + new Date ( '2024-01-07' )
228
227
} , {
229
228
id : 'history-15' ,
230
- createdAt : '2024-01-08' ,
229
+ createdAt : + new Date ( '2024-01-08' ) ,
231
230
count : 1 ,
232
231
type : 'Counter' ,
233
232
title : 'Joy'
234
233
} , {
235
234
id : 'history-16' ,
236
- createdAt : '2024-01-08' ,
235
+ createdAt : + new Date ( '2024-01-08' ) ,
237
236
count : 1 ,
238
237
type : 'Counter' ,
239
238
title : 'Coffee'
@@ -266,22 +265,25 @@ var reactServer = (0, _jsxRuntime.jsxs)(_reactServer.Server, {
266
265
policies : [ _Poll . PollActions . Revert ]
267
266
} , "poll-open" ) , ( 0 , _jsxRuntime . jsx ) ( _Comments . Comments , {
268
267
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 , {
270
269
id : "community-forum" ,
271
270
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 , {
274
274
id : "lists-forum" ,
275
275
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 , {
278
279
id : "javascript-forum" ,
279
280
name : "JavaScript Forum" ,
280
- policies : [ _Forum . ForumPolicies . PostsNeedApproval ]
281
+ policies : [ _leapBackend . ForumPolicies . PostsNeedApproval ] ,
282
+ users : _permissions . admins
281
283
} , "javascript-forum" ) , ( 0 , _jsxRuntime . jsx ) ( _WebPushManager . WebPushManager , { } , "web-push" ) ]
282
284
} , "server" ) ;
283
285
exports . reactServer = reactServer ;
284
- var node = ( 0 , _reactServer . render ) ( reactServer , {
286
+ ( 0 , _reactServer . render ) ( reactServer , {
285
287
initiator : _reactServer . Initiator . RenderServer ,
286
288
context : {
287
289
__typename : 'ServerContext' ,
0 commit comments