@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.
Files changed (48) hide show
  1. package/dist/ElvClient-min.js +2 -68
  2. package/dist/ElvClient-min.js.LICENSE.txt +72 -0
  3. package/dist/ElvClient-node-min.js +2 -67
  4. package/dist/ElvClient-node-min.js.LICENSE.txt +72 -0
  5. package/dist/ElvFrameClient-min.js +2 -60
  6. package/dist/ElvFrameClient-min.js.LICENSE.txt +72 -0
  7. package/dist/ElvPermissionsClient-min.js +2 -60
  8. package/dist/ElvPermissionsClient-min.js.LICENSE.txt +72 -0
  9. package/dist/ElvWalletClient-min.js +2 -68
  10. package/dist/ElvWalletClient-min.js.LICENSE.txt +72 -0
  11. package/dist/ElvWalletClient-node-min.js +2 -67
  12. package/dist/ElvWalletClient-node-min.js.LICENSE.txt +72 -0
  13. package/dist/src/AuthorizationClient.js +704 -703
  14. package/dist/src/ContentObjectAudit.js +56 -56
  15. package/dist/src/Crypto.js +85 -86
  16. package/dist/src/ElvClient.js +483 -471
  17. package/dist/src/ElvWallet.js +23 -23
  18. package/dist/src/EthClient.js +308 -307
  19. package/dist/src/FrameClient.js +62 -62
  20. package/dist/src/HttpClient.js +59 -58
  21. package/dist/src/PermissionsClient.js +470 -470
  22. package/dist/src/RemoteSigner.js +77 -76
  23. package/dist/src/UserProfileClient.js +357 -354
  24. package/dist/src/Utils.js +65 -64
  25. package/dist/src/Validation.js +10 -10
  26. package/dist/src/client/ABRPublishing.js +237 -237
  27. package/dist/src/client/AccessGroups.js +477 -474
  28. package/dist/src/client/ContentAccess.js +1749 -1802
  29. package/dist/src/client/ContentManagement.js +871 -871
  30. package/dist/src/client/Contracts.js +575 -578
  31. package/dist/src/client/Files.js +700 -684
  32. package/dist/src/client/LiveStream.js +659 -650
  33. package/dist/src/client/NFT.js +14 -14
  34. package/dist/src/client/NTP.js +84 -84
  35. package/dist/src/client/Shares.js +49 -49
  36. package/dist/src/walletClient/ClientMethods.js +977 -951
  37. package/dist/src/walletClient/Notifications.js +14 -14
  38. package/dist/src/walletClient/Profile.js +66 -66
  39. package/dist/src/walletClient/Utils.js +15 -15
  40. package/dist/src/walletClient/index.js +557 -550
  41. package/package.json +17 -16
  42. package/src/ElvClient.js +1 -0
  43. package/src/FrameClient.js +12 -0
  44. package/src/client/AccessGroups.js +1 -1
  45. package/src/client/ContentAccess.js +44 -71
  46. package/testScripts/Test.js +5 -1
  47. package/webpack.config.js +10 -13
  48. package/dist/src/ContentObjectVerification.js +0 -281
