eddev 2.0.0-beta.144 → 2.0.0-beta.145

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.
@@ -1 +1 @@
1
- {"version":3,"file":"content-security.d.ts","sourceRoot":"","sources":["../../../../src/app/server/utils/content-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAG7D,QAAA,MAAM,QAAQ,kXAyBJ,CAAA;AAEV,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAE9C,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;AAEnD,MAAM,MAAM,mCAAmC,GAAG;IAChD,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,YAAY,EAAE,CAAA;CACrB,CAAA;AAED,qBAAa,mBAAmB;IAC9B,SAAS,CAAC,GAAG,EAAE,SAAS,CAAA;IACxB,SAAS,CAAC,OAAO,EAAE,OAAO,CAAgB;IAE1C,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,oBAAoB,CAAO;IACnC,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,gBAAgB,CAAe;IAEvC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;gBAEtB,MAAM,EAAE,QAAQ;IA0B5B,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW;IAmB/C,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE;IAkBhC,UAAU,IAAI,OAAO;IAWrB,iBAAiB,IAAI,MAAM,GAAG,SAAS;CAgBxC"}
1
+ {"version":3,"file":"content-security.d.ts","sourceRoot":"","sources":["../../../../src/app/server/utils/content-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAG7D,QAAA,MAAM,QAAQ,kXAyBJ,CAAA;AAEV,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAE9C,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;AAEnD,MAAM,MAAM,mCAAmC,GAAG;IAChD,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,YAAY,EAAE,CAAA;CACrB,CAAA;AAED,qBAAa,mBAAmB;IAC9B,SAAS,CAAC,GAAG,EAAE,SAAS,CAAA;IACxB,SAAS,CAAC,OAAO,EAAE,OAAO,CAAgB;IAE1C,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,oBAAoB,CAAO;IACnC,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,gBAAgB,CAAe;IAEvC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;gBAEtB,MAAM,EAAE,QAAQ;IAgC5B,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW;IAmB/C,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE;IAkBhC,UAAU,IAAI,OAAO;IAWrB,iBAAiB,IAAI,MAAM,GAAG,SAAS;CAgBxC"}
@@ -53,6 +53,12 @@ export class SecureHeaderBuilder {
53
53
  if (this.useNonce) {
54
54
  defaults.push(`'nonce-${this.nonce}'`);
55
55
  }
56
+ if (config.serverless.csp.values) {
57
+ const value = config.serverless.csp.values[key];
58
+ if (value) {
59
+ defaults.push(...value);
60
+ }
61
+ }
56
62
  }
57
63
  this.csp[key] = new Set(defaults);
58
64
  }
@@ -9,20 +9,20 @@ export declare const EDConfigSchema: z.ZodObject<{
9
9
  provider: z.ZodLiteral<"ga4">;
10
10
  id: z.ZodString;
11
11
  }, "strip", z.ZodTypeAny, {
12
- id: string;
13
12
  provider: "ga4";
14
- }, {
15
13
  id: string;
14
+ }, {
16
15
  provider: "ga4";
16
+ id: string;
17
17
  }>, z.ZodObject<{
18
18
  provider: z.ZodLiteral<"gtm">;
19
19
  id: z.ZodString;
20
20
  }, "strip", z.ZodTypeAny, {
21
- id: string;
22
21
  provider: "gtm";
23
- }, {
24
22
  id: string;
23
+ }, {
25
24
  provider: "gtm";
25
+ id: string;
26
26
  }>]>, "many">>;
