@enonic-types/core 8.0.4 → 8.1.0-B2

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.
Files changed (2) hide show
  1. package/index.d.ts +21 -3
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -16,19 +16,21 @@ declare global {
16
16
  type XpMixin = Record<string, Record<string, Record<string, unknown>>>;
17
17
  }
18
18
 
19
+ export type AppConfig = Readonly<Record<string, string | undefined>>;
20
+
19
21
  export interface App {
20
22
  /**
21
23
  * The name of the application.
22
24
  *
23
25
  * @type string
24
26
  */
25
- name: string;
27
+ readonly name: string;
26
28
  /**
27
29
  * Version of the application.
28
30
  *
29
31
  * @type string
30
32
  */
31
- version: string;
33
+ readonly version: string;
32
34
  /**
33
35
  * Values from the application’s configuration file.
34
36
  * This can be set using $XP_HOME/config/<app.name>.cfg.
@@ -36,7 +38,7 @@ export interface App {
36
38
  *
37
39
  * @type Object
38
40
  */
39
- config: Record<string, string | undefined>;
41
+ readonly config: AppConfig;
40
42
  }
41
43
 
42
44
  export interface DoubleUnderscore {
@@ -278,6 +280,13 @@ export interface DefaultRequestHeaders
278
280
  export interface RequestConstructorParams {
279
281
  body?: string;
280
282
  branch?: LiteralUnion<RequestBranch>;
283
+ /**
284
+ * Path of the content being rendered. Set by the site service.
285
+ *
286
+ * Assigning it in a site mapping filter, on the request passed to `next`, re-routes rendering to
287
+ * that content: the requested URL is unchanged, but content, site and context path are re-resolved.
288
+ */
289
+ contentPath?: string;
281
290
  contentType?: string;
282
291
  contextPath?: string;
283
292
  cookies: RequestCookies;
@@ -834,6 +843,15 @@ export type ByteSource = Brand<object, 'ByteSource'>;
834
843
  export interface Resource {
835
844
  getSize(): number;
836
845
 
846
+ /**
847
+ * @deprecated Not a dependable measure of when a resource last changed. A resource served from an
848
+ * application bundle reports the time recorded in its jar entry, and build tools normalize that value
849
+ * to a constant so that builds are reproducible — Gradle does so by default as of version 9. Two
850
+ * different builds of an application therefore report identical timestamps, making the value a
851
+ * property of the build rather than of the file. Only resources backed by a repository node carry a
852
+ * genuine modification time; for file-backed resources the value is meaningful in development mode
853
+ * alone.
854
+ */
837
855
  getTimestamp(): number;
838
856
 
839
857
  getStream(): ByteSource;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic-types/core",
3
- "version": "8.0.4",
3
+ "version": "8.1.0-B2",
4
4
  "description": "Shared type definition for core libraries.",
5
5
  "types": "index.d.ts",
6
6
  "files": [