auth0-deploy-cli 8.3.0 → 8.4.1
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/.nyc_output/d36c3306-98f3-42dd-bd80-c2e94b615e98.json +1 -0
- package/.nyc_output/processinfo/2e0fdb33-97aa-41e6-955a-bfa2d6ef0a4d.json +1 -0
- package/.nyc_output/processinfo/314ff92e-f01f-4dd2-bd1c-e90e2bcff056.json +1 -0
- package/.nyc_output/processinfo/{ecad2d34-1d34-48d9-9a0d-bb4c26508a9c.json → d36c3306-98f3-42dd-bd80-c2e94b615e98.json} +1 -1
- package/.nyc_output/processinfo/index.json +1 -1
- package/CHANGELOG.md +19 -1
- package/coverage/lcov-report/index.html +36 -36
- package/coverage/lcov.info +940 -748
- package/docs/resource-specific-documentation.md +74 -1
- package/examples/directory/prompts/custom-text.json +9 -0
- package/examples/directory/prompts/prompts.json +6 -0
- package/examples/directory/prompts/screenRenderSettings/login-id_login-id.json +33 -0
- package/examples/directory/prompts/screenRenderSettings/signup-id_signup-id.json +20 -0
- package/examples/yaml/prompts/screenRenderSettings/login-id_login-id.json +33 -0
- package/examples/yaml/prompts/screenRenderSettings/signup-id_signup-id.json +20 -0
- package/examples/yaml/tenant.yaml +16 -0
- package/lib/context/directory/handlers/prompts.js +29 -2
- package/lib/context/directory/handlers/prompts.js.map +1 -1
- package/lib/context/yaml/handlers/prompts.js +95 -3
- package/lib/context/yaml/handlers/prompts.js.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/tools/auth0/handlers/flowVaultConnections.js +46 -1
- package/lib/tools/auth0/handlers/flowVaultConnections.js.map +1 -1
- package/lib/tools/auth0/handlers/flows.js +44 -2
- package/lib/tools/auth0/handlers/flows.js.map +1 -1
- package/lib/tools/auth0/handlers/forms.js +43 -1
- package/lib/tools/auth0/handlers/forms.js.map +1 -1
- package/lib/tools/auth0/handlers/prompts.d.ts +21 -3
- package/lib/tools/auth0/handlers/prompts.js +101 -4
- package/lib/tools/auth0/handlers/prompts.js.map +1 -1
- package/lib/tools/auth0/handlers/triggers.js.map +1 -1
- package/lib/tools/constants.d.ts +5 -0
- package/lib/tools/constants.js +13 -0
- package/lib/tools/constants.js.map +1 -1
- package/lib/tools/index.d.ts +4 -0
- package/lib/utils.d.ts +1 -0
- package/package.json +2 -2
- package/.nyc_output/ecad2d34-1d34-48d9-9a0d-bb4c26508a9c.json +0 -1
- package/.nyc_output/processinfo/03941aa4-af45-42de-9432-07c6d9373eb4.json +0 -1
- package/.nyc_output/processinfo/2150f3c4-9262-4d47-b5b2-eb3f4d0f8111.json +0 -1
- /package/.nyc_output/{03941aa4-af45-42de-9432-07c6d9373eb4.json → 2e0fdb33-97aa-41e6-955a-bfa2d6ef0a4d.json} +0 -0
- /package/.nyc_output/{2150f3c4-9262-4d47-b5b2-eb3f4d0f8111.json → 314ff92e-f01f-4dd2-bd1c-e90e2bcff056.json} +0 -0
|
@@ -12,6 +12,8 @@ The Deploy CLI's own client grant is intentionally not exported nor configurable
|
|
|
12
12
|
|
|
13
13
|
Multilingual custom text prompts follow a particular hierarchy. Under the root-level `prompts` resource property is a proprietary `customText` property that is used to bundle custom text translations with other prompts settings. Underneath `customText` is the two-character language code. Thirdly is the prompt ID, followed by the screen ID, followed by text ID.
|
|
14
14
|
|
|
15
|
+
RenderSettings of a prompt-screen follow a particular hierarchy. Under the root-level `prompts` we store `screenRenderers` property that is used to configure the rendering settings of a given prompt & screen. Thirdly is the prompt Name, followed by the screen Name mapped to the respective renderer configs file. Refer [more](https://auth0.com/docs/customize/login-pages/advanced-customizations/getting-started/configure-acul-screens) on this.
|
|
16
|
+
|
|
15
17
|
**Hierarchy**
|
|
16
18
|
|
|
17
19
|
```yaml
|
|
@@ -21,11 +23,29 @@ prompts:
|
|
|
21
23
|
<PROMPT_ID>: # prompt ID
|
|
22
24
|
<SCREEN_ID>: # prompt screen ID
|
|
23
25
|
<TEXT_ID>: 'Some text'
|
|
26
|
+
screenRenderers:
|
|
27
|
+
- <PROMPT-NAME>:
|
|
28
|
+
<SCREEN-NAME>: ./prompts/screenRenderSettings/promptName_screenName.json #Add the renderer configs for a given prompt & a given screen
|
|
24
29
|
```
|
|
25
30
|
|
|
26
|
-
**Example**
|
|
31
|
+
**YAML Example**
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
Folder structure when in YAML mode.
|
|
35
|
+
|
|
36
|
+
./prompts/
|
|
37
|
+
/screenRenderSettings
|
|
38
|
+
/signup-id_signup-id.json
|
|
39
|
+
/login-id_login-id.json
|
|
40
|
+
/login-passwordless_login-passwordless-email-code.json
|
|
41
|
+
/login-passwordless_login-passwordless-sms-otp.json
|
|
42
|
+
/login-password_login-password.json
|
|
43
|
+
/signup-password_signup-password.json
|
|
44
|
+
./tenant.yaml
|
|
45
|
+
```
|
|
27
46
|
|
|
28
47
|
```yaml
|
|
48
|
+
# Contents of ./tenant.yaml
|
|
29
49
|
prompts:
|
|
30
50
|
identifier_first: true
|
|
31
51
|
universal_login_experience: classic
|
|
@@ -43,7 +63,60 @@ prompts:
|
|
|
43
63
|
mfa-login-options:
|
|
44
64
|
pageTitle: 'Log in to ${clientName}'
|
|
45
65
|
authenticatorNamesSMS: 'SMS'
|
|
66
|
+
screenRenderers:
|
|
67
|
+
- signup-id:
|
|
68
|
+
signup-id: ./prompts/screenRenderSettings/signup-id_signup-id.json
|
|
69
|
+
- login-passwordless:
|
|
70
|
+
login-passwordless-email-code: ./prompts/screenRenderSettings/login-passwordless_login-passwordless-email-code.json
|
|
71
|
+
login-passwordless-sms-otp: ./prompts/screenRenderSettings/login-passwordless_login-passwordless-sms-otp.json
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Directory Example**
|
|
75
|
+
|
|
46
76
|
```
|
|
77
|
+
Folder structure when in directory mode.
|
|
78
|
+
|
|
79
|
+
./prompts/
|
|
80
|
+
/screenRenderSettings
|
|
81
|
+
/signup-id_signup-id.json
|
|
82
|
+
/login-id_login-id.json
|
|
83
|
+
/login-passwordless_login-passwordless-email-code.json
|
|
84
|
+
/login-passwordless_login-passwordless-sms-otp.json
|
|
85
|
+
/login-password_login-password.json
|
|
86
|
+
/signup-password_signup-password.json
|
|
87
|
+
/custom-text.json
|
|
88
|
+
/prompts.json
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Contents of `promptName_screenName.json`
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"prompt": "signup-id",
|
|
96
|
+
"screen": "signup-id",
|
|
97
|
+
"rendering_mode": "advanced",
|
|
98
|
+
"context_configuration": [
|
|
99
|
+
"branding.settings",
|
|
100
|
+
"branding.themes.default"
|
|
101
|
+
],
|
|
102
|
+
"default_head_tags_disabled": false,
|
|
103
|
+
"head_tags": [
|
|
104
|
+
{
|
|
105
|
+
"tag": "script",
|
|
106
|
+
"attributes": {
|
|
107
|
+
"src": "URL_TO_YOUR_ASSET",
|
|
108
|
+
"async": true,
|
|
109
|
+
"defer": true,
|
|
110
|
+
"integrity": [
|
|
111
|
+
"ASSET_SHA"
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
|
|
47
120
|
|
|
48
121
|
## Databases
|
|
49
122
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompt": "login-id",
|
|
3
|
+
"screen": "login-id",
|
|
4
|
+
"rendering_mode": "advanced",
|
|
5
|
+
"context_configuration": [
|
|
6
|
+
"branding.settings",
|
|
7
|
+
"branding.themes.default"
|
|
8
|
+
],
|
|
9
|
+
"default_head_tags_disabled": true,
|
|
10
|
+
"head_tags": [
|
|
11
|
+
{
|
|
12
|
+
"tag": "script",
|
|
13
|
+
"attributes": {
|
|
14
|
+
"src": "http://127.0.0.1:8090/index.js",
|
|
15
|
+
"defer": true
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"tag": "link",
|
|
20
|
+
"attributes": {
|
|
21
|
+
"rel": "stylesheet",
|
|
22
|
+
"href": "http://127.0.0.1:8090/index.css"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"tag": "meta",
|
|
27
|
+
"attributes": {
|
|
28
|
+
"name": "viewport",
|
|
29
|
+
"content": "width=device-width, initial-scale=1"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompt": "signup-id",
|
|
3
|
+
"screen": "signup-id",
|
|
4
|
+
"rendering_mode": "advanced",
|
|
5
|
+
"context_configuration": [],
|
|
6
|
+
"default_head_tags_disabled": false,
|
|
7
|
+
"head_tags": [
|
|
8
|
+
{
|
|
9
|
+
"tag": "script",
|
|
10
|
+
"attributes": {
|
|
11
|
+
"src": "URL_TO_YOUR_ASSET",
|
|
12
|
+
"async": true,
|
|
13
|
+
"defer": true,
|
|
14
|
+
"integrity": [
|
|
15
|
+
"ASSET_SHA"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompt": "login-id",
|
|
3
|
+
"screen": "login-id",
|
|
4
|
+
"rendering_mode": "advanced",
|
|
5
|
+
"context_configuration": [
|
|
6
|
+
"branding.settings",
|
|
7
|
+
"branding.themes.default"
|
|
8
|
+
],
|
|
9
|
+
"default_head_tags_disabled": true,
|
|
10
|
+
"head_tags": [
|
|
11
|
+
{
|
|
12
|
+
"tag": "script",
|
|
13
|
+
"attributes": {
|
|
14
|
+
"src": "http://127.0.0.1:8090/index.js",
|
|
15
|
+
"defer": true
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"tag": "link",
|
|
20
|
+
"attributes": {
|
|
21
|
+
"rel": "stylesheet",
|
|
22
|
+
"href": "http://127.0.0.1:8090/index.css"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"tag": "meta",
|
|
27
|
+
"attributes": {
|
|
28
|
+
"name": "viewport",
|
|
29
|
+
"content": "width=device-width, initial-scale=1"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"prompt": "signup-id",
|
|
3
|
+
"screen": "signup-id",
|
|
4
|
+
"rendering_mode": "advanced",
|
|
5
|
+
"context_configuration": [],
|
|
6
|
+
"default_head_tags_disabled": false,
|
|
7
|
+
"head_tags": [
|
|
8
|
+
{
|
|
9
|
+
"tag": "script",
|
|
10
|
+
"attributes": {
|
|
11
|
+
"src": "URL_TO_YOUR_ASSET",
|
|
12
|
+
"async": true,
|
|
13
|
+
"defer": true,
|
|
14
|
+
"integrity": [
|
|
15
|
+
"ASSET_SHA"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|
|
@@ -184,3 +184,19 @@ triggers:
|
|
|
184
184
|
post-user-registration: []
|
|
185
185
|
pre-user-registration: []
|
|
186
186
|
send-phone-message: []
|
|
187
|
+
|
|
188
|
+
prompts:
|
|
189
|
+
customText:
|
|
190
|
+
en:
|
|
191
|
+
login-id:
|
|
192
|
+
login-id:
|
|
193
|
+
invalid-email-format: Email is not valid.
|
|
194
|
+
enable_ulp_wcag_compliance: false
|
|
195
|
+
identifier_first: false
|
|
196
|
+
partials: {}
|
|
197
|
+
screenRenderers:
|
|
198
|
+
- signup-id:
|
|
199
|
+
signup-id: ./prompts/screenRenderSettings/signup-id_signup-id.json
|
|
200
|
+
- login-passwordless:
|
|
201
|
+
login-passwordless-email-code: ./prompts/screenRenderSettings/login-passwordless_login-passwordless-email-code.json
|
|
202
|
+
login-passwordless-sms-otp: ./prompts/screenRenderSettings/login-passwordless_login-passwordless-sms-otp.json
|
|
@@ -31,6 +31,7 @@ const getPromptsDirectory = (filePath) => path_1.default.join(filePath, tools_1.
|
|
|
31
31
|
const getPromptsSettingsFile = (promptsDirectory) => path_1.default.join(promptsDirectory, 'prompts.json');
|
|
32
32
|
const getCustomTextFile = (promptsDirectory) => path_1.default.join(promptsDirectory, 'custom-text.json');
|
|
33
33
|
const getPartialsFile = (promptsDirectory) => path_1.default.join(promptsDirectory, 'partials.json');
|
|
34
|
+
const getScreenRenderSettingsDir = (promptsDirectory) => path_1.default.join(promptsDirectory, tools_1.constants.PROMPTS_SCREEN_RENDER_DIRECTORY);
|
|
34
35
|
function parse(context) {
|
|
35
36
|
const promptsDirectory = getPromptsDirectory(context.filePath);
|
|
36
37
|
if (!(0, utils_1.existsMustBeDir)(promptsDirectory))
|
|
@@ -79,9 +80,24 @@ function parse(context) {
|
|
|
79
80
|
return acc;
|
|
80
81
|
}, {});
|
|
81
82
|
})();
|
|
83
|
+
const screenRenderers = (() => {
|
|
84
|
+
const screenRenderSettingsDir = getScreenRenderSettingsDir(promptsDirectory);
|
|
85
|
+
if (!(0, utils_1.existsMustBeDir)(screenRenderSettingsDir))
|
|
86
|
+
return [];
|
|
87
|
+
const screenSettingsFiles = (0, utils_1.getFiles)(screenRenderSettingsDir, ['.json']);
|
|
88
|
+
const renderSettings = screenSettingsFiles.map((f) => {
|
|
89
|
+
const renderSetting = Object.assign({}, (0, utils_1.loadJSON)(f, {
|
|
90
|
+
mappings: context.mappings,
|
|
91
|
+
disableKeywordReplacement: context.disableKeywordReplacement,
|
|
92
|
+
}));
|
|
93
|
+
return renderSetting;
|
|
94
|
+
});
|
|
95
|
+
return renderSettings;
|
|
96
|
+
})();
|
|
82
97
|
return {
|
|
83
98
|
prompts: Object.assign(Object.assign({}, promptsSettings), { customText,
|
|
84
|
-
partials
|
|
99
|
+
partials,
|
|
100
|
+
screenRenderers }),
|
|
85
101
|
};
|
|
86
102
|
}
|
|
87
103
|
function dump(context) {
|
|
@@ -89,7 +105,7 @@ function dump(context) {
|
|
|
89
105
|
const { prompts } = context.assets;
|
|
90
106
|
if (!prompts)
|
|
91
107
|
return;
|
|
92
|
-
const { customText, partials } = prompts, promptsSettings = __rest(prompts, ["customText", "partials"]);
|
|
108
|
+
const { customText, partials, screenRenderers } = prompts, promptsSettings = __rest(prompts, ["customText", "partials", "screenRenderers"]);
|
|
93
109
|
const promptsDirectory = getPromptsDirectory(context.filePath);
|
|
94
110
|
(0, fs_extra_1.ensureDirSync)(promptsDirectory);
|
|
95
111
|
if (!promptsSettings)
|
|
@@ -121,6 +137,17 @@ function dump(context) {
|
|
|
121
137
|
return acc;
|
|
122
138
|
}, {});
|
|
123
139
|
(0, utils_1.dumpJSON)(partialsFile, transformedPartials);
|
|
140
|
+
if (!screenRenderers)
|
|
141
|
+
return;
|
|
142
|
+
const screenRenderSettingsDir = getScreenRenderSettingsDir(promptsDirectory);
|
|
143
|
+
(0, fs_extra_1.ensureDirSync)(screenRenderSettingsDir);
|
|
144
|
+
for (let index = 0; index < screenRenderers.length; index++) {
|
|
145
|
+
const screenRenderersSetting = screenRenderers[index];
|
|
146
|
+
delete screenRenderersSetting.tenant;
|
|
147
|
+
const fileName = `${screenRenderersSetting.prompt}_${screenRenderersSetting.screen}.json`;
|
|
148
|
+
const screenSettingsFilePath = path_1.default.join(screenRenderSettingsDir, fileName);
|
|
149
|
+
(0, utils_1.dumpJSON)(screenSettingsFilePath, screenRenderersSetting);
|
|
150
|
+
}
|
|
124
151
|
});
|
|
125
152
|
}
|
|
126
153
|
const promptsHandler = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../../src/context/directory/handlers/prompts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,uCAAwD;AACxD,0CAAuE;AACvE,
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../../src/context/directory/handlers/prompts.ts"],"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AC;QAC3D,CAAC;IACH,CAAC;CAAA;AAED,MAAM,cAAc,GAAoC;IACtD,KAAK;IACL,IAAI;CACL,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
|
@@ -8,20 +8,112 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
11
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
|
|
26
|
+
const path_1 = __importDefault(require("path"));
|
|
27
|
+
const fs_extra_1 = require("fs-extra");
|
|
28
|
+
const tools_1 = require("../../../tools");
|
|
29
|
+
const utils_1 = require("../../../utils");
|
|
30
|
+
const logger_1 = __importDefault(require("../../../logger"));
|
|
31
|
+
const getPromptsDirectory = (filePath) => path_1.default.join(filePath, tools_1.constants.PROMPTS_DIRECTORY);
|
|
32
|
+
const loadScreenRenderers = (context, screenRenderArray) => {
|
|
33
|
+
// Array to store loaded renderers
|
|
34
|
+
const loadedRenderers = [];
|
|
35
|
+
screenRenderArray.forEach((promptEntry) => {
|
|
36
|
+
// Get the prompt (there will be only one key in each entry)
|
|
37
|
+
const prompt = Object.keys(promptEntry)[0];
|
|
38
|
+
const screens = promptEntry[prompt];
|
|
39
|
+
Object.entries(screens).forEach(([, fileName]) => {
|
|
40
|
+
const filePath = fileName;
|
|
41
|
+
try {
|
|
42
|
+
const rendererFile = path_1.default.join(context.basePath, filePath);
|
|
43
|
+
const rendererData = (0, utils_1.loadJSON)(rendererFile, {
|
|
44
|
+
mappings: context.mappings,
|
|
45
|
+
disableKeywordReplacement: context.disableKeywordReplacement,
|
|
46
|
+
});
|
|
47
|
+
// Add to the loadedRenderers array
|
|
48
|
+
loadedRenderers.push(rendererData);
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
logger_1.default.error(`Error loading file ${fileName}:`, error);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
return loadedRenderers;
|
|
56
|
+
};
|
|
57
|
+
function parse(context) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
const { prompts } = context.assets;
|
|
60
|
+
if (!prompts)
|
|
61
|
+
return { prompts: null };
|
|
62
|
+
if (prompts.screenRenderers && prompts.screenRenderers.length > 0) {
|
|
63
|
+
const screenRendersYAML = prompts.screenRenderers;
|
|
64
|
+
prompts.screenRenderers = loadScreenRenderers(context, screenRendersYAML);
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
prompts,
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
const dumpScreenRenderers = (context, screenRenderers) => {
|
|
72
|
+
const screenRenderArray = [];
|
|
73
|
+
const promptsDirectory = getPromptsDirectory(context.basePath);
|
|
74
|
+
(0, fs_extra_1.ensureDirSync)(promptsDirectory);
|
|
75
|
+
// Create the directory for render settings if it doesn't exist
|
|
76
|
+
const renderSettingsDir = path_1.default.join(promptsDirectory, tools_1.constants.PROMPTS_SCREEN_RENDER_DIRECTORY);
|
|
77
|
+
(0, fs_extra_1.ensureDirSync)(renderSettingsDir);
|
|
78
|
+
screenRenderers.forEach((renderer) => {
|
|
79
|
+
const { tenant } = renderer, screenRendererConfig = __rest(renderer, ["tenant"]);
|
|
80
|
+
if (!renderer.prompt || !renderer.screen) {
|
|
81
|
+
logger_1.default.error('Invalid screen renderer:', renderer);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const fileName = `${renderer.prompt}_${renderer.screen}.json`;
|
|
85
|
+
const filePath = path_1.default.join(renderSettingsDir, fileName);
|
|
86
|
+
logger_1.default.info(`Writing ${filePath}`);
|
|
87
|
+
// Write individual file
|
|
88
|
+
(0, fs_extra_1.writeFileSync)(filePath, JSON.stringify(screenRendererConfig, null, 2));
|
|
89
|
+
// Find or create entry for this prompt in the screenRenderArray
|
|
90
|
+
let promptEntry = screenRenderArray.find((entry) => entry[renderer.prompt]);
|
|
91
|
+
if (!promptEntry) {
|
|
92
|
+
// If no entry exists for this prompt, create a new one
|
|
93
|
+
promptEntry = { [renderer.prompt]: {} };
|
|
94
|
+
screenRenderArray.push(promptEntry);
|
|
95
|
+
}
|
|
96
|
+
// Add screen to the prompt entry
|
|
97
|
+
promptEntry[renderer.prompt][renderer.screen] = `./prompts/${tools_1.constants.PROMPTS_SCREEN_RENDER_DIRECTORY}/${fileName}`;
|
|
98
|
+
});
|
|
99
|
+
return screenRenderArray;
|
|
100
|
+
};
|
|
101
|
+
function dump(context) {
|
|
13
102
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
103
|
const { prompts } = context.assets;
|
|
15
104
|
if (!prompts)
|
|
16
105
|
return { prompts: null };
|
|
106
|
+
if (prompts.screenRenderers && prompts.screenRenderers.length > 0) {
|
|
107
|
+
prompts.screenRenderers = dumpScreenRenderers(context, prompts.screenRenderers);
|
|
108
|
+
}
|
|
17
109
|
return {
|
|
18
110
|
prompts,
|
|
19
111
|
};
|
|
20
112
|
});
|
|
21
113
|
}
|
|
22
114
|
const promptsHandler = {
|
|
23
|
-
parse
|
|
24
|
-
dump
|
|
115
|
+
parse,
|
|
116
|
+
dump,
|
|
25
117
|
};
|
|
26
118
|
exports.default = promptsHandler;
|
|
27
119
|
//# sourceMappingURL=prompts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../../src/context/yaml/handlers/prompts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../../../src/context/yaml/handlers/prompts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAwB;AACxB,uCAAwD;AAIxD,0CAA2C;AAG3C,0CAA0C;AAC1C,6DAAkC;AAUlC,MAAM,mBAAmB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,cAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,iBAAS,CAAC,iBAAiB,CAAC,CAAC;AAEnG,MAAM,mBAAmB,GAAG,CAC1B,OAAoB,EACpB,iBAAmC,EACR,EAAE;IAC7B,kCAAkC;IAClC,MAAM,eAAe,GAA8B,EAAE,CAAC;IAEtD,iBAAiB,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;QACxC,4DAA4D;QAC5D,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;QAE3C,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;QAEpC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,EAAE;YAC/C,MAAM,QAAQ,GAAG,QAAQ,CAAC;YAE1B,IAAI,CAAC;gBACH,MAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;gBAE3D,MAAM,YAAY,GAAG,IAAA,gBAAQ,EAAC,YAAY,EAAE;oBAC1C,QAAQ,EAAE,OAAO,CAAC,QAAQ;oBAC1B,yBAAyB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O,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC;QAEnC,IAAI,CAAC,OAAO;YAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAEvC,IAAI,OAAO,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClE,OAAO,CAAC,eAAe,GAAG,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;QAClF,CAAC;QAED,OAAO;YACL,OAAO;SACR,CAAC;IACJ,CAAC;CAAA;AAED,MAAM,cAAc,GAA+B;IACjD,KAAK;IACL,IAAI;CACL,CAAC;AAEF,kBAAe,cAAc,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -78,6 +78,7 @@ declare const _default: {
|
|
|
78
78
|
SUPPORTED_BRANDING_TEMPLATES: string[];
|
|
79
79
|
LOG_STREAMS_DIRECTORY: string;
|
|
80
80
|
PROMPTS_DIRECTORY: string;
|
|
81
|
+
PROMPTS_SCREEN_RENDER_DIRECTORY: string;
|
|
81
82
|
PARTIALS_DIRECTORY: string;
|
|
82
83
|
CUSTOM_DOMAINS_DIRECTORY: string;
|
|
83
84
|
THEMES_DIRECTORY: string;
|
|
@@ -86,6 +87,9 @@ declare const _default: {
|
|
|
86
87
|
FLOWS_DIRECTORY: string;
|
|
87
88
|
FLOWS_VAULT_DIRECTORY: string;
|
|
88
89
|
SELF_SERVICE_PROFILE_DIRECTORY: string;
|
|
90
|
+
PROMPT_SCREEN_MAPPINGS: {
|
|
91
|
+
[prompt: string]: string[];
|
|
92
|
+
};
|
|
89
93
|
};
|
|
90
94
|
deploy: typeof import("./tools").deploy;
|
|
91
95
|
keywordReplace: typeof import("./tools").keywordReplace;
|
|
@@ -1,4 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
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);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
2
41
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
42
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
43
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -14,7 +53,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
54
|
exports.schema = void 0;
|
|
16
55
|
const lodash_1 = require("lodash");
|
|
17
|
-
const default_1 =
|
|
56
|
+
const default_1 = __importStar(require("./default"));
|
|
18
57
|
const constants_1 = __importDefault(require("../../constants"));
|
|
19
58
|
const logger_1 = __importDefault(require("../../../logger"));
|
|
20
59
|
exports.schema = {
|
|
@@ -103,6 +142,9 @@ class FlowVaultHandler extends default_1.default {
|
|
|
103
142
|
if ('ready' in conn) {
|
|
104
143
|
delete conn.ready;
|
|
105
144
|
}
|
|
145
|
+
if ('account_name' in conn) {
|
|
146
|
+
delete conn.account_name;
|
|
147
|
+
}
|
|
106
148
|
const { data: created } = yield this.client.flows.createConnection(conn);
|
|
107
149
|
return created;
|
|
108
150
|
});
|
|
@@ -185,4 +227,7 @@ class FlowVaultHandler extends default_1.default {
|
|
|
185
227
|
}
|
|
186
228
|
}
|
|
187
229
|
exports.default = FlowVaultHandler;
|
|
230
|
+
__decorate([
|
|
231
|
+
(0, default_1.order)('50')
|
|
232
|
+
], FlowVaultHandler.prototype, "processChanges", null);
|
|
188
233
|
//# sourceMappingURL=flowVaultConnections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flowVaultConnections.js","sourceRoot":"","sources":["../../../../src/tools/auth0/handlers/flowVaultConnections.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flowVaultConnections.js","sourceRoot":"","sources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D,OAAO,EAAE,CAAC;YACf,CAAC;iBAAM,CAAC;gBACN,gBAAG,CAAC,IAAI,CAAC;UACL,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACvD,CAAC;QACH,CAAC;KAAA;CACF;AA5KD,mCA4KC;AApJO;IADL,IAAA,eAAK,EAAC,IAAI,CAAC;sDAgCX"}
|
|
@@ -1,4 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
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);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
2
41
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
42
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
43
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -15,7 +54,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
54
|
exports.schema = void 0;
|
|
16
55
|
const lodash_1 = require("lodash");
|
|
17
56
|
const dot_prop_1 = __importDefault(require("dot-prop"));
|
|
18
|
-
const default_1 =
|
|
57
|
+
const default_1 = __importStar(require("./default"));
|
|
19
58
|
const client_1 = require("../client");
|
|
20
59
|
const logger_1 = __importDefault(require("../../../logger"));
|
|
21
60
|
const utils_1 = require("../../../utils");
|
|
@@ -33,7 +72,7 @@ exports.schema = {
|
|
|
33
72
|
};
|
|
34
73
|
class FlowHandler extends default_1.default {
|
|
35
74
|
constructor(options) {
|
|
36
|
-
super(Object.assign(Object.assign({}, options), { type: 'flows', id: 'id' }));
|
|
75
|
+
super(Object.assign(Object.assign({}, options), { type: 'flows', id: 'id', stripCreateFields: ['created_at', 'updated_at', 'executed_at'], stripUpdateFields: ['created_at', 'updated_at', 'executed_at'] }));
|
|
37
76
|
}
|
|
38
77
|
getType() {
|
|
39
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -153,4 +192,7 @@ class FlowHandler extends default_1.default {
|
|
|
153
192
|
}
|
|
154
193
|
}
|
|
155
194
|
exports.default = FlowHandler;
|
|
195
|
+
__decorate([
|
|
196
|
+
(0, default_1.order)('60')
|
|
197
|
+
], FlowHandler.prototype, "processChanges", null);
|
|
156
198
|
//# sourceMappingURL=flows.js.map
|