-
-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #827 from codigoencasa/release/production
0.1.31
- Loading branch information
Showing
61 changed files
with
6,929 additions
and
4,104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@bot-whatsapp/root", | ||
"version": "0.1.29", | ||
"version": "0.1.30", | ||
"description": "Bot de wahtsapp open source para MVP o pequeños negocios", | ||
"main": "app.js", | ||
"private": true, | ||
|
@@ -24,7 +24,7 @@ | |
"build": "pnpm run cli:rollup && pnpm run bot:rollup && pnpm run provider:rollup && pnpm run database:rollup && pnpm run contexts:rollup && pnpm run create-bot-whatsapp:rollup && pnpm run portal:rollup", | ||
"copy.lib": "node ./scripts/move.js", | ||
"test.unit": "node ./node_modules/uvu/bin.js packages test", | ||
"test.e2e": "node ./node_modules/uvu/bin.js __test__", | ||
"test.e2e": "node ./node_modules/uvu/bin.js __test__ ", | ||
"test.coverage": "node ./node_modules/c8/bin/c8.js npm run test.unit", | ||
"test": "npm run test.coverage", | ||
"cli": "node ./packages/cli/bin/cli.js", | ||
|
@@ -84,12 +84,12 @@ | |
"standard-version": "^9.5.0", | ||
"uvu": "^0.5.6" | ||
}, | ||
"packageManager": "pnpm@8.5.0", | ||
"packageManager": "pnpm@8.6.12", | ||
"engines": { | ||
"node": ">=16", | ||
"node": ">=18", | ||
"npm": "please-use-pnpm", | ||
"yarn": "please-use-pnpm", | ||
"pnpm": ">=8.5.0" | ||
"pnpm": ">=8.6.12" | ||
}, | ||
"author": "Leifer Mendez <[email protected]>" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
class GlobalState { | ||
STATE = new Map() | ||
RAW = {} | ||
constructor() {} | ||
|
||
/** | ||
* | ||
* @param {*} ctx | ||
* @returns | ||
*/ | ||
updateState = () => { | ||
const currentStateByFrom = this.STATE.get('__global__') | ||
return (keyValue) => this.STATE.set('__global__', { ...currentStateByFrom, ...keyValue }) | ||
} | ||
|
||
/** | ||
* | ||
* @returns | ||
*/ | ||
getMyState = () => { | ||
return () => this.STATE.get('__global__') | ||
} | ||
|
||
/** | ||
* | ||
* @returns | ||
*/ | ||
getAllState = () => this.STATE.values() | ||
|
||
/** | ||
* | ||
* @param {*} from | ||
* @returns | ||
*/ | ||
clear = () => { | ||
return () => this.STATE.delete('__global__') | ||
} | ||
} | ||
|
||
module.exports = GlobalState |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.