@designliquido/delegua-http 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fontes/cliente-http.d.ts +1 -0
- package/fontes/cliente-http.d.ts.map +1 -0
- package/fontes/cliente-http.js +15 -5
- package/fontes/cliente-http.js.map +1 -1
- package/fontes/interfaces/argumento-interface.d.ts +1 -0
- package/fontes/interfaces/argumento-interface.d.ts.map +1 -0
- package/fontes/interfaces/index.d.ts +1 -0
- package/fontes/interfaces/index.d.ts.map +1 -0
- package/fontes/resposta-http.d.ts +1 -0
- package/fontes/resposta-http.d.ts.map +1 -0
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -0
- package/jest.config.d.ts +1 -0
- package/jest.config.d.ts.map +1 -0
- package/package.json +8 -4
- package/testes/cliente-http.test.d.ts +0 -1
- package/testes/cliente-http.test.js +0 -12
- package/testes/cliente-http.test.js.map +0 -1
package/fontes/cliente-http.d.ts
CHANGED
|
@@ -10,3 +10,4 @@ export declare class ClienteHttp {
|
|
|
10
10
|
requisicaoDelete(sufixoUrl: string | ArgumentoInterface, cabecalhos?: RawAxiosRequestHeaders): Promise<RespostaHttp>;
|
|
11
11
|
requisicaoPatch(sufixoUrl: string | ArgumentoInterface, corpo: any, cabecalhos?: RawAxiosRequestHeaders): Promise<RespostaHttp>;
|
|
12
12
|
}
|
|
13
|
+
//# sourceMappingURL=cliente-http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliente-http.d.ts","sourceRoot":"","sources":["../../fontes/cliente-http.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAAiB,sBAAsB,EAAE,MAAM,OAAO,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,qBAAa,WAAW;IACpB,cAAc,EAAE,aAAa,CAAC;gBAElB,OAAO,GAAE,MAAW,EAAE,WAAW,GAAE,MAAa,EAAE,UAAU,GAAE,GAAQ;IAQ5E,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,EAAE,UAAU,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC;IAkBjH,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC;IAmB9H,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC;IAmB7H,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,EAAE,UAAU,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC;IAkBpH,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,YAAY,CAAC;CAkBxI"}
|
package/fontes/cliente-http.js
CHANGED
|
@@ -17,35 +17,45 @@ class ClienteHttp {
|
|
|
17
17
|
async requisicaoGet(sufixoUrl, cabecalhos) {
|
|
18
18
|
const sufixoUrlResolvido = sufixoUrl.hasOwnProperty("valor") ? sufixoUrl.valor : sufixoUrl;
|
|
19
19
|
const respostaAxios = await this.instanciaAxios.get(`${sufixoUrlResolvido}`, {
|
|
20
|
-
headers:
|
|
20
|
+
headers: {
|
|
21
|
+
...cabecalhos
|
|
22
|
+
}
|
|
21
23
|
});
|
|
22
24
|
return new resposta_http_1.RespostaHttp(respostaAxios.status, respostaAxios.statusText, respostaAxios.data);
|
|
23
25
|
}
|
|
24
26
|
async requisicaoPost(sufixoUrl, corpo, cabecalhos) {
|
|
25
27
|
const sufixoUrlResolvido = sufixoUrl.hasOwnProperty("valor") ? sufixoUrl.valor : sufixoUrl;
|
|
26
28
|
const respostaAxios = await this.instanciaAxios.post(`${sufixoUrlResolvido}`, corpo, {
|
|
27
|
-
headers:
|
|
29
|
+
headers: {
|
|
30
|
+
...cabecalhos
|
|
31
|
+
}
|
|
28
32
|
});
|
|
29
33
|
return new resposta_http_1.RespostaHttp(respostaAxios.status, respostaAxios.statusText, respostaAxios.data);
|
|
30
34
|
}
|
|
31
35
|
async requisicaoPut(sufixoUrl, corpo, cabecalhos) {
|
|
32
36
|
const sufixoUrlResolvido = sufixoUrl.hasOwnProperty("valor") ? sufixoUrl.valor : sufixoUrl;
|
|
33
37
|
const respostaAxios = await this.instanciaAxios.put(`${sufixoUrlResolvido}`, corpo, {
|
|
34
|
-
headers:
|
|
38
|
+
headers: {
|
|
39
|
+
...cabecalhos
|
|
40
|
+
}
|
|
35
41
|
});
|
|
36
42
|
return new resposta_http_1.RespostaHttp(respostaAxios.status, respostaAxios.statusText, respostaAxios.data);
|
|
37
43
|
}
|
|
38
44
|
async requisicaoDelete(sufixoUrl, cabecalhos) {
|
|
39
45
|
const sufixoUrlResolvido = sufixoUrl.hasOwnProperty("valor") ? sufixoUrl.valor : sufixoUrl;
|
|
40
46
|
const respostaAxios = await this.instanciaAxios.delete(`${sufixoUrlResolvido}`, {
|
|
41
|
-
headers:
|
|
47
|
+
headers: {
|
|
48
|
+
...cabecalhos
|
|
49
|
+
}
|
|
42
50
|
});
|
|
43
51
|
return new resposta_http_1.RespostaHttp(respostaAxios.status, respostaAxios.statusText, respostaAxios.data);
|
|
44
52
|
}
|
|
45
53
|
async requisicaoPatch(sufixoUrl, corpo, cabecalhos) {
|
|
46
54
|
const sufixoUrlResolvido = sufixoUrl.hasOwnProperty("valor") ? sufixoUrl.valor : sufixoUrl;
|
|
47
55
|
const respostaAxios = await this.instanciaAxios.patch(`${sufixoUrlResolvido}`, corpo, {
|
|
48
|
-
headers:
|
|
56
|
+
headers: {
|
|
57
|
+
...cabecalhos
|
|
58
|
+
}
|
|
49
59
|
});
|
|
50
60
|
return new resposta_http_1.RespostaHttp(respostaAxios.status, respostaAxios.statusText, respostaAxios.data);
|
|
51
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliente-http.js","sourceRoot":"","sources":["../../fontes/cliente-http.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAoF;AACpF,mDAA+C;AAG/C,MAAa,WAAW;IAGpB,YAAY,UAAkB,EAAE,EAAE,cAAsB,IAAI,EAAE,aAAkB,EAAE;QAC9E,IAAI,CAAC,cAAc,GAAG,eAAK,CAAC,MAAM,CAAC;YAC/B,OAAO,EAAE,GAAG,OAAO,EAAE;YACrB,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,UAAU;SACtB,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,SAAsC,EAAE,UAAmC;QAC3F,MAAM,kBAAkB,GAAG,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,SAAgC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QACnH,MAAM,aAAa,GAA4B,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,CACxE,GAAG,kBAAkB,EAAE,EACvB;YACI,OAAO,
|
|
1
|
+
{"version":3,"file":"cliente-http.js","sourceRoot":"","sources":["../../fontes/cliente-http.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAoF;AACpF,mDAA+C;AAG/C,MAAa,WAAW;IAGpB,YAAY,UAAkB,EAAE,EAAE,cAAsB,IAAI,EAAE,aAAkB,EAAE;QAC9E,IAAI,CAAC,cAAc,GAAG,eAAK,CAAC,MAAM,CAAC;YAC/B,OAAO,EAAE,GAAG,OAAO,EAAE;YACrB,OAAO,EAAE,WAAW;YACpB,OAAO,EAAE,UAAU;SACtB,CAAC,CAAC;IACP,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,SAAsC,EAAE,UAAmC;QAC3F,MAAM,kBA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AI,4BAAY,CACnB,aAAa,CAAC,MAAM,EACpB,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,IAAI,CACrB,CAAC;IACN,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,SAAsC,EAAE,UAAmC;QAC9F,MAAM,kBAAkB,GAAG,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,SAAgC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QACnH,MAAM,aAAa,GAA4B,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAC3E,GAAG,kBAAkB,EAAE,EACvB;YACI,OAAO,EAAE;gBACL,GAAG,UAAU;aAChB;SACJ,CACJ,CAAC;QAEF,OAAO,IAAI,4BAAY,CACnB,aAAa,CAAC,MAAM,EACpB,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,IAAI,CACrB,CAAC;IACN,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,SAAsC,EAAE,KAAU,EAAE,UAAmC;QACzG,MAAM,kBAAkB,GAAG,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,SAAgC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QACnH,MAAM,aAAa,GAA4B,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAC1E,GAAG,kBAAkB,EAAE,EACvB,KAAK,EACL;YACI,OAAO,EAAE;gBACL,GAAG,UAAU;aAChB;SACJ,CACJ,CAAC;QAEF,OAAO,IAAI,4BAAY,CACnB,aAAa,CAAC,MAAM,EACpB,aAAa,CAAC,UAAU,EACxB,aAAa,CAAC,IAAI,CACrB,CAAC;IACN,CAAC;CACJ;AAvGD,kCAuGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"argumento-interface.d.ts","sourceRoot":"","sources":["../../../fontes/interfaces/argumento-interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../fontes/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resposta-http.d.ts","sourceRoot":"","sources":["../../fontes/resposta-http.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAY;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,GAAG,CAAC;gBAEC,YAAY,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG;CAKvE"}
|
package/index.d.ts
CHANGED
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,GAAE,MAAW,EAAE,WAAW,GAAE,MAAa,EAAE,UAAU,GAAE,GAAQ,GAAG,WAAW,CAE3H;AAED,cAAc,wBAAwB,CAAC"}
|
package/jest.config.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jest.config.d.ts","sourceRoot":"","sources":["../jest.config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;8BAEjB,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC;AAAvD,wBAQE"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@designliquido/delegua-http",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Biblioteca para acessos HTTP em Delégua",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
5
7
|
"repository": {
|
|
6
8
|
"type": "git",
|
|
7
9
|
"url": "git+https://github.com/DesignLiquido/delegua-http.git"
|
|
8
10
|
},
|
|
9
11
|
"scripts": {
|
|
10
|
-
"empacotar": "yarn rimraf ./dist && tsc && yarn copyfiles -V ./README.md ./dist && yarn copyfiles -V ./LICENSE ./dist",
|
|
11
|
-
"publicar-npm": "npm publish --access public"
|
|
12
|
+
"empacotar": "yarn rimraf ./dist && tsc && yarn copyfiles -V ./README.md ./dist && yarn copyfiles -V ./LICENSE ./dist && yarn copyfiles -V ./package.json ./dist",
|
|
13
|
+
"publicar-npm": "npm publish ./dist --access public",
|
|
14
|
+
"testes-unitarios": "jest --passWithNoTests --coverage"
|
|
12
15
|
},
|
|
13
16
|
"author": "Leonel Sanches da Silva",
|
|
14
17
|
"dependencies": {
|
|
@@ -16,10 +19,11 @@
|
|
|
16
19
|
},
|
|
17
20
|
"devDependencies": {
|
|
18
21
|
"@types/jest": "^29.5.14",
|
|
22
|
+
"@types/node": "^22.14.0",
|
|
19
23
|
"copyfiles": "^2.4.1",
|
|
20
24
|
"jest": "^29.7.0",
|
|
21
25
|
"rimraf": "^6.0.1",
|
|
22
|
-
"ts-jest": "^29.3.
|
|
26
|
+
"ts-jest": "^29.3.4",
|
|
23
27
|
"ts-node": "^10.9.2",
|
|
24
28
|
"typescript": "^5.8.3"
|
|
25
29
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const __1 = require("..");
|
|
4
|
-
describe('Cliente HTTP', () => {
|
|
5
|
-
it('Deve trazer dados com sucesso', async () => {
|
|
6
|
-
const clienteHttp = (0, __1.novoClienteHttp)(undefined, "https://github.com");
|
|
7
|
-
const resultado = await clienteHttp.requisicaoGet({ nome: undefined, valor: "/DesignLiquido/delegua" });
|
|
8
|
-
expect(resultado).toBeTruthy();
|
|
9
|
-
expect(resultado.codigoStatus).toBe(200);
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
//# sourceMappingURL=cliente-http.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cliente-http.test.js","sourceRoot":"","sources":["../../testes/cliente-http.test.ts"],"names":[],"mappings":";;AAAA,0BAAqC;AAErC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC1B,EAAE,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;QAC3C,MAAM,WAAW,GAAG,IAAA,mBAAe,EAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;QACrE,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,wBAAwB,EAAC,CAAC,CAAC;QACvG,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC;QAC/B,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|