@dyrected/core 2.5.56 → 2.5.59

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/server.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as hono_types from 'hono/types';
2
2
  import * as hono from 'hono';
3
3
  import { Hono, Context } from 'hono';
4
- import { D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig } from './app-config-Bxg_DVxv.cjs';
4
+ import { D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig } from './app-config-C3X5BAyK.cjs';
5
5
  import * as hono_utils_http_status from 'hono/utils/http-status';
6
6
  import * as hono_utils_types from 'hono/utils/types';
7
7
  import 'lucide-react';
@@ -11,10 +11,15 @@ interface DyrectedContext {
11
11
  config: DyrectedConfig;
12
12
  siteId?: string;
13
13
  workspaceId?: string;
14
- /** Decoded JWT payload set by requireAuth() or optionalAuth() middleware. */
14
+ /**
15
+ * The authenticated user set by requireAuth() or optionalAuth() middleware.
16
+ * Hydrated from the full user record (minus password) when a db adapter is
17
+ * configured, so collection fields like `roles` are available; falls back to
18
+ * the token's identity claims otherwise.
19
+ */
15
20
  user?: {
16
21
  sub: string;
17
- email: string;
22
+ email?: string;
18
23
  collection: string;
19
24
  [key: string]: any;
20
25
  };
@@ -157,6 +162,7 @@ declare class CollectionController {
157
162
  constructor(collection: CollectionConfig);
158
163
  private getDelegatedProvider;
159
164
  private toHookRequestContext;
165
+ private evaluateAccess;
160
166
  find(c: Context<DyrectedContext>): Promise<(Response & hono.TypedResponse<{
161
167
  message: string;
162
168
  }, 500, "json">) | (Response & hono.TypedResponse<{
@@ -176,6 +182,9 @@ declare class CollectionController {
176
182
  hasNextPage: boolean;
177
183
  hasPrevPage: boolean;
178
184
  }, hono_utils_http_status.ContentfulStatusCode, "json">) | (Response & hono.TypedResponse<{
185
+ error: true;
186
+ message: string;
187
+ }, 403, "json">) | (Response & hono.TypedResponse<{
179
188
  docs: {
180
189
  [x: string]: any;
181
190
  }[];
@@ -194,6 +203,9 @@ declare class CollectionController {
194
203
  }, 400, "json">) | (Response & hono.TypedResponse<{
195
204
  message: string;
196
205
  }, 413 | 415, "json">) | (Response & hono.TypedResponse<{
206
+ error: true;
207
+ message: string;
208
+ }, 403, "json">) | (Response & hono.TypedResponse<{
197
209
  [x: string]: hono_utils_types.JSONValue;
198
210
  }, 201, "json">) | (Response & hono.TypedResponse<{
199
211
  id: string;
@@ -211,6 +223,9 @@ declare class CollectionController {
211
223
  }, 400, "json">) | (Response & hono.TypedResponse<{
212
224
  message: string;
213
225
  }, 413 | 415, "json">) | (Response & hono.TypedResponse<{
226
+ error: true;
227
+ message: string;
228
+ }, 403, "json">) | (Response & hono.TypedResponse<{
214
229
  [x: string]: hono_utils_types.JSONValue;
215
230
  }, 201, "json">)>;
216
231
  update(c: Context<DyrectedContext>): Promise<(Response & hono.TypedResponse<{
@@ -229,7 +244,10 @@ declare class CollectionController {
229
244
  status?: "active" | "pending" | undefined;
230
245
  }, hono_utils_http_status.ContentfulStatusCode, "json">) | (Response & hono.TypedResponse<{
231
246
  message: string;
232
- }, 404, "json">)>;
247
+ }, 404, "json">) | (Response & hono.TypedResponse<{
248
+ error: true;
249
+ message: string;
250
+ }, 403, "json">)>;
233
251
  transition(c: Context<DyrectedContext>): Promise<(Response & hono.TypedResponse<{
234
252
  message: string;
235
253
  }, 500, "json">) | (Response & hono.TypedResponse<{
@@ -314,7 +332,10 @@ declare class GlobalController {
314
332
  [x: string]: hono_utils_types.JSONValue;
315
333
  }, hono_utils_http_status.ContentfulStatusCode, "json">) | (Response & hono.TypedResponse<{
316
334
  message: string;
317
- }, 500, "json">)>;
335
+ }, 500, "json">) | (Response & hono.TypedResponse<{
336
+ error: true;
337
+ message: string;
338
+ }, 403, "json">)>;
318
339
  seed(c: Context<DyrectedContext>): Promise<Response & hono.TypedResponse<{
319
340
  message: string;
320
341
  }, hono_utils_http_status.ContentfulStatusCode, "json">>;
package/dist/server.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as hono_types from 'hono/types';
2
2
  import * as hono from 'hono';
3
3
  import { Hono, Context } from 'hono';
4
- import { D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig } from './app-config-Bxg_DVxv.js';
4
+ import { D as DyrectedConfig, C as CollectionConfig, G as GlobalConfig } from './app-config-C3X5BAyK.js';
5
5
  import * as hono_utils_http_status from 'hono/utils/http-status';
6
6
  import * as hono_utils_types from 'hono/utils/types';
7
7
  import 'lucide-react';
@@ -11,10 +11,15 @@ interface DyrectedContext {
11
11
  config: DyrectedConfig;
12
12
  siteId?: string;
13
13
  workspaceId?: string;
14
- /** Decoded JWT payload set by requireAuth() or optionalAuth() middleware. */
14
+ /**
15
+ * The authenticated user set by requireAuth() or optionalAuth() middleware.
16
+ * Hydrated from the full user record (minus password) when a db adapter is
17
+ * configured, so collection fields like `roles` are available; falls back to
18
+ * the token's identity claims otherwise.
19
+ */
15
20
  user?: {
16
21
  sub: string;
17
- email: string;
22
+ email?: string;
18
23
  collection: string;
19
24
  [key: string]: any;
20
25
  };
@@ -157,6 +162,7 @@ declare class CollectionController {
157
162
  constructor(collection: CollectionConfig);
158
163
  private getDelegatedProvider;
159
164
  private toHookRequestContext;
165
+ private evaluateAccess;
160
166
  find(c: Context<DyrectedContext>): Promise<(Response & hono.TypedResponse<{
161
167
  message: string;
162
168
  }, 500, "json">) | (Response & hono.TypedResponse<{
@@ -176,6 +182,9 @@ declare class CollectionController {
176
182
  hasNextPage: boolean;
177
183
  hasPrevPage: boolean;
178
184
  }, hono_utils_http_status.ContentfulStatusCode, "json">) | (Response & hono.TypedResponse<{
185
+ error: true;
186
+ message: string;
187
+ }, 403, "json">) | (Response & hono.TypedResponse<{
179
188
  docs: {
180
189
  [x: string]: any;
181
190
  }[];
@@ -194,6 +203,9 @@ declare class CollectionController {
194
203
  }, 400, "json">) | (Response & hono.TypedResponse<{
195
204
  message: string;
196
205
  }, 413 | 415, "json">) | (Response & hono.TypedResponse<{
206
+ error: true;
207
+ message: string;
208
+ }, 403, "json">) | (Response & hono.TypedResponse<{
197
209
  [x: string]: hono_utils_types.JSONValue;
198
210
  }, 201, "json">) | (Response & hono.TypedResponse<{
199
211
  id: string;
@@ -211,6 +223,9 @@ declare class CollectionController {
211
223
  }, 400, "json">) | (Response & hono.TypedResponse<{
212
224
  message: string;
213
225
  }, 413 | 415, "json">) | (Response & hono.TypedResponse<{
226
+ error: true;
227
+ message: string;
228
+ }, 403, "json">) | (Response & hono.TypedResponse<{
214
229
  [x: string]: hono_utils_types.JSONValue;
215
230
  }, 201, "json">)>;
216
231
  update(c: Context<DyrectedContext>): Promise<(Response & hono.TypedResponse<{
@@ -229,7 +244,10 @@ declare class CollectionController {
229
244
  status?: "active" | "pending" | undefined;
230
245
  }, hono_utils_http_status.ContentfulStatusCode, "json">) | (Response & hono.TypedResponse<{
231
246
  message: string;
232
- }, 404, "json">)>;
247
+ }, 404, "json">) | (Response & hono.TypedResponse<{
248
+ error: true;
249
+ message: string;
250
+ }, 403, "json">)>;
233
251
  transition(c: Context<DyrectedContext>): Promise<(Response & hono.TypedResponse<{
234
252
  message: string;
235
253
  }, 500, "json">) | (Response & hono.TypedResponse<{
@@ -314,7 +332,10 @@ declare class GlobalController {
314
332
  [x: string]: hono_utils_types.JSONValue;
315
333
  }, hono_utils_http_status.ContentfulStatusCode, "json">) | (Response & hono.TypedResponse<{
316
334
  message: string;
317
- }, 500, "json">)>;
335
+ }, 500, "json">) | (Response & hono.TypedResponse<{
336
+ error: true;
337
+ message: string;
338
+ }, 403, "json">)>;
318
339
  seed(c: Context<DyrectedContext>): Promise<Response & hono.TypedResponse<{
319
340
  message: string;
320
341
  }, hono_utils_http_status.ContentfulStatusCode, "json">>;