@equinor/fusion-framework-module-app
Advanced tools
Comparing version 5.2.1 to 5.2.3
# Change Log | ||
## 5.2.3 | ||
### Patch Changes | ||
- Updated dependencies [[`05accaaa`](https://github.com/equinor/fusion-framework/commit/05accaaa72085b07483008fac822dd5e7c56a8b9)]: | ||
- @equinor/fusion-query@3.0.6 | ||
## 5.2.2 | ||
### Patch Changes | ||
- [#1109](https://github.com/equinor/fusion-framework/pull/1109) [`7ec195d4`](https://github.com/equinor/fusion-framework/commit/7ec195d42098fec8794db13e83b71ef7753ff862) Thanks [@odinr](https://github.com/odinr)! - Change packaged manager from yarn to pnpm | ||
conflicts of `@types/react` made random outcomes when using `yarn` | ||
this change should not affect consumer of the packages, but might conflict dependent on local package manager. | ||
- [#1145](https://github.com/equinor/fusion-framework/pull/1145) [`d276fc5d`](https://github.com/equinor/fusion-framework/commit/d276fc5d514566d05c64705076a1cb91c6a44272) Thanks [@dependabot](https://github.com/apps/dependabot)! - build(deps): bump rxjs from 7.5.7 to [7.8.1](https://github.com/ReactiveX/rxjs/blob/7.8.1/CHANGELOG.md) | ||
- Updated dependencies [[`7ec195d4`](https://github.com/equinor/fusion-framework/commit/7ec195d42098fec8794db13e83b71ef7753ff862), [`8e7ae77c`](https://github.com/equinor/fusion-framework/commit/8e7ae77cfcadddc4b59e6bb57e620b84e5e1c647), [`8e7ae77c`](https://github.com/equinor/fusion-framework/commit/8e7ae77cfcadddc4b59e6bb57e620b84e5e1c647), [`8e7ae77c`](https://github.com/equinor/fusion-framework/commit/8e7ae77cfcadddc4b59e6bb57e620b84e5e1c647), [`2dccccd1`](https://github.com/equinor/fusion-framework/commit/2dccccd124fbe3cdde2132c29c27d3da9fc6f1f5), [`8e7ae77c`](https://github.com/equinor/fusion-framework/commit/8e7ae77cfcadddc4b59e6bb57e620b84e5e1c647), [`d276fc5d`](https://github.com/equinor/fusion-framework/commit/d276fc5d514566d05c64705076a1cb91c6a44272)]: | ||
- @equinor/fusion-observable@8.1.0 | ||
- @equinor/fusion-query@3.0.5 | ||
## 5.2.1 | ||
@@ -4,0 +27,0 @@ |
import type { Flow } from '@equinor/fusion-observable'; | ||
import type { AppModuleProvider } from '../AppModuleProvider'; | ||
import type { Actions } from './actions'; | ||
import { AppBundleState } from './types'; | ||
import type { AppBundleState } from './types'; | ||
export declare const handleFetchManifest: (provider: AppModuleProvider) => Flow<Actions, AppBundleState>; | ||
export declare const handleFetchConfig: (provider: AppModuleProvider) => Flow<Actions, AppBundleState>; | ||
export declare const handleImportApplication: () => Flow<Actions, AppBundleState>; |
@@ -1,5 +0,5 @@ | ||
import { ModuleInitializerArgs } from '@equinor/fusion-framework-module'; | ||
import { HttpModule, IHttpClient } from '@equinor/fusion-framework-module-http'; | ||
import { ServiceDiscoveryModule } from '@equinor/fusion-framework-module-service-discovery'; | ||
import { QueryCtorOptions } from '@equinor/fusion-query'; | ||
import type { ModuleInitializerArgs } from '@equinor/fusion-framework-module'; | ||
import type { HttpModule, IHttpClient } from '@equinor/fusion-framework-module-http'; | ||
import type { ServiceDiscoveryModule } from '@equinor/fusion-framework-module-service-discovery'; | ||
import type { QueryCtorOptions } from '@equinor/fusion-query'; | ||
import { AppConfigBuilderCallback } from './AppConfigBuilder'; | ||
@@ -6,0 +6,0 @@ import type { AppConfig, AppManifest } from './types'; |
import { AnyModule, CombinedModules, ModulesInstance } from '@equinor/fusion-framework-module'; | ||
import type { EventModule } from '@equinor/fusion-framework-module-event'; | ||
import type { HttpModule } from '@equinor/fusion-framework-module-http'; | ||
import { MsalModule } from '@equinor/fusion-framework-module-msal'; | ||
import type { MsalModule } from '@equinor/fusion-framework-module-msal'; | ||
import type { ServiceDiscoveryModule } from '@equinor/fusion-framework-module-service-discovery'; | ||
@@ -6,0 +6,0 @@ import IApp from './app'; |
{ | ||
"name": "@equinor/fusion-framework-module-app", | ||
"version": "5.2.1", | ||
"description": "", | ||
"main": "dist/esm/index.js", | ||
"exports": { | ||
".": "./dist/esm/index.js", | ||
"./errors.js": "./dist/esm/errors.js", | ||
"./app": "./dist/esm/app/index.js" | ||
}, | ||
"types": "dist/types/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"errors.js": [ | ||
"dist/types/errors.d.ts" | ||
], | ||
"app": [ | ||
"dist/types/app/index.d.ts" | ||
] | ||
} | ||
}, | ||
"scripts": { | ||
"build": "tsc -b", | ||
"prepack": "yarn build" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/equinor/fusion-framework.git", | ||
"directory": "packages/modules/app" | ||
}, | ||
"dependencies": { | ||
"@equinor/fusion-query": "^3.0.2", | ||
"rxjs": "^7.5.7" | ||
}, | ||
"devDependencies": { | ||
"@equinor/fusion-framework-module": "^4.2.1", | ||
"@equinor/fusion-framework-module-event": "^4.0.2", | ||
"@equinor/fusion-framework-module-http": "^5.0.4", | ||
"@equinor/fusion-framework-module-service-discovery": "^7.0.5", | ||
"typescript": "^5.1.3" | ||
"name": "@equinor/fusion-framework-module-app", | ||
"version": "5.2.3", | ||
"description": "", | ||
"main": "dist/esm/index.js", | ||
"exports": { | ||
".": "./dist/esm/index.js", | ||
"./errors.js": "./dist/esm/errors.js", | ||
"./app": "./dist/esm/app/index.js" | ||
}, | ||
"types": "dist/types/index.d.ts", | ||
"typesVersions": { | ||
"*": { | ||
"errors.js": [ | ||
"dist/types/errors.d.ts" | ||
], | ||
"app": [ | ||
"dist/types/app/index.d.ts" | ||
] | ||
} | ||
} | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/equinor/fusion-framework.git", | ||
"directory": "packages/modules/app" | ||
}, | ||
"dependencies": { | ||
"immer": "^9.0.16", | ||
"rxjs": "^7.8.1", | ||
"@equinor/fusion-observable": "^8.1.0", | ||
"@equinor/fusion-query": "^3.0.6" | ||
}, | ||
"devDependencies": { | ||
"typescript": "^5.1.3", | ||
"@equinor/fusion-framework-module": "^4.2.3", | ||
"@equinor/fusion-framework-module-event": "^4.0.4", | ||
"@equinor/fusion-framework-module-http": "^5.0.5", | ||
"@equinor/fusion-framework-module-msal": "^3.0.5", | ||
"@equinor/fusion-framework-module-service-discovery": "^7.0.7" | ||
}, | ||
"scripts": { | ||
"build": "tsc -b" | ||
} | ||
} |
@@ -24,3 +24,3 @@ import { | ||
(manifest: AppManifest) => ({ payload: manifest }), | ||
(error: unknown) => ({ payload: error }) | ||
(error: unknown) => ({ payload: error }), | ||
), | ||
@@ -33,3 +33,3 @@ /** Config loading */ | ||
(config: AppConfig) => ({ payload: config }), | ||
(error: unknown) => ({ payload: error }) | ||
(error: unknown) => ({ payload: error }), | ||
), | ||
@@ -43,3 +43,3 @@ /** App loading */ | ||
(module: AppScriptModule) => ({ payload: module }), | ||
(error: unknown) => ({ payload: error }) | ||
(error: unknown) => ({ payload: error }), | ||
), | ||
@@ -56,3 +56,3 @@ | ||
() => ({ payload: null }), | ||
(error: unknown) => ({ payload: error }) | ||
(error: unknown) => ({ payload: error }), | ||
), | ||
@@ -59,0 +59,0 @@ }); |
@@ -76,3 +76,3 @@ import { AppConfig, AppManifest, AppModulesInstance, AppScriptModule } from '../types'; | ||
map(({ manifest }) => manifest), | ||
filterEmpty() | ||
filterEmpty(), | ||
); | ||
@@ -84,3 +84,3 @@ } | ||
map(({ config }) => config), | ||
filterEmpty() | ||
filterEmpty(), | ||
); | ||
@@ -92,3 +92,3 @@ } | ||
map(({ modules }) => modules), | ||
filterEmpty() | ||
filterEmpty(), | ||
); | ||
@@ -100,3 +100,3 @@ } | ||
map(({ instance }) => instance as AppModulesInstance<TModules>), | ||
filterEmpty() | ||
filterEmpty(), | ||
); | ||
@@ -141,3 +141,3 @@ } | ||
event?: ModuleType<EventModule>; | ||
} | ||
}, | ||
) { | ||
@@ -161,3 +161,3 @@ this.#state = createState(value, args.provider); | ||
} | ||
}) | ||
}), | ||
); | ||
@@ -262,3 +262,3 @@ } | ||
}, | ||
}) | ||
}), | ||
); | ||
@@ -296,3 +296,3 @@ }); | ||
subscriber.next(payload); | ||
}) | ||
}), | ||
); | ||
@@ -303,3 +303,3 @@ subscriber.add( | ||
subscriber.complete(); | ||
}) | ||
}), | ||
); | ||
@@ -311,5 +311,5 @@ subscriber.add( | ||
cause: payload, | ||
}) | ||
}), | ||
); | ||
}) | ||
}), | ||
); | ||
@@ -337,3 +337,3 @@ | ||
subscriber.next(payload); | ||
}) | ||
}), | ||
); | ||
@@ -344,3 +344,3 @@ subscriber.add( | ||
subscriber.complete(); | ||
}) | ||
}), | ||
); | ||
@@ -352,5 +352,5 @@ subscriber.add( | ||
cause: payload, | ||
}) | ||
}), | ||
); | ||
}) | ||
}), | ||
); | ||
@@ -378,3 +378,3 @@ | ||
subscriber.next(payload); | ||
}) | ||
}), | ||
); | ||
@@ -385,3 +385,3 @@ subscriber.add( | ||
subscriber.complete(); | ||
}) | ||
}), | ||
); | ||
@@ -393,5 +393,5 @@ subscriber.add( | ||
cause: payload, | ||
}) | ||
}), | ||
); | ||
}) | ||
}), | ||
); | ||
@@ -401,4 +401,4 @@ | ||
this.getManifest().subscribe((manifest) => | ||
of(this.#state.next(actions.importApp(manifest.entry))) | ||
) | ||
of(this.#state.next(actions.importApp(manifest.entry))), | ||
), | ||
); | ||
@@ -405,0 +405,0 @@ }); |
@@ -42,5 +42,5 @@ import { | ||
state.status.delete(actionBaseType(action)); | ||
}) | ||
}), | ||
); | ||
export default createReducer; |
@@ -13,3 +13,3 @@ import { FlowSubject } from '@equinor/fusion-observable'; | ||
value: AppBundleStateInitial, | ||
provider: AppModuleProvider | ||
provider: AppModuleProvider, | ||
): FlowSubject<AppBundleState, Actions> => { | ||
@@ -16,0 +16,0 @@ const reducer = createReducer(value); |
@@ -9,3 +9,3 @@ import { from, of, merge } from 'rxjs'; | ||
import type { Actions } from './actions'; | ||
import { AppBundleState } from './types'; | ||
import type { AppBundleState } from './types'; | ||
@@ -20,3 +20,3 @@ export const handleFetchManifest = | ||
filter((x) => !!x), | ||
map((manifest) => actions.setManifest(manifest, update)) | ||
map((manifest) => actions.setManifest(manifest, update)), | ||
); | ||
@@ -27,10 +27,10 @@ return merge( | ||
last(), | ||
map(({ payload }) => actions.fetchManifest.success(payload)) | ||
) | ||
map(({ payload }) => actions.fetchManifest.success(payload)), | ||
), | ||
).pipe( | ||
catchError((err) => { | ||
return of(actions.fetchManifest.failure(err)); | ||
}) | ||
}), | ||
); | ||
}) | ||
}), | ||
); | ||
@@ -49,6 +49,6 @@ | ||
last(), | ||
map(({ payload }) => actions.fetchConfig.success(payload)) | ||
) | ||
map(({ payload }) => actions.fetchConfig.success(payload)), | ||
), | ||
).pipe(catchError((err) => of(actions.fetchConfig.failure(err)))); | ||
}) | ||
}), | ||
); | ||
@@ -62,5 +62,5 @@ | ||
map(actions.importApp.success), | ||
catchError((err) => of(actions.importApp.failure(err))) | ||
catchError((err) => of(actions.importApp.failure(err))), | ||
); | ||
}) | ||
}), | ||
); |
@@ -10,3 +10,3 @@ import { ModuleInitializerArgs, Modules, ModuleType } from '@equinor/fusion-framework-module'; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
builder: AppConfigBuilder<ModuleInitializerArgs<IAppConfigurator, any>> | ||
builder: AppConfigBuilder<ModuleInitializerArgs<IAppConfigurator, any>>, | ||
) => void | Promise<void>; | ||
@@ -19,6 +19,9 @@ | ||
ModuleDeps | ||
> | ||
>, | ||
> { | ||
#init: TInit; | ||
constructor(init: TInit, public config: Partial<AppModuleConfig> = {}) { | ||
constructor( | ||
init: TInit, | ||
public config: Partial<AppModuleConfig> = {}, | ||
) { | ||
this.#init = init; | ||
@@ -28,3 +31,3 @@ } | ||
requireInstance<TKey extends string = Extract<keyof Modules, string>>( | ||
module: TKey | ||
module: TKey, | ||
): Promise<ModuleType<Modules[TKey]>>; | ||
@@ -49,3 +52,3 @@ | ||
}, | ||
expire = 1 * 60 * 1000 | ||
expire = 1 * 60 * 1000, | ||
) { | ||
@@ -52,0 +55,0 @@ client; |
@@ -1,5 +0,5 @@ | ||
import { ModuleInitializerArgs } from '@equinor/fusion-framework-module'; | ||
import { HttpModule, IHttpClient } from '@equinor/fusion-framework-module-http'; | ||
import { ServiceDiscoveryModule } from '@equinor/fusion-framework-module-service-discovery'; | ||
import { QueryCtorOptions } from '@equinor/fusion-query'; | ||
import type { ModuleInitializerArgs } from '@equinor/fusion-framework-module'; | ||
import type { HttpModule, IHttpClient } from '@equinor/fusion-framework-module-http'; | ||
import type { ServiceDiscoveryModule } from '@equinor/fusion-framework-module-service-discovery'; | ||
import type { QueryCtorOptions } from '@equinor/fusion-query'; | ||
@@ -37,3 +37,3 @@ import { AppConfigBuilder, AppConfigBuilderCallback } from './AppConfigBuilder'; | ||
protected async _createHttpClient( | ||
init: ModuleInitializerArgs<IAppConfigurator, [HttpModule, ServiceDiscoveryModule]> | ||
init: ModuleInitializerArgs<IAppConfigurator, [HttpModule, ServiceDiscoveryModule]>, | ||
): Promise<IHttpClient> { | ||
@@ -59,10 +59,13 @@ const http = await init.requireInstance('http'); | ||
public async createConfig( | ||
init: ModuleInitializerArgs<IAppConfigurator, [HttpModule, ServiceDiscoveryModule]> | ||
init: ModuleInitializerArgs<IAppConfigurator, [HttpModule, ServiceDiscoveryModule]>, | ||
): Promise<AppModuleConfig> { | ||
const config = await this.#configBuilders.reduce(async (cur, cb) => { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const builder = new AppConfigBuilder(init, await cur); | ||
await Promise.resolve(cb(builder)); | ||
return Object.assign(cur, builder.config); | ||
}, Promise.resolve({} as Partial<AppModuleConfig>)); | ||
const config = await this.#configBuilders.reduce( | ||
async (cur, cb) => { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const builder = new AppConfigBuilder(init, await cur); | ||
await Promise.resolve(cb(builder)); | ||
return Object.assign(cur, builder.config); | ||
}, | ||
Promise.resolve({} as Partial<AppModuleConfig>), | ||
); | ||
@@ -92,3 +95,3 @@ // TODO - make less lazy | ||
httpClient.json$( | ||
`/api/apps/${appKey}/config${tag ? `?tag=${tag}` : ''}` | ||
`/api/apps/${appKey}/config${tag ? `?tag=${tag}` : ''}`, | ||
), | ||
@@ -95,0 +98,0 @@ }, |
@@ -56,3 +56,3 @@ import { | ||
return prev === next; | ||
}) | ||
}), | ||
); | ||
@@ -79,3 +79,3 @@ } | ||
pairwise(), | ||
takeWhile(() => !!event) | ||
takeWhile(() => !!event), | ||
) | ||
@@ -87,3 +87,3 @@ .subscribe(([previous, next]) => { | ||
}); | ||
}) | ||
}), | ||
); | ||
@@ -96,5 +96,5 @@ | ||
map(([previous]) => previous), | ||
filterEmpty() | ||
filterEmpty(), | ||
) | ||
.subscribe((app) => app.dispose()) | ||
.subscribe((app) => app.dispose()), | ||
); | ||
@@ -120,4 +120,4 @@ } | ||
throw new AppManifestError('unknown', 'failed to load manifest', { cause }); | ||
}) | ||
) | ||
}), | ||
), | ||
); | ||
@@ -139,3 +139,3 @@ } | ||
appKey: string, | ||
tag?: string | ||
tag?: string, | ||
): Observable<AppConfig<TType>> { | ||
@@ -154,4 +154,4 @@ return Query.extractQueryValue( | ||
throw new AppConfigError('unknown', 'failed to load config', { cause }); | ||
}) | ||
) | ||
}), | ||
), | ||
); | ||
@@ -158,0 +158,0 @@ } |
@@ -13,3 +13,3 @@ import type { IModulesConfigurator } from '@equinor/fusion-framework-module'; | ||
configurator: IModulesConfigurator<any, any>, | ||
builder?: AppConfigBuilderCallback | ||
builder?: AppConfigBuilderCallback, | ||
): void => { | ||
@@ -16,0 +16,0 @@ configurator.addConfig({ |
@@ -10,3 +10,3 @@ type AppErrorType = 'not_found' | 'unauthorized' | 'unknown'; | ||
'failed to load application manifest, request not authorized', | ||
options | ||
options, | ||
); | ||
@@ -19,6 +19,10 @@ case 404: | ||
`failed to load application manifest, status code ${response.status}`, | ||
options | ||
options, | ||
); | ||
} | ||
constructor(public readonly type: AppErrorType, message?: string, options?: ErrorOptions) { | ||
constructor( | ||
public readonly type: AppErrorType, | ||
message?: string, | ||
options?: ErrorOptions, | ||
) { | ||
super(message, options); | ||
@@ -35,3 +39,3 @@ } | ||
'failed to load application config, request not authorized', | ||
options | ||
options, | ||
); | ||
@@ -44,6 +48,10 @@ case 404: | ||
`failed to load application config, status code ${response.status}`, | ||
options | ||
options, | ||
); | ||
} | ||
constructor(public readonly type: AppErrorType, message?: string, options?: ErrorOptions) { | ||
constructor( | ||
public readonly type: AppErrorType, | ||
message?: string, | ||
options?: ErrorOptions, | ||
) { | ||
super(message, options); | ||
@@ -54,5 +62,9 @@ } | ||
export class AppScriptModuleError extends Error { | ||
constructor(public readonly type: AppErrorType, message?: string, options?: ErrorOptions) { | ||
constructor( | ||
public readonly type: AppErrorType, | ||
message?: string, | ||
options?: ErrorOptions, | ||
) { | ||
super(message, options); | ||
} | ||
} |
import { AnyModule, CombinedModules, ModulesInstance } from '@equinor/fusion-framework-module'; | ||
import type { EventModule } from '@equinor/fusion-framework-module-event'; | ||
import type { HttpModule } from '@equinor/fusion-framework-module-http'; | ||
import { MsalModule } from '@equinor/fusion-framework-module-msal'; | ||
import type { MsalModule } from '@equinor/fusion-framework-module-msal'; | ||
import type { ServiceDiscoveryModule } from '@equinor/fusion-framework-module-service-discovery'; | ||
@@ -6,0 +6,0 @@ import IApp from './app'; |
@@ -7,3 +7,3 @@ { | ||
"declarationDir": "./dist/types", | ||
"baseUrl": "src", | ||
}, | ||
@@ -10,0 +10,0 @@ "references": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81
2205
258665
4
6
1
+ Addedimmer@^9.0.16
Updated@equinor/fusion-query@^3.0.6
Updatedrxjs@^7.8.1