Skip to content

Commit d0e5d11

Browse files
authored
Merge pull request #752 from inplayer-org/new-daily-env-config
New daily env config
2 parents e0e2d38 + 23499cb commit d0e5d11

File tree

7 files changed

+37
-8
lines changed

7 files changed

+37
-8
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
# [3.12.4] - 03-17-2022
6+
7+
### Changes
8+
9+
- Add config object for daily environment
10+
511
# [3.12.3] - 07-12-2021
612

713
### Changes

index.d.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { AxiosResponse } from 'axios';
44
export enum Env {
55
Development = 'development',
66
Production = 'production',
7+
Daily = 'daily',
78
}
89

910
// Common response
@@ -971,8 +972,6 @@ export declare class Notifications {
971972
unsubscribe(): void;
972973
}
973974

974-
type Env = 'development' | 'production';
975-
976975
export interface LocalStorageMethods {
977976
setItem: <R = void>(key: string, value: string) => R | void;
978977
getItem: <R = string | null>(key: string) => R | (string | null);

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@inplayer-org/inplayer.js",
3-
"version": "3.12.2",
3+
"version": "3.12.4",
44
"author": "InPlayer",
55
"license": "MIT",
66
"description": "A Javascript SDK for Inplayer's RESTful API",

src/config.ts

+17
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ export const commonConfig = {
66
IOT_NOTIF_URL: 'a3gkl64duktvc4-ats.iot.eu-west-1.amazonaws.com',
77
};
88

9+
/**
10+
* ```typescript
11+
* INPLAYER_TOKEN_KEY = 'inplayer_token';
12+
* INPLAYER_IOT_KEY = 'inplayer_iot';
13+
* INPLAYER_ACCESS_CODE_NAME = (assetId: number) => `access_code_${assetId}`;
14+
* IOT_NOTIF_URL = 'a3gkl64duktvc4-ats.iot.eu-west-1.amazonaws.com';
15+
* BASE_URL = 'https://services-daily.inplayer.com';
16+
* AWS_IOT_URL = 'https://o3871l8vj7.execute-api.eu-west-1.amazonaws.com/staging/iot/keys';
17+
* ```
18+
*/
19+
export const dailyConfig = {
20+
...commonConfig,
21+
BASE_URL: 'https://services-daily.inplayer.com',
22+
AWS_IOT_URL: 'https://o3871l8vj7.execute-api.eu-west-1.amazonaws.com/staging/iot/keys',
23+
};
24+
925
/**
1026
* ```typescript
1127
* INPLAYER_TOKEN_KEY = 'inplayer_token';
@@ -42,6 +58,7 @@ export const prodConfig = {
4258
export const config = {
4359
development: devConfig,
4460
production: prodConfig,
61+
daily: dailyConfig,
4562
};
4663

4764
export default config;

src/endpoints/payment.ts

+4
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ class Payment extends BaseExtend {
391391
* })
392392
* .then(data => console.log(data));
393393
* @returns {AxiosResponse<GeneratePayPalParameters>} Contains the data:
394+
* ```typescript
394395
* {
395396
* endpoint: string;
396397
* business: string;
@@ -399,6 +400,7 @@ class Payment extends BaseExtend {
399400
* return: string;
400401
* cancel_return: string;
401402
* }
403+
* ```
402404
*/
403405
// object types must be anonymous(don't use interface or type alias)
404406
// in order to data params description to be shown in typedoc
@@ -450,6 +452,7 @@ class Payment extends BaseExtend {
450452
* .getPurchaseHistory('active', 0, 5)
451453
* .then(data => console.log(data));
452454
* @returns {AxiosResponse<PurchaseHistoryCollection[]>} Contains the data:
455+
* ```typescript
453456
* {
454457
* total: number;
455458
* page: number;
@@ -478,6 +481,7 @@ class Payment extends BaseExtend {
478481
* type: string;
479482
* }];
480483
* }
484+
* ```
481485
*/
482486
async getPurchaseHistory(
483487
status = 'active',

src/index.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@ export class InPlayer {
7878
* InPlayer.subscribe(
7979
* 'adsasd-d1-cjc1c-1ajaveo',
8080
* {
81-
* onMessage: (message) =>
82-
* { let body = JSON.parse(message.body); console.log(body, 'message') },
83-
* onOpen: (e) => console.log('open'),
84-
* onClose: (e) => console.log('close', e)
81+
* onMessage: (message) =>
82+
* {
83+
* let body = JSON.parse(message.body); console.log(body, 'message')
84+
* },
85+
* onOpen: (e) => console.log('open'),
86+
* onClose: (e) => console.log('close', e)
8587
* }
8688
* )
8789
*/
@@ -128,7 +130,7 @@ export class InPlayer {
128130
/**
129131
* Overrides the default configs
130132
* @method setConfig
131-
* @param {String} config 'production', 'development'
133+
* @param {String} config 'production', 'development', 'daily'
132134
* @example
133135
* InPlayer.setConfig('development');
134136
*/

src/models/CommonInterfaces.ts

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ApiConfig, Request } from './Config';
44
export enum Env {
55
Development = 'development',
66
Production = 'production',
7+
Daily = 'daily',
78
}
89

910
export interface BaseExtend {

0 commit comments

Comments
 (0)