Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@equinor/fusion

Package Overview
Dependencies
Maintainers
2
Versions
485
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@equinor/fusion - npm Package Compare versions

Comparing version 0.1.35 to 0.1.36

5

lib/core/FusionContext.d.ts

@@ -60,5 +60,8 @@ import { MutableRefObject } from "react";

export declare const defaultSettings: CoreSettings;
export declare type FusionContextOptions = {
loadBundlesFromDisk: boolean;
};
declare const FusionContext: import("react").Context<IFusionContext>;
export declare const createFusionContext: (authContainer: IAuthContainer, serviceResolver: ServiceResolver, refs: Refs) => IFusionContext;
export declare const createFusionContext: (authContainer: IAuthContainer, serviceResolver: ServiceResolver, refs: Refs, options?: FusionContextOptions | undefined) => IFusionContext;
export declare const useFusionContext: () => IFusionContext;
export default FusionContext;

4

lib/core/FusionContext.js

@@ -17,5 +17,5 @@ import { createContext, useContext } from "react";

const FusionContext = createContext({});
export const createFusionContext = (authContainer, serviceResolver, refs) => {
export const createFusionContext = (authContainer, serviceResolver, refs, options) => {
const abortControllerManager = new AbortControllerManager();
const resourceCollections = createResourceCollections(serviceResolver);
const resourceCollections = createResourceCollections(serviceResolver, options);
const resourceCache = new ResourceCache();

@@ -22,0 +22,0 @@ const httpClient = new HttpClient(authContainer, resourceCache, abortControllerManager);

import BaseResourceCollection from "./BaseResourceCollection";
import ServiceResolver from './ServiceResolver';
import { FusionContextOptions } from '../../core/FusionContext';
export default class FusionResourceCollection extends BaseResourceCollection {
options?: FusionContextOptions;
constructor(serviceResolver: ServiceResolver, options?: FusionContextOptions);
protected getBaseUrl(): string;
apps(): string;
app(appKey: string): string;
appManifest(appKey: string): string;
appScript(appKey: string): string;
private getBundlesPath;
private getManifestFileName;
}
import BaseResourceCollection from "./BaseResourceCollection";
import combineUrls from "../../utils/combineUrls";
export default class FusionResourceCollection extends BaseResourceCollection {
constructor(serviceResolver, options) {
super(serviceResolver);
this.options = options;
}
getBaseUrl() {

@@ -8,10 +12,22 @@ return this.serviceResolver.getFusionBaseUrl();

apps() {
return combineUrls(this.getBaseUrl(), "bundles", "apps");
return combineUrls(this.getBaseUrl(), this.getBundlesPath(), "apps");
}
appManifest(appKey) {
app(appKey) {
return combineUrls(this.apps(), appKey);
}
appManifest(appKey) {
return combineUrls(this.app(appKey), this.getManifestFileName());
}
appScript(appKey) {
return this.appManifest(appKey) + ".js";
if (this.options && this.options.loadBundlesFromDisk) {
return combineUrls(this.app(appKey), `app-bundle.js?v=${(+new Date)}`);
}
return this.app(appKey) + ".js";
}
getBundlesPath() {
return this.options && this.options.loadBundlesFromDisk ? "js" : "bundles";
}
getManifestFileName() {
return this.options && this.options.loadBundlesFromDisk ? `app-manifest.json?v=${(+new Date)}` : "";
}
}

@@ -5,2 +5,3 @@ import DataProxyResourceCollection from "./DataProxyResourceCollection";

import ServiceResolver from "./ServiceResolver";
import { FusionContextOptions } from "../../core/FusionContext";
declare type ResourceCollections = {

@@ -12,3 +13,3 @@ dataProxy: DataProxyResourceCollection;

export { DataProxyResourceCollection };
export declare const createResourceCollections: (serviceResolver: ServiceResolver) => ResourceCollections;
export declare const createResourceCollections: (serviceResolver: ServiceResolver, options?: FusionContextOptions | undefined) => ResourceCollections;
export default ResourceCollections;

@@ -5,6 +5,6 @@ import DataProxyResourceCollection from "./DataProxyResourceCollection";

export { DataProxyResourceCollection };
export const createResourceCollections = (serviceResolver) => ({
export const createResourceCollections = (serviceResolver, options) => ({
dataProxy: new DataProxyResourceCollection(serviceResolver),
fusion: new FusionResourceCollection(serviceResolver),
fusion: new FusionResourceCollection(serviceResolver, options),
context: new ContextResourceCollection(serviceResolver),
});

@@ -5,3 +5,6 @@ declare type ServiceResolver = {

getContextBaseUrl: () => string;
getOrgBaseUrl: () => string;
getPowerBiBaseUrl: () => string;
getTasksBaseUrl: () => string;
};
export default ServiceResolver;
{
"name": "@equinor/fusion",
"version": "0.1.35",
"version": "0.1.36",
"description": "Everything a Fusion app needs to communicate with the core",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc