@web-lite/api-types
Advanced tools
Comparing version 1.2.1 to 1.3.0
# Changelog | ||
## [v1.2.1](https://github.com/weblite-wapps/api-types/tree/v1.2.1) (2021-07-27) | ||
[Full Changelog](https://github.com/weblite-wapps/api-types/compare/v1.2.0...v1.2.1) | ||
## [v1.2.0](https://github.com/weblite-wapps/api-types/tree/v1.2.0) (2021-07-27) | ||
@@ -4,0 +8,0 @@ |
@@ -7,3 +7,3 @@ { | ||
"author": "Weblite Team", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Use W with type checking and mock out of the box.", | ||
@@ -38,3 +38,3 @@ "license": "BSD-3-Clause", | ||
"devDependencies": { | ||
"@types/node": "^14.14.37", | ||
"@types/node": "^16.9.2", | ||
"@types/ramda": "0.25.51", | ||
@@ -41,0 +41,0 @@ "tsd": "^0.14.0", |
@@ -102,3 +102,6 @@ import * as R from 'ramda'; | ||
mock = R.mergeDeepLeft(mock, GLOBALS); | ||
R.forEach(key => globalUpdatePath([key], mock[key]!), R.keys(mock)); | ||
R.forEach( | ||
(key: keyof IMock) => globalUpdatePath([key], mock[key]!), | ||
R.keys(mock), | ||
); | ||
}; | ||
@@ -208,3 +211,3 @@ | ||
R.forEach(userId => { | ||
R.forEach((userId: string) => { | ||
const probableUser = _getUserById(userId); | ||
@@ -222,3 +225,3 @@ if (probableUser) users[userId] = probableUser; | ||
R.forEach(username => { | ||
R.forEach((username: string) => { | ||
const probableUser = _getUserByUsername(username); | ||
@@ -382,6 +385,8 @@ if (probableUser) users[username] = probableUser; | ||
/******************************************************************************/ | ||
export const getAnalyticsMock = | ||
() => (type: string, data: { [key: string]: string | number }) => { | ||
debug(`Send analytics event for [${type}] with te following data`, data); | ||
}; | ||
export const getAnalyticsMock = () => ( | ||
type: string, | ||
data: { [key: string]: string | number }, | ||
) => { | ||
debug(`Send analytics event for [${type}] with te following data`, data); | ||
}; | ||
/******************************************************************************/ | ||
@@ -430,3 +435,3 @@ | ||
// (args) | ||
const parseList: any = R.map(arg => { | ||
const parseList: any = R.map((arg: string | string[]) => { | ||
if (R.type(arg) === 'Array') | ||
@@ -486,1 +491,13 @@ return isFunction(arg as Qlite<string>) | ||
}); | ||
export const getWappActivity = () => ({ | ||
search: async (args: { [key: string]: any } & { instance: string }) => { | ||
debug('[wappActivity.search]', args); | ||
return [] as any; | ||
}, | ||
postActivity: (args: { [key: string]: any } & { instance: string }) => { | ||
debug('[wappActivity.postActivity]', args); | ||
return Promise.resolve(); | ||
}, | ||
}); |
@@ -443,2 +443,8 @@ ///////////////////////// | ||
type wappActivityArgs = { [key: string]: any } & { instance: string }; | ||
export interface WappActivity { | ||
search: (args: wappActivityArgs) => Promise<any>; | ||
postActivity: (args: wappActivityArgs) => Promise<any>; | ||
} | ||
///////////////////////// | ||
@@ -460,2 +466,3 @@ // W // | ||
shareDB: ShareDB; | ||
wappActivity: WappActivity; | ||
} | ||
@@ -462,0 +469,0 @@ |
@@ -19,2 +19,3 @@ import IWindow, { IMock } from './index'; | ||
DeepPartial, | ||
getWappActivity, | ||
} from './core'; | ||
@@ -43,3 +44,4 @@ | ||
shareDB: getShareDBMock(), | ||
wappActivity: getWappActivity(), | ||
} as IWindow['W']; | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
66012
1606