@mimik/local 7.1.5 → 7.1.7

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
@@ -73,6 +73,14 @@ The same `domainName`/`port` rules as in `mSTConfig.json` apply.
73
73
  "streamNameInfo": "Name of the Kinesis stream for info",
74
74
  "streamNameError": "Name of the Kinesis stream for errors",
75
75
  "streamNameOther": "Name of the Kinesis stream for all other levels"
76
+ "maxEvents": "Number of events buffered before sending to Kinesis",
77
+ "timeout": "Number of minutes before a timeout triggers sending to Kinesis",
78
+ "maxSize": "Maximum size in bytes before sending to Kinesis",
79
+ "maxRetries": "Maximum retries to connect to Kinesis",
80
+ "httpOptions": {
81
+ "socketTimeout": "Socket timeout for the HTTP handler (in millisecond)",
82
+ "connectionTimeout": "Connection timeout for the HTTP handler (in millisecond)",
83
+ }
76
84
  }
77
85
  ```
78
86
 
@@ -83,9 +91,9 @@ The same `domainName`/`port` rules as in `mSTConfig.json` apply.
83
91
  "accessKeyId": "Access key ID for S3",
84
92
  "secretAccessKey": "Secret access key for S3",
85
93
  "bucketname": "Name of the S3 bucket used to store information",
86
- "maxEvents": "Number of events buffered before sending to S3 (integer)",
87
- "timeout": "Number of seconds before a timeout triggers sending to S3 (integer)",
88
- "maxSize": "Maximum size in bytes before sending to S3 (integer)"
94
+ "maxEvents": "Number of events buffered before sending to S3",
95
+ "timeout": "Number of minutes before a timeout triggers sending to S3",
96
+ "maxSize": "Maximum size in bytes before sending to S3"
89
97
  }
90
98
  ```
91
99
 
@@ -111,9 +119,9 @@ The same `domainName`/`port` rules as in `mSTConfig.json` apply.
111
119
  A property may be defined for each `serverType` involved. If the `serverType` does not exist, the `default` entry is used.
112
120
 
113
121
  - for `customerConfig.json`: see `mST` `README.md` file for an example of a customer configuration. This may have to be updated to reflect the new server.
114
- - In the `local` directory under the servers root directory: two files, `start.json` and `testStart.json`, may exist. `start.json` is used when `npm start` is executed; `testStart.json` is used when `npm test` is executed.
115
- If these files dont exist, `example-start.json` is used to create `start.json` and `testStart.json`. Additionally, `example-testStart.json` is used to create `testStart.json`; values in `example-testStart.json` take precedence over values in `example-start.json`.
116
- The configuration of these files depends on the servers configuration parameters.
122
+ - In the `local` directory under the server's root directory: two files, `start.json` and `testStart.json`, may exist. `start.json` is used when `npm start` is executed; `testStart.json` is used when `npm test` is executed.
123
+ If these files don't exist, `example-start.json` is used to create `start.json` and `testStart.json`. Additionally, `example-testStart.json` is used to create `testStart.json`; values in `example-testStart.json` take precedence over values in `example-start.json`.
124
+ The configuration of these files depends on the server's configuration parameters.
117
125
 
118
126
  Example `start.json` for `mIT`:
119
127
  ```javascript
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable import/no-extraneous-dependencies */
2
+ import globals from 'globals';
2
3
  import importPlugin from 'eslint-plugin-import';
3
4
  import js from '@eslint/js';
4
5
  import processDoc from '@mimik/eslint-plugin-document-env';
@@ -10,8 +11,8 @@ const MAX_LINES_IN_FILES = 600;
10
11
  const MAX_LINES_IN_FUNCTION = 150;
11
12
  const MAX_STATEMENTS_IN_FUNCTION = 45;
12
13
  const MIN_KEYS_IN_OBJECT = 10;
13
- const MAX_COMPLEXITY = 30;
14
- const ECMA_VERSION = 2022;
14
+ const MAX_COMPLEXITY = 60;
15
+ const ECMA_VERSION = 'latest';
15
16
  const MAX_DEPTH = 6;
16
17
  const ALLOWED_CONSTANTS = [0, 1, -1];
17
18
 
@@ -29,6 +30,7 @@ export default [
29
30
  languageOptions: {
30
31
  ecmaVersion: ECMA_VERSION,
31
32
  globals: {
33
+ ...globals.nodeBuiltin,
32
34
  console: 'readonly',
33
35
  describe: 'readonly',
34
36
  it: 'readonly',
package/eslint.config.js CHANGED
@@ -1,3 +1,4 @@
1
+ import globals from 'globals';
1
2
  import importPlugin from 'eslint-plugin-import';
2
3
  import js from '@eslint/js';
3
4
  import processDoc from '@mimik/eslint-plugin-document-env';
@@ -10,7 +11,7 @@ const MAX_LINES_IN_FUNCTION = 150;
10
11
  const MAX_STATEMENTS_IN_FUNCTION = 80;
11
12
  const MIN_KEYS_IN_OBJECT = 10;
12
13
  const MAX_COMPLEXITY = 80;
13
- const ECMA_VERSION = 2022;
14
+ const ECMA_VERSION = 'latest';
14
15
  const MAX_DEPTH = 6;
15
16
  const ALLOWED_CONSTANTS = [0, 1, -1];
16
17
 
@@ -28,6 +29,7 @@ export default [
28
29
  languageOptions: {
29
30
  ecmaVersion: ECMA_VERSION,
30
31
  globals: {
32
+ ...globals.nodeBuiltin,
31
33
  console: 'readonly',
32
34
  describe: 'readonly',
33
35
  it: 'readonly',
package/index.js CHANGED
@@ -128,6 +128,14 @@ const getBasePath = apiDef => apiDef.basePath || apiDef.servers[FIRST].url;
128
128
  * "streamNameInfo": "Name of the Kinesis stream for info",
129
129
  * "streamNameError": "Name of the Kinesis stream for errors",
130
130
  * "streamNameOther": "Name of the Kinesis stream for all other levels"
131
+ * "maxEvents": "Number of events buffered before sending to Kinesis",
132
+ * "timeout": "Number of minutes before a timeout triggers sending to Kinesis",
133
+ * "maxSize": "Maximum size in bytes before sending to Kinesis",
134
+ * "maxRetries": "Maximum retries to connect to Kinesis",
135
+ * "httpOptions": {
136
+ * "socketTimeout": "Socket timeout for the HTTP handler (in millisecond)",
137
+ * "connectionTimeout": "Connection timeout for the HTTP handler (in millisecond)",
138
+ * }
131
139
  * }
132
140
  * ```
133
141
  *
@@ -138,9 +146,9 @@ const getBasePath = apiDef => apiDef.basePath || apiDef.servers[FIRST].url;
138
146
  * "accessKeyId": "Access key ID for S3",
139
147
  * "secretAccessKey": "Secret access key for S3",
140
148
  * "bucketname": "Name of the S3 bucket used to store information",
141
- * "maxEvents": "Number of events buffered before sending to S3 (integer)",
142
- * "timeout": "Number of seconds before a timeout triggers sending to S3 (integer)",
143
- * "maxSize": "Maximum size in bytes before sending to S3 (integer)"
149
+ * "maxEvents": "Number of events buffered before sending to S3",
150
+ * "timeout": "Number of minutes before a timeout triggers sending to S3",
151
+ * "maxSize": "Maximum size in bytes before sending to S3"
144
152
  * }
