UNPKG

moeralib

Version:

Library to interact with Moera decentralized social network

667 lines (666 loc) 7.3 MB
// This file is generated "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.FundraiserInfo = exports.FriendOfInfoArray = exports.FriendOfInfo = exports.FriendInfoArray = exports.FriendInfo = exports.FriendGroupsFeatures = exports.FriendGroupInfoArray = exports.FriendGroupInfo = exports.FriendGroupDetails = exports.FeedWithStatus = exports.FeedStatus = exports.FeedReference = exports.EmailHint = exports.DomainInfoArray = exports.DomainInfo = exports.DomainAvailable = exports.DeleteNodeStatus = exports.CredentialsCreated = exports.ContactInfoArray = exports.ContactInfo = exports.CommentTotalInfo = exports.ClientReactionInfo = exports.CarteVerificationInfo = exports.CarteSet = exports.CarteInfo = exports.BlockedUsersChecksums = exports.BlockedPostingInstantInfo = exports.BlockedInstantInfoArray = exports.BlockedInstantInfo = exports.AvatarOrdinalArray = exports.AvatarOrdinal = exports.AvatarInfoArray = exports.AvatarInfo = exports.AvatarImage = exports.AsyncOperationCreated = exports.SubscriptionOperations = exports.SubscriberOperations = exports.StoryOperations = exports.SearchEntryOperations = exports.ReactionOperations = exports.ProfileOperations = exports.PrivateMediaFileOperations = exports.PostingOperations = exports.PeopleOperations = exports.NodeNameOperations = exports.FriendGroupOperations = exports.FriendOperations = exports.FeedOperations = exports.ContactOperations = exports.CommentOperations = void 0; exports.StorySummaryReaction = exports.StorySummaryPageClicks = exports.StorySummaryNode = exports.StorySummaryEntry = exports.StorySummaryFriendGroup = exports.StorySummaryBlocked = exports.SheriffOrdersSliceInfo = exports.SheriffOrderInfo = exports.SheriffComplaintInfoArray = exports.SheriffComplaintInfo = exports.SheriffComplaintGroupsSliceInfo = exports.SheriffComplaintGroupInfo = exports.SettingValueChoice = exports.SettingInfoArray = exports.SettingInfo = exports.SearchRepliedTo = exports.SearchNodePageInfo = exports.SearchNodeInfoArray = exports.SearchNodeInfo = exports.SearchHistoryInfoArray = exports.SearchHistoryInfo = exports.SheriffMark = exports.Result = exports.RepliedTo = exports.RemoteReactionVerificationInfo = exports.RemotePostingVerificationInfo = exports.RemoteMediaInfo = exports.RejectedReactions = exports.RegisteredNameSecret = exports.RecommendedPostingInfoArray = exports.RecommendedPostingInfo = exports.ReactionTotalsInfoArray = exports.ReactionTotalsInfo = exports.ReactionTotalInfo = exports.ReactionsSliceInfo = exports.ReactionInfoArray = exports.ReactionInfo = exports.PublicMediaFileInfo = exports.ProfileInfo = exports.PrivateMediaFileInfo = exports.PostingSourceInfo = exports.PostingFeatures = exports.PeopleGeneralInfo = exports.NodeNameInfo = exports.MediaFilePreviewInfo = exports.LinkPreviewInfo = exports.LinkPreview = exports.KeyMnemonic = exports.GrantInfoArray = exports.GrantInfo = void 0; exports.PushContentArray = exports.PushContent = exports.PluginInfoArray = exports.PluginInfo = exports.FeedSliceInfo = exports.CommentCreated = exports.StoryInfo = exports.SettingMetaInfoArray = exports.SettingMetaInfo = exports.EntryInfoArray = exports.EntryInfo = exports.DraftInfoArray = exports.DraftInfo = exports.CommentsSliceInfo = exports.CommentInfo = exports.StorySummaryData = exports.SettingTypeModifiers = exports.SearchTextPageInfo = exports.SearchHashtagSliceInfo = exports.SearchEntryInfo = exports.ReactionCreated = exports.PostingRevisionInfoArray = exports.PostingRevisionInfo = exports.PostingInfoArray = exports.PostingInfo = exports.MediaAttachment = exports.FeedInfoArray = exports.FeedInfo = exports.Features = exports.CommentRevisionInfoArray = exports.CommentRevisionInfo = exports.Body = exports.BlockedUserInfoArray = exports.BlockedUserInfo = exports.BlockedByUserInfoArray = exports.BlockedByUserInfo = exports.ActivityReactionInfoArray = exports.ActivityReactionInfo = exports.WhoAmI = exports.UserListSliceInfo = exports.UserListItemInfo = exports.UserListInfo = exports.UpdateInfo = exports.TokenInfoArray = exports.TokenInfo = exports.SubscriptionInfoArray = exports.SubscriptionInfo = exports.SubscriberInfoArray = exports.SubscriberInfo = exports.StorySummarySheriff = void 0; exports.NODE_API_VALIDATORS = void 0; exports.CommentOperations = validate11; const schema12 = { "type": "object", "properties": { "view": { "type": "string", "nullable": true }, "edit": { "type": "string", "nullable": true }, "delete": { "type": "string", "nullable": true }, "viewReactions": { "type": "string", "nullable": true }, "viewNegativeReactions": { "type": "string", "nullable": true }, "viewReactionTotals": { "type": "string", "nullable": true }, "viewNegativeReactionTotals": { "type": "string", "nullable": true }, "viewReactionRatios": { "type": "string", "nullable": true }, "viewNegativeReactionRatios": { "type": "string", "nullable": true }, "addReaction": { "type": "string", "nullable": true }, "addNegativeReaction": { "type": "string", "nullable": true }, "overrideReaction": { "type": "string", "nullable": true } }, "additionalProperties": false }; const func2 = Object.prototype.hasOwnProperty; function validate11(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (errors === 0) { if (data && typeof data == "object" && !Array.isArray(data)) { const _errs1 = errors; for (const key0 in data) { if (!(func2.call(schema12.properties, key0))) { delete data[key0]; } } if (_errs1 === errors) { if (data.view !== undefined) { let data0 = data.view; const _errs2 = errors; if ((typeof data0 !== "string") && (data0 !== null)) { let dataType0 = typeof data0; let coerced0 = undefined; if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) { data0 = data0[0]; dataType0 = typeof data0; if ((typeof data0 === "string") && (data0 === null)) { coerced0 = data0; } } if (!(coerced0 !== undefined)) { if (dataType0 == "number" || dataType0 == "boolean") { coerced0 = "" + data0; } else if (data0 === null) { coerced0 = ""; } else if (data0 === "" || data0 === 0 || data0 === false) { coerced0 = null; } else { validate11.errors = [{ instancePath: instancePath + "/view", schemaPath: "#/properties/view/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced0 !== undefined) { data0 = coerced0; if (data !== undefined) { data["view"] = coerced0; } } } var valid0 = _errs2 === errors; } else { var valid0 = true; } if (valid0) { if (data.edit !== undefined) { let data1 = data.edit; const _errs5 = errors; if ((typeof data1 !== "string") && (data1 !== null)) { let dataType1 = typeof data1; let coerced1 = undefined; if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) { data1 = data1[0]; dataType1 = typeof data1; if ((typeof data1 === "string") && (data1 === null)) { coerced1 = data1; } } if (!(coerced1 !== undefined)) { if (dataType1 == "number" || dataType1 == "boolean") { coerced1 = "" + data1; } else if (data1 === null) { coerced1 = ""; } else if (data1 === "" || data1 === 0 || data1 === false) { coerced1 = null; } else { validate11.errors = [{ instancePath: instancePath + "/edit", schemaPath: "#/properties/edit/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced1 !== undefined) { data1 = coerced1; if (data !== undefined) { data["edit"] = coerced1; } } } var valid0 = _errs5 === errors; } else { var valid0 = true; } if (valid0) { if (data.delete !== undefined) { let data2 = data.delete; const _errs8 = errors; if ((typeof data2 !== "string") && (data2 !== null)) { let dataType2 = typeof data2; let coerced2 = undefined; if (dataType2 == 'object' && Array.isArray(data2) && data2.length == 1) { data2 = data2[0]; dataType2 = typeof data2; if ((typeof data2 === "string") && (data2 === null)) { coerced2 = data2; } } if (!(coerced2 !== undefined)) { if (dataType2 == "number" || dataType2 == "boolean") { coerced2 = "" + data2; } else if (data2 === null) { coerced2 = ""; } else if (data2 === "" || data2 === 0 || data2 === false) { coerced2 = null; } else { validate11.errors = [{ instancePath: instancePath + "/delete", schemaPath: "#/properties/delete/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced2 !== undefined) { data2 = coerced2; if (data !== undefined) { data["delete"] = coerced2; } } } var valid0 = _errs8 === errors; } else { var valid0 = true; } if (valid0) { if (data.viewReactions !== undefined) { let data3 = data.viewReactions; const _errs11 = errors; if ((typeof data3 !== "string") && (data3 !== null)) { let dataType3 = typeof data3; let coerced3 = undefined; if (dataType3 == 'object' && Array.isArray(data3) && data3.length == 1) { data3 = data3[0]; dataType3 = typeof data3; if ((typeof data3 === "string") && (data3 === null)) { coerced3 = data3; } } if (!(coerced3 !== undefined)) { if (dataType3 == "number" || dataType3 == "boolean") { coerced3 = "" + data3; } else if (data3 === null) { coerced3 = ""; } else if (data3 === "" || data3 === 0 || data3 === false) { coerced3 = null; } else { validate11.errors = [{ instancePath: instancePath + "/viewReactions", schemaPath: "#/properties/viewReactions/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced3 !== undefined) { data3 = coerced3; if (data !== undefined) { data["viewReactions"] = coerced3; } } } var valid0 = _errs11 === errors; } else { var valid0 = true; } if (valid0) { if (data.viewNegativeReactions !== undefined) { let data4 = data.viewNegativeReactions; const _errs14 = errors; if ((typeof data4 !== "string") && (data4 !== null)) { let dataType4 = typeof data4; let coerced4 = undefined; if (dataType4 == 'object' && Array.isArray(data4) && data4.length == 1) { data4 = data4[0]; dataType4 = typeof data4; if ((typeof data4 === "string") && (data4 === null)) { coerced4 = data4; } } if (!(coerced4 !== undefined)) { if (dataType4 == "number" || dataType4 == "boolean") { coerced4 = "" + data4; } else if (data4 === null) { coerced4 = ""; } else if (data4 === "" || data4 === 0 || data4 === false) { coerced4 = null; } else { validate11.errors = [{ instancePath: instancePath + "/viewNegativeReactions", schemaPath: "#/properties/viewNegativeReactions/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced4 !== undefined) { data4 = coerced4; if (data !== undefined) { data["viewNegativeReactions"] = coerced4; } } } var valid0 = _errs14 === errors; } else { var valid0 = true; } if (valid0) { if (data.viewReactionTotals !== undefined) { let data5 = data.viewReactionTotals; const _errs17 = errors; if ((typeof data5 !== "string") && (data5 !== null)) { let dataType5 = typeof data5; let coerced5 = undefined; if (dataType5 == 'object' && Array.isArray(data5) && data5.length == 1) { data5 = data5[0]; dataType5 = typeof data5; if ((typeof data5 === "string") && (data5 === null)) { coerced5 = data5; } } if (!(coerced5 !== undefined)) { if (dataType5 == "number" || dataType5 == "boolean") { coerced5 = "" + data5; } else if (data5 === null) { coerced5 = ""; } else if (data5 === "" || data5 === 0 || data5 === false) { coerced5 = null; } else { validate11.errors = [{ instancePath: instancePath + "/viewReactionTotals", schemaPath: "#/properties/viewReactionTotals/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced5 !== undefined) { data5 = coerced5; if (data !== undefined) { data["viewReactionTotals"] = coerced5; } } } var valid0 = _errs17 === errors; } else { var valid0 = true; } if (valid0) { if (data.viewNegativeReactionTotals !== undefined) { let data6 = data.viewNegativeReactionTotals; const _errs20 = errors; if ((typeof data6 !== "string") && (data6 !== null)) { let dataType6 = typeof data6; let coerced6 = undefined; if (dataType6 == 'object' && Array.isArray(data6) && data6.length == 1) { data6 = data6[0]; dataType6 = typeof data6; if ((typeof data6 === "string") && (data6 === null)) { coerced6 = data6; } } if (!(coerced6 !== undefined)) { if (dataType6 == "number" || dataType6 == "boolean") { coerced6 = "" + data6; } else if (data6 === null) { coerced6 = ""; } else if (data6 === "" || data6 === 0 || data6 === false) { coerced6 = null; } else { validate11.errors = [{ instancePath: instancePath + "/viewNegativeReactionTotals", schemaPath: "#/properties/viewNegativeReactionTotals/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced6 !== undefined) { data6 = coerced6; if (data !== undefined) { data["viewNegativeReactionTotals"] = coerced6; } } } var valid0 = _errs20 === errors; } else { var valid0 = true; } if (valid0) { if (data.viewReactionRatios !== undefined) { let data7 = data.viewReactionRatios; const _errs23 = errors; if ((typeof data7 !== "string") && (data7 !== null)) { let dataType7 = typeof data7; let coerced7 = undefined; if (dataType7 == 'object' && Array.isArray(data7) && data7.length == 1) { data7 = data7[0]; dataType7 = typeof data7; if ((typeof data7 === "string") && (data7 === null)) { coerced7 = data7; } } if (!(coerced7 !== undefined)) { if (dataType7 == "number" || dataType7 == "boolean") { coerced7 = "" + data7; } else if (data7 === null) { coerced7 = ""; } else if (data7 === "" || data7 === 0 || data7 === false) { coerced7 = null; } else { validate11.errors = [{ instancePath: instancePath + "/viewReactionRatios", schemaPath: "#/properties/viewReactionRatios/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced7 !== undefined) { data7 = coerced7; if (data !== undefined) { data["viewReactionRatios"] = coerced7; } } } var valid0 = _errs23 === errors; } else { var valid0 = true; } if (valid0) { if (data.viewNegativeReactionRatios !== undefined) { let data8 = data.viewNegativeReactionRatios; const _errs26 = errors; if ((typeof data8 !== "string") && (data8 !== null)) { let dataType8 = typeof data8; let coerced8 = undefined; if (dataType8 == 'object' && Array.isArray(data8) && data8.length == 1) { data8 = data8[0]; dataType8 = typeof data8; if ((typeof data8 === "string") && (data8 === null)) { coerced8 = data8; } } if (!(coerced8 !== undefined)) { if (dataType8 == "number" || dataType8 == "boolean") { coerced8 = "" + data8; } else if (data8 === null) { coerced8 = ""; } else if (data8 === "" || data8 === 0 || data8 === false) { coerced8 = null; } else { validate11.errors = [{ instancePath: instancePath + "/viewNegativeReactionRatios", schemaPath: "#/properties/viewNegativeReactionRatios/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced8 !== undefined) { data8 = coerced8; if (data !== undefined) { data["viewNegativeReactionRatios"] = coerced8; } } } var valid0 = _errs26 === errors; } else { var valid0 = true; } if (valid0) { if (data.addReaction !== undefined) { let data9 = data.addReaction; const _errs29 = errors; if ((typeof data9 !== "string") && (data9 !== null)) { let dataType9 = typeof data9; let coerced9 = undefined; if (dataType9 == 'object' && Array.isArray(data9) && data9.length == 1) { data9 = data9[0]; dataType9 = typeof data9; if ((typeof data9 === "string") && (data9 === null)) { coerced9 = data9; } } if (!(coerced9 !== undefined)) { if (dataType9 == "number" || dataType9 == "boolean") { coerced9 = "" + data9; } else if (data9 === null) { coerced9 = ""; } else if (data9 === "" || data9 === 0 || data9 === false) { coerced9 = null; } else { validate11.errors = [{ instancePath: instancePath + "/addReaction", schemaPath: "#/properties/addReaction/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced9 !== undefined) { data9 = coerced9; if (data !== undefined) { data["addReaction"] = coerced9; } } } var valid0 = _errs29 === errors; } else { var valid0 = true; } if (valid0) { if (data.addNegativeReaction !== undefined) { let data10 = data.addNegativeReaction; const _errs32 = errors; if ((typeof data10 !== "string") && (data10 !== null)) { let dataType10 = typeof data10; let coerced10 = undefined; if (dataType10 == 'object' && Array.isArray(data10) && data10.length == 1) { data10 = data10[0]; dataType10 = typeof data10; if ((typeof data10 === "string") && (data10 === null)) { coerced10 = data10; } } if (!(coerced10 !== undefined)) { if (dataType10 == "number" || dataType10 == "boolean") { coerced10 = "" + data10; } else if (data10 === null) { coerced10 = ""; } else if (data10 === "" || data10 === 0 || data10 === false) { coerced10 = null; } else { validate11.errors = [{ instancePath: instancePath + "/addNegativeReaction", schemaPath: "#/properties/addNegativeReaction/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced10 !== undefined) { data10 = coerced10; if (data !== undefined) { data["addNegativeReaction"] = coerced10; } } } var valid0 = _errs32 === errors; } else { var valid0 = true; } if (valid0) { if (data.overrideReaction !== undefined) { let data11 = data.overrideReaction; const _errs35 = errors; if ((typeof data11 !== "string") && (data11 !== null)) { let dataType11 = typeof data11; let coerced11 = undefined; if (dataType11 == 'object' && Array.isArray(data11) && data11.length == 1) { data11 = data11[0]; dataType11 = typeof data11; if ((typeof data11 === "string") && (data11 === null)) { coerced11 = data11; } } if (!(coerced11 !== undefined)) { if (dataType11 == "number" || dataType11 == "boolean") { coerced11 = "" + data11; } else if (data11 === null) { coerced11 = ""; } else if (data11 === "" || data11 === 0 || data11 === false) { coerced11 = null; } else { validate11.errors = [{ instancePath: instancePath + "/overrideReaction", schemaPath: "#/properties/overrideReaction/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced11 !== undefined) { data11 = coerced11; if (data !== undefined) { data["overrideReaction"] = coerced11; } } } var valid0 = _errs35 === errors; } else { var valid0 = true; } } } } } } } } } } } } } } else { validate11.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; return false; } } validate11.errors = vErrors; return errors === 0; } exports.ContactOperations = validate12; const schema13 = { "type": "object", "properties": { "viewFeedSubscriber": { "type": "string", "nullable": true }, "viewFeedSubscription": { "type": "string", "nullable": true }, "viewFriend": { "type": "string", "nullable": true }, "viewFriendOf": { "type": "string", "nullable": true }, "viewBlock": { "type": "string", "nullable": true }, "viewBlockBy": { "type": "string", "nullable": true } }, "additionalProperties": false }; function validate12(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (errors === 0) { if (data && typeof data == "object" && !Array.isArray(data)) { const _errs1 = errors; for (const key0 in data) { if (!((((((key0 === "viewFeedSubscriber") || (key0 === "viewFeedSubscription")) || (key0 === "viewFriend")) || (key0 === "viewFriendOf")) || (key0 === "viewBlock")) || (key0 === "viewBlockBy"))) { delete data[key0]; } } if (_errs1 === errors) { if (data.viewFeedSubscriber !== undefined) { let data0 = data.viewFeedSubscriber; const _errs2 = errors; if ((typeof data0 !== "string") && (data0 !== null)) { let dataType0 = typeof data0; let coerced0 = undefined; if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) { data0 = data0[0]; dataType0 = typeof data0; if ((typeof data0 === "string") && (data0 === null)) { coerced0 = data0; } } if (!(coerced0 !== undefined)) { if (dataType0 == "number" || dataType0 == "boolean") { coerced0 = "" + data0; } else if (data0 === null) { coerced0 = ""; } else if (data0 === "" || data0 === 0 || data0 === false) { coerced0 = null; } else { validate12.errors = [{ instancePath: instancePath + "/viewFeedSubscriber", schemaPath: "#/properties/viewFeedSubscriber/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced0 !== undefined) { data0 = coerced0; if (data !== undefined) { data["viewFeedSubscriber"] = coerced0; } } } var valid0 = _errs2 === errors; } else { var valid0 = true; } if (valid0) { if (data.viewFeedSubscription !== undefined) { let data1 = data.viewFeedSubscription; const _errs5 = errors; if ((typeof data1 !== "string") && (data1 !== null)) { let dataType1 = typeof data1; let coerced1 = undefined; if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) { data1 = data1[0]; dataType1 = typeof data1; if ((typeof data1 === "string") && (data1 === null)) { coerced1 = data1; } } if (!(coerced1 !== undefined)) { if (dataType1 == "number" || dataType1 == "boolean") { coerced1 = "" + data1; } else if (data1 === null) { coerced1 = ""; } else if (data1 === "" || data1 === 0 || data1 === false) { coerced1 = null; } else { validate12.errors = [{ instancePath: instancePath + "/viewFeedSubscription", schemaPath: "#/properties/viewFeedSubscription/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced1 !== undefined) { data1 = coerced1; if (data !== undefined) { data["viewFeedSubscription"] = coerced1; } } } var valid0 = _errs5 === errors; } else { var valid0 = true; } if (valid0) { if (data.viewFriend !== undefined) { let data2 = data.viewFriend; const _errs8 = errors; if ((typeof data2 !== "string") && (data2 !== null)) { let dataType2 = typeof data2; let coerced2 = undefined; if (dataType2 == 'object' && Array.isArray(data2) && data2.length == 1) { data2 = data2[0]; dataType2 = typeof data2; if ((typeof data2 === "string") && (data2 === null)) { coerced2 = data2; } } if (!(coerced2 !== undefined)) { if (dataType2 == "number" || dataType2 == "boolean") { coerced2 = "" + data2; } else if (data2 === null) { coerced2 = ""; } else if (data2 === "" || data2 === 0 || data2 === false) { coerced2 = null; } else { validate12.errors = [{ instancePath: instancePath + "/viewFriend", schemaPath: "#/properties/viewFriend/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } } if (coerced2 !== undefined) { data2 = coerced2; if (data !== undefined) { data["viewFriend"] = coerced2; } } } var valid0 = _errs8 === errors;