@nomalism-com/api 0.8.243 → 0.8.244

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.
@@ -1,4 +1,38 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ var desc = Object.getOwnPropertyDescriptor(m, k);
16
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
17
+ desc = { enumerable: true, get: function() { return m[k]; } };
18
+ }
19
+ Object.defineProperty(o, k2, desc);
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
25
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
26
+ }) : function(o, v) {
27
+ o["default"] = v;
28
+ });
29
+ var __importStar = (this && this.__importStar) || function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
2
36
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
37
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
38
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -35,12 +69,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
69
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
70
  }
37
71
  };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
72
  Object.defineProperty(exports, "__esModule", { value: true });
42
73
  exports.create = exports.getUrl = exports.publicRoute = exports.route = void 0;
43
- var client_1 = __importDefault(require("../../shared/client"));
74
+ var client_1 = __importStar(require("../../shared/client"));
44
75
  var _1 = require(".");
45
76
  exports.route = "".concat(_1.serviceHostname).concat(_1.serviceAuthPath);
46
77
  exports.publicRoute = "".concat(_1.serviceHostname).concat(_1.servicePublicPath);
@@ -58,7 +89,7 @@ var repository = {
58
89
  return __generator(this, function (_a) {
59
90
  switch (_a.label) {
60
91
  case 0: return [4, client_1.default.post("".concat(exports.route, "multimedia/upload"), multipartFormData, {
61
- headers: headers || { 'content-type': 'multipart/form-data' },
92
+ headers: __assign(__assign(__assign({}, (headers || {})), client_1.defaultHeaders), { 'content-type': 'multipart/form-data' }),
62
93
  })];
63
94
  case 1:
64
95
  response = _a.sent();
@@ -1,4 +1,7 @@
1
1
  export declare const processEnvironment: string;
2
2
  export declare const REACT_APP_API_GATEWAY_URL: string | undefined;
3
+ export declare const defaultHeaders: {
4
+ apikey: string;
5
+ } | undefined;
3
6
  declare const _default: import("axios").AxiosInstance;
4
7
  export default _default;
@@ -1,20 +1,9 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
4
  };
16
5
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.REACT_APP_API_GATEWAY_URL = exports.processEnvironment = void 0;
6
+ exports.defaultHeaders = exports.REACT_APP_API_GATEWAY_URL = exports.processEnvironment = void 0;
18
7
  var axios_1 = __importDefault(require("axios"));
19
8
  exports.processEnvironment = process.env.REACT_APP_ENV || process.env.NODE_ENV || 'localhost';
20
9
  var PROCESS_REACT_APP_API_GATEWAY_URL = {
@@ -24,10 +13,12 @@ var PROCESS_REACT_APP_API_GATEWAY_URL = {
24
13
  localhost: 'localhost',
25
14
  };
26
15
  exports.REACT_APP_API_GATEWAY_URL = PROCESS_REACT_APP_API_GATEWAY_URL[exports.processEnvironment];
27
- exports.default = axios_1.default.create(__assign({ baseURL: exports.REACT_APP_API_GATEWAY_URL }, (process.env.REACT_APP_API_KEY
16
+ exports.defaultHeaders = process.env.REACT_APP_API_KEY
28
17
  ? {
29
- headers: {
30
- apikey: process.env.REACT_APP_API_KEY,
31
- },
18
+ apikey: process.env.REACT_APP_API_KEY,
32
19
  }
33
- : {})));
20
+ : undefined;
21
+ exports.default = axios_1.default.create({
22
+ baseURL: exports.REACT_APP_API_GATEWAY_URL,
23
+ headers: exports.defaultHeaders,
24
+ });
package/package.json CHANGED
@@ -1,53 +1,53 @@
1
- {
2
- "name": "@nomalism-com/api",
3
- "description": "A nomalism API package for performing HTTP requests on API endpoints",
4
- "author": "Nomalism <it.nomalism@gmail.com> (https://https://nomalism.com/)",
5
- "keywords": [
6
- "nomalism",
7
- "api",
8
- "types",
9
- "typescript",
10
- "helper"
11
- ],
12
- "version": "0.8.243",
13
- "main": "dist/index.js",
14
- "types": "./dist/index.d.ts",
15
- "files": [
16
- "dist"
17
- ],
18
- "license": "UNLICENSED",
19
- "homepage": "https://gitlab.com/nomalism-develop/api",
20
- "bugs": {
21
- "url": "https://gitlab.com/nomalism-develop/api/issues"
22
- },
23
- "repository": {
24
- "type": "git",
25
- "url": "git+https://gitlab.com/nomalism-develop/api.git"
26
- },
27
- "scripts": {
28
- "lint": "eslint src --ext .ts,.js --ignore-pattern node_modules --ignore-pattern dist --cache",
29
- "build": "rm -rf dist && tsc --project tsconfig.json",
30
- "start": "tsx --tsconfig ./tsconfig.json src/index.ts",
31
- "prepack": "concurrently --success all \"npm run lint\" \"npm run build\" \"npm run start\""
32
- },
33
- "devDependencies": {
34
- "@types/convert-units": "^2.3.5",
35
- "@types/node": "^18.16.3",
36
- "@typescript-eslint/eslint-plugin": "^5.59.2",
37
- "@typescript-eslint/parser": "^5.59.2",
38
- "concurrently": "^8.0.1",
39
- "eslint": "^8.39.0",
40
- "eslint-config-airbnb-base": "^15.0.0",
41
- "eslint-config-prettier": "^8.8.0",
42
- "eslint-import-resolver-typescript": "^3.5.5",
43
- "eslint-plugin-import": "^2.27.5",
44
- "eslint-plugin-prettier": "^4.2.1",
45
- "prettier": "^2.8.8",
46
- "tsx": "^3.12.7",
47
- "typescript": "^5.0.4"
48
- },
49
- "dependencies": {
50
- "@nomalism-com/types": "^0.9.315",
51
- "axios": "^0.27.2"
52
- }
53
- }
1
+ {
2
+ "name": "@nomalism-com/api",
3
+ "description": "A nomalism API package for performing HTTP requests on API endpoints",
4
+ "author": "Nomalism <it.nomalism@gmail.com> (https://https://nomalism.com/)",
5
+ "keywords": [
6
+ "nomalism",
7
+ "api",
8
+ "types",
9
+ "typescript",
10
+ "helper"
11
+ ],
12
+ "version": "0.8.244",
13
+ "main": "dist/index.js",
14
+ "types": "./dist/index.d.ts",
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "license": "UNLICENSED",
19
+ "homepage": "https://gitlab.com/nomalism-develop/api",
20
+ "bugs": {
21
+ "url": "https://gitlab.com/nomalism-develop/api/issues"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://gitlab.com/nomalism-develop/api.git"
26
+ },
27
+ "scripts": {
28
+ "lint": "eslint src --ext .ts,.js --ignore-pattern node_modules --ignore-pattern dist --cache",
29
+ "build": "rm -rf dist && tsc --project tsconfig.json",
30
+ "start": "tsx --tsconfig ./tsconfig.json src/index.ts",
31
+ "prepack": "concurrently --success all \"npm run lint\" \"npm run build\" \"npm run start\""
32
+ },
33
+ "devDependencies": {
34
+ "@types/convert-units": "^2.3.5",
35
+ "@types/node": "^18.16.3",
36
+ "@typescript-eslint/eslint-plugin": "^5.59.2",
37
+ "@typescript-eslint/parser": "^5.59.2",
38
+ "concurrently": "^8.0.1",
39
+ "eslint": "^8.39.0",
40
+ "eslint-config-airbnb-base": "^15.0.0",
41
+ "eslint-config-prettier": "^8.8.0",
42
+ "eslint-import-resolver-typescript": "^3.5.5",
43
+ "eslint-plugin-import": "^2.27.5",
44
+ "eslint-plugin-prettier": "^4.2.1",
45
+ "prettier": "^2.8.8",
46
+ "tsx": "^3.12.7",
47
+ "typescript": "^5.0.4"
48
+ },
49
+ "dependencies": {
50
+ "@nomalism-com/types": "^0.9.315",
51
+ "axios": "^0.27.2"
52
+ }
53
+ }