user 6 rokov pred
rodič
commit
0ea6552864

+ 3 - 2
lib/index.js

@@ -121,18 +121,19 @@ class BankClient {
                     }
                 };
             }
+            if (params.links) {
+                formData.links = JSON.stringify(params.links);
+            }
             for (const attr of ['title', 'text', 'type']) {
                 if (params[attr] != null) {
                     formData[attr] = params[attr];
                 }
             }
-            console.log('formData', formData);
             const uploadResponse = yield this.webClient.requestJSON({
                 formData,
                 method: 'POST',
                 url
             });
-            console.log('uploadResponse', uploadResponse);
             return uploadResponse.hash;
         });
     }

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 1 - 1
lib/index.js.map


+ 5 - 0
lib/upload-item-link.d.ts

@@ -0,0 +1,5 @@
+export interface UploadItemLink {
+    rel: string;
+    target: string;
+    text: string;
+}

+ 3 - 0
lib/upload-item-link.js

@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=upload-item-link.js.map

+ 1 - 0
lib/upload-item-link.js.map

@@ -0,0 +1 @@
+{"version":3,"file":"upload-item-link.js","sourceRoot":"","sources":["../src/upload-item-link.ts"],"names":[],"mappings":""}

+ 2 - 0
lib/upload-item-parameters.d.ts

@@ -1,3 +1,4 @@
+import { UploadItemLink } from "./upload-item-link";
 export interface UploadItemParameters {
     type?: string;
     title: string;
@@ -6,4 +7,5 @@ export interface UploadItemParameters {
     fileData?: File;
     thumbFileName?: string;
     thumbFileData?: string;
+    links?: UploadItemLink[];
 }

+ 3 - 2
src/index.ts

@@ -115,18 +115,19 @@ export class BankClient {
           }
         };
       }
+      if (params.links) {
+        formData.links = JSON.stringify(params.links);
+      }
       for (const attr of ['title', 'text', 'type']) {
         if (params[attr] != null) {
           formData[attr] = params[attr];
         }
       }
-      console.log('formData', formData);
       const uploadResponse: any = await this.webClient.requestJSON({
         formData,
         method: 'POST',
         url
       });
-      console.log('uploadResponse', uploadResponse);
       return uploadResponse.hash;
     }
 

+ 5 - 0
src/upload-item-link.ts

@@ -0,0 +1,5 @@
+export interface UploadItemLink {
+    rel: string;
+    target: string;
+    text: string;
+}

+ 3 - 0
src/upload-item-parameters.ts

@@ -1,3 +1,5 @@
+import { UploadItemLink } from "./upload-item-link";
+
 export interface UploadItemParameters {
     type?: string;
     title: string;
@@ -6,4 +8,5 @@ export interface UploadItemParameters {
     fileData?: File;
     thumbFileName?: string;
     thumbFileData?: string;
+    links?: UploadItemLink[];
 }