@eluvio/elv-client-js 4.0.146 → 4.1.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/ElvClient-min.js +2 -68
- package/dist/ElvClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvClient-node-min.js +2 -67
- package/dist/ElvClient-node-min.js.LICENSE.txt +72 -0
- package/dist/ElvFrameClient-min.js +2 -60
- package/dist/ElvFrameClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvPermissionsClient-min.js +2 -60
- package/dist/ElvPermissionsClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvWalletClient-min.js +2 -68
- package/dist/ElvWalletClient-min.js.LICENSE.txt +72 -0
- package/dist/ElvWalletClient-node-min.js +2 -67
- package/dist/ElvWalletClient-node-min.js.LICENSE.txt +72 -0
- package/dist/src/AuthorizationClient.js +704 -703
- package/dist/src/ContentObjectAudit.js +56 -56
- package/dist/src/Crypto.js +85 -86
- package/dist/src/ElvClient.js +483 -471
- package/dist/src/ElvWallet.js +23 -23
- package/dist/src/EthClient.js +308 -307
- package/dist/src/FrameClient.js +62 -62
- package/dist/src/HttpClient.js +59 -58
- package/dist/src/PermissionsClient.js +470 -470
- package/dist/src/RemoteSigner.js +77 -76
- package/dist/src/UserProfileClient.js +357 -354
- package/dist/src/Utils.js +65 -64
- package/dist/src/Validation.js +10 -10
- package/dist/src/client/ABRPublishing.js +237 -237
- package/dist/src/client/AccessGroups.js +477 -474
- package/dist/src/client/ContentAccess.js +1749 -1802
- package/dist/src/client/ContentManagement.js +871 -871
- package/dist/src/client/Contracts.js +575 -578
- package/dist/src/client/Files.js +700 -684
- package/dist/src/client/LiveStream.js +659 -650
- package/dist/src/client/NFT.js +14 -14
- package/dist/src/client/NTP.js +84 -84
- package/dist/src/client/Shares.js +49 -49
- package/dist/src/walletClient/ClientMethods.js +977 -951
- package/dist/src/walletClient/Notifications.js +14 -14
- package/dist/src/walletClient/Profile.js +66 -66
- package/dist/src/walletClient/Utils.js +15 -15
- package/dist/src/walletClient/index.js +557 -550
- package/package.json +17 -16
- package/src/ElvClient.js +1 -0
- package/src/FrameClient.js +12 -0
- package/src/client/AccessGroups.js +1 -1
- package/src/client/ContentAccess.js +44 -71
- package/testScripts/Test.js +5 -1
- package/webpack.config.js +10 -13
- package/dist/src/ContentObjectVerification.js +0 -281
|
@@ -71,62 +71,62 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
71
71
|
}, {
|
|
72
72
|
key: "CreateWallet",
|
|
73
73
|
value: function () {
|
|
74
|
-
var _CreateWallet = _asyncToGenerator(
|
|
75
|
-
var balance, walletCreationEvent, abi, libraryId, objectId, createResponse;
|
|
76
|
-
return _regeneratorRuntime.wrap(function
|
|
74
|
+
var _CreateWallet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
75
|
+
var balance, walletCreationEvent, abi, libraryId, objectId, createResponse, _t, _t2;
|
|
76
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
77
77
|
while (1) switch (_context.prev = _context.next) {
|
|
78
78
|
case 0:
|
|
79
79
|
if (!this.creatingWallet) {
|
|
80
|
-
_context.next =
|
|
80
|
+
_context.next = 3;
|
|
81
81
|
break;
|
|
82
82
|
}
|
|
83
83
|
case 1:
|
|
84
84
|
if (!this.creatingWallet) {
|
|
85
|
-
_context.next =
|
|
85
|
+
_context.next = 3;
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
|
-
_context.next =
|
|
88
|
+
_context.next = 2;
|
|
89
89
|
return new Promise(function (resolve) {
|
|
90
90
|
return setTimeout(resolve, 500);
|
|
91
91
|
});
|
|
92
|
-
case
|
|
92
|
+
case 2:
|
|
93
93
|
_context.next = 1;
|
|
94
94
|
break;
|
|
95
|
-
case
|
|
95
|
+
case 3:
|
|
96
96
|
this.creatingWallet = true;
|
|
97
|
-
_context.prev =
|
|
97
|
+
_context.prev = 4;
|
|
98
98
|
if (!(!this.walletAddress || Utils.EqualAddress(this.walletAddress, Utils.nullAddress))) {
|
|
99
|
-
_context.next =
|
|
99
|
+
_context.next = 9;
|
|
100
100
|
break;
|
|
101
101
|
}
|
|
102
102
|
this.Log("Creating user wallet for user ".concat(this.client.signer.address));
|
|
103
103
|
|
|
104
104
|
// Don't attempt to create a user wallet if user has no funds
|
|
105
|
-
_context.next =
|
|
105
|
+
_context.next = 5;
|
|
106
106
|
return this.client.GetBalance({
|
|
107
107
|
address: this.client.signer.address
|
|
108
108
|
});
|
|
109
|
-
case
|
|
109
|
+
case 5:
|
|
110
110
|
balance = _context.sent;
|
|
111
111
|
if (!(balance < 0.05)) {
|
|
112
|
-
_context.next =
|
|
112
|
+
_context.next = 6;
|
|
113
113
|
break;
|
|
114
114
|
}
|
|
115
115
|
return _context.abrupt("return", undefined);
|
|
116
|
-
case
|
|
117
|
-
_context.next =
|
|
116
|
+
case 6:
|
|
117
|
+
_context.next = 7;
|
|
118
118
|
return this.client.CallContractMethodAndWait({
|
|
119
119
|
contractAddress: Utils.HashToAddress(this.client.contentSpaceId),
|
|
120
120
|
methodName: "createAccessWallet",
|
|
121
121
|
methodArgs: []
|
|
122
122
|
});
|
|
123
|
-
case
|
|
123
|
+
case 7:
|
|
124
124
|
walletCreationEvent = _context.sent;
|
|
125
|
-
_context.next =
|
|
125
|
+
_context.next = 8;
|
|
126
126
|
return this.client.ContractAbi({
|
|
127
127
|
contractAddress: this.client.contentSpaceAddress
|
|
128
128
|
});
|
|
129
|
-
case
|
|
129
|
+
case 8:
|
|
130
130
|
abi = _context.sent;
|
|
131
131
|
this.walletAddress = this.client.ExtractValueFromEvent({
|
|
132
132
|
abi: abi,
|
|
@@ -135,60 +135,60 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
135
135
|
eventValue: "wallet"
|
|
136
136
|
});
|
|
137
137
|
this.userWalletAddresses[Utils.FormatAddress(this.client.signer.address)] = this.walletAddress;
|
|
138
|
-
case
|
|
138
|
+
case 9:
|
|
139
139
|
// Check if wallet object is created
|
|
140
140
|
libraryId = this.client.contentSpaceLibraryId;
|
|
141
141
|
objectId = Utils.AddressToObjectId(this.walletAddress);
|
|
142
|
-
_context.prev =
|
|
143
|
-
_context.next =
|
|
142
|
+
_context.prev = 10;
|
|
143
|
+
_context.next = 11;
|
|
144
144
|
return this.client.ContentObject({
|
|
145
145
|
libraryId: libraryId,
|
|
146
146
|
objectId: objectId
|
|
147
147
|
});
|
|
148
|
-
case
|
|
149
|
-
_context.next =
|
|
148
|
+
case 11:
|
|
149
|
+
_context.next = 14;
|
|
150
150
|
break;
|
|
151
|
-
case
|
|
152
|
-
_context.prev =
|
|
153
|
-
|
|
154
|
-
if (!(
|
|
155
|
-
_context.next =
|
|
151
|
+
case 12:
|
|
152
|
+
_context.prev = 12;
|
|
153
|
+
_t = _context["catch"](10);
|
|
154
|
+
if (!(_t.status === 404)) {
|
|
155
|
+
_context.next = 14;
|
|
156
156
|
break;
|
|
157
157
|
}
|
|
158
158
|
this.Log("Creating wallet object for user ".concat(this.client.signer.address));
|
|
159
|
-
_context.next =
|
|
159
|
+
_context.next = 13;
|
|
160
160
|
return this.client.CreateContentObject({
|
|
161
161
|
libraryId: libraryId,
|
|
162
162
|
objectId: objectId
|
|
163
163
|
});
|
|
164
|
-
case
|
|
164
|
+
case 13:
|
|
165
165
|
createResponse = _context.sent;
|
|
166
|
-
_context.next =
|
|
166
|
+
_context.next = 14;
|
|
167
167
|
return this.client.FinalizeContentObject({
|
|
168
168
|
libraryId: libraryId,
|
|
169
169
|
objectId: objectId,
|
|
170
170
|
writeToken: createResponse.write_token,
|
|
171
171
|
commitMessage: "Create user wallet object"
|
|
172
172
|
});
|
|
173
|
-
case
|
|
174
|
-
_context.next =
|
|
173
|
+
case 14:
|
|
174
|
+
_context.next = 16;
|
|
175
175
|
break;
|
|
176
|
-
case
|
|
177
|
-
_context.prev =
|
|
178
|
-
|
|
176
|
+
case 15:
|
|
177
|
+
_context.prev = 15;
|
|
178
|
+
_t2 = _context["catch"](4);
|
|
179
179
|
// eslint-disable-next-line no-console
|
|
180
180
|
console.error("Failed to create wallet contract:");
|
|
181
181
|
// eslint-disable-next-line no-console
|
|
182
|
-
console.error(
|
|
183
|
-
case
|
|
184
|
-
_context.prev =
|
|
182
|
+
console.error(_t2);
|
|
183
|
+
case 16:
|
|
184
|
+
_context.prev = 16;
|
|
185
185
|
this.creatingWallet = false;
|
|
186
|
-
return _context.finish(
|
|
187
|
-
case
|
|
186
|
+
return _context.finish(16);
|
|
187
|
+
case 17:
|
|
188
188
|
case "end":
|
|
189
189
|
return _context.stop();
|
|
190
190
|
}
|
|
191
|
-
}, _callee, this, [[
|
|
191
|
+
}, _callee, this, [[4, 15, 16, 17], [10, 12]]);
|
|
192
192
|
}));
|
|
193
193
|
function CreateWallet() {
|
|
194
194
|
return _CreateWallet.apply(this, arguments);
|
|
@@ -203,20 +203,20 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
203
203
|
}, {
|
|
204
204
|
key: "WalletAddress",
|
|
205
205
|
value: (function () {
|
|
206
|
-
var _WalletAddress = _asyncToGenerator(
|
|
206
|
+
var _WalletAddress = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
207
207
|
var autoCreate,
|
|
208
208
|
walletAddress,
|
|
209
209
|
_args2 = arguments;
|
|
210
|
-
return _regeneratorRuntime.wrap(function
|
|
210
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
211
211
|
while (1) switch (_context2.prev = _context2.next) {
|
|
212
212
|
case 0:
|
|
213
213
|
autoCreate = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : true;
|
|
214
214
|
if (!(this.walletAddress || this.walletAddressRetrieved)) {
|
|
215
|
-
_context2.next =
|
|
215
|
+
_context2.next = 1;
|
|
216
216
|
break;
|
|
217
217
|
}
|
|
218
218
|
return _context2.abrupt("return", this.walletAddress);
|
|
219
|
-
case
|
|
219
|
+
case 1:
|
|
220
220
|
if (!this.walletAddressPromise) {
|
|
221
221
|
this.walletAddressPromise = this.client.CallContractMethod({
|
|
222
222
|
contractAddress: Utils.HashToAddress(this.client.contentSpaceId),
|
|
@@ -224,23 +224,23 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
224
224
|
methodArgs: [this.client.signer.address]
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
|
-
_context2.next =
|
|
227
|
+
_context2.next = 2;
|
|
228
228
|
return this.walletAddressPromise;
|
|
229
|
-
case
|
|
229
|
+
case 2:
|
|
230
230
|
walletAddress = _context2.sent;
|
|
231
231
|
if (!Utils.EqualAddress(walletAddress, Utils.nullAddress)) {
|
|
232
232
|
this.walletAddress = walletAddress;
|
|
233
233
|
}
|
|
234
234
|
if (!(!this.walletAddress && autoCreate)) {
|
|
235
|
-
_context2.next =
|
|
235
|
+
_context2.next = 3;
|
|
236
236
|
break;
|
|
237
237
|
}
|
|
238
|
-
_context2.next =
|
|
238
|
+
_context2.next = 3;
|
|
239
239
|
return this.CreateWallet();
|
|
240
|
-
case
|
|
240
|
+
case 3:
|
|
241
241
|
this.walletAddressRetrieved = true;
|
|
242
242
|
return _context2.abrupt("return", this.walletAddress);
|
|
243
|
-
case
|
|
243
|
+
case 4:
|
|
244
244
|
case "end":
|
|
245
245
|
return _context2.stop();
|
|
246
246
|
}
|
|
@@ -263,40 +263,40 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
263
263
|
}, {
|
|
264
264
|
key: "UserWalletAddress",
|
|
265
265
|
value: (function () {
|
|
266
|
-
var _UserWalletAddress = _asyncToGenerator(
|
|
266
|
+
var _UserWalletAddress = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref2) {
|
|
267
267
|
var address, walletAddress;
|
|
268
|
-
return _regeneratorRuntime.wrap(function
|
|
268
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
269
269
|
while (1) switch (_context3.prev = _context3.next) {
|
|
270
270
|
case 0:
|
|
271
271
|
address = _ref2.address;
|
|
272
272
|
if (!Utils.EqualAddress(address, this.client.signer.address)) {
|
|
273
|
-
_context3.next =
|
|
273
|
+
_context3.next = 2;
|
|
274
274
|
break;
|
|
275
275
|
}
|
|
276
|
-
_context3.next =
|
|
276
|
+
_context3.next = 1;
|
|
277
277
|
return this.WalletAddress();
|
|
278
|
-
case
|
|
278
|
+
case 1:
|
|
279
279
|
return _context3.abrupt("return", _context3.sent);
|
|
280
|
-
case
|
|
280
|
+
case 2:
|
|
281
281
|
if (this.userWalletAddresses[address]) {
|
|
282
|
-
_context3.next =
|
|
282
|
+
_context3.next = 4;
|
|
283
283
|
break;
|
|
284
284
|
}
|
|
285
285
|
this.Log("Retrieving user wallet address for user ".concat(address));
|
|
286
|
-
_context3.next =
|
|
286
|
+
_context3.next = 3;
|
|
287
287
|
return this.client.CallContractMethod({
|
|
288
288
|
contractAddress: Utils.HashToAddress(this.client.contentSpaceId),
|
|
289
289
|
methodName: "userWallets",
|
|
290
290
|
methodArgs: [address]
|
|
291
291
|
});
|
|
292
|
-
case
|
|
292
|
+
case 3:
|
|
293
293
|
walletAddress = _context3.sent;
|
|
294
294
|
if (!Utils.EqualAddress(walletAddress, Utils.nullAddress)) {
|
|
295
295
|
this.userWalletAddresses[address] = walletAddress;
|
|
296
296
|
}
|
|
297
|
-
case
|
|
297
|
+
case 4:
|
|
298
298
|
return _context3.abrupt("return", this.userWalletAddresses[address]);
|
|
299
|
-
case
|
|
299
|
+
case 5:
|
|
300
300
|
case "end":
|
|
301
301
|
return _context3.stop();
|
|
302
302
|
}
|
|
@@ -320,39 +320,40 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
320
320
|
}, {
|
|
321
321
|
key: "UserWalletObjectInfo",
|
|
322
322
|
value: (function () {
|
|
323
|
-
var _UserWalletObjectInfo = _asyncToGenerator(
|
|
323
|
+
var _UserWalletObjectInfo = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
324
324
|
var _ref3,
|
|
325
325
|
address,
|
|
326
326
|
walletAddress,
|
|
327
|
-
_args4 = arguments
|
|
328
|
-
|
|
327
|
+
_args4 = arguments,
|
|
328
|
+
_t3;
|
|
329
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
329
330
|
while (1) switch (_context4.prev = _context4.next) {
|
|
330
331
|
case 0:
|
|
331
332
|
_ref3 = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, address = _ref3.address;
|
|
332
333
|
if (!address) {
|
|
333
|
-
_context4.next =
|
|
334
|
+
_context4.next = 2;
|
|
334
335
|
break;
|
|
335
336
|
}
|
|
336
|
-
_context4.next =
|
|
337
|
+
_context4.next = 1;
|
|
337
338
|
return this.UserWalletAddress({
|
|
338
339
|
address: address
|
|
339
340
|
});
|
|
340
|
-
case
|
|
341
|
-
|
|
342
|
-
_context4.next =
|
|
341
|
+
case 1:
|
|
342
|
+
_t3 = _context4.sent;
|
|
343
|
+
_context4.next = 4;
|
|
343
344
|
break;
|
|
344
|
-
case
|
|
345
|
-
_context4.next =
|
|
345
|
+
case 2:
|
|
346
|
+
_context4.next = 3;
|
|
346
347
|
return this.WalletAddress();
|
|
347
|
-
case
|
|
348
|
-
|
|
349
|
-
case
|
|
350
|
-
walletAddress =
|
|
348
|
+
case 3:
|
|
349
|
+
_t3 = _context4.sent;
|
|
350
|
+
case 4:
|
|
351
|
+
walletAddress = _t3;
|
|
351
352
|
return _context4.abrupt("return", {
|
|
352
353
|
libraryId: this.client.contentSpaceLibraryId,
|
|
353
354
|
objectId: walletAddress ? Utils.AddressToObjectId(walletAddress) : ""
|
|
354
355
|
});
|
|
355
|
-
case
|
|
356
|
+
case 5:
|
|
356
357
|
case "end":
|
|
357
358
|
return _context4.stop();
|
|
358
359
|
}
|
|
@@ -395,46 +396,46 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
395
396
|
}, {
|
|
396
397
|
key: "PublicUserMetadata",
|
|
397
398
|
value: (function () {
|
|
398
|
-
var _PublicUserMetadata = _asyncToGenerator(
|
|
399
|
+
var _PublicUserMetadata = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref4) {
|
|
399
400
|
var address, _ref4$metadataSubtree, metadataSubtree, _ref4$queryParams, queryParams, _ref4$select, select, _ref4$resolveLinks, resolveLinks, _ref4$resolveIncludeS, resolveIncludeSource, _ref4$resolveIgnoreEr, resolveIgnoreErrors, _ref4$linkDepthLimit, linkDepthLimit, walletAddress, _yield$this$UserWalle, libraryId, objectId;
|
|
400
|
-
return _regeneratorRuntime.wrap(function
|
|
401
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
401
402
|
while (1) switch (_context5.prev = _context5.next) {
|
|
402
403
|
case 0:
|
|
403
404
|
address = _ref4.address, _ref4$metadataSubtree = _ref4.metadataSubtree, metadataSubtree = _ref4$metadataSubtree === void 0 ? "/" : _ref4$metadataSubtree, _ref4$queryParams = _ref4.queryParams, queryParams = _ref4$queryParams === void 0 ? {} : _ref4$queryParams, _ref4$select = _ref4.select, select = _ref4$select === void 0 ? [] : _ref4$select, _ref4$resolveLinks = _ref4.resolveLinks, resolveLinks = _ref4$resolveLinks === void 0 ? false : _ref4$resolveLinks, _ref4$resolveIncludeS = _ref4.resolveIncludeSource, resolveIncludeSource = _ref4$resolveIncludeS === void 0 ? false : _ref4$resolveIncludeS, _ref4$resolveIgnoreEr = _ref4.resolveIgnoreErrors, resolveIgnoreErrors = _ref4$resolveIgnoreEr === void 0 ? false : _ref4$resolveIgnoreEr, _ref4$linkDepthLimit = _ref4.linkDepthLimit, linkDepthLimit = _ref4$linkDepthLimit === void 0 ? 1 : _ref4$linkDepthLimit;
|
|
404
405
|
if (address) {
|
|
405
|
-
_context5.next =
|
|
406
|
+
_context5.next = 1;
|
|
406
407
|
break;
|
|
407
408
|
}
|
|
408
409
|
return _context5.abrupt("return");
|
|
409
|
-
case
|
|
410
|
-
_context5.next =
|
|
410
|
+
case 1:
|
|
411
|
+
_context5.next = 2;
|
|
411
412
|
return this.UserWalletAddress({
|
|
412
413
|
address: address
|
|
413
414
|
});
|
|
414
|
-
case
|
|
415
|
+
case 2:
|
|
415
416
|
walletAddress = _context5.sent;
|
|
416
417
|
if (walletAddress) {
|
|
417
|
-
_context5.next =
|
|
418
|
+
_context5.next = 3;
|
|
418
419
|
break;
|
|
419
420
|
}
|
|
420
421
|
return _context5.abrupt("return");
|
|
421
|
-
case
|
|
422
|
+
case 3:
|
|
422
423
|
metadataSubtree = UrlJoin("public", metadataSubtree || "/");
|
|
423
|
-
_context5.next =
|
|
424
|
+
_context5.next = 4;
|
|
424
425
|
return this.UserWalletObjectInfo({
|
|
425
426
|
address: address
|
|
426
427
|
});
|
|
427
|
-
case
|
|
428
|
+
case 4:
|
|
428
429
|
_yield$this$UserWalle = _context5.sent;
|
|
429
430
|
libraryId = _yield$this$UserWalle.libraryId;
|
|
430
431
|
objectId = _yield$this$UserWalle.objectId;
|
|
431
432
|
if (objectId) {
|
|
432
|
-
_context5.next =
|
|
433
|
+
_context5.next = 5;
|
|
433
434
|
break;
|
|
434
435
|
}
|
|
435
436
|
return _context5.abrupt("return");
|
|
436
|
-
case
|
|
437
|
-
_context5.next =
|
|
437
|
+
case 5:
|
|
438
|
+
_context5.next = 6;
|
|
438
439
|
return this.client.ContentObjectMetadata({
|
|
439
440
|
libraryId: libraryId,
|
|
440
441
|
objectId: objectId,
|
|
@@ -446,9 +447,9 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
446
447
|
resolveIgnoreErrors: resolveIgnoreErrors,
|
|
447
448
|
linkDepthLimit: linkDepthLimit
|
|
448
449
|
});
|
|
449
|
-
case
|
|
450
|
+
case 6:
|
|
450
451
|
return _context5.abrupt("return", _context5.sent);
|
|
451
|
-
case
|
|
452
|
+
case 7:
|
|
452
453
|
case "end":
|
|
453
454
|
return _context5.stop();
|
|
454
455
|
}
|
|
@@ -494,7 +495,7 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
494
495
|
}, {
|
|
495
496
|
key: "UserMetadata",
|
|
496
497
|
value: (function () {
|
|
497
|
-
var _UserMetadata = _asyncToGenerator(
|
|
498
|
+
var _UserMetadata = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
|
|
498
499
|
var _ref5,
|
|
499
500
|
_ref5$metadataSubtree,
|
|
500
501
|
metadataSubtree,
|
|
@@ -514,18 +515,18 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
514
515
|
libraryId,
|
|
515
516
|
objectId,
|
|
516
517
|
_args6 = arguments;
|
|
517
|
-
return _regeneratorRuntime.wrap(function
|
|
518
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
518
519
|
while (1) switch (_context6.prev = _context6.next) {
|
|
519
520
|
case 0:
|
|
520
521
|
_ref5 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, _ref5$metadataSubtree = _ref5.metadataSubtree, metadataSubtree = _ref5$metadataSubtree === void 0 ? "/" : _ref5$metadataSubtree, _ref5$queryParams = _ref5.queryParams, queryParams = _ref5$queryParams === void 0 ? {} : _ref5$queryParams, _ref5$select = _ref5.select, select = _ref5$select === void 0 ? [] : _ref5$select, _ref5$resolveLinks = _ref5.resolveLinks, resolveLinks = _ref5$resolveLinks === void 0 ? false : _ref5$resolveLinks, _ref5$resolveIncludeS = _ref5.resolveIncludeSource, resolveIncludeSource = _ref5$resolveIncludeS === void 0 ? false : _ref5$resolveIncludeS, _ref5$resolveIgnoreEr = _ref5.resolveIgnoreErrors, resolveIgnoreErrors = _ref5$resolveIgnoreEr === void 0 ? false : _ref5$resolveIgnoreEr, _ref5$linkDepthLimit = _ref5.linkDepthLimit, linkDepthLimit = _ref5$linkDepthLimit === void 0 ? 1 : _ref5$linkDepthLimit;
|
|
521
522
|
this.Log("Accessing private user metadata at ".concat(metadataSubtree));
|
|
522
|
-
_context6.next =
|
|
523
|
+
_context6.next = 1;
|
|
523
524
|
return this.UserWalletObjectInfo();
|
|
524
|
-
case
|
|
525
|
+
case 1:
|
|
525
526
|
_yield$this$UserWalle2 = _context6.sent;
|
|
526
527
|
libraryId = _yield$this$UserWalle2.libraryId;
|
|
527
528
|
objectId = _yield$this$UserWalle2.objectId;
|
|
528
|
-
_context6.next =
|
|
529
|
+
_context6.next = 2;
|
|
529
530
|
return this.client.ContentObjectMetadata({
|
|
530
531
|
libraryId: libraryId,
|
|
531
532
|
objectId: objectId,
|
|
@@ -537,9 +538,9 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
537
538
|
resolveIgnoreErrors: resolveIgnoreErrors,
|
|
538
539
|
linkDepthLimit: linkDepthLimit
|
|
539
540
|
});
|
|
540
|
-
case
|
|
541
|
+
case 2:
|
|
541
542
|
return _context6.abrupt("return", _context6.sent);
|
|
542
|
-
case
|
|
543
|
+
case 3:
|
|
543
544
|
case "end":
|
|
544
545
|
return _context6.stop();
|
|
545
546
|
}
|
|
@@ -561,27 +562,27 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
561
562
|
}, {
|
|
562
563
|
key: "MergeUserMetadata",
|
|
563
564
|
value: (function () {
|
|
564
|
-
var _MergeUserMetadata = _asyncToGenerator(
|
|
565
|
+
var _MergeUserMetadata = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref6) {
|
|
565
566
|
var _ref6$metadataSubtree, metadataSubtree, _ref6$metadata, metadata, _yield$this$UserWalle3, libraryId, objectId, editRequest;
|
|
566
|
-
return _regeneratorRuntime.wrap(function
|
|
567
|
+
return _regeneratorRuntime.wrap(function (_context7) {
|
|
567
568
|
while (1) switch (_context7.prev = _context7.next) {
|
|
568
569
|
case 0:
|
|
569
570
|
_ref6$metadataSubtree = _ref6.metadataSubtree, metadataSubtree = _ref6$metadataSubtree === void 0 ? "/" : _ref6$metadataSubtree, _ref6$metadata = _ref6.metadata, metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata;
|
|
570
571
|
this.Log("Merging user metadata at ".concat(metadataSubtree));
|
|
571
|
-
_context7.next =
|
|
572
|
+
_context7.next = 1;
|
|
572
573
|
return this.UserWalletObjectInfo();
|
|
573
|
-
case
|
|
574
|
+
case 1:
|
|
574
575
|
_yield$this$UserWalle3 = _context7.sent;
|
|
575
576
|
libraryId = _yield$this$UserWalle3.libraryId;
|
|
576
577
|
objectId = _yield$this$UserWalle3.objectId;
|
|
577
|
-
_context7.next =
|
|
578
|
+
_context7.next = 2;
|
|
578
579
|
return this.client.EditContentObject({
|
|
579
580
|
libraryId: libraryId,
|
|
580
581
|
objectId: objectId
|
|
581
582
|
});
|
|
582
|
-
case
|
|
583
|
+
case 2:
|
|
583
584
|
editRequest = _context7.sent;
|
|
584
|
-
_context7.next =
|
|
585
|
+
_context7.next = 3;
|
|
585
586
|
return this.client.MergeMetadata({
|
|
586
587
|
libraryId: libraryId,
|
|
587
588
|
objectId: objectId,
|
|
@@ -589,15 +590,15 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
589
590
|
metadataSubtree: metadataSubtree,
|
|
590
591
|
metadata: metadata
|
|
591
592
|
});
|
|
592
|
-
case
|
|
593
|
-
_context7.next =
|
|
593
|
+
case 3:
|
|
594
|
+
_context7.next = 4;
|
|
594
595
|
return this.client.FinalizeContentObject({
|
|
595
596
|
libraryId: libraryId,
|
|
596
597
|
objectId: objectId,
|
|
597
598
|
writeToken: editRequest.write_token,
|
|
598
599
|
commitMessage: "Merge user metadata"
|
|
599
600
|
});
|
|
600
|
-
case
|
|
601
|
+
case 4:
|
|
601
602
|
case "end":
|
|
602
603
|
return _context7.stop();
|
|
603
604
|
}
|
|
@@ -619,27 +620,27 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
619
620
|
}, {
|
|
620
621
|
key: "ReplaceUserMetadata",
|
|
621
622
|
value: (function () {
|
|
622
|
-
var _ReplaceUserMetadata = _asyncToGenerator(
|
|
623
|
+
var _ReplaceUserMetadata = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref7) {
|
|
623
624
|
var _ref7$metadataSubtree, metadataSubtree, _ref7$metadata, metadata, _yield$this$UserWalle4, libraryId, objectId, editRequest;
|
|
624
|
-
return _regeneratorRuntime.wrap(function
|
|
625
|
+
return _regeneratorRuntime.wrap(function (_context8) {
|
|
625
626
|
while (1) switch (_context8.prev = _context8.next) {
|
|
626
627
|
case 0:
|
|
627
628
|
_ref7$metadataSubtree = _ref7.metadataSubtree, metadataSubtree = _ref7$metadataSubtree === void 0 ? "/" : _ref7$metadataSubtree, _ref7$metadata = _ref7.metadata, metadata = _ref7$metadata === void 0 ? {} : _ref7$metadata;
|
|
628
629
|
this.Log("Replacing user metadata at ".concat(metadataSubtree));
|
|
629
|
-
_context8.next =
|
|
630
|
+
_context8.next = 1;
|
|
630
631
|
return this.UserWalletObjectInfo();
|
|
631
|
-
case
|
|
632
|
+
case 1:
|
|
632
633
|
_yield$this$UserWalle4 = _context8.sent;
|
|
633
634
|
libraryId = _yield$this$UserWalle4.libraryId;
|
|
634
635
|
objectId = _yield$this$UserWalle4.objectId;
|
|
635
|
-
_context8.next =
|
|
636
|
+
_context8.next = 2;
|
|
636
637
|
return this.client.EditContentObject({
|
|
637
638
|
libraryId: libraryId,
|
|
638
639
|
objectId: objectId
|
|
639
640
|
});
|
|
640
|
-
case
|
|
641
|
+
case 2:
|
|
641
642
|
editRequest = _context8.sent;
|
|
642
|
-
_context8.next =
|
|
643
|
+
_context8.next = 3;
|
|
643
644
|
return this.client.ReplaceMetadata({
|
|
644
645
|
libraryId: libraryId,
|
|
645
646
|
objectId: objectId,
|
|
@@ -647,15 +648,15 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
647
648
|
metadataSubtree: metadataSubtree,
|
|
648
649
|
metadata: metadata
|
|
649
650
|
});
|
|
650
|
-
case
|
|
651
|
-
_context8.next =
|
|
651
|
+
case 3:
|
|
652
|
+
_context8.next = 4;
|
|
652
653
|
return this.client.FinalizeContentObject({
|
|
653
654
|
libraryId: libraryId,
|
|
654
655
|
objectId: objectId,
|
|
655
656
|
writeToken: editRequest.write_token,
|
|
656
657
|
commitMessage: "Replace user metadata"
|
|
657
658
|
});
|
|
658
|
-
case
|
|
659
|
+
case 4:
|
|
659
660
|
case "end":
|
|
660
661
|
return _context8.stop();
|
|
661
662
|
}
|
|
@@ -676,42 +677,42 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
676
677
|
}, {
|
|
677
678
|
key: "DeleteUserMetadata",
|
|
678
679
|
value: (function () {
|
|
679
|
-
var _DeleteUserMetadata = _asyncToGenerator(
|
|
680
|
+
var _DeleteUserMetadata = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref8) {
|
|
680
681
|
var _ref8$metadataSubtree, metadataSubtree, _yield$this$UserWalle5, libraryId, objectId, editRequest;
|
|
681
|
-
return _regeneratorRuntime.wrap(function
|
|
682
|
+
return _regeneratorRuntime.wrap(function (_context9) {
|
|
682
683
|
while (1) switch (_context9.prev = _context9.next) {
|
|
683
684
|
case 0:
|
|
684
685
|
_ref8$metadataSubtree = _ref8.metadataSubtree, metadataSubtree = _ref8$metadataSubtree === void 0 ? "/" : _ref8$metadataSubtree;
|
|
685
686
|
this.Log("Deleting user metadata at ".concat(metadataSubtree));
|
|
686
|
-
_context9.next =
|
|
687
|
+
_context9.next = 1;
|
|
687
688
|
return this.UserWalletObjectInfo();
|
|
688
|
-
case
|
|
689
|
+
case 1:
|
|
689
690
|
_yield$this$UserWalle5 = _context9.sent;
|
|
690
691
|
libraryId = _yield$this$UserWalle5.libraryId;
|
|
691
692
|
objectId = _yield$this$UserWalle5.objectId;
|
|
692
|
-
_context9.next =
|
|
693
|
+
_context9.next = 2;
|
|
693
694
|
return this.client.EditContentObject({
|
|
694
695
|
libraryId: libraryId,
|
|
695
696
|
objectId: objectId
|
|
696
697
|
});
|
|
697
|
-
case
|
|
698
|
+
case 2:
|
|
698
699
|
editRequest = _context9.sent;
|
|
699
|
-
_context9.next =
|
|
700
|
+
_context9.next = 3;
|
|
700
701
|
return this.client.DeleteMetadata({
|
|
701
702
|
libraryId: libraryId,
|
|
702
703
|
objectId: objectId,
|
|
703
704
|
writeToken: editRequest.write_token,
|
|
704
705
|
metadataSubtree: metadataSubtree
|
|
705
706
|
});
|
|
706
|
-
case
|
|
707
|
-
_context9.next =
|
|
707
|
+
case 3:
|
|
708
|
+
_context9.next = 4;
|
|
708
709
|
return this.client.FinalizeContentObject({
|
|
709
710
|
libraryId: libraryId,
|
|
710
711
|
objectId: objectId,
|
|
711
712
|
writeToken: editRequest.write_token,
|
|
712
713
|
commitMessage: "Delete user metadata"
|
|
713
714
|
});
|
|
714
|
-
case
|
|
715
|
+
case 4:
|
|
715
716
|
case "end":
|
|
716
717
|
return _context9.stop();
|
|
717
718
|
}
|
|
@@ -735,28 +736,29 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
735
736
|
}, {
|
|
736
737
|
key: "AccessLevel",
|
|
737
738
|
value: (function () {
|
|
738
|
-
var _AccessLevel = _asyncToGenerator(
|
|
739
|
-
|
|
740
|
-
|
|
739
|
+
var _AccessLevel = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0() {
|
|
740
|
+
var _t4;
|
|
741
|
+
return _regeneratorRuntime.wrap(function (_context0) {
|
|
742
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
741
743
|
case 0:
|
|
742
|
-
|
|
744
|
+
_context0.next = 1;
|
|
743
745
|
return this.UserMetadata({
|
|
744
746
|
metadataSubtree: "access_level"
|
|
745
747
|
});
|
|
746
|
-
case
|
|
747
|
-
|
|
748
|
-
if (
|
|
749
|
-
|
|
748
|
+
case 1:
|
|
749
|
+
_t4 = _context0.sent;
|
|
750
|
+
if (_t4) {
|
|
751
|
+
_context0.next = 2;
|
|
750
752
|
break;
|
|
751
753
|
}
|
|
752
|
-
|
|
753
|
-
case
|
|
754
|
-
return
|
|
755
|
-
case
|
|
754
|
+
_t4 = "prompt";
|
|
755
|
+
case 2:
|
|
756
|
+
return _context0.abrupt("return", _t4);
|
|
757
|
+
case 3:
|
|
756
758
|
case "end":
|
|
757
|
-
return
|
|
759
|
+
return _context0.stop();
|
|
758
760
|
}
|
|
759
|
-
},
|
|
761
|
+
}, _callee0, this);
|
|
760
762
|
}));
|
|
761
763
|
function AccessLevel() {
|
|
762
764
|
return _AccessLevel.apply(this, arguments);
|
|
@@ -775,29 +777,29 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
775
777
|
}, {
|
|
776
778
|
key: "SetAccessLevel",
|
|
777
779
|
value: (function () {
|
|
778
|
-
var _SetAccessLevel = _asyncToGenerator(
|
|
780
|
+
var _SetAccessLevel = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee1(_ref9) {
|
|
779
781
|
var level;
|
|
780
|
-
return _regeneratorRuntime.wrap(function
|
|
781
|
-
while (1) switch (
|
|
782
|
+
return _regeneratorRuntime.wrap(function (_context1) {
|
|
783
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
782
784
|
case 0:
|
|
783
785
|
level = _ref9.level;
|
|
784
786
|
level = level.toLowerCase();
|
|
785
787
|
if (["private", "prompt", "public"].includes(level)) {
|
|
786
|
-
|
|
788
|
+
_context1.next = 1;
|
|
787
789
|
break;
|
|
788
790
|
}
|
|
789
791
|
throw new Error("Invalid access level: " + level);
|
|
790
|
-
case
|
|
791
|
-
|
|
792
|
+
case 1:
|
|
793
|
+
_context1.next = 2;
|
|
792
794
|
return this.ReplaceUserMetadata({
|
|
793
795
|
metadataSubtree: "access_level",
|
|
794
796
|
metadata: level
|
|
795
797
|
});
|
|
796
|
-
case
|
|
798
|
+
case 2:
|
|
797
799
|
case "end":
|
|
798
|
-
return
|
|
800
|
+
return _context1.stop();
|
|
799
801
|
}
|
|
800
|
-
},
|
|
802
|
+
}, _callee1, this);
|
|
801
803
|
}));
|
|
802
804
|
function SetAccessLevel(_x6) {
|
|
803
805
|
return _SetAccessLevel.apply(this, arguments);
|
|
@@ -813,33 +815,33 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
813
815
|
}, {
|
|
814
816
|
key: "TenantId",
|
|
815
817
|
value: (function () {
|
|
816
|
-
var _TenantId = _asyncToGenerator(
|
|
818
|
+
var _TenantId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10() {
|
|
817
819
|
var _yield$this$UserWalle6, objectId;
|
|
818
|
-
return _regeneratorRuntime.wrap(function
|
|
819
|
-
while (1) switch (
|
|
820
|
+
return _regeneratorRuntime.wrap(function (_context10) {
|
|
821
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
820
822
|
case 0:
|
|
821
823
|
if (this.tenantId) {
|
|
822
|
-
|
|
824
|
+
_context10.next = 3;
|
|
823
825
|
break;
|
|
824
826
|
}
|
|
825
|
-
|
|
827
|
+
_context10.next = 1;
|
|
826
828
|
return this.UserWalletObjectInfo();
|
|
827
|
-
case
|
|
828
|
-
_yield$this$UserWalle6 =
|
|
829
|
+
case 1:
|
|
830
|
+
_yield$this$UserWalle6 = _context10.sent;
|
|
829
831
|
objectId = _yield$this$UserWalle6.objectId;
|
|
830
|
-
|
|
832
|
+
_context10.next = 2;
|
|
831
833
|
return this.client.TenantId({
|
|
832
834
|
objectId: objectId
|
|
833
835
|
});
|
|
834
|
-
case
|
|
835
|
-
this.tenantId =
|
|
836
|
-
case
|
|
837
|
-
return
|
|
838
|
-
case
|
|
836
|
+
case 2:
|
|
837
|
+
this.tenantId = _context10.sent;
|
|
838
|
+
case 3:
|
|
839
|
+
return _context10.abrupt("return", this.tenantId);
|
|
840
|
+
case 4:
|
|
839
841
|
case "end":
|
|
840
|
-
return
|
|
842
|
+
return _context10.stop();
|
|
841
843
|
}
|
|
842
|
-
},
|
|
844
|
+
}, _callee10, this);
|
|
843
845
|
}));
|
|
844
846
|
function TenantId() {
|
|
845
847
|
return _TenantId.apply(this, arguments);
|
|
@@ -859,49 +861,49 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
859
861
|
}, {
|
|
860
862
|
key: "SetTenantId",
|
|
861
863
|
value: (function () {
|
|
862
|
-
var _SetTenantId = _asyncToGenerator(
|
|
864
|
+
var _SetTenantId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref0) {
|
|
863
865
|
var id, address, _yield$this$UserWalle7, objectId, tenantInfo;
|
|
864
|
-
return _regeneratorRuntime.wrap(function
|
|
865
|
-
while (1) switch (
|
|
866
|
+
return _regeneratorRuntime.wrap(function (_context11) {
|
|
867
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
866
868
|
case 0:
|
|
867
|
-
id =
|
|
869
|
+
id = _ref0.id, address = _ref0.address;
|
|
868
870
|
if (!(id && (!id.startsWith("iten") || !Utils.ValidHash(id)))) {
|
|
869
|
-
|
|
871
|
+
_context11.next = 1;
|
|
870
872
|
break;
|
|
871
873
|
}
|
|
872
874
|
throw Error("Invalid tenant ID: ".concat(id));
|
|
873
|
-
case
|
|
875
|
+
case 1:
|
|
874
876
|
if (!address) {
|
|
875
|
-
|
|
877
|
+
_context11.next = 3;
|
|
876
878
|
break;
|
|
877
879
|
}
|
|
878
880
|
if (Utils.ValidAddress(address)) {
|
|
879
|
-
|
|
881
|
+
_context11.next = 2;
|
|
880
882
|
break;
|
|
881
883
|
}
|
|
882
884
|
throw Error("Invalid address: ".concat(address));
|
|
883
|
-
case
|
|
885
|
+
case 2:
|
|
884
886
|
id = "iten".concat(Utils.AddressToHash(address));
|
|
885
|
-
case
|
|
886
|
-
|
|
887
|
+
case 3:
|
|
888
|
+
_context11.next = 4;
|
|
887
889
|
return this.UserWalletObjectInfo();
|
|
888
|
-
case
|
|
889
|
-
_yield$this$UserWalle7 =
|
|
890
|
+
case 4:
|
|
891
|
+
_yield$this$UserWalle7 = _context11.sent;
|
|
890
892
|
objectId = _yield$this$UserWalle7.objectId;
|
|
891
|
-
|
|
893
|
+
_context11.next = 5;
|
|
892
894
|
return this.client.SetTenantId({
|
|
893
895
|
objectId: objectId,
|
|
894
896
|
tenantId: id
|
|
895
897
|
});
|
|
896
|
-
case
|
|
897
|
-
tenantInfo =
|
|
898
|
+
case 5:
|
|
899
|
+
tenantInfo = _context11.sent;
|
|
898
900
|
this.tenantContractId = tenantInfo.tenantContractId;
|
|
899
901
|
this.tenantId = tenantInfo.tenantId;
|
|
900
|
-
case
|
|
902
|
+
case 6:
|
|
901
903
|
case "end":
|
|
902
|
-
return
|
|
904
|
+
return _context11.stop();
|
|
903
905
|
}
|
|
904
|
-
},
|
|
906
|
+
}, _callee11, this);
|
|
905
907
|
}));
|
|
906
908
|
function SetTenantId(_x7) {
|
|
907
909
|
return _SetTenantId.apply(this, arguments);
|
|
@@ -917,33 +919,33 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
917
919
|
}, {
|
|
918
920
|
key: "TenantContractId",
|
|
919
921
|
value: (function () {
|
|
920
|
-
var _TenantContractId = _asyncToGenerator(
|
|
922
|
+
var _TenantContractId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
921
923
|
var _yield$this$UserWalle8, objectId;
|
|
922
|
-
return _regeneratorRuntime.wrap(function
|
|
923
|
-
while (1) switch (
|
|
924
|
+
return _regeneratorRuntime.wrap(function (_context12) {
|
|
925
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
924
926
|
case 0:
|
|
925
927
|
if (this.tenantContractId) {
|
|
926
|
-
|
|
928
|
+
_context12.next = 3;
|
|
927
929
|
break;
|
|
928
930
|
}
|
|
929
|
-
|
|
931
|
+
_context12.next = 1;
|
|
930
932
|
return this.UserWalletObjectInfo();
|
|
931
|
-
case
|
|
932
|
-
_yield$this$UserWalle8 =
|
|
933
|
+
case 1:
|
|
934
|
+
_yield$this$UserWalle8 = _context12.sent;
|
|
933
935
|
objectId = _yield$this$UserWalle8.objectId;
|
|
934
|
-
|
|
936
|
+
_context12.next = 2;
|
|
935
937
|
return this.client.TenantContractId({
|
|
936
938
|
objectId: objectId
|
|
937
939
|
});
|
|
938
|
-
case
|
|
939
|
-
this.tenantContractId =
|
|
940
|
-
case
|
|
941
|
-
return
|
|
942
|
-
case
|
|
940
|
+
case 2:
|
|
941
|
+
this.tenantContractId = _context12.sent;
|
|
942
|
+
case 3:
|
|
943
|
+
return _context12.abrupt("return", this.tenantContractId);
|
|
944
|
+
case 4:
|
|
943
945
|
case "end":
|
|
944
|
-
return
|
|
946
|
+
return _context12.stop();
|
|
945
947
|
}
|
|
946
|
-
},
|
|
948
|
+
}, _callee12, this);
|
|
947
949
|
}));
|
|
948
950
|
function TenantContractId() {
|
|
949
951
|
return _TenantContractId.apply(this, arguments);
|
|
@@ -963,31 +965,31 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
963
965
|
}, {
|
|
964
966
|
key: "SetTenantContractId",
|
|
965
967
|
value: (function () {
|
|
966
|
-
var _SetTenantContractId = _asyncToGenerator(
|
|
968
|
+
var _SetTenantContractId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref1) {
|
|
967
969
|
var tenantContractId, _yield$this$UserWalle9, objectId, tenantInfo;
|
|
968
|
-
return _regeneratorRuntime.wrap(function
|
|
969
|
-
while (1) switch (
|
|
970
|
+
return _regeneratorRuntime.wrap(function (_context13) {
|
|
971
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
970
972
|
case 0:
|
|
971
|
-
tenantContractId =
|
|
972
|
-
|
|
973
|
+
tenantContractId = _ref1.tenantContractId;
|
|
974
|
+
_context13.next = 1;
|
|
973
975
|
return this.UserWalletObjectInfo();
|
|
974
|
-
case
|
|
975
|
-
_yield$this$UserWalle9 =
|
|
976
|
+
case 1:
|
|
977
|
+
_yield$this$UserWalle9 = _context13.sent;
|
|
976
978
|
objectId = _yield$this$UserWalle9.objectId;
|
|
977
|
-
|
|
979
|
+
_context13.next = 2;
|
|
978
980
|
return this.client.SetTenantContractId({
|
|
979
981
|
objectId: objectId,
|
|
980
982
|
tenantContractId: tenantContractId
|
|
981
983
|
});
|
|
982
|
-
case
|
|
983
|
-
tenantInfo =
|
|
984
|
+
case 2:
|
|
985
|
+
tenantInfo = _context13.sent;
|
|
984
986
|
this.tenantContractId = tenantInfo.tenantContractId;
|
|
985
987
|
this.tenantId = tenantInfo.tenantId;
|
|
986
|
-
case
|
|
988
|
+
case 3:
|
|
987
989
|
case "end":
|
|
988
|
-
return
|
|
990
|
+
return _context13.stop();
|
|
989
991
|
}
|
|
990
|
-
},
|
|
992
|
+
}, _callee13, this);
|
|
991
993
|
}));
|
|
992
994
|
function SetTenantContractId(_x8) {
|
|
993
995
|
return _SetTenantContractId.apply(this, arguments);
|
|
@@ -997,32 +999,32 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
997
999
|
}, {
|
|
998
1000
|
key: "ResetTenantId",
|
|
999
1001
|
value: function () {
|
|
1000
|
-
var _ResetTenantId = _asyncToGenerator(
|
|
1001
|
-
var _yield$this$
|
|
1002
|
-
return _regeneratorRuntime.wrap(function
|
|
1003
|
-
while (1) switch (
|
|
1002
|
+
var _ResetTenantId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
|
1003
|
+
var _yield$this$UserWalle0, objectId;
|
|
1004
|
+
return _regeneratorRuntime.wrap(function (_context14) {
|
|
1005
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
1004
1006
|
case 0:
|
|
1005
|
-
|
|
1007
|
+
_context14.next = 1;
|
|
1006
1008
|
return this.UserWalletObjectInfo();
|
|
1007
|
-
case
|
|
1008
|
-
_yield$this$
|
|
1009
|
-
objectId = _yield$this$
|
|
1010
|
-
|
|
1009
|
+
case 1:
|
|
1010
|
+
_yield$this$UserWalle0 = _context14.sent;
|
|
1011
|
+
objectId = _yield$this$UserWalle0.objectId;
|
|
1012
|
+
_context14.next = 2;
|
|
1011
1013
|
return this.client.ResetTenantId({
|
|
1012
1014
|
objectId: objectId
|
|
1013
1015
|
});
|
|
1014
|
-
case
|
|
1016
|
+
case 2:
|
|
1015
1017
|
this.tenantId = this.client.TenantId({
|
|
1016
1018
|
objectId: objectId
|
|
1017
1019
|
});
|
|
1018
1020
|
this.tenantContractId = this.client.TenantContractId({
|
|
1019
1021
|
objectId: objectId
|
|
1020
1022
|
});
|
|
1021
|
-
case
|
|
1023
|
+
case 3:
|
|
1022
1024
|
case "end":
|
|
1023
|
-
return
|
|
1025
|
+
return _context14.stop();
|
|
1024
1026
|
}
|
|
1025
|
-
},
|
|
1027
|
+
}, _callee14, this);
|
|
1026
1028
|
}));
|
|
1027
1029
|
function ResetTenantId() {
|
|
1028
1030
|
return _ResetTenantId.apply(this, arguments);
|
|
@@ -1046,60 +1048,60 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1046
1048
|
}, {
|
|
1047
1049
|
key: "UserProfileImage",
|
|
1048
1050
|
value: (function () {
|
|
1049
|
-
var _UserProfileImage = _asyncToGenerator(
|
|
1050
|
-
var
|
|
1051
|
+
var _UserProfileImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15() {
|
|
1052
|
+
var _ref10,
|
|
1051
1053
|
address,
|
|
1052
1054
|
height,
|
|
1053
1055
|
walletAddress,
|
|
1054
|
-
_yield$this$
|
|
1056
|
+
_yield$this$UserWalle1,
|
|
1055
1057
|
libraryId,
|
|
1056
1058
|
objectId,
|
|
1057
|
-
|
|
1058
|
-
return _regeneratorRuntime.wrap(function
|
|
1059
|
-
while (1) switch (
|
|
1059
|
+
_args15 = arguments;
|
|
1060
|
+
return _regeneratorRuntime.wrap(function (_context15) {
|
|
1061
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
1060
1062
|
case 0:
|
|
1061
|
-
|
|
1063
|
+
_ref10 = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : {}, address = _ref10.address, height = _ref10.height;
|
|
1062
1064
|
if (!address) {
|
|
1063
|
-
|
|
1065
|
+
_context15.next = 2;
|
|
1064
1066
|
break;
|
|
1065
1067
|
}
|
|
1066
|
-
|
|
1068
|
+
_context15.next = 1;
|
|
1067
1069
|
return this.UserWalletAddress({
|
|
1068
1070
|
address: address
|
|
1069
1071
|
});
|
|
1070
|
-
case
|
|
1071
|
-
walletAddress =
|
|
1072
|
-
|
|
1072
|
+
case 1:
|
|
1073
|
+
walletAddress = _context15.sent;
|
|
1074
|
+
_context15.next = 3;
|
|
1073
1075
|
break;
|
|
1074
|
-
case
|
|
1076
|
+
case 2:
|
|
1075
1077
|
address = this.client.signer.address;
|
|
1076
1078
|
walletAddress = this.walletAddress;
|
|
1077
|
-
case
|
|
1079
|
+
case 3:
|
|
1078
1080
|
if (walletAddress) {
|
|
1079
|
-
|
|
1081
|
+
_context15.next = 4;
|
|
1080
1082
|
break;
|
|
1081
1083
|
}
|
|
1082
|
-
return
|
|
1083
|
-
case
|
|
1084
|
-
|
|
1084
|
+
return _context15.abrupt("return");
|
|
1085
|
+
case 4:
|
|
1086
|
+
_context15.next = 5;
|
|
1085
1087
|
return this.UserWalletObjectInfo({
|
|
1086
1088
|
address: address
|
|
1087
1089
|
});
|
|
1088
|
-
case
|
|
1089
|
-
_yield$this$
|
|
1090
|
-
libraryId = _yield$this$
|
|
1091
|
-
objectId = _yield$this$
|
|
1092
|
-
return
|
|
1090
|
+
case 5:
|
|
1091
|
+
_yield$this$UserWalle1 = _context15.sent;
|
|
1092
|
+
libraryId = _yield$this$UserWalle1.libraryId;
|
|
1093
|
+
objectId = _yield$this$UserWalle1.objectId;
|
|
1094
|
+
return _context15.abrupt("return", this.client.ContentObjectImageUrl({
|
|
1093
1095
|
libraryId: libraryId,
|
|
1094
1096
|
objectId: objectId,
|
|
1095
1097
|
height: height,
|
|
1096
1098
|
imagePath: "public/profile_image"
|
|
1097
1099
|
}));
|
|
1098
|
-
case
|
|
1100
|
+
case 6:
|
|
1099
1101
|
case "end":
|
|
1100
|
-
return
|
|
1102
|
+
return _context15.stop();
|
|
1101
1103
|
}
|
|
1102
|
-
},
|
|
1104
|
+
}, _callee15, this);
|
|
1103
1105
|
}));
|
|
1104
1106
|
function UserProfileImage() {
|
|
1105
1107
|
return _UserProfileImage.apply(this, arguments);
|
|
@@ -1116,34 +1118,34 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1116
1118
|
}, {
|
|
1117
1119
|
key: "SetUserProfileImage",
|
|
1118
1120
|
value: (function () {
|
|
1119
|
-
var _SetUserProfileImage = _asyncToGenerator(
|
|
1120
|
-
var image, size, _yield$this$
|
|
1121
|
-
return _regeneratorRuntime.wrap(function
|
|
1122
|
-
while (1) switch (
|
|
1121
|
+
var _SetUserProfileImage = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(_ref11) {
|
|
1122
|
+
var image, size, _yield$this$UserWalle10, libraryId, objectId, editRequest;
|
|
1123
|
+
return _regeneratorRuntime.wrap(function (_context16) {
|
|
1124
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1123
1125
|
case 0:
|
|
1124
|
-
image =
|
|
1126
|
+
image = _ref11.image;
|
|
1125
1127
|
this.Log("Setting profile image for user ".concat(this.client.signer.address));
|
|
1126
1128
|
size = image.length || image.byteLength || image.size;
|
|
1127
1129
|
if (!(size > 5000000)) {
|
|
1128
|
-
|
|
1130
|
+
_context16.next = 1;
|
|
1129
1131
|
break;
|
|
1130
1132
|
}
|
|
1131
1133
|
throw Error("Maximum profile image size is 5MB");
|
|
1132
|
-
case
|
|
1133
|
-
|
|
1134
|
+
case 1:
|
|
1135
|
+
_context16.next = 2;
|
|
1134
1136
|
return this.UserWalletObjectInfo();
|
|
1135
|
-
case
|
|
1136
|
-
_yield$this$
|
|
1137
|
-
libraryId = _yield$this$
|
|
1138
|
-
objectId = _yield$this$
|
|
1139
|
-
|
|
1137
|
+
case 2:
|
|
1138
|
+
_yield$this$UserWalle10 = _context16.sent;
|
|
1139
|
+
libraryId = _yield$this$UserWalle10.libraryId;
|
|
1140
|
+
objectId = _yield$this$UserWalle10.objectId;
|
|
1141
|
+
_context16.next = 3;
|
|
1140
1142
|
return this.client.EditContentObject({
|
|
1141
1143
|
libraryId: libraryId,
|
|
1142
1144
|
objectId: objectId
|
|
1143
1145
|
});
|
|
1144
|
-
case
|
|
1145
|
-
editRequest =
|
|
1146
|
-
|
|
1146
|
+
case 3:
|
|
1147
|
+
editRequest = _context16.sent;
|
|
1148
|
+
_context16.next = 4;
|
|
1147
1149
|
return this.client.SetContentObjectImage({
|
|
1148
1150
|
libraryId: libraryId,
|
|
1149
1151
|
objectId: objectId,
|
|
@@ -1152,19 +1154,19 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1152
1154
|
imageName: "profile_image",
|
|
1153
1155
|
imagePath: "public/profile_image"
|
|
1154
1156
|
});
|
|
1155
|
-
case
|
|
1156
|
-
|
|
1157
|
+
case 4:
|
|
1158
|
+
_context16.next = 5;
|
|
1157
1159
|
return this.client.FinalizeContentObject({
|
|
1158
1160
|
libraryId: libraryId,
|
|
1159
1161
|
objectId: objectId,
|
|
1160
1162
|
writeToken: editRequest.write_token,
|
|
1161
1163
|
commitMessage: "Set user profile image"
|
|
1162
1164
|
});
|
|
1163
|
-
case
|
|
1165
|
+
case 5:
|
|
1164
1166
|
case "end":
|
|
1165
|
-
return
|
|
1167
|
+
return _context16.stop();
|
|
1166
1168
|
}
|
|
1167
|
-
},
|
|
1169
|
+
}, _callee16, this);
|
|
1168
1170
|
}));
|
|
1169
1171
|
function SetUserProfileImage(_x9) {
|
|
1170
1172
|
return _SetUserProfileImage.apply(this, arguments);
|
|
@@ -1184,28 +1186,29 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1184
1186
|
}, {
|
|
1185
1187
|
key: "CollectedTags",
|
|
1186
1188
|
value: (function () {
|
|
1187
|
-
var _CollectedTags = _asyncToGenerator(
|
|
1188
|
-
|
|
1189
|
-
|
|
1189
|
+
var _CollectedTags = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
|
|
1190
|
+
var _t5;
|
|
1191
|
+
return _regeneratorRuntime.wrap(function (_context17) {
|
|
1192
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1190
1193
|
case 0:
|
|
1191
|
-
|
|
1194
|
+
_context17.next = 1;
|
|
1192
1195
|
return this.UserMetadata({
|
|
1193
1196
|
metadataSubtree: "collected_data"
|
|
1194
1197
|
});
|
|
1195
|
-
case
|
|
1196
|
-
|
|
1197
|
-
if (
|
|
1198
|
-
|
|
1198
|
+
case 1:
|
|
1199
|
+
_t5 = _context17.sent;
|
|
1200
|
+
if (_t5) {
|
|
1201
|
+
_context17.next = 2;
|
|
1199
1202
|
break;
|
|
1200
1203
|
}
|
|
1201
|
-
|
|
1202
|
-
case
|
|
1203
|
-
return
|
|
1204
|
-
case
|
|
1204
|
+
_t5 = {};
|
|
1205
|
+
case 2:
|
|
1206
|
+
return _context17.abrupt("return", _t5);
|
|
1207
|
+
case 3:
|
|
1205
1208
|
case "end":
|
|
1206
|
-
return
|
|
1209
|
+
return _context17.stop();
|
|
1207
1210
|
}
|
|
1208
|
-
},
|
|
1211
|
+
}, _callee17, this);
|
|
1209
1212
|
}));
|
|
1210
1213
|
function CollectedTags() {
|
|
1211
1214
|
return _CollectedTags.apply(this, arguments);
|
|
@@ -1216,34 +1219,34 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1216
1219
|
}, {
|
|
1217
1220
|
key: "RecordTags",
|
|
1218
1221
|
value: function () {
|
|
1219
|
-
var _RecordTags = _asyncToGenerator(
|
|
1220
|
-
var libraryId, objectId, versionHash;
|
|
1221
|
-
return _regeneratorRuntime.wrap(function
|
|
1222
|
-
while (1) switch (
|
|
1222
|
+
var _RecordTags = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18(_ref12) {
|
|
1223
|
+
var libraryId, objectId, versionHash, _t6;
|
|
1224
|
+
return _regeneratorRuntime.wrap(function (_context18) {
|
|
1225
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1223
1226
|
case 0:
|
|
1224
|
-
libraryId =
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
+
libraryId = _ref12.libraryId, objectId = _ref12.objectId, versionHash = _ref12.versionHash;
|
|
1228
|
+
_context18.prev = 1;
|
|
1229
|
+
_context18.next = 2;
|
|
1227
1230
|
return this.__RecordTags({
|
|
1228
1231
|
libraryId: libraryId,
|
|
1229
1232
|
objectId: objectId,
|
|
1230
1233
|
versionHash: versionHash
|
|
1231
1234
|
});
|
|
1232
|
-
case
|
|
1233
|
-
|
|
1235
|
+
case 2:
|
|
1236
|
+
_context18.next = 4;
|
|
1234
1237
|
break;
|
|
1235
|
-
case
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
+
case 3:
|
|
1239
|
+
_context18.prev = 3;
|
|
1240
|
+
_t6 = _context18["catch"](1);
|
|
1238
1241
|
// eslint-disable-next-line no-console
|
|
1239
|
-
console.error(
|
|
1240
|
-
case
|
|
1242
|
+
console.error(_t6);
|
|
1243
|
+
case 4:
|
|
1241
1244
|
case "end":
|
|
1242
|
-
return
|
|
1245
|
+
return _context18.stop();
|
|
1243
1246
|
}
|
|
1244
|
-
},
|
|
1247
|
+
}, _callee18, this, [[1, 3]]);
|
|
1245
1248
|
}));
|
|
1246
|
-
function RecordTags(
|
|
1249
|
+
function RecordTags(_x0) {
|
|
1247
1250
|
return _RecordTags.apply(this, arguments);
|
|
1248
1251
|
}
|
|
1249
1252
|
return RecordTags;
|
|
@@ -1251,73 +1254,73 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1251
1254
|
}, {
|
|
1252
1255
|
key: "__RecordTags",
|
|
1253
1256
|
value: function () {
|
|
1254
|
-
var _RecordTags2 = _asyncToGenerator(
|
|
1257
|
+
var _RecordTags2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref13) {
|
|
1255
1258
|
var libraryId, objectId, versionHash, accessType, seen, walletObjectInfo, userLibraryId, userObjectId, editRequest, contentTags, userTags, formattedTags;
|
|
1256
|
-
return _regeneratorRuntime.wrap(function
|
|
1257
|
-
while (1) switch (
|
|
1259
|
+
return _regeneratorRuntime.wrap(function (_context19) {
|
|
1260
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1258
1261
|
case 0:
|
|
1259
|
-
libraryId =
|
|
1260
|
-
|
|
1262
|
+
libraryId = _ref13.libraryId, objectId = _ref13.objectId, versionHash = _ref13.versionHash;
|
|
1263
|
+
_context19.next = 1;
|
|
1261
1264
|
return this.client.AccessType({
|
|
1262
1265
|
id: objectId
|
|
1263
1266
|
});
|
|
1264
|
-
case
|
|
1265
|
-
accessType =
|
|
1267
|
+
case 1:
|
|
1268
|
+
accessType = _context19.sent;
|
|
1266
1269
|
if (!(accessType !== "object")) {
|
|
1267
|
-
|
|
1270
|
+
_context19.next = 2;
|
|
1268
1271
|
break;
|
|
1269
1272
|
}
|
|
1270
|
-
return
|
|
1271
|
-
case
|
|
1273
|
+
return _context19.abrupt("return");
|
|
1274
|
+
case 2:
|
|
1272
1275
|
if (!(!versionHash && !libraryId)) {
|
|
1273
|
-
|
|
1276
|
+
_context19.next = 4;
|
|
1274
1277
|
break;
|
|
1275
1278
|
}
|
|
1276
|
-
|
|
1279
|
+
_context19.next = 3;
|
|
1277
1280
|
return this.client.ContentObjectLibraryId({
|
|
1278
1281
|
objectId: objectId
|
|
1279
1282
|
});
|
|
1280
|
-
case
|
|
1281
|
-
libraryId =
|
|
1282
|
-
case
|
|
1283
|
+
case 3:
|
|
1284
|
+
libraryId = _context19.sent;
|
|
1285
|
+
case 4:
|
|
1283
1286
|
if (versionHash) {
|
|
1284
|
-
|
|
1287
|
+
_context19.next = 6;
|
|
1285
1288
|
break;
|
|
1286
1289
|
}
|
|
1287
|
-
|
|
1290
|
+
_context19.next = 5;
|
|
1288
1291
|
return this.client.ContentObject({
|
|
1289
1292
|
libraryId: libraryId,
|
|
1290
1293
|
objectId: objectId
|
|
1291
1294
|
});
|
|
1292
|
-
case
|
|
1293
|
-
versionHash =
|
|
1294
|
-
case
|
|
1295
|
-
|
|
1295
|
+
case 5:
|
|
1296
|
+
versionHash = _context19.sent.hash;
|
|
1297
|
+
case 6:
|
|
1298
|
+
_context19.next = 7;
|
|
1296
1299
|
return this.UserMetadata({
|
|
1297
1300
|
metadataSubtree: UrlJoin("accessed_content", versionHash)
|
|
1298
1301
|
});
|
|
1299
|
-
case
|
|
1300
|
-
seen =
|
|
1302
|
+
case 7:
|
|
1303
|
+
seen = _context19.sent;
|
|
1301
1304
|
if (!seen) {
|
|
1302
|
-
|
|
1305
|
+
_context19.next = 8;
|
|
1303
1306
|
break;
|
|
1304
1307
|
}
|
|
1305
|
-
return
|
|
1306
|
-
case
|
|
1307
|
-
|
|
1308
|
+
return _context19.abrupt("return");
|
|
1309
|
+
case 8:
|
|
1310
|
+
_context19.next = 9;
|
|
1308
1311
|
return this.UserWalletObjectInfo();
|
|
1309
|
-
case
|
|
1310
|
-
walletObjectInfo =
|
|
1312
|
+
case 9:
|
|
1313
|
+
walletObjectInfo = _context19.sent;
|
|
1311
1314
|
userLibraryId = walletObjectInfo.libraryId;
|
|
1312
1315
|
userObjectId = walletObjectInfo.objectId; // Mark content as seen
|
|
1313
|
-
|
|
1316
|
+
_context19.next = 10;
|
|
1314
1317
|
return this.client.EditContentObject({
|
|
1315
1318
|
libraryId: userLibraryId,
|
|
1316
1319
|
objectId: userObjectId
|
|
1317
1320
|
});
|
|
1318
|
-
case
|
|
1319
|
-
editRequest =
|
|
1320
|
-
|
|
1321
|
+
case 10:
|
|
1322
|
+
editRequest = _context19.sent;
|
|
1323
|
+
_context19.next = 11;
|
|
1321
1324
|
return this.client.ReplaceMetadata({
|
|
1322
1325
|
libraryId: userLibraryId,
|
|
1323
1326
|
objectId: userObjectId,
|
|
@@ -1325,24 +1328,24 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1325
1328
|
metadataSubtree: UrlJoin("accessed_content", versionHash),
|
|
1326
1329
|
metadata: Date.now()
|
|
1327
1330
|
});
|
|
1328
|
-
case
|
|
1329
|
-
|
|
1331
|
+
case 11:
|
|
1332
|
+
_context19.next = 12;
|
|
1330
1333
|
return this.client.ContentObjectMetadata({
|
|
1331
1334
|
libraryId: libraryId,
|
|
1332
1335
|
objectId: objectId,
|
|
1333
1336
|
versionHash: versionHash,
|
|
1334
1337
|
metadataSubtree: "video_tags"
|
|
1335
1338
|
});
|
|
1336
|
-
case
|
|
1337
|
-
contentTags =
|
|
1339
|
+
case 12:
|
|
1340
|
+
contentTags = _context19.sent;
|
|
1338
1341
|
if (!(contentTags && contentTags.length > 0)) {
|
|
1339
|
-
|
|
1342
|
+
_context19.next = 14;
|
|
1340
1343
|
break;
|
|
1341
1344
|
}
|
|
1342
|
-
|
|
1345
|
+
_context19.next = 13;
|
|
1343
1346
|
return this.CollectedTags();
|
|
1344
|
-
case
|
|
1345
|
-
userTags =
|
|
1347
|
+
case 13:
|
|
1348
|
+
userTags = _context19.sent;
|
|
1346
1349
|
formattedTags = this.__FormatVideoTags(contentTags);
|
|
1347
1350
|
Object.keys(formattedTags).forEach(function (tag) {
|
|
1348
1351
|
if (userTags[tag]) {
|
|
@@ -1359,7 +1362,7 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1359
1362
|
});
|
|
1360
1363
|
|
|
1361
1364
|
// Update user tags
|
|
1362
|
-
|
|
1365
|
+
_context19.next = 14;
|
|
1363
1366
|
return this.client.ReplaceMetadata({
|
|
1364
1367
|
libraryId: userLibraryId,
|
|
1365
1368
|
objectId: userObjectId,
|
|
@@ -1367,8 +1370,8 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1367
1370
|
metadataSubtree: "collected_data",
|
|
1368
1371
|
metadata: userTags
|
|
1369
1372
|
});
|
|
1370
|
-
case
|
|
1371
|
-
|
|
1373
|
+
case 14:
|
|
1374
|
+
_context19.next = 15;
|
|
1372
1375
|
return this.client.FinalizeContentObject({
|
|
1373
1376
|
libraryId: userLibraryId,
|
|
1374
1377
|
objectId: userObjectId,
|
|
@@ -1376,13 +1379,13 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1376
1379
|
commitMessage: "Record user tags",
|
|
1377
1380
|
awaitCommitConfirmation: false
|
|
1378
1381
|
});
|
|
1379
|
-
case
|
|
1382
|
+
case 15:
|
|
1380
1383
|
case "end":
|
|
1381
|
-
return
|
|
1384
|
+
return _context19.stop();
|
|
1382
1385
|
}
|
|
1383
|
-
},
|
|
1386
|
+
}, _callee19, this);
|
|
1384
1387
|
}));
|
|
1385
|
-
function __RecordTags(
|
|
1388
|
+
function __RecordTags(_x1) {
|
|
1386
1389
|
return _RecordTags2.apply(this, arguments);
|
|
1387
1390
|
}
|
|
1388
1391
|
return __RecordTags;
|