@equinor/fusion-framework-module-app 8.0.3 → 8.0.5

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.
@@ -43,6 +43,7 @@ export interface IAppConfigurator {
43
43
  * via service discovery. The default `assetUri` is `'/apps-proxy'`.
44
44
  */
45
45
  export declare class AppConfigurator extends BaseConfigBuilder<AppModuleConfig> implements IAppConfigurator {
46
+ /** Default cache expiration time, in milliseconds, for the app service client. */
46
47
  defaultExpireTime: number;
47
48
  /**
48
49
  * Creates the default HTTP client for the app service, preferring a pre-configured
@@ -289,6 +289,7 @@ export declare class App<TEnv extends ConfigEnvironment = ConfigEnvironment, TMo
289
289
  getAppModule(force_refresh?: boolean): Observable<AppScriptModule>;
290
290
  /** @inheritdoc */
291
291
  getAppModuleAsync(allow_cache?: boolean): Promise<AppScriptModule>;
292
+ /** Releases resources held by this app instance. */
292
293
  dispose: VoidFunction;
293
294
  }
294
295
  export default App;
@@ -18,6 +18,22 @@ export declare const ApiAppConfigSchema: z.ZodObject<{
18
18
  }, z.core.$strip>>>;
19
19
  }, z.core.$strip>;
20
20
  export type ApiAppConfig = z.infer<typeof ApiAppConfigSchema>;
21
+ /**
22
+ * Schema for validating the options object on application builds.
23
+ *
24
+ * Known properties:
25
+ * - `contextRouting` (optional): Routing strategy for context — `'path'` or `'query'`.
26
+ *
27
+ * The schema uses `.catchall(z.unknown())` to permit additional properties
28
+ * at runtime without requiring them to be declared here. Add known properties
29
+ * to this schema as they are introduced.
30
+ */
31
+ export declare const FrameworkOptionsSchema: z.ZodObject<{
32
+ contextRouting: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
33
+ path: "path";
34
+ query: "query";
35
+ }>>>;
36
+ }, z.core.$catchall<z.ZodUnknown>>;
21
37
  /**
22
38
  * Schema for validating the structure of an API application build.
23
39
  *
@@ -33,6 +49,7 @@ export type ApiAppConfig = z.infer<typeof ApiAppConfigSchema>;
33
49
  * - `githubRepo`: An optional GitHub repository associated with the build.
34
50
  * - `projectPage`: An optional project page URL.
35
51
  * - `allowedExtensions`: An optional array of allowed extensions for the build.
52
+ * - `options`: An optional record of additional build options, where the key is a string and the value can be of any type.
36
53
  * - `uploadedBy`: An optional schema for the person who uploaded the build.
37
54
  */
38
55
  export declare const ApiApplicationBuildSchema: z.ZodObject<{
@@ -46,6 +63,12 @@ export declare const ApiApplicationBuildSchema: z.ZodObject<{
46
63
  commitSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
47
64
  githubRepo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
48
65
  projectPage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
66
+ options: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
67
+ contextRouting: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
68
+ path: "path";
69
+ query: "query";
70
+ }>>>;
71
+ }, z.core.$catchall<z.ZodUnknown>>>>>;
49
72
  allowedExtensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
50
73
  uploadedBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
51
74
  azureUniqueId: z.ZodString;
@@ -133,6 +156,12 @@ export declare const ApiApplicationSchema: z.ZodObject<{
133
156
  commitSha: z.ZodOptional<z.ZodNullable<z.ZodString>>;
134
157
  githubRepo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
135
158
  projectPage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
159
+ options: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
160
+ contextRouting: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
161
+ path: "path";
162
+ query: "query";
163
+ }>>>;
164
+ }, z.core.$catchall<z.ZodUnknown>>>>>;
136
165
  allowedExtensions: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
137
166
  uploadedBy: z.ZodOptional<z.ZodNullable<z.ZodObject<{
138
167
  azureUniqueId: z.ZodString;
@@ -93,6 +93,36 @@ export type RouteSchemaEntry = [
93
93
  search?: Record<string, string>;
94
94
  }
95
95
  ];
