@ethersphere/bee-js 10.3.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bee.js +17 -10
- package/dist/cjs/chunk/bmt.js +1 -2
- package/dist/cjs/chunk/cac.js +3 -3
- package/dist/cjs/chunk/soc.js +24 -15
- package/dist/cjs/feed/identifier.js +1 -2
- package/dist/cjs/feed/index.js +25 -16
- package/dist/cjs/feed/retrievable.js +1 -2
- package/dist/cjs/index.js +17 -7
- package/dist/cjs/modules/bytes.js +4 -5
- package/dist/cjs/modules/bzz.js +4 -5
- package/dist/cjs/modules/chunk.js +2 -3
- package/dist/cjs/modules/debug/balance.js +4 -5
- package/dist/cjs/modules/debug/chequebook.js +8 -9
- package/dist/cjs/modules/debug/connectivity.js +7 -8
- package/dist/cjs/modules/debug/settlements.js +2 -3
- package/dist/cjs/modules/debug/stake.js +6 -7
- package/dist/cjs/modules/debug/stamps.js +23 -77
- package/dist/cjs/modules/debug/states.js +6 -6
- package/dist/cjs/modules/debug/status.js +9 -9
- package/dist/cjs/modules/debug/transactions.js +4 -5
- package/dist/cjs/modules/envelope.js +1 -2
- package/dist/cjs/modules/feed.js +3 -4
- package/dist/cjs/modules/grantee.js +3 -4
- package/dist/cjs/modules/gsoc.js +2 -3
- package/dist/cjs/modules/pinning.js +4 -5
- package/dist/cjs/modules/pss.js +2 -3
- package/dist/cjs/modules/rchash.js +1 -2
- package/dist/cjs/modules/soc.js +1 -2
- package/dist/cjs/modules/status.js +2 -3
- package/dist/cjs/modules/stewardship.js +2 -3
- package/dist/cjs/modules/tag.js +5 -6
- package/dist/cjs/types/debug.js +3 -3
- package/dist/cjs/types/index.js +2 -2
- package/dist/cjs/utils/bytes.js +2 -2
- package/dist/cjs/utils/chunk-size.js +1 -2
- package/dist/cjs/utils/chunk-stream.browser.js +3 -4
- package/dist/cjs/utils/chunk-stream.js +3 -4
- package/dist/cjs/utils/cid.js +3 -3
- package/dist/cjs/utils/collection.browser.js +2 -3
- package/dist/cjs/utils/collection.js +5 -6
- package/dist/cjs/utils/collection.node.js +2 -3
- package/dist/cjs/utils/data.browser.js +1 -2
- package/dist/cjs/utils/data.js +1 -2
- package/dist/cjs/utils/expose.js +4 -1
- package/dist/cjs/utils/file.js +2 -3
- package/dist/cjs/utils/headers.js +2 -3
- package/dist/cjs/utils/http.js +2 -2
- package/dist/cjs/utils/pss.js +1 -2
- package/dist/cjs/utils/redundancy.js +3 -4
- package/dist/cjs/utils/stamps.js +60 -11
- package/dist/cjs/utils/tar-uploader.browser.js +1 -2
- package/dist/cjs/utils/tar-uploader.js +1 -2
- package/dist/cjs/utils/tar-writer.browser.js +1 -2
- package/dist/cjs/utils/tar-writer.js +1 -2
- package/dist/cjs/utils/type.js +34 -25
- package/dist/cjs/utils/url.js +3 -4
- package/dist/cjs/utils/workaround.js +7 -5
- package/dist/index.browser.min.js +1 -1
- package/dist/index.browser.min.js.map +1 -1
- package/dist/mjs/bee.js +0 -3
- package/dist/mjs/modules/debug/stamps.js +37 -110
- package/dist/mjs/modules/debug/states.js +3 -0
- package/dist/mjs/modules/debug/status.js +1 -1
- package/dist/mjs/utils/expose.js +1 -1
- package/dist/mjs/utils/stamps.js +48 -0
- package/dist/mjs/utils/workaround.js +5 -2
- package/dist/types/bee.d.ts +0 -4
- package/dist/types/index.d.ts +3 -2
- package/dist/types/modules/bzz.d.ts +0 -1
- package/dist/types/modules/debug/status.d.ts +1 -1
- package/dist/types/modules/gsoc.d.ts +0 -1
- package/dist/types/modules/pss.d.ts +0 -1
- package/dist/types/types/debug.d.ts +1 -0
- package/dist/types/utils/constants.d.ts +3 -3
- package/dist/types/utils/error.d.ts +2 -2
- package/dist/types/utils/expose.d.ts +1 -1
- package/dist/types/utils/stamps.d.ts +15 -1
- package/dist/types/utils/tar.browser.d.ts +1 -1
- package/dist/types/utils/tar.d.ts +0 -1
- package/dist/types/utils/type.d.ts +0 -1
- package/package.json +9 -12
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getStake = getStake;
|
|
4
|
+
exports.getWithdrawableStake = getWithdrawableStake;
|
|
5
|
+
exports.withdrawSurplusStake = withdrawSurplusStake;
|
|
6
|
+
exports.migrateStake = migrateStake;
|
|
7
|
+
exports.stake = stake;
|
|
8
|
+
exports.getRedistributionState = getRedistributionState;
|
|
4
9
|
const cafe_utility_1 = require("cafe-utility");
|
|
5
10
|
const headers_1 = require("../../utils/headers");
|
|
6
11
|
const http_1 = require("../../utils/http");
|
|
@@ -23,7 +28,6 @@ async function getStake(requestOptions) {
|
|
|
23
28
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
24
29
|
return tokens_1.BZZ.fromPLUR((0, type_1.asNumberString)(body.stakedAmount, { name: 'stakedAmount' }));
|
|
25
30
|
}
|
|
26
|
-
exports.getStake = getStake;
|
|
27
31
|
/**
|
|
28
32
|
* Gets the amount of withdrawable staked BZZ
|
|
29
33
|
*
|
|
@@ -38,7 +42,6 @@ async function getWithdrawableStake(requestOptions) {
|
|
|
38
42
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
39
43
|
return tokens_1.BZZ.fromPLUR((0, type_1.asNumberString)(body.withdrawableAmount, { name: 'withdrawableAmount' }));
|
|
40
44
|
}
|
|
41
|
-
exports.getWithdrawableStake = getWithdrawableStake;
|
|
42
45
|
async function withdrawSurplusStake(requestOptions) {
|
|
43
46
|
const response = await (0, http_1.http)(requestOptions, {
|
|
44
47
|
method: 'delete',
|
|
@@ -48,7 +51,6 @@ async function withdrawSurplusStake(requestOptions) {
|
|
|
48
51
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
49
52
|
return new typed_bytes_1.TransactionId(cafe_utility_1.Types.asHexString(body.txHash, { name: 'txHash' }));
|
|
50
53
|
}
|
|
51
|
-
exports.withdrawSurplusStake = withdrawSurplusStake;
|
|
52
54
|
async function migrateStake(requestOptions) {
|
|
53
55
|
const response = await (0, http_1.http)(requestOptions, {
|
|
54
56
|
method: 'delete',
|
|
@@ -58,7 +60,6 @@ async function migrateStake(requestOptions) {
|
|
|
58
60
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
59
61
|
return new typed_bytes_1.TransactionId(cafe_utility_1.Types.asHexString(body.txHash, { name: 'txHash' }));
|
|
60
62
|
}
|
|
61
|
-
exports.migrateStake = migrateStake;
|
|
62
63
|
/**
|
|
63
64
|
* Stake given amount of tokens.
|
|
64
65
|
*
|
|
@@ -75,7 +76,6 @@ async function stake(requestOptions, amount, options) {
|
|
|
75
76
|
const body = cafe_utility_1.Types.asObject(repsonse.data, { name: 'response.data' });
|
|
76
77
|
return new typed_bytes_1.TransactionId(cafe_utility_1.Types.asHexString(body.txHash, { name: 'txHash' }));
|
|
77
78
|
}
|
|
78
|
-
exports.stake = stake;
|
|
79
79
|
/**
|
|
80
80
|
* Get current status of node in redistribution game
|
|
81
81
|
*
|
|
@@ -106,4 +106,3 @@ async function getRedistributionState(requestOptions) {
|
|
|
106
106
|
isHealthy: cafe_utility_1.Types.asBoolean(body.isHealthy, { name: 'isHealthy' }),
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
exports.getRedistributionState = getRedistributionState;
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getGlobalPostageBatches = getGlobalPostageBatches;
|
|
4
|
+
exports.getAllPostageBatches = getAllPostageBatches;
|
|
5
|
+
exports.getPostageBatch = getPostageBatch;
|
|
6
|
+
exports.getPostageBatchBuckets = getPostageBatchBuckets;
|
|
7
|
+
exports.createPostageBatch = createPostageBatch;
|
|
8
|
+
exports.topUpBatch = topUpBatch;
|
|
9
|
+
exports.diluteBatch = diluteBatch;
|
|
4
10
|
const cafe_utility_1 = require("cafe-utility");
|
|
5
|
-
const duration_1 = require("../../utils/duration");
|
|
6
11
|
const http_1 = require("../../utils/http");
|
|
7
|
-
const size_1 = require("../../utils/size");
|
|
8
12
|
const stamps_1 = require("../../utils/stamps");
|
|
9
13
|
const type_1 = require("../../utils/type");
|
|
10
14
|
const typed_bytes_1 = require("../../utils/typed-bytes");
|
|
11
|
-
const workaround_1 = require("../../utils/workaround");
|
|
12
15
|
const STAMPS_ENDPOINT = 'stamps';
|
|
13
16
|
const BATCHES_ENDPOINT = 'batches';
|
|
14
17
|
async function getGlobalPostageBatches(requestOptions) {
|
|
@@ -30,7 +33,6 @@ async function getGlobalPostageBatches(requestOptions) {
|
|
|
30
33
|
value: (0, type_1.asNumberString)(x.value, { name: 'value' }),
|
|
31
34
|
}));
|
|
32
35
|
}
|
|
33
|
-
exports.getGlobalPostageBatches = getGlobalPostageBatches;
|
|
34
36
|
async function getAllPostageBatches(requestOptions) {
|
|
35
37
|
const response = await (0, http_1.http)(requestOptions, {
|
|
36
38
|
method: 'get',
|
|
@@ -39,42 +41,8 @@ async function getAllPostageBatches(requestOptions) {
|
|
|
39
41
|
});
|
|
40
42
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
41
43
|
const stamps = cafe_utility_1.Types.asArray(body.stamps, { name: 'stamps' }).map(x => cafe_utility_1.Types.asObject(x, { name: 'stamp' }));
|
|
42
|
-
return stamps.map(x =>
|
|
43
|
-
const utilization = cafe_utility_1.Types.asNumber(x.utilization, { name: 'utilization' });
|
|
44
|
-
const depth = cafe_utility_1.Types.asNumber(x.depth, { name: 'depth' });
|
|
45
|
-
const bucketDepth = cafe_utility_1.Types.asNumber(x.bucketDepth, { name: 'bucketDepth' });
|
|
46
|
-
const usage = (0, stamps_1.getStampUsage)(utilization, depth, bucketDepth);
|
|
47
|
-
const batchTTL = (0, workaround_1.normalizeBatchTTL)(cafe_utility_1.Types.asNumber(x.batchTTL, { name: 'batchTTL' }));
|
|
48
|
-
const duration = duration_1.Duration.fromSeconds(batchTTL);
|
|
49
|
-
const effectiveBytes = (0, stamps_1.getStampEffectiveBytes)(depth);
|
|
50
|
-
return {
|
|
51
|
-
batchID: new typed_bytes_1.BatchId(cafe_utility_1.Types.asString(x.batchID, { name: 'batchID' })),
|
|
52
|
-
utilization,
|
|
53
|
-
usable: cafe_utility_1.Types.asBoolean(x.usable, { name: 'usable' }),
|
|
54
|
-
label: cafe_utility_1.Types.asEmptiableString(x.label, { name: 'label' }),
|
|
55
|
-
depth,
|
|
56
|
-
amount: (0, type_1.asNumberString)(x.amount, { name: 'amount' }),
|
|
57
|
-
bucketDepth,
|
|
58
|
-
blockNumber: cafe_utility_1.Types.asNumber(x.blockNumber, { name: 'blockNumber' }),
|
|
59
|
-
immutableFlag: cafe_utility_1.Types.asBoolean(x.immutableFlag, { name: 'immutableFlag' }),
|
|
60
|
-
usage,
|
|
61
|
-
usageText: `${Math.round(usage * 100)}%`,
|
|
62
|
-
size: size_1.Size.fromBytes(effectiveBytes),
|
|
63
|
-
remainingSize: size_1.Size.fromBytes(Math.ceil(effectiveBytes * (1 - usage))),
|
|
64
|
-
theoreticalSize: size_1.Size.fromBytes((0, stamps_1.getStampTheoreticalBytes)(depth)),
|
|
65
|
-
duration,
|
|
66
|
-
calculateSize(encryption, redundancyLevel) {
|
|
67
|
-
const effectiveBytes = (0, stamps_1.getStampEffectiveBytes)(this.depth, encryption, redundancyLevel);
|
|
68
|
-
return size_1.Size.fromBytes(effectiveBytes);
|
|
69
|
-
},
|
|
70
|
-
calculateRemainingSize(encryption, redundancyLevel) {
|
|
71
|
-
const effectiveBytes = (0, stamps_1.getStampEffectiveBytes)(this.depth, encryption, redundancyLevel);
|
|
72
|
-
return size_1.Size.fromBytes(Math.ceil(effectiveBytes * (1 - this.usage)));
|
|
73
|
-
},
|
|
74
|
-
};
|
|
75
|
-
});
|
|
44
|
+
return stamps.map(x => (0, stamps_1.mapPostageBatch)(validateRawPostageBatch(x)));
|
|
76
45
|
}
|
|
77
|
-
exports.getAllPostageBatches = getAllPostageBatches;
|
|
78
46
|
async function getPostageBatch(requestOptions, postageBatchId, encryption, erasureCodeLevel) {
|
|
79
47
|
const response = await (0, http_1.http)(requestOptions, {
|
|
80
48
|
method: 'get',
|
|
@@ -82,40 +50,8 @@ async function getPostageBatch(requestOptions, postageBatchId, encryption, erasu
|
|
|
82
50
|
responseType: 'json',
|
|
83
51
|
});
|
|
84
52
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
85
|
-
|
|
86
|
-
const depth = cafe_utility_1.Types.asNumber(body.depth, { name: 'depth' });
|
|
87
|
-
const bucketDepth = cafe_utility_1.Types.asNumber(body.bucketDepth, { name: 'bucketDepth' });
|
|
88
|
-
const usage = (0, stamps_1.getStampUsage)(utilization, depth, bucketDepth);
|
|
89
|
-
const batchTTL = (0, workaround_1.normalizeBatchTTL)(cafe_utility_1.Types.asNumber(body.batchTTL, { name: 'batchTTL' }));
|
|
90
|
-
const duration = duration_1.Duration.fromSeconds(batchTTL);
|
|
91
|
-
const effectiveBytes = (0, stamps_1.getStampEffectiveBytes)(depth, encryption, erasureCodeLevel);
|
|
92
|
-
return {
|
|
93
|
-
batchID: new typed_bytes_1.BatchId(cafe_utility_1.Types.asString(body.batchID, { name: 'batchID' })),
|
|
94
|
-
utilization,
|
|
95
|
-
usable: cafe_utility_1.Types.asBoolean(body.usable, { name: 'usable' }),
|
|
96
|
-
label: cafe_utility_1.Types.asEmptiableString(body.label, { name: 'label' }),
|
|
97
|
-
depth,
|
|
98
|
-
amount: (0, type_1.asNumberString)(body.amount, { name: 'amount' }),
|
|
99
|
-
bucketDepth,
|
|
100
|
-
blockNumber: cafe_utility_1.Types.asNumber(body.blockNumber, { name: 'blockNumber' }),
|
|
101
|
-
immutableFlag: cafe_utility_1.Types.asBoolean(body.immutableFlag, { name: 'immutableFlag' }),
|
|
102
|
-
usage,
|
|
103
|
-
usageText: `${Math.round(usage * 100)}%`,
|
|
104
|
-
size: size_1.Size.fromBytes(effectiveBytes),
|
|
105
|
-
remainingSize: size_1.Size.fromBytes(Math.ceil(effectiveBytes * (1 - usage))),
|
|
106
|
-
theoreticalSize: size_1.Size.fromBytes((0, stamps_1.getStampTheoreticalBytes)(depth)),
|
|
107
|
-
duration,
|
|
108
|
-
calculateSize(encryption, redundancyLevel) {
|
|
109
|
-
const effectiveBytes = (0, stamps_1.getStampEffectiveBytes)(depth, encryption, redundancyLevel);
|
|
110
|
-
return size_1.Size.fromBytes(effectiveBytes);
|
|
111
|
-
},
|
|
112
|
-
calculateRemainingSize(encryption, redundancyLevel) {
|
|
113
|
-
const effectiveBytes = (0, stamps_1.getStampEffectiveBytes)(depth, encryption, redundancyLevel);
|
|
114
|
-
return size_1.Size.fromBytes(Math.ceil(effectiveBytes * (1 - usage)));
|
|
115
|
-
},
|
|
116
|
-
};
|
|
53
|
+
return (0, stamps_1.mapPostageBatch)(validateRawPostageBatch(body), encryption, erasureCodeLevel);
|
|
117
54
|
}
|
|
118
|
-
exports.getPostageBatch = getPostageBatch;
|
|
119
55
|
async function getPostageBatchBuckets(requestOptions, postageBatchId) {
|
|
120
56
|
const response = await (0, http_1.http)(requestOptions, {
|
|
121
57
|
method: 'get',
|
|
@@ -135,7 +71,6 @@ async function getPostageBatchBuckets(requestOptions, postageBatchId) {
|
|
|
135
71
|
})),
|
|
136
72
|
};
|
|
137
73
|
}
|
|
138
|
-
exports.getPostageBatchBuckets = getPostageBatchBuckets;
|
|
139
74
|
async function createPostageBatch(requestOptions, amount, depth, options) {
|
|
140
75
|
const headers = {};
|
|
141
76
|
if (options?.gasPrice) {
|
|
@@ -154,7 +89,6 @@ async function createPostageBatch(requestOptions, amount, depth, options) {
|
|
|
154
89
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
155
90
|
return new typed_bytes_1.BatchId(cafe_utility_1.Types.asString(body.batchID, { name: 'batchID' }));
|
|
156
91
|
}
|
|
157
|
-
exports.createPostageBatch = createPostageBatch;
|
|
158
92
|
async function topUpBatch(requestOptions, id, amount) {
|
|
159
93
|
const response = await (0, http_1.http)(requestOptions, {
|
|
160
94
|
method: 'patch',
|
|
@@ -164,7 +98,6 @@ async function topUpBatch(requestOptions, id, amount) {
|
|
|
164
98
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
165
99
|
return new typed_bytes_1.BatchId(cafe_utility_1.Types.asString(body.batchID, { name: 'batchID' }));
|
|
166
100
|
}
|
|
167
|
-
exports.topUpBatch = topUpBatch;
|
|
168
101
|
async function diluteBatch(requestOptions, id, depth) {
|
|
169
102
|
const response = await (0, http_1.http)(requestOptions, {
|
|
170
103
|
method: 'patch',
|
|
@@ -174,4 +107,17 @@ async function diluteBatch(requestOptions, id, depth) {
|
|
|
174
107
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
175
108
|
return new typed_bytes_1.BatchId(cafe_utility_1.Types.asString(body.batchID, { name: 'batchID' }));
|
|
176
109
|
}
|
|
177
|
-
|
|
110
|
+
function validateRawPostageBatch(raw) {
|
|
111
|
+
return {
|
|
112
|
+
amount: (0, type_1.asNumberString)(raw.amount, { name: 'amount' }),
|
|
113
|
+
batchID: cafe_utility_1.Types.asString(raw.batchID, { name: 'batchID' }),
|
|
114
|
+
batchTTL: cafe_utility_1.Types.asNumber(raw.batchTTL, { name: 'batchTTL' }),
|
|
115
|
+
bucketDepth: cafe_utility_1.Types.asNumber(raw.bucketDepth, { name: 'bucketDepth' }),
|
|
116
|
+
blockNumber: cafe_utility_1.Types.asNumber(raw.blockNumber, { name: 'blockNumber' }),
|
|
117
|
+
depth: cafe_utility_1.Types.asNumber(raw.depth, { name: 'depth' }),
|
|
118
|
+
immutableFlag: cafe_utility_1.Types.asBoolean(raw.immutableFlag, { name: 'immutableFlag' }),
|
|
119
|
+
label: cafe_utility_1.Types.asEmptiableString(raw.label, { name: 'label' }),
|
|
120
|
+
usable: cafe_utility_1.Types.asBoolean(raw.usable, { name: 'usable' }),
|
|
121
|
+
utilization: cafe_utility_1.Types.asNumber(raw.utilization, { name: 'utilization' }),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getReserveState = getReserveState;
|
|
4
|
+
exports.getChainState = getChainState;
|
|
5
|
+
exports.getWalletBalance = getWalletBalance;
|
|
6
|
+
exports.withdrawBZZ = withdrawBZZ;
|
|
7
|
+
exports.withdrawDAI = withdrawDAI;
|
|
4
8
|
const cafe_utility_1 = require("cafe-utility");
|
|
5
9
|
const http_1 = require("../../utils/http");
|
|
6
10
|
const tokens_1 = require("../../utils/tokens");
|
|
@@ -26,9 +30,9 @@ async function getReserveState(requestOptions) {
|
|
|
26
30
|
commitment: cafe_utility_1.Types.asNumber(body.commitment, { name: 'commitment' }),
|
|
27
31
|
radius: cafe_utility_1.Types.asNumber(body.radius, { name: 'radius' }),
|
|
28
32
|
storageRadius: cafe_utility_1.Types.asNumber(body.storageRadius, { name: 'storageRadius' }),
|
|
33
|
+
reserveCapacityDoubling: cafe_utility_1.Types.asNumber(body.reserveCapacityDoubling, { name: 'reserveCapacityDoubling' }),
|
|
29
34
|
};
|
|
30
35
|
}
|
|
31
|
-
exports.getReserveState = getReserveState;
|
|
32
36
|
/**
|
|
33
37
|
* Get state of reserve
|
|
34
38
|
*
|
|
@@ -48,7 +52,6 @@ async function getChainState(requestOptions) {
|
|
|
48
52
|
currentPrice: (0, workaround_1.normalizeCurrentPrice)(cafe_utility_1.Types.asNumber(body.currentPrice, { name: 'currentPrice' })),
|
|
49
53
|
};
|
|
50
54
|
}
|
|
51
|
-
exports.getChainState = getChainState;
|
|
52
55
|
/**
|
|
53
56
|
* Get wallet balances for xDai and BZZ of the node
|
|
54
57
|
*
|
|
@@ -69,7 +72,6 @@ async function getWalletBalance(requestOptions) {
|
|
|
69
72
|
walletAddress: cafe_utility_1.Types.asString(body.walletAddress, { name: 'walletAddress' }),
|
|
70
73
|
};
|
|
71
74
|
}
|
|
72
|
-
exports.getWalletBalance = getWalletBalance;
|
|
73
75
|
async function withdrawBZZ(requestOptions, amount, address) {
|
|
74
76
|
const response = await (0, http_1.http)(requestOptions, {
|
|
75
77
|
method: 'post',
|
|
@@ -80,7 +82,6 @@ async function withdrawBZZ(requestOptions, amount, address) {
|
|
|
80
82
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
81
83
|
return new typed_bytes_1.TransactionId(cafe_utility_1.Types.asString(body.transactionHash, { name: 'transactionHash' }));
|
|
82
84
|
}
|
|
83
|
-
exports.withdrawBZZ = withdrawBZZ;
|
|
84
85
|
async function withdrawDAI(requestOptions, amount, address) {
|
|
85
86
|
const response = await (0, http_1.http)(requestOptions, {
|
|
86
87
|
method: 'post',
|
|
@@ -91,4 +92,3 @@ async function withdrawDAI(requestOptions, amount, address) {
|
|
|
91
92
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
92
93
|
return new typed_bytes_1.TransactionId(cafe_utility_1.Types.asString(body.transactionHash, { name: 'transactionHash' }));
|
|
93
94
|
}
|
|
94
|
-
exports.withdrawDAI = withdrawDAI;
|
|
@@ -3,12 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.SUPPORTED_API_VERSION = exports.SUPPORTED_BEE_VERSION = exports.SUPPORTED_BEE_VERSION_EXACT = void 0;
|
|
7
|
+
exports.getDebugStatus = getDebugStatus;
|
|
8
|
+
exports.getHealth = getHealth;
|
|
9
|
+
exports.getReadiness = getReadiness;
|
|
10
|
+
exports.getNodeInfo = getNodeInfo;
|
|
11
|
+
exports.isSupportedExactVersion = isSupportedExactVersion;
|
|
12
|
+
exports.isSupportedApiVersion = isSupportedApiVersion;
|
|
13
|
+
exports.getVersions = getVersions;
|
|
7
14
|
const cafe_utility_1 = require("cafe-utility");
|
|
8
15
|
const major_js_1 = __importDefault(require("semver/functions/major.js"));
|
|
9
16
|
const debug_1 = require("../../types/debug");
|
|
10
17
|
const http_1 = require("../../utils/http");
|
|
11
|
-
exports.SUPPORTED_BEE_VERSION_EXACT = '2.
|
|
18
|
+
exports.SUPPORTED_BEE_VERSION_EXACT = '2.7.0-6ddf9b45';
|
|
12
19
|
exports.SUPPORTED_BEE_VERSION = exports.SUPPORTED_BEE_VERSION_EXACT.split('-')[0];
|
|
13
20
|
exports.SUPPORTED_API_VERSION = '7.3.0';
|
|
14
21
|
const NODE_INFO_URL = 'node';
|
|
@@ -39,7 +46,6 @@ async function getDebugStatus(requestOptions) {
|
|
|
39
46
|
isWarmingUp: cafe_utility_1.Types.asBoolean(body.isWarmingUp, { name: 'isWarmingUp' }),
|
|
40
47
|
};
|
|
41
48
|
}
|
|
42
|
-
exports.getDebugStatus = getDebugStatus;
|
|
43
49
|
/**
|
|
44
50
|
* Get health of node
|
|
45
51
|
*
|
|
@@ -58,7 +64,6 @@ async function getHealth(requestOptions) {
|
|
|
58
64
|
status: cafe_utility_1.Types.asString(body.status, { name: 'status' }),
|
|
59
65
|
};
|
|
60
66
|
}
|
|
61
|
-
exports.getHealth = getHealth;
|
|
62
67
|
/**
|
|
63
68
|
* Get readiness of node
|
|
64
69
|
*
|
|
@@ -76,7 +81,6 @@ async function getReadiness(requestOptions) {
|
|
|
76
81
|
status: cafe_utility_1.Types.asString(body.status, { name: 'status' }),
|
|
77
82
|
};
|
|
78
83
|
}
|
|
79
|
-
exports.getReadiness = getReadiness;
|
|
80
84
|
/**
|
|
81
85
|
* Get information about Bee node
|
|
82
86
|
*
|
|
@@ -95,7 +99,6 @@ async function getNodeInfo(requestOptions) {
|
|
|
95
99
|
swapEnabled: cafe_utility_1.Types.asBoolean(body.swapEnabled, { name: 'swapEnabled' }),
|
|
96
100
|
};
|
|
97
101
|
}
|
|
98
|
-
exports.getNodeInfo = getNodeInfo;
|
|
99
102
|
/**
|
|
100
103
|
* Connects to a node and checks if its version matches with the one that bee-js supports.
|
|
101
104
|
*
|
|
@@ -108,7 +111,6 @@ async function isSupportedExactVersion(requestOptions) {
|
|
|
108
111
|
const { version } = await getHealth(requestOptions);
|
|
109
112
|
return version === exports.SUPPORTED_BEE_VERSION_EXACT;
|
|
110
113
|
}
|
|
111
|
-
exports.isSupportedExactVersion = isSupportedExactVersion;
|
|
112
114
|
/**
|
|
113
115
|
* Connects to a node and checks if its Main API versions matches with the one that bee-js supports.
|
|
114
116
|
*
|
|
@@ -120,7 +122,6 @@ async function isSupportedApiVersion(requestOptions) {
|
|
|
120
122
|
const { apiVersion } = await getHealth(requestOptions);
|
|
121
123
|
return (0, major_js_1.default)(apiVersion) === (0, major_js_1.default)(exports.SUPPORTED_API_VERSION);
|
|
122
124
|
}
|
|
123
|
-
exports.isSupportedApiVersion = isSupportedApiVersion;
|
|
124
125
|
/**
|
|
125
126
|
* Returns object with all versions specified by the connected Bee node (properties prefixed with `bee*`)
|
|
126
127
|
* and versions that bee-js supports (properties prefixed with `supported*`).
|
|
@@ -136,4 +137,3 @@ async function getVersions(requestOptions) {
|
|
|
136
137
|
beeApiVersion: apiVersion,
|
|
137
138
|
};
|
|
138
139
|
}
|
|
139
|
-
exports.getVersions = getVersions;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getAllTransactions = getAllTransactions;
|
|
4
|
+
exports.getTransaction = getTransaction;
|
|
5
|
+
exports.rebroadcastTransaction = rebroadcastTransaction;
|
|
6
|
+
exports.cancelTransaction = cancelTransaction;
|
|
4
7
|
const cafe_utility_1 = require("cafe-utility");
|
|
5
8
|
const http_1 = require("../../utils/http");
|
|
6
9
|
const type_1 = require("../../utils/type");
|
|
@@ -20,7 +23,6 @@ async function getAllTransactions(requestOptions) {
|
|
|
20
23
|
const pendingTransactions = cafe_utility_1.Types.asArray(body.pendingTransactions, { name: 'pendingTransactions' });
|
|
21
24
|
return pendingTransactions.map(toTransaction);
|
|
22
25
|
}
|
|
23
|
-
exports.getAllTransactions = getAllTransactions;
|
|
24
26
|
/**
|
|
25
27
|
* Get information for specific pending transactions
|
|
26
28
|
*
|
|
@@ -35,7 +37,6 @@ async function getTransaction(requestOptions, transactionHash) {
|
|
|
35
37
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
36
38
|
return toTransaction(body);
|
|
37
39
|
}
|
|
38
|
-
exports.getTransaction = getTransaction;
|
|
39
40
|
function toTransaction(value) {
|
|
40
41
|
const object = cafe_utility_1.Types.asObject(value, { name: 'transaction' });
|
|
41
42
|
return {
|
|
@@ -65,7 +66,6 @@ async function rebroadcastTransaction(requestOptions, transactionHash) {
|
|
|
65
66
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
66
67
|
return new typed_bytes_1.TransactionId(cafe_utility_1.Types.asString(body.transactionHash, { name: 'transactionHash' }));
|
|
67
68
|
}
|
|
68
|
-
exports.rebroadcastTransaction = rebroadcastTransaction;
|
|
69
69
|
/**
|
|
70
70
|
* Cancel existing transaction
|
|
71
71
|
*
|
|
@@ -87,4 +87,3 @@ async function cancelTransaction(requestOptions, transactionHash, gasPrice) {
|
|
|
87
87
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
88
88
|
return new typed_bytes_1.TransactionId(cafe_utility_1.Types.asString(body.transactionHash, { name: 'transactionHash' }));
|
|
89
89
|
}
|
|
90
|
-
exports.cancelTransaction = cancelTransaction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.postEnvelope =
|
|
3
|
+
exports.postEnvelope = postEnvelope;
|
|
4
4
|
const cafe_utility_1 = require("cafe-utility");
|
|
5
5
|
const http_1 = require("../utils/http");
|
|
6
6
|
const ENVELOPE_ENDPOINT = 'envelope';
|
|
@@ -22,4 +22,3 @@ async function postEnvelope(requestOptions, postageBatchId, reference) {
|
|
|
22
22
|
batchId: postageBatchId,
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
exports.postEnvelope = postEnvelope;
|
package/dist/cjs/modules/feed.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createFeedManifest = createFeedManifest;
|
|
4
|
+
exports.fetchLatestFeedUpdate = fetchLatestFeedUpdate;
|
|
5
|
+
exports.probeFeed = probeFeed;
|
|
4
6
|
const cafe_utility_1 = require("cafe-utility");
|
|
5
7
|
const bytes_1 = require("../utils/bytes");
|
|
6
8
|
const error_1 = require("../utils/error");
|
|
@@ -27,7 +29,6 @@ async function createFeedManifest(requestOptions, owner, topic, stamp, options)
|
|
|
27
29
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
28
30
|
return new typed_bytes_1.Reference(cafe_utility_1.Types.asHexString(body.reference));
|
|
29
31
|
}
|
|
30
|
-
exports.createFeedManifest = createFeedManifest;
|
|
31
32
|
function readFeedUpdateHeaders(headers) {
|
|
32
33
|
const feedIndex = headers['swarm-feed-index'];
|
|
33
34
|
const feedIndexNext = headers['swarm-feed-index-next'];
|
|
@@ -66,7 +67,6 @@ async function fetchLatestFeedUpdate(requestOptions, owner, topic, options) {
|
|
|
66
67
|
...readFeedUpdateHeaders(response.headers),
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
|
-
exports.fetchLatestFeedUpdate = fetchLatestFeedUpdate;
|
|
70
70
|
async function probeFeed(requestOptions, owner, topic) {
|
|
71
71
|
const response = await (0, http_1.http)(requestOptions, {
|
|
72
72
|
responseType: 'arraybuffer',
|
|
@@ -77,4 +77,3 @@ async function probeFeed(requestOptions, owner, topic) {
|
|
|
77
77
|
});
|
|
78
78
|
return readFeedUpdateHeaders(response.headers);
|
|
79
79
|
}
|
|
80
|
-
exports.probeFeed = probeFeed;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getGrantees = getGrantees;
|
|
4
|
+
exports.createGrantees = createGrantees;
|
|
5
|
+
exports.patchGrantees = patchGrantees;
|
|
4
6
|
const cafe_utility_1 = require("cafe-utility");
|
|
5
7
|
const headers_1 = require("../utils/headers");
|
|
6
8
|
const http_1 = require("../utils/http");
|
|
@@ -19,7 +21,6 @@ async function getGrantees(reference, requestOptions) {
|
|
|
19
21
|
grantees: body,
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
|
-
exports.getGrantees = getGrantees;
|
|
23
24
|
async function createGrantees(requestOptions, postageBatchId, grantees) {
|
|
24
25
|
const response = await (0, http_1.http)(requestOptions, {
|
|
25
26
|
method: 'post',
|
|
@@ -36,7 +37,6 @@ async function createGrantees(requestOptions, postageBatchId, grantees) {
|
|
|
36
37
|
historyref: new typed_bytes_1.Reference(cafe_utility_1.Types.asString(body.historyref, { name: 'historyref' })),
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
|
-
exports.createGrantees = createGrantees;
|
|
40
40
|
async function patchGrantees(postageBatchId, reference, historyRef, grantees, requestOptions) {
|
|
41
41
|
const response = await (0, http_1.http)(requestOptions, {
|
|
42
42
|
method: 'patch',
|
|
@@ -59,4 +59,3 @@ async function patchGrantees(postageBatchId, reference, historyRef, grantees, re
|
|
|
59
59
|
historyref: new typed_bytes_1.Reference(cafe_utility_1.Types.asString(body.historyref, { name: 'historyref' })),
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
exports.patchGrantees = patchGrantees;
|
package/dist/cjs/modules/gsoc.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.send = send;
|
|
7
|
+
exports.subscribe = subscribe;
|
|
7
8
|
const cafe_utility_1 = require("cafe-utility");
|
|
8
9
|
const isomorphic_ws_1 = __importDefault(require("isomorphic-ws"));
|
|
9
10
|
const soc_1 = require("../chunk/soc");
|
|
@@ -11,7 +12,6 @@ const endpoint = 'gsoc';
|
|
|
11
12
|
async function send(requestOptions, soc, stamp, options) {
|
|
12
13
|
return (0, soc_1.uploadSingleOwnerChunk)(requestOptions, soc, stamp, options);
|
|
13
14
|
}
|
|
14
|
-
exports.send = send;
|
|
15
15
|
function subscribe(url, reference, headers) {
|
|
16
16
|
const wsUrl = url.replace(/^http/i, 'ws');
|
|
17
17
|
if (cafe_utility_1.System.whereAmI() === 'browser') {
|
|
@@ -21,4 +21,3 @@ function subscribe(url, reference, headers) {
|
|
|
21
21
|
headers,
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
exports.subscribe = subscribe;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.pin = pin;
|
|
4
|
+
exports.unpin = unpin;
|
|
5
|
+
exports.getPin = getPin;
|
|
6
|
+
exports.getAllPins = getAllPins;
|
|
4
7
|
const cafe_utility_1 = require("cafe-utility");
|
|
5
8
|
const http_1 = require("../utils/http");
|
|
6
9
|
const typed_bytes_1 = require("../utils/typed-bytes");
|
|
@@ -18,7 +21,6 @@ async function pin(requestOptions, reference) {
|
|
|
18
21
|
url: `${PINNING_ENDPOINT}/${reference}`,
|
|
19
22
|
});
|
|
20
23
|
}
|
|
21
|
-
exports.pin = pin;
|
|
22
24
|
/**
|
|
23
25
|
* Unpin data with given reference
|
|
24
26
|
*
|
|
@@ -32,7 +34,6 @@ async function unpin(requestOptions, reference) {
|
|
|
32
34
|
url: `${PINNING_ENDPOINT}/${reference}`,
|
|
33
35
|
});
|
|
34
36
|
}
|
|
35
|
-
exports.unpin = unpin;
|
|
36
37
|
/**
|
|
37
38
|
* Get pin status for specific address.
|
|
38
39
|
*
|
|
@@ -51,7 +52,6 @@ async function getPin(requestOptions, reference) {
|
|
|
51
52
|
reference: new typed_bytes_1.Reference(cafe_utility_1.Types.asString(body.reference, { name: 'reference' })),
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
|
-
exports.getPin = getPin;
|
|
55
55
|
/**
|
|
56
56
|
* Get list of all pins
|
|
57
57
|
*
|
|
@@ -71,4 +71,3 @@ async function getAllPins(requestOptions) {
|
|
|
71
71
|
const references = cafe_utility_1.Types.asArray(body.references, { name: 'references' }).map(x => cafe_utility_1.Types.asString(x, { name: 'reference' }));
|
|
72
72
|
return references.map(x => new typed_bytes_1.Reference(x));
|
|
73
73
|
}
|
|
74
|
-
exports.getAllPins = getAllPins;
|
package/dist/cjs/modules/pss.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.send = send;
|
|
7
|
+
exports.subscribe = subscribe;
|
|
7
8
|
const cafe_utility_1 = require("cafe-utility");
|
|
8
9
|
const isomorphic_ws_1 = __importDefault(require("isomorphic-ws"));
|
|
9
10
|
const headers_1 = require("../utils/headers");
|
|
@@ -30,7 +31,6 @@ async function send(requestOptions, topic, target, data, postageBatchId, recipie
|
|
|
30
31
|
headers: (0, headers_1.prepareRequestHeaders)(postageBatchId),
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
|
-
exports.send = send;
|
|
34
34
|
/**
|
|
35
35
|
* Subscribe for messages on the given topic
|
|
36
36
|
*
|
|
@@ -46,4 +46,3 @@ function subscribe(url, topic, headers) {
|
|
|
46
46
|
headers,
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
exports.subscribe = subscribe;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rchash =
|
|
3
|
+
exports.rchash = rchash;
|
|
4
4
|
const cafe_utility_1 = require("cafe-utility");
|
|
5
5
|
const http_1 = require("../utils/http");
|
|
6
6
|
const RCHASH_ENDPOINT = 'rchash';
|
|
@@ -12,4 +12,3 @@ async function rchash(requestOptions, depth, anchor1, anchor2) {
|
|
|
12
12
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
13
13
|
return cafe_utility_1.Types.asNumber(body.durationSeconds, { name: 'durationSeconds' });
|
|
14
14
|
}
|
|
15
|
-
exports.rchash = rchash;
|
package/dist/cjs/modules/soc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.upload =
|
|
3
|
+
exports.upload = upload;
|
|
4
4
|
const cafe_utility_1 = require("cafe-utility");
|
|
5
5
|
const headers_1 = require("../utils/headers");
|
|
6
6
|
const http_1 = require("../utils/http");
|
|
@@ -39,4 +39,3 @@ async function upload(requestOptions, owner, identifier, signature, data, stamp,
|
|
|
39
39
|
: cafe_utility_1.Optional.empty(),
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
exports.upload = upload;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.checkConnection = checkConnection;
|
|
4
|
+
exports.isGateway = isGateway;
|
|
4
5
|
const cafe_utility_1 = require("cafe-utility");
|
|
5
6
|
const http_1 = require("../utils/http");
|
|
6
7
|
/**
|
|
@@ -13,7 +14,6 @@ async function checkConnection(requestOptions) {
|
|
|
13
14
|
url: '',
|
|
14
15
|
});
|
|
15
16
|
}
|
|
16
|
-
exports.checkConnection = checkConnection;
|
|
17
17
|
async function isGateway(requestOptions) {
|
|
18
18
|
try {
|
|
19
19
|
const response = await (0, http_1.http)(requestOptions, {
|
|
@@ -26,4 +26,3 @@ async function isGateway(requestOptions) {
|
|
|
26
26
|
return false;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
exports.isGateway = isGateway;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.reupload = reupload;
|
|
4
|
+
exports.isRetrievable = isRetrievable;
|
|
4
5
|
const cafe_utility_1 = require("cafe-utility");
|
|
5
6
|
const http_1 = require("../utils/http");
|
|
6
7
|
const typed_bytes_1 = require("../utils/typed-bytes");
|
|
@@ -18,7 +19,6 @@ async function reupload(requestOptions, stamp, reference) {
|
|
|
18
19
|
headers: { 'swarm-postage-batch-id': stamp.toHex() },
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
|
-
exports.reupload = reupload;
|
|
22
22
|
async function isRetrievable(requestOptions, reference) {
|
|
23
23
|
reference = new typed_bytes_1.Reference(reference);
|
|
24
24
|
const response = await (0, http_1.http)(requestOptions, {
|
|
@@ -29,4 +29,3 @@ async function isRetrievable(requestOptions, reference) {
|
|
|
29
29
|
const body = cafe_utility_1.Types.asObject(response.data, { name: 'response.data' });
|
|
30
30
|
return cafe_utility_1.Types.asBoolean(body.isRetrievable, { name: 'isRetrievable' });
|
|
31
31
|
}
|
|
32
|
-
exports.isRetrievable = isRetrievable;
|
package/dist/cjs/modules/tag.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createTag = createTag;
|
|
4
|
+
exports.retrieveTag = retrieveTag;
|
|
5
|
+
exports.getAllTags = getAllTags;
|
|
6
|
+
exports.deleteTag = deleteTag;
|
|
7
|
+
exports.updateTag = updateTag;
|
|
4
8
|
const cafe_utility_1 = require("cafe-utility");
|
|
5
9
|
const http_1 = require("../utils/http");
|
|
6
10
|
const endpoint = 'tags';
|
|
@@ -27,7 +31,6 @@ async function createTag(requestOptions) {
|
|
|
27
31
|
uid: cafe_utility_1.Types.asNumber(body.uid, { name: 'uid' }),
|
|
28
32
|
};
|
|
29
33
|
}
|
|
30
|
-
exports.createTag = createTag;
|
|
31
34
|
/**
|
|
32
35
|
* Retrieve tag information from Bee node
|
|
33
36
|
*
|
|
@@ -51,7 +54,6 @@ async function retrieveTag(requestOptions, uid) {
|
|
|
51
54
|
uid: cafe_utility_1.Types.asNumber(body.uid, { name: 'uid' }),
|
|
52
55
|
};
|
|
53
56
|
}
|
|
54
|
-
exports.retrieveTag = retrieveTag;
|
|
55
57
|
/**
|
|
56
58
|
* Get limited listing of all tags.
|
|
57
59
|
*
|
|
@@ -78,7 +80,6 @@ async function getAllTags(requestOptions, offset, limit) {
|
|
|
78
80
|
uid: cafe_utility_1.Types.asNumber(x.uid, { name: 'uid' }),
|
|
79
81
|
}));
|
|
80
82
|
}
|
|
81
|
-
exports.getAllTags = getAllTags;
|
|
82
83
|
/**
|
|
83
84
|
* Removes tag from the Bee node.
|
|
84
85
|
* @param url
|
|
@@ -90,7 +91,6 @@ async function deleteTag(requestOptions, uid) {
|
|
|
90
91
|
url: `${endpoint}/${uid}`,
|
|
91
92
|
});
|
|
92
93
|
}
|
|
93
|
-
exports.deleteTag = deleteTag;
|
|
94
94
|
/**
|
|
95
95
|
* Updates tag
|
|
96
96
|
* @param url
|
|
@@ -106,4 +106,3 @@ async function updateTag(requestOptions, uid, reference) {
|
|
|
106
106
|
},
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
exports.updateTag = updateTag;
|