auth0-deploy-cli 7.14.0 → 7.14.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/.circleci/config.yml +40 -11
- package/.eslintignore +1 -0
- package/.nyc_output/b55d7a30-feb2-4763-a79f-030cbbcaf34c.json +1 -0
- package/.nyc_output/d585e288-6dff-4d1c-a029-4e45efb2ad92.json +1 -0
- package/.nyc_output/d6d3177f-b440-4a24-ac55-7aabf686a0a7.json +1 -0
- package/.nyc_output/processinfo/b55d7a30-feb2-4763-a79f-030cbbcaf34c.json +1 -0
- package/.nyc_output/processinfo/d585e288-6dff-4d1c-a029-4e45efb2ad92.json +1 -0
- package/.nyc_output/processinfo/d6d3177f-b440-4a24-ac55-7aabf686a0a7.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/.prettierignore +2 -1
- package/CHANGELOG.md +30 -1
- package/README.md +1 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +251 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/args.ts.html +505 -0
- package/coverage/lcov-report/src/commands/export.ts.html +274 -0
- package/coverage/lcov-report/src/commands/import.ts.html +250 -0
- package/coverage/lcov-report/src/commands/index.html +131 -0
- package/coverage/lcov-report/src/configFactory.ts.html +175 -0
- package/coverage/lcov-report/src/context/defaults.ts.html +196 -0
- package/coverage/lcov-report/src/context/directory/handlers/actions.ts.html +355 -0
- package/coverage/lcov-report/src/context/directory/handlers/attackProtection.ts.html +307 -0
- package/coverage/lcov-report/src/context/directory/handlers/branding.ts.html +448 -0
- package/coverage/lcov-report/src/context/directory/handlers/clientGrants.ts.html +262 -0
- package/coverage/lcov-report/src/context/directory/handlers/clients.ts.html +319 -0
- package/coverage/lcov-report/src/context/directory/handlers/connections.ts.html +370 -0
- package/coverage/lcov-report/src/context/directory/handlers/customDomains.ts.html +223 -0
- package/coverage/lcov-report/src/context/directory/handlers/databases.ts.html +544 -0
- package/coverage/lcov-report/src/context/directory/handlers/emailProvider.ts.html +241 -0
- package/coverage/lcov-report/src/context/directory/handlers/emailTemplates.ts.html +316 -0
- package/coverage/lcov-report/src/context/directory/handlers/guardianFactorProviders.ts.html +256 -0
- package/coverage/lcov-report/src/context/directory/handlers/guardianFactorTemplates.ts.html +247 -0
- package/coverage/lcov-report/src/context/directory/handlers/guardianFactors.ts.html +247 -0
- package/coverage/lcov-report/src/context/directory/handlers/guardianPhoneFactorMessageTypes.ts.html +214 -0
- package/coverage/lcov-report/src/context/directory/handlers/guardianPhoneFactorSelectedProvider.ts.html +226 -0
- package/coverage/lcov-report/src/context/directory/handlers/guardianPolicies.ts.html +214 -0
- package/coverage/lcov-report/src/context/directory/handlers/hooks.ts.html +274 -0
- package/coverage/lcov-report/src/context/directory/handlers/index.html +551 -0
- package/coverage/lcov-report/src/context/directory/handlers/index.ts.html +304 -0
- package/coverage/lcov-report/src/context/directory/handlers/logStreams.ts.html +220 -0
- package/coverage/lcov-report/src/context/directory/handlers/migrations.ts.html +196 -0
- package/coverage/lcov-report/src/context/directory/handlers/organizations.ts.html +289 -0
- package/coverage/lcov-report/src/context/directory/handlers/pages.ts.html +358 -0
- package/coverage/lcov-report/src/context/directory/handlers/prompts.ts.html +313 -0
- package/coverage/lcov-report/src/context/directory/handlers/resourceServers.ts.html +229 -0
- package/coverage/lcov-report/src/context/directory/handlers/roles.ts.html +253 -0
- package/coverage/lcov-report/src/context/directory/handlers/rules.ts.html +262 -0
- package/coverage/lcov-report/src/context/directory/handlers/rulesConfigs.ts.html +193 -0
- package/coverage/lcov-report/src/context/directory/handlers/tenant.ts.html +289 -0
- package/coverage/lcov-report/src/context/directory/handlers/themes.ts.html +232 -0
- package/coverage/lcov-report/src/context/directory/handlers/triggers.ts.html +214 -0
- package/coverage/lcov-report/src/context/directory/index.html +116 -0
- package/coverage/lcov-report/src/context/directory/index.ts.html +400 -0
- package/coverage/lcov-report/src/context/index.html +131 -0
- package/coverage/lcov-report/src/context/index.ts.html +475 -0
- package/coverage/lcov-report/src/context/yaml/handlers/actions.ts.html +349 -0
- package/coverage/lcov-report/src/context/yaml/handlers/attackProtection.ts.html +193 -0
- package/coverage/lcov-report/src/context/yaml/handlers/branding.ts.html +391 -0
- package/coverage/lcov-report/src/context/yaml/handlers/clientGrants.ts.html +199 -0
- package/coverage/lcov-report/src/context/yaml/handlers/clients.ts.html +301 -0
- package/coverage/lcov-report/src/context/yaml/handlers/connections.ts.html +394 -0
- package/coverage/lcov-report/src/context/yaml/handlers/customDomains.ts.html +151 -0
- package/coverage/lcov-report/src/context/yaml/handlers/databases.ts.html +346 -0
- package/coverage/lcov-report/src/context/yaml/handlers/emailProvider.ts.html +208 -0
- package/coverage/lcov-report/src/context/yaml/handlers/emailTemplates.ts.html +241 -0
- package/coverage/lcov-report/src/context/yaml/handlers/guardianFactorProviders.ts.html +151 -0
- package/coverage/lcov-report/src/context/yaml/handlers/guardianFactorTemplates.ts.html +151 -0
- package/coverage/lcov-report/src/context/yaml/handlers/guardianFactors.ts.html +151 -0
- package/coverage/lcov-report/src/context/yaml/handlers/guardianPhoneFactorMessageTypes.ts.html +151 -0
- package/coverage/lcov-report/src/context/yaml/handlers/guardianPhoneFactorSelectedProvider.ts.html +169 -0
- package/coverage/lcov-report/src/context/yaml/handlers/guardianPolicies.ts.html +151 -0
- package/coverage/lcov-report/src/context/yaml/handlers/hooks.ts.html +280 -0
- package/coverage/lcov-report/src/context/yaml/handlers/index.html +551 -0
- package/coverage/lcov-report/src/context/yaml/handlers/index.ts.html +298 -0
- package/coverage/lcov-report/src/context/yaml/handlers/logStreams.ts.html +151 -0
- package/coverage/lcov-report/src/context/yaml/handlers/migrations.ts.html +145 -0
- package/coverage/lcov-report/src/context/yaml/handlers/organizations.ts.html +235 -0
- package/coverage/lcov-report/src/context/yaml/handlers/pages.ts.html +268 -0
- package/coverage/lcov-report/src/context/yaml/handlers/prompts.ts.html +154 -0
- package/coverage/lcov-report/src/context/yaml/handlers/resourceServers.ts.html +154 -0
- package/coverage/lcov-report/src/context/yaml/handlers/roles.ts.html +199 -0
- package/coverage/lcov-report/src/context/yaml/handlers/rules.ts.html +253 -0
- package/coverage/lcov-report/src/context/yaml/handlers/rulesConfigs.ts.html +181 -0
- package/coverage/lcov-report/src/context/yaml/handlers/tenant.ts.html +235 -0
- package/coverage/lcov-report/src/context/yaml/handlers/themes.ts.html +154 -0
- package/coverage/lcov-report/src/context/yaml/handlers/triggers.ts.html +172 -0
- package/coverage/lcov-report/src/context/yaml/index.html +116 -0
- package/coverage/lcov-report/src/context/yaml/index.ts.html +568 -0
- package/coverage/lcov-report/src/index.html +221 -0
- package/coverage/lcov-report/src/index.ts.html +361 -0
- package/coverage/lcov-report/src/logger.ts.html +133 -0
- package/coverage/lcov-report/src/readonly.ts.html +346 -0
- package/coverage/lcov-report/src/sessionDurationsToMinutes.ts.html +154 -0
- package/coverage/lcov-report/src/tools/auth0/client.ts.html +604 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/actions.ts.html +793 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/attackProtection.ts.html +367 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/branding.ts.html +427 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/clientGrants.ts.html +418 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/clients.ts.html +340 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/connections.ts.html +598 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/customDomains.ts.html +379 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/databases.ts.html +436 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/default.ts.html +1027 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/emailProvider.ts.html +274 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/emailTemplates.ts.html +337 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/guardianFactorProviders.ts.html +301 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/guardianFactorTemplates.ts.html +265 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/guardianFactors.ts.html +241 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/guardianPhoneFactorMessageTypes.ts.html +337 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.ts.html +331 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/guardianPolicies.ts.html +256 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/hooks.ts.html +829 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/index.html +566 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/index.ts.html +295 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/logStreams.ts.html +346 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/migrations.ts.html +319 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/organizations.ts.html +949 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/pages.ts.html +517 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/prompts.ts.html +913 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/resourceServers.ts.html +412 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/roles.ts.html +751 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/rules.ts.html +727 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/rulesConfigs.ts.html +256 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/tenant.ts.html +466 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/themes.ts.html +1882 -0
- package/coverage/lcov-report/src/tools/auth0/handlers/triggers.ts.html +430 -0
- package/coverage/lcov-report/src/tools/auth0/index.html +146 -0
- package/coverage/lcov-report/src/tools/auth0/index.ts.html +355 -0
- package/coverage/lcov-report/src/tools/auth0/schema.ts.html +184 -0
- package/coverage/lcov-report/src/tools/calculateChanges.ts.html +688 -0
- package/coverage/lcov-report/src/tools/constants.ts.html +610 -0
- package/coverage/lcov-report/src/tools/deploy.ts.html +181 -0
- package/coverage/lcov-report/src/tools/index.html +191 -0
- package/coverage/lcov-report/src/tools/index.ts.html +127 -0
- package/coverage/lcov-report/src/tools/utils.ts.html +796 -0
- package/coverage/lcov-report/src/tools/validationError.ts.html +127 -0
- package/coverage/lcov-report/src/types.ts.html +1093 -0
- package/coverage/lcov-report/src/utils.ts.html +679 -0
- package/coverage/lcov.info +7177 -0
- package/docs/configuring-the-deploy-cli.md +3 -3
- package/docs/keyword-replacement.md +22 -0
- package/examples/yaml/config.json.example +1 -1
- package/lib/commands/import.d.ts +0 -2
- package/lib/commands/import.js +1 -36
- package/lib/context/directory/handlers/connections.js +3 -2
- package/lib/context/directory/handlers/pages.js +7 -2
- package/lib/context/yaml/handlers/connections.js +5 -2
- package/lib/tools/auth0/handlers/themes.js +11 -3
- package/lib/types.d.ts +2 -2
- package/package.json +14 -13
|
@@ -25,7 +25,7 @@ Example **config.json** file:
|
|
|
25
25
|
|
|
26
26
|
By default, the Deploy CLI ingests environment variables, providing the ability to pass credentials and other configurations to the tool without needing to publish to the `config.json` file. Environment variables can either be used to augment the `config.json` file or replace it altogether depending on the project needs.
|
|
27
27
|
|
|
28
|
-
Non-primitive configuration values like `
|
|
28
|
+
Non-primitive configuration values like `AUTH0_KEYWORD_REPLACE_MAPPINGS` and `AUTH0_EXCLUDED` can also be passed in through environment variables so long as these values are properly serialized JSON.
|
|
29
29
|
|
|
30
30
|
To **disable** the consumption of environment variables for either the `import` or `export` commands, pass the `--env=false` argument.
|
|
31
31
|
|
|
@@ -34,8 +34,8 @@ To **disable** the consumption of environment variables for either the `import`
|
|
|
34
34
|
```shell
|
|
35
35
|
# Deploying configuration for YAML formats without a config.json file
|
|
36
36
|
export AUTH0_DOMAIN=<YOUR_AUTH0_DOMAIN>
|
|
37
|
-
export AUTH0_CLIENT_ID=<YOUR_CLIENT_ID>
|
|
38
|
-
export AUTH0_CLIENT_SECRET=<YOUR_CLIENT_SECRET>
|
|
37
|
+
export AUTH0_CLIENT_ID=<YOUR_CLIENT_ID>
|
|
38
|
+
export AUTH0_CLIENT_SECRET=<YOUR_CLIENT_SECRET>
|
|
39
39
|
|
|
40
40
|
a0deploy import --input_file=local/tenant.yaml
|
|
41
41
|
|
|
@@ -36,6 +36,28 @@ clients:
|
|
|
36
36
|
allowed_logout_urls: @@ALLOWED_LOGOUTS@@
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
## Array Concatenation
|
|
40
|
+
|
|
41
|
+
You may encounter situations where you would want to concatenate values onto a static array through keyword replacement. There is no special syntax to support this case, however, it is possible to achieve this by escaping double quotes in a single string that contains the appropriate values and injecting with the `##` keyword syntax. This technique works for both the [YAML and directory formats](./available-resource-config-formats.md).
|
|
42
|
+
|
|
43
|
+
### Example `config.json`
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"AUTH0_KEYWORD_REPLACE_MAPPINGS": {
|
|
48
|
+
"GLOBAL_WEB_ORIGINS": "\"http://local.me:8080\", \"http://localhost\", \"http://localhost:3000\""
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Example `tenant.yaml`
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
clients:
|
|
57
|
+
- name: Test App
|
|
58
|
+
web_origins: [ "http://production-app.com", "https://production-app.com", ##GLOBAL_WEB_ORIGINS## ]
|
|
59
|
+
```
|
|
60
|
+
|
|
39
61
|
## Uni-directional Limitation
|
|
40
62
|
|
|
41
63
|
Currently, the Deploy CLI only preserves keywords during import. Once added, keywords are overwritten with subsequent exports. For this reason, it is recommended that if a workflow heavily depends on keyword replacement, to only perform imports in perpetuity. This limitation is noted in [this Github issue](https://github.com/auth0/auth0-deploy-cli/issues/328).
|
package/lib/commands/import.d.ts
CHANGED
package/lib/commands/import.js
CHANGED
|
@@ -12,7 +12,6 @@ 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
|
-
exports.findUnreplacedKeywords = void 0;
|
|
16
15
|
const nconf_1 = __importDefault(require("nconf"));
|
|
17
16
|
const configFactory_1 = require("../configFactory");
|
|
18
17
|
const tools_1 = require("../tools");
|
|
@@ -41,43 +40,9 @@ function importCMD(params) {
|
|
|
41
40
|
yield context.load();
|
|
42
41
|
const config = (0, configFactory_1.configFactory)();
|
|
43
42
|
config.setProvider((key) => nconf_1.default.get(key));
|
|
44
|
-
|
|
43
|
+
//@ts-ignore because context and assets still need to be typed TODO: type assets and type context
|
|
45
44
|
yield (0, tools_1.deploy)(context.assets, context.mgmtClient, config);
|
|
46
45
|
logger_1.default.info('Import Successful');
|
|
47
46
|
});
|
|
48
47
|
}
|
|
49
48
|
exports.default = importCMD;
|
|
50
|
-
const findUnreplacedKeywords = (assets) => {
|
|
51
|
-
const recursiveFindUnreplacedKeywords = (target) => {
|
|
52
|
-
let unreplaced = [];
|
|
53
|
-
if (target === undefined || target === null)
|
|
54
|
-
return [];
|
|
55
|
-
if (Array.isArray(target)) {
|
|
56
|
-
target.forEach((child) => {
|
|
57
|
-
unreplaced.push(...recursiveFindUnreplacedKeywords(child));
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
else if (typeof target === 'object') {
|
|
61
|
-
Object.values(target).forEach((child) => {
|
|
62
|
-
unreplaced.push(...recursiveFindUnreplacedKeywords(child));
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
if (typeof target === 'string') {
|
|
66
|
-
const arrayMatches = target.match(/(?<=@@).*(?=@@)/g);
|
|
67
|
-
if (arrayMatches !== null) {
|
|
68
|
-
return arrayMatches;
|
|
69
|
-
}
|
|
70
|
-
const keywordMatches = target.match(/(?<=##).*(?=##)/g);
|
|
71
|
-
if (keywordMatches !== null) {
|
|
72
|
-
return keywordMatches;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return unreplaced;
|
|
76
|
-
};
|
|
77
|
-
const unreplacedKeywords = recursiveFindUnreplacedKeywords(assets);
|
|
78
|
-
if (unreplacedKeywords.length > 0) {
|
|
79
|
-
throw `Unreplaced keywords found: ${unreplacedKeywords.join(', ')}. Either correct these values or add to AUTH0_KEYWORD_REPLACE_MAPPINGS configuration.`;
|
|
80
|
-
}
|
|
81
|
-
return;
|
|
82
|
-
};
|
|
83
|
-
exports.findUnreplacedKeywords = findUnreplacedKeywords;
|
|
@@ -29,9 +29,10 @@ function parse(context) {
|
|
|
29
29
|
if (connection.strategy === 'email') {
|
|
30
30
|
(0, utils_1.ensureProp)(connection, 'options.email.body');
|
|
31
31
|
const htmlFileName = path_1.default.join(connectionsFolder, connection.options.email.body);
|
|
32
|
-
if ((0, utils_1.isFile)(htmlFileName)) {
|
|
33
|
-
|
|
32
|
+
if (!(0, utils_1.isFile)(htmlFileName)) {
|
|
33
|
+
throw new Error(`Passwordless email template purportedly located at ${htmlFileName} does not exist for connection. Ensure the existence of this file to proceed with deployment.`);
|
|
34
34
|
}
|
|
35
|
+
connection.options.email.body = (0, tools_1.loadFileAndReplaceKeywords)(htmlFileName, context.mappings);
|
|
35
36
|
}
|
|
36
37
|
return connection;
|
|
37
38
|
})
|
|
@@ -32,11 +32,16 @@ function parse(context) {
|
|
|
32
32
|
acc[name].html = file;
|
|
33
33
|
return acc;
|
|
34
34
|
}, {});
|
|
35
|
-
const pages = Object.
|
|
35
|
+
const pages = Object.keys(sorted).flatMap((key) => {
|
|
36
|
+
const { meta, html } = sorted[key];
|
|
36
37
|
if (!meta) {
|
|
37
38
|
logger_1.default.warn(`Skipping pages file ${html} as missing the corresponding '.json' file`);
|
|
38
39
|
return [];
|
|
39
40
|
}
|
|
41
|
+
if (!html && ['error_page', 'login'].includes(key)) {
|
|
42
|
+
//Error pages don't require an HTML template, it is valid to redirect errors to URL
|
|
43
|
+
return Object.assign(Object.assign({}, (0, utils_1.loadJSON)(meta, context.mappings)), { html: '' });
|
|
44
|
+
}
|
|
40
45
|
if (!html) {
|
|
41
46
|
logger_1.default.warn(`Skipping pages file ${meta} as missing corresponding '.html' file`);
|
|
42
47
|
return [];
|
|
@@ -61,7 +66,7 @@ function dump(context) {
|
|
|
61
66
|
// Dump template html to file
|
|
62
67
|
const htmlFile = path_1.default.join(pagesFolder, `${page.name}.html`);
|
|
63
68
|
logger_1.default.info(`Writing ${htmlFile}`);
|
|
64
|
-
fs_extra_1.default.writeFileSync(htmlFile, page.html);
|
|
69
|
+
fs_extra_1.default.writeFileSync(htmlFile || '', page.html);
|
|
65
70
|
metadata.html = `./${page.name}.html`;
|
|
66
71
|
}
|
|
67
72
|
// Dump page metadata
|
|
@@ -30,9 +30,12 @@ function parse(context) {
|
|
|
30
30
|
if (connection.strategy === 'email') {
|
|
31
31
|
(0, utils_1.ensureProp)(connection, 'options.email.body');
|
|
32
32
|
const htmlFileName = path_1.default.join(connectionsFolder, connection.options.email.body);
|
|
33
|
-
if ((0, utils_1.isFile)(htmlFileName)) {
|
|
34
|
-
connection.
|
|
33
|
+
if (!(0, utils_1.isFile)(htmlFileName)) {
|
|
34
|
+
const missingTemplateErrorMessage = `Passwordless email template purportedly located at ${htmlFileName} does not exist for connection. Ensure the existence of this file to proceed with deployment.`;
|
|
35
|
+
logger_1.default.error(missingTemplateErrorMessage);
|
|
36
|
+
throw new Error(missingTemplateErrorMessage);
|
|
35
37
|
}
|
|
38
|
+
connection.options.email.body = context.loadFile(htmlFileName);
|
|
36
39
|
}
|
|
37
40
|
return connection;
|
|
38
41
|
}),
|
|
@@ -66,13 +66,21 @@ class ThemesHandler extends default_1.default {
|
|
|
66
66
|
logger_1.default.warn('Only one theme is supported per tenant');
|
|
67
67
|
}
|
|
68
68
|
const currentThemes = yield this.getThemes();
|
|
69
|
+
const themeReqPayload = (() => {
|
|
70
|
+
// Removing themeId from update and create payloads, otherwise API will error
|
|
71
|
+
// Theme ID may be required to handle if `--export_ids=true`
|
|
72
|
+
const payload = themes[0];
|
|
73
|
+
//@ts-ignore to quell non-optional themeId property, but we know that it's ok to delete
|
|
74
|
+
delete payload.themeId;
|
|
75
|
+
return payload;
|
|
76
|
+
})();
|
|
69
77
|
if (currentThemes === null || currentThemes.length === 0) {
|
|
70
|
-
yield this.client.branding.createTheme(
|
|
78
|
+
yield this.client.branding.createTheme(themeReqPayload);
|
|
71
79
|
}
|
|
72
80
|
else {
|
|
73
81
|
const currentTheme = currentThemes[0];
|
|
74
82
|
// if theme exists, overwrite it otherwise create it
|
|
75
|
-
yield this.client.branding.updateTheme({ id: currentTheme.themeId },
|
|
83
|
+
yield this.client.branding.updateTheme({ id: currentTheme.themeId }, themeReqPayload);
|
|
76
84
|
}
|
|
77
85
|
this.updated += 1;
|
|
78
86
|
this.didUpdate(themes[0]);
|
|
@@ -102,7 +110,7 @@ exports.default = ThemesHandler;
|
|
|
102
110
|
exports.schema = {
|
|
103
111
|
type: 'array',
|
|
104
112
|
items: {
|
|
105
|
-
additionalProperties:
|
|
113
|
+
additionalProperties: true,
|
|
106
114
|
properties: {
|
|
107
115
|
borders: {
|
|
108
116
|
additionalProperties: false,
|
package/lib/types.d.ts
CHANGED
|
@@ -70,8 +70,8 @@ export declare type BaseAuth0APIClient = {
|
|
|
70
70
|
getDefaultTheme: () => Promise<Theme>;
|
|
71
71
|
updateTheme: (arg0: {
|
|
72
72
|
id: string;
|
|
73
|
-
},
|
|
74
|
-
createTheme: (arg0: Theme) => Promise<Omit<Theme, 'themeId'>>;
|
|
73
|
+
}, arg1: Omit<Theme, 'themeId'>) => Promise<Omit<Theme, 'themeId'>>;
|
|
74
|
+
createTheme: (arg0: Omit<Theme, 'themeId'>) => Promise<Omit<Theme, 'themeId'>>;
|
|
75
75
|
deleteTheme: (arg0: {
|
|
76
76
|
id: string;
|
|
77
77
|
}) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auth0-deploy-cli",
|
|
3
|
-
"version": "7.14.
|
|
3
|
+
"version": "7.14.3",
|
|
4
4
|
"description": "A command line tool for deploying updates to your Auth0 tenant",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
"lint:fix": "eslint --fix --ignore-path .eslintignore --ignore-pattern webpack . && kacl lint",
|
|
11
11
|
"lint": "eslint --ignore-path .eslintignore --ignore-pattern webpack . && kacl lint",
|
|
12
12
|
"format": "npx prettier --write .",
|
|
13
|
-
"
|
|
14
|
-
"test": "ts-mocha -p tsconfig.json --recursive 'test
|
|
13
|
+
"test": "ts-mocha -p tsconfig.json --recursive 'test/**/*.test*' --exclude 'test/e2e/*' --timeout 5000",
|
|
14
|
+
"test:e2e:node-module": "ts-mocha -p tsconfig.json --recursive 'test/e2e/*.test*' --timeout 120000",
|
|
15
|
+
"test:e2e:cli": "sh ./test/e2e/e2e-cli.sh",
|
|
16
|
+
"test:coverage": "nyc npm run test; nyc report --reporter=lcov",
|
|
15
17
|
"build": "rimraf ./lib && npx tsc",
|
|
16
18
|
"dev": "npx tsc --watch",
|
|
17
|
-
"
|
|
19
|
+
"prepublishOnly": "npm run build",
|
|
18
20
|
"preversion": "kacl prerelease",
|
|
19
21
|
"version": "kacl release && git add CHANGELOG.md"
|
|
20
22
|
},
|
|
@@ -30,9 +32,6 @@
|
|
|
30
32
|
"readme": "README.md",
|
|
31
33
|
"homepage": "https://github.com/auth0/auth0-deploy-cli#readme",
|
|
32
34
|
"dependencies": {
|
|
33
|
-
"@types/lodash": "^4.14.181",
|
|
34
|
-
"@types/nconf": "^0.10.2",
|
|
35
|
-
"@types/winston": "^2.4.4",
|
|
36
35
|
"ajv": "^6.12.6",
|
|
37
36
|
"auth0": "^2.42.0",
|
|
38
37
|
"dot-prop": "^5.2.0",
|
|
@@ -44,18 +43,16 @@
|
|
|
44
43
|
"nconf": "^0.12.0",
|
|
45
44
|
"promise-pool-executor": "^1.1.1",
|
|
46
45
|
"sanitize-filename": "^1.6.1",
|
|
47
|
-
"sinon": "^13.0.1",
|
|
48
|
-
"sinon-chai": "^3.7.0",
|
|
49
46
|
"winston": "^3.7.2",
|
|
50
47
|
"yargs": "^15.3.1"
|
|
51
48
|
},
|
|
52
49
|
"devDependencies": {
|
|
53
|
-
"@types/
|
|
50
|
+
"@types/lodash": "^4.14.182",
|
|
54
51
|
"@types/mocha": "^9.1.0",
|
|
55
|
-
"@
|
|
52
|
+
"@types/nconf": "^0.10.3",
|
|
53
|
+
"@typescript-eslint/parser": "^5.30.3",
|
|
56
54
|
"chai": "^4.3.6",
|
|
57
55
|
"chai-as-promised": "^7.1.1",
|
|
58
|
-
"cross-env": "^3.1.4",
|
|
59
56
|
"eslint": "^7.28.0",
|
|
60
57
|
"eslint-config-airbnb-base": "^14.2.1",
|
|
61
58
|
"eslint-config-prettier": "^8.5.0",
|
|
@@ -63,13 +60,17 @@
|
|
|
63
60
|
"husky": "^7.0.4",
|
|
64
61
|
"kacl": "^1.1.1",
|
|
65
62
|
"mocha": "^9.2.2",
|
|
63
|
+
"nock": "^13.2.9",
|
|
66
64
|
"nyc": "^15.0.1",
|
|
67
65
|
"prettier": "^2.6.2",
|
|
68
66
|
"pretty-quick": "^3.1.3",
|
|
69
67
|
"rimraf": "^3.0.2",
|
|
70
68
|
"rmdir-sync": "^1.0.1",
|
|
69
|
+
"sinon": "^13.0.2",
|
|
70
|
+
"sinon-chai": "^3.7.0",
|
|
71
71
|
"ts-mocha": "^9.0.2",
|
|
72
|
-
"typescript": "^4.7.
|
|
72
|
+
"typescript": "^4.7.4",
|
|
73
|
+
"zlib": "^1.0.5"
|
|
73
74
|
},
|
|
74
75
|
"overrides": {
|
|
75
76
|
"istanbul-reports": "3.1.4"
|