Skip to content

Commit 2155dda

Browse files
committed
chore: Project Init
0 parents  commit 2155dda

24 files changed

+17287
-0
lines changed

.commitlintrc.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://json.schemastore.org/commitlintrc.json",
3+
"extends": ["@commitlint/config-conventional"],
4+
"rules": {
5+
"body-max-line-length": [0, "always", 100],
6+
"header-max-length": [2, "always", 120],
7+
"subject-case": [
8+
1,
9+
"never",
10+
["sentence-case", "start-case", "pascal-case", "upper-case"]
11+
]
12+
}
13+
}

.editorconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
charset = utf-8
7+
8+
[{package.json}]
9+
indent_style = space
10+
indent_size = 2

.env

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# PORT
2+
PORT = 4000
3+
4+
# TOKEN
5+
SECRET_KEY = secretKey
6+
7+
# LOG
8+
LOG_FORMAT = dev
9+
LOG_DIR = ./logs
10+
11+
# CORS
12+
ORIGIN = *
13+
CREDENTIALS = true

.eslintrc.json

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"plugins": ["@typescript-eslint", "simple-import-sort", "import", "header"],
5+
"extends": [
6+
"eslint:recommended",
7+
"plugin:@typescript-eslint/eslint-recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:prettier/recommended"
10+
],
11+
"rules": {
12+
"@typescript-eslint/explicit-module-boundary-types": "off",
13+
"@typescript-eslint/no-explicit-any": "off",
14+
"@typescript-eslint/no-non-null-assertion": "off",
15+
"header/header": [
16+
2,
17+
"block",
18+
[
19+
"!",
20+
{
21+
"pattern": "^ \\* Copyright \\d{4} WPPConnect Team$",
22+
"template": " * Copyright 2021 WPPConnect Team"
23+
},
24+
" *",
25+
" * Licensed under the Apache License, Version 2.0 (the \"License\");",
26+
" * you may not use this file except in compliance with the License.",
27+
" * You may obtain a copy of the License at",
28+
" *",
29+
" * http://www.apache.org/licenses/LICENSE-2.0",
30+
" *",
31+
" * Unless required by applicable law or agreed to in writing, software",
32+
" * distributed under the License is distributed on an \"AS IS\" BASIS,",
33+
" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
34+
" * See the License for the specific language governing permissions and",
35+
" * limitations under the License.",
36+
" "
37+
],
38+
2
39+
],
40+
"import/first": "error",
41+
"import/newline-after-import": "error",
42+
"import/no-duplicates": "error",
43+
"no-empty": ["error", { "allowEmptyCatch": true }],
44+
"simple-import-sort/exports": "error",
45+
"simple-import-sort/imports": "error"
46+
},
47+
"ignorePatterns": ["webpack.config.js", "dist/*", "wa-source/*"],
48+
"overrides": [
49+
{
50+
"files": ["src/whatsapp/**/*.ts"],
51+
"rules": {
52+
"@typescript-eslint/no-empty-interface": "off",
53+
"@typescript-eslint/no-namespace": "off"
54+
}
55+
}
56+
]
57+
}

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.tgz
2+
/.idea
3+
/debug.log
4+
/dist/
5+
/logs
6+
/node_modules

.npmignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.*
2+
*.tgz
3+
*.zip
4+
/docs
5+
/docs-source
6+
/src
7+
/tsconfig.json
8+
/typedoc.json
9+
/userDataDir
10+
/wa-source
11+
/webpack.config.js

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
docs-source
3+
html

.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

.release-it.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
git:
2+
commitMessage: 'chore(release): v${version}'
3+
tagAnnotation: 'chore(release): v${version}'
4+
tagName: 'v${version}'
5+
6+
hooks:
7+
after:bump:
8+
- 'npm run changelog:update'
9+
10+
# automatic publish from github workflow
11+
npm:
12+
publish: false
13+
private: true
14+
registry: 'OMITTED'

.vscode/launch.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
// Use o IntelliSense para saber mais sobre os atributos possíveis.
3+
// Focalizar para exibir as descrições dos atributos existentes.
4+
// Para obter mais informações, acesse: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch Server",
11+
"presentation": {
12+
"hidden": false,
13+
"group": "Other",
14+
"order": 2
15+
},
16+
"preLaunchTask": "npm: watch",
17+
// "runtimeExecutable": "npm",
18+
"runtimeArgs": [
19+
"./dist/server.js",
20+
],
21+
"cwd": "${workspaceFolder}"
22+
}
23+
],
24+
}

.vscode/tasks.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "npm",
6+
"script": "watch",
7+
"group": {
8+
"kind": "build",
9+
"isDefault": true
10+
},
11+
"isBackground": true,
12+
"problemMatcher": [
13+
"$tsc-watch"
14+
],
15+
"label": "npm: watch",
16+
"detail": "tsc watch",
17+
}
18+
]
19+
}

decode.js

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
function toDataURL(src, callback, outputFormat) {
2+
var img = new Image();
3+
img.crossOrigin = "Anonymous";
4+
img.onload = function () {
5+
var canvas = document.createElement("canvas");
6+
var ctx = canvas.getContext("2d");
7+
var dataURL;
8+
canvas.height = this.naturalHeight;
9+
canvas.width = this.naturalWidth;
10+
ctx.drawImage(this, 0, 0);
11+
// dataURL = canvas.toDataURL(outputFormat);
12+
// callback(dataURL);
13+
14+
var s = String.fromCharCode;
15+
var x = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
16+
var a = "",
17+
l = x.length,
18+
p = -1;
19+
for (var i = 0; i < l; i += 4) {
20+
if (x[i + 0]) a += s(x[i + 0]);
21+
if (x[i + 1]) a += s(x[i + 1]);
22+
if (x[i + 2]) a += s(x[i + 2]);
23+
}
24+
25+
callback(a);
26+
};
27+
img.src = src;
28+
if (img.complete || img.complete === undefined) {
29+
img.src =
30+
"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
31+
img.src = src;
32+
}
33+
}
34+
35+
toDataURL("http://localhost:3333/?url=https://github.com/wppconnect-team/wa-js", function (dataUrl) {
36+
console.log("RESULT:", dataUrl);
37+
});

0 commit comments

Comments
 (0)