Socket
Socket
Sign inDemoInstall

@shapediver/sdk.geometry-api-sdk-v2

Package Overview
Dependencies
11
Maintainers
5
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.7.0 to 1.8.0

5

dist/resources/ShapeDiverFileApi.d.ts
import { ShapeDiverRequestFileUpload, ShapeDiverResponseDto } from "@shapediver/api.geometry-api-dto-v2";
import { BaseResourceApi, ShapeDiverSdkApi } from "@shapediver/sdk.geometry-api-sdk-core";
export interface ShapeDiverResponseFileInfo {
filename?: string;
size?: number;
}
export declare class ShapeDiverFileApi extends BaseResourceApi {
constructor(api: ShapeDiverSdkApi);
list(sessionId: string, paramId: string): Promise<ShapeDiverResponseDto>;
info(sessionId: string, paramId: string, fileId: string): Promise<ShapeDiverResponseFileInfo>;
get(sessionId: string, paramId: string, fileId: string): Promise<ArrayBuffer>;

@@ -7,0 +12,0 @@ delete(sessionId: string, paramId: string, fileId: string): Promise<ShapeDiverResponseDto>;

31

dist/resources/ShapeDiverFileApi.js

@@ -21,5 +21,26 @@ "use strict";

return __awaiter(this, void 0, void 0, function* () {
return yield (0, utils_1.sendRequest)(() => __awaiter(this, void 0, void 0, function* () { return (yield this.api.get(`${this.buildSessionUri(sessionId)}/file/${paramId}/list`))[1]; }));
return yield (0, utils_1.sendRequest)(() => __awaiter(this, void 0, void 0, function* () {
return (yield this.api.get(`${this.buildSessionUri(sessionId)}/file/${paramId}/list`))[1];
}));
});
}
info(sessionId, paramId, fileId) {
return __awaiter(this, void 0, void 0, function* () {
return yield (0, utils_1.sendRequest)(() => __awaiter(this, void 0, void 0, function* () {
const headers = (yield this.api.head(`${this.buildSessionUri(sessionId)}/file/${paramId}/${fileId}`))[0];
const res = {
size: Number(headers.get("Content-Length") || headers.get("content-length")),
};
const contentDisposition = headers.get("Content-Disposition")
|| headers.get("content-disposition");
if (typeof contentDisposition === "string" &&
contentDisposition.indexOf("=") > 0) {
res.filename = contentDisposition
.split("=")[1]
.slice(1, -1);
}
return res;
}));
});
}
get(sessionId, paramId, fileId) {

@@ -34,3 +55,5 @@ return __awaiter(this, void 0, void 0, function* () {

return __awaiter(this, void 0, void 0, function* () {
return yield (0, utils_1.sendRequest)(() => __awaiter(this, void 0, void 0, function* () { return (yield this.api.delete(`${this.buildSessionUri(sessionId)}/file/${paramId}/${fileId}`))[1]; }));
return yield (0, utils_1.sendRequest)(() => __awaiter(this, void 0, void 0, function* () {
return (yield this.api.delete(`${this.buildSessionUri(sessionId)}/file/${paramId}/${fileId}`))[1];
}));
});

@@ -40,3 +63,5 @@ }

return __awaiter(this, void 0, void 0, function* () {
return yield (0, utils_1.sendRequest)(() => __awaiter(this, void 0, void 0, function* () { return (yield this.api.post(this.buildSessionUri(sessionId) + "/file/upload", body))[1]; }));
return yield (0, utils_1.sendRequest)(() => __awaiter(this, void 0, void 0, function* () {
return (yield this.api.post(this.buildSessionUri(sessionId) + "/file/upload", body))[1];
}));
});

@@ -43,0 +68,0 @@ }

2

dist/resources/ShapeDiverUtilsApi.d.ts

@@ -7,3 +7,3 @@ import { ShapeDiverRequestCustomization, ShapeDiverRequestExport, ShapeDiverResponseDto } from "@shapediver/api.geometry-api-dto-v2";

constructor(api: ShapeDiverSdkApi);
upload(url: string, data: ArrayBuffer | Record<string, any> | string, contentType: string): Promise<any>;
upload(url: string, data: ArrayBuffer | Record<string, any> | string, contentType: string, filename?: string): Promise<any>;
download<T extends ShapeDiverSdkApiResponseType>(url: string, responseType: T): Promise<[

@@ -10,0 +10,0 @@ Record<string, any>,

@@ -19,3 +19,3 @@ "use strict";

}
upload(url, data, contentType) {
upload(url, data, contentType, filename) {
return __awaiter(this, void 0, void 0, function* () {

@@ -25,2 +25,3 @@ return yield (0, utils_1.sendRequest)(() => __awaiter(this, void 0, void 0, function* () {

contentType: contentType,
contentDisposition: (filename) ? `attachment; filename="${filename}"` : undefined,
responseType: sdk_geometry_api_sdk_core_1.ShapeDiverSdkApiResponseType.JSON,

@@ -27,0 +28,0 @@ disableAuthorization: true,

{
"name": "@shapediver/sdk.geometry-api-sdk-v2",
"version": "1.7.0",
"version": "1.8.0",
"description": "SDK to communicate with the Geometry API version 2",

@@ -56,5 +56,5 @@ "keywords": [

"dependencies": {
"@shapediver/sdk.geometry-api-sdk-core": "~1.3.2",
"@shapediver/api.geometry-api-dto-v2": "~1.13.0"
"@shapediver/sdk.geometry-api-sdk-core": "~1.4.0",
"@shapediver/api.geometry-api-dto-v2": "~1.14.1"
}
}

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

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc