diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a6509db..3dabb205 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +# [3.12.4] - 03-17-2022 + +### Changes + +- Add config object for daily environment + # [3.12.3] - 07-12-2021 ### Changes diff --git a/index.d.ts b/index.d.ts index 2f867f0a..8abd2e66 100644 --- a/index.d.ts +++ b/index.d.ts @@ -4,6 +4,7 @@ import { AxiosResponse } from 'axios'; export enum Env { Development = 'development', Production = 'production', + Daily = 'daily', } // Common response @@ -971,8 +972,6 @@ export declare class Notifications { unsubscribe(): void; } -type Env = 'development' | 'production'; - export interface LocalStorageMethods { setItem: (key: string, value: string) => R | void; getItem: (key: string) => R | (string | null); diff --git a/package.json b/package.json index cfa044cc..e6a69673 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@inplayer-org/inplayer.js", - "version": "3.12.2", + "version": "3.12.4", "author": "InPlayer", "license": "MIT", "description": "A Javascript SDK for Inplayer's RESTful API", diff --git a/src/config.ts b/src/config.ts index bffbd1af..c9a27938 100644 --- a/src/config.ts +++ b/src/config.ts @@ -6,6 +6,22 @@ export const commonConfig = { IOT_NOTIF_URL: 'a3gkl64duktvc4-ats.iot.eu-west-1.amazonaws.com', }; +/** + * ```typescript + * INPLAYER_TOKEN_KEY = 'inplayer_token'; + * INPLAYER_IOT_KEY = 'inplayer_iot'; + * INPLAYER_ACCESS_CODE_NAME = (assetId: number) => `access_code_${assetId}`; + * IOT_NOTIF_URL = 'a3gkl64duktvc4-ats.iot.eu-west-1.amazonaws.com'; + * BASE_URL = 'https://services-daily.inplayer.com'; + * AWS_IOT_URL = 'https://o3871l8vj7.execute-api.eu-west-1.amazonaws.com/staging/iot/keys'; + * ``` + */ +export const dailyConfig = { + ...commonConfig, + BASE_URL: 'https://services-daily.inplayer.com', + AWS_IOT_URL: 'https://o3871l8vj7.execute-api.eu-west-1.amazonaws.com/staging/iot/keys', +}; + /** * ```typescript * INPLAYER_TOKEN_KEY = 'inplayer_token'; @@ -42,6 +58,7 @@ export const prodConfig = { export const config = { development: devConfig, production: prodConfig, + daily: dailyConfig, }; export default config; diff --git a/src/endpoints/payment.ts b/src/endpoints/payment.ts index cdbc8cb7..5a00db43 100644 --- a/src/endpoints/payment.ts +++ b/src/endpoints/payment.ts @@ -391,6 +391,7 @@ class Payment extends BaseExtend { * }) * .then(data => console.log(data)); * @returns {AxiosResponse} Contains the data: + * ```typescript * { * endpoint: string; * business: string; @@ -399,6 +400,7 @@ class Payment extends BaseExtend { * return: string; * cancel_return: string; * } + * ``` */ // object types must be anonymous(don't use interface or type alias) // in order to data params description to be shown in typedoc @@ -450,6 +452,7 @@ class Payment extends BaseExtend { * .getPurchaseHistory('active', 0, 5) * .then(data => console.log(data)); * @returns {AxiosResponse} Contains the data: + * ```typescript * { * total: number; * page: number; @@ -478,6 +481,7 @@ class Payment extends BaseExtend { * type: string; * }]; * } + * ``` */ async getPurchaseHistory( status = 'active', diff --git a/src/index.ts b/src/index.ts index 0191e5a3..49fa20ef 100644 --- a/src/index.ts +++ b/src/index.ts @@ -78,10 +78,12 @@ export class InPlayer { * InPlayer.subscribe( * 'adsasd-d1-cjc1c-1ajaveo', * { - * onMessage: (message) => - * { let body = JSON.parse(message.body); console.log(body, 'message') }, - * onOpen: (e) => console.log('open'), - * onClose: (e) => console.log('close', e) + * onMessage: (message) => + * { + * let body = JSON.parse(message.body); console.log(body, 'message') + * }, + * onOpen: (e) => console.log('open'), + * onClose: (e) => console.log('close', e) * } * ) */ @@ -128,7 +130,7 @@ export class InPlayer { /** * Overrides the default configs * @method setConfig - * @param {String} config 'production', 'development' + * @param {String} config 'production', 'development', 'daily' * @example * InPlayer.setConfig('development'); */ diff --git a/src/models/CommonInterfaces.ts b/src/models/CommonInterfaces.ts index 6937c08b..0e739b91 100644 --- a/src/models/CommonInterfaces.ts +++ b/src/models/CommonInterfaces.ts @@ -4,6 +4,7 @@ import { ApiConfig, Request } from './Config'; export enum Env { Development = 'development', Production = 'production', + Daily = 'daily', } export interface BaseExtend {