@equinor/fusion
Advanced tools
Comparing version 2.3.11 to 2.3.12-beta.0
@@ -6,6 +6,6 @@ import { IHttpClient } from '../HttpClient'; | ||
export default abstract class BaseApiClient { | ||
protected serviceResolver: ServiceResolver; | ||
protected httpClient: IHttpClient; | ||
protected resourceCollections: ResourceCollections; | ||
constructor(httpClient: IHttpClient, resourceCollection: ResourceCollections, serviceResolver: ServiceResolver); | ||
protected serviceResolver: ServiceResolver; | ||
constructor(httpClient: IHttpClient, resourceCollections: ResourceCollections, serviceResolver: ServiceResolver); | ||
protected abstract getBaseUrl(): string; | ||
@@ -12,0 +12,0 @@ getAsync<TResponse>(path: string, init?: RequestInit, responseParser?: ResponseParser<TResponse>): Promise<import("../HttpClient").HttpResponse<TResponse>>; |
import { combineUrls } from '../../utils/url'; | ||
export default class BaseApiClient { | ||
constructor(httpClient, resourceCollection, serviceResolver) { | ||
constructor(httpClient, resourceCollections, serviceResolver) { | ||
this.httpClient = httpClient; | ||
this.resourceCollections = resourceCollections; | ||
this.serviceResolver = serviceResolver; | ||
this.httpClient = httpClient; | ||
this.resourceCollections = resourceCollection; | ||
} | ||
@@ -8,0 +8,0 @@ async getAsync(path, init, responseParser) { |
@@ -8,2 +8,3 @@ import BaseApiClient from './BaseApiClient'; | ||
protected getBaseUrl(): string; | ||
apiSigninAsync(): Promise<void>; | ||
getHandoverAsync(siteCode: string, projectIdentifier: string): Promise<HttpResponse<HandoverItem[]>>; | ||
@@ -10,0 +11,0 @@ getHandoverChildrenAsync<TKey extends keyof HandoverActions, T = HandoverActions[TKey]>(siteCode: string, projectIdentifier: string, commpkgId: string, action: TKey): Promise<HttpResponse<T[]>>; |
@@ -6,2 +6,5 @@ import BaseApiClient from './BaseApiClient'; | ||
} | ||
async apiSigninAsync() { | ||
await this.httpClient.postAsync(this.resourceCollections.dataProxy.apiSignin(), { credentials: 'include' }); | ||
} | ||
async getHandoverAsync(siteCode, projectIdentifier) { | ||
@@ -8,0 +11,0 @@ const url = this.resourceCollections.dataProxy.handover(siteCode, projectIdentifier); |
import BaseApiClient from './BaseApiClient'; | ||
import ResourceCollections from '../resourceCollections'; | ||
import { IHttpClient } from '../HttpClient'; | ||
import PersonDetails, { PersonAccountType, PersonRole, PersonBasePosition, PersonContract, PersonPosition, PersonProject, PersonRoleScope, PersonPresence } from './models/people/PersonDetails'; | ||
@@ -8,9 +6,5 @@ import RoleDefinition from './models/people/RoleDefinition'; | ||
import GroupRoleMapping from './models/people/GroupRoleMapping'; | ||
import ServiceResolver from '../resourceCollections/ServiceResolver'; | ||
export { PersonDetails, PersonAccountType, PersonRole, PersonBasePosition, PersonContract, PersonPosition, PersonProject, PersonRoleScope, PersonODataExpand, }; | ||
export default class PeopleClient extends BaseApiClient { | ||
protected httpClient: IHttpClient; | ||
protected resourceCollection: ResourceCollections; | ||
constructor(httpClient: IHttpClient, resourceCollection: ResourceCollections, serviceResolver: ServiceResolver); | ||
private apiSigninAsync; | ||
apiSigninAsync(): Promise<void>; | ||
protected getBaseUrl(): string; | ||
@@ -17,0 +11,0 @@ getPersonDetailsAsync(id: string, oDataExpand?: PersonODataExpand[]): Promise<import("../HttpClient").HttpResponse<PersonDetails>>; |
import BaseApiClient from './BaseApiClient'; | ||
import fusionConsole from '../../utils/fusionConsole'; | ||
export default class PeopleClient extends BaseApiClient { | ||
constructor(httpClient, resourceCollection, serviceResolver) { | ||
super(httpClient, resourceCollection, serviceResolver); | ||
this.httpClient = httpClient; | ||
this.resourceCollection = resourceCollection; | ||
this.apiSigninAsync(); | ||
async apiSigninAsync() { | ||
await this.httpClient.postAsync(this.resourceCollections.people.apiSignin(), { credentials: 'include' }); | ||
} | ||
apiSigninAsync() { | ||
try { | ||
this.httpClient.postAsync(this.resourceCollection.people.apiSignin(), { credentials: 'include' }, null, async () => Promise.resolve()); | ||
} | ||
catch (e) { | ||
fusionConsole.error(e); | ||
} | ||
} | ||
getBaseUrl() { | ||
@@ -19,0 +7,0 @@ return this.serviceResolver.getPeopleBaseUrl(); |
@@ -5,2 +5,3 @@ import BaseResourceCollection from './BaseResourceCollection'; | ||
protected getBaseUrl(): string; | ||
apiSignin(): string; | ||
contexts(): string; | ||
@@ -7,0 +8,0 @@ context(id: string): string; |
@@ -8,2 +8,5 @@ import buildQuery from 'odata-query'; | ||
} | ||
apiSignin() { | ||
return combineUrls(this.getBaseUrl(), 'api-signin'); | ||
} | ||
contexts() { | ||
@@ -10,0 +13,0 @@ return combineUrls(this.getBaseUrl(), 'contexts'); |
@@ -25,2 +25,3 @@ import BaseResourceCollection from './BaseResourceCollection'; | ||
protected getBaseUrl(): string; | ||
apiSignin(): string; | ||
handover(siteCode: string, projectIdentifier: string): string; | ||
@@ -27,0 +28,0 @@ handoverChildren(siteCode: string, projectIdentifier: string, commpkgId: string, action: keyof HandoverActions): string; |
@@ -7,2 +7,5 @@ import BaseResourceCollection from './BaseResourceCollection'; | ||
} | ||
apiSignin() { | ||
return combineUrls(this.getBaseUrl(), 'api-signin'); | ||
} | ||
handover(siteCode, projectIdentifier) { | ||
@@ -9,0 +12,0 @@ return this.getSiteAndProjectUrl(siteCode, projectIdentifier, 'handover'); |
@@ -1,2 +0,2 @@ | ||
declare const _default: "2.3.11"; | ||
declare const _default: "2.3.12-beta.0"; | ||
export default _default; |
@@ -1,1 +0,1 @@ | ||
export default '2.3.11'; | ||
export default '2.3.12-beta.0'; |
{ | ||
"name": "@equinor/fusion", | ||
"version": "2.3.11", | ||
"version": "2.3.12-beta.0", | ||
"description": "Everything a Fusion app needs to communicate with the core", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
324282
348
7639
1
7