145
153
  * ```
146
154
  *
@@ -166,9 +174,9 @@ const getBasePath = apiDef => apiDef.basePath || apiDef.servers[FIRST].url;
166
174
  * A property may be defined for each `serverType` involved. If the `serverType` does not exist, the `default` entry is used.
167
175
  *
168
176
  * - for `customerConfig.json`: see `mST` `README.md` file for an example of a customer configuration. This may have to be updated to reflect the new server.
169
- * - In the `local` directory under the servers root directory: two files, `start.json` and `testStart.json`, may exist. `start.json` is used when `npm start` is executed; `testStart.json` is used when `npm test` is executed.
170
- * If these files dont exist, `example-start.json` is used to create `start.json` and `testStart.json`. Additionally, `example-testStart.json` is used to create `testStart.json`; values in `example-testStart.json` take precedence over values in `example-start.json`.
171
- * The configuration of these files depends on the servers configuration parameters.
177
+ * - In the `local` directory under the server's root directory: two files, `start.json` and `testStart.json`, may exist. `start.json` is used when `npm start` is executed; `testStart.json` is used when `npm test` is executed.
178
+ * If these files don't exist, `example-start.json` is used to create `start.json` and `testStart.json`. Additionally, `example-testStart.json` is used to create `testStart.json`; values in `example-testStart.json` take precedence over values in `example-start.json`.
179
+ * The configuration of these files depends on the server's configuration parameters.
172
180
  *
173
181
  * Example `start.json` for `mIT`:
174
182
  * ```javascript
package/lib/common.js CHANGED
@@ -4,6 +4,12 @@ import process from 'node:process';
4
4
  const S3_MAX_EVENTS = 10;
5
5
  const S3_TIMEOUT = 1;
6
6
  const S3_MAX_SIZE = 5;
7
+ const KINESIS_MAX_EVENTS = 10;
8
+ const KINESIS_TIMEOUT = 1;
9
+ const KINESIS_MAX_SIZE = 5;
10
+ const KINESIS_MAX_RETRIES = 2;
11
+ const KINESIS_SOCKET_TIMEOUT = 5000;
12
+ const KINESIS_CONNECTION_TIMEOUT = 5000;
7
13
 
8
14
  const DEFAULT_MST_PORT = 8025;
9
15
  const DEFAULT_MIT_PORT = 8050;
@@ -54,21 +60,31 @@ const DEFAULT = {
54
60
  },
55
61
 
56
62
  KINESISLOG: {
57
- region: '--- default region ---',
58
63
  accessKeyId: '--- default accessKey Id',
64
+ region: '--- default region ---',
59
65
  secretAccessKey: '--- default secret accessKey ---',
60
- streamNameInfo: '--- default streamName Info ---',
61
66
  streamNameError: '--- default streamName Error ---',
67
+ streamNameInfo: '--- default streamName Info ---',
62
68
  streamNameOther: '--- default streamName Other ---',
69
+
70
+ httpOptions: {
71
+ socketTimeout: KINESIS_SOCKET_TIMEOUT,
72
+ connectionTimeout: KINESIS_CONNECTION_TIMEOUT,
73
+ },
74
+ maxEvents: KINESIS_MAX_EVENTS,
75
+ maxRetries: KINESIS_MAX_RETRIES,
76
+ maxSize: KINESIS_MAX_SIZE,
77
+ timeout: KINESIS_TIMEOUT,
63
78
  },
64
79
  S3LOG: {
65
- region: '--- default region ---',
80
+ bucketname: '--- default bucketname ---',
66
81
  accessKeyId: '--- default accessKey Id',
82
+ region: '--- default region ---',
67
83
  secretAccessKey: '--- default secret accessKey ---',
68
- bucketname: '--- default bucketname ---',
84
+
69
85
  maxEvents: S3_MAX_EVENTS,
70
- timeout: S3_TIMEOUT,
71
86
  maxSize: S3_MAX_SIZE,
87
+ timeout: S3_TIMEOUT,
72
88
  },
