@eluvio/elv-client-js 4.0.105 → 4.0.107
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 +1 -1
- package/dist/ElvClient-node-min.js +7 -7
- package/dist/ElvWalletClient-min.js +1 -1
- package/dist/ElvWalletClient-node-min.js +1 -1
- package/dist/src/UserProfileClient.js +160 -132
- package/dist/src/client/Contracts.js +431 -106
- package/dist/src/client/LiveConf.js +1 -1
- package/dist/src/client/LiveStream.js +229 -136
- package/package.json +1 -1
- package/src/UserProfileClient.js +19 -20
- package/src/client/Contracts.js +244 -42
- package/src/client/LiveConf.js +1 -1
- package/src/client/LiveStream.js +122 -44
- package/testScripts/TestAddTenantContractId.js +45 -4
|
@@ -805,7 +805,7 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
805
805
|
return SetAccessLevel;
|
|
806
806
|
}()
|
|
807
807
|
/**
|
|
808
|
-
* Return the ID of the tenant
|
|
808
|
+
* Return the ID of the tenant admin group set for current user
|
|
809
809
|
*
|
|
810
810
|
* @return {Promise<string>} - Tenant ID
|
|
811
811
|
*/
|
|
@@ -814,22 +814,28 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
814
814
|
key: "TenantId",
|
|
815
815
|
value: (function () {
|
|
816
816
|
var _TenantId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
|
|
817
|
+
var _yield$this$UserWalle6, objectId;
|
|
817
818
|
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
818
819
|
while (1) switch (_context12.prev = _context12.next) {
|
|
819
820
|
case 0:
|
|
820
821
|
if (this.tenantId) {
|
|
821
|
-
_context12.next =
|
|
822
|
+
_context12.next = 8;
|
|
822
823
|
break;
|
|
823
824
|
}
|
|
824
825
|
_context12.next = 3;
|
|
825
|
-
return this.
|
|
826
|
-
metadataSubtree: "tenantId"
|
|
827
|
-
});
|
|
826
|
+
return this.UserWalletObjectInfo();
|
|
828
827
|
case 3:
|
|
828
|
+
_yield$this$UserWalle6 = _context12.sent;
|
|
829
|
+
objectId = _yield$this$UserWalle6.objectId;
|
|
830
|
+
_context12.next = 7;
|
|
831
|
+
return this.client.TenantId({
|
|
832
|
+
objectId: objectId
|
|
833
|
+
});
|
|
834
|
+
case 7:
|
|
829
835
|
this.tenantId = _context12.sent;
|
|
830
|
-
case
|
|
836
|
+
case 8:
|
|
831
837
|
return _context12.abrupt("return", this.tenantId);
|
|
832
|
-
case
|
|
838
|
+
case 9:
|
|
833
839
|
case "end":
|
|
834
840
|
return _context12.stop();
|
|
835
841
|
}
|
|
@@ -841,7 +847,7 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
841
847
|
return TenantId;
|
|
842
848
|
}()
|
|
843
849
|
/**
|
|
844
|
-
* Set the current user's tenant
|
|
850
|
+
* Set the current user's tenant admin group ID
|
|
845
851
|
*
|
|
846
852
|
* Note: This method is not accessible to applications. Eluvio core will drop the request.
|
|
847
853
|
*
|
|
@@ -854,7 +860,7 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
854
860
|
key: "SetTenantId",
|
|
855
861
|
value: (function () {
|
|
856
862
|
var _SetTenantId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(_ref10) {
|
|
857
|
-
var id, address,
|
|
863
|
+
var id, address, _yield$this$UserWalle7, objectId, tenantInfo;
|
|
858
864
|
return _regeneratorRuntime.wrap(function _callee13$(_context13) {
|
|
859
865
|
while (1) switch (_context13.prev = _context13.next) {
|
|
860
866
|
case 0:
|
|
@@ -877,38 +883,25 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
877
883
|
case 6:
|
|
878
884
|
id = "iten".concat(Utils.AddressToHash(address));
|
|
879
885
|
case 7:
|
|
880
|
-
_context13.
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
886
|
+
_context13.next = 9;
|
|
887
|
+
return this.UserWalletObjectInfo();
|
|
888
|
+
case 9:
|
|
889
|
+
_yield$this$UserWalle7 = _context13.sent;
|
|
890
|
+
objectId = _yield$this$UserWalle7.objectId;
|
|
891
|
+
_context13.next = 13;
|
|
892
|
+
return this.client.SetTenantId({
|
|
893
|
+
objectId: objectId,
|
|
894
|
+
tenantId: id
|
|
884
895
|
});
|
|
885
|
-
case 10:
|
|
886
|
-
version = _context13.sent;
|
|
887
|
-
if (!(version !== this.client.authClient.ACCESS_TYPES.GROUP)) {
|
|
888
|
-
_context13.next = 13;
|
|
889
|
-
break;
|
|
890
|
-
}
|
|
891
|
-
throw Error("Invalid tenant ID: " + id);
|
|
892
896
|
case 13:
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
_context13.t0 = _context13["catch"](7);
|
|
898
|
-
throw Error("Invalid tenant ID: " + id);
|
|
899
|
-
case 18:
|
|
900
|
-
_context13.next = 20;
|
|
901
|
-
return this.ReplaceUserMetadata({
|
|
902
|
-
metadataSubtree: "tenantId",
|
|
903
|
-
metadata: id
|
|
904
|
-
});
|
|
905
|
-
case 20:
|
|
906
|
-
this.tenantId = id;
|
|
907
|
-
case 21:
|
|
897
|
+
tenantInfo = _context13.sent;
|
|
898
|
+
this.tenantContractId = tenantInfo.tenantContractId;
|
|
899
|
+
this.tenantId = tenantInfo.tenantId;
|
|
900
|
+
case 16:
|
|
908
901
|
case "end":
|
|
909
902
|
return _context13.stop();
|
|
910
903
|
}
|
|
911
|
-
}, _callee13, this
|
|
904
|
+
}, _callee13, this);
|
|
912
905
|
}));
|
|
913
906
|
function SetTenantId(_x7) {
|
|
914
907
|
return _SetTenantId.apply(this, arguments);
|
|
@@ -925,7 +918,7 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
925
918
|
key: "TenantContractId",
|
|
926
919
|
value: (function () {
|
|
927
920
|
var _TenantContractId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14() {
|
|
928
|
-
var _yield$this$
|
|
921
|
+
var _yield$this$UserWalle8, objectId;
|
|
929
922
|
return _regeneratorRuntime.wrap(function _callee14$(_context14) {
|
|
930
923
|
while (1) switch (_context14.prev = _context14.next) {
|
|
931
924
|
case 0:
|
|
@@ -936,11 +929,11 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
936
929
|
_context14.next = 3;
|
|
937
930
|
return this.UserWalletObjectInfo();
|
|
938
931
|
case 3:
|
|
939
|
-
_yield$this$
|
|
940
|
-
objectId = _yield$this$
|
|
932
|
+
_yield$this$UserWalle8 = _context14.sent;
|
|
933
|
+
objectId = _yield$this$UserWalle8.objectId;
|
|
941
934
|
_context14.next = 7;
|
|
942
935
|
return this.client.TenantContractId({
|
|
943
|
-
|
|
936
|
+
objectId: objectId
|
|
944
937
|
});
|
|
945
938
|
case 7:
|
|
946
939
|
this.tenantContractId = _context14.sent;
|
|
@@ -971,7 +964,7 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
971
964
|
key: "SetTenantContractId",
|
|
972
965
|
value: (function () {
|
|
973
966
|
var _SetTenantContractId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(_ref11) {
|
|
974
|
-
var tenantContractId, _yield$this$
|
|
967
|
+
var tenantContractId, _yield$this$UserWalle9, objectId, tenantInfo;
|
|
975
968
|
return _regeneratorRuntime.wrap(function _callee15$(_context15) {
|
|
976
969
|
while (1) switch (_context15.prev = _context15.next) {
|
|
977
970
|
case 0:
|
|
@@ -979,8 +972,8 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
979
972
|
_context15.next = 3;
|
|
980
973
|
return this.UserWalletObjectInfo();
|
|
981
974
|
case 3:
|
|
982
|
-
_yield$this$
|
|
983
|
-
objectId = _yield$this$
|
|
975
|
+
_yield$this$UserWalle9 = _context15.sent;
|
|
976
|
+
objectId = _yield$this$UserWalle9.objectId;
|
|
984
977
|
_context15.next = 7;
|
|
985
978
|
return this.client.SetTenantContractId({
|
|
986
979
|
objectId: objectId,
|
|
@@ -989,7 +982,8 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
989
982
|
case 7:
|
|
990
983
|
tenantInfo = _context15.sent;
|
|
991
984
|
this.tenantContractId = tenantInfo.tenantContractId;
|
|
992
|
-
|
|
985
|
+
this.tenantId = tenantInfo.tenantId;
|
|
986
|
+
case 10:
|
|
993
987
|
case "end":
|
|
994
988
|
return _context15.stop();
|
|
995
989
|
}
|
|
@@ -999,6 +993,41 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
999
993
|
return _SetTenantContractId.apply(this, arguments);
|
|
1000
994
|
}
|
|
1001
995
|
return SetTenantContractId;
|
|
996
|
+
}())
|
|
997
|
+
}, {
|
|
998
|
+
key: "ResetTenantId",
|
|
999
|
+
value: function () {
|
|
1000
|
+
var _ResetTenantId = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16() {
|
|
1001
|
+
var _yield$this$UserWalle10, objectId;
|
|
1002
|
+
return _regeneratorRuntime.wrap(function _callee16$(_context16) {
|
|
1003
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1004
|
+
case 0:
|
|
1005
|
+
_context16.next = 2;
|
|
1006
|
+
return this.UserWalletObjectInfo();
|
|
1007
|
+
case 2:
|
|
1008
|
+
_yield$this$UserWalle10 = _context16.sent;
|
|
1009
|
+
objectId = _yield$this$UserWalle10.objectId;
|
|
1010
|
+
_context16.next = 6;
|
|
1011
|
+
return this.client.ResetTenantId({
|
|
1012
|
+
objectId: objectId
|
|
1013
|
+
});
|
|
1014
|
+
case 6:
|
|
1015
|
+
this.tenantId = this.client.TenantId({
|
|
1016
|
+
objectId: objectId
|
|
1017
|
+
});
|
|
1018
|
+
this.tenantContractId = this.client.TenantContractId({
|
|
1019
|
+
objectId: objectId
|
|
1020
|
+
});
|
|
1021
|
+
case 8:
|
|
1022
|
+
case "end":
|
|
1023
|
+
return _context16.stop();
|
|
1024
|
+
}
|
|
1025
|
+
}, _callee16, this);
|
|
1026
|
+
}));
|
|
1027
|
+
function ResetTenantId() {
|
|
1028
|
+
return _ResetTenantId.apply(this, arguments);
|
|
1029
|
+
}
|
|
1030
|
+
return ResetTenantId;
|
|
1002
1031
|
}()
|
|
1003
1032
|
/**
|
|
1004
1033
|
* Get the URL of the current user's profile image
|
|
@@ -1014,54 +1043,53 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1014
1043
|
*
|
|
1015
1044
|
* @return {Promise<string | undefined>} - URL of the user's profile image. Will be undefined if no profile image is set.
|
|
1016
1045
|
*/
|
|
1017
|
-
)
|
|
1018
1046
|
}, {
|
|
1019
1047
|
key: "UserProfileImage",
|
|
1020
1048
|
value: (function () {
|
|
1021
|
-
var _UserProfileImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1049
|
+
var _UserProfileImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
|
|
1022
1050
|
var _ref12,
|
|
1023
1051
|
address,
|
|
1024
1052
|
height,
|
|
1025
1053
|
walletAddress,
|
|
1026
|
-
_yield$this$
|
|
1054
|
+
_yield$this$UserWalle11,
|
|
1027
1055
|
libraryId,
|
|
1028
1056
|
objectId,
|
|
1029
|
-
|
|
1030
|
-
return _regeneratorRuntime.wrap(function
|
|
1031
|
-
while (1) switch (
|
|
1057
|
+
_args17 = arguments;
|
|
1058
|
+
return _regeneratorRuntime.wrap(function _callee17$(_context17) {
|
|
1059
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1032
1060
|
case 0:
|
|
1033
|
-
_ref12 =
|
|
1061
|
+
_ref12 = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : {}, address = _ref12.address, height = _ref12.height;
|
|
1034
1062
|
if (!address) {
|
|
1035
|
-
|
|
1063
|
+
_context17.next = 7;
|
|
1036
1064
|
break;
|
|
1037
1065
|
}
|
|
1038
|
-
|
|
1066
|
+
_context17.next = 4;
|
|
1039
1067
|
return this.UserWalletAddress({
|
|
1040
1068
|
address: address
|
|
1041
1069
|
});
|
|
1042
1070
|
case 4:
|
|
1043
|
-
walletAddress =
|
|
1044
|
-
|
|
1071
|
+
walletAddress = _context17.sent;
|
|
1072
|
+
_context17.next = 9;
|
|
1045
1073
|
break;
|
|
1046
1074
|
case 7:
|
|
1047
1075
|
address = this.client.signer.address;
|
|
1048
1076
|
walletAddress = this.walletAddress;
|
|
1049
1077
|
case 9:
|
|
1050
1078
|
if (walletAddress) {
|
|
1051
|
-
|
|
1079
|
+
_context17.next = 11;
|
|
1052
1080
|
break;
|
|
1053
1081
|
}
|
|
1054
|
-
return
|
|
1082
|
+
return _context17.abrupt("return");
|
|
1055
1083
|
case 11:
|
|
1056
|
-
|
|
1084
|
+
_context17.next = 13;
|
|
1057
1085
|
return this.UserWalletObjectInfo({
|
|
1058
1086
|
address: address
|
|
1059
1087
|
});
|
|
1060
1088
|
case 13:
|
|
1061
|
-
_yield$this$
|
|
1062
|
-
libraryId = _yield$this$
|
|
1063
|
-
objectId = _yield$this$
|
|
1064
|
-
return
|
|
1089
|
+
_yield$this$UserWalle11 = _context17.sent;
|
|
1090
|
+
libraryId = _yield$this$UserWalle11.libraryId;
|
|
1091
|
+
objectId = _yield$this$UserWalle11.objectId;
|
|
1092
|
+
return _context17.abrupt("return", this.client.ContentObjectImageUrl({
|
|
1065
1093
|
libraryId: libraryId,
|
|
1066
1094
|
objectId: objectId,
|
|
1067
1095
|
height: height,
|
|
@@ -1069,9 +1097,9 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1069
1097
|
}));
|
|
1070
1098
|
case 17:
|
|
1071
1099
|
case "end":
|
|
1072
|
-
return
|
|
1100
|
+
return _context17.stop();
|
|
1073
1101
|
}
|
|
1074
|
-
},
|
|
1102
|
+
}, _callee17, this);
|
|
1075
1103
|
}));
|
|
1076
1104
|
function UserProfileImage() {
|
|
1077
1105
|
return _UserProfileImage.apply(this, arguments);
|
|
@@ -1088,34 +1116,34 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1088
1116
|
}, {
|
|
1089
1117
|
key: "SetUserProfileImage",
|
|
1090
1118
|
value: (function () {
|
|
1091
|
-
var _SetUserProfileImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1092
|
-
var image, size, _yield$this$
|
|
1093
|
-
return _regeneratorRuntime.wrap(function
|
|
1094
|
-
while (1) switch (
|
|
1119
|
+
var _SetUserProfileImage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(_ref13) {
|
|
1120
|
+
var image, size, _yield$this$UserWalle12, libraryId, objectId, editRequest;
|
|
1121
|
+
return _regeneratorRuntime.wrap(function _callee18$(_context18) {
|
|
1122
|
+
while (1) switch (_context18.prev = _context18.next) {
|
|
1095
1123
|
case 0:
|
|
1096
1124
|
image = _ref13.image;
|
|
1097
1125
|
this.Log("Setting profile image for user ".concat(this.client.signer.address));
|
|
1098
1126
|
size = image.length || image.byteLength || image.size;
|
|
1099
1127
|
if (!(size > 5000000)) {
|
|
1100
|
-
|
|
1128
|
+
_context18.next = 5;
|
|
1101
1129
|
break;
|
|
1102
1130
|
}
|
|
1103
1131
|
throw Error("Maximum profile image size is 5MB");
|
|
1104
1132
|
case 5:
|
|
1105
|
-
|
|
1133
|
+
_context18.next = 7;
|
|
1106
1134
|
return this.UserWalletObjectInfo();
|
|
1107
1135
|
case 7:
|
|
1108
|
-
_yield$this$
|
|
1109
|
-
libraryId = _yield$this$
|
|
1110
|
-
objectId = _yield$this$
|
|
1111
|
-
|
|
1136
|
+
_yield$this$UserWalle12 = _context18.sent;
|
|
1137
|
+
libraryId = _yield$this$UserWalle12.libraryId;
|
|
1138
|
+
objectId = _yield$this$UserWalle12.objectId;
|
|
1139
|
+
_context18.next = 12;
|
|
1112
1140
|
return this.client.EditContentObject({
|
|
1113
1141
|
libraryId: libraryId,
|
|
1114
1142
|
objectId: objectId
|
|
1115
1143
|
});
|
|
1116
1144
|
case 12:
|
|
1117
|
-
editRequest =
|
|
1118
|
-
|
|
1145
|
+
editRequest = _context18.sent;
|
|
1146
|
+
_context18.next = 15;
|
|
1119
1147
|
return this.client.SetContentObjectImage({
|
|
1120
1148
|
libraryId: libraryId,
|
|
1121
1149
|
objectId: objectId,
|
|
@@ -1125,7 +1153,7 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1125
1153
|
imagePath: "public/profile_image"
|
|
1126
1154
|
});
|
|
1127
1155
|
case 15:
|
|
1128
|
-
|
|
1156
|
+
_context18.next = 17;
|
|
1129
1157
|
return this.client.FinalizeContentObject({
|
|
1130
1158
|
libraryId: libraryId,
|
|
1131
1159
|
objectId: objectId,
|
|
@@ -1134,9 +1162,9 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1134
1162
|
});
|
|
1135
1163
|
case 17:
|
|
1136
1164
|
case "end":
|
|
1137
|
-
return
|
|
1165
|
+
return _context18.stop();
|
|
1138
1166
|
}
|
|
1139
|
-
},
|
|
1167
|
+
}, _callee18, this);
|
|
1140
1168
|
}));
|
|
1141
1169
|
function SetUserProfileImage(_x9) {
|
|
1142
1170
|
return _SetUserProfileImage.apply(this, arguments);
|
|
@@ -1156,28 +1184,28 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1156
1184
|
}, {
|
|
1157
1185
|
key: "CollectedTags",
|
|
1158
1186
|
value: (function () {
|
|
1159
|
-
var _CollectedTags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1160
|
-
return _regeneratorRuntime.wrap(function
|
|
1161
|
-
while (1) switch (
|
|
1187
|
+
var _CollectedTags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19() {
|
|
1188
|
+
return _regeneratorRuntime.wrap(function _callee19$(_context19) {
|
|
1189
|
+
while (1) switch (_context19.prev = _context19.next) {
|
|
1162
1190
|
case 0:
|
|
1163
|
-
|
|
1191
|
+
_context19.next = 2;
|
|
1164
1192
|
return this.UserMetadata({
|
|
1165
1193
|
metadataSubtree: "collected_data"
|
|
1166
1194
|
});
|
|
1167
1195
|
case 2:
|
|
1168
|
-
|
|
1169
|
-
if (
|
|
1170
|
-
|
|
1196
|
+
_context19.t0 = _context19.sent;
|
|
1197
|
+
if (_context19.t0) {
|
|
1198
|
+
_context19.next = 5;
|
|
1171
1199
|
break;
|
|
1172
1200
|
}
|
|
1173
|
-
|
|
1201
|
+
_context19.t0 = {};
|
|
1174
1202
|
case 5:
|
|
1175
|
-
return
|
|
1203
|
+
return _context19.abrupt("return", _context19.t0);
|
|
1176
1204
|
case 6:
|
|
1177
1205
|
case "end":
|
|
1178
|
-
return
|
|
1206
|
+
return _context19.stop();
|
|
1179
1207
|
}
|
|
1180
|
-
},
|
|
1208
|
+
}, _callee19, this);
|
|
1181
1209
|
}));
|
|
1182
1210
|
function CollectedTags() {
|
|
1183
1211
|
return _CollectedTags.apply(this, arguments);
|
|
@@ -1188,32 +1216,32 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1188
1216
|
}, {
|
|
1189
1217
|
key: "RecordTags",
|
|
1190
1218
|
value: function () {
|
|
1191
|
-
var _RecordTags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1219
|
+
var _RecordTags = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20(_ref14) {
|
|
1192
1220
|
var libraryId, objectId, versionHash;
|
|
1193
|
-
return _regeneratorRuntime.wrap(function
|
|
1194
|
-
while (1) switch (
|
|
1221
|
+
return _regeneratorRuntime.wrap(function _callee20$(_context20) {
|
|
1222
|
+
while (1) switch (_context20.prev = _context20.next) {
|
|
1195
1223
|
case 0:
|
|
1196
1224
|
libraryId = _ref14.libraryId, objectId = _ref14.objectId, versionHash = _ref14.versionHash;
|
|
1197
|
-
|
|
1198
|
-
|
|
1225
|
+
_context20.prev = 1;
|
|
1226
|
+
_context20.next = 4;
|
|
1199
1227
|
return this.__RecordTags({
|
|
1200
1228
|
libraryId: libraryId,
|
|
1201
1229
|
objectId: objectId,
|
|
1202
1230
|
versionHash: versionHash
|
|
1203
1231
|
});
|
|
1204
1232
|
case 4:
|
|
1205
|
-
|
|
1233
|
+
_context20.next = 9;
|
|
1206
1234
|
break;
|
|
1207
1235
|
case 6:
|
|
1208
|
-
|
|
1209
|
-
|
|
1236
|
+
_context20.prev = 6;
|
|
1237
|
+
_context20.t0 = _context20["catch"](1);
|
|
1210
1238
|
// eslint-disable-next-line no-console
|
|
1211
|
-
console.error(
|
|
1239
|
+
console.error(_context20.t0);
|
|
1212
1240
|
case 9:
|
|
1213
1241
|
case "end":
|
|
1214
|
-
return
|
|
1242
|
+
return _context20.stop();
|
|
1215
1243
|
}
|
|
1216
|
-
},
|
|
1244
|
+
}, _callee20, this, [[1, 6]]);
|
|
1217
1245
|
}));
|
|
1218
1246
|
function RecordTags(_x10) {
|
|
1219
1247
|
return _RecordTags.apply(this, arguments);
|
|
@@ -1223,73 +1251,73 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1223
1251
|
}, {
|
|
1224
1252
|
key: "__RecordTags",
|
|
1225
1253
|
value: function () {
|
|
1226
|
-
var _RecordTags2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
1254
|
+
var _RecordTags2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21(_ref15) {
|
|
1227
1255
|
var libraryId, objectId, versionHash, accessType, seen, walletObjectInfo, userLibraryId, userObjectId, editRequest, contentTags, userTags, formattedTags;
|
|
1228
|
-
return _regeneratorRuntime.wrap(function
|
|
1229
|
-
while (1) switch (
|
|
1256
|
+
return _regeneratorRuntime.wrap(function _callee21$(_context21) {
|
|
1257
|
+
while (1) switch (_context21.prev = _context21.next) {
|
|
1230
1258
|
case 0:
|
|
1231
1259
|
libraryId = _ref15.libraryId, objectId = _ref15.objectId, versionHash = _ref15.versionHash;
|
|
1232
|
-
|
|
1260
|
+
_context21.next = 3;
|
|
1233
1261
|
return this.client.AccessType({
|
|
1234
1262
|
id: objectId
|
|
1235
1263
|
});
|
|
1236
1264
|
case 3:
|
|
1237
|
-
accessType =
|
|
1265
|
+
accessType = _context21.sent;
|
|
1238
1266
|
if (!(accessType !== "object")) {
|
|
1239
|
-
|
|
1267
|
+
_context21.next = 6;
|
|
1240
1268
|
break;
|
|
1241
1269
|
}
|
|
1242
|
-
return
|
|
1270
|
+
return _context21.abrupt("return");
|
|
1243
1271
|
case 6:
|
|
1244
1272
|
if (!(!versionHash && !libraryId)) {
|
|
1245
|
-
|
|
1273
|
+
_context21.next = 10;
|
|
1246
1274
|
break;
|
|
1247
1275
|
}
|
|
1248
|
-
|
|
1276
|
+
_context21.next = 9;
|
|
1249
1277
|
return this.client.ContentObjectLibraryId({
|
|
1250
1278
|
objectId: objectId
|
|
1251
1279
|
});
|
|
1252
1280
|
case 9:
|
|
1253
|
-
libraryId =
|
|
1281
|
+
libraryId = _context21.sent;
|
|
1254
1282
|
case 10:
|
|
1255
1283
|
if (versionHash) {
|
|
1256
|
-
|
|
1284
|
+
_context21.next = 14;
|
|
1257
1285
|
break;
|
|
1258
1286
|
}
|
|
1259
|
-
|
|
1287
|
+
_context21.next = 13;
|
|
1260
1288
|
return this.client.ContentObject({
|
|
1261
1289
|
libraryId: libraryId,
|
|
1262
1290
|
objectId: objectId
|
|
1263
1291
|
});
|
|
1264
1292
|
case 13:
|
|
1265
|
-
versionHash =
|
|
1293
|
+
versionHash = _context21.sent.hash;
|
|
1266
1294
|
case 14:
|
|
1267
|
-
|
|
1295
|
+
_context21.next = 16;
|
|
1268
1296
|
return this.UserMetadata({
|
|
1269
1297
|
metadataSubtree: UrlJoin("accessed_content", versionHash)
|
|
1270
1298
|
});
|
|
1271
1299
|
case 16:
|
|
1272
|
-
seen =
|
|
1300
|
+
seen = _context21.sent;
|
|
1273
1301
|
if (!seen) {
|
|
1274
|
-
|
|
1302
|
+
_context21.next = 19;
|
|
1275
1303
|
break;
|
|
1276
1304
|
}
|
|
1277
|
-
return
|
|
1305
|
+
return _context21.abrupt("return");
|
|
1278
1306
|
case 19:
|
|
1279
|
-
|
|
1307
|
+
_context21.next = 21;
|
|
1280
1308
|
return this.UserWalletObjectInfo();
|
|
1281
1309
|
case 21:
|
|
1282
|
-
walletObjectInfo =
|
|
1310
|
+
walletObjectInfo = _context21.sent;
|
|
1283
1311
|
userLibraryId = walletObjectInfo.libraryId;
|
|
1284
1312
|
userObjectId = walletObjectInfo.objectId; // Mark content as seen
|
|
1285
|
-
|
|
1313
|
+
_context21.next = 26;
|
|
1286
1314
|
return this.client.EditContentObject({
|
|
1287
1315
|
libraryId: userLibraryId,
|
|
1288
1316
|
objectId: userObjectId
|
|
1289
1317
|
});
|
|
1290
1318
|
case 26:
|
|
1291
|
-
editRequest =
|
|
1292
|
-
|
|
1319
|
+
editRequest = _context21.sent;
|
|
1320
|
+
_context21.next = 29;
|
|
1293
1321
|
return this.client.ReplaceMetadata({
|
|
1294
1322
|
libraryId: userLibraryId,
|
|
1295
1323
|
objectId: userObjectId,
|
|
@@ -1298,7 +1326,7 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1298
1326
|
metadata: Date.now()
|
|
1299
1327
|
});
|
|
1300
1328
|
case 29:
|
|
1301
|
-
|
|
1329
|
+
_context21.next = 31;
|
|
1302
1330
|
return this.client.ContentObjectMetadata({
|
|
1303
1331
|
libraryId: libraryId,
|
|
1304
1332
|
objectId: objectId,
|
|
@@ -1306,15 +1334,15 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1306
1334
|
metadataSubtree: "video_tags"
|
|
1307
1335
|
});
|
|
1308
1336
|
case 31:
|
|
1309
|
-
contentTags =
|
|
1337
|
+
contentTags = _context21.sent;
|
|
1310
1338
|
if (!(contentTags && contentTags.length > 0)) {
|
|
1311
|
-
|
|
1339
|
+
_context21.next = 40;
|
|
1312
1340
|
break;
|
|
1313
1341
|
}
|
|
1314
|
-
|
|
1342
|
+
_context21.next = 35;
|
|
1315
1343
|
return this.CollectedTags();
|
|
1316
1344
|
case 35:
|
|
1317
|
-
userTags =
|
|
1345
|
+
userTags = _context21.sent;
|
|
1318
1346
|
formattedTags = this.__FormatVideoTags(contentTags);
|
|
1319
1347
|
Object.keys(formattedTags).forEach(function (tag) {
|
|
1320
1348
|
if (userTags[tag]) {
|
|
@@ -1331,7 +1359,7 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1331
1359
|
});
|
|
1332
1360
|
|
|
1333
1361
|
// Update user tags
|
|
1334
|
-
|
|
1362
|
+
_context21.next = 40;
|
|
1335
1363
|
return this.client.ReplaceMetadata({
|
|
1336
1364
|
libraryId: userLibraryId,
|
|
1337
1365
|
objectId: userObjectId,
|
|
@@ -1340,7 +1368,7 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1340
1368
|
metadata: userTags
|
|
1341
1369
|
});
|
|
1342
1370
|
case 40:
|
|
1343
|
-
|
|
1371
|
+
_context21.next = 42;
|
|
1344
1372
|
return this.client.FinalizeContentObject({
|
|
1345
1373
|
libraryId: userLibraryId,
|
|
1346
1374
|
objectId: userObjectId,
|
|
@@ -1350,9 +1378,9 @@ var UserProfileClient = /*#__PURE__*/function () {
|
|
|
1350
1378
|
});
|
|
1351
1379
|
case 42:
|
|
1352
1380
|
case "end":
|
|
1353
|
-
return
|
|
1381
|
+
return _context21.stop();
|
|
1354
1382
|
}
|
|
1355
|
-
},
|
|
1383
|
+
}, _callee21, this);
|
|
1356
1384
|
}));
|
|
1357
1385
|
function __RecordTags(_x11) {
|
|
1358
1386
|
return _RecordTags2.apply(this, arguments);
|