@equinor/fusion
Advanced tools
Comparing version 2.3.10 to 2.3.11
@@ -37,2 +37,4 @@ import BaseApiClient from './BaseApiClient'; | ||
getSnapshotAsync(projectId: string, snapshotId: string): Promise<HttpResponse<OrgSnapshot>>; | ||
canDeleteSnapshotsAsync(projectId: string, snapshotId: string): Promise<boolean>; | ||
deleteSnapShotAsync(projectId: string, snapshotId: string): Promise<HttpResponse<void>>; | ||
createSnapshotAsync(projectId: string, snapshotRequest: CreateSnapshotRequest): Promise<HttpResponse<OrgSnapshot>>; | ||
@@ -39,0 +41,0 @@ createTransientSnapshotAsync(projectId: string, snapshotRequest: CreateTransientSnapshotRequest): Promise<HttpResponse<OrgSnapshot>>; |
@@ -278,2 +278,20 @@ import BaseApiClient from './BaseApiClient'; | ||
} | ||
async canDeleteSnapshotsAsync(projectId, snapshotId) { | ||
const url = this.resourceCollections.org.snapshot(projectId, snapshotId); | ||
try { | ||
const response = await this.httpClient.optionsAsync(url, {}, () => Promise.resolve()); | ||
const allowHeader = response.headers.get('Allow'); | ||
if (allowHeader !== null && allowHeader.toLowerCase().indexOf('delete') !== -1) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
catch (e) { | ||
return false; | ||
} | ||
} | ||
async deleteSnapShotAsync(projectId, snapshotId) { | ||
const url = this.resourceCollections.org.snapshot(projectId, snapshotId); | ||
return await this.httpClient.deleteAsync(url, {}, () => Promise.resolve()); | ||
} | ||
async createSnapshotAsync(projectId, snapshotRequest) { | ||
@@ -280,0 +298,0 @@ const url = this.resourceCollections.org.snapshots(projectId); |
@@ -1,2 +0,2 @@ | ||
declare const _default: "2.3.10"; | ||
declare const _default: "2.3.11"; | ||
export default _default; |
@@ -1,1 +0,1 @@ | ||
export default '2.3.10'; | ||
export default '2.3.11'; |
{ | ||
"name": "@equinor/fusion", | ||
"version": "2.3.10", | ||
"version": "2.3.11", | ||
"description": "Everything a Fusion app needs to communicate with the core", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
322603
7614