73
89
  SUMOLOG: {
74
90
  default: {
package/lib/helpers.js CHANGED
@@ -123,12 +123,12 @@ const baseUrl = (serverType, regType, config, literal) => {
123
123
  *
124
124
  * @function retrieve
125
125
  * @category sync
126
- * @params {string} regType - Type of registration to be excuted.
126
+ * @params {string} regType - Type of registration to be executed.
127
127
  * @params {PATH<string>} filename - Filename to retrieve. If the filename does not retrieve any file altFilename will be used.
128
128
  * @params options {object} - Options to be added for the retrieval
129
129
  * @return {object} The JSON object contained in the file.
130
130
  *
131
- * The options parameters has the folowing structure:
131
+ * The options parameters has the following structure:
132
132
  *``` javascript
133
133
  * {
134
134
  * sourceFilename: {PATH<string>}, // Source filename to use if altFilename does not retrieve any file.
package/lib/tasks.js CHANGED
@@ -149,8 +149,8 @@ const startSetup = (config, origStart) => {
149
149
  let sumoLog = config.sumoLog[type];
150
150
 
151
151
  if (!sumoLog) {
152
- if (!config.sumoLog.default) exitError(regType, Error(`missing sumologic default config in ${DEFAULT.FILE.sumoLogFile}`));
153
- console.log('- using ' + 'default value'.warn + ' for sumologic');
152
+ if (!config.sumoLog.default) exitError(regType, Error(`missing Sumologic default config in ${DEFAULT.FILE.sumoLogFile}`));
153
+ console.log('- using ' + 'default value'.warn + ' for Sumologic');
154
154
  sumoLog = config.sumoLog.default;
155
155
  }
156
156
  start.SUMO_LOGIC_ENDPOINT ||= sumoLog.url;
@@ -245,7 +245,7 @@ const startSetup = (config, origStart) => {
245
245
  * @function getAPI
246
246
  * @category async
247
247
  * @param {PATH<string>} directory - Directory to store the API file.
248
- * @param {object} swaggerFile - Information from package.swaggeFile.
248
+ * @param {object} swaggerFile - Information from package.swaggerFile.
249
249
  * @param {string} key - `bitbucket` with username password to access the bitbucket account or string to access `swaggerhub`.
250
250
  * .
251
251
  * @return {Promise}.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mimik/local",
3
- "version": "7.1.5",
3
+ "version": "7.1.7",
4
4
  "description": "Local setup configuration for normal and test operation",
5
5
  "main": "./index.js",
6
6
  "type": "module",
@@ -32,23 +32,24 @@
32
32
  "url": "https://bitbucket.org/mimiktech/local"
33
33
  },
34
34
  "dependencies": {
35
- "@eslint/js": "9.37.0",
35
+ "@eslint/js": "9.39.1",
36
36
  "@mimik/eslint-plugin-document-env": "^2.0.8",
37
37
  "@mimik/git-hooks": "^2.0.0",
38
38
  "@mimik/request-helper": "^2.0.2",
39
- "@stylistic/eslint-plugin": "5.4.0",
40
- "axios": "1.12.2",
39
+ "@stylistic/eslint-plugin": "5.6.1",
40
+ "axios": "1.13.2",
41
41
  "bluebird": "3.7.2",
42
42
  "c8": "10.1.3",
43
- "chai": "6.2.0",
43
+ "chai": "6.2.1",
44
44
  "colors": "1.4.0",
45
45
  "comment-json": "4.4.1",
46
- "eslint": "9.37.0",
46
+ "eslint": "9.39.1",
47
47
  "eslint-plugin-import": "2.32.0",
48
+ "globals": "16.5.0",
48
49
  "husky": "9.1.7",
49
50
  "ip": "2.0.1",
50
51
  "js-base64": "3.7.8",
51
- "js-yaml": "4.1.0",
52
+ "js-yaml": "4.1.1",
52
53
  "jsdoc-to-markdown": "9.1.3",
53
54
  "lodash.difference": "4.5.0",
54
55
  "lodash.find": "4.6.0",
@@ -58,12 +59,12 @@
58
59
  "lodash.isobject": "3.0.2",
59
60
  "lodash.split": "4.4.2",
60
61
  "lodash.union": "4.6.0",
61
- "mocha": "11.7.4",
62
+ "mocha": "11.7.5",
62
63
  "mochawesome": "7.1.4",
63
64
  "rewire": "9.0.1",
64
65
  "sinon": "21.0.0",
65
66
  "supertest": "7.1.4",
66
- "swagger-client": "3.35.7",
67
+ "swagger-client": "3.36.0",
67
68
  "uuid": "11.1.0"
68
69
  }
69
70
  }