@commercetools-frontend/mc-scripts 27.5.3 → 27.6.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/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.dev.js +39 -19
- package/cli/dist/commercetools-frontend-mc-scripts-cli.cjs.prod.js +39 -19
- package/cli/dist/commercetools-frontend-mc-scripts-cli.esm.js +11 -11
- package/dist/{build-BP3m-wjz.cjs.prod.js → build-74ba5097.cjs.prod.js} +23 -23
- package/dist/{build-Dq8dqtsd.cjs.dev.js → build-7c291b9e.cjs.dev.js} +23 -23
- package/dist/{build-GEMI3W9m.esm.js → build-bfc4d2be.esm.js} +7 -7
- package/dist/{build-vite-D67xSRU1.cjs.prod.js → build-vite-73361390.cjs.prod.js} +32 -32
- package/dist/{build-vite-Dxi3rfHf.cjs.dev.js → build-vite-8453739c.cjs.dev.js} +32 -32
- package/dist/{build-vite-CO8mi4hd.esm.js → build-vite-a9c1c374.esm.js} +5 -5
- package/dist/commercetools-frontend-mc-scripts.cjs.dev.js +4 -2
- package/dist/commercetools-frontend-mc-scripts.cjs.prod.js +4 -2
- package/dist/commercetools-frontend-mc-scripts.esm.js +2 -2
- package/dist/{compile-html-BVvy3IQD.esm.js → compile-html-025cd493.esm.js} +2 -2
- package/dist/{compile-html-Ds1YojsY.cjs.dev.js → compile-html-50fd05ec.cjs.prod.js} +8 -8
- package/dist/{compile-html-DZlUpFXg.cjs.prod.js → compile-html-f4ac88cc.cjs.dev.js} +8 -8
- package/dist/{config-sync-D6xLjo9S.cjs.prod.js → config-sync-09f66547.cjs.prod.js} +22 -22
- package/dist/{config-sync-Bu7U5gn5.esm.js → config-sync-15eb8589.esm.js} +5 -5
- package/dist/{config-sync-ci-SDsF-Onw.cjs.dev.js → config-sync-ci-61250b40.cjs.dev.js} +21 -21
- package/dist/{config-sync-ci-CXgQcemF.cjs.prod.js → config-sync-ci-72d17127.cjs.prod.js} +21 -21
- package/dist/{config-sync-ci-Dq7bAqeu.esm.js → config-sync-ci-906ef640.esm.js} +5 -5
- package/dist/{config-sync-Cd0sSSrd.cjs.dev.js → config-sync-fa80ea02.cjs.dev.js} +22 -22
- package/dist/{config-sync-helpers-9kvPwuoy.cjs.prod.js → config-sync-helpers-9e749cc1.cjs.prod.js} +47 -47
- package/dist/{config-sync-helpers-DUK45F_R.cjs.dev.js → config-sync-helpers-f35fab2b.cjs.dev.js} +47 -47
- package/dist/{config-sync-helpers-BLXJp1-D.esm.js → config-sync-helpers-f3861cb3.esm.js} +3 -3
- package/dist/{create-postcss-config-CN9_8Usa.esm.js → create-postcss-config-9f7fc8fe.esm.js} +1 -1
- package/dist/{create-postcss-config-DAShdAyB.cjs.prod.js → create-postcss-config-aa65bd02.cjs.prod.js} +3 -3
- package/dist/{create-postcss-config-NN2FAhvH.cjs.dev.js → create-postcss-config-bda2f46f.cjs.dev.js} +3 -3
- package/dist/{create-webpack-config-for-development-hxSNyq2_.cjs.dev.js → create-webpack-config-for-development-37fd15dd.cjs.dev.js} +25 -25
- package/dist/{create-webpack-config-for-development-CxGehl7I.cjs.prod.js → create-webpack-config-for-development-7f9ac343.cjs.prod.js} +25 -25
- package/dist/{create-webpack-config-for-development-5HpRHV9G.esm.js → create-webpack-config-for-development-cfc8c0d8.esm.js} +5 -5
- package/dist/{create-webpack-config-for-production-BY0UNoNz.esm.js → create-webpack-config-for-production-0ed3db08.esm.js} +5 -5
- package/dist/{create-webpack-config-for-production-CW0DlZBz.cjs.prod.js → create-webpack-config-for-production-c6f5fc5e.cjs.prod.js} +32 -32
- package/dist/{create-webpack-config-for-production-Edp9dzmw.cjs.dev.js → create-webpack-config-for-production-f0692e4f.cjs.dev.js} +32 -32
- package/dist/{credentials-storage-B79bb0Ns.esm.js → credentials-storage-67deadc3.esm.js} +1 -1
- package/dist/{credentials-storage-C3TlK0a8.cjs.prod.js → credentials-storage-ea1c16dc.cjs.prod.js} +10 -10
- package/dist/{credentials-storage-B0tDCH7i.cjs.dev.js → credentials-storage-fd195144.cjs.dev.js} +10 -10
- package/dist/{deployment-previews-set-nvkAPwYw.cjs.prod.js → deployment-previews-set-77a06501.cjs.prod.js} +22 -22
- package/dist/{deployment-previews-set-C2OPIfy-.esm.js → deployment-previews-set-8e17e07a.esm.js} +4 -4
- package/dist/{deployment-previews-set-BuHX8wKo.cjs.dev.js → deployment-previews-set-bfc5a58a.cjs.dev.js} +22 -22
- package/dist/{does-file-exist-DrcZIPe6.cjs.dev.js → does-file-exist-be53305d.cjs.prod.js} +2 -2
- package/dist/{does-file-exist-DrcZIPe6.cjs.prod.js → does-file-exist-eb86baca.cjs.dev.js} +2 -2
- package/dist/{graphql-requests-DCLX_2y0.esm.js → graphql-requests-1afa51b6.esm.js} +4 -4
- package/dist/{graphql-requests-D0rtMo7K.cjs.prod.js → graphql-requests-65332887.cjs.prod.js} +9 -9
- package/dist/{graphql-requests-BeUd4g3v.cjs.dev.js → graphql-requests-8c5aeb2f.cjs.dev.js} +9 -9
- package/dist/{i18n-message-complilation-CdVhuyWk.cjs.dev.js → i18n-message-complilation-7311cb29.cjs.dev.js} +3 -3
- package/dist/{i18n-message-complilation-CdVhuyWk.cjs.prod.js → i18n-message-complilation-7762da61.cjs.prod.js} +3 -3
- package/dist/{login-DKzmRa46.cjs.dev.js → login-3dbe724f.cjs.prod.js} +60 -42
- package/dist/{login-BagHOLO1.cjs.prod.js → login-6bc2696b.cjs.dev.js} +60 -42
- package/dist/{login-DZVfG3Jq.esm.js → login-dbab5c47.esm.js} +3 -3
- package/dist/{optimizations-Cjrg77Gu.esm.js → optimizations-54382f7b.esm.js} +1 -1
- package/dist/{optimizations-CEaq4axa.cjs.dev.js → optimizations-56be74d6.cjs.dev.js} +8 -8
- package/dist/{optimizations-CEaq4axa.cjs.prod.js → optimizations-da5a0cfa.cjs.prod.js} +8 -8
- package/dist/package-7c551972.esm.js +165 -0
- package/dist/package-7fcd7258.cjs.prod.js +167 -0
- package/dist/package-8cf0508d.cjs.dev.js +167 -0
- package/dist/{paths-Cg5Vq6RE.esm.js → paths-39f22b8b.esm.js} +1 -1
- package/dist/{paths-DtvtCG0U.cjs.prod.js → paths-7768b440.cjs.prod.js} +5 -5
- package/dist/{paths-B0WM5jb9.cjs.dev.js → paths-b76fc753.cjs.dev.js} +5 -5
- package/dist/{serve-fXDv4-Pm.esm.js → serve-22475fec.esm.js} +2 -2
- package/dist/{serve-BxRJOSeR.cjs.dev.js → serve-3837602d.cjs.prod.js} +13 -13
- package/dist/{serve-BwNRk6vi.cjs.prod.js → serve-b1c12985.cjs.dev.js} +13 -13
- package/dist/{start-suUcoYml.esm.js → start-5985f6fa.esm.js} +7 -7
- package/dist/{start-OjGog63p.cjs.dev.js → start-633a16e4.cjs.dev.js} +17 -17
- package/dist/{start-CQgQhNhU.cjs.prod.js → start-e7fdfc20.cjs.prod.js} +17 -17
- package/dist/{start-vite-CeaoWKrT.cjs.dev.js → start-vite-068e9f73.cjs.dev.js} +14 -14
- package/dist/{start-vite-Bf9UIg63.cjs.prod.js → start-vite-29078b3a.cjs.prod.js} +14 -14
- package/dist/{start-vite-BOrX5xsW.esm.js → start-vite-7d1161e8.esm.js} +3 -3
- package/dist/{vite-plugin-svgr-CRRIY_Py.cjs.prod.js → vite-plugin-svgr-4034a834.cjs.prod.js} +24 -6
- package/dist/{vite-plugin-svgr-CRRIY_Py.cjs.dev.js → vite-plugin-svgr-7d06f400.cjs.dev.js} +24 -6
- package/package.json +8 -8
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.dev.js +4 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.cjs.prod.js +4 -2
- package/postcss/dist/commercetools-frontend-mc-scripts-postcss.esm.js +2 -2
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.dev.js +10 -8
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.cjs.prod.js +10 -8
- package/webpack/dist/commercetools-frontend-mc-scripts-webpack.esm.js +8 -8
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.dev.js +2 -2
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.cjs.prod.js +2 -2
- package/webpack-loaders/i18n-message-compilation-loader/dist/commercetools-frontend-mc-scripts-webpack-loaders-i18n-message-compilation-loader.esm.js +1 -1
- package/dist/package-B1Y3_DDl.cjs.dev.js +0 -17
- package/dist/package-BiK3ergJ.esm.js +0 -15
- package/dist/package-DxhqRLHb.cjs.prod.js +0 -12
- /package/dist/{does-file-exist-C7l6j7NP.esm.js → does-file-exist-32618334.esm.js} +0 -0
- /package/dist/{i18n-message-complilation-BRZ7ffQI.esm.js → i18n-message-complilation-21d3b0aa.esm.js} +0 -0
- /package/dist/{vendors-to-transpile-DLHlk7c-.cjs.dev.js → vendors-to-transpile-04a49d40.cjs.prod.js} +0 -0
- /package/dist/{vendors-to-transpile-DLHlk7c-.cjs.prod.js → vendors-to-transpile-6ab4ea06.cjs.dev.js} +0 -0
- /package/dist/{vendors-to-transpile-uu9TNPDO.esm.js → vendors-to-transpile-7dc84a72.esm.js} +0 -0
- /package/dist/{vite-plugin-svgr-B1JerYlQ.esm.js → vite-plugin-svgr-de6ee7da.esm.js} +0 -0
|
@@ -15,19 +15,37 @@ var crypto = require('node:crypto');
|
|
|
15
15
|
var process = require('node:process');
|
|
16
16
|
var chalk = require('chalk');
|
|
17
17
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
18
|
-
var _package = require('./package-
|
|
18
|
+
var _package = require('./package-7fcd7258.cjs.prod.js');
|
|
19
19
|
var http = require('node:http');
|
|
20
20
|
var jwtDecode = require('jwt-decode');
|
|
21
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
21
|
+
var credentialsStorage$1 = require('./credentials-storage-ea1c16dc.cjs.prod.js');
|
|
22
22
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
23
23
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
24
24
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
25
25
|
require('node:fs');
|
|
26
26
|
require('node:os');
|
|
27
27
|
require('node:path');
|
|
28
|
-
require('./does-file-exist-
|
|
28
|
+
require('./does-file-exist-be53305d.cjs.prod.js');
|
|
29
29
|
|
|
30
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
31
|
+
|
|
32
|
+
function _interopNamespace(e) {
|
|
33
|
+
if (e && e.__esModule) return e;
|
|
34
|
+
var n = Object.create(null);
|
|
35
|
+
if (e) {
|
|
36
|
+
Object.keys(e).forEach(function (k) {
|
|
37
|
+
if (k !== 'default') {
|
|
38
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
39
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return e[k]; }
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
n["default"] = e;
|
|
47
|
+
return Object.freeze(n);
|
|
48
|
+
}
|
|
31
49
|
|
|
32
50
|
var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
|
|
33
51
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
@@ -47,17 +65,17 @@ var http__default = /*#__PURE__*/_interopDefault(http);
|
|
|
47
65
|
var jwtDecode__default = /*#__PURE__*/_interopDefault(jwtDecode);
|
|
48
66
|
|
|
49
67
|
function createAuthCallbackServer(options) {
|
|
50
|
-
const server = http__default
|
|
68
|
+
const server = http__default["default"].createServer(async (request, response) => {
|
|
51
69
|
try {
|
|
52
70
|
var _context, _context2;
|
|
53
|
-
if (((_context = request.url) == null ? void 0 : _bindInstanceProperty__default
|
|
54
|
-
const incomingUrl = new _URL__default
|
|
71
|
+
if (((_context = request.url) == null ? void 0 : _bindInstanceProperty__default["default"](_context2 = Function.call).call(_context2, _includesInstanceProperty__default["default"](_context), _context))?.(`/${options.clientIdentifier}/oidc/callback`)) {
|
|
72
|
+
const incomingUrl = new _URL__default["default"](request.url, 'http://localhost');
|
|
55
73
|
const sessionToken = incomingUrl.searchParams.get('sessionToken');
|
|
56
74
|
const requestedState = incomingUrl.searchParams.get('state');
|
|
57
75
|
if (!sessionToken) {
|
|
58
76
|
throw new Error('Invalid authentication flow (missing sessionToken)');
|
|
59
77
|
}
|
|
60
|
-
const decodedSessionToken = jwtDecode__default
|
|
78
|
+
const decodedSessionToken = jwtDecode__default["default"](sessionToken);
|
|
61
79
|
if (decodedSessionToken?.nonce !== options.nonce) {
|
|
62
80
|
throw new Error('Invalid authentication flow (nonce mismatch)');
|
|
63
81
|
}
|
|
@@ -97,7 +115,7 @@ const clientIdentifier = `mc-scripts-${_package.pkgJson.version}`;
|
|
|
97
115
|
const isServerError = error => {
|
|
98
116
|
return error instanceof Error && 'code' in error;
|
|
99
117
|
};
|
|
100
|
-
const startServer = server => new _Promise__default
|
|
118
|
+
const startServer = server => new _Promise__default["default"]((resolve, reject) => {
|
|
101
119
|
server.listen(port, 'localhost').on('listening', resolve).on('error', error => {
|
|
102
120
|
if (isServerError(error) && error.code === 'EADDRINUSE') {
|
|
103
121
|
return reject(new Error(`The address "localhost:${port}" is already in use. Are you running a Merchant Center application in other process? Please stop that and try again.`, {
|
|
@@ -108,7 +126,7 @@ const startServer = server => new _Promise__default.default((resolve, reject) =>
|
|
|
108
126
|
cause: error
|
|
109
127
|
}));
|
|
110
128
|
}).on('close', () => {
|
|
111
|
-
process__default
|
|
129
|
+
process__default["default"].exit();
|
|
112
130
|
});
|
|
113
131
|
});
|
|
114
132
|
const resolveMcApiUrl = async options => {
|
|
@@ -117,8 +135,8 @@ const resolveMcApiUrl = async options => {
|
|
|
117
135
|
}
|
|
118
136
|
|
|
119
137
|
// We first check whether the user has set the MC_API_URL environment variable
|
|
120
|
-
if (process__default
|
|
121
|
-
return process__default
|
|
138
|
+
if (process__default["default"].env.MC_API_URL) {
|
|
139
|
+
return process__default["default"].env.MC_API_URL;
|
|
122
140
|
}
|
|
123
141
|
|
|
124
142
|
// If not, we parse the configuration and check if it's defined over there
|
|
@@ -132,8 +150,8 @@ const resolveProjectKey = async options => {
|
|
|
132
150
|
}
|
|
133
151
|
|
|
134
152
|
// We first check whether the user has set the CTP_PROJECT_KEY environment variable
|
|
135
|
-
if (process__default
|
|
136
|
-
return process__default
|
|
153
|
+
if (process__default["default"].env.CTP_PROJECT_KEY) {
|
|
154
|
+
return process__default["default"].env.CTP_PROJECT_KEY;
|
|
137
155
|
}
|
|
138
156
|
try {
|
|
139
157
|
const applicationConfig$1 = await applicationConfig.processConfig();
|
|
@@ -144,22 +162,22 @@ const resolveProjectKey = async options => {
|
|
|
144
162
|
}
|
|
145
163
|
};
|
|
146
164
|
const mapOAuthScopesToClaims = scopes => {
|
|
147
|
-
return _mapInstanceProperty__default
|
|
148
|
-
if (_startsWithInstanceProperty__default
|
|
165
|
+
return _mapInstanceProperty__default["default"](scopes).call(scopes, scope => {
|
|
166
|
+
if (_startsWithInstanceProperty__default["default"](scope).call(scope, 'view_')) {
|
|
149
167
|
return `view:${scope}`;
|
|
150
168
|
}
|
|
151
|
-
if (_startsWithInstanceProperty__default
|
|
169
|
+
if (_startsWithInstanceProperty__default["default"](scope).call(scope, 'manage_')) {
|
|
152
170
|
return `manage:${scope}`;
|
|
153
171
|
}
|
|
154
172
|
return scope;
|
|
155
173
|
});
|
|
156
174
|
};
|
|
157
175
|
const mapAdditionalOAuthScopesToClaims = (name, scopes) => {
|
|
158
|
-
return _mapInstanceProperty__default
|
|
159
|
-
if (_startsWithInstanceProperty__default
|
|
176
|
+
return _mapInstanceProperty__default["default"](scopes).call(scopes, scope => {
|
|
177
|
+
if (_startsWithInstanceProperty__default["default"](scope).call(scope, 'view_')) {
|
|
160
178
|
return `view/${name}:${scope}`;
|
|
161
179
|
}
|
|
162
|
-
if (_startsWithInstanceProperty__default
|
|
180
|
+
if (_startsWithInstanceProperty__default["default"](scope).call(scope, 'manage_')) {
|
|
163
181
|
return `manage/${name}:${scope}`;
|
|
164
182
|
}
|
|
165
183
|
return scope;
|
|
@@ -171,16 +189,16 @@ const resolveOAuthScopes = async options => {
|
|
|
171
189
|
}
|
|
172
190
|
|
|
173
191
|
// We first check whether the user has set the CTP_OAUTH_SCOPES environment variable
|
|
174
|
-
if (process__default
|
|
192
|
+
if (process__default["default"].env.CTP_OAUTH_SCOPES) {
|
|
175
193
|
var _context, _context2;
|
|
176
|
-
return mapOAuthScopesToClaims(((_context = process__default
|
|
194
|
+
return mapOAuthScopesToClaims(((_context = process__default["default"].env.CTP_OAUTH_SCOPES?.split(',')) == null ? void 0 : _bindInstanceProperty__default["default"](_context2 = Function.call).call(_context2, _mapInstanceProperty__default["default"](_context), _context))?.(scope => _trimInstanceProperty__default["default"](scope).call(scope)) ?? []);
|
|
177
195
|
}
|
|
178
196
|
try {
|
|
179
197
|
var _context3, _context4, _context5, _context6;
|
|
180
198
|
const applicationConfig$1 = await applicationConfig.processConfig();
|
|
181
199
|
const configuredOAuthScopes = applicationConfig$1.env.__DEVELOPMENT__?.oidc?.oAuthScopes;
|
|
182
200
|
const configuredAdditionalOAuthScopes = applicationConfig$1.env.__DEVELOPMENT__?.oidc?.additionalOAuthScopes;
|
|
183
|
-
return [...mapOAuthScopesToClaims(configuredOAuthScopes?.view ?? []), ...mapOAuthScopesToClaims(configuredOAuthScopes?.manage ?? []), ...(((_context3 = configuredAdditionalOAuthScopes) == null ? void 0 : _bindInstanceProperty__default
|
|
201
|
+
return [...mapOAuthScopesToClaims(configuredOAuthScopes?.view ?? []), ...mapOAuthScopesToClaims(configuredOAuthScopes?.manage ?? []), ...(((_context3 = configuredAdditionalOAuthScopes) == null ? void 0 : _bindInstanceProperty__default["default"](_context4 = Function.call).call(_context4, _flatMapInstanceProperty__default["default"](_context3), _context3))?.(scope => mapAdditionalOAuthScopesToClaims(scope.name, scope.view)) ?? []), ...(((_context5 = configuredAdditionalOAuthScopes) == null ? void 0 : _bindInstanceProperty__default["default"](_context6 = Function.call).call(_context6, _flatMapInstanceProperty__default["default"](_context5), _context5))?.(scope => mapAdditionalOAuthScopesToClaims(scope.name, scope.manage)) ?? [])];
|
|
184
202
|
} catch (error) {
|
|
185
203
|
// It's ok if there's not application config file or if it does not contain the initialProjectKey
|
|
186
204
|
return [];
|
|
@@ -188,7 +206,7 @@ const resolveOAuthScopes = async options => {
|
|
|
188
206
|
};
|
|
189
207
|
const generateRandomHash = function () {
|
|
190
208
|
let length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 16;
|
|
191
|
-
return crypto__default
|
|
209
|
+
return crypto__default["default"].randomBytes(length).toString('hex');
|
|
192
210
|
};
|
|
193
211
|
|
|
194
212
|
/**
|
|
@@ -196,14 +214,14 @@ const generateRandomHash = function () {
|
|
|
196
214
|
* Requires IDENTITY_EMAIL and IDENTITY_PASSWORD environment variables.
|
|
197
215
|
*/
|
|
198
216
|
async function runHeadlessLogin(authUrl) {
|
|
199
|
-
const email = process__default
|
|
200
|
-
const password = process__default
|
|
217
|
+
const email = process__default["default"].env.IDENTITY_EMAIL;
|
|
218
|
+
const password = process__default["default"].env.IDENTITY_PASSWORD;
|
|
201
219
|
if (!email || !password) {
|
|
202
220
|
throw new Error('Headless login requires IDENTITY_EMAIL and IDENTITY_PASSWORD environment variables');
|
|
203
221
|
}
|
|
204
222
|
let puppeteer;
|
|
205
223
|
try {
|
|
206
|
-
puppeteer = await
|
|
224
|
+
puppeteer = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('puppeteer')); });
|
|
207
225
|
} catch {
|
|
208
226
|
throw new Error('Puppeteer is required for headless login. Install it with: npm install puppeteer');
|
|
209
227
|
}
|
|
@@ -234,14 +252,14 @@ async function runHeadlessLogin(authUrl) {
|
|
|
234
252
|
if (acceptBtn) acceptBtn.click();
|
|
235
253
|
})()
|
|
236
254
|
`);
|
|
237
|
-
await new _Promise__default
|
|
255
|
+
await new _Promise__default["default"](resolve => _setTimeout__default["default"](resolve, 500));
|
|
238
256
|
} catch {
|
|
239
257
|
// Cookie banner not found or already dismissed
|
|
240
258
|
}
|
|
241
259
|
|
|
242
260
|
// Fill in email
|
|
243
261
|
await page.type('input[name="identifier"]', email);
|
|
244
|
-
await new _Promise__default
|
|
262
|
+
await new _Promise__default["default"](resolve => _setTimeout__default["default"](resolve, 500));
|
|
245
263
|
|
|
246
264
|
// Click "Next" button
|
|
247
265
|
await page.evaluate(`
|
|
@@ -262,7 +280,7 @@ async function runHeadlessLogin(authUrl) {
|
|
|
262
280
|
|
|
263
281
|
// Fill in password
|
|
264
282
|
await page.type('input[name="password"]', password);
|
|
265
|
-
await new _Promise__default
|
|
283
|
+
await new _Promise__default["default"](resolve => _setTimeout__default["default"](resolve, 500));
|
|
266
284
|
|
|
267
285
|
// Click "Submit" button
|
|
268
286
|
await page.evaluate(`
|
|
@@ -277,22 +295,22 @@ async function runHeadlessLogin(authUrl) {
|
|
|
277
295
|
|
|
278
296
|
// Wait for the callback to be processed (the server will close and exit)
|
|
279
297
|
// We just need to keep the browser alive until the redirect happens
|
|
280
|
-
const startTime = _Date$now__default
|
|
298
|
+
const startTime = _Date$now__default["default"]();
|
|
281
299
|
const timeout = 60000;
|
|
282
|
-
while (_Date$now__default
|
|
283
|
-
await new _Promise__default
|
|
300
|
+
while (_Date$now__default["default"]() - startTime < timeout) {
|
|
301
|
+
await new _Promise__default["default"](resolve => _setTimeout__default["default"](resolve, 500));
|
|
284
302
|
const currentUrl = page.url();
|
|
285
|
-
if (_includesInstanceProperty__default
|
|
303
|
+
if (_includesInstanceProperty__default["default"](currentUrl).call(currentUrl, 'sessionToken=')) {
|
|
286
304
|
// Token was captured by the callback server, we can exit
|
|
287
305
|
break;
|
|
288
306
|
}
|
|
289
307
|
const pageContent = await page.content();
|
|
290
|
-
if (_includesInstanceProperty__default
|
|
308
|
+
if (_includesInstanceProperty__default["default"](pageContent).call(pageContent, 'Invalid credentials') || _includesInstanceProperty__default["default"](pageContent).call(pageContent, 'invalid_grant')) {
|
|
291
309
|
throw new Error('Invalid credentials');
|
|
292
310
|
}
|
|
293
311
|
|
|
294
312
|
// Check if page shows success (callback server response)
|
|
295
|
-
if (_includesInstanceProperty__default
|
|
313
|
+
if (_includesInstanceProperty__default["default"](pageContent).call(pageContent, 'Success!')) {
|
|
296
314
|
break;
|
|
297
315
|
}
|
|
298
316
|
}
|
|
@@ -305,7 +323,7 @@ async function run(options) {
|
|
|
305
323
|
if (!mcApiUrl) {
|
|
306
324
|
throw new Error('No Merchant Center API URL found. Aborting.');
|
|
307
325
|
}
|
|
308
|
-
console.log(`Using Merchant Center environment "${chalk__default
|
|
326
|
+
console.log(`Using Merchant Center environment "${chalk__default["default"].green(mcApiUrl)}".`);
|
|
309
327
|
console.log();
|
|
310
328
|
if (!options.force && credentialsStorage.isSessionValid(mcApiUrl)) {
|
|
311
329
|
console.log(`You already have a valid session.`);
|
|
@@ -316,13 +334,13 @@ async function run(options) {
|
|
|
316
334
|
const scopes = ['openid'];
|
|
317
335
|
if (projectKey) {
|
|
318
336
|
scopes.push(`project_key:${projectKey}`);
|
|
319
|
-
_forEachInstanceProperty__default
|
|
337
|
+
_forEachInstanceProperty__default["default"](oauthScopes).call(oauthScopes, scope => {
|
|
320
338
|
scopes.push(scope);
|
|
321
339
|
});
|
|
322
340
|
}
|
|
323
341
|
const state = generateRandomHash();
|
|
324
342
|
const nonce = generateRandomHash();
|
|
325
|
-
const authUrl = new _URL__default
|
|
343
|
+
const authUrl = new _URL__default["default"]('/login/authorize', mcApiUrl);
|
|
326
344
|
authUrl.searchParams.set('response_type', 'id_token');
|
|
327
345
|
authUrl.searchParams.set('response_mode', 'query');
|
|
328
346
|
authUrl.searchParams.set('client_id', `__local:${clientIdentifier}`);
|
|
@@ -336,7 +354,7 @@ async function run(options) {
|
|
|
336
354
|
onSuccess: tokenContext => {
|
|
337
355
|
credentialsStorage.setToken(mcApiUrl, tokenContext);
|
|
338
356
|
console.log();
|
|
339
|
-
console.log(chalk__default
|
|
357
|
+
console.log(chalk__default["default"].green(`Login successful.`));
|
|
340
358
|
console.log();
|
|
341
359
|
}
|
|
342
360
|
});
|
|
@@ -349,10 +367,10 @@ async function run(options) {
|
|
|
349
367
|
console.log(`Initiating the OIDC authentication flow, opening the login page in your browser...`);
|
|
350
368
|
console.log(` ${authUrl}`);
|
|
351
369
|
console.log();
|
|
352
|
-
const open = await
|
|
370
|
+
const open = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('open')); });
|
|
353
371
|
await open.default(authUrl.toString());
|
|
354
372
|
console.log('Waiting for the OIDC authentication to complete...');
|
|
355
373
|
}
|
|
356
374
|
}
|
|
357
375
|
|
|
358
|
-
exports
|
|
376
|
+
exports["default"] = run;
|
|
@@ -15,19 +15,37 @@ var crypto = require('node:crypto');
|
|
|
15
15
|
var process = require('node:process');
|
|
16
16
|
var chalk = require('chalk');
|
|
17
17
|
var applicationConfig = require('@commercetools-frontend/application-config');
|
|
18
|
-
var _package = require('./package-
|
|
18
|
+
var _package = require('./package-8cf0508d.cjs.dev.js');
|
|
19
19
|
var http = require('node:http');
|
|
20
20
|
var jwtDecode = require('jwt-decode');
|
|
21
|
-
var credentialsStorage$1 = require('./credentials-storage-
|
|
21
|
+
var credentialsStorage$1 = require('./credentials-storage-fd195144.cjs.dev.js');
|
|
22
22
|
require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
23
23
|
require('@babel/runtime-corejs3/helpers/createClass');
|
|
24
24
|
require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
25
25
|
require('node:fs');
|
|
26
26
|
require('node:os');
|
|
27
27
|
require('node:path');
|
|
28
|
-
require('./does-file-exist-
|
|
28
|
+
require('./does-file-exist-eb86baca.cjs.dev.js');
|
|
29
29
|
|
|
30
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
31
|
+
|
|
32
|
+
function _interopNamespace(e) {
|
|
33
|
+
if (e && e.__esModule) return e;
|
|
34
|
+
var n = Object.create(null);
|
|
35
|
+
if (e) {
|
|
36
|
+
Object.keys(e).forEach(function (k) {
|
|
37
|
+
if (k !== 'default') {
|
|
38
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
39
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () { return e[k]; }
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
n["default"] = e;
|
|
47
|
+
return Object.freeze(n);
|
|
48
|
+
}
|
|
31
49
|
|
|
32
50
|
var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
|
|
33
51
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
@@ -47,17 +65,17 @@ var http__default = /*#__PURE__*/_interopDefault(http);
|
|
|
47
65
|
var jwtDecode__default = /*#__PURE__*/_interopDefault(jwtDecode);
|
|
48
66
|
|
|
49
67
|
function createAuthCallbackServer(options) {
|
|
50
|
-
const server = http__default
|
|
68
|
+
const server = http__default["default"].createServer(async (request, response) => {
|
|
51
69
|
try {
|
|
52
70
|
var _context, _context2;
|
|
53
|
-
if (((_context = request.url) == null ? void 0 : _bindInstanceProperty__default
|
|
54
|
-
const incomingUrl = new _URL__default
|
|
71
|
+
if (((_context = request.url) == null ? void 0 : _bindInstanceProperty__default["default"](_context2 = Function.call).call(_context2, _includesInstanceProperty__default["default"](_context), _context))?.(`/${options.clientIdentifier}/oidc/callback`)) {
|
|
72
|
+
const incomingUrl = new _URL__default["default"](request.url, 'http://localhost');
|
|
55
73
|
const sessionToken = incomingUrl.searchParams.get('sessionToken');
|
|
56
74
|
const requestedState = incomingUrl.searchParams.get('state');
|
|
57
75
|
if (!sessionToken) {
|
|
58
76
|
throw new Error('Invalid authentication flow (missing sessionToken)');
|
|
59
77
|
}
|
|
60
|
-
const decodedSessionToken = jwtDecode__default
|
|
78
|
+
const decodedSessionToken = jwtDecode__default["default"](sessionToken);
|
|
61
79
|
if (decodedSessionToken?.nonce !== options.nonce) {
|
|
62
80
|
throw new Error('Invalid authentication flow (nonce mismatch)');
|
|
63
81
|
}
|
|
@@ -97,7 +115,7 @@ const clientIdentifier = `mc-scripts-${_package.pkgJson.version}`;
|
|
|
97
115
|
const isServerError = error => {
|
|
98
116
|
return error instanceof Error && 'code' in error;
|
|
99
117
|
};
|
|
100
|
-
const startServer = server => new _Promise__default
|
|
118
|
+
const startServer = server => new _Promise__default["default"]((resolve, reject) => {
|
|
101
119
|
server.listen(port, 'localhost').on('listening', resolve).on('error', error => {
|
|
102
120
|
if (isServerError(error) && error.code === 'EADDRINUSE') {
|
|
103
121
|
return reject(new Error(`The address "localhost:${port}" is already in use. Are you running a Merchant Center application in other process? Please stop that and try again.`, {
|
|
@@ -108,7 +126,7 @@ const startServer = server => new _Promise__default.default((resolve, reject) =>
|
|
|
108
126
|
cause: error
|
|
109
127
|
}));
|
|
110
128
|
}).on('close', () => {
|
|
111
|
-
process__default
|
|
129
|
+
process__default["default"].exit();
|
|
112
130
|
});
|
|
113
131
|
});
|
|
114
132
|
const resolveMcApiUrl = async options => {
|
|
@@ -117,8 +135,8 @@ const resolveMcApiUrl = async options => {
|
|
|
117
135
|
}
|
|
118
136
|
|
|
119
137
|
// We first check whether the user has set the MC_API_URL environment variable
|
|
120
|
-
if (process__default
|
|
121
|
-
return process__default
|
|
138
|
+
if (process__default["default"].env.MC_API_URL) {
|
|
139
|
+
return process__default["default"].env.MC_API_URL;
|
|
122
140
|
}
|
|
123
141
|
|
|
124
142
|
// If not, we parse the configuration and check if it's defined over there
|
|
@@ -132,8 +150,8 @@ const resolveProjectKey = async options => {
|
|
|
132
150
|
}
|
|
133
151
|
|
|
134
152
|
// We first check whether the user has set the CTP_PROJECT_KEY environment variable
|
|
135
|
-
if (process__default
|
|
136
|
-
return process__default
|
|
153
|
+
if (process__default["default"].env.CTP_PROJECT_KEY) {
|
|
154
|
+
return process__default["default"].env.CTP_PROJECT_KEY;
|
|
137
155
|
}
|
|
138
156
|
try {
|
|
139
157
|
const applicationConfig$1 = await applicationConfig.processConfig();
|
|
@@ -144,22 +162,22 @@ const resolveProjectKey = async options => {
|
|
|
144
162
|
}
|
|
145
163
|
};
|
|
146
164
|
const mapOAuthScopesToClaims = scopes => {
|
|
147
|
-
return _mapInstanceProperty__default
|
|
148
|
-
if (_startsWithInstanceProperty__default
|
|
165
|
+
return _mapInstanceProperty__default["default"](scopes).call(scopes, scope => {
|
|
166
|
+
if (_startsWithInstanceProperty__default["default"](scope).call(scope, 'view_')) {
|
|
149
167
|
return `view:${scope}`;
|
|
150
168
|
}
|
|
151
|
-
if (_startsWithInstanceProperty__default
|
|
169
|
+
if (_startsWithInstanceProperty__default["default"](scope).call(scope, 'manage_')) {
|
|
152
170
|
return `manage:${scope}`;
|
|
153
171
|
}
|
|
154
172
|
return scope;
|
|
155
173
|
});
|
|
156
174
|
};
|
|
157
175
|
const mapAdditionalOAuthScopesToClaims = (name, scopes) => {
|
|
158
|
-
return _mapInstanceProperty__default
|
|
159
|
-
if (_startsWithInstanceProperty__default
|
|
176
|
+
return _mapInstanceProperty__default["default"](scopes).call(scopes, scope => {
|
|
177
|
+
if (_startsWithInstanceProperty__default["default"](scope).call(scope, 'view_')) {
|
|
160
178
|
return `view/${name}:${scope}`;
|
|
161
179
|
}
|
|
162
|
-
if (_startsWithInstanceProperty__default
|
|
180
|
+
if (_startsWithInstanceProperty__default["default"](scope).call(scope, 'manage_')) {
|
|
163
181
|
return `manage/${name}:${scope}`;
|
|
164
182
|
}
|
|
165
183
|
return scope;
|
|
@@ -171,16 +189,16 @@ const resolveOAuthScopes = async options => {
|
|
|
171
189
|
}
|
|
172
190
|
|
|
173
191
|
// We first check whether the user has set the CTP_OAUTH_SCOPES environment variable
|
|
174
|
-
if (process__default
|
|
192
|
+
if (process__default["default"].env.CTP_OAUTH_SCOPES) {
|
|
175
193
|
var _context, _context2;
|
|
176
|
-
return mapOAuthScopesToClaims(((_context = process__default
|
|
194
|
+
return mapOAuthScopesToClaims(((_context = process__default["default"].env.CTP_OAUTH_SCOPES?.split(',')) == null ? void 0 : _bindInstanceProperty__default["default"](_context2 = Function.call).call(_context2, _mapInstanceProperty__default["default"](_context), _context))?.(scope => _trimInstanceProperty__default["default"](scope).call(scope)) ?? []);
|
|
177
195
|
}
|
|
178
196
|
try {
|
|
179
197
|
var _context3, _context4, _context5, _context6;
|
|
180
198
|
const applicationConfig$1 = await applicationConfig.processConfig();
|
|
181
199
|
const configuredOAuthScopes = applicationConfig$1.env.__DEVELOPMENT__?.oidc?.oAuthScopes;
|
|
182
200
|
const configuredAdditionalOAuthScopes = applicationConfig$1.env.__DEVELOPMENT__?.oidc?.additionalOAuthScopes;
|
|
183
|
-
return [...mapOAuthScopesToClaims(configuredOAuthScopes?.view ?? []), ...mapOAuthScopesToClaims(configuredOAuthScopes?.manage ?? []), ...(((_context3 = configuredAdditionalOAuthScopes) == null ? void 0 : _bindInstanceProperty__default
|
|
201
|
+
return [...mapOAuthScopesToClaims(configuredOAuthScopes?.view ?? []), ...mapOAuthScopesToClaims(configuredOAuthScopes?.manage ?? []), ...(((_context3 = configuredAdditionalOAuthScopes) == null ? void 0 : _bindInstanceProperty__default["default"](_context4 = Function.call).call(_context4, _flatMapInstanceProperty__default["default"](_context3), _context3))?.(scope => mapAdditionalOAuthScopesToClaims(scope.name, scope.view)) ?? []), ...(((_context5 = configuredAdditionalOAuthScopes) == null ? void 0 : _bindInstanceProperty__default["default"](_context6 = Function.call).call(_context6, _flatMapInstanceProperty__default["default"](_context5), _context5))?.(scope => mapAdditionalOAuthScopesToClaims(scope.name, scope.manage)) ?? [])];
|
|
184
202
|
} catch (error) {
|
|
185
203
|
// It's ok if there's not application config file or if it does not contain the initialProjectKey
|
|
186
204
|
return [];
|
|
@@ -188,7 +206,7 @@ const resolveOAuthScopes = async options => {
|
|
|
188
206
|
};
|
|
189
207
|
const generateRandomHash = function () {
|
|
190
208
|
let length = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 16;
|
|
191
|
-
return crypto__default
|
|
209
|
+
return crypto__default["default"].randomBytes(length).toString('hex');
|
|
192
210
|
};
|
|
193
211
|
|
|
194
212
|
/**
|
|
@@ -196,14 +214,14 @@ const generateRandomHash = function () {
|
|
|
196
214
|
* Requires IDENTITY_EMAIL and IDENTITY_PASSWORD environment variables.
|
|
197
215
|
*/
|
|
198
216
|
async function runHeadlessLogin(authUrl) {
|
|
199
|
-
const email = process__default
|
|
200
|
-
const password = process__default
|
|
217
|
+
const email = process__default["default"].env.IDENTITY_EMAIL;
|
|
218
|
+
const password = process__default["default"].env.IDENTITY_PASSWORD;
|
|
201
219
|
if (!email || !password) {
|
|
202
220
|
throw new Error('Headless login requires IDENTITY_EMAIL and IDENTITY_PASSWORD environment variables');
|
|
203
221
|
}
|
|
204
222
|
let puppeteer;
|
|
205
223
|
try {
|
|
206
|
-
puppeteer = await
|
|
224
|
+
puppeteer = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('puppeteer')); });
|
|
207
225
|
} catch {
|
|
208
226
|
throw new Error('Puppeteer is required for headless login. Install it with: npm install puppeteer');
|
|
209
227
|
}
|
|
@@ -234,14 +252,14 @@ async function runHeadlessLogin(authUrl) {
|
|
|
234
252
|
if (acceptBtn) acceptBtn.click();
|
|
235
253
|
})()
|
|
236
254
|
`);
|
|
237
|
-
await new _Promise__default
|
|
255
|
+
await new _Promise__default["default"](resolve => _setTimeout__default["default"](resolve, 500));
|
|
238
256
|
} catch {
|
|
239
257
|
// Cookie banner not found or already dismissed
|
|
240
258
|
}
|
|
241
259
|
|
|
242
260
|
// Fill in email
|
|
243
261
|
await page.type('input[name="identifier"]', email);
|
|
244
|
-
await new _Promise__default
|
|
262
|
+
await new _Promise__default["default"](resolve => _setTimeout__default["default"](resolve, 500));
|
|
245
263
|
|
|
246
264
|
// Click "Next" button
|
|
247
265
|
await page.evaluate(`
|
|
@@ -262,7 +280,7 @@ async function runHeadlessLogin(authUrl) {
|
|
|
262
280
|
|
|
263
281
|
// Fill in password
|
|
264
282
|
await page.type('input[name="password"]', password);
|
|
265
|
-
await new _Promise__default
|
|
283
|
+
await new _Promise__default["default"](resolve => _setTimeout__default["default"](resolve, 500));
|
|
266
284
|
|
|
267
285
|
// Click "Submit" button
|
|
268
286
|
await page.evaluate(`
|
|
@@ -277,22 +295,22 @@ async function runHeadlessLogin(authUrl) {
|
|
|
277
295
|
|
|
278
296
|
// Wait for the callback to be processed (the server will close and exit)
|
|
279
297
|
// We just need to keep the browser alive until the redirect happens
|
|
280
|
-
const startTime = _Date$now__default
|
|
298
|
+
const startTime = _Date$now__default["default"]();
|
|
281
299
|
const timeout = 60000;
|
|
282
|
-
while (_Date$now__default
|
|
283
|
-
await new _Promise__default
|
|
300
|
+
while (_Date$now__default["default"]() - startTime < timeout) {
|
|
301
|
+
await new _Promise__default["default"](resolve => _setTimeout__default["default"](resolve, 500));
|
|
284
302
|
const currentUrl = page.url();
|
|
285
|
-
if (_includesInstanceProperty__default
|
|
303
|
+
if (_includesInstanceProperty__default["default"](currentUrl).call(currentUrl, 'sessionToken=')) {
|
|
286
304
|
// Token was captured by the callback server, we can exit
|
|
287
305
|
break;
|
|
288
306
|
}
|
|
289
307
|
const pageContent = await page.content();
|
|
290
|
-
if (_includesInstanceProperty__default
|
|
308
|
+
if (_includesInstanceProperty__default["default"](pageContent).call(pageContent, 'Invalid credentials') || _includesInstanceProperty__default["default"](pageContent).call(pageContent, 'invalid_grant')) {
|
|
291
309
|
throw new Error('Invalid credentials');
|
|
292
310
|
}
|
|
293
311
|
|
|
294
312
|
// Check if page shows success (callback server response)
|
|
295
|
-
if (_includesInstanceProperty__default
|
|
313
|
+
if (_includesInstanceProperty__default["default"](pageContent).call(pageContent, 'Success!')) {
|
|
296
314
|
break;
|
|
297
315
|
}
|
|
298
316
|
}
|
|
@@ -305,7 +323,7 @@ async function run(options) {
|
|
|
305
323
|
if (!mcApiUrl) {
|
|
306
324
|
throw new Error('No Merchant Center API URL found. Aborting.');
|
|
307
325
|
}
|
|
308
|
-
console.log(`Using Merchant Center environment "${chalk__default
|
|
326
|
+
console.log(`Using Merchant Center environment "${chalk__default["default"].green(mcApiUrl)}".`);
|
|
309
327
|
console.log();
|
|
310
328
|
if (!options.force && credentialsStorage.isSessionValid(mcApiUrl)) {
|
|
311
329
|
console.log(`You already have a valid session.`);
|
|
@@ -316,13 +334,13 @@ async function run(options) {
|
|
|
316
334
|
const scopes = ['openid'];
|
|
317
335
|
if (projectKey) {
|
|
318
336
|
scopes.push(`project_key:${projectKey}`);
|
|
319
|
-
_forEachInstanceProperty__default
|
|
337
|
+
_forEachInstanceProperty__default["default"](oauthScopes).call(oauthScopes, scope => {
|
|
320
338
|
scopes.push(scope);
|
|
321
339
|
});
|
|
322
340
|
}
|
|
323
341
|
const state = generateRandomHash();
|
|
324
342
|
const nonce = generateRandomHash();
|
|
325
|
-
const authUrl = new _URL__default
|
|
343
|
+
const authUrl = new _URL__default["default"]('/login/authorize', mcApiUrl);
|
|
326
344
|
authUrl.searchParams.set('response_type', 'id_token');
|
|
327
345
|
authUrl.searchParams.set('response_mode', 'query');
|
|
328
346
|
authUrl.searchParams.set('client_id', `__local:${clientIdentifier}`);
|
|
@@ -336,7 +354,7 @@ async function run(options) {
|
|
|
336
354
|
onSuccess: tokenContext => {
|
|
337
355
|
credentialsStorage.setToken(mcApiUrl, tokenContext);
|
|
338
356
|
console.log();
|
|
339
|
-
console.log(chalk__default
|
|
357
|
+
console.log(chalk__default["default"].green(`Login successful.`));
|
|
340
358
|
console.log();
|
|
341
359
|
}
|
|
342
360
|
});
|
|
@@ -349,10 +367,10 @@ async function run(options) {
|
|
|
349
367
|
console.log(`Initiating the OIDC authentication flow, opening the login page in your browser...`);
|
|
350
368
|
console.log(` ${authUrl}`);
|
|
351
369
|
console.log();
|
|
352
|
-
const open = await
|
|
370
|
+
const open = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('open')); });
|
|
353
371
|
await open.default(authUrl.toString());
|
|
354
372
|
console.log('Waiting for the OIDC authentication to complete...');
|
|
355
373
|
}
|
|
356
374
|
}
|
|
357
375
|
|
|
358
|
-
exports
|
|
376
|
+
exports["default"] = run;
|
|
@@ -13,17 +13,17 @@ import crypto from 'node:crypto';
|
|
|
13
13
|
import process, { exit } from 'node:process';
|
|
14
14
|
import chalk from 'chalk';
|
|
15
15
|
import { processConfig } from '@commercetools-frontend/application-config';
|
|
16
|
-
import { p as pkgJson } from './package-
|
|
16
|
+
import { p as pkgJson } from './package-7c551972.esm.js';
|
|
17
17
|
import http from 'node:http';
|
|
18
18
|
import jwtDecode from 'jwt-decode';
|
|
19
|
-
import { C as CredentialsStorage } from './credentials-storage-
|
|
19
|
+
import { C as CredentialsStorage } from './credentials-storage-67deadc3.esm.js';
|
|
20
20
|
import '@babel/runtime-corejs3/helpers/classCallCheck';
|
|
21
21
|
import '@babel/runtime-corejs3/helpers/createClass';
|
|
22
22
|
import '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
23
23
|
import 'node:fs';
|
|
24
24
|
import 'node:os';
|
|
25
25
|
import 'node:path';
|
|
26
|
-
import './does-file-exist-
|
|
26
|
+
import './does-file-exist-32618334.esm.js';
|
|
27
27
|
|
|
28
28
|
function createAuthCallbackServer(options) {
|
|
29
29
|
const server = http.createServer(async (request, response) => {
|
|
@@ -26,7 +26,7 @@ function hasJsxRuntime() {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(t),
|
|
29
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30
30
|
|
|
31
31
|
// Dependencies to be split/grouped into separate chunks for the Webpack build.
|
|
32
32
|
// This is useful to reduce the main bundle size and have more dedicated
|