UNPKG

omnipartners

Version:
1,290 lines (1,289 loc) 49.7 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const querystring_1 = __importDefault(require("querystring")); const Api_1 = __importDefault(require("../../lib/Api")); const apiDecorators_1 = require("../../lib/apiDecorators"); class Identity extends Api_1.default { constructor() { super(...arguments); this.errorMap = { 9: { message: "Pet not found" }, 19: { message: "Partner not found." }, }; } deleteUser(data) { return this.get("/service/account/delete", data, { hashKeys: ["user_guid"], }); } updateRecoveredPassword(data) { return this.get("/service/account/create-password", data, { hashKeys: ["password"], }); } checkPasswordTokenValidity(data) { return this.get("/service/account/check-password-token-validity", data); } getAccessToken(data) { return this.get("/service/access-tokens/get-token", data); } deleteAccessToken(data) { return this.get("/service/access-tokens/delete-token", data); } findAccountByPhone(data) { return this.get("/service/user/resolve-by-mobile-number", data, { hashKeys: ["mobile_no"], retry: true, }); } findAccountByEmail(data) { return this.get("/service/user/resolve-by-email", data, { hashKeys: ["email"], retry: true, }); } findAccountByPublicToken(data) { return this.get("/service/user/resolve-by-public-token", data, { retry: true, }); } findAccountByPartnerExtId(data) { return this.get("/service/user/resolve-by-partner", data, { hashKeys: ["partner_ext_id"], retry: true, }); } recoverPassword(data) { return this.get("/service/account/recover-password", data, { errorMap: { 27: { message: "Password could not be auto generated because of validation constraints.", }, 48: { message: "The email could not be sent because the email address has been marked as invalid by the email bounce management system.", }, }, hashKeys: ["uid"], }); } recoverPasswordSMS(data) { return this.get("/service/account/recover-password-sms", data, { hashKeys: ["mobile"], }); } register(data) { return this.get("/service/user/register", data, { errorMap: { 8: { message: "Error saving data to the database." }, 9: { message: "Pet information required but not specified." }, 18: { message: "Email address already exists in the system." }, 23: { message: "Duplicate request." }, }, hashKeys: [ data.user_email ? "user_email" : "user_mobile_phone", "user_password", ], }); } forceActivate(data) { return this.get("/service/account/force-activate", data, { errorMap: { 1: { message: "Internal error." }, 6: { message: "Not authorized to use this function or its disabled." }, 19: { message: "There is no confirmed partner relationship." }, 34: { message: "Account already active." }, }, hashKeys: ["user_guid"], }); } confirmUserAccount(data) { return this.get("/service/account/confirm", data, { errorMap: { 1: { message: "Internal error." }, 4: { message: "User is not active in the system" }, 6: { message: "Not authorized to use this function or its disabled." }, 24: { message: "Account already confirmed." }, }, hashKeys: ["identifier"], }); } update(data, options) { return this.get("/service/user/update", data, { hashKeys: ["user_email", "user_guid"], ...(options && options.locale && { headers: { "X-LANGUAGE": options.locale, }, }), }); } getUserList(data) { return this.get("/service/profile/get-user-lis", data, { retry: true }); } retrieveUserSubscriptions(data) { return this.get("/service/preferences/get", data, { errorMap: { 6: { message: "Not authorised to use this function or it's disabled." }, 8: { message: "Error saving data to the database." }, }, hashKeys: ["user_guid"], }); } updateSubscriptions(data) { return this.get("/service/preferences/update", data, { errorMap: { 8: { message: "Error saving data to the database." }, 36: { message: "User in blacklist." }, }, hashKeys: ["user_guid"], }); } retrieveUserPlacesOfPurchase(data) { return this.get("service/preferences/get-places-of-purchase", data, { errorMap: { 6: { message: "Either key is invalid or the method is restricted for the key", }, }, hashKeys: ["user_guid"], }); } updateUserPlacesOfPurchase(data) { return this.get("/service/preferences/add-place-of-purchase", data, { errorMap: { 6: { message: "Either key is invalid or the method is restricted for the key", }, }, hashKeys: ["user_guid", "place_id", "place_rating"], }); } deleteUserPlacesOfPurchase(data) { return this.get("/service/preferences/delete-place-of-purchase", data, { hashKeys: ["user_guid", "place_id"], }); } listUserAddress(data) { return this.post("/service/user-address/list", data, { hashNoKey: true, retry: true, }); } registerUserAddress(data) { return this.post("/service/user-address/add", data, { hashKeys: ["user_guid"], }); } updateUserAddress(data) { return this.post("/service/user-address/update", data, { errorMap: { 22: { message: 'Update restricted, if it is the only address and trying to update it as "not default".', }, 26: { message: "Address not found in the system." }, }, hashKeys: ["user_guid"], }); } deleteUserAddress(data) { return this.post("/service/user-address/delete", data, { errorMap: { 22: { message: "Delete restricted if address is the default address." }, 26: { message: "Address not found in the system." }, }, hashKeys: ["user_guid"], }); } confirmLegalForm(data) { return this.post("/service/legal-form/confirm-legal-form", data, { errorMap: { // Special case here: // { statusCode: false, // errors: // { legal_form_code: // { invalidLegalFormCode: 'Invalid legal form code \'foo\' specified' } } [-1]: { message: "An error is occured.", }, 3: { message: "Specified user not found." }, 8: { message: "Error saving data to the database." }, 39: { message: "Error in File upload." }, 40: { message: "Legal form is already confirmed." }, 41: { message: "Invalid File." }, }, }); } getConfirmedLegalForm(data) { return this.post("/service/legal-form/get-confirmed-legal-forms", data); } revokeLegalForm(data) { return this.post("/service/legal-form/revoke-legal-form", data, { errorMap: { 26: { message: "Legal code not found." }, }, }); } /* Authenticate */ async authenticate(data, options) { const result = await this.get("/service/auth/credentials", data, { hashKeys: ["identifier", "password"], hashNoKey: true, retry: true, ...(options && options.locale && { headers: { "X-LANGUAGE": options.locale, }, }), }); return result; } authenticateByGUID(data) { return this.get("/service/auth/user-guid", { ...data, data_options: Array.isArray(data.data_options) ? data.data_options.join(",") : data.data_options, }, { retry: true, }); } authenticateBySessionToken(data) { return this.get("/service/auth/session-token", data, { retry: true }); } authenticateByAccessToken({ data_options, ...data }) { return this.get("/service/auth/access-token", { ...data, data_options: data_options && Array.isArray(data_options) ? data_options.join(",") : data_options, }, { retry: true }); } authenticateByEmail(data) { return this.get("/service/auth/email", data, { hashKeys: ["email"], retry: true, }); } authenticateByExternalId({ data_options, partner_data_options, pet_data_options, ...data }) { return this.get("/service/auth/user-ext-id", { ...data, data_options: data_options ? Array.isArray(data_options) ? data_options.join(",") : data_options : undefined, partner_data_options: partner_data_options ? Array.isArray(data_options) ? data_options.join(",") : data_options : undefined, pet_data_options: pet_data_options ? Array.isArray(data_options) ? data_options.join(",") : data_options : undefined, }, { retry: true, }); } createAuthCode(data) { return this.post("/service/auth/get-auth-code", data, { retry: true, errorMap: { 1: { message: "Failed to generate the auth code. This error usually appears when system fails to generate a unique identifier because it has already generated too many and filled up the most of the possibilities.", }, 6: { message: "Not authorized to use this function or its disabled." }, 11: { message: "Too many consecutive requests for the the same account. Requests are allowed once in every 2 minutes per account.", }, 26: { message: "User Mobile number not available in user profile." }, 50: { message: "SMS Template not available." }, }, }); } async authenticateByCode(data) { return this.get("/service/auth/code", { ...data, data_options: Array.isArray(data.data_options) ? data.data_options.join(",") : data.data_options, }, { retry: true, errorMap: { 7: { message: "Auth Code not found in the system." }, 49: { message: "User not confirmed." }, }, }); } /* Manage partners */ getPartnerAccountRelations(data) { return this.post("/service/user/get-partners/", { ...data, partner_groups: Array.isArray(data.partner_groups) ? data.partner_groups.join(",") : data.partner_groups, data_options: Array.isArray(data.data_options) ? data.data_options.join(",") : data.data_options, }, { errorMap: { 4: { message: "User not active in the system." }, 6: { message: "Not authorized to use this function or its disabled.", }, }, retry: true, }); } createPartnerAccountRelation(data) { return this.post("/service/partners/add/", data, { errorMap: { 19: { message: "Partner not found." }, }, hashKeys: [ "user_guid", "partner_ext_id", "partner_relationship", "partner_status", ], }); } updatePartnerAccountRelation(data) { return this.post("/service/partners/update/", data, { errorMap: { 19: { message: "Partner not found." }, }, hashKeys: [ "user_guid", "partner_ext_id", "partner_relationship", "partner_status", ], }); } deletePartnerAccountRelation(data) { return this.post("/service/partners/delete/", data, { errorMap: { 19: { message: "Partner not found." }, }, hashKeys: ["user_guid", "partner_ext_id", "partner_relationship"], }); } getUserPartnerAccountRelations(data) { return this.get("/service/partners/get-users/", { ...data, data_options: data.data_options && Array.isArray(data.data_options) ? data.data_options.join(",") : data.data_options, }, { hashKeys: undefined, }); } /* Manage pets */ getPets(data, options) { return this.get("/service/pets/get", { ...data, data_options: Array.isArray(data.data_options) ? data.data_options.join(",") : data.data_options, }, { hashNoKey: true, hashKeys: ["user_guid"], retry: true, ...(options && options.locale && { headers: { "X-LANGUAGE": options.locale, }, }), }); } getPet(data) { return this.get("/service/pets/get-pet", { ...data, data_options: Array.isArray(data.data_options) ? data.data_options.join(",") : data.data_options, }, { errorMap: { 9: { message: "Pet not found in the system." }, }, hashNoKey: true, hashKeys: ["pet_guid"], retry: true, }); } getPetByExternalId(data) { return this.get("/service/pets/get-pet-by-external-id", { ...data, data_options: Array.isArray(data.data_options) ? data.data_options.join(",") : data.data_options, }, { errorMap: { 9: { message: "Pet not found in the system." }, 21: { message: "Pet not active in the system." }, }, hashNoKey: true, hashKeys: ["pet_ext_id"], retry: true, }); } createPet(data) { return this.post("/service/pets/add", data, { multipart: true, errorMap: { 35: { message: "Pet limit reached for this account." }, }, hashKeys: ["pet_name", "user_guid"], }); } deletePet(data) { return this.post("/service/pets/delete", data, { hashKeys: ["pet_guid"], }); } getPetDeletionCauses(data) { return this.post("service/data/get-animal-deletion-causes", data, { hashKeys: undefined, }); } updatePet(data) { return this.post("/service/pets/update", data, { multipart: true, errorMap: { 9: { message: "Pet not found in the system." }, }, hashKeys: ["pet_name", "pet_guid"], }); } getPetPictureUrl(data) { const { qs, uri } = this.signForGet("/service/pets/get-picture", data, { hashKeys: ["w", "h"], }); return `${uri}?${querystring_1.default.stringify(qs)}`; } updatePetPicture(data) { return this.post("/service/pets/update-picture", data, { multipart: true, hashKeys: ["pet_guid"], errorMap: { 9: { message: "Pet not found in the system." }, 10: { message: "File upload error." }, }, }); } updatePetPlaceOfPurchase(data) { return this.post("/service/pet-purchase-place/add-place/", data, { hashKeys: undefined, }); } retrievePetPlaceOfPurchase(data) { return this.post("service/pet-purchase-place/get-places/", data, { hashKeys: undefined, }); } deletePetPlaceOfPurchase(data) { return this.post("/service/pet-purchase-place/delete-place/", data, { hashKeys: undefined, }); } addPetWeight(data) { return this.post("/service/pets/add-weight/", data, { hashKeys: ["pet_guid", "date", "weight", "source"], }); } getPetWeight(data) { return this.post("/service/pets/get-weight/", data, { hashKeys: ["pet_guid"], }); } deletePetWeight(data) { return this.post("/service/pets/del-weight/", data, { hashKeys: ["pet_guid", "date"], }); } addPetBmi(data) { return this.post("/service/pets/add-bmi/", data, { hashKeys: ["pet_guid", "date", "bmi", "source"], }); } getPetBmi(data) { return this.post("/service/pets/get-bmi/", data, { hashKeys: ["pet_guid"], }); } deletePetBmi(data) { return this.post("/service/pets/del-bmi/", data, { hashKeys: ["pet_guid", "date"], }); } addPetDietRecommendation(data) { return this.post("/service/pets/add-diet-recommendation", data, { hashKeys: undefined, }); } getPetDietRecommendation(data) { return this.post("/service/pets/get-diet-recommendations", data, { hashKeys: undefined, }); } deletePetDietRecommendation(data) { return this.post("/service/pets/delete-diet-recommendations", data, { hashKeys: undefined, }); } addPetTags(data) { return this.post("/service/pet-tags/add-tag", data, { hashKeys: ["pet_guid"], }); } deletePetTags(data) { return this.post("/service/pet-tags/delete-tag", data, { hashKeys: ["pet_guid"], }); } /* Manage children */ createChild(data, options) { return this.post("/service/children/add", data, { hashKeys: undefined, ...(options && options.locale && { headers: { "X-LANGUAGE": options.locale, }, }), }); } getChildren(data) { return this.post("/service/children/get", data, { hashKeys: undefined, }); } updateChild(data, options) { return this.post("/service/children/update", data, { hashKeys: undefined, ...(options && options.locale && { headers: { "X-LANGUAGE": options.locale, }, }), }); } /* Manage segments */ getUserSegments(data) { return this.post("/service/segments/get-user-segments", data, { hashNoKey: undefined, }); } flushUserSegmentCache(data) { return this.post("/service/user/flush-segment-cache", data, { hashNoKey: undefined, }); } /* Manage favourites */ addUserFavourites(data) { return this.get("/service/user/add-favorite/", data, { hashKeys: ["user_guid", "source", "date", "type"], }); } getUserFavourites(data) { return this.get("service/user/get-favorite/", data, { hashKeys: ["user_guid"], }); } deleteUserFavourites(data) { return this.get("/service/user/del-favorite/", data, { hashKeys: ["user_guid", "content_id"], }); } getFormatPassword(data = {}) { return this.get("/service/account/get-password-format", data, {}); } /* Manage tags */ getUserTags(data) { return this.post("/service/user-tags/get-tags", data, { hashKeys: ["user_guid"], }); } addUserTags(data) { return this.post("/service/user-tags/add-tag", data, { hashKeys: ["user_guid"], }); } deleteUserTags(data) { return this.post("/service/user-tags/delete-tag", data, { hashKeys: ["user_guid"], }); } /* Manage User Socials Network */ getUserSocialNetwork(data) { return this.post("/service/social-network/list", data, { hashKeys: undefined, }); } addUserSocialNetwork(data) { return this.post("/service/social-network/add", data, { hashKeys: undefined, }); } updateUserSocialNetwork(data) { return this.post("/service/social-network/update", data, { hashKeys: undefined, }); } deleteUserSocialNetwork(data) { return this.post("/service/social-network/delete", data, { hashKeys: undefined, }); } } __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Delete_User_Accounts"), (0, apiDecorators_1.filterInput)(["user_guid", "user_context"]) ], Identity.prototype, "deleteUser", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Update_Password"), (0, apiDecorators_1.filterInput)(["token", "password"]) ], Identity.prototype, "updateRecoveredPassword", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Check_Password_Token_Validity"), (0, apiDecorators_1.filterInput)(["token"]) ], Identity.prototype, "checkPasswordTokenValidity", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Create_Access_Token"), (0, apiDecorators_1.filterInput)(["session_token", "ttl"]) ], Identity.prototype, "getAccessToken", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Delete_Access_Token"), (0, apiDecorators_1.filterInput)(["token"]) ], Identity.prototype, "deleteAccessToken", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Find_account_GUID_by_mobile_phone_(strict)"), (0, apiDecorators_1.filterInput)(["mobile_no", "include_loyalty_cards"]) ], Identity.prototype, "findAccountByPhone", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Find_account_GUID_by_email_(strict)"), (0, apiDecorators_1.filterInput)(["email", "include_user_type", "user_context"]) ], Identity.prototype, "findAccountByEmail", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Find_account_GUID_by_public_token"), (0, apiDecorators_1.filterInput)(["token"]) ], Identity.prototype, "findAccountByPublicToken", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Find_account_GUID_by_partner_ext_id"), (0, apiDecorators_1.filterInput)(["partner_ext_id"]) ], Identity.prototype, "findAccountByPartnerExtId", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Recover_by_email_or_user_id"), (0, apiDecorators_1.filterInput)(["uid", "mode", "url", "user_context"]) ], Identity.prototype, "recoverPassword", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php/Recover_by_mobile_phone"), (0, apiDecorators_1.filterInput)(["mobile", "message"]) ], Identity.prototype, "recoverPasswordSMS", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php/Create_User_Accounts") ], Identity.prototype, "register", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Force_Activate_User_Account"), (0, apiDecorators_1.filterInput)(["user_guid"]) ], Identity.prototype, "forceActivate", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Confirm_User_Accounts"), (0, apiDecorators_1.filterInput)(["identifier"]) ], Identity.prototype, "confirmUserAccount", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Edit_User_Accounts") ], Identity.prototype, "update", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_Users_List"), (0, apiDecorators_1.filterInput)([ "first_name", "last_name", "email", "postcode", "mobile", "partner_ext_id", "partner_relationship", "page", "records_per_page", ]) ], Identity.prototype, "getUserList", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_user_preferences"), (0, apiDecorators_1.filterInput)(["user_guid"]) ], Identity.prototype, "retrieveUserSubscriptions", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Update_user_preferences"), (0, apiDecorators_1.filterInput)([ "user_guid", "com_prefs", "interests", "subscriptions", "replace", ]) ], Identity.prototype, "updateSubscriptions", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_places_of_purchase_preferences_of_a_user_account"), (0, apiDecorators_1.filterInput)(["user_guid"]) ], Identity.prototype, "retrieveUserPlacesOfPurchase", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Add_a_place_of_purchase_preference_to_the_user_account"), (0, apiDecorators_1.filterInput)(["user_guid", "place_id", "place_rating"]) ], Identity.prototype, "updateUserPlacesOfPurchase", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Delete_a_place_of_purchase_preference_from_a_user_account"), (0, apiDecorators_1.filterInput)(["user_guid", "place_id"]) ], Identity.prototype, "deleteUserPlacesOfPurchase", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/List_User_Addresses"), (0, apiDecorators_1.filterInput)(["user_guid"]) ], Identity.prototype, "listUserAddress", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Add_User_Address"), (0, apiDecorators_1.filterInput)([ "user_guid", "address_type", "address_name", "address_company", "address_phone", "address_streetnum", "address_street1", "address_street2", "address_postal_code", "address_city", "address_region", "address_county", "address_country", "address_comment", "address_is_default", "address_lat", "address_lng", ]) ], Identity.prototype, "registerUserAddress", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Update_User_Address"), (0, apiDecorators_1.filterInput)([ "user_guid", "address_id", "address_type", "address_name", "address_company", "address_phone", "address_streetnum", "address_street1", "address_street2", "address_postal_code", "address_city", "address_region", "address_county", "address_country", "address_comment", "address_is_default", "address_lat", "address_lng", ]) ], Identity.prototype, "updateUserAddress", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Delete_User_Address"), (0, apiDecorators_1.filterInput)(["user_guid", "address_id"]) ], Identity.prototype, "deleteUserAddress", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Confirm_Legal_Form"), (0, apiDecorators_1.filterInput)([ "legal_form_code", "user_guid", "confirmed_place", "send_notification", "signature", ]) ], Identity.prototype, "confirmLegalForm", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Get_Confirmed_Legal_Forms"), (0, apiDecorators_1.filterInput)(["user_guid"]) ], Identity.prototype, "getConfirmedLegalForm", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Revoke_Legal_Form"), (0, apiDecorators_1.filterInput)(["legal_form_code", "user_guid", "send_notification"]) ], Identity.prototype, "revokeLegalForm", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php/Retrieve_Profile_Using_User_Credentials"), (0, apiDecorators_1.filterInput)([ "identifier", "password", "data_options", "pet_data_options", "pet_partner_type", "partner_data_options", "related_partners_filter_relation", "related_partners_filter_types", "related_partners_filter_groups", "related_partners_filter_roles", "user_context", ]) ], Identity.prototype, "authenticate", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_Profile_Using_User_GUID_ONLY"), (0, apiDecorators_1.filterInput)(["user_guid", "data_options"]) ], Identity.prototype, "authenticateByGUID", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_Profile_Using_Session_Tokens"), (0, apiDecorators_1.filterInput)(["session_token", "data_options"]) ], Identity.prototype, "authenticateBySessionToken", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_Profile_Using_Access_Tokens"), (0, apiDecorators_1.filterInput)([ "access_token", "data_options", "partner_data_options", "pet_data_options", "pet_partner_type", "related_partners_filter_relation", "related_partners_filter_types", "related_partners_filter_groups", "related_partners_filter_roles", "user_context", ]) ], Identity.prototype, "authenticateByAccessToken", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_Profile_Using_Email_ONLY_Service"), (0, apiDecorators_1.filterInput)(["email", "data_options"]) ], Identity.prototype, "authenticateByEmail", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Retrieve_Profile_Using_User_External_Id_ONLY"), (0, apiDecorators_1.filterInput)([ "user_ext_id", "data_options", "pet_data_options", "partner_data_options", "pet_partner_type", "related_partners_filter_xxxx", // (Optional) A set of filters that could be used to filter partner relationships. For more information please refer Partner Relationship Filter. ]) ], Identity.prototype, "authenticateByExternalId", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Create_Auth_Code"), (0, apiDecorators_1.filterInput)(["type", "value", "ttl"]) ], Identity.prototype, "createAuthCode", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_Profile_Using_Auth_Code"), (0, apiDecorators_1.filterInput)(["auth_code"]) ], Identity.prototype, "authenticateByCode", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Get_partners_-_account_relations"), (0, apiDecorators_1.filterInput)([ "user_guid", "partner_relationship", "partner_relationship_role", "partner_groups", "show_not_accepted", "data_options", "page", "records_per_page", // (Optional) The number of records per page. Minimum value is 1 and maximum is 100. ]) ], Identity.prototype, "getPartnerAccountRelations", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php/Add_new_partner_-_account_relation"), (0, apiDecorators_1.filterInput)([ "user_guid", "partner_ext_id", "partner_relationship", "partner_roles", "is_primary_contact", "notify", "partner_status", // (Deprecated) The status of the relationship between the partner and user. Valid status values are submitted, accepted, pending and refused. ]) ], Identity.prototype, "createPartnerAccountRelation", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Update_partner_-_account_relation_status"), (0, apiDecorators_1.filterInput)([ "user_guid", "partner_ext_id", "partner_relationship", "partner_roles", "partner_status", "notify", // Flag used to determine if the preset notification email has to be sent to the user. If the value is "1" then the email is sent. ]) ], Identity.prototype, "updatePartnerAccountRelation", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Delete_a_partner_-_account_relation"), (0, apiDecorators_1.filterInput)([ "user_guid", "partner_ext_id", "partner_relationship", // (Required) The relationship between the partner and the account. Valid values are “clientof” and “partof”. ]) ], Identity.prototype, "deletePartnerAccountRelation", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Get_users_of_partner_-_account_relations"), (0, apiDecorators_1.filterInput)([ "partner_ext_id", "partner_relationship", "show_not_accepted", "active_users_only", "role", "customer_group", "group_results_by_status", "page", "records_per_page", "data_options", // (Optional) This defines information that is returned in the result. At the moment only owner_details option is valid. For more information please refer Data Options. ]) ], Identity.prototype, "getUserPartnerAccountRelations", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_pet_information"), (0, apiDecorators_1.filterInput)(["user_guid", "data_options"]) ], Identity.prototype, "getPets", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Get_information_by_pet_guid"), (0, apiDecorators_1.filterInput)(["pet_guid", "data_options"]) ], Identity.prototype, "getPet", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Get_information_by_pet_ext_id"), (0, apiDecorators_1.filterInput)(["pet_ext_id", "data_options"]) ], Identity.prototype, "getPetByExternalId", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Add_new_pet"), (0, apiDecorators_1.filterInput)([ "user_guid", "pet_name", "pet_type", "pet_breed", "pet_breed_com_id", "pet_pedigreename", "pet_dob", "pet_dob_approx", "pet_neutered", "pet_neutering_date", "pet_gender", "vaccination_date", "pet_insured", "pet_medical_condition", "pet_lifestyle", "pet_brand", "pet_declarative_product", "tattoo_number", "chip_number", "pet_picture", "kc_number", "pet_ext_id", // (Optional) The external id of the pet. This should be a unique value. ]) ], Identity.prototype, "createPet", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Delete_existing_pet"), (0, apiDecorators_1.filterInput)([ "pet_guid", "pet_deletion_cause", // (Optional) Code of pet deletion cause. Please refer Animal deletion causes list for valid values. ]) ], Identity.prototype, "deletePet", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Animal_deletion_causes_list"), (0, apiDecorators_1.filterInput)([ "lang", // (Optional) The language in which the list of animal types must be retrieved. Please refer Language list for valid values. ]) ], Identity.prototype, "getPetDeletionCauses", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Update_pet_information"), (0, apiDecorators_1.filterInput)([ "pet_guid", "pet_name", "pet_type", "pet_breed", "pet_pedigreename", "pet_breed_com_id", "pet_dob", "pet_dob_approx", "pet_gender", "pet_neutered", "pet_neutering_date", "vaccination_date", "pet_insured", "pet_medical_condition", "pet_lifestyle", "pet_brand", "pet_declarative_product", "tattoo_number", "chip_number", "kc_number", "pet_picture", "pet_ext_id", "pet_special_needs", ]) ], Identity.prototype, "updatePet", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_pet_picture") ], Identity.prototype, "getPetPictureUrl", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Update_pet_picture"), (0, apiDecorators_1.filterInput)(["pet_guid", "pet_picture"]) ], Identity.prototype, "updatePetPicture", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Add_a_place_of_purchase_preference_to_the_pet_account"), (0, apiDecorators_1.filterInput)([ "pet_guid", "place_id", "place_rating", "replace_existing_preferences", // (Optional) If this is set to yes/1, then the preferences of the pet are replaced by this single new entry. Applicable values are 'yes' or '1' / 'no' or '0'. Default value for this is 'yes'. ]) ], Identity.prototype, "updatePetPlaceOfPurchase", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_places_of_purchase_preferences_of_a_pet_account"), (0, apiDecorators_1.filterInput)([ "pet_guid", // (Required) The GUID of the pet. ]) ], Identity.prototype, "retrievePetPlaceOfPurchase", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Delete_a_place_of_purchase_preference_from_a_pet_account"), (0, apiDecorators_1.filterInput)([ "pet_guid", "place_id", "place_rating", "replace_existing_preferences", // (Optional) If this is set to yes/1, then the preferences of the pet are replaced by this single new entry. Applicable values are 'yes' or '1' / 'no' or '0'. Default value for this is 'yes'. ]) ], Identity.prototype, "deletePetPlaceOfPurchase", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Add_weight_entry"), (0, apiDecorators_1.filterInput)([ "pet_guid", "date", "weight", "partner_ext_id", "source", "ideal_weight", // (Optional)Ideal Weight of the pet (in grams). ]) ], Identity.prototype, "addPetWeight", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_weight_Series"), (0, apiDecorators_1.filterInput)([ "pet_guid", "partner_ext_id", // (Optional)Ext ID of the partner who adds the entry. ]) ], Identity.prototype, "getPetWeight", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Delete_weight_entry"), (0, apiDecorators_1.filterInput)([ "pet_guid", "date", "partner_ext_id", // (Optional)Ext ID of the partner who adds the entry. ]) ], Identity.prototype, "deletePetWeight", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Add_body_mass_index_entry"), (0, apiDecorators_1.filterInput)([ "pet_guid", "date", "bmi", "partner_ext_id", "source", // (Required)It’s a text value and specifies the source of the request. ]) ], Identity.prototype, "addPetBmi", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_body_mass_index_Series"), (0, apiDecorators_1.filterInput)([ "pet_guid", "partner_ext_id", // (Optional)Ext ID of the partner who adds the entry. ]) ], Identity.prototype, "getPetBmi", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Delete_body_mass_index_entry"), (0, apiDecorators_1.filterInput)([ "pet_guid", "date", "partner_ext_id", // (Optional)Ext ID of the partner who adds the entry. ]) ], Identity.prototype, "deletePetBmi", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Add_diet_recommendation"), (0, apiDecorators_1.filterInput)([ "pet_guid", "creation_date", "collection_reference", "expiration_date", "partner_ext_id", "ration", "ration_unit", "custom_logger_info", // (Optional) custom values to add as logging values. Ex. {"tag_1":"custom_tag_1", "tag_2":"custom_tag_2"} ]) ], Identity.prototype, "addPetDietRecommendation", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Retrieve_diet_recommendations"), (0, apiDecorators_1.filterInput)([ "pet_guid", "creation_date", "partner_ext_id", // (Optional) Ext ID of the partner who added the entries. ]) ], Identity.prototype, "getPetDietRecommendation", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Delete_diet_recommendations"), (0, apiDecorators_1.filterInput)([ "pet_guid", "creation_date", "collection_reference", "partner_ext_id", "custom_logger_info", // (Optional) custom values to add as logging values. Ex. {"tag_1":"custom_tag_1", "tag_2":"custom_tag_2"} ]) ], Identity.prototype, "deletePetDietRecommendation", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Add_Pet_Tags"), (0, apiDecorators_1.filterInput)([ "pet_guid", "pet_tags", "replace_existing_tags", // (Optional) Flag used to determine whether existing tags have to be replaced by the given list or not. If the value is "1" or "yes" then the existing tags will be removed. ]) ], Identity.prototype, "addPetTags", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Delete_Pet_Tags"), (0, apiDecorators_1.filterInput)([ "pet_guid", "pet_tags", // (Required) Tag which is going to delete from the user. Multiple values can be used for this by separating each by a comma. If this parameter is not sent or empty value is sent, all tags which are relate to the user will be deleted. ]) ], Identity.prototype, "deletePetTags", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Add_new_child"), (0, apiDecorators_1.filterInput)([ "user_guid", "child_first_name", "child_birthday", "child_gender", "child_ext_id", "multiples", // Valid values are '1' OR '0' When adding a child allow replacement of existing child if existing child has a Date of Birth within x days. X is an optional config parameter, not editable. If the parameter is set then replacement will be automatic unless the "multiples" option is used ]) ], Identity.prototype, "createChild", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php/Retrieve_child_information"), (0, apiDecorators_1.filterInput)([ "user_guid", // (Required) The GUID of the parent account. ]) ], Identity.prototype, "getChildren", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Update_child_information"), (0, apiDecorators_1.filterInput)([ "child_guid", "child_first_name", "child_birthday", "child_gender", "child_ext_id", // (Optional) The external id of the child. This should be a unique value. ]) ], Identity.prototype, "updateChild", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Get_User_Segments"), (0, apiDecorators_1.filterInput)(["user_guid"]) ], Identity.prototype, "getUserSegments", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Flush_User_Segment_Cache"), (0, apiDecorators_1.filterInput)(["user_guid"]) ], Identity.prototype, "flushUserSegmentCache", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Add_a_favourite_to_the_user_account"), (0, apiDecorators_1.filterInput)([ "user_guid", "date", "type", "content", "source", // Text string used to identify the source that created the favorite. ]) ], Identity.prototype, "addUserFavourites", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Retrieve_favourites_of_a_user_account"), (0, apiDecorators_1.filterInput)([ "user_guid", "type", "source", // (Optional) Text string used to define the source of favorite. ]) ], Identity.prototype, "getUserFavourites", null); __decorate([ (0, apiDecorators_1.doc)("http://doc.clixray.com/index.php/Delete_a_favourite_from_a_user_account"), (0, apiDecorators_1.filterInput)([ "user_guid", "content_id", // The content ID of the pet owner favorite record ]) ], Identity.prototype, "deleteUserFavourites", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php/Retrieve_Password_Validation_Rule"), (0, apiDecorators_1.filterInput)([ "user_guid", "user_email", "user_username", // Required if other identifiers not given - The username of the user for whom the password validation rule should be retrieved. ]) ], Identity.prototype, "getFormatPassword", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Get_User_Tags"), (0, apiDecorators_1.filterInput)(["user_guid"]) ], Identity.prototype, "getUserTags", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Get_User_Tags"), (0, apiDecorators_1.filterInput)([ "user_guid", "user_tags", "replace_existing_tags", "custom_logger_info", // (Optional) custom values to add as logging values. Ex. {"tag_1":"custom_tag_1", "tag_2":"custom_tag_2"} ]) ], Identity.prototype, "addUserTags", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Get_User_Tags"), (0, apiDecorators_1.filterInput)([ "user_guid", "user_tags", "custom_logger_info", // (Optional) custom values to add as logging values. Ex. {"tag_1":"custom_tag_1", "tag_2":"custom_tag_2"} ]) ], Identity.prototype, "deleteUserTags", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Get_User_Social_Networks"), (0, apiDecorators_1.filterInput)([ "user_guid", // (Required) GUID of the user. ]) ], Identity.prototype, "getUserSocialNetwork", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Add_User_Social_Network"), (0, apiDecorators_1.filterInput)([ "user_guid", "social_network", "username", "follower_count", // (Optional) Number of followers in the social network. ]) ], Identity.prototype, "addUserSocialNetwork", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Update_User_Social_Network"), (0, apiDecorators_1.filterInput)([ "user_guid", "social_network", "username", "follower_count", // (Optional) Number of followers in the social network. ]) ], Identity.prototype, "updateUserSocialNetwork", null); __decorate([ (0, apiDecorators_1.doc)("https://doc.clixray.com/index.php?title=Delete_User_Social_Network"), (0, apiDecorators_1.filterInput)([ "user_guid", "social_network", "username", // (Required) The username in the social network. ]) ], Identity.prototype, "deleteUserSocialNetwork", null); exports.default = Identity;