@cimo/request 1.5.17 → 1.5.19

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/README.md CHANGED
@@ -5,8 +5,8 @@ Writed with native Typescript code and no dependencies are used.
5
5
 
6
6
  ## Pack
7
7
 
8
- 1. npm run pack
9
- 2. Copy the file "package_name-x.x.x.tgz" in the project root folder.
8
+ 1. npm run build
9
+ 2. Copy the file "/build/package_name-x.x.x.tgz" in the project root folder.
10
10
  3. In the "package.json" file insert: "@cimo/package_name": "file:package_name-x.x.x.tgz"
11
11
 
12
12
  ## Publish
@@ -32,7 +32,7 @@ By default is "false".
32
32
  ```
33
33
  ...
34
34
 
35
- import { Cr } from "@cimo/request";
35
+ import { Cr } from "@cimo/request/dist/src/Main";
36
36
 
37
37
  ...
38
38
 
@@ -65,18 +65,35 @@ const data = {
65
65
  name: "test",
66
66
  };
67
67
 
68
+ cr.post("/test_post_json",
69
+ {
70
+ headers: {
71
+ "Content-Type": "application/json"
72
+ }
73
+ },
74
+ data
75
+ )
76
+ .then((data) => {
77
+ // Response
78
+ })
79
+ .catch((error) => {
80
+ // Error
81
+ });
82
+
83
+ ...
84
+
68
85
  const formData = new FormData();
69
86
  formData.append("token_api", "1234");
70
87
  formData.append("name", "test");
71
- // use formData with "multipart/form-data" or in case of file upload, just remove the headers content-type.
88
+ // In case of file upload, just remove the headers content-type parameter.
72
89
 
73
- cr.post("/test_post",
90
+ cr.post("/test_post_form-data",
74
91
  {
75
92
  headers: {
76
- "Content-Type": "application/json"
93
+ "Content-Type": "multipart/form-data"
77
94
  }
78
95
  },
79
- data
96
+ formData
80
97
  )
81
98
  .then((data) => {
82
99
  // Response
@@ -85,6 +102,8 @@ cr.post("/test_post",
85
102
  // Error
86
103
  });
87
104
 
105
+ ...
106
+
88
107
  cr.get("/test_get", {})
89
108
  .then((data) => {
90
109
  // Response
@@ -0,0 +1,20 @@
1
+ import { TSESTree } from "@typescript-eslint/utils";
2
+ import { RuleContext } from "@typescript-eslint/utils/dist/ts-eslint";
3
+ export declare const rules: {
4
+ "disallow-array-for-object-type": {
5
+ meta: {
6
+ type: string;
7
+ docs: {
8
+ description: string;
9
+ recommended: boolean;
10
+ };
11
+ messages: {
12
+ disallowArrayForObjectType: string;
13
+ };
14
+ schema: never[];
15
+ };
16
+ create(context: RuleContext<"disallowArrayForObjectType", []>): {
17
+ TSArrayType(node: TSESTree.TSArrayType): void;
18
+ };
19
+ };
20
+ };
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rules = void 0;
4
+ const utils_1 = require("@typescript-eslint/utils");
5
+ exports.rules = {
6
+ "disallow-array-for-object-type": {
7
+ meta: {
8
+ type: "problem",
9
+ docs: {
10
+ description: "Disallow array for object type.",
11
+ recommended: false
12
+ },
13
+ messages: {
14
+ disallowArrayForObjectType: "Array for object type are disallowed."
15
+ },
16
+ schema: []
17
+ },
18
+ create(context) {
19
+ const parserServices = utils_1.ESLintUtils.getParserServices(context);
20
+ return {
21
+ TSArrayType(node) {
22
+ const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.elementType);
23
+ const checker = parserServices.program.getTypeChecker();
24
+ const type = checker.getTypeAtLocation(tsNode);
25
+ const indexType = type.getStringIndexType();
26
+ if (indexType) {
27
+ context.report({
28
+ node,
29
+ messageId: "disallowArrayForObjectType"
30
+ });
31
+ }
32
+ }
33
+ };
34
+ }
35
+ }
36
+ };
37
+ //# sourceMappingURL=eslint.customRule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eslint.customRule.js","sourceRoot":"","sources":["../eslint.customRule.ts"],"names":[],"mappings":";;;AAAA,oDAAiE;AAGpD,QAAA,KAAK,GAAG;IACjB,gCAAgC,EAAE;QAC9B,IAAI,EAAE;YACF,IAAI,EAAE,SAAS;YACf,IAAI,EAAE;gBACF,WAAW,EAAE,iCAAiC;gBAC9C,WAAW,EAAE,KAAK;aACrB;YACD,QAAQ,EAAE;gBACN,0BAA0B,EAAE,uCAAuC;aACtE;YACD,MAAM,EAAE,EAAE;SACb;QACD,MAAM,CAAC,OAAsD;YACzD,MAAM,cAAc,GAAG,mBAAW,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;YAE9D,OAAO;gBACH,WAAW,CAAC,IAA0B;oBAClC,MAAM,MAAM,GAAG,cAAc,CAAC,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;oBAC1E,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;oBACxD,MAAM,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;oBAE/C,MAAM,SAAS,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;oBAC5C,IAAI,SAAS,EAAE,CAAC;wBACZ,OAAO,CAAC,MAAM,CAAC;4BACX,IAAI;4BACJ,SAAS,EAAE,4BAA4B;yBAC1C,CAAC,CAAC;oBACP,CAAC;gBACL,CAAC;aACJ,CAAC;QACN,CAAC;KACJ;CACJ,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Main.js","sourceRoot":"","sources":["../../src/Main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAA2B;AAGlB,aAHF,iBAAE,CAGE;AADX,mDAAmC"}
@@ -6,71 +6,10 @@ class Manager {
6
6
  isEncoded;
7
7
  requestInterceptor;
8
8
  responseInterceptor;
9
- constructor(baseUrlValue, timeoutValue = 25000, isEncoded = false) {
10
- this.baseUrl = baseUrlValue;
11
- this.timeout = timeoutValue;
12
- this.isEncoded = isEncoded;
13
- this.requestInterceptor = undefined;
14
- this.responseInterceptor = undefined;
15
- }
16
- setRequestInterceptor = (callback) => {
17
- this.requestInterceptor = callback;
18
- };
19
- setResponseInterceptor = (callback) => {
20
- this.responseInterceptor = callback;
21
- };
22
- get = (partialUrl, config) => {
23
- if (this.requestInterceptor) {
24
- config = this.requestInterceptor(config || {});
25
- }
26
- return new Promise((resolve, reject) => {
27
- const fetchConfig = {
28
- ...config,
29
- signal: undefined,
30
- method: "GET",
31
- headers: config.headers
32
- };
33
- if (this.timeout > 0) {
34
- const controller = new AbortController();
35
- setTimeout(() => {
36
- controller.abort();
37
- }, this.timeout);
38
- fetchConfig.signal = controller.signal;
39
- }
40
- fetch(`${this.baseUrl}${partialUrl}`, fetchConfig)
41
- .then((response) => {
42
- if (this.responseInterceptor) {
43
- this.responseInterceptor(response);
44
- }
45
- if (!response.ok) {
46
- reject(new Error(`@cimo/request - Manager.ts - fetch() - Error: Request failed with status ${response.status}`));
47
- }
48
- return response.json();
49
- })
50
- .then((response) => {
51
- resolve(response);
52
- })
53
- .catch((error) => {
54
- reject(error);
55
- });
56
- });
57
- };
58
- post = (partialUrl, config, bodyValue, conversion = false) => {
59
- return this.send("POST", partialUrl, config, bodyValue, conversion);
60
- };
61
- put = (partialUrl, config, bodyValue, conversion = false) => {
62
- return this.send("PUT", partialUrl, config, bodyValue, conversion);
63
- };
64
- patch = (partialUrl, config, bodyValue, conversion = false) => {
65
- return this.send("PATCH", partialUrl, config, bodyValue, conversion);
66
- };
67
- delete = (partialUrl, config, bodyValue, conversion = false) => {
68
- return this.send("DELETE", partialUrl, config, bodyValue, conversion);
69
- };
70
9
  send = (method, partialUrl, config, bodyValue, conversion = false) => {
71
10
  const isFormData = bodyValue instanceof FormData ? true : false;
72
11
  const data = {};
73
- let body = {};
12
+ let body = null;
74
13
  if (conversion && isFormData) {
75
14
  const formData = bodyValue;
76
15
  for (const item of formData) {
@@ -100,7 +39,7 @@ class Manager {
100
39
  config = this.requestInterceptor(config || {});
101
40
  }
102
41
  return new Promise((resolve, reject) => {
103
- const fetchConfig = {
42
+ const fetchConfigObject = {
104
43
  ...config,
105
44
  signal: undefined,
106
45
  method: method,
@@ -112,15 +51,15 @@ class Manager {
112
51
  setTimeout(() => {
113
52
  controller.abort();
114
53
  }, this.timeout);
115
- fetchConfig.signal = controller.signal;
54
+ fetchConfigObject.signal = controller.signal;
116
55
  }
117
- fetch(`${this.baseUrl}${partialUrl}`, fetchConfig)
56
+ fetch(`${this.baseUrl}${partialUrl}`, fetchConfigObject)
118
57
  .then((response) => {
119
58
  if (this.responseInterceptor) {
120
59
  this.responseInterceptor(response);
121
60
  }
122
61
  if (!response.ok) {
123
- reject(new Error(`@cimo/request - Manager.ts - fetch() - Error: Request failed with status ${response.status}`));
62
+ reject(new Error(`@cimo/request - Manager.ts - fetch() => Request failed with status ${response.status}!`));
124
63
  }
125
64
  return response.json();
126
65
  })
@@ -132,6 +71,67 @@ class Manager {
132
71
  });
133
72
  });
134
73
  };
74
+ constructor(baseUrlValue, timeoutValue = 25000, isEncoded = false) {
75
+ this.baseUrl = baseUrlValue;
76
+ this.timeout = timeoutValue;
77
+ this.isEncoded = isEncoded;
78
+ this.requestInterceptor = undefined;
79
+ this.responseInterceptor = undefined;
80
+ }
81
+ setRequestInterceptor = (callback) => {
82
+ this.requestInterceptor = callback;
83
+ };
84
+ setResponseInterceptor = (callback) => {
85
+ this.responseInterceptor = callback;
86
+ };
87
+ get = (partialUrl, config) => {
88
+ if (this.requestInterceptor) {
89
+ config = this.requestInterceptor(config || {});
90
+ }
91
+ return new Promise((resolve, reject) => {
92
+ const fetchConfigObject = {
93
+ ...config,
94
+ signal: undefined,
95
+ method: "GET",
96
+ headers: config.headers
97
+ };
98
+ if (this.timeout > 0) {
99
+ const controller = new AbortController();
100
+ setTimeout(() => {
101
+ controller.abort();
102
+ }, this.timeout);
103
+ fetchConfigObject.signal = controller.signal;
104
+ }
105
+ fetch(`${this.baseUrl}${partialUrl}`, fetchConfigObject)
106
+ .then((response) => {
107
+ if (this.responseInterceptor) {
108
+ this.responseInterceptor(response);
109
+ }
110
+ if (!response.ok) {
111
+ reject(new Error(`@cimo/request - Manager.ts - fetch() => Request failed with status ${response.status}!`));
112
+ }
113
+ return response.json();
114
+ })
115
+ .then((response) => {
116
+ resolve(response);
117
+ })
118
+ .catch((error) => {
119
+ reject(error);
120
+ });
121
+ });
122
+ };
123
+ post = (partialUrl, config, bodyValue, conversion = false) => {
124
+ return this.send("POST", partialUrl, config, bodyValue, conversion);
125
+ };
126
+ put = (partialUrl, config, bodyValue, conversion = false) => {
127
+ return this.send("PUT", partialUrl, config, bodyValue, conversion);
128
+ };
129
+ patch = (partialUrl, config, bodyValue, conversion = false) => {
130
+ return this.send("PATCH", partialUrl, config, bodyValue, conversion);
131
+ };
132
+ delete = (partialUrl, config, bodyValue, conversion = false) => {
133
+ return this.send("DELETE", partialUrl, config, bodyValue, conversion);
134
+ };
135
135
  }
136
136
  exports.default = Manager;
137
137
  //# sourceMappingURL=Manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Manager.js","sourceRoot":"","sources":["../../src/Manager.ts"],"names":[],"mappings":";;AAGA,MAAqB,OAAO;IAChB,OAAO,CAAS;IAChB,OAAO,CAAS;IAChB,SAAS,CAAU;IACnB,kBAAkB,CAAwC;IAC1D,mBAAmB,CAAyC;IAE5D,IAAI,GAAG,CACX,MAAc,EACd,UAAkB,EAClB,MAAmB,EACnB,SAA6C,EAC7C,UAAU,GAAG,KAAK,EACR,EAAE;QACZ,MAAM,UAAU,GAAG,SAAS,YAAY,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;QAEhE,MAAM,IAAI,GAA4B,EAAE,CAAC;QACzC,IAAI,IAAI,GAA6B,IAAI,CAAC;QAE1C,IAAI,UAAU,IAAI,UAAU,EAAE,CAAC;YAC3B,MAAM,QAAQ,GAAG,SAAqB,CAAC;YAEvC,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;gBAC1B,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;YAC5B,CAAC;YAED,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;gBAClB,IAAI,G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":["../eslint.customRule.ts","../global.d.ts","../src/Main.ts","../src/Manager.ts","../src/Model.ts"],"version":"5.7.2"}
@@ -0,0 +1 @@
1
+ {"root":["../eslint.customRule.ts","../global.d.ts"],"version":"5.7.2"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cimo/request",
3
- "version": "1.5.17",
3
+ "version": "1.5.19",
4
4
  "description": "Request api. Light, fast and secure.",
5
5
  "author": "cimo",
6
6
  "license": "MIT",
@@ -10,16 +10,18 @@
10
10
  },
11
11
  "scripts": {
12
12
  "remove_dist": "node -e \"const fs = require('fs'); try{ fs.rmdirSync('./dist/', { recursive: true }) } catch{}; process.exit(0);\"",
13
- "check": "eslint --no-cache --config eslint.config.js --fix",
14
- "build": "npm run remove_dist && npm run check && tsc --build tsconfig.build.json && npm audit",
15
- "pack": "npm run build && npm pack"
13
+ "remove_build": "node -e \"const fs = require('fs'); try{ fs.rmdirSync('./build/', { recursive: true }) } catch{}; process.exit(0);\"",
14
+ "check": "eslint --no-cache --config eslint.config.js",
15
+ "build_tsc": "npm run remove_dist && tsc --build tsconfig.tsc.json && npm run check",
16
+ "build_library": "npm run remove_build && tsc --build tsconfig.json && npm pack && mkdir -p ./build/ && mv *.tgz ./build/",
17
+ "build": "npm audit && npm run build_tsc && npm run build_library"
16
18
  },
17
19
  "dependencies": {},
18
20
  "devDependencies": {
19
21
  "typescript": "5.7.2",
20
- "eslint": "9.17.0",
21
- "@typescript-eslint/parser": "8.18.1",
22
- "@typescript-eslint/eslint-plugin": "8.18.1",
22
+ "eslint": "9.31.0",
23
+ "@typescript-eslint/parser": "8.24.1",
24
+ "@typescript-eslint/eslint-plugin": "8.24.1",
23
25
  "eslint-plugin-prettier": "5.2.1",
24
26
  "globals": "15.13.0",
25
27
  "prettier": "3.4.2",
package/dist/Main.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Main.js","sourceRoot":"","sources":["../src/Main.ts"],"names":[],"mappings":";;;;;;;;;;;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C,MAAM,CAAC;YAC3C,CAAC;YAED,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,UAAU,EAAE,EAAE,WAAW,CAAC;iBAC7C,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;gBACf,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;oBAC3B,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;gBACvC,CAAC;gBAED,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;oBACf,MAAM,CAAC,IAAI,KAAK,CAAC,4EAA4E,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;gBACrH,CAAC;gBAED,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;YAC3B,CAAC,CAAC;iBACD,IAAI,CAAC,CAAC,QAAW,EAAE,EAAE;gBAClB,OAAO,CAAC,QAAQ,CAAC,CAAC;YACtB,CAAC,CAAC;iBACD,KAAK,CAAC,CAAC,KAAY,EAAE,EAAE;gBACpB,MAAM,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACX,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;CACL;AApKD,0BAoKC"}
package/dist/Model.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"Model.js","sourceRoot":"","sources":["../src/Model.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"root":["../src/Main.ts","../src/Manager.ts","../src/Model.ts"],"version":"5.7.2"}
File without changes
File without changes
@@ -4,6 +4,7 @@ export default class Manager {
4
4
  private isEncoded;
5
5
  private requestInterceptor;
6
6
  private responseInterceptor;
7
+ private send;
7
8
  constructor(baseUrlValue: string, timeoutValue?: number, isEncoded?: boolean);
8
9
  setRequestInterceptor: (callback: (config: RequestInit) => RequestInit) => void;
9
10
  setResponseInterceptor: (callback: (response: Response) => void) => void;
@@ -12,5 +13,4 @@ export default class Manager {
12
13
  put: <T>(partialUrl: string, config: RequestInit, bodyValue: Record<string, unknown> | FormData, conversion?: boolean) => Promise<T>;
13
14
  patch: <T>(partialUrl: string, config: RequestInit, bodyValue: Record<string, unknown> | FormData, conversion?: boolean) => Promise<T>;
14
15
  delete: <T>(partialUrl: string, config: RequestInit, bodyValue: Record<string, unknown> | FormData, conversion?: boolean) => Promise<T>;
15
- private send;
16
16
  }
File without changes
File without changes