Skip to content

Commit

Permalink
chore: Project Init
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed May 4, 2022
0 parents commit 2155dda
Show file tree
Hide file tree
Showing 24 changed files with 17,287 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://json.schemastore.org/commitlintrc.json",
"extends": ["@commitlint/config-conventional"],
"rules": {
"body-max-line-length": [0, "always", 100],
"header-max-length": [2, "always", 120],
"subject-case": [
1,
"never",
["sentence-case", "start-case", "pascal-case", "upper-case"]
]
}
}
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8

[{package.json}]
indent_style = space
indent_size = 2
13 changes: 13 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# PORT
PORT = 4000

# TOKEN
SECRET_KEY = secretKey

# LOG
LOG_FORMAT = dev
LOG_DIR = ./logs

# CORS
ORIGIN = *
CREDENTIALS = true
57 changes: 57 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "simple-import-sort", "import", "header"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"rules": {
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-non-null-assertion": "off",
"header/header": [
2,
"block",
[
"!",
{
"pattern": "^ \\* Copyright \\d{4} WPPConnect Team$",
"template": " * Copyright 2021 WPPConnect Team"
},
" *",
" * Licensed under the Apache License, Version 2.0 (the \"License\");",
" * you may not use this file except in compliance with the License.",
" * You may obtain a copy of the License at",
" *",
" * http://www.apache.org/licenses/LICENSE-2.0",
" *",
" * Unless required by applicable law or agreed to in writing, software",
" * distributed under the License is distributed on an \"AS IS\" BASIS,",
" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
" * See the License for the specific language governing permissions and",
" * limitations under the License.",
" "
],
2
],
"import/first": "error",
"import/newline-after-import": "error",
"import/no-duplicates": "error",
"no-empty": ["error", { "allowEmptyCatch": true }],
"simple-import-sort/exports": "error",
"simple-import-sort/imports": "error"
},
"ignorePatterns": ["webpack.config.js", "dist/*", "wa-source/*"],
"overrides": [
{
"files": ["src/whatsapp/**/*.ts"],
"rules": {
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-namespace": "off"
}
}
]
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*.tgz
/.idea
/debug.log
/dist/
/logs
/node_modules
11 changes: 11 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.*
*.tgz
*.zip
/docs
/docs-source
/src
/tsconfig.json
/typedoc.json
/userDataDir
/wa-source
/webpack.config.js
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
docs-source
html
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
14 changes: 14 additions & 0 deletions .release-it.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
git:
commitMessage: 'chore(release): v${version}'
tagAnnotation: 'chore(release): v${version}'
tagName: 'v${version}'

hooks:
after:bump:
- 'npm run changelog:update'

# automatic publish from github workflow
npm:
publish: false
private: true
registry: 'OMITTED'
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
// Use o IntelliSense para saber mais sobre os atributos possíveis.
// Focalizar para exibir as descrições dos atributos existentes.
// Para obter mais informações, acesse: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Server",
"presentation": {
"hidden": false,
"group": "Other",
"order": 2
},
"preLaunchTask": "npm: watch",
// "runtimeExecutable": "npm",
"runtimeArgs": [
"./dist/server.js",
],
"cwd": "${workspaceFolder}"
}
],
}
19 changes: 19 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"group": {
"kind": "build",
"isDefault": true
},
"isBackground": true,
"problemMatcher": [
"$tsc-watch"
],
"label": "npm: watch",
"detail": "tsc watch",
}
]
}
37 changes: 37 additions & 0 deletions decode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
function toDataURL(src, callback, outputFormat) {
var img = new Image();
img.crossOrigin = "Anonymous";
img.onload = function () {
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
var dataURL;
canvas.height = this.naturalHeight;
canvas.width = this.naturalWidth;
ctx.drawImage(this, 0, 0);
// dataURL = canvas.toDataURL(outputFormat);
// callback(dataURL);

var s = String.fromCharCode;
var x = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
var a = "",
l = x.length,
p = -1;
for (var i = 0; i < l; i += 4) {
if (x[i + 0]) a += s(x[i + 0]);
if (x[i + 1]) a += s(x[i + 1]);
if (x[i + 2]) a += s(x[i + 2]);
}

callback(a);
};
img.src = src;
if (img.complete || img.complete === undefined) {
img.src =
"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
img.src = src;
}
}

toDataURL("http://localhost:3333/?url=https://github.com/wppconnect-team/wa-js", function (dataUrl) {
console.log("RESULT:", dataUrl);
});
Loading

0 comments on commit 2155dda

Please sign in to comment.