@commercetools/connect-payments-sdk 0.9.0 → 0.10.0
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @commercetools/connect-payments-sdk
|
|
2
2
|
|
|
3
|
+
## 0.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 766ffd4: Accept manage_project permission when checking the status of the commercetools permissions
|
|
8
|
+
|
|
9
|
+
## 0.9.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 36e1a4b: Updated various dependencies to their latest versions for improved performance and security
|
|
14
|
+
|
|
3
15
|
## 0.9.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -70,7 +70,9 @@ exports.statusHandler = statusHandler;
|
|
|
70
70
|
const healthCheckCommercetoolsPermissions = (opts) => async () => {
|
|
71
71
|
try {
|
|
72
72
|
const token = await opts.ctAuthorizationService.getAccessToken();
|
|
73
|
-
const
|
|
73
|
+
const hasManageProjectPermission = token.scope.split(' ').includes(`manage_project:${opts.projectKey}`);
|
|
74
|
+
const foundAll = hasManageProjectPermission ||
|
|
75
|
+
opts.requiredPermissions.every((currentScope) => token.scope.split(' ').some((scopeInToken) => scopeInToken === `${currentScope}:${opts.projectKey}`));
|
|
74
76
|
if (foundAll) {
|
|
75
77
|
return {
|
|
76
78
|
name: 'commercetools permissions',
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
|
|
2
|
+
import jest from 'eslint-plugin-jest';
|
|
3
|
+
import prettier from 'eslint-plugin-prettier';
|
|
4
|
+
import unusedImports from 'eslint-plugin-unused-imports';
|
|
5
|
+
import globals from 'globals';
|
|
6
|
+
import tsParser from '@typescript-eslint/parser';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
|
+
import js from '@eslint/js';
|
|
10
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
11
|
+
|
|
12
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
const __dirname = path.dirname(__filename);
|
|
14
|
+
const compat = new FlatCompat({
|
|
15
|
+
baseDirectory: __dirname,
|
|
16
|
+
recommendedConfig: js.configs.recommended,
|
|
17
|
+
allConfig: js.configs.all,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default [
|
|
21
|
+
...compat.extends(
|
|
22
|
+
'eslint:recommended',
|
|
23
|
+
'plugin:@typescript-eslint/recommended',
|
|
24
|
+
'prettier',
|
|
25
|
+
'plugin:prettier/recommended',
|
|
26
|
+
),
|
|
27
|
+
{
|
|
28
|
+
plugins: {
|
|
29
|
+
'@typescript-eslint': typescriptEslint,
|
|
30
|
+
jest,
|
|
31
|
+
prettier,
|
|
32
|
+
'unused-imports': unusedImports,
|
|
33
|
+
},
|
|
34
|
+
files: ['*.ts'],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
globals: {
|
|
37
|
+
...globals.node,
|
|
38
|
+
...globals.jest,
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
parser: tsParser,
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
rules: {
|
|
45
|
+
'no-redeclare': ['warn'],
|
|
46
|
+
'no-console': ['error'],
|
|
47
|
+
'no-unused-vars': 'off',
|
|
48
|
+
'no-irregular-whitespace': 'warn',
|
|
49
|
+
'unused-imports/no-unused-imports': 'error',
|
|
50
|
+
|
|
51
|
+
'unused-imports/no-unused-vars': [
|
|
52
|
+
'warn',
|
|
53
|
+
{
|
|
54
|
+
vars: 'all',
|
|
55
|
+
varsIgnorePattern: '^_',
|
|
56
|
+
args: 'after-used',
|
|
57
|
+
argsIgnorePattern: '^_',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
|
|
61
|
+
'@typescript-eslint/no-unused-vars': ['warn'],
|
|
62
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
63
|
+
'@typescript-eslint/no-var-requires': 'off',
|
|
64
|
+
|
|
65
|
+
'sort-imports': [
|
|
66
|
+
'error',
|
|
67
|
+
{
|
|
68
|
+
ignoreCase: true,
|
|
69
|
+
ignoreDeclarationSort: true,
|
|
70
|
+
ignoreMemberSort: false,
|
|
71
|
+
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools/connect-payments-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Payment SDK for commercetools payment connectors",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
],
|
|
16
16
|
"license": "ISC",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@commercetools-backend/loggers": "22.
|
|
19
|
-
"@commercetools/platform-sdk": "7.
|
|
18
|
+
"@commercetools-backend/loggers": "22.32.2",
|
|
19
|
+
"@commercetools/platform-sdk": "7.14.0",
|
|
20
20
|
"@commercetools/sdk-client-v2": "2.5.0",
|
|
21
21
|
"jsonwebtoken": "9.0.2",
|
|
22
22
|
"jwks-rsa": "3.1.0",
|