user 5 rokov pred
rodič
commit
8b65adc2fa

+ 2 - 0
lib/content-item.d.ts

@@ -14,6 +14,8 @@ export declare class ContentItem {
     readonly creator?: string;
     readonly title?: string;
     readonly text?: string;
+    readonly file?: string;
+    readonly thumb?: string;
     readonly price?: number;
     readonly priceFormatted?: string;
     readonly fromTarget?: string;

+ 2 - 0
lib/content-item.js

@@ -9,6 +9,8 @@ class ContentItem {
         this.title = props.title;
         this.text = props.text;
         this.creator = props.creator;
+        this.file = props.file;
+        this.thumb = props.thumb;
         if (props.date) {
             this.date = new Date(props.date);
         }

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


+ 2 - 0
lib/content-params.d.ts

@@ -8,4 +8,6 @@ export interface ContentParams {
     price?: number;
     title?: string;
     text?: string;
+    file?: string;
+    thumb?: string;
 }

+ 19 - 11
lib/sample.js

@@ -18,7 +18,7 @@ const webclient_node_1 = require("./webclient-node");
 // const ipfsHost = 'http://127.0.0.1:5001';
 const host = 'https://distributing.fun';
 const ipfsHost = 'https://distributing.fun';
-const crypto_node_1 = __importDefault(require("./../src/crypto-node"));
+const crypto_node_1 = __importDefault(require("./crypto-node"));
 const bankClient = new index_1.BankClient(host, ipfsHost, new storage_node_1.StorageNode('bankClient'), new webclient_node_1.WebClientNode(), new crypto_node_1.default());
 (() => __awaiter(this, void 0, void 0, function* () {
     yield bankClient.bootstrap();
@@ -26,7 +26,15 @@ const bankClient = new index_1.BankClient(host, ipfsHost, new storage_node_1.Sto
     console.log('peerId', peerId);
     const balance = yield bankClient.getBalance();
     console.log('my balance', balance);
-    const starting = yield bankClient.retrievePrivate('QmXRkCwxqecBMXs4DQucS9w85pW16i26tdKcZHExt9z8s5', '🌎');
+    const uploadResult = yield bankClient.upload({
+        title: 'Random thing',
+        text: 'txt',
+        type: 'file',
+    });
+    console.log('upl', uploadResult);
+    yield bankClient.appendPrivate(peerId, '🌎newreleases', uploadResult);
+    console.log('added.');
+    const starting = yield bankClient.retrievePrivate(peerId, '🌎newreleases');
     const items = yield bankClient.getItemsForCommaList(starting);
     console.log('items', items);
     // await bankClient.appendBank('bank:qmlink/📥', uploadResult);
@@ -56,17 +64,17 @@ const bankClient = new index_1.BankClient(host, ipfsHost, new storage_node_1.Sto
     // const items = await bankClient.getItemsForCommaList('1563498096_SL_bafkreiaocpbrzrc45xdkmnwobospujpewrb4t4hk2thqqs5kldtehy62qu');
     // console.log('items', items);
     // setTimeout(async () => {
-    const uploadResult = yield bankClient.upload({
-        title: 'New random entry in outbox',
-        text: 'txt',
-        type: 'file',
-    });
-    console.log('upl', uploadResult);
-    yield bankClient.appendPrivate('QmXRkCwxqecBMXs4DQucS9w85pW16i26tdKcZHExt9z8s5', '📥', uploadResult);
-    console.log('added.');
+    // const uploadResult = await bankClient.upload({
+    //     title: 'New random entry in outbox',
+    //     text: 'txt',
+    //     type: 'file',
+    // });
+    // console.log('upl', uploadResult);
+    // await bankClient.appendPrivate('QmXRkCwxqecBMXs4DQucS9w85pW16i26tdKcZHExt9z8s5', '📥', uploadResult);
+    // console.log('added.');
     // }, 10000);
     setTimeout(() => {
         console.log('done');
-    }, 20000);
+    }, 10000);
 }))();
 //# sourceMappingURL=sample.js.map

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


+ 4 - 0
src/content-item.ts

@@ -18,6 +18,8 @@ export class ContentItem {
   public readonly creator?: string;
   public readonly title?: string;
   public readonly text?: string;
+  public readonly file?: string;
+  public readonly thumb?: string;
   public readonly price?: number;
   public readonly priceFormatted?: string;
   public readonly fromTarget?: string;
@@ -35,6 +37,8 @@ export class ContentItem {
     this.title = props.title;
     this.text = props.text;
     this.creator = props.creator;
+    this.file = props.file;
+    this.thumb = props.thumb;
 
     if (props.date) {
       this.date = new Date(props.date);

+ 2 - 0
src/content-params.ts

@@ -9,4 +9,6 @@ export interface ContentParams {
     price?: number;
     title?: string;
     text?: string;
+    file?: string;
+    thumb?: string;
 }