@@ -176,150 +176,150 @@ var PermissionsClient = /*#__PURE__*/function () {
176
176
  }, {
177
177
  key: "FormatPermission",
178
178
  value: function () {
179
- var _FormatPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
180
- var policyId, policyWriteToken, permission, subjectSource, subjectType, subjectId, subjectName, subjectNTPId, id, cachedName, contentSpaceLibraryId, permissionSpec;
181
- return _regeneratorRuntime.wrap(function _callee$(_context) {
179
+ var _FormatPermission = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
180
+ var policyId, policyWriteToken, permission, subjectSource, subjectType, subjectId, subjectName, subjectNTPId, id, cachedName, contentSpaceLibraryId, permissionSpec, _t, _t2, _t3, _t4, _t5, _t6, _t7, _t8, _t9, _t0, _t1, _t10, _t11, _t12, _t13, _t14, _t15, _t16;
181
+ return _regeneratorRuntime.wrap(function (_context) {
182
182
  while (1) switch (_context.prev = _context.next) {
183
183
  case 0:
184
184
  policyId = _ref.policyId, policyWriteToken = _ref.policyWriteToken, permission = _ref.permission;
185
185
  subjectSource = permission.subject.type.startsWith("oauth") ? "oauth" : "fabric";
186
- _context.t0 = permission.subject.type;
187
- _context.next = _context.t0 === "otp" ? 5 : _context.t0 === "otp_subject" ? 8 : _context.t0 === "group" ? 13 : _context.t0 === "oauth_group" ? 13 : _context.t0 === "user" ? 16 : _context.t0 === "oauth_user" ? 16 : 19;
186
+ _t = permission.subject.type;
187
+ _context.next = _t === "otp" ? 1 : _t === "otp_subject" ? 2 : _t === "group" ? 3 : _t === "oauth_group" ? 3 : _t === "user" ? 4 : _t === "oauth_user" ? 4 : 5;
188
188
  break;
189
- case 5:
189
+ case 1:
190
190
  subjectType = "ntp";
191
191
  subjectId = permission.subject.id;
192
- return _context.abrupt("break", 20);
193
- case 8:
192
+ return _context.abrupt("continue", 6);
193
+ case 2:
194
194
  subjectType = "ntp_subject";
195
195
  subjectId = permission.subject.id;
196
196
  subjectName = subjectId;
197
197
  subjectNTPId = permission.subject.otp_id;
198
- return _context.abrupt("break", 20);
199
- case 13:
198
+ return _context.abrupt("continue", 6);
199
+ case 3:
200
200
  subjectType = "group";
201
201
  subjectId = subjectSource === "oauth" ? permission.subject.oauth_id : this.client.utils.HashToAddress(permission.subject.id);
202
- return _context.abrupt("break", 20);
203
- case 16:
202
+ return _context.abrupt("continue", 6);
203
+ case 4:
204
204
  subjectType = "user";
205
205
  subjectId = subjectSource === "oauth" ? permission.subject.oauth_id : this.client.utils.HashToAddress(permission.subject.id);
206
- return _context.abrupt("break", 20);
207
- case 19:
206
+ return _context.abrupt("continue", 6);
207
+ case 5:
208
208
  throw Error("Unknown subject type: " + permission.subject.type);
209
- case 20:
209
+ case 6:
210
210
  id = permission.subject.oauth_id || permission.subject.id;
211
211
  cachedName = this.subjectNames[id];
212
212
  subjectName = subjectName || cachedName || permission.subject.id;
213
213
  if (!(!cachedName && subjectSource === "fabric")) {
214
- _context.next = 74;
214
+ _context.next = 20;
215
215
  break;
216
216
  }
217
217
  if (!(subjectType === "group")) {
218
- _context.next = 36;
218
+ _context.next = 10;
219
219
  break;
220
220
  }
221
- _context.next = 27;
221
+ _context.next = 7;
222
222
  return this.client.ContentSpaceId();
223
- case 27:
223
+ case 7:
224
224
  contentSpaceLibraryId = _context.sent.replace("ispc", "ilib");
225
- _context.next = 30;
225
+ _context.next = 8;
226
226
  return this.client.ContentObjectMetadata({
227
227
  libraryId: contentSpaceLibraryId,
228
228
  objectId: this.client.utils.AddressToObjectId(subjectId),
229
229
  metadataSubtree: UrlJoin("public", "name")
230
230
  });
231
- case 30:
232
- _context.t1 = _context.sent;
233
- if (_context.t1) {
234
- _context.next = 33;
231
+ case 8:
232
+ _t2 = _context.sent;
233
+ if (_t2) {
234
+ _context.next = 9;
235
235
  break;
236
236
  }
237
- _context.t1 = subjectId;
238
- case 33:
239
- subjectName = _context.t1;
240
- _context.next = 74;
237
+ _t2 = subjectId;
238
+ case 9:
239
+ subjectName = _t2;
240
+ _context.next = 20;
241
241
  break;
242
- case 36:
242
+ case 10:
243
243
  if (!(subjectType === "user")) {
244
- _context.next = 56;
244
+ _context.next = 15;
245
245
  break;
246
246
  }
247
- _context.t4 = this.client;
248
- _context.next = 40;
247
+ _t5 = this.client;
248
+ _context.next = 11;
249
249
  return this.client.ContentObjectLibraryId({
250
250
  objectId: policyId
251
251
  });
252
- case 40:
253
- _context.t5 = _context.sent;
254
- _context.t6 = policyId;
255
- _context.t7 = policyWriteToken;
256
- _context.t8 = UrlJoin("auth_policy_settings", "fabric_users", subjectId);
257
- _context.t9 = {
258
- libraryId: _context.t5,
259
- objectId: _context.t6,
260
- writeToken: _context.t7,
261
- metadataSubtree: _context.t8
252
+ case 11:
253
+ _t6 = _context.sent;
254
+ _t7 = policyId;
255
+ _t8 = policyWriteToken;
256
+ _t9 = UrlJoin("auth_policy_settings", "fabric_users", subjectId);
257
+ _t0 = {
258
+ libraryId: _t6,
259
+ objectId: _t7,
260
+ writeToken: _t8,
261
+ metadataSubtree: _t9
262
262
  };
263
- _context.next = 47;
264
- return _context.t4.ContentObjectMetadata.call(_context.t4, _context.t9);
265
- case 47:
266
- _context.t3 = _context.sent;
267
- if (_context.t3) {
268
- _context.next = 50;
263
+ _context.next = 12;
264
+ return _t5.ContentObjectMetadata.call(_t5, _t0);
265
+ case 12:
266
+ _t4 = _context.sent;
267
+ if (_t4) {
268
+ _context.next = 13;
269
269
  break;
270
270
  }
271
- _context.t3 = {};
272
- case 50:
273
- _context.t2 = _context.t3.name;
274
- if (_context.t2) {
275
- _context.next = 53;
271
+ _t4 = {};
272
+ case 13:
273
+ _t3 = _t4.name;
274
+ if (_t3) {
275
+ _context.next = 14;
276
276
  break;
277
277
  }
278
- _context.t2 = subjectId;
279
- case 53:
280
- subjectName = _context.t2;
281
- _context.next = 74;
278
+ _t3 = subjectId;
279
+ case 14:
280
+ subjectName = _t3;
281
+ _context.next = 20;
282
282
  break;
283
- case 56:
283
+ case 15:
284
284
  if (!(subjectType === "ntp")) {
285
- _context.next = 74;
285
+ _context.next = 20;
286
286
  break;
287
287
  }
288
- _context.t12 = this.client;
289
- _context.next = 60;
288
+ _t11 = this.client;
289
+ _context.next = 16;
290
290
  return this.client.ContentObjectLibraryId({
291
291
  objectId: policyId
292
292
  });
293
- case 60:
294
- _context.t13 = _context.sent;
295
- _context.t14 = policyId;
296
- _context.t15 = policyWriteToken;
297
- _context.t16 = UrlJoin("auth_policy_settings", "ntp_instances", subjectId);
298
- _context.t17 = {
299
- libraryId: _context.t13,
300
- objectId: _context.t14,
301
- writeToken: _context.t15,
302
- metadataSubtree: _context.t16
293
+ case 16:
294
+ _t12 = _context.sent;
295
+ _t13 = policyId;
296
+ _t14 = policyWriteToken;
297
+ _t15 = UrlJoin("auth_policy_settings", "ntp_instances", subjectId);
298
+ _t16 = {
299
+ libraryId: _t12,
300
+ objectId: _t13,
301
+ writeToken: _t14,
302
+ metadataSubtree: _t15
303
303
  };
304
- _context.next = 67;
305
- return _context.t12.ContentObjectMetadata.call(_context.t12, _context.t17);
306
- case 67:
307
- _context.t11 = _context.sent;
308
- if (_context.t11) {
309
- _context.next = 70;
304
+ _context.next = 17;
305
+ return _t11.ContentObjectMetadata.call(_t11, _t16);
306
+ case 17:
307
+ _t10 = _context.sent;
308
+ if (_t10) {
309
+ _context.next = 18;
310
310
  break;
311
311
  }
312
- _context.t11 = {};
313
- case 70:
314
- _context.t10 = _context.t11.name;
315
- if (_context.t10) {
316
- _context.next = 73;
312
+ _t10 = {};
313
+ case 18:
314
+ _t1 = _t10.name;
315
+ if (_t1) {
316
+ _context.next = 19;
317
317
  break;
318
318
  }
319
- _context.t10 = subjectId;
320
- case 73:
321
- subjectName = _context.t10;
322
- case 74:
319
+ _t1 = subjectId;
320
+ case 19:
321
+ subjectName = _t1;
322
+ case 20:
323
323
  this.subjectNames[id] = subjectName;
324
324
  permissionSpec = {
325
325
  profileName: permission.profile,
@@ -338,7 +338,7 @@ var PermissionsClient = /*#__PURE__*/function () {
338
338
  permissionSpec.end = permission.end;
339
339
  }
340
340
  return _context.abrupt("return", permissionSpec);
341
- case 80:
341
+ case 21:
342
342
  case "end":
343
343
  return _context.stop();
344
344
  }
@@ -363,37 +363,37 @@ var PermissionsClient = /*#__PURE__*/function () {
363
363
  }, {
364
364
  key: "OpenOfflineDraft",
365
365
  value: (function () {
366
- var _OpenOfflineDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
366
+ var _OpenOfflineDraft = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref2) {
367
367
  var policyId, policyLibraryId, policyWriteToken, meta;
368
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
368
+ return _regeneratorRuntime.wrap(function (_context2) {
369
369
  while (1) switch (_context2.prev = _context2.next) {
370
370
  case 0:
371
371
  policyId = _ref2.policyId, policyLibraryId = _ref2.policyLibraryId, policyWriteToken = _ref2.policyWriteToken;
372
372
  if (!(policyLibraryId == null)) {
373
- _context2.next = 5;
373
+ _context2.next = 2;
374
374
  break;
375
375
  }
376
- _context2.next = 4;
376
+ _context2.next = 1;
377
377
  return this.client.ContentObjectLibraryId({
378
378
  objectId: policyId
379
379
  });
380
- case 4:
380
+ case 1:
381
381
  policyLibraryId = _context2.sent;
382
- case 5:
383
- _context2.next = 7;
382
+ case 2:
383
+ _context2.next = 3;
384
384
  return this.client.ContentObjectMetadata({
385
385
  libraryId: policyLibraryId,
386
386
  objectId: policyId,
387
387
  writeToken: policyWriteToken
388
388
  });
389
- case 7:
389
+ case 3:
390
390
  meta = _context2.sent;
391
391
  this.drafts[policyId] = {
392
392
  meta: meta,
393
393
  policyLibraryId: policyLibraryId,
394
394
  policyWriteToken: policyWriteToken
395
395
  };
396
- case 9:
396
+ case 4:
397
397
  case "end":
398
398
  return _context2.stop();
399
399
  }
@@ -416,28 +416,28 @@ var PermissionsClient = /*#__PURE__*/function () {
416
416
  }, {
417
417
  key: "CloseOfflineDraft",
418
418
  value: (function () {
419
- var _CloseOfflineDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
419
+ var _CloseOfflineDraft = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref3) {
420
420
  var policyId;
421
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
421
+ return _regeneratorRuntime.wrap(function (_context3) {
422
422
  while (1) switch (_context3.prev = _context3.next) {
423
423
  case 0:
424
424
  policyId = _ref3.policyId;
425
425
  if (!(this.drafts[policyId] == null)) {
426
- _context3.next = 3;
426
+ _context3.next = 1;
427
427
  break;
428
428
  }
429
429
  throw Error("No draft open for policyId: " + policyId);
430
- case 3:
431
- _context3.next = 5;
430
+ case 1:
431
+ _context3.next = 2;
432
432
  return this.client.ReplaceMetadata({
433
433
  libraryId: this.drafts[policyId].policyLibraryId,
434
434
  objectId: policyId,
435
435
  writeToken: this.drafts[policyId].policyWriteToken,
436
436
  metadata: this.drafts[policyId].meta
437
437
  });
438
- case 5:
438
+ case 2:
439
439
  this.drafts[policyId] = null;
440
- case 6:
440
+ case 3:
441
441
  case "end":
442
442
  return _context3.stop();
443
443
  }
@@ -462,41 +462,41 @@ var PermissionsClient = /*#__PURE__*/function () {
462
462
  }, {
463
463
  key: "PolicyItems",
464
464
  value: (function () {
465
- var _PolicyItems = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
466
- var policyId, policyWriteToken;
467
- return _regeneratorRuntime.wrap(function _callee4$(_context4) {
465
+ var _PolicyItems = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(_ref4) {
466
+ var policyId, policyWriteToken, _t17, _t18, _t19, _t20, _t21, _t22, _t23;
467
+ return _regeneratorRuntime.wrap(function (_context4) {
468
468
  while (1) switch (_context4.prev = _context4.next) {
469
469
  case 0:
470
470
  policyId = _ref4.policyId, policyWriteToken = _ref4.policyWriteToken;
471
- _context4.t1 = this.client;
472
- _context4.next = 4;
471
+ _t18 = this.client;
472
+ _context4.next = 1;
473
473
  return this.client.ContentObjectLibraryId({
474
474
  objectId: policyId
475
475
  });
476
- case 4:
477
- _context4.t2 = _context4.sent;
478
- _context4.t3 = policyId;
479
- _context4.t4 = policyWriteToken;
480
- _context4.t5 = ["*/display_title"];
481
- _context4.t6 = {
482
- libraryId: _context4.t2,
483
- objectId: _context4.t3,
484
- writeToken: _context4.t4,
476
+ case 1:
477
+ _t19 = _context4.sent;
478
+ _t20 = policyId;
479
+ _t21 = policyWriteToken;
480
+ _t22 = ["*/display_title"];
481
+ _t23 = {
482
+ libraryId: _t19,
483
+ objectId: _t20,
484
+ writeToken: _t21,
485
485
  metadataSubtree: "auth_policy_spec",
486
- select: _context4.t5
486
+ select: _t22
487
487
  };
488
- _context4.next = 11;
489
- return _context4.t1.ContentObjectMetadata.call(_context4.t1, _context4.t6);
490
- case 11:
491
- _context4.t0 = _context4.sent;
492
- if (_context4.t0) {
493
- _context4.next = 14;
488
+ _context4.next = 2;
489
+ return _t18.ContentObjectMetadata.call(_t18, _t23);
490
+ case 2:
491
+ _t17 = _context4.sent;
492
+ if (_t17) {
493
+ _context4.next = 3;
494
494
  break;
495
495
  }
496
- _context4.t0 = {};
497
- case 14:
498
- return _context4.abrupt("return", _context4.t0);
499
- case 15:
496
+ _t17 = {};
497
+ case 3:
498
+ return _context4.abrupt("return", _t17);
499
+ case 4:
500
500
  case "end":
501
501
  return _context4.stop();
502
502
  }
@@ -521,39 +521,39 @@ var PermissionsClient = /*#__PURE__*/function () {
521
521
  }, {
522
522
  key: "ItemPolicy",
523
523
  value: (function () {
524
- var _ItemPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
524
+ var _ItemPolicy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(_ref5) {
525
525
  var policyId, policyWriteToken, itemId, profiles, permissions;
526
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
526
+ return _regeneratorRuntime.wrap(function (_context5) {
527
527
  while (1) switch (_context5.prev = _context5.next) {
528
528
  case 0:
529
529
  policyId = _ref5.policyId, policyWriteToken = _ref5.policyWriteToken, itemId = _ref5.itemId;
530
- _context5.next = 3;
530
+ _context5.next = 1;
531
531
  return this.ItemProfiles({
532
532
  policyId: policyId,
533
533
  policyWriteToken: policyWriteToken,
534
534
  itemId: itemId
535
535
  });
536
- case 3:
536
+ case 1:
537
537
  profiles = _context5.sent;
538
- _context5.next = 6;
538
+ _context5.next = 2;
539
539
  return this.ItemPermissions({
540
540
  policyId: policyId,
541
541
  policyWriteToken: policyWriteToken,
542
542
  itemId: itemId
543
543
  });
544
- case 6:
544
+ case 2:
545
545
  permissions = _context5.sent;
546
546
  if (!(!profiles || !permissions)) {
547
- _context5.next = 9;
547
+ _context5.next = 3;
548
548
  break;
549
549
  }
550
550
  return _context5.abrupt("return");
551
- case 9:
551
+ case 3:
552
552
  return _context5.abrupt("return", {
553
553
  profiles: profiles,
554
554
  permissions: permissions
555
555
  });
556
- case 10:
556
+ case 4:
557
557
  case "end":
558
558
  return _context5.stop();
559
559
  }
@@ -578,10 +578,10 @@ var PermissionsClient = /*#__PURE__*/function () {
578
578
  }, {
579
579
  key: "CreateItemPolicy",
580
580
  value: (function () {
581
- var _CreateItemPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref6) {
581
+ var _CreateItemPolicy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(_ref6) {
582
582
  var _this2 = this;
583
- var policyId, policyWriteToken, itemId, _ref6$profiles, profiles, metadata, assetMetadata, displayTitle, itemSpec;
584
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
583
+ var policyId, policyWriteToken, itemId, _ref6$profiles, profiles, metadata, assetMetadata, displayTitle, itemSpec, _t24, _t25, _t26, _t27, _t28, _t29, _t30, _t31, _t32, _t33, _t34, _t35, _t36;
584
+ return _regeneratorRuntime.wrap(function (_context6) {
585
585
  while (1) switch (_context6.prev = _context6.next) {
586
586
  case 0:
587
587
  policyId = _ref6.policyId, policyWriteToken = _ref6.policyWriteToken, itemId = _ref6.itemId, _ref6$profiles = _ref6.profiles, profiles = _ref6$profiles === void 0 ? {} : _ref6$profiles;
@@ -589,31 +589,31 @@ var PermissionsClient = /*#__PURE__*/function () {
589
589
  ValidatePresence("policyWriteToken", policyWriteToken);
590
590
  ValidatePresence("itemId", itemId);
591
591
  ValidatePresence("profiles", profiles);
592
- _context6.t1 = this.client;
593
- _context6.next = 8;
592
+ _t25 = this.client;
593
+ _context6.next = 1;
594
594
  return this.client.ContentObjectLibraryId({
595
595
  objectId: itemId
596
596
  });
597
- case 8:
598
- _context6.t2 = _context6.sent;
599
- _context6.t3 = itemId;
600
- _context6.t4 = ["public/name", "public/asset_metadata/title", "public/asset_metadata/display_title"];
601
- _context6.t5 = {
602
- libraryId: _context6.t2,
603
- objectId: _context6.t3,
604
- select: _context6.t4
597
+ case 1:
598
+ _t26 = _context6.sent;
599
+ _t27 = itemId;
600
+ _t28 = ["public/name", "public/asset_metadata/title", "public/asset_metadata/display_title"];
601
+ _t29 = {
602
+ libraryId: _t26,
603
+ objectId: _t27,
604
+ select: _t28
605
605
  };
606
- _context6.next = 14;
607
- return _context6.t1.ContentObjectMetadata.call(_context6.t1, _context6.t5);
608
- case 14:
609
- _context6.t0 = _context6.sent;
610
- if (_context6.t0) {
611
- _context6.next = 17;
606
+ _context6.next = 2;
607
+ return _t25.ContentObjectMetadata.call(_t25, _t29);
608
+ case 2:
609
+ _t24 = _context6.sent;
610
+ if (_t24) {
611
+ _context6.next = 3;
612
612
  break;
613
613
  }
614
- _context6.t0 = {};
615
- case 17:
616
- metadata = _context6.t0;
614
+ _t24 = {};
615
+ case 3:
616
+ metadata = _t24;
617
617
  assetMetadata = (metadata["public"] || {}).asset_metadata || {};
618
618
  displayTitle = assetMetadata.display_title || assetMetadata.title || (metadata["public"] || {}).name;
619
619
  itemSpec = {
@@ -624,27 +624,27 @@ var PermissionsClient = /*#__PURE__*/function () {
624
624
  Object.keys(profiles).forEach(function (profileName) {
625
625
  itemSpec.profiles[profileName] = _this2.FormatProfile(profiles[profileName]);
626
626
  });
627
- _context6.t6 = this.client;
628
- _context6.next = 25;
627
+ _t30 = this.client;
628
+ _context6.next = 4;
629
629
  return this.client.ContentObjectLibraryId({
630
630
  objectId: policyId
631
631
  });
632
- case 25:
633
- _context6.t7 = _context6.sent;
634
- _context6.t8 = policyId;
635
- _context6.t9 = policyWriteToken;
636
- _context6.t10 = UrlJoin("auth_policy_spec", itemId);
637
- _context6.t11 = itemSpec;
638
- _context6.t12 = {
639
- libraryId: _context6.t7,
640
- objectId: _context6.t8,
641
- writeToken: _context6.t9,
642
- metadataSubtree: _context6.t10,
643
- metadata: _context6.t11
632
+ case 4:
633
+ _t31 = _context6.sent;
634
+ _t32 = policyId;
635
+ _t33 = policyWriteToken;
636
+ _t34 = UrlJoin("auth_policy_spec", itemId);
637
+ _t35 = itemSpec;
638
+ _t36 = {
639
+ libraryId: _t31,
640
+ objectId: _t32,
641
+ writeToken: _t33,
642
+ metadataSubtree: _t34,
643
+ metadata: _t35
644
644
  };
645
- _context6.next = 33;
646
- return _context6.t6.ReplaceMetadata.call(_context6.t6, _context6.t12);
647
- case 33:
645
+ _context6.next = 5;
646
+ return _t30.ReplaceMetadata.call(_t30, _t36);
647
+ case 5:
648
648
  case "end":
649
649
  return _context6.stop();
650
650
  }
@@ -668,34 +668,34 @@ var PermissionsClient = /*#__PURE__*/function () {
668
668
  }, {
669
669
  key: "RemoveItemPolicy",
670
670
  value: (function () {
671
- var _RemoveItemPolicy = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref7) {
672
- var policyId, policyWriteToken, itemId;
673
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
671
+ var _RemoveItemPolicy = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref7) {
672
+ var policyId, policyWriteToken, itemId, _t37, _t38, _t39, _t40, _t41, _t42;
673
+ return _regeneratorRuntime.wrap(function (_context7) {
674
674
  while (1) switch (_context7.prev = _context7.next) {
675
675
  case 0:
676
676
  policyId = _ref7.policyId, policyWriteToken = _ref7.policyWriteToken, itemId = _ref7.itemId;
677
677
  ValidatePresence("policyId", policyId);
678
678
  ValidatePresence("policyWriteToken", policyWriteToken);
679
679
  ValidatePresence("itemId", itemId);
680
- _context7.t0 = this.client;
681
- _context7.next = 7;
680
+ _t37 = this.client;
681
+ _context7.next = 1;
682
682
  return this.client.ContentObjectLibraryId({
683
683
  objectId: policyId
684
684
  });
685
- case 7:
686
- _context7.t1 = _context7.sent;
687
- _context7.t2 = policyId;
688
- _context7.t3 = policyWriteToken;
689
- _context7.t4 = UrlJoin("auth_policy_spec", itemId);
690
- _context7.t5 = {
691
- libraryId: _context7.t1,
692
- objectId: _context7.t2,
693
- writeToken: _context7.t3,
694
- metadataSubtree: _context7.t4
685
+ case 1:
686
+ _t38 = _context7.sent;
687
+ _t39 = policyId;
688
+ _t40 = policyWriteToken;
689
+ _t41 = UrlJoin("auth_policy_spec", itemId);
690
+ _t42 = {
691
+ libraryId: _t38,
692
+ objectId: _t39,
693
+ writeToken: _t40,
694
+ metadataSubtree: _t41
695
695
  };
696
- _context7.next = 14;
697
- return _context7.t0.DeleteMetadata.call(_context7.t0, _context7.t5);
698
- case 14:
696
+ _context7.next = 2;
697
+ return _t37.DeleteMetadata.call(_t37, _t42);
698
+ case 2:
699
699
  case "end":
700
700
  return _context7.stop();
701
701
  }
@@ -721,33 +721,33 @@ var PermissionsClient = /*#__PURE__*/function () {
721
721
  }, {
722
722
  key: "ItemProfiles",
723
723
  value: (function () {
724
- var _ItemProfiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref8) {
725
- var policyId, policyWriteToken, itemId, profileName;
726
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
724
+ var _ItemProfiles = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref8) {
725
+ var policyId, policyWriteToken, itemId, profileName, _t43, _t44, _t45, _t46, _t47, _t48;
726
+ return _regeneratorRuntime.wrap(function (_context8) {
727
727
  while (1) switch (_context8.prev = _context8.next) {
728
728
  case 0:
729
729
  policyId = _ref8.policyId, policyWriteToken = _ref8.policyWriteToken, itemId = _ref8.itemId, profileName = _ref8.profileName;
730
- _context8.t0 = this.client;
731
- _context8.next = 4;
730
+ _t43 = this.client;
731
+ _context8.next = 1;
732
732
  return this.client.ContentObjectLibraryId({
733
733
  objectId: policyId
734
734
  });
735
- case 4:
736
- _context8.t1 = _context8.sent;
737
- _context8.t2 = policyId;
738
- _context8.t3 = policyWriteToken;
739
- _context8.t4 = UrlJoin("auth_policy_spec", itemId, "profiles", profileName || "");
740
- _context8.t5 = {
741
- libraryId: _context8.t1,
742
- objectId: _context8.t2,
743
- writeToken: _context8.t3,
744
- metadataSubtree: _context8.t4
735
+ case 1:
736
+ _t44 = _context8.sent;
737
+ _t45 = policyId;
738
+ _t46 = policyWriteToken;
739
+ _t47 = UrlJoin("auth_policy_spec", itemId, "profiles", profileName || "");
740
+ _t48 = {
741
+ libraryId: _t44,
742
+ objectId: _t45,
743
+ writeToken: _t46,
744
+ metadataSubtree: _t47
745
745
  };
746
- _context8.next = 11;
747
- return _context8.t0.ContentObjectMetadata.call(_context8.t0, _context8.t5);
748
- case 11:
746
+ _context8.next = 2;
747
+ return _t43.ContentObjectMetadata.call(_t43, _t48);
748
+ case 2:
749
749
  return _context8.abrupt("return", _context8.sent);
750
- case 12:
750
+ case 3:
751
751
  case "end":
752
752
  return _context8.stop();
753
753
  }
@@ -774,9 +774,9 @@ var PermissionsClient = /*#__PURE__*/function () {
774
774
  }, {
775
775
  key: "SetProfile",
776
776
  value: (function () {
777
- var _SetProfile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref9) {
778
- var policyId, policyWriteToken, itemId, profileName, profileSpec;
779
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
777
+ var _SetProfile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(_ref9) {
778
+ var policyId, policyWriteToken, itemId, profileName, profileSpec, _t49, _t50, _t51, _t52, _t53, _t54, _t55;
779
+ return _regeneratorRuntime.wrap(function (_context9) {
780
780
  while (1) switch (_context9.prev = _context9.next) {
781
781
  case 0:
782
782
  policyId = _ref9.policyId, policyWriteToken = _ref9.policyWriteToken, itemId = _ref9.itemId, profileName = _ref9.profileName, profileSpec = _ref9.profileSpec;
@@ -785,27 +785,27 @@ var PermissionsClient = /*#__PURE__*/function () {
785
785
  ValidatePresence("itemId", itemId);
786
786
  ValidatePresence("profileName", profileName);
787
787
  ValidatePresence("profileSpec", profileSpec);
788
- _context9.t0 = this.client;
789
- _context9.next = 9;
788
+ _t49 = this.client;
789
+ _context9.next = 1;
790
790
  return this.client.ContentObjectLibraryId({
791
791
  objectId: policyId
792
792
  });
793
- case 9:
794
- _context9.t1 = _context9.sent;
795
- _context9.t2 = policyId;
796
- _context9.t3 = policyWriteToken;
797
- _context9.t4 = UrlJoin("auth_policy_spec", itemId, "profiles", profileName);
798
- _context9.t5 = this.FormatProfile(profileSpec);
799
- _context9.t6 = {
800
- libraryId: _context9.t1,
801
- objectId: _context9.t2,
802
- writeToken: _context9.t3,
803
- metadataSubtree: _context9.t4,
804
- metadata: _context9.t5
793
+ case 1:
794
+ _t50 = _context9.sent;
795
+ _t51 = policyId;
796
+ _t52 = policyWriteToken;
797
+ _t53 = UrlJoin("auth_policy_spec", itemId, "profiles", profileName);
798
+ _t54 = this.FormatProfile(profileSpec);
799
+ _t55 = {
800
+ libraryId: _t50,
801
+ objectId: _t51,
802
+ writeToken: _t52,
803
+ metadataSubtree: _t53,
804
+ metadata: _t54
805
805
  };
806
- _context9.next = 17;
807
- return _context9.t0.ReplaceMetadata.call(_context9.t0, _context9.t6);
808
- case 17:
806
+ _context9.next = 2;
807
+ return _t49.ReplaceMetadata.call(_t49, _t55);
808
+ case 2:
809
809
  case "end":
810
810
  return _context9.stop();
811
811
  }
@@ -832,41 +832,41 @@ var PermissionsClient = /*#__PURE__*/function () {
832
832
  }, {
833
833
  key: "RemoveProfile",
834
834
  value: (function () {
835
- var _RemoveProfile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref10) {
836
- var policyId, policyWriteToken, itemId, profileName;
837
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
838
- while (1) switch (_context10.prev = _context10.next) {
835
+ var _RemoveProfile = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(_ref0) {
836
+ var policyId, policyWriteToken, itemId, profileName, _t56, _t57, _t58, _t59, _t60, _t61;
837
+ return _regeneratorRuntime.wrap(function (_context0) {
838
+ while (1) switch (_context0.prev = _context0.next) {
839
839
  case 0:
840
- policyId = _ref10.policyId, policyWriteToken = _ref10.policyWriteToken, itemId = _ref10.itemId, profileName = _ref10.profileName;
840
+ policyId = _ref0.policyId, policyWriteToken = _ref0.policyWriteToken, itemId = _ref0.itemId, profileName = _ref0.profileName;
841
841
  ValidatePresence("policyId", policyId);
842
842
  ValidatePresence("policyWriteToken", policyWriteToken);
843
843
  ValidatePresence("itemId", itemId);
844
844
  ValidatePresence("profileName", profileName);
845
- _context10.t0 = this.client;
846
- _context10.next = 8;
845
+ _t56 = this.client;
846
+ _context0.next = 1;
847
847
  return this.client.ContentObjectLibraryId({
848
848
  objectId: policyId
849
849
  });
850
- case 8:
851
- _context10.t1 = _context10.sent;
852
- _context10.t2 = policyId;
853
- _context10.t3 = policyWriteToken;
854
- _context10.t4 = UrlJoin("auth_policy_spec", itemId, "profiles", profileName);
855
- _context10.t5 = {
856
- libraryId: _context10.t1,
857
- objectId: _context10.t2,
858
- writeToken: _context10.t3,
859
- metadataSubtree: _context10.t4
850
+ case 1:
851
+ _t57 = _context0.sent;
852
+ _t58 = policyId;
853
+ _t59 = policyWriteToken;
854
+ _t60 = UrlJoin("auth_policy_spec", itemId, "profiles", profileName);
855
+ _t61 = {
856
+ libraryId: _t57,
857
+ objectId: _t58,
858
+ writeToken: _t59,
859
+ metadataSubtree: _t60
860
860
  };
861
- _context10.next = 15;
862
- return _context10.t0.DeleteMetadata.call(_context10.t0, _context10.t5);
863
- case 15:
861
+ _context0.next = 2;
862
+ return _t56.DeleteMetadata.call(_t56, _t61);
863
+ case 2:
864
864
  case "end":
865
- return _context10.stop();
865
+ return _context0.stop();
866
866
  }
867
- }, _callee10, this);
867
+ }, _callee0, this);
868
868
  }));
869
- function RemoveProfile(_x10) {
869
+ function RemoveProfile(_x0) {
870
870
  return _RemoveProfile.apply(this, arguments);
871
871
  }
872
872
  return RemoveProfile;
@@ -887,68 +887,68 @@ var PermissionsClient = /*#__PURE__*/function () {
887
887
  }, {
888
888
  key: "ItemPermissions",
889
889
  value: (function () {
890
- var _ItemPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(_ref11) {
890
+ var _ItemPermissions = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(_ref1) {
891
891
  var _this3 = this;
892
- var policyId, policyWriteToken, itemId, libraryId, permissions;
893
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
894
- while (1) switch (_context12.prev = _context12.next) {
892
+ var policyId, policyWriteToken, itemId, libraryId, permissions, _t62;
893
+ return _regeneratorRuntime.wrap(function (_context10) {
894
+ while (1) switch (_context10.prev = _context10.next) {
895
895
  case 0:
896
- policyId = _ref11.policyId, policyWriteToken = _ref11.policyWriteToken, itemId = _ref11.itemId;
897
- _context12.next = 3;
896
+ policyId = _ref1.policyId, policyWriteToken = _ref1.policyWriteToken, itemId = _ref1.itemId;
897
+ _context10.next = 1;
898
898
  return this.client.ContentObjectLibraryId({
899
899
  objectId: policyId
900
900
  });
901
- case 3:
902
- libraryId = _context12.sent;
903
- _context12.next = 6;
901
+ case 1:
902
+ libraryId = _context10.sent;
903
+ _context10.next = 2;
904
904
  return this.client.ContentObjectMetadata({
905
905
  libraryId: libraryId,
906
906
  objectId: policyId,
907
907
  writeToken: policyWriteToken,
908
908
  metadataSubtree: UrlJoin("auth_policy_spec", itemId, "permissions")
909
909
  });
910
- case 6:
911
- _context12.t0 = _context12.sent;
912
- if (_context12.t0) {
913
- _context12.next = 9;
910
+ case 2:
911
+ _t62 = _context10.sent;
912
+ if (_t62) {
913
+ _context10.next = 3;
914
914
  break;
915
915
  }
916
- _context12.t0 = [];
917
- case 9:
918
- permissions = _context12.t0;
919
- _context12.next = 12;
920
- return Promise.all(permissions.map( /*#__PURE__*/function () {
921
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(permission) {
922
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
923
- while (1) switch (_context11.prev = _context11.next) {
916
+ _t62 = [];
917
+ case 3:
918
+ permissions = _t62;
919
+ _context10.next = 4;
920
+ return Promise.all(permissions.map(/*#__PURE__*/function () {
921
+ var _ref10 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee1(permission) {
922
+ return _regeneratorRuntime.wrap(function (_context1) {
923
+ while (1) switch (_context1.prev = _context1.next) {
924
924
  case 0:
925
- _context11.next = 2;
925
+ _context1.next = 1;
926
926
  return _this3.FormatPermission({
927
927
  policyId: policyId,
928
928
  policyWriteToken: policyWriteToken,
929
929
  permission: permission
930
930
  });
931
+ case 1:
932
+ return _context1.abrupt("return", _context1.sent);
931
933
  case 2:
932
- return _context11.abrupt("return", _context11.sent);
933
- case 3:
934
934
  case "end":
935
- return _context11.stop();
935
+ return _context1.stop();
936
936
  }
937
- }, _callee11);
937
+ }, _callee1);
938
938
  }));
939
- return function (_x12) {
940
- return _ref12.apply(this, arguments);
939
+ return function (_x10) {
940
+ return _ref10.apply(this, arguments);
941
941
  };
942
942
  }()));
943
- case 12:
944
- return _context12.abrupt("return", _context12.sent);
945
- case 13:
943
+ case 4:
944
+ return _context10.abrupt("return", _context10.sent);
945
+ case 5:
946
946
  case "end":
947
- return _context12.stop();
947
+ return _context10.stop();
948
948
  }
949
- }, _callee12, this);
949
+ }, _callee10, this);
950
950
  }));
951
- function ItemPermissions(_x11) {
951
+ function ItemPermissions(_x1) {
952
952
  return _ItemPermissions.apply(this, arguments);
953
953
  }
954
954
  return ItemPermissions;
@@ -974,12 +974,12 @@ var PermissionsClient = /*#__PURE__*/function () {
974
974
  }, {
975
975
  key: "SetPermission",
976
976
  value: (function () {
977
- var _SetPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref13) {
978
- var policyId, policyWriteToken, itemId, _ref13$subjectSource, subjectSource, _ref13$subjectType, subjectType, subjectName, subjectId, subjectNTPId, profileName, start, end, offlineDraft, policyLibraryId, existingPermissions, index, permissionSpec, subjectInfo, newMeta, userInfo, _newMeta, _userInfo;
979
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
980
- while (1) switch (_context13.prev = _context13.next) {
977
+ var _SetPermission = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(_ref11) {
978
+ var policyId, policyWriteToken, itemId, _ref11$subjectSource, subjectSource, _ref11$subjectType, subjectType, subjectName, subjectId, subjectNTPId, profileName, start, end, offlineDraft, policyLibraryId, existingPermissions, index, permissionSpec, subjectInfo, newMeta, userInfo, _newMeta, _userInfo;
979
+ return _regeneratorRuntime.wrap(function (_context11) {
980
+ while (1) switch (_context11.prev = _context11.next) {
981
981
  case 0:
982
- policyId = _ref13.policyId, policyWriteToken = _ref13.policyWriteToken, itemId = _ref13.itemId, _ref13$subjectSource = _ref13.subjectSource, subjectSource = _ref13$subjectSource === void 0 ? "fabric" : _ref13$subjectSource, _ref13$subjectType = _ref13.subjectType, subjectType = _ref13$subjectType === void 0 ? "group" : _ref13$subjectType, subjectName = _ref13.subjectName, subjectId = _ref13.subjectId, subjectNTPId = _ref13.subjectNTPId, profileName = _ref13.profileName, start = _ref13.start, end = _ref13.end;
982
+ policyId = _ref11.policyId, policyWriteToken = _ref11.policyWriteToken, itemId = _ref11.itemId, _ref11$subjectSource = _ref11.subjectSource, subjectSource = _ref11$subjectSource === void 0 ? "fabric" : _ref11$subjectSource, _ref11$subjectType = _ref11.subjectType, subjectType = _ref11$subjectType === void 0 ? "group" : _ref11$subjectType, subjectName = _ref11.subjectName, subjectId = _ref11.subjectId, subjectNTPId = _ref11.subjectNTPId, profileName = _ref11.profileName, start = _ref11.start, end = _ref11.end;
983
983
  ValidatePresence("policyId", policyId);
984
984
  ValidatePresence("policyWriteToken", policyWriteToken);
985
985
  ValidatePresence("itemId", itemId);
@@ -994,16 +994,16 @@ var PermissionsClient = /*#__PURE__*/function () {
994
994
  offlineDraft = this.offline && this.drafts[policyId] != null;
995
995
  policyLibraryId = null;
996
996
  if (offlineDraft) {
997
- _context13.next = 16;
997
+ _context11.next = 2;
998
998
  break;
999
999
  }
1000
- _context13.next = 15;
1000
+ _context11.next = 1;
1001
1001
  return this.client.ContentObjectLibraryId({
1002
1002
  objectId: policyId
1003
1003
  });
1004
- case 15:
1005
- policyLibraryId = _context13.sent;
1006
- case 16:
1004
+ case 1:
1005
+ policyLibraryId = _context11.sent;
1006
+ case 2:
1007
1007
  // Allow address to be passed in for fabric subjects, though spec requires iusr/igrp hash
1008
1008
  if (subjectSource === "fabric") {
1009
1009
  if (subjectType === "group") {
@@ -1017,35 +1017,35 @@ var PermissionsClient = /*#__PURE__*/function () {
1017
1017
  }
1018
1018
  }
1019
1019
  if (!offlineDraft) {
1020
- _context13.next = 21;
1020
+ _context11.next = 3;
1021
1021
  break;
1022
1022
  }
1023
1023
  existingPermissions = this.drafts[policyId].meta["auth_policy_spec"][itemId];
1024
- _context13.next = 24;
1024
+ _context11.next = 5;
1025
1025
  break;
1026
- case 21:
1027
- _context13.next = 23;
1026
+ case 3:
1027
+ _context11.next = 4;
1028
1028
  return this.client.ContentObjectMetadata({
1029
1029
  libraryId: policyLibraryId,
1030
1030
  objectId: policyId,
1031
1031
  writeToken: policyWriteToken,
1032
1032
  metadataSubtree: UrlJoin("auth_policy_spec", itemId)
1033
1033
  });
1034
- case 23:
1035
- existingPermissions = _context13.sent;
1036
- case 24:
1034
+ case 4:
1035
+ existingPermissions = _context11.sent;
1036
+ case 5:
1037
1037
  if (existingPermissions) {
1038
- _context13.next = 26;
1038
+ _context11.next = 6;
1039
1039
  break;
1040
1040
  }
1041
1041
  throw Error("Unable to add permissions to uninitialized item");
1042
- case 26:
1042
+ case 6:
1043
1043
  if (existingPermissions.profiles[profileName]) {
1044
- _context13.next = 28;
1044
+ _context11.next = 7;
1045
1045
  break;
1046
1046
  }
1047
1047
  throw Error("Profile '".concat(profileName, "' does not exist"));
1048
- case 28:
1048
+ case 7:
1049
1049
  index = existingPermissions.permissions.findIndex(function (permission) {
1050
1050
  if (subjectSource === "fabric") {
1051
1051
  return permission.subject.id === subjectId;
@@ -1066,44 +1066,44 @@ var PermissionsClient = /*#__PURE__*/function () {
1066
1066
  permissionSpec.end = end;
1067
1067
  }
1068
1068
  if (!(subjectSource === "fabric")) {
1069
- _context13.next = 53;
1069
+ _context11.next = 13;
1070
1070
  break;
1071
1071
  }
1072
1072
  if (!(subjectType === "group")) {
1073
- _context13.next = 38;
1073
+ _context11.next = 8;
1074
1074
  break;
1075
1075
  }
1076
1076
  subjectInfo = {
1077
1077
  id: subjectId,
1078
1078
  type: "group"
1079
1079
  };
1080
- _context13.next = 51;
1080
+ _context11.next = 12;
1081
1081
  break;
1082
- case 38:
1082
+ case 8:
1083
1083
  if (!(subjectType === "user")) {
1084
- _context13.next = 42;
1084
+ _context11.next = 9;
1085
1085
  break;
1086
1086
  }
1087
1087
  subjectInfo = {
1088
1088
  id: subjectId,
1089
1089
  type: "user"
1090
1090
  };
1091
- _context13.next = 51;
1091
+ _context11.next = 12;
1092
1092
  break;
1093
- case 42:
1093
+ case 9:
1094
1094
  if (!(subjectType === "ntp")) {
1095
- _context13.next = 46;
1095
+ _context11.next = 10;
1096
1096
  break;
1097
1097
  }
1098
1098
  subjectInfo = {
1099
1099
  id: subjectId,
1100
1100
  type: "otp"
1101
1101
  };
1102
- _context13.next = 51;
1102
+ _context11.next = 12;
1103
1103
  break;
1104
- case 46:
1104
+ case 10:
1105
1105
  if (!(subjectType === "ntp_subject")) {
1106
- _context13.next = 50;
1106
+ _context11.next = 11;
1107
1107
  break;
1108
1108
  }
1109
1109
  subjectInfo = {
@@ -1111,20 +1111,20 @@ var PermissionsClient = /*#__PURE__*/function () {
1111
1111
  otp_id: subjectNTPId,
1112
1112
  type: "otp_subject"
1113
1113
  };
1114
- _context13.next = 51;
1114
+ _context11.next = 12;
1115
1115
  break;
1116
- case 50:
1116
+ case 11:
1117
1117
  throw Error("Invalid subject type: ".concat(subjectType));
1118
- case 51:
1119
- _context13.next = 66;
1118
+ case 12:
1119
+ _context11.next = 18;
1120
1120
  break;
1121
- case 53:
1121
+ case 13:
1122
1122
  if (!(subjectSource === "oauth")) {
1123
- _context13.next = 65;
1123
+ _context11.next = 17;
1124
1124
  break;
1125
1125
  }
1126
1126
  if (!(subjectType === "group")) {
1127
- _context13.next = 58;
1127
+ _context11.next = 14;
1128
1128
  break;
1129
1129
  }
1130
1130
  subjectInfo = {
@@ -1132,11 +1132,11 @@ var PermissionsClient = /*#__PURE__*/function () {
1132
1132
  oauth_id: subjectId,
1133
1133
  type: "oauth_group"
1134
1134
  };
1135
- _context13.next = 63;
1135
+ _context11.next = 16;
1136
1136
  break;
1137
- case 58:
1137
+ case 14:
1138
1138
  if (!(subjectType === "user")) {
1139
- _context13.next = 62;
1139
+ _context11.next = 15;
1140
1140
  break;
1141
1141
  }
1142
1142
  subjectInfo = {
@@ -1144,23 +1144,23 @@ var PermissionsClient = /*#__PURE__*/function () {
1144
1144
  oauth_id: subjectId,
1145
1145
  type: "oauth_user"
1146
1146
  };
1147
- _context13.next = 63;
1147
+ _context11.next = 16;
1148
1148
  break;
1149
- case 62:
1149
+ case 15:
1150
1150
  throw Error("Invalid subject type: ".concat(subjectType));
1151
- case 63:
1152
- _context13.next = 66;
1151
+ case 16:
1152
+ _context11.next = 18;
1153
1153
  break;
1154
- case 65:
1154
+ case 17:
1155
1155
  throw Error("Invalid subject source: ".concat(subjectSource));
1156
- case 66:
1156
+ case 18:
1157
1157
  permissionSpec.subject = subjectInfo;
1158
1158
  existingPermissions.permissions[index] = permissionSpec;
1159
1159
  if (offlineDraft) {
1160
- _context13.next = 71;
1160
+ _context11.next = 19;
1161
1161
  break;
1162
1162
  }
1163
- _context13.next = 71;
1163
+ _context11.next = 19;
1164
1164
  return this.client.ReplaceMetadata({
1165
1165
  libraryId: policyLibraryId,
1166
1166
  objectId: policyId,
@@ -1168,9 +1168,9 @@ var PermissionsClient = /*#__PURE__*/function () {
1168
1168
  metadataSubtree: UrlJoin("auth_policy_spec", itemId, "permissions"),
1169
1169
  metadata: existingPermissions.permissions
1170
1170
  });
1171
- case 71:
1171
+ case 19:
1172
1172
  if (!(subjectSource === "fabric" && subjectType === "user")) {
1173
- _context13.next = 85;
1173
+ _context11.next = 23;
1174
1174
  break;
1175
1175
  }
1176
1176
  newMeta = {
@@ -1178,27 +1178,27 @@ var PermissionsClient = /*#__PURE__*/function () {
1178
1178
  name: subjectName
1179
1179
  };
1180
1180
  if (!offlineDraft) {
1181
- _context13.next = 77;
1181
+ _context11.next = 20;
1182
1182
  break;
1183
1183
  }
1184
1184
  this.drafts[policyId].meta["auth_policy_settings"]["fabric_users"][this.client.utils.HashToAddress(subjectId)] = newMeta;
1185
- _context13.next = 83;
1185
+ _context11.next = 22;
1186
1186
  break;
1187
- case 77:
1188
- _context13.next = 79;
1187
+ case 20:
1188
+ _context11.next = 21;
1189
1189
  return this.client.ContentObjectMetadata({
1190
1190
  libraryId: policyLibraryId,
1191
1191
  objectId: policyId,
1192
1192
  writeToken: policyWriteToken,
1193
1193
  metadataSubtree: UrlJoin("auth_policy_settings", "fabric_users", this.client.utils.HashToAddress(subjectId))
1194
1194
  });
1195
- case 79:
1196
- userInfo = _context13.sent;
1195
+ case 21:
1196
+ userInfo = _context11.sent;
1197
1197
  if (userInfo) {
1198
- _context13.next = 83;
1198
+ _context11.next = 22;
1199
1199
  break;
1200
1200
  }
1201
- _context13.next = 83;
1201
+ _context11.next = 22;
1202
1202
  return this.client.ReplaceMetadata({
1203
1203
  libraryId: policyLibraryId,
1204
1204
  objectId: policyId,
@@ -1206,12 +1206,12 @@ var PermissionsClient = /*#__PURE__*/function () {
1206
1206
  metadataSubtree: UrlJoin("auth_policy_settings", "fabric_users", this.client.utils.HashToAddress(subjectId)),
1207
1207
  metadata: newMeta
1208
1208
  });
1209
- case 83:
1210
- _context13.next = 97;
1209
+ case 22:
1210
+ _context11.next = 26;
1211
1211
  break;
1212
- case 85:
1212
+ case 23:
1213
1213
  if (!(subjectSource === "fabric" && subjectType === "ntp")) {
1214
- _context13.next = 97;
1214
+ _context11.next = 26;
1215
1215
  break;
1216
1216
  }
1217
1217
  _newMeta = {
@@ -1221,27 +1221,27 @@ var PermissionsClient = /*#__PURE__*/function () {
1221
1221
  type: "ntpInstance"
1222
1222
  };
1223
1223
  if (!offlineDraft) {
1224
- _context13.next = 91;
1224
+ _context11.next = 24;
1225
1225
  break;
1226
1226
  }
1227
1227
  this.drafts[policyId].meta["auth_policy_settings"]["ntp_instances"][subjectId] = _newMeta;
1228
- _context13.next = 97;
1228
+ _context11.next = 26;
1229
1229
  break;
1230
- case 91:
1231
- _context13.next = 93;
1230
+ case 24:
1231
+ _context11.next = 25;
1232
1232
  return this.client.ContentObjectMetadata({
1233
1233
  libraryId: policyLibraryId,
1234
1234
  objectId: policyId,
1235
1235
  writeToken: policyWriteToken,
1236
1236
  metadataSubtree: UrlJoin("auth_policy_settings", "ntp_instances", subjectId)
1237
1237
  });
1238
- case 93:
1239
- _userInfo = _context13.sent;
1238
+ case 25:
1239
+ _userInfo = _context11.sent;
1240
1240
  if (_userInfo) {
1241
- _context13.next = 97;
1241
+ _context11.next = 26;
1242
1242
  break;
1243
1243
  }
1244
- _context13.next = 97;
1244
+ _context11.next = 26;
1245
1245
  return this.client.ReplaceMetadata({
1246
1246
  libraryId: policyLibraryId,
1247
1247
  objectId: policyId,
@@ -1249,13 +1249,13 @@ var PermissionsClient = /*#__PURE__*/function () {
1249
1249
  metadataSubtree: UrlJoin("auth_policy_settings", "ntp_instances", subjectId),
1250
1250
  metadata: _newMeta
1251
1251
  });
1252
- case 97:
1252
+ case 26:
1253
1253
  case "end":
1254
- return _context13.stop();
1254
+ return _context11.stop();
1255
1255
  }
1256
- }, _callee13, this);
1256
+ }, _callee11, this);
1257
1257
  }));
1258
- function SetPermission(_x13) {
1258
+ function SetPermission(_x11) {
1259
1259
  return _SetPermission.apply(this, arguments);
1260
1260
  }
1261
1261
  return SetPermission;
@@ -1274,93 +1274,93 @@ var PermissionsClient = /*#__PURE__*/function () {
1274
1274
  }, {
1275
1275
  key: "RemovePermission",
1276
1276
  value: (function () {
1277
- var _RemovePermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref14) {
1277
+ var _RemovePermission = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref12) {
1278
1278
  var _this4 = this;
1279
- var policyId, policyWriteToken, itemId, subjectId, policyLibraryId, permissions, id;
1280
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
1281
- while (1) switch (_context15.prev = _context15.next) {
1279
+ var policyId, policyWriteToken, itemId, subjectId, policyLibraryId, permissions, id, _t63;
1280
+ return _regeneratorRuntime.wrap(function (_context13) {
1281
+ while (1) switch (_context13.prev = _context13.next) {
1282
1282
  case 0:
1283
- policyId = _ref14.policyId, policyWriteToken = _ref14.policyWriteToken, itemId = _ref14.itemId, subjectId = _ref14.subjectId;
1283
+ policyId = _ref12.policyId, policyWriteToken = _ref12.policyWriteToken, itemId = _ref12.itemId, subjectId = _ref12.subjectId;
1284
1284
  ValidatePresence("policyId", policyId);
1285
1285
  ValidatePresence("policyWriteToken", policyWriteToken);
1286
1286
  ValidatePresence("itemId", itemId);
1287
1287
  ValidatePresence("subjectId", subjectId);
1288
- _context15.next = 7;
1288
+ _context13.next = 1;
1289
1289
  return this.client.ContentObjectLibraryId({
1290
1290
  objectId: policyId
1291
1291
  });
1292
- case 7:
1293
- policyLibraryId = _context15.sent;
1294
- _context15.next = 10;
1292
+ case 1:
1293
+ policyLibraryId = _context13.sent;
1294
+ _context13.next = 2;
1295
1295
  return this.client.ContentObjectMetadata({
1296
1296
  libraryId: policyLibraryId,
1297
1297
  objectId: policyId,
1298
1298
  writeToken: policyWriteToken,
1299
1299
  metadataSubtree: UrlJoin("auth_policy_spec", itemId, "permissions")
1300
1300
  });
1301
- case 10:
1302
- permissions = _context15.sent;
1301
+ case 2:
1302
+ permissions = _context13.sent;
1303
1303
  if (permissions) {
1304
- _context15.next = 13;
1304
+ _context13.next = 3;
1305
1305
  break;
1306
1306
  }
1307
- return _context15.abrupt("return");
1308
- case 13:
1307
+ return _context13.abrupt("return");
1308
+ case 3:
1309
1309
  if (!subjectId.startsWith("0x")) {
1310
- _context15.next = 23;
1310
+ _context13.next = 6;
1311
1311
  break;
1312
1312
  }
1313
1313
  id = this.client.utils.AddressToObjectId(subjectId);
1314
- _context15.next = 17;
1314
+ _context13.next = 4;
1315
1315
  return this.client.AccessType({
1316
1316
  id: id
1317
1317
  });
1318
- case 17:
1319
- _context15.t0 = _context15.sent;
1320
- if (!(_context15.t0 === "group")) {
1321
- _context15.next = 22;
1318
+ case 4:
1319
+ _t63 = _context13.sent;
1320
+ if (!(_t63 === "group")) {
1321
+ _context13.next = 5;
1322
1322
  break;
1323
1323
  }
1324
1324
  subjectId = "igrp".concat(this.client.utils.AddressToHash(subjectId));
1325
- _context15.next = 23;
1325
+ _context13.next = 6;
1326
1326
  break;
1327
- case 22:
1327
+ case 5:
1328
1328
  subjectId = "iusr".concat(this.client.utils.AddressToHash(subjectId));
1329
- case 23:
1330
- _context15.next = 25;
1331
- return Promise.all(permissions.map( /*#__PURE__*/function () {
1332
- var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(permission, index) {
1333
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
1334
- while (1) switch (_context14.prev = _context14.next) {
1329
+ case 6:
1330
+ _context13.next = 7;
1331
+ return Promise.all(permissions.map(/*#__PURE__*/function () {
1332
+ var _ref13 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(permission, index) {
1333
+ return _regeneratorRuntime.wrap(function (_context12) {
1334
+ while (1) switch (_context12.prev = _context12.next) {
1335
1335
  case 0:
1336
1336
  if (!(permission.subject.id === subjectId || permission.subject.oauth_id === subjectId)) {
1337
- _context14.next = 3;
1337
+ _context12.next = 1;
1338
1338
  break;
1339
1339
  }
1340
- _context14.next = 3;
1340
+ _context12.next = 1;
1341
1341
  return _this4.client.DeleteMetadata({
1342
1342
  libraryId: policyLibraryId,
1343
1343
  objectId: policyId,
1344
1344
  writeToken: policyWriteToken,
1345
1345
  metadataSubtree: UrlJoin("auth_policy_spec", itemId, "permissions", index.toString())
1346
1346
  });
1347
- case 3:
1347
+ case 1:
1348
1348
  case "end":
1349
- return _context14.stop();
1349
+ return _context12.stop();
1350
1350
  }
1351
- }, _callee14);
1351
+ }, _callee12);
1352
1352
  }));
1353
- return function (_x15, _x16) {
1354
- return _ref15.apply(this, arguments);
1353
+ return function (_x13, _x14) {
1354
+ return _ref13.apply(this, arguments);
1355
1355
  };
1356
1356
  }()));
1357
- case 25:
1357
+ case 7:
1358
1358
  case "end":
1359
- return _context15.stop();
1359
+ return _context13.stop();
1360
1360
  }
1361
- }, _callee15, this);
1361
+ }, _callee13, this);
1362
1362
  }));
1363
- function RemovePermission(_x14) {
1363
+ function RemovePermission(_x12) {
1364
1364
  return _RemovePermission.apply(this, arguments);
1365
1365
  }
1366
1366
  return RemovePermission;
@@ -1380,108 +1380,108 @@ var PermissionsClient = /*#__PURE__*/function () {
1380
1380
  }, {
1381
1381
  key: "SubjectPermissions",
1382
1382
  value: (function () {
1383
- var _SubjectPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref16) {
1383
+ var _SubjectPermissions = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref14) {
1384
1384
  var _this5 = this;
1385
- var policyId, policyWriteToken, subjectId, id, policyLibraryId, policy, allSubjectPermissions, _i, _Object$keys, itemId, itemPermissions, subjectPermissions;
1386
- return _regeneratorRuntime.wrap(function _callee17$(_context17) {
1387
- while (1) switch (_context17.prev = _context17.next) {
1385
+ var policyId, policyWriteToken, subjectId, id, policyLibraryId, policy, allSubjectPermissions, _i, _Object$keys, itemId, itemPermissions, subjectPermissions, _t64;
1386
+ return _regeneratorRuntime.wrap(function (_context15) {
1387
+ while (1) switch (_context15.prev = _context15.next) {
1388
1388
  case 0:
1389
- policyId = _ref16.policyId, policyWriteToken = _ref16.policyWriteToken, subjectId = _ref16.subjectId;
1389
+ policyId = _ref14.policyId, policyWriteToken = _ref14.policyWriteToken, subjectId = _ref14.subjectId;
1390
1390
  ValidatePresence("policyId", policyId);
1391
1391
  ValidatePresence("subjectId", subjectId);
1392
1392
 
1393
1393
  // Convert address to appropriate ID
1394
1394
  if (!subjectId.startsWith("0x")) {
1395
- _context17.next = 13;
1395
+ _context15.next = 3;
1396
1396
  break;
1397
1397
  }
1398
1398
  id = this.client.utils.AddressToObjectId(subjectId);
1399
- _context17.next = 7;
1399
+ _context15.next = 1;
1400
1400
  return this.client.AccessType({
1401
1401
  id: id
1402
1402
  });
1403
- case 7:
1404
- _context17.t0 = _context17.sent;
1405
- if (!(_context17.t0 === "group")) {
1406
- _context17.next = 12;
1403
+ case 1:
1404
+ _t64 = _context15.sent;
1405
+ if (!(_t64 === "group")) {
1406
+ _context15.next = 2;
1407
1407
  break;
1408
1408
  }
1409
1409
  subjectId = "igrp".concat(this.client.utils.AddressToHash(subjectId));
1410
- _context17.next = 13;
1410
+ _context15.next = 3;
1411
1411
  break;
1412
- case 12:
1412
+ case 2:
1413
1413
  subjectId = "iusr".concat(this.client.utils.AddressToHash(subjectId));
1414
- case 13:
1415
- _context17.next = 15;
1414
+ case 3:
1415
+ _context15.next = 4;
1416
1416
  return this.client.ContentObjectLibraryId({
1417
1417
  objectId: policyId
1418
1418
  });
1419
- case 15:
1420
- policyLibraryId = _context17.sent;
1421
- _context17.next = 18;
1419
+ case 4:
1420
+ policyLibraryId = _context15.sent;
1421
+ _context15.next = 5;
1422
1422
  return this.client.ContentObjectMetadata({
1423
1423
  libraryId: policyLibraryId,
1424
1424
  objectId: policyId,
1425
1425
  writeToken: policyWriteToken,
1426
1426
  metadataSubtree: UrlJoin("auth_policy_spec")
1427
1427
  });
1428
- case 18:
1429
- policy = _context17.sent;
1428
+ case 5:
1429
+ policy = _context15.sent;
1430
1430
  allSubjectPermissions = {};
1431
1431
  _i = 0, _Object$keys = Object.keys(policy);
1432
- case 21:
1432
+ case 6:
1433
1433
  if (!(_i < _Object$keys.length)) {
1434
- _context17.next = 31;
1434
+ _context15.next = 9;
1435
1435
  break;
1436
1436
  }
1437
1437
  itemId = _Object$keys[_i];
1438
1438
  itemPermissions = policy[itemId].permissions || [];
1439
- _context17.next = 26;
1439
+ _context15.next = 7;
1440
1440
  return Promise.all(itemPermissions.filter(function (permission) {
1441
1441
  return (permission.subject || {}).oauth_id === subjectId || (permission.subject || {}).id === subjectId;
1442
- }).map( /*#__PURE__*/function () {
1443
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(permission) {
1444
- return _regeneratorRuntime.wrap(function _callee16$(_context16) {
1445
- while (1) switch (_context16.prev = _context16.next) {
1442
+ }).map(/*#__PURE__*/function () {
1443
+ var _ref15 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(permission) {
1444
+ return _regeneratorRuntime.wrap(function (_context14) {
1445
+ while (1) switch (_context14.prev = _context14.next) {
1446
1446
  case 0:
1447
- _context16.next = 2;
1447
+ _context14.next = 1;
1448
1448
  return _this5.FormatPermission({
1449
1449
  policyId: policyId,
1450
1450
  policyWriteToken: policyWriteToken,
1451
1451
  permission: permission
1452
1452
  });
1453
+ case 1:
1454
+ return _context14.abrupt("return", _context14.sent);
1453
1455
  case 2:
1454
- return _context16.abrupt("return", _context16.sent);
1455
- case 3:
1456
1456
  case "end":
1457
- return _context16.stop();
1457
+ return _context14.stop();
1458
1458
  }
1459
- }, _callee16);
1459
+ }, _callee14);
1460
1460
  }));
1461
- return function (_x18) {
1462
- return _ref17.apply(this, arguments);
1461
+ return function (_x16) {
1462
+ return _ref15.apply(this, arguments);
1463
1463
  };
1464
1464
  }()));
1465
- case 26:
1466
- subjectPermissions = _context17.sent;
1465
+ case 7:
1466
+ subjectPermissions = _context15.sent;
1467
1467
  if (subjectPermissions.length > 0) {
1468
1468
  allSubjectPermissions[itemId] = _objectSpread(_objectSpread({}, policy[itemId]), {}, {
1469
1469
  permissions: subjectPermissions
1470
1470
  });
1471
1471
  }
1472
- case 28:
1472
+ case 8:
1473
1473
  _i++;
1474
- _context17.next = 21;
1474
+ _context15.next = 6;
1475
1475
  break;
1476
- case 31:
1477
- return _context17.abrupt("return", allSubjectPermissions);
1478
- case 32:
1476
+ case 9:
1477
+ return _context15.abrupt("return", allSubjectPermissions);
1478
+ case 10:
1479
1479
  case "end":
1480
- return _context17.stop();
1480
+ return _context15.stop();
1481
1481
  }
1482
- }, _callee17, this);
1482
+ }, _callee15, this);
1483
1483
  }));
1484
- function SubjectPermissions(_x17) {
1484
+ function SubjectPermissions(_x15) {
1485
1485
  return _SubjectPermissions.apply(this, arguments);
1486
1486
  }
1487
1487
  return SubjectPermissions;
@@ -1499,54 +1499,54 @@ var PermissionsClient = /*#__PURE__*/function () {
1499
1499
  }, {
1500
1500
  key: "RemoveSubjectPermissions",
1501
1501
  value: (function () {
1502
- var _RemoveSubjectPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(_ref18) {
1502
+ var _RemoveSubjectPermissions = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee17(_ref16) {
1503
1503
  var _this6 = this;
1504
1504
  var policyId, policyWriteToken, subjectId, subjectPermissions;
1505
- return _regeneratorRuntime.wrap(function _callee19$(_context19) {
1506
- while (1) switch (_context19.prev = _context19.next) {
1505
+ return _regeneratorRuntime.wrap(function (_context17) {
1506
+ while (1) switch (_context17.prev = _context17.next) {
1507
1507
  case 0:
1508
- policyId = _ref18.policyId, policyWriteToken = _ref18.policyWriteToken, subjectId = _ref18.subjectId;
1508
+ policyId = _ref16.policyId, policyWriteToken = _ref16.policyWriteToken, subjectId = _ref16.subjectId;
1509
1509
  ValidatePresence("policyId", policyId);
1510
1510
  ValidatePresence("policyWriteToken", policyWriteToken);
1511
1511
  ValidatePresence("subjectId", subjectId);
1512
- _context19.next = 6;
1512
+ _context17.next = 1;
1513
1513
  return this.SubjectPermissions({
1514
1514
  policyId: policyId,
1515
1515
  policyWriteToken: policyWriteToken,
1516
1516
  subjectId: subjectId
1517
1517
  });
1518
- case 6:
1519
- subjectPermissions = _context19.sent;
1520
- _context19.next = 9;
1518
+ case 1:
1519
+ subjectPermissions = _context17.sent;
1520
+ _context17.next = 2;
1521
1521
  return this.client.utils.LimitedMap(5, Object.keys(subjectPermissions), /*#__PURE__*/function () {
1522
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(itemId) {
1523
- return _regeneratorRuntime.wrap(function _callee18$(_context18) {
1524
- while (1) switch (_context18.prev = _context18.next) {
1522
+ var _ref17 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(itemId) {
1523
+ return _regeneratorRuntime.wrap(function (_context16) {
1524
+ while (1) switch (_context16.prev = _context16.next) {
1525
1525
  case 0:
1526
- _context18.next = 2;
1526
+ _context16.next = 1;
1527
1527
  return _this6.RemovePermission({
1528
1528
  policyId: policyId,
1529
1529
  policyWriteToken: policyWriteToken,
1530
1530
  subjectId: subjectId,
1531
1531
  itemId: itemId
1532
1532
  });
1533
- case 2:
1533
+ case 1:
1534
1534
  case "end":
1535
- return _context18.stop();
1535
+ return _context16.stop();
1536
1536
  }
1537
- }, _callee18);
1537
+ }, _callee16);
1538
1538
  }));
1539
- return function (_x20) {
1540
- return _ref19.apply(this, arguments);
1539
+ return function (_x18) {
1540
+ return _ref17.apply(this, arguments);
1541
1541
  };
1542
1542
  }());
1543
- case 9:
1543
+ case 2:
1544
1544
  case "end":
1545
- return _context19.stop();
1545
+ return _context17.stop();
1546
1546
  }
1547
- }, _callee19, this);
1547
+ }, _callee17, this);
1548
1548
  }));
1549
- function RemoveSubjectPermissions(_x19) {
1549
+ function RemoveSubjectPermissions(_x17) {
1550
1550
  return _RemoveSubjectPermissions.apply(this, arguments);
1551
1551
  }
1552
1552
  return RemoveSubjectPermissions;