27
27
  serverless: z.ZodObject<{
28
28
  enabled: z.ZodDefault<z.ZodBoolean>;
@@ -50,35 +50,35 @@ export declare const EDConfigSchema: z.ZodObject<{
50
50
  autoDetect: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
51
51
  nonce: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
52
52
  commonOrigins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
53
- values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
53
+ values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
54
54
  }, "strip", z.ZodTypeAny, {
55
- nonce: boolean;
56
55
  enabled: boolean;
57
56
  autoDetect: boolean;
58
- values?: Record<string, string> | undefined;
57
+ nonce: boolean;
58
+ values?: Record<string, string[]> | undefined;
59
59
  commonOrigins?: string[] | undefined;
60
60
  }, {
61
61
  enabled: boolean;
62
- values?: Record<string, string> | undefined;
63
- nonce?: boolean | undefined;
62
+ values?: Record<string, string[]> | undefined;
64
63
  autoDetect?: boolean | undefined;
64
+ nonce?: boolean | undefined;
65
65
  commonOrigins?: string[] | undefined;
66
66
  }>>;
67
67
  }, "strip", z.ZodTypeAny, {
68
- plugins: "proxy" | "remote";
69
68
  enabled: boolean;
70
69
  uploads: "proxy" | "remote";
71
- admin: "hide" | "proxy";
70
+ plugins: "proxy" | "remote";
71
+ admin: "proxy" | "hide";
72
72
  originProtection: {
73
73
  requireLogin: boolean;
74
74
  };
75
75
  themeAssets: string[];
76
76
  endpoints: Record<string, string>;
77
77
  csp: {
78
- nonce: boolean;
79
78
  enabled: boolean;
80
79
  autoDetect: boolean;
81
- values?: Record<string, string> | undefined;
80
+ nonce: boolean;
81
+ values?: Record<string, string[]> | undefined;
82
82
  commonOrigins?: string[] | undefined;
83
83
  };
84
84
  cors?: {
@@ -87,9 +87,9 @@ export declare const EDConfigSchema: z.ZodObject<{
87
87
  }, {
88
88
  uploads: "proxy" | "remote";
89
89
  endpoints: Record<string, string>;
90
- plugins?: "proxy" | "remote" | undefined;
91
90
  enabled?: boolean | undefined;
92
- admin?: "hide" | "proxy" | undefined;
91
+ plugins?: "proxy" | "remote" | undefined;
92
+ admin?: "proxy" | "hide" | undefined;
93
93
  originProtection?: {
94
94
  requireLogin?: boolean | undefined;
95
95
  } | undefined;
@@ -99,9 +99,9 @@ export declare const EDConfigSchema: z.ZodObject<{
99
99
  } | undefined;
100
100
  csp?: {
101
101
  enabled: boolean;
102
- values?: Record<string, string> | undefined;
103
- nonce?: boolean | undefined;
102
+ values?: Record<string, string[]> | undefined;
104
103
  autoDetect?: boolean | undefined;
104
+ nonce?: boolean | undefined;
105
105
  commonOrigins?: string[] | undefined;
106
106
  } | undefined;
107
107
  }>;
@@ -124,37 +124,37 @@ export declare const EDConfigSchema: z.ZodObject<{
124
124
  dataCache: z.ZodDefault<z.ZodEnum<["in-memory", "kv", "none"]>>;
125
125
  }, "strip", z.ZodTypeAny, {
126
126
  isr: boolean;
127
- dataCache: "none" | "in-memory" | "kv";
127
+ dataCache: "in-memory" | "kv" | "none";
128
128
  }, {
129
129
  isr?: boolean | undefined;
130
- dataCache?: "none" | "in-memory" | "kv" | undefined;
130
+ dataCache?: "in-memory" | "kv" | "none" | undefined;
131
131
  }>>>;
132
132
  pageDataTTL: z.ZodDefault<z.ZodNumber>;
133
133
  appDataTTL: z.ZodDefault<z.ZodNumber>;
134
134
  queryHooksTTL: z.ZodDefault<z.ZodNumber>;
135
135
  }, "strip", z.ZodTypeAny, {
136
+ serverless: {
137
+ isr: boolean;
138
+ dataCache: "in-memory" | "kv" | "none";
139
+ };
136
140
  wordpress: {
137
141
  strategy: "always" | "ssr-always-fresh";
138
142
  cacheHeaders: boolean;
139
143
  transients: boolean;
140
144
  };
141
- serverless: {
142
- isr: boolean;
143
- dataCache: "none" | "in-memory" | "kv";
144
- };
145
145
  pageDataTTL: number;
146
146
  appDataTTL: number;
147
147
  queryHooksTTL: number;
148
148
  }, {
149
+ serverless?: {
150
+ isr?: boolean | undefined;
151
+ dataCache?: "in-memory" | "kv" | "none" | undefined;
152
+ } | undefined;
149
153
  wordpress?: {
150
154
  strategy: "always" | "ssr-always-fresh";
151
155
  cacheHeaders?: boolean | undefined;
152
156
  transients?: boolean | undefined;
153
157
  } | undefined;
154
- serverless?: {
155
- isr?: boolean | undefined;
156
- dataCache?: "none" | "in-memory" | "kv" | undefined;
157
- } | undefined;
158
158
  pageDataTTL?: number | undefined;
159
159
  appDataTTL?: number | undefined;
160
160
  queryHooksTTL?: number | undefined;
@@ -162,60 +162,60 @@ export declare const EDConfigSchema: z.ZodObject<{
162
162
  devUI: z.ZodDefault<z.ZodEnum<["disabled", "enabled"]>>;
163
163
  }, "strip", z.ZodTypeAny, {
164
164
  version: "2";
165
- cache: Record<string, {
166
- wordpress: {
167
- strategy: "always" | "ssr-always-fresh";
168
- cacheHeaders: boolean;
169
- transients: boolean;
170
- };
171
- serverless: {
172
- isr: boolean;
173
- dataCache: "none" | "in-memory" | "kv";
174
- };
175
- pageDataTTL: number;
176
- appDataTTL: number;
177
- queryHooksTTL: number;
178
- }>;
179
165
  legacyMetadata: boolean;
180
166
  legacyStitches: boolean;
181
167
  serverless: {
182
- plugins: "proxy" | "remote";
183
168
  enabled: boolean;
184
169
  uploads: "proxy" | "remote";
185
- admin: "hide" | "proxy";
170
+ plugins: "proxy" | "remote";
171
+ admin: "proxy" | "hide";
186
172
  originProtection: {
187
173
  requireLogin: boolean;
188
174
  };
189
175
  themeAssets: string[];
190
176
  endpoints: Record<string, string>;
191
177
  csp: {
192
- nonce: boolean;
193
178
  enabled: boolean;
194
179
  autoDetect: boolean;
195
- values?: Record<string, string> | undefined;
180
+ nonce: boolean;
181
+ values?: Record<string, string[]> | undefined;
196
182
  commonOrigins?: string[] | undefined;
197
183
  };
198
184
  cors?: {
199
185
  origins?: string[] | undefined;
200
186
  } | undefined;
201
187
  };
202
- devUI: "disabled" | "enabled";
188
+ cache: Record<string, {
189
+ serverless: {
190
+ isr: boolean;
191
+ dataCache: "in-memory" | "kv" | "none";
192
+ };
193
+ wordpress: {
194
+ strategy: "always" | "ssr-always-fresh";
195
+ cacheHeaders: boolean;
196
+ transients: boolean;
197
+ };
198
+ pageDataTTL: number;
199
+ appDataTTL: number;
200
+ queryHooksTTL: number;
201
+ }>;
202
+ devUI: "enabled" | "disabled";
203
203
  $schema?: string | undefined;
204
204
  trackers?: ({
205
- id: string;
206
205
  provider: "ga4";
207
- } | {
208
206
  id: string;
207
+ } | {
209
208
  provider: "gtm";
209
+ id: string;
210
210
  })[] | undefined;
211
211
  }, {
212
212
  version: "1" | "2";
213
213
  serverless: {
214
214
  uploads: "proxy" | "remote";
215
215
  endpoints: Record<string, string>;
216
- plugins?: "proxy" | "remote" | undefined;
217
216
  enabled?: boolean | undefined;
218
- admin?: "hide" | "proxy" | undefined;
217
+ plugins?: "proxy" | "remote" | undefined;
218
+ admin?: "proxy" | "hide" | undefined;
219
219
  originProtection?: {
220
220
  requireLogin?: boolean | undefined;
221
221
  } | undefined;
@@ -225,37 +225,37 @@ export declare const EDConfigSchema: z.ZodObject<{
225
225
  } | undefined;
226
226
  csp?: {
227
227
  enabled: boolean;
228
- values?: Record<string, string> | undefined;
229
- nonce?: boolean | undefined;
228
+ values?: Record<string, string[]> | undefined;
230
229
  autoDetect?: boolean | undefined;
230
+ nonce?: boolean | undefined;
231
231
  commonOrigins?: string[] | undefined;
232
232
  } | undefined;
233
233
  };
234
+ $schema?: string | undefined;
235
+ legacyMetadata?: boolean | undefined;
236
+ legacyStitches?: boolean | undefined;
237
+ trackers?: ({
238
+ provider: "ga4";
239
+ id: string;
240
+ } | {
241
+ provider: "gtm";
242
+ id: string;
243
+ })[] | undefined;
234
244
  cache?: Record<string, {
245
+ serverless?: {
246
+ isr?: boolean | undefined;
247
+ dataCache?: "in-memory" | "kv" | "none" | undefined;
248
+ } | undefined;
235
249
  wordpress?: {
236
250
  strategy: "always" | "ssr-always-fresh";
237
251
  cacheHeaders?: boolean | undefined;
238
252
  transients?: boolean | undefined;
239
253
  } | undefined;
240
- serverless?: {
241
- isr?: boolean | undefined;
242
- dataCache?: "none" | "in-memory" | "kv" | undefined;
243
- } | undefined;
244
254
  pageDataTTL?: number | undefined;
245
255
  appDataTTL?: number | undefined;
246
256
  queryHooksTTL?: number | undefined;
247
257
  }> | undefined;
248
- $schema?: string | undefined;
249
- legacyMetadata?: boolean | undefined;
250
- legacyStitches?: boolean | undefined;
251
- trackers?: ({
252
- id: string;
253
- provider: "ga4";
254
- } | {
255
- id: string;
256
- provider: "gtm";
257
- })[] | undefined;
258
- devUI?: "disabled" | "enabled" | undefined;
258
+ devUI?: "enabled" | "disabled" | undefined;
259
259
  }>;
260
260
  export type EDConfig = z.infer<typeof EDConfigSchema>;
261
261
  export declare class Configurator {
@@ -85,7 +85,7 @@ export const EDConfigSchema = z.object({
85
85
  .describe("A list of common origins, to be shared amoungst all directives. Items should be things like 'hubspot.com' or '*.hubspot.com'")
86
86
  .optional(),
87
87
  values: z
88
- .record(z.string())
88
+ .record(z.string().array())
89
89
  .optional()
90
90
  .describe("A map of CSP directives to their values. Keys should be camelCase."),
91
91
  })
@@ -35,24 +35,24 @@ export declare const BlockMetaSchema: z.ZodObject<{
35
35
  frontendMode: z.ZodDefault<z.ZodEnum<["hidden", "childrenOnly", "default"]>>;
36
36
  inserter: z.ZodDefault<z.ZodBoolean>;
37
37
  }, "strip", z.ZodTypeAny, {
38
- title: string;
39
- mode: "both" | "edit" | "preview";
40
- slug: string;
41
- tags: string[];
42
- flags: Record<string, any>;
43
- category: string;
38
+ cache: boolean;
44
39
  acfName: string;
45
40
  fileName: string;
41
+ slug: string;
46
42
  graphqlFieldName: string;
43
+ title: string;
44
+ category: string;
47
45
  types: string[];
46
+ mode: "preview" | "edit" | "both";
47
+ tags: string[];
48
+ flags: Record<string, any>;
48
49
  childTags: string[];
49
50
  childBlocks: string[];
50
51
  parent: string[];
51
52
  ancestors: string[];
52
53
  dynamic: boolean;
53
- cache: boolean;
54
54
  allowMultiple: boolean;
55
- frontendMode: "hidden" | "default" | "childrenOnly";
55
+ frontendMode: "default" | "hidden" | "childrenOnly";
56
56
  inserter: boolean;
57
57
  description?: string | undefined;
58
58
  icon?: string | undefined;
@@ -63,32 +63,32 @@ export declare const BlockMetaSchema: z.ZodObject<{
63
63
  fieldName: string;
64
64
  } | undefined;
65
65
  }, {
66
- title: string;
67
- slug: string;
68
66
  acfName: string;
69
67
  fileName: string;
68
+ slug: string;
70
69
  graphqlFieldName: string;
70
+ title: string;
71
71
  types: string[];
72
- mode?: "both" | "edit" | "preview" | undefined;
73
- tags?: string[] | undefined;
74
- flags?: Record<string, any> | undefined;
72
+ cache?: boolean | undefined;
75
73
  description?: string | undefined;
76
- icon?: string | undefined;
77
74
  category?: string | undefined;
75
+ icon?: string | undefined;
78
76
  keywords?: string[] | undefined;
79
77
  templates?: string[] | null | undefined;
78
+ mode?: "preview" | "edit" | "both" | undefined;
79
+ tags?: string[] | undefined;
80
+ flags?: Record<string, any> | undefined;
80
81
  childTags?: string[] | undefined;
81
82
  childBlocks?: string[] | undefined;
82
83
  parent?: string[] | undefined;
83
84
  ancestors?: string[] | undefined;
84
85
  dynamic?: boolean | undefined;
85
- cache?: boolean | undefined;
86
86
  allowMultiple?: boolean | undefined;
87
87
  postMetaBlock?: {
88
88
  postTypes: string[];
89
89
  fieldName: string;
90
90
  } | undefined;
91
- frontendMode?: "hidden" | "default" | "childrenOnly" | undefined;
91
+ frontendMode?: "default" | "hidden" | "childrenOnly" | undefined;
92
92
  inserter?: boolean | undefined;
93
93
  }>;
94
94
  export type BlockMetadata = z.infer<typeof BlockMetaSchema>;
@@ -9,21 +9,21 @@ export declare const ViewMetaSchema: z.ZodObject<{
9
9
  routePattern: z.ZodOptional<z.ZodString>;
10
10
  postType: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
11
11
  }, "strip", z.ZodTypeAny, {
12
- title: string;
13
- slug: string;
14
- fileName: string;
15
12
  cache: boolean;
13
+ fileName: string;
14
+ slug: string;
15
+ title: string;
16
16
  isCustomTemplate: boolean;
17
- postType?: string[] | undefined;
18
17
  routePattern?: string | undefined;
18
+ postType?: string[] | undefined;
19
19
  }, {
20
- title: string;
21
- slug: string;
22
20
  fileName: string;
23
- postType?: string[] | undefined;
21
+ slug: string;
22
+ title: string;
24
23
  cache?: boolean | undefined;
25
24
  isCustomTemplate?: boolean | undefined;
26
25
  routePattern?: string | undefined;
26
+ postType?: string[] | undefined;
27
27
  }>;
28
28
  export type ViewMetadata = z.infer<typeof ViewMetaSchema>;
29
29
  export type ViewMetadataConstructor = z.input<typeof ViewMetaSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "2.0.0-beta.144",
3
+ "version": "2.0.0-beta.145",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",