@tramvai/papi 2.70.1 → 2.72.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/lib/createPapiMethod.es.js +23 -0
- package/lib/createPapiMethod.js +30 -0
- package/lib/index.es.js +1 -23
- package/lib/index.js +7 -25
- package/package.json +4 -5
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const DEFAULT_TIMEOUT = 10000;
|
|
2
|
+
const PAPI_PARAMETERS = '__papi_parameters__';
|
|
3
|
+
const createPapiMethod = (papi) => {
|
|
4
|
+
const result = Object.assign(papi.handler, {
|
|
5
|
+
[PAPI_PARAMETERS]: {
|
|
6
|
+
...papi,
|
|
7
|
+
options: {
|
|
8
|
+
timeout: DEFAULT_TIMEOUT,
|
|
9
|
+
...papi.options,
|
|
10
|
+
},
|
|
11
|
+
method: papi.method || 'all',
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
16
|
+
const getPapiParameters = (papi) => {
|
|
17
|
+
return papi[PAPI_PARAMETERS];
|
|
18
|
+
};
|
|
19
|
+
const isPapiMethod = (papi) => {
|
|
20
|
+
return papi && !!getPapiParameters(papi);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { PAPI_PARAMETERS, createPapiMethod, getPapiParameters, isPapiMethod };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const DEFAULT_TIMEOUT = 10000;
|
|
6
|
+
const PAPI_PARAMETERS = '__papi_parameters__';
|
|
7
|
+
const createPapiMethod = (papi) => {
|
|
8
|
+
const result = Object.assign(papi.handler, {
|
|
9
|
+
[PAPI_PARAMETERS]: {
|
|
10
|
+
...papi,
|
|
11
|
+
options: {
|
|
12
|
+
timeout: DEFAULT_TIMEOUT,
|
|
13
|
+
...papi.options,
|
|
14
|
+
},
|
|
15
|
+
method: papi.method || 'all',
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
return result;
|
|
19
|
+
};
|
|
20
|
+
const getPapiParameters = (papi) => {
|
|
21
|
+
return papi[PAPI_PARAMETERS];
|
|
22
|
+
};
|
|
23
|
+
const isPapiMethod = (papi) => {
|
|
24
|
+
return papi && !!getPapiParameters(papi);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.PAPI_PARAMETERS = PAPI_PARAMETERS;
|
|
28
|
+
exports.createPapiMethod = createPapiMethod;
|
|
29
|
+
exports.getPapiParameters = getPapiParameters;
|
|
30
|
+
exports.isPapiMethod = isPapiMethod;
|
package/lib/index.es.js
CHANGED
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
const PAPI_PARAMETERS = '__papi_parameters__';
|
|
3
|
-
const createPapiMethod = (papi) => {
|
|
4
|
-
const result = Object.assign(papi.handler, {
|
|
5
|
-
[PAPI_PARAMETERS]: {
|
|
6
|
-
...papi,
|
|
7
|
-
options: {
|
|
8
|
-
timeout: DEFAULT_TIMEOUT,
|
|
9
|
-
...papi.options,
|
|
10
|
-
},
|
|
11
|
-
method: papi.method || 'all',
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
return result;
|
|
15
|
-
};
|
|
16
|
-
const getPapiParameters = (papi) => {
|
|
17
|
-
return papi[PAPI_PARAMETERS];
|
|
18
|
-
};
|
|
19
|
-
const isPapiMethod = (papi) => {
|
|
20
|
-
return papi && !!getPapiParameters(papi);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export { PAPI_PARAMETERS, createPapiMethod, getPapiParameters, isPapiMethod };
|
|
1
|
+
export { PAPI_PARAMETERS, createPapiMethod, getPapiParameters, isPapiMethod } from './createPapiMethod.es.js';
|
package/lib/index.js
CHANGED
|
@@ -2,29 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
const PAPI_PARAMETERS = '__papi_parameters__';
|
|
7
|
-
const createPapiMethod = (papi) => {
|
|
8
|
-
const result = Object.assign(papi.handler, {
|
|
9
|
-
[PAPI_PARAMETERS]: {
|
|
10
|
-
...papi,
|
|
11
|
-
options: {
|
|
12
|
-
timeout: DEFAULT_TIMEOUT,
|
|
13
|
-
...papi.options,
|
|
14
|
-
},
|
|
15
|
-
method: papi.method || 'all',
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
return result;
|
|
19
|
-
};
|
|
20
|
-
const getPapiParameters = (papi) => {
|
|
21
|
-
return papi[PAPI_PARAMETERS];
|
|
22
|
-
};
|
|
23
|
-
const isPapiMethod = (papi) => {
|
|
24
|
-
return papi && !!getPapiParameters(papi);
|
|
25
|
-
};
|
|
5
|
+
var createPapiMethod = require('./createPapiMethod.js');
|
|
26
6
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.PAPI_PARAMETERS = createPapiMethod.PAPI_PARAMETERS;
|
|
10
|
+
exports.createPapiMethod = createPapiMethod.createPapiMethod;
|
|
11
|
+
exports.getPapiParameters = createPapiMethod.getPapiParameters;
|
|
12
|
+
exports.isPapiMethod = createPapiMethod.isPapiMethod;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/papi",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.72.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -13,12 +13,11 @@
|
|
|
13
13
|
"url": "git@github.com:Tinkoff/tramvai.git"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "tramvai-build --
|
|
17
|
-
"watch": "tsc -w"
|
|
18
|
-
"build-for-publish": "true"
|
|
16
|
+
"build": "tramvai-build --forPublish --preserveModules",
|
|
17
|
+
"watch": "tsc -w"
|
|
19
18
|
},
|
|
20
19
|
"dependencies": {
|
|
21
|
-
"@tinkoff/url": "0.8.
|
|
20
|
+
"@tinkoff/url": "0.8.5",
|
|
22
21
|
"@tinkoff/utils": "^2.1.2",
|
|
23
22
|
"tslib": "^2.4.0"
|
|
24
23
|
},
|