96
+ /**
97
+ * Typed representation of the options object.
98
+ *
99
+ * Only known keys are declared in the type — additional properties are
100
+ * handled by the Zod schema at runtime. Keeping the type narrow avoids
101
+ * structural incompatibilities with `RecursivePartial<AppManifest>`.
102
+ */
103
+ export type FrameworkOptions = {
104
+ /**
105
+ * Declares how the portal should encode this app's active context into the URL.
106
+ *
107
+ * Read by the `@equinor/fusion-framework-plugin-context-navigation` plugin
108
+ * to select the correct adapter at runtime.
109
+ *
110
+ * - `'path'` — context id as a path segment: `/apps/{appKey}/{contextId}/...`
111
+ * - `'query'` — context id as a query parameter: `/apps/{appKey}/...?$contextId={id}`
112
+ * - `null` — explicitly opt out of automatic context-to-URL encoding
113
+ * - `undefined` (omitted) — falls back to `'path'` (the default adapter)
114
+ *
115
+ * Apps with custom URL shapes should omit this field and register
116
+ * `setContextPathExtractor` / `setContextPathGenerator` hooks instead —
117
+ * the custom adapter picks those up automatically.
118
+ *
119
+ * Set this in the app manifest's `build.options.contextRouting` field,
120
+ * either in `app.manifest.config.ts` or via the app service manifest.
121
+ *
122
+ * @default undefined (falls back to path adapter)
123
+ */
124
+ contextRouting?: 'path' | 'query' | null;
125
+ };
96
126
  /**
97
127
  * Build metadata returned by the app service for a specific application version.
98
128
  * Contains the script entry point, asset path, tags, and optional CI metadata.
@@ -109,6 +139,7 @@ export type AppBuildManifest = {
109
139
  githubRepo?: Nullable<string>;
110
140
  projectPage?: Nullable<string>;
111
141
  annotations?: Nullable<Record<string, string>>;
142
+ options?: Nullable<FrameworkOptions>;
112
143
  allowedExtensions?: Nullable<string[]>;
113
144
  uploadedBy?: Nullable<AppOwner>;
114
145
  };
@@ -1 +1 @@
1
- export declare const version = "8.0.3";
1
+ export declare const version = "8.0.5";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-module-app",
3
- "version": "8.0.3",
3
+ "version": "8.0.5",
4
4
  "description": "",
5
5
  "main": "dist/esm/index.js",
6
6
  "exports": {
@@ -62,13 +62,13 @@
62
62
  "uuid": "^14.0.0",
63
63
  "zod": "^4.4.3",
64
64
  "@equinor/fusion-observable": "^9.1.1",
65
- "@equinor/fusion-query": "^7.0.2"
65
+ "@equinor/fusion-query": "^7.0.3"
66
66
  },
67
67
  "devDependencies": {
68
68
  "typescript": "^7.0.2",
69
- "@equinor/fusion-framework-module": "^6.1.1",
69
+ "@equinor/fusion-framework-module": "^6.1.2",
70
70
  "@equinor/fusion-framework-module-event": "^6.0.1",
71
- "@equinor/fusion-framework-module-http": "^8.0.4",
71
+ "@equinor/fusion-framework-module-http": "^8.0.5",
72
72
  "@equinor/fusion-framework-module-msal": "^10.0.2",
73
73
  "@equinor/fusion-framework-module-service-discovery": "^10.0.2"
74
74
  },
@@ -59,6 +59,7 @@ export class AppConfigurator
59
59
  extends BaseConfigBuilder<AppModuleConfig>
60
60
  implements IAppConfigurator
61
61
  {
62
+ /** Default cache expiration time, in milliseconds, for the app service client. */
62
63
  defaultExpireTime = 1 * 60 * 1000;
63
64
 
64
65
  /**
package/src/app/App.ts CHANGED
@@ -977,6 +977,7 @@ export class App<
977
977
  return operator(this.getAppModule(!allow_cache));
978
978
  }
979
979
 
980
+ /** Releases resources held by this app instance. */
980
981
  public dispose: VoidFunction;
981
982
  }
982
983
 
package/src/schemas.ts CHANGED
@@ -60,6 +60,28 @@ const ApiApplicationPersonSchema = z.object({
60
60
  .nullish(),
61
61
  });
62
62
 
