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ot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/thirdwatch_api@0.0.3/src/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * Thirdwatch API\n * The first version of the Thirdwatch API is an exciting step forward towards making it easier for developers to pass data to Thirdwatch.  Once you've [registered your website/app](https://thirdwatch.ai) it's easy to start sending data to Thirdwatch.  All endpoints are only accessible via https and are located at `api.thirdwatch.ai`. For instance: you can send event at the moment by ```HTTP POST``` Request to the following URL with your API key in ```Header``` and ```JSON``` data in request body. ```   https://api.thirdwatch.ai/event/v1 ``` Every API request must contain ```API Key``` in header value ```X-THIRDWATCH-API-KEY```  Every event must contain your ```_userId``` (if this is not available, you can alternatively provide a ```_sessionId``` value also in ```_userId```).  JavaScript Fingerprinting module for capturing unique devices and tracking user interaction.  This script will identify unique devices with respect to the browser. For e.g., if chrome is opened in normal mode a unique device id is generated and this will be same if chrome is opened in incognito mode or reinstalled.  Paste the below script onto your webpage, just after the opening `<body>` tag. This script should be added to the page which is accessed externally by the user of your website. For e.g., If you want to track three different webpages then paste the below script onto each webpage, just after the opening `<body>` tag. This script should not be added onto internal tools or admin panels. ```   &lt;script id=\\\"thirdwatch\\\"     data-session-cookie-name=\\\"&lt;cookie_name&gt;\\\"     data-session-id-value=\\\"&lt;session_id&gt;\\\"     data-user-id=\\\"&lt;user_id&gt;\\\"     data-app-secret=\\\"&lt;app_secret&gt;\\\"     data-is-track-pageview=\\\"true\\\"&gt; (function() {         var loadDeviceJs = function() {         var element = document.createElement(\\\"script\\\");         element.async = 1;         element.src = \\\"https://cdn.thirdwatch.ai/tw.min.js\\\";         document.body.appendChild(element);         };         if (window.addEventListener) {              window.addEventListener(\\\"load\\\", loadDeviceJs, false);         } else if (window.attachEvent) {         window.attachEvent(\\\"onload\\\", loadDeviceJs);         }     })();   &lt;/script&gt; ``` * `data-session-cookie-name` -- The cookie name where you are saving the unique session id. We will pick the session id by reading its value from the cookie name. (Optional) * `data-session-id-value` -- In case you are not passing `data-session-cookie-name` than you can put session id directly in this parameter. In absence of both `data-session-cookie-name` and `data-session-id-value`, our system will generate a session Id. (Optional) * `data-user-id` -- Unique user id at your end. This can be email id or primary key in the database. In case of guest user, you can insert session Id here. * `data-app-secret` -- Unique App secret generated for you by Thirdwatch. * `data-is-track-pageview` -- If this is set to true, then the url on which this script is running will be sent to Thirdwatch, else the url will not be captured.   The Score API is use to get an up to date cutomer trust score after you have sent transaction event and order successful. This API will provide the riskiness score of the order with reasons. Some examples of when you may want to check the score are before:    - Before Shippement of a package   - Finalizing a money transfer   - Giving access to a prearranged vacation rental   - Sending voucher on mail  ```   https://api.thirdwatch.ai/neo/v1/score?api_key=<your api key>&order_id=<Order id> ```  According to Score you can decide to take action Approve or Reject. Orders with score more than 70 will consider as Riskey orders. We'll provide some reasons also in rules section.   ``` {   \\\"order_id\\\": \\\"OCT45671\\\",   \\\"user_id\\\": \\\"ajay_245\\\",   \\\"order_timestamp\\\": \\\"2017-05-09T09:40:45.717Z\\\",   \\\"score\\\": 82,   \\\"flag\\\": \\\"red\\\",     -\\\"reasons\\\": [     {         \\\"name\\\": \\\"_numOfFailedTransactions\\\",         \\\"display_name\\\": \\\"Number of failed transactions\\\",         \\\"flag\\\": \\\"green\\\",         \\\"value\\\": \\\"0\\\",         \\\"is_display\\\": true       },       {         \\\"name\\\": \\\"_accountAge\\\",         \\\"display_name\\\": \\\"Account age\\\",         \\\"flag\\\": \\\"red\\\",         \\\"value\\\": \\\"0\\\",         \\\"is_display\\\": true       },       {         \\\"name\\\": \\\"_numOfOrderSameIp\\\",         \\\"display_name\\\": \\\"Number of orders from same IP\\\",         \\\"flag\\\": \\\"red\\\",         \\\"value\\\": \\\"11\\\",         \\\"is_display\\\": true       }     ] } ``` \n *\n * OpenAPI spec version: 0.0.1\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n *\n * Swagger Codegen version: 2.2.3\n *\n * Do not edit the class manually.\n *\n */\n\n(function(factory) {\n  if (typeof define === 'function' && define.amd) {\n    // AMD. Register as an anonymous module.\n    define(['ApiClient', 'model/AddPromotion', 'model/AddToCart', 'model/BillingAddress', 'model/Chargeback', 'model/CreateAccount', 'model/CreateOrder', 'model/Custom', 'model/CustomInfo', 'model/ErrorResponse', 'model/EventResponse', 'model/Item', 'model/ItemStatus', 'model/LinkSessionToUser', 'model/Login', 'model/Logout', 'model/OrderStatus', 'model/PaymentMethod', 'model/Promotion', 'model/RemoveFromCart', 'model/ReportItem', 'model/Seller', 'model/SendMessage', 'model/ShippingAddress', 'model/SubmitReview', 'model/Tag', 'model/Transaction', 'model/UnTag', 'model/UpdateAccount', 'model/UpdateOrder', 'api/AddPromotionApi', 'api/AddToCartApi', 'api/ChargebackApi', 'api/CreateAccountApi', 'api/CreateOrderApi', 'api/CustomEventApi', 'api/ItemStatusApi', 'api/LinkSessionToUserApi', 'api/LoginApi', 'api/LogoutApi', 'api/OrderStatusApi', 'api/RemoveFromCartApi', 'api/ReportItemApi', 'api/SendMessageApi', 'api/SubmitReviewApi', 'api/TagAPIApi', 'api/TransactionApi', 'api/UntagAPIApi', 'api/UpdateAccountApi', 'api/UpdateOrderApi'], factory);\n  } else if (typeof module === 'object' && module.exports) {\n    // CommonJS-like environments that support module.exports, like Node.\n    module.exports = factory(require('./ApiClient'), require('./model/AddPromotion'), require('./model/AddToCart'), require('./model/BillingAddress'), require('./model/Chargeback'), require('./model/CreateAccount'), require('./model/CreateOrder'), require('./model/Custom'), require('./model/CustomInfo'), require('./model/ErrorResponse'), require('./model/EventResponse'), require('./model/Item'), require('./model/ItemStatus'), require('./model/LinkSessionToUser'), require('./model/Login'), require('./model/Logout'), require('./model/OrderStatus'), require('./model/PaymentMethod'), require('./model/Promotion'), require('./model/RemoveFromCart'), require('./model/ReportItem'), require('./model/Seller'), require('./model/SendMessage'), require('./model/ShippingAddress'), require('./model/SubmitReview'), require('./model/Tag'), require('./model/Transaction'), require('./model/UnTag'), require('./model/UpdateAccount'), require('./model/UpdateOrder'), require('./api/AddPromotionApi'), require('./api/AddToCartApi'), require('./api/ChargebackApi'), require('./api/CreateAccountApi'), require('./api/CreateOrderApi'), require('./api/CustomEventApi'), require('./api/ItemStatusApi'), require('./api/LinkSessionToUserApi'), require('./api/LoginApi'), require('./api/LogoutApi'), require('./api/OrderStatusApi'), require('./api/RemoveFromCartApi'), require('./api/ReportItemApi'), require('./api/SendMessageApi'), require('./api/SubmitReviewApi'), require('./api/TagAPIApi'), require('./api/TransactionApi'), require('./api/UntagAPIApi'), require('./api/UpdateAccountApi'), require('./api/UpdateOrderApi'));\n  }\n}(function(ApiClient, AddPromotion, AddToCart, BillingAddress, Chargeback, CreateAccount, CreateOrder, Custom, CustomInfo, ErrorResponse, EventResponse, Item, ItemStatus, LinkSessionToUser, Login, Logout, OrderStatus, PaymentMethod, Promotion, RemoveFromCart, ReportItem, Seller, SendMessage, ShippingAddress, SubmitReview, Tag, Transaction, UnTag, UpdateAccount, UpdateOrder, AddPromotionApi, AddToCartApi, ChargebackApi, CreateAccountApi, CreateOrderApi, CustomEventApi, ItemStatusApi, LinkSessionToUserApi, LoginApi, LogoutApi, OrderStatusApi, RemoveFromCartApi, ReportItemApi, SendMessageApi, SubmitReviewApi, TagAPIApi, TransactionApi, UntagAPIApi, UpdateAccountApi, UpdateOrderApi) {\n  'use strict';\n\n  /**\n   * .<br>\n   * The <code>index</code> module provides access to constructors for all the classes which comprise the public API.\n   * <p>\n   * An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:\n   * <pre>\n   * var thirdwatch_api = require('index'); // See note below*.\n   * var xxxSvc = new thirdwatch_api.XxxApi(); // Allocate the API class we're going to use.\n   * var yyyModel = new thirdwatch_api.Yyy(); // Construct a model instance.\n   * yyyModel.someProperty = 'someValue';\n   * ...\n   * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.\n   * ...\n   * </pre>\n   * <em>*NOTE: For a top-level AMD script, use require(['index'], function(){...})\n   * and put the application logic within the callback function.</em>\n   * </p>\n   * <p>\n   * A non-AMD browser application (discouraged) might do something like this:\n   * <pre>\n   * var xxxSvc = new thirdwatch_api.XxxApi(); // Allocate the API class we're going to use.\n   * var yyy = new thirdwatch_api.Yyy(); // Construct a model instance.\n   * yyyModel.someProperty = 'someValue';\n   * ...\n   * var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.\n   * ...\n   * </pre>\n   * </p>\n   * @module index\n   * @version 0.0.2\n   */\n  var exports = {\n    /**\n     * The ApiClient constructor.\n     * @property {module:ApiClient}\n     */\n    ApiClient: ApiClient,\n    /**\n     * The AddPromotion model constructor.\n     * @property {module:model/AddPromotion}\n     */\n    AddPromotion: AddPromotion,\n    /**\n     * The AddToCart model constructor.\n     * @property {module:model/AddToCart}\n     */\n    AddToCart: AddToCart,\n    /**\n     * The BillingAddress model constructor.\n     * @property {module:model/BillingAddress}\n     */\n    BillingAddress: BillingAddress,\n    /**\n     * The Chargeback model constructor.\n     * @property {module:model/Chargeback}\n     */\n    Chargeback: Chargeback,\n    /**\n     * The CreateAccount model constructor.\n     * @property {module:model/CreateAccount}\n     */\n    CreateAccount: CreateAccount,\n    /**\n     * The CreateOrder model constructor.\n     * @property {module:model/CreateOrder}\n     */\n    CreateOrder: CreateOrder,\n    /**\n     * The Custom model constructor.\n     * @property {module:model/Custom}\n     */\n    Custom: Custom,\n    /**\n     * The CustomInfo model constructor.\n     * @property {module:model/CustomInfo}\n     */\n    CustomInfo: CustomInfo,\n    /**\n     * The ErrorResponse model constructor.\n     * @property {module:model/ErrorResponse}\n     */\n    ErrorResponse: ErrorResponse,\n    /**\n     * The EventResponse model constructor.\n     * @property {module:model/EventResponse}\n     */\n    EventResponse: EventResponse,\n    /**\n     * The Item model constructor.\n     * @property {module:model/Item}\n     */\n    Item: Item,\n    /**\n     * The ItemStatus model constructor.\n     * @property {module:model/ItemStatus}\n     */\n    ItemStatus: ItemStatus,\n    /**\n     * The LinkSessionToUser model constructor.\n     * @property {module:model/LinkSessionToUser}\n     */\n    LinkSessionToUser: LinkSessionToUser,\n    /**\n     * The Login model constructor.\n     * @property {module:model/Login}\n     */\n    Login: Login,\n    /**\n     * The Logout model constructor.\n     * @property {module:model/Logout}\n     */\n    Logout: Logout,\n    /**\n     * The OrderStatus model constructor.\n     * @property {module:model/OrderStatus}\n     */\n    OrderStatus: OrderStatus,\n    /**\n     * The PaymentMethod model constructor.\n     * @property {module:model/PaymentMethod}\n     */\n    PaymentMethod: PaymentMethod,\n    /**\n     * The Promotion model constructor.\n     * @property {module:model/Promotion}\n     */\n    Promotion: Promotion,\n    /**\n     * The RemoveFromCart model constructor.\n     * @property {module:model/RemoveFromCart}\n     */\n    RemoveFromCart: RemoveFromCart,\n    /**\n     * The ReportItem model constructor.\n     * @property {module:model/ReportItem}\n     */\n    ReportItem: ReportItem,\n    /**\n     * The Seller model constructor.\n     * @property {module:model/Seller}\n     */\n    Seller: Seller,\n    /**\n     * The SendMessage model constructor.\n     * @property {module:model/SendMessage}\n     */\n    SendMessage: SendMessage,\n    /**\n     * The ShippingAddress model constructor.\n     * @property {module:model/ShippingAddress}\n     */\n    ShippingAddress: ShippingAddress,\n    /**\n     * The SubmitReview model constructor.\n     * @property {module:model/SubmitReview}\n     */\n    SubmitReview: SubmitReview,\n    /**\n     * The Tag model constructor.\n     * @property {module:model/Tag}\n     */\n    Tag: Tag,\n    /**\n     * The Transaction model constructor.\n     * @property {module:model/Transaction}\n     */\n    Transaction: Transaction,\n    /**\n     * The UnTag model constructor.\n     * @property {module:model/UnTag}\n     */\n    UnTag: UnTag,\n    /**\n     * The UpdateAccount model constructor.\n     * @property {module:model/UpdateAccount}\n     */\n    UpdateAccount: UpdateAccount,\n    /**\n     * The UpdateOrder model constructor.\n     * @property {module:model/UpdateOrder}\n     */\n    UpdateOrder: UpdateOrder,\n    /**\n     * The AddPromotionApi service constructor.\n     * @property {module:api/AddPromotionApi}\n     */\n    AddPromotionApi: AddPromotionApi,\n    /**\n     * The AddToCartApi service constructor.\n     * @property {module:api/AddToCartApi}\n     */\n    AddToCartApi: AddToCartApi,\n    /**\n     * The ChargebackApi service constructor.\n     * @property {module:api/ChargebackApi}\n     */\n    ChargebackApi: ChargebackApi,\n    /**\n     * The CreateAccountApi service constructor.\n     * @property {module:api/CreateAccountApi}\n     */\n    CreateAccountApi: CreateAccountApi,\n    /**\n     * The CreateOrderApi service constructor.\n     * @property {module:api/CreateOrderApi}\n     */\n    CreateOrderApi: CreateOrderApi,\n    /**\n     * The CustomEventApi service constructor.\n     * @property {module:api/CustomEventApi}\n     */\n    CustomEventApi: CustomEventApi,\n    /**\n     * The ItemStatusApi service constructor.\n     * @property {module:api/ItemStatusApi}\n     */\n    ItemStatusApi: ItemStatusApi,\n    /**\n     * The LinkSessionToUserApi service constructor.\n     * @property {module:api/LinkSessionToUserApi}\n     */\n    LinkSessionToUserApi: LinkSessionToUserApi,\n    /**\n     * The LoginApi service constructor.\n     * @property {module:api/LoginApi}\n     */\n    LoginApi: LoginApi,\n    /**\n     * The LogoutApi service constructor.\n     * @property {module:api/LogoutApi}\n     */\n    LogoutApi: LogoutApi,\n    /**\n     * The OrderStatusApi service constructor.\n     * @property {module:api/OrderStatusApi}\n     */\n    OrderStatusApi: OrderStatusApi,\n    /**\n     * The RemoveFromCartApi service constructor.\n     * @property {module:api/RemoveFromCartApi}\n     */\n    RemoveFromCartApi: RemoveFromCartApi,\n    /**\n     * The ReportItemApi service constructor.\n     * @property {module:api/ReportItemApi}\n     */\n    ReportItemApi: ReportItemApi,\n    /**\n     * The SendMessageApi service constructor.\n     * @property {module:api/SendMessageApi}\n     */\n    SendMessageApi: SendMessageApi,\n    /**\n     * The SubmitReviewApi service constructor.\n     * @property {module:api/SubmitReviewApi}\n     */\n    SubmitReviewApi: SubmitReviewApi,\n    /**\n     * The TagAPIApi service constructor.\n     * @property {module:api/TagAPIApi}\n     */\n    TagAPIApi: TagAPIApi,\n    /**\n     * The TransactionApi service constructor.\n     * @property {module:api/TransactionApi}\n     */\n    TransactionApi: TransactionApi,\n    /**\n     * The UntagAPIApi service constructor.\n     * @property {module:api/UntagAPIApi}\n     */\n    UntagAPIApi: UntagAPIApi,\n    /**\n     * The UpdateAccountApi service constructor.\n     * @property {module:api/UpdateAccountApi}\n     */\n    UpdateAccountApi: UpdateAccountApi,\n    /**\n     * The UpdateOrderApi service constructor.\n     * @property {module:api/UpdateOrderApi}\n     */\n    UpdateOrderApi: UpdateOrderApi\n  };\n\n  return exports;\n}));\n"]}