zcatalyst-cli 1.12.1 → 1.13.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/lib/apig-utils.js +39 -39
- package/lib/archiver.js +13 -9
- package/lib/authentication/index.js +22 -18
- package/lib/authentication/login.js +32 -32
- package/lib/bin/catalyst.js +15 -15
- package/lib/cli_table/src/cell.js +26 -26
- package/lib/cli_table/src/layout-manager.js +44 -45
- package/lib/cli_table/src/table.js +9 -9
- package/lib/cli_table/src/utils.js +35 -36
- package/lib/client-utils.js +18 -18
- package/lib/client.js +1 -1
- package/lib/command_needs/auth.js +7 -7
- package/lib/command_needs/rc.js +24 -24
- package/lib/commands/apig/disable.js +5 -5
- package/lib/commands/apig/enable.js +5 -5
- package/lib/commands/apig/status.js +9 -9
- package/lib/commands/client/delete.js +18 -18
- package/lib/commands/client/setup.js +8 -4
- package/lib/commands/deploy.js +18 -14
- package/lib/commands/ds/export.js +11 -11
- package/lib/commands/ds/import.js +12 -12
- package/lib/commands/ds/status.js +10 -10
- package/lib/commands/event/generate/index.js +21 -17
- package/lib/commands/event/generate/integ.js +7 -3
- package/lib/commands/functions/add.js +8 -4
- package/lib/commands/functions/config.js +5 -5
- package/lib/commands/functions/delete.js +20 -20
- package/lib/commands/functions/setup.js +8 -4
- package/lib/commands/functions/shell.js +7 -3
- package/lib/commands/help.js +4 -4
- package/lib/commands/iac/export.js +8 -8
- package/lib/commands/iac/import.js +23 -19
- package/lib/commands/iac/pack.js +15 -11
- package/lib/commands/iac/status.js +6 -2
- package/lib/commands/index.js +5 -1
- package/lib/commands/init.js +14 -10
- package/lib/commands/login.js +5 -1
- package/lib/commands/logout.js +5 -1
- package/lib/commands/project/list.js +14 -10
- package/lib/commands/project/reset.js +5 -5
- package/lib/commands/project/use.js +9 -9
- package/lib/commands/pull.js +18 -14
- package/lib/commands/run.js +13 -9
- package/lib/commands/serve.js +5 -1
- package/lib/commands/token/generate.js +6 -2
- package/lib/commands/token/list.js +7 -3
- package/lib/commands/token/revoke.js +6 -2
- package/lib/commands/whoami.js +3 -3
- package/lib/dc.js +2 -2
- package/lib/deploy/features/apig.js +6 -6
- package/lib/deploy/features/client.js +1 -1
- package/lib/deploy/features/functions/index.js +9 -9
- package/lib/deploy/features/index.js +5 -1
- package/lib/deploy/index.js +2 -2
- package/lib/endpoints/index.js +17 -13
- package/lib/endpoints/lib/apig.js +5 -5
- package/lib/endpoints/lib/applogic.js +4 -4
- package/lib/endpoints/lib/cache.js +3 -3
- package/lib/endpoints/lib/catalyst-details.js +1 -1
- package/lib/endpoints/lib/client.js +5 -5
- package/lib/endpoints/lib/datastore.js +2 -2
- package/lib/endpoints/lib/ds-bulk.js +5 -5
- package/lib/endpoints/lib/env.js +1 -1
- package/lib/endpoints/lib/event-bus.js +1 -1
- package/lib/endpoints/lib/filestore.js +2 -2
- package/lib/endpoints/lib/functions.js +4 -4
- package/lib/endpoints/lib/iac.js +10 -10
- package/lib/endpoints/lib/project.js +20 -5
- package/lib/endpoints/lib/queue.js +3 -3
- package/lib/endpoints/lib/sdk.js +1 -1
- package/lib/endpoints/lib/zcql.js +1 -1
- package/lib/error.js +1 -1
- package/lib/errorOut.js +2 -2
- package/lib/event_generate/cache.js +5 -5
- package/lib/event_generate/custom.js +2 -2
- package/lib/event_generate/datastore.js +5 -5
- package/lib/event_generate/filestore.js +5 -5
- package/lib/event_generate/integration/cliq.js +3 -3
- package/lib/event_generate/user.js +1 -1
- package/lib/event_generate/webapp.js +5 -5
- package/lib/execute-script.js +19 -15
- package/lib/express_middlewares/authenticator.js +32 -5
- package/lib/express_middlewares/logger.js +2 -2
- package/lib/express_middlewares/unknownReqProxy.js +1 -1
- package/lib/fn-utils/index.js +5 -1
- package/lib/fn-utils/lib/common.js +44 -44
- package/lib/fn-utils/lib/integ.js +9 -9
- package/lib/fn-utils/lib/java.js +46 -46
- package/lib/fn-utils/lib/node.js +7 -7
- package/lib/fn-watcher.js +9 -11
- package/lib/iac/status/bundle.js +5 -5
- package/lib/iac/status/deploy.js +4 -4
- package/lib/index.js +2 -2
- package/lib/init/dependencies/npm-install.js +1 -1
- package/lib/init/dependencies/package-json.js +6 -6
- package/lib/init/features/client/index.js +5 -1
- package/lib/init/features/client/initializers/angular.js +16 -12
- package/lib/init/features/client/initializers/basic.js +10 -6
- package/lib/init/features/client/initializers/lyte.js +11 -7
- package/lib/init/features/client/initializers/react.js +13 -9
- package/lib/init/features/functions/index.js +9 -9
- package/lib/init/features/functions/languages/java.js +10 -10
- package/lib/init/features/functions/languages/node.js +9 -9
- package/lib/init/features/index.js +12 -8
- package/lib/init/features/project.js +20 -20
- package/lib/init/index.js +2 -2
- package/lib/init/util/client.js +7 -3
- package/lib/init/util/functions.js +1 -1
- package/lib/init/util/project.js +4 -4
- package/lib/internal/api.js +19 -19
- package/lib/internal/command.js +20 -16
- package/lib/internal/config.js +5 -5
- package/lib/internal/credential.js +10 -10
- package/lib/internal/crypt.js +5 -5
- package/lib/internal/rc.js +5 -5
- package/lib/migration/global/1.6.2.js +3 -3
- package/lib/migration/index.js +22 -18
- package/lib/option-filter.js +34 -30
- package/lib/optional-import.js +12 -8
- package/lib/plugin-loader.js +7 -3
- package/lib/port-resolver.js +4 -4
- package/lib/progress.js +2 -2
- package/lib/prompt/index.js +5 -1
- package/lib/prompt/types/file-path.js +1 -1
- package/lib/pull/features/apig.js +9 -9
- package/lib/pull/features/client.js +7 -7
- package/lib/pull/features/functions/index.js +14 -14
- package/lib/pull/features/index.js +5 -1
- package/lib/pull/index.js +4 -4
- package/lib/repl-server.js +2 -2
- package/lib/serve/features/apig.js +1 -1
- package/lib/serve/features/index.js +8 -4
- package/lib/serve/index.js +15 -11
- package/lib/serve/server/index.js +34 -27
- package/lib/serve/server/lib/java/JavaaioServer.java +2 -1
- package/lib/serve/server/lib/java/lib/catalyst-cli-java-runtime-1.0.0.jar +0 -0
- package/lib/serve/server/lib/java/lib/catalyst-java-runtime-1.0.0.jar +0 -0
- package/lib/serve/server/lib/java/lib/zip4j-2.5.0.jar +0 -0
- package/lib/serve/server/lib/master.js +26 -15
- package/lib/serve/server/lib/node.js +7 -3
- package/lib/serve/server/lib/web_client/index.js +3 -3
- package/lib/serve/server/lib/web_client/server.js +17 -17
- package/lib/shell/dependencies/http-functions.js +38 -33
- package/lib/shell/dependencies/invoker/bio/java/JavabioInvoker.java +7 -2
- package/lib/shell/dependencies/invoker/cron/java/JavacronInvoker.java +7 -2
- package/lib/shell/dependencies/invoker/event/java/JavaeventInvoker.java +7 -2
- package/lib/shell/dependencies/invoker/integ/java/JavaintegInvoker.java +7 -2
- package/lib/shell/dependencies/invoker/integ/node.js +8 -4
- package/lib/shell/dependencies/local-function.js +44 -40
- package/lib/shell/index.js +12 -12
- package/lib/shell/prepare/index.js +2 -2
- package/lib/shell/prepare/languages/index.js +5 -1
- package/lib/shell/prepare/languages/java.js +1 -1
- package/lib/throbber/index.js +17 -17
- package/lib/throbber/utils.js +9 -9
- package/lib/track.js +7 -7
- package/lib/util_modules/config/index.js +5 -1
- package/lib/util_modules/constants/lib/auth.js +6 -6
- package/lib/util_modules/constants/lib/cliq-handlers.js +2 -2
- package/lib/util_modules/constants/lib/template.js +21 -21
- package/lib/util_modules/constants/lib/urls.js +11 -11
- package/lib/util_modules/context-help.js +15 -15
- package/lib/util_modules/fs/index.js +5 -1
- package/lib/util_modules/fs/lib/async.js +4 -4
- package/lib/util_modules/fs/utils.js +1 -1
- package/lib/util_modules/logger.js +2 -2
- package/lib/util_modules/parser/toml.js +1 -1
- package/lib/util_modules/project.js +6 -6
- package/lib/util_modules/shell.js +4 -4
- package/lib/winston.js +5 -5
- package/package.json +39 -39
- package/scripts/postInstall.js +7 -6
- package/docs/.DS_Store +0 -0
- package/lib/serve/server/lib/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
- package/templates/.DS_Store +0 -0
- package/templates/init/.DS_Store +0 -0
- package/templates/init/client/.DS_Store +0 -0
- package/templates/init/client/react/.DS_Store +0 -0
- package/templates/init/functions/node/integ/cliq/.DS_Store +0 -0
package/lib/endpoints/lib/iac.js
CHANGED
|
@@ -18,8 +18,8 @@ const logger_1 = require("../../util_modules/logger");
|
|
|
18
18
|
const project_1 = require("../../util_modules/project");
|
|
19
19
|
class IacAPI {
|
|
20
20
|
constructor(projectId, opts) {
|
|
21
|
-
this.opts = opts || { env: project_1.getEnvName() };
|
|
22
|
-
this.projectId = projectId || project_1.getProjectId('');
|
|
21
|
+
this.opts = opts || { env: (0, project_1.getEnvName)() };
|
|
22
|
+
this.projectId = projectId || (0, project_1.getProjectId)('');
|
|
23
23
|
}
|
|
24
24
|
deploy(projectName, format, file, schedule = false) {
|
|
25
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -35,7 +35,7 @@ class IacAPI {
|
|
|
35
35
|
if (res.body && res.body.data) {
|
|
36
36
|
return res.body.data;
|
|
37
37
|
}
|
|
38
|
-
logger_1.debug('deploy response from server : ' + JSON.stringify(res.body));
|
|
38
|
+
(0, logger_1.debug)('deploy response from server : ' + JSON.stringify(res.body));
|
|
39
39
|
throw new error_1.default('Server Error: Unexpected Response from server.', { exit: 2 });
|
|
40
40
|
});
|
|
41
41
|
}
|
|
@@ -50,7 +50,7 @@ class IacAPI {
|
|
|
50
50
|
if (res.body && res.body.data) {
|
|
51
51
|
return res.body.data;
|
|
52
52
|
}
|
|
53
|
-
logger_1.debug('bundle response from server : ' + JSON.stringify(res.body));
|
|
53
|
+
(0, logger_1.debug)('bundle response from server : ' + JSON.stringify(res.body));
|
|
54
54
|
throw new error_1.default('Server Error: Unexpected Response from server.', { exit: 2 });
|
|
55
55
|
});
|
|
56
56
|
}
|
|
@@ -60,7 +60,7 @@ class IacAPI {
|
|
|
60
60
|
if (res.body && res.body.data) {
|
|
61
61
|
return res.body.data;
|
|
62
62
|
}
|
|
63
|
-
logger_1.debug('bundle status response from server : ' + JSON.stringify(res.body));
|
|
63
|
+
(0, logger_1.debug)('bundle status response from server : ' + JSON.stringify(res.body));
|
|
64
64
|
throw new error_1.default('Server Error: Unexpected Response from server.', { exit: 2 });
|
|
65
65
|
});
|
|
66
66
|
}
|
|
@@ -78,7 +78,7 @@ class IacAPI {
|
|
|
78
78
|
if (res.body) {
|
|
79
79
|
return res.body;
|
|
80
80
|
}
|
|
81
|
-
logger_1.debug('bundle status response from server : ' + JSON.stringify(res.body));
|
|
81
|
+
(0, logger_1.debug)('bundle status response from server : ' + JSON.stringify(res.body));
|
|
82
82
|
throw new error_1.default('Server Error: Unexpected Response from server.', { exit: 2 });
|
|
83
83
|
});
|
|
84
84
|
}
|
|
@@ -88,7 +88,7 @@ class IacAPI {
|
|
|
88
88
|
if (res.body && res.body.data) {
|
|
89
89
|
return res.body.data;
|
|
90
90
|
}
|
|
91
|
-
logger_1.debug('export response from server : ' + JSON.stringify(res.body));
|
|
91
|
+
(0, logger_1.debug)('export response from server : ' + JSON.stringify(res.body));
|
|
92
92
|
throw new error_1.default('Server Error: Unexpected Response from server.', { exit: 2 });
|
|
93
93
|
});
|
|
94
94
|
}
|
|
@@ -98,7 +98,7 @@ class IacAPI {
|
|
|
98
98
|
if (res.body && res.body.data) {
|
|
99
99
|
return res.body.data;
|
|
100
100
|
}
|
|
101
|
-
logger_1.debug('export response from server : ' + JSON.stringify(res.body));
|
|
101
|
+
(0, logger_1.debug)('export response from server : ' + JSON.stringify(res.body));
|
|
102
102
|
throw new error_1.default('Server Error: Unexpected Response from server.', { exit: 2 });
|
|
103
103
|
});
|
|
104
104
|
}
|
|
@@ -108,7 +108,7 @@ class IacAPI {
|
|
|
108
108
|
if (res.body && res.body.data) {
|
|
109
109
|
return res.body.data;
|
|
110
110
|
}
|
|
111
|
-
logger_1.debug('export response from server : ' + JSON.stringify(res.body));
|
|
111
|
+
(0, logger_1.debug)('export response from server : ' + JSON.stringify(res.body));
|
|
112
112
|
throw new error_1.default('Server Error: Unexpected Response from server.', { exit: 2 });
|
|
113
113
|
});
|
|
114
114
|
}
|
|
@@ -126,7 +126,7 @@ class IacAPI {
|
|
|
126
126
|
if (res.body) {
|
|
127
127
|
return res.body;
|
|
128
128
|
}
|
|
129
|
-
logger_1.debug('export response from server : ' + JSON.stringify(res.body));
|
|
129
|
+
(0, logger_1.debug)('export response from server : ' + JSON.stringify(res.body));
|
|
130
130
|
throw new error_1.default('Server Error: Unexpected Response from server.', { exit: 2 });
|
|
131
131
|
});
|
|
132
132
|
}
|
|
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const error_1 = __importDefault(require("../../error"));
|
|
16
16
|
const api_1 = __importDefault(require("../../internal/api"));
|
|
17
17
|
const logger_1 = require("../../util_modules/logger");
|
|
18
|
-
class
|
|
18
|
+
class ProjectAPI {
|
|
19
19
|
constructor(opts) {
|
|
20
20
|
this.opts = opts;
|
|
21
21
|
}
|
|
@@ -25,7 +25,7 @@ class Project {
|
|
|
25
25
|
if (res.body && res.body.data) {
|
|
26
26
|
return res.body.data;
|
|
27
27
|
}
|
|
28
|
-
logger_1.debug('get project response from server : ' + res.body);
|
|
28
|
+
(0, logger_1.debug)('get project response from server : ' + res.body);
|
|
29
29
|
throw new error_1.default('Server Error: Unexpected Response from server.', {
|
|
30
30
|
exit: 2
|
|
31
31
|
});
|
|
@@ -37,7 +37,7 @@ class Project {
|
|
|
37
37
|
if (res.body && res.body.data) {
|
|
38
38
|
return res.body.data;
|
|
39
39
|
}
|
|
40
|
-
logger_1.debug('get all project response from server : ' + res.body);
|
|
40
|
+
(0, logger_1.debug)('get all project response from server : ' + res.body);
|
|
41
41
|
throw new error_1.default('Server Error: Unexpected Response from server.', {
|
|
42
42
|
exit: 2
|
|
43
43
|
});
|
|
@@ -53,11 +53,26 @@ class Project {
|
|
|
53
53
|
if (res.body && res.body.data) {
|
|
54
54
|
return res.body.data;
|
|
55
55
|
}
|
|
56
|
-
logger_1.debug('create project response from server : ' + res.body);
|
|
56
|
+
(0, logger_1.debug)('create project response from server : ' + res.body);
|
|
57
|
+
throw new error_1.default('Server Error: Unexpected Response from server.', {
|
|
58
|
+
exit: 2
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
getCurrentProjectUser(projectId, headers = {}) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const res = yield new api_1.default(Object.assign(Object.assign({}, this.opts), { headers, authNeeded: false, resolveOnError: true })).get(`/baas/v1/project/${projectId}/project-user/current`);
|
|
65
|
+
if (res.body && res.body.data) {
|
|
66
|
+
if (typeof res.body.data.email_id === 'undefined') {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
return res.body.data;
|
|
70
|
+
}
|
|
71
|
+
(0, logger_1.debug)('get project response from server : ' + res.body);
|
|
57
72
|
throw new error_1.default('Server Error: Unexpected Response from server.', {
|
|
58
73
|
exit: 2
|
|
59
74
|
});
|
|
60
75
|
});
|
|
61
76
|
}
|
|
62
77
|
}
|
|
63
|
-
exports.default =
|
|
78
|
+
exports.default = ProjectAPI;
|
|
@@ -26,7 +26,7 @@ class Queue {
|
|
|
26
26
|
if (res.body && res.body.data) {
|
|
27
27
|
return res.body.data;
|
|
28
28
|
}
|
|
29
|
-
logger_1.debug('get all topics response from server : ' + res.body);
|
|
29
|
+
(0, logger_1.debug)('get all topics response from server : ' + res.body);
|
|
30
30
|
throw new error_1.default('Server Error: Unexpected Response from server.', {
|
|
31
31
|
exit: 2
|
|
32
32
|
});
|
|
@@ -42,7 +42,7 @@ class Queue {
|
|
|
42
42
|
if (res.body && res.body.data) {
|
|
43
43
|
return res.body.data;
|
|
44
44
|
}
|
|
45
|
-
logger_1.debug('produce data to queue response from server : ' + res.body);
|
|
45
|
+
(0, logger_1.debug)('produce data to queue response from server : ' + res.body);
|
|
46
46
|
throw new error_1.default('Server Error: Unexpected Response from server.', {
|
|
47
47
|
exit: 2
|
|
48
48
|
});
|
|
@@ -57,7 +57,7 @@ class Queue {
|
|
|
57
57
|
else if (res.status === 204) {
|
|
58
58
|
return undefined;
|
|
59
59
|
}
|
|
60
|
-
logger_1.debug('consume data from queue response from server : ' + res.body);
|
|
60
|
+
(0, logger_1.debug)('consume data from queue response from server : ' + res.body);
|
|
61
61
|
throw new error_1.default('Server Error: Unexpected Response from server.', {
|
|
62
62
|
exit: 2
|
|
63
63
|
});
|
package/lib/endpoints/lib/sdk.js
CHANGED
|
@@ -44,7 +44,7 @@ class SDK {
|
|
|
44
44
|
if (res.body) {
|
|
45
45
|
return res.body;
|
|
46
46
|
}
|
|
47
|
-
logger_1.debug('java sdk response from server : ' + res.body);
|
|
47
|
+
(0, logger_1.debug)('java sdk response from server : ' + res.body);
|
|
48
48
|
throw new error_1.default('Server Error: Unexpected Response from server.', {
|
|
49
49
|
exit: 2
|
|
50
50
|
});
|
|
@@ -30,7 +30,7 @@ class ZCQL {
|
|
|
30
30
|
if (res.body && res.body.data) {
|
|
31
31
|
return res.body.data;
|
|
32
32
|
}
|
|
33
|
-
logger_1.debug('ZCQL response from server : ' + res.body);
|
|
33
|
+
(0, logger_1.debug)('ZCQL response from server : ' + res.body);
|
|
34
34
|
throw new error_1.default('Server Error: Unexpected Response from server.', {
|
|
35
35
|
exit: 2
|
|
36
36
|
});
|
package/lib/error.js
CHANGED
|
@@ -47,7 +47,7 @@ class CatalystError extends Error {
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
const newError = new CatalystError(message || 'Malformed error', {
|
|
50
|
-
original: util_1.inspect(unknownError),
|
|
50
|
+
original: (0, util_1.inspect)(unknownError),
|
|
51
51
|
skipHelp: skipHelp === undefined ? true : skipHelp
|
|
52
52
|
});
|
|
53
53
|
if (typeof unknownError === 'object') {
|
package/lib/errorOut.js
CHANGED
|
@@ -23,11 +23,11 @@ exports.default = (error, status) => {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
try {
|
|
26
|
-
const exitCode = context_help_1.default();
|
|
26
|
+
const exitCode = (0, context_help_1.default)();
|
|
27
27
|
process.exitCode = typeof exitCode === 'number' ? exitCode : 2;
|
|
28
28
|
}
|
|
29
29
|
catch (err) {
|
|
30
|
-
logger_1.debug('HELP ERROR: ' + err.stack);
|
|
30
|
+
(0, logger_1.debug)('HELP ERROR: ' + err.stack);
|
|
31
31
|
process.exitCode = 2;
|
|
32
32
|
}
|
|
33
33
|
};
|
|
@@ -21,7 +21,7 @@ const js_1 = require("../util_modules/js");
|
|
|
21
21
|
const project_1 = require("../util_modules/project");
|
|
22
22
|
exports.default = (eventJson, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
23
|
const segmentId = options.segment;
|
|
24
|
-
const allSegments = (yield (yield endpoints_1.cacheAPI()).getAllSegments());
|
|
24
|
+
const allSegments = (yield (yield (0, endpoints_1.cacheAPI)()).getAllSegments());
|
|
25
25
|
const selectedSegment = segmentId !== undefined
|
|
26
26
|
? allSegments.find((segment) => segment.segment_name === segmentId || segment.id + '' === segmentId)
|
|
27
27
|
: allSegments.find((segment) => segment.segment_name === 'Default');
|
|
@@ -32,7 +32,7 @@ exports.default = (eventJson, options = {}) => __awaiter(void 0, void 0, void 0,
|
|
|
32
32
|
throw new error_1.default('Unknown segment identifier', {
|
|
33
33
|
exit: 1,
|
|
34
34
|
errorId: 'CACHE-1',
|
|
35
|
-
arg: [ansi_colors_1.bold(segmentId || ''), ansi_colors_1.bold('--segment')]
|
|
35
|
+
arg: [(0, ansi_colors_1.bold)(segmentId || ''), (0, ansi_colors_1.bold)('--segment')]
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
eventJson = eventJson.replace(new RegExp(constants_1.PLACEHOLDER.event_data.source_id, 'g'), selectedSegment.id);
|
|
@@ -41,12 +41,12 @@ exports.default = (eventJson, options = {}) => __awaiter(void 0, void 0, void 0,
|
|
|
41
41
|
cache_name: js_1.JS.randomString(js_1.JS.random(5, 10)),
|
|
42
42
|
cache_value: js_1.JS.randomString(10),
|
|
43
43
|
project_details: {
|
|
44
|
-
id: project_1.getProjectId(),
|
|
45
|
-
project_name: project_1.getProjectName()
|
|
44
|
+
id: (0, project_1.getProjectId)(),
|
|
45
|
+
project_name: (0, project_1.getProjectName)()
|
|
46
46
|
},
|
|
47
47
|
segment_details: selectedSegment,
|
|
48
48
|
expiry_in_hours: expiryInHours,
|
|
49
|
-
expires_in: moment_1.default(moment_1.default.now() + expiryInHours * 60 * 60 * 1000).format('MMM DD, YYYY hh:mm A')
|
|
49
|
+
expires_in: (0, moment_1.default)(moment_1.default.now() + expiryInHours * 60 * 60 * 1000).format('MMM DD, YYYY hh:mm A')
|
|
50
50
|
};
|
|
51
51
|
eventJson = eventJson.replace(new RegExp(constants_1.PLACEHOLDER.event_data.rule_id, 'g'), 'NULL');
|
|
52
52
|
return eventJson.replace(new RegExp(constants_1.PLACEHOLDER.event_data.data, 'g'), JSON.stringify(data));
|
|
@@ -23,12 +23,12 @@ exports.default = (eventJson, options = {}) => __awaiter(void 0, void 0, void 0,
|
|
|
23
23
|
data = js_1.JS.randomString(15);
|
|
24
24
|
}
|
|
25
25
|
eventJson = eventJson.replace(new RegExp(constants_1.PLACEHOLDER.event_data.data, 'g'), JSON.stringify(data));
|
|
26
|
-
const ruleId = option_1.getOptionValue('ruleId', false);
|
|
26
|
+
const ruleId = (0, option_1.getOptionValue)('ruleId', false);
|
|
27
27
|
if (!ruleId) {
|
|
28
28
|
throw new error_1.default('no rule-id provided', {
|
|
29
29
|
exit: 1,
|
|
30
30
|
errorId: 'CUSTOM-1',
|
|
31
|
-
arg: [ansi_colors_1.bold('-rid'), ansi_colors_1.bold('--rule-id')]
|
|
31
|
+
arg: [(0, ansi_colors_1.bold)('-rid'), (0, ansi_colors_1.bold)('--rule-id')]
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
eventJson = eventJson.replace(new RegExp(constants_1.PLACEHOLDER.event_data.source_id, 'g'), 'NULL');
|
|
@@ -23,12 +23,12 @@ exports.default = (eventJson, options = {}) => __awaiter(void 0, void 0, void 0,
|
|
|
23
23
|
const tableId = options.table;
|
|
24
24
|
let columnDetails = constants_1.DEFAULT.datastore.column_details;
|
|
25
25
|
if (tableId !== undefined) {
|
|
26
|
-
columnDetails = (yield (yield endpoints_1.datastoreAPI()).getColumnDetails(tableId).catch((err) => {
|
|
26
|
+
columnDetails = (yield (yield (0, endpoints_1.datastoreAPI)()).getColumnDetails(tableId).catch((err) => {
|
|
27
27
|
if (err.status && err.status === 404) {
|
|
28
28
|
throw new error_1.default('Invalid table identifier', {
|
|
29
29
|
exit: 1,
|
|
30
30
|
errorId: 'DSTORE-1',
|
|
31
|
-
arg: [ansi_colors_1.bold(tableId), ansi_colors_1.bold('--table')]
|
|
31
|
+
arg: [(0, ansi_colors_1.bold)(tableId), (0, ansi_colors_1.bold)('--table')]
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
throw err;
|
|
@@ -54,14 +54,14 @@ exports.default = (eventJson, options = {}) => __awaiter(void 0, void 0, void 0,
|
|
|
54
54
|
accumulator[0][current.column_name] = js_1.JS.randomNumber(15);
|
|
55
55
|
break;
|
|
56
56
|
case 'datetime':
|
|
57
|
-
accumulator[0][current.column_name] = moment_1.default().format('YYYY-MM-DD HH:mm:ss');
|
|
57
|
+
accumulator[0][current.column_name] = (0, moment_1.default)().format('YYYY-MM-DD HH:mm:ss');
|
|
58
58
|
break;
|
|
59
59
|
case 'text':
|
|
60
60
|
case 'varchar':
|
|
61
61
|
accumulator[0][current.column_name] = js_1.JS.randomString(10);
|
|
62
62
|
break;
|
|
63
63
|
case 'date':
|
|
64
|
-
accumulator[0][current.column_name] = moment_1.default().format('YYYY-MM-DD');
|
|
64
|
+
accumulator[0][current.column_name] = (0, moment_1.default)().format('YYYY-MM-DD');
|
|
65
65
|
break;
|
|
66
66
|
case 'boolean':
|
|
67
67
|
accumulator[0][current.column_name] = js_1.JS.random(0, 1) === 1 ? true : false;
|
|
@@ -71,7 +71,7 @@ exports.default = (eventJson, options = {}) => __awaiter(void 0, void 0, void 0,
|
|
|
71
71
|
accumulator[0][current.column_name] = js_1.JS.randomNumber(5);
|
|
72
72
|
break;
|
|
73
73
|
default:
|
|
74
|
-
logger_1.debug('Unknown data_type received: ' + current.data_type);
|
|
74
|
+
(0, logger_1.debug)('Unknown data_type received: ' + current.data_type);
|
|
75
75
|
break;
|
|
76
76
|
}
|
|
77
77
|
return accumulator;
|
|
@@ -22,7 +22,7 @@ const js_1 = require("../util_modules/js");
|
|
|
22
22
|
const project_1 = require("../util_modules/project");
|
|
23
23
|
exports.default = (eventJson, options = {}) => __awaiter(void 0, void 0, void 0, function* () {
|
|
24
24
|
const folderId = options.folder;
|
|
25
|
-
const allFolders = (yield (yield endpoints_1.filestoreAPI()).getAllFolders());
|
|
25
|
+
const allFolders = (yield (yield (0, endpoints_1.filestoreAPI)()).getAllFolders());
|
|
26
26
|
const selectedFolder = folderId !== undefined
|
|
27
27
|
? allFolders.find((folder) => folder.folder_name === folderId || folder.id + '' === folderId)
|
|
28
28
|
: {
|
|
@@ -36,7 +36,7 @@ exports.default = (eventJson, options = {}) => __awaiter(void 0, void 0, void 0,
|
|
|
36
36
|
throw new error_1.default('Invalid folder identifier', {
|
|
37
37
|
exit: 1,
|
|
38
38
|
errorId: 'FSTORE-1',
|
|
39
|
-
arg: [ansi_colors_1.bold('--folder'), ansi_colors_1.bold(allFoldersFormatted)]
|
|
39
|
+
arg: [(0, ansi_colors_1.bold)('--folder'), (0, ansi_colors_1.bold)(allFoldersFormatted)]
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
eventJson = eventJson.replace(new RegExp(constants_1.PLACEHOLDER.event_data.source_id, 'g'), selectedFolder.id);
|
|
@@ -48,11 +48,11 @@ exports.default = (eventJson, options = {}) => __awaiter(void 0, void 0, void 0,
|
|
|
48
48
|
first_name: js_1.JS.randomString(10),
|
|
49
49
|
zuid: js_1.JS.randomNumber(10)
|
|
50
50
|
};
|
|
51
|
-
const time = moment_1.default().format('MMM DD, YYYY hh:mm A');
|
|
51
|
+
const time = (0, moment_1.default)().format('MMM DD, YYYY hh:mm A');
|
|
52
52
|
const data = {
|
|
53
53
|
project_details: {
|
|
54
|
-
id: project_1.getProjectId(),
|
|
55
|
-
project_name: project_1.getProjectName()
|
|
54
|
+
id: (0, project_1.getProjectId)(),
|
|
55
|
+
project_name: (0, project_1.getProjectName)()
|
|
56
56
|
},
|
|
57
57
|
folder_details: selectedFolder.id,
|
|
58
58
|
created_time: time,
|
|
@@ -27,7 +27,7 @@ exports.default = (inputs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
27
27
|
throw new error_1.default('incorrect input for event cliq', {
|
|
28
28
|
exit: 1,
|
|
29
29
|
errorId: 'CLIQ-1',
|
|
30
|
-
arg: [ansi_colors_1.bold('[component-type,handler]')]
|
|
30
|
+
arg: [(0, ansi_colors_1.bold)('[component-type,handler]')]
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
else if (input[0] === '') {
|
|
@@ -67,11 +67,11 @@ exports.default = (inputs) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
67
67
|
throw new error_1.default('invalid input combination', {
|
|
68
68
|
exit: 1,
|
|
69
69
|
errorId: 'CLIQ-2',
|
|
70
|
-
arg: [ansi_colors_1.bold(input[0]), ansi_colors_1.bold.red('X'), ansi_colors_1.bold(input[1]), ansi_colors_1.bold('--inputs')]
|
|
70
|
+
arg: [(0, ansi_colors_1.bold)(input[0]), ansi_colors_1.bold.red('X'), (0, ansi_colors_1.bold)(input[1]), (0, ansi_colors_1.bold)('--inputs')]
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
const filePath = path_1.join(constants_1.CLIQ.event_template_dir, component, handler + '.json');
|
|
74
|
+
const filePath = (0, path_1.join)(constants_1.CLIQ.event_template_dir, component, handler + '.json');
|
|
75
75
|
if (!fs_1.ASYNC.fileExists(filePath)) {
|
|
76
76
|
throw new error_1.default("Couldn't read request template", { exit: 2 });
|
|
77
77
|
}
|
|
@@ -17,7 +17,7 @@ const runtime_store_1 = __importDefault(require("../runtime-store"));
|
|
|
17
17
|
const constants_1 = require("../util_modules/constants");
|
|
18
18
|
const js_1 = require("../util_modules/js");
|
|
19
19
|
exports.default = (eventJson) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
const mockTime = moment_1.default().format('MMM DD, YYYY hh:mm A');
|
|
20
|
+
const mockTime = (0, moment_1.default)().format('MMM DD, YYYY hh:mm A');
|
|
21
21
|
const data = {
|
|
22
22
|
platform_type: null,
|
|
23
23
|
user_details: {
|
|
@@ -19,13 +19,13 @@ const constants_1 = require("../util_modules/constants");
|
|
|
19
19
|
const js_1 = require("../util_modules/js");
|
|
20
20
|
const project_1 = require("../util_modules/project");
|
|
21
21
|
exports.default = (eventJson) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
-
const webappDetails = (yield (yield endpoints_1.clientAPI()).getWebappDetails());
|
|
22
|
+
const webappDetails = (yield (yield (0, endpoints_1.clientAPI)()).getWebappDetails());
|
|
23
23
|
const selectedWebapp = webappDetails !== undefined && Object.keys(webappDetails).length > 0
|
|
24
24
|
? webappDetails
|
|
25
25
|
: {
|
|
26
26
|
app_name: js_1.JS.randomString(js_1.JS.random(5, 10)),
|
|
27
27
|
app_id: js_1.JS.randomNumber(15),
|
|
28
|
-
url_prefix: project_1.getDomainPrefix()
|
|
28
|
+
url_prefix: (0, project_1.getDomainPrefix)()
|
|
29
29
|
};
|
|
30
30
|
const userDetails = {
|
|
31
31
|
email_id: runtime_store_1.default.get('user.Email'),
|
|
@@ -36,10 +36,10 @@ exports.default = (eventJson) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
36
36
|
zuid: js_1.JS.randomNumber(10)
|
|
37
37
|
};
|
|
38
38
|
const data = {
|
|
39
|
-
uploaded_time: moment_1.default().format('MMM DD, YYYY hh:mm A'),
|
|
39
|
+
uploaded_time: (0, moment_1.default)().format('MMM DD, YYYY hh:mm A'),
|
|
40
40
|
project_details: {
|
|
41
|
-
id: project_1.getProjectId(),
|
|
42
|
-
project_name: project_1.getProjectName()
|
|
41
|
+
id: (0, project_1.getProjectId)(),
|
|
42
|
+
project_name: (0, project_1.getProjectName)()
|
|
43
43
|
},
|
|
44
44
|
app_name: selectedWebapp.app_name,
|
|
45
45
|
uploaded_by: userDetails,
|
package/lib/execute-script.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -38,7 +42,7 @@ exports.default = (commandName) => {
|
|
|
38
42
|
throw new error_1.default('Not a proper script command', {
|
|
39
43
|
exit: 1,
|
|
40
44
|
errorId: 'EXEC-SCRIPT-1',
|
|
41
|
-
arg: [ansi_colors_1.bold.red(commandName), ansi_colors_1.bold('feature:script')]
|
|
45
|
+
arg: [ansi_colors_1.bold.red(commandName), (0, ansi_colors_1.bold)('feature:script')]
|
|
42
46
|
});
|
|
43
47
|
}
|
|
44
48
|
const configModule = config[(featureByScript[0] + 'Config')];
|
|
@@ -47,8 +51,8 @@ exports.default = (commandName) => {
|
|
|
47
51
|
exit: 1,
|
|
48
52
|
errorId: 'EXEC-SCRIPT-2',
|
|
49
53
|
arg: [
|
|
50
|
-
ansi_colors_1.bold(commandName.replace(featureByScript[0], ansi_colors_1.red(featureByScript[0]))),
|
|
51
|
-
ansi_colors_1.bold(['* client', '* function'].join('\n'))
|
|
54
|
+
(0, ansi_colors_1.bold)(commandName.replace(featureByScript[0], (0, ansi_colors_1.red)(featureByScript[0]))),
|
|
55
|
+
(0, ansi_colors_1.bold)(['* client', '* function'].join('\n'))
|
|
52
56
|
]
|
|
53
57
|
});
|
|
54
58
|
}
|
|
@@ -60,8 +64,8 @@ exports.default = (commandName) => {
|
|
|
60
64
|
errorId: 'EXEC-SCRIPT-3',
|
|
61
65
|
arg: [
|
|
62
66
|
ansi_colors_1.bold.red(featureByScript[1]),
|
|
63
|
-
ansi_colors_1.bold(constants_1.FILENAME.config),
|
|
64
|
-
ansi_colors_1.bold(availableScripts
|
|
67
|
+
(0, ansi_colors_1.bold)(constants_1.FILENAME.config),
|
|
68
|
+
(0, ansi_colors_1.bold)(availableScripts
|
|
65
69
|
? Object.keys(availableScripts)
|
|
66
70
|
.map((script) => '* ' + script)
|
|
67
71
|
.join('\n')
|
|
@@ -69,7 +73,7 @@ exports.default = (commandName) => {
|
|
|
69
73
|
]
|
|
70
74
|
});
|
|
71
75
|
}
|
|
72
|
-
const featureSource = project_1.resolveProjectPath(configModule.source());
|
|
76
|
+
const featureSource = (0, project_1.resolveProjectPath)(configModule.source());
|
|
73
77
|
const exeCommand = js_1.JS.chain(exeTempCommand)
|
|
74
78
|
.split(' ')
|
|
75
79
|
.map((arg) => {
|
|
@@ -81,19 +85,19 @@ exports.default = (commandName) => {
|
|
|
81
85
|
.join(' ')
|
|
82
86
|
.value();
|
|
83
87
|
const workingDir = runtime_store_1.default.get('project.root', configModule.source());
|
|
84
|
-
const exeDir = project_1.resolveProjectPath(workingDir);
|
|
85
|
-
logger_1.info();
|
|
86
|
-
logger_1.info(`Executing ${ansi_colors_1.cyan(featureByScript[1])} script in ${ansi_colors_1.underline(exeDir)}`);
|
|
87
|
-
logger_1.debug('Executing command > ' + exeCommand);
|
|
88
|
-
logger_1.info(`> ${exeCommand}`);
|
|
88
|
+
const exeDir = (0, project_1.resolveProjectPath)(workingDir);
|
|
89
|
+
(0, logger_1.info)();
|
|
90
|
+
(0, logger_1.info)(`Executing ${(0, ansi_colors_1.cyan)(featureByScript[1])} script in ${(0, ansi_colors_1.underline)(exeDir)}`);
|
|
91
|
+
(0, logger_1.debug)('Executing command > ' + exeCommand);
|
|
92
|
+
(0, logger_1.info)(`> ${exeCommand}`);
|
|
89
93
|
const exitListeners = process.listeners('exit');
|
|
90
94
|
process.removeAllListeners('exit');
|
|
91
|
-
const result = shell_1.spawn(exeCommand, [], {
|
|
95
|
+
const result = (0, shell_1.spawn)(exeCommand, [], {
|
|
92
96
|
cwd: exeDir,
|
|
93
97
|
shell: true,
|
|
94
98
|
stdio: 'inherit'
|
|
95
99
|
}).SYNC();
|
|
96
|
-
if (env_1.isPrimaryShell()) {
|
|
100
|
+
if ((0, env_1.isPrimaryShell)()) {
|
|
97
101
|
js_1.JS.forEach(exitListeners || [], (listner) => {
|
|
98
102
|
process.addListener('exit', listner);
|
|
99
103
|
});
|
|
@@ -103,7 +107,7 @@ exports.default = (commandName) => {
|
|
|
103
107
|
exit: 0,
|
|
104
108
|
original: new Error(JSON.stringify(result)),
|
|
105
109
|
errorId: 'EXEC-SCRIPT-4',
|
|
106
|
-
arg: [ansi_colors_1.bold(commandName), ansi_colors_1.italic.red(JSON.stringify(result, null, ' '))]
|
|
110
|
+
arg: [(0, ansi_colors_1.bold)(commandName), ansi_colors_1.italic.red(JSON.stringify(result, null, ' '))]
|
|
107
111
|
});
|
|
108
112
|
}
|
|
109
113
|
return result;
|
|
@@ -12,29 +12,56 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const project_1 = __importDefault(require("../endpoints/lib/project"));
|
|
15
16
|
const credential_1 = __importDefault(require("../internal/credential"));
|
|
16
17
|
exports.default = (req, _RES, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
+
var _a;
|
|
19
|
+
const projectId = req.headers['x-zc-projectid'];
|
|
20
|
+
const projectDomain = req.headers['x-zc-project-domain'];
|
|
21
|
+
const { cookie, authorization } = req.headers;
|
|
17
22
|
const accessToken = yield credential_1.default.getAccessToken();
|
|
18
23
|
const [hasCSRF, hasADT, hasBDT] = Object.keys(req.cookies || {}).reduce((acc, name) => {
|
|
19
|
-
if (name === 'ZD_CSRF_TOKEN') {
|
|
24
|
+
if (name === 'ZD_CSRF_TOKEN' && req.cookies[name]) {
|
|
20
25
|
acc[0] = true;
|
|
21
26
|
}
|
|
22
|
-
if (name.startsWith('_iamadt_client')) {
|
|
27
|
+
if (name.startsWith('_iamadt_client') && req.cookies[name]) {
|
|
23
28
|
acc[1] = true;
|
|
24
29
|
}
|
|
25
|
-
if (name.startsWith('_iambdt_client')) {
|
|
30
|
+
if (name.startsWith('_iambdt_client') && req.cookies[name]) {
|
|
26
31
|
acc[2] = true;
|
|
27
32
|
}
|
|
28
33
|
return acc;
|
|
29
34
|
}, [false, false, false]);
|
|
30
35
|
if (hasCSRF && hasADT && hasBDT) {
|
|
31
|
-
req.headers['x-zc-
|
|
36
|
+
req.headers['x-zc-user-type'] = 'project-user';
|
|
37
|
+
req.headers['x-zc-cookie'] = cookie;
|
|
38
|
+
}
|
|
39
|
+
else if (typeof authorization !== 'undefined') {
|
|
40
|
+
const currentUser = yield new project_1.default({
|
|
41
|
+
origin: 'https://' + projectDomain
|
|
42
|
+
}).getCurrentProjectUser(projectId, { cookie, authorization });
|
|
43
|
+
if (currentUser === null) {
|
|
44
|
+
req.headers['x-zc-user-cred-type'] = 'token';
|
|
45
|
+
req.headers['x-zc-user-cred-token'] = accessToken;
|
|
46
|
+
req.headers['x-zc-user-type'] = 'admin';
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
req.headers['x-zc-user-type'] = 'project-user';
|
|
50
|
+
req.headers['x-zc-user-cred-type'] = 'token';
|
|
51
|
+
req.headers['x-zc-user-cred-token'] = (_a = req.headers.authorization) === null || _a === void 0 ? void 0 : _a.split(' ')[1];
|
|
52
|
+
}
|
|
32
53
|
}
|
|
33
54
|
else {
|
|
34
55
|
req.headers['x-zc-user-cred-type'] = 'token';
|
|
35
56
|
req.headers['x-zc-user-cred-token'] = accessToken;
|
|
57
|
+
req.headers['x-zc-user-type'] = 'admin';
|
|
36
58
|
}
|
|
37
59
|
req.headers['x-zc-admin-cred-type'] = 'token';
|
|
38
60
|
req.headers['x-zc-admin-cred-token'] = accessToken;
|
|
39
|
-
|
|
61
|
+
if (req.headers['x-zc-user-cred-token'] === undefined) {
|
|
62
|
+
next(new Error('Provided "authorization" header is not valid'));
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
next();
|
|
66
|
+
}
|
|
40
67
|
});
|
|
@@ -6,10 +6,10 @@ exports.default = (req, _RES, next) => {
|
|
|
6
6
|
new Date().getTime() +
|
|
7
7
|
']' +
|
|
8
8
|
' "' +
|
|
9
|
-
ansi_colors_1.cyan(req.method) +
|
|
9
|
+
(0, ansi_colors_1.cyan)(req.method) +
|
|
10
10
|
'" ' +
|
|
11
11
|
' "' +
|
|
12
|
-
ansi_colors_1.bold(req.originalUrl) +
|
|
12
|
+
(0, ansi_colors_1.bold)(req.originalUrl) +
|
|
13
13
|
'"');
|
|
14
14
|
next();
|
|
15
15
|
};
|
|
@@ -11,7 +11,7 @@ exports.default = (proxyInstance, customProxyUrl) => (req, res) => {
|
|
|
11
11
|
}
|
|
12
12
|
else if (typeof customProxyUrl === 'string' &&
|
|
13
13
|
!req.url.match(/^(\/baas|\/app|\/server|\/oauthorize|\/__catalyst).*/g)) {
|
|
14
|
-
logger_1.debug(`proxying "${req.url}" to "${customProxyUrl}"`);
|
|
14
|
+
(0, logger_1.debug)(`proxying "${req.url}" to "${customProxyUrl}"`);
|
|
15
15
|
proxyInstance.web(req, res, {
|
|
16
16
|
target: customProxyUrl,
|
|
17
17
|
ws: true,
|
package/lib/fn-utils/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|