user 6 år sedan
förälder
incheckning
acad6a4e05
4 ändrade filer med 48 tillägg och 0 borttagningar
  1. 2 0
      lib/sample.d.ts
  2. 27 0
      lib/sample.js
  3. 1 0
      lib/sample.js.map
  4. 18 0
      src/sample.ts

+ 2 - 0
lib/sample.d.ts

@@ -0,0 +1,2 @@
+declare const BankClient: any;
+declare const bankClient: any;

+ 27 - 0
lib/sample.js

@@ -0,0 +1,27 @@
+"use strict";
+var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
+    return new (P || (P = Promise))(function (resolve, reject) {
+        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
+        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
+        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
+        step((generator = generator.apply(thisArg, _arguments || [])).next());
+    });
+};
+const { BankClient } = require('./index');
+const bankClient = new BankClient('https://hostname');
+(() => __awaiter(this, void 0, void 0, function* () {
+    yield bankClient.bootstrap();
+    const balance = yield bankClient.getBalance();
+    const uploadResult = yield bankClient.upload({
+        fileData: 't2',
+        fileName: 't3.txt',
+        type: 'file',
+        title: '442a',
+        text: 'txt'
+    });
+    console.log('my balance', balance);
+    console.log('upl', uploadResult);
+    yield bankClient.appendBank('bank:qmlink/📥', uploadResult);
+    console.log('added.');
+}))();
+//# sourceMappingURL=sample.js.map

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 0
lib/sample.js.map


+ 18 - 0
src/sample.ts

@@ -0,0 +1,18 @@
+const { BankClient } = require('./index');
+const bankClient = new BankClient('https://hostname');
+
+(async () => {
+    await bankClient.bootstrap();
+    const balance = await bankClient.getBalance();
+    const uploadResult = await bankClient.upload({
+        fileData: 't2',
+        fileName: 't3.txt',
+        type: 'file',
+        title: '442a',
+        text: 'txt'
+    });
+    console.log('my balance', balance);
+    console.log('upl', uploadResult);
+    await bankClient.appendBank('bank:qmlink/📥', uploadResult);
+    console.log('added.');
+})();