63
+ /**
64
+ * Schema for validating the options object on application builds.
65
+ *
66
+ * Known properties:
67
+ * - `contextRouting` (optional): Routing strategy for context — `'path'` or `'query'`.
68
+ *
69
+ * The schema uses `.catchall(z.unknown())` to permit additional properties
70
+ * at runtime without requiring them to be declared here. Add known properties
71
+ * to this schema as they are introduced.
72
+ */
73
+ // Deliberately co-located with ApiApplicationBuildSchema, which depends on it
74
+ // fusion-lint-disable-next-line single-export-per-file
75
+ export const FrameworkOptionsSchema = z
76
+ .object({
77
+ contextRouting: z
78
+ .enum(['path', 'query'], {
79
+ message: "The routing strategy for context, which can be either 'path' or 'query'.",
80
+ })
81
+ .nullish(),
82
+ })
83
+ .catchall(z.unknown());
84
+
63
85
  /**
64
86
  * Schema for validating the structure of an API application build.
65
87
  *
@@ -75,6 +97,7 @@ const ApiApplicationPersonSchema = z.object({
75
97
  * - `githubRepo`: An optional GitHub repository associated with the build.
76
98
  * - `projectPage`: An optional project page URL.
77
99
  * - `allowedExtensions`: An optional array of allowed extensions for the build.
100
+ * - `options`: An optional record of additional build options, where the key is a string and the value can be of any type.
78
101
  * - `uploadedBy`: An optional schema for the person who uploaded the build.
79
102
  */
80
103
  // Deliberately co-located with ApiApplicationPersonSchema, which it depends on
@@ -90,6 +113,9 @@ export const ApiApplicationBuildSchema = z.object({
90
113
  commitSha: z.string().nullish(),
91
114
  githubRepo: z.string().nullish(),
92
115
  projectPage: z.string().nullish(),
116
+ options: FrameworkOptionsSchema.nullish().default({
117
+ contextRouting: 'path',
118
+ }),
93
119
  allowedExtensions: z.array(z.string()).nullish(),
94
120
  uploadedBy: ApiApplicationPersonSchema.nullish(),
95
121
  });
package/src/types.ts CHANGED
@@ -117,6 +117,37 @@ export type RouteSchemaEntry = [
117
117
  },
118
118
  ];
119
119
 
120
+ /**
121
+ * Typed representation of the options object.
122
+ *
123
+ * Only known keys are declared in the type — additional properties are
124
+ * handled by the Zod schema at runtime. Keeping the type narrow avoids
125
+ * structural incompatibilities with `RecursivePartial<AppManifest>`.
126
+ */
127
+ export type FrameworkOptions = {
128
+ /**
129
+ * Declares how the portal should encode this app's active context into the URL.
130
+ *
131
+ * Read by the `@equinor/fusion-framework-plugin-context-navigation` plugin
132
+ * to select the correct adapter at runtime.
133
+ *
134
+ * - `'path'` — context id as a path segment: `/apps/{appKey}/{contextId}/...`
135
+ * - `'query'` — context id as a query parameter: `/apps/{appKey}/...?$contextId={id}`
136
+ * - `null` — explicitly opt out of automatic context-to-URL encoding
137
+ * - `undefined` (omitted) — falls back to `'path'` (the default adapter)
138
+ *
139
+ * Apps with custom URL shapes should omit this field and register
140
+ * `setContextPathExtractor` / `setContextPathGenerator` hooks instead —
141
+ * the custom adapter picks those up automatically.
142
+ *
143
+ * Set this in the app manifest's `build.options.contextRouting` field,
144
+ * either in `app.manifest.config.ts` or via the app service manifest.
145
+ *
146
+ * @default undefined (falls back to path adapter)
147
+ */
148
+ contextRouting?: 'path' | 'query' | null;
149
+ };
150
+
120
151
  /**
121
152
  * Build metadata returned by the app service for a specific application version.
122
153
  * Contains the script entry point, asset path, tags, and optional CI metadata.
@@ -133,6 +164,7 @@ export type AppBuildManifest = {
133
164
  githubRepo?: Nullable<string>;
134
165
  projectPage?: Nullable<string>;
135
166
  annotations?: Nullable<Record<string, string>>;
167
+ options?: Nullable<FrameworkOptions>;
136
168
  allowedExtensions?: Nullable<string[]>;
137
169
  uploadedBy?: Nullable<AppOwner>;
138
170
  };
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '8.0.3';
2
+ export const version = '8.0.5';