@cedarjs/cli-helpers 6.0.0-canary.2771 → 6.0.0-canary.2773
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/dist/lib/project.d.ts.map +1 -1
- package/dist/lib/project.js +2 -1
- package/package.json +14 -46
- package/dist/cjs/auth/authFiles.d.ts +0 -44
- package/dist/cjs/auth/authFiles.d.ts.map +0 -1
- package/dist/cjs/auth/authFiles.js +0 -109
- package/dist/cjs/auth/authTasks.d.ts +0 -49
- package/dist/cjs/auth/authTasks.d.ts.map +0 -1
- package/dist/cjs/auth/authTasks.js +0 -391
- package/dist/cjs/auth/setupHelpers.d.ts +0 -27
- package/dist/cjs/auth/setupHelpers.d.ts.map +0 -1
- package/dist/cjs/auth/setupHelpers.js +0 -141
- package/dist/cjs/index.d.ts +0 -12
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -52
- package/dist/cjs/lib/colors.d.ts +0 -24
- package/dist/cjs/lib/colors.d.ts.map +0 -1
- package/dist/cjs/lib/colors.js +0 -52
- package/dist/cjs/lib/index.d.ts +0 -22
- package/dist/cjs/lib/index.d.ts.map +0 -1
- package/dist/cjs/lib/index.js +0 -147
- package/dist/cjs/lib/installHelpers.d.ts +0 -17
- package/dist/cjs/lib/installHelpers.d.ts.map +0 -1
- package/dist/cjs/lib/installHelpers.js +0 -65
- package/dist/cjs/lib/loadEnvFiles.d.ts +0 -5
- package/dist/cjs/lib/loadEnvFiles.d.ts.map +0 -1
- package/dist/cjs/lib/loadEnvFiles.js +0 -99
- package/dist/cjs/lib/paths.d.ts +0 -6
- package/dist/cjs/lib/paths.d.ts.map +0 -1
- package/dist/cjs/lib/paths.js +0 -42
- package/dist/cjs/lib/project.d.ts +0 -44
- package/dist/cjs/lib/project.d.ts.map +0 -1
- package/dist/cjs/lib/project.js +0 -268
- package/dist/cjs/lib/version.d.ts +0 -17
- package/dist/cjs/lib/version.d.ts.map +0 -1
- package/dist/cjs/lib/version.js +0 -107
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/packageManager/display.d.ts +0 -90
- package/dist/cjs/packageManager/display.d.ts.map +0 -1
- package/dist/cjs/packageManager/display.js +0 -139
- package/dist/cjs/packageManager/exec.d.ts +0 -77
- package/dist/cjs/packageManager/exec.d.ts.map +0 -1
- package/dist/cjs/packageManager/exec.js +0 -152
- package/dist/cjs/packageManager/index.d.ts +0 -13
- package/dist/cjs/packageManager/index.d.ts.map +0 -1
- package/dist/cjs/packageManager/index.js +0 -73
- package/dist/cjs/packageManager/packages.d.ts +0 -39
- package/dist/cjs/packageManager/packages.d.ts.map +0 -1
- package/dist/cjs/packageManager/packages.js +0 -91
- package/dist/cjs/packageManager/workspaces.d.ts +0 -4
- package/dist/cjs/packageManager/workspaces.d.ts.map +0 -1
- package/dist/cjs/packageManager/workspaces.js +0 -93
- package/dist/cjs/telemetry/index.d.ts +0 -20
- package/dist/cjs/telemetry/index.d.ts.map +0 -1
- package/dist/cjs/telemetry/index.js +0 -64
- package/dist/package.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/lib/project.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAWrD,eAAO,MAAM,cAAc,qBAE1B,CAAA;AAED,eAAO,MAAM,sBAAsB,2BAGlC,CAAA;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA;AAED,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/lib/project.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAWrD,eAAO,MAAM,cAAc,qBAE1B,CAAA;AAED,eAAO,MAAM,sBAAsB,2BAGlC,CAAA;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA;AAED,eAAO,MAAM,0BAA0B,WAStC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,SAkDnD,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,aAAa,MAAM;;;CAOvD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM;;;CAOzE,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM,kBAqCrE,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,QAmCzC;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,QA0HjC"}
|
package/dist/lib/project.js
CHANGED
|
@@ -23,7 +23,8 @@ const isTypeScriptProject = () => {
|
|
|
23
23
|
};
|
|
24
24
|
const getInstalledRedwoodVersion = () => {
|
|
25
25
|
try {
|
|
26
|
-
const
|
|
26
|
+
const packageJsonPath = path.join(import.meta.dirname, "../../package.json");
|
|
27
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
|
|
27
28
|
return packageJson.version;
|
|
28
29
|
} catch {
|
|
29
30
|
console.error(colors.error("Could not find installed Cedar version"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/cli-helpers",
|
|
3
|
-
"version": "6.0.0-canary.
|
|
3
|
+
"version": "6.0.0-canary.2773",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -10,83 +10,51 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
-
"
|
|
13
|
+
"default": {
|
|
14
14
|
"types": "./dist/index.d.ts",
|
|
15
15
|
"default": "./dist/index.js"
|
|
16
|
-
},
|
|
17
|
-
"default": {
|
|
18
|
-
"types": "./dist/cjs/index.d.ts",
|
|
19
|
-
"default": "./dist/cjs/index.js"
|
|
20
16
|
}
|
|
21
17
|
},
|
|
22
18
|
"./loadEnvFiles": {
|
|
23
|
-
"
|
|
19
|
+
"default": {
|
|
24
20
|
"types": "./dist/lib/loadEnvFiles.d.ts",
|
|
25
21
|
"default": "./dist/lib/loadEnvFiles.js"
|
|
26
|
-
},
|
|
27
|
-
"default": {
|
|
28
|
-
"types": "./dist/cjs/lib/loadEnvFiles.d.ts",
|
|
29
|
-
"default": "./dist/cjs/lib/loadEnvFiles.js"
|
|
30
22
|
}
|
|
31
23
|
},
|
|
32
24
|
"./dist/lib/loadEnvFiles.js": {
|
|
33
|
-
"
|
|
25
|
+
"default": {
|
|
34
26
|
"types": "./dist/lib/loadEnvFiles.d.ts",
|
|
35
27
|
"default": "./dist/lib/loadEnvFiles.js"
|
|
36
|
-
},
|
|
37
|
-
"default": {
|
|
38
|
-
"types": "./dist/cjs/lib/loadEnvFiles.d.ts",
|
|
39
|
-
"default": "./dist/cjs/lib/loadEnvFiles.js"
|
|
40
28
|
}
|
|
41
29
|
},
|
|
42
30
|
"./packageManager": {
|
|
43
|
-
"
|
|
31
|
+
"default": {
|
|
44
32
|
"types": "./dist/packageManager/index.d.ts",
|
|
45
33
|
"default": "./dist/packageManager/index.js"
|
|
46
|
-
},
|
|
47
|
-
"default": {
|
|
48
|
-
"types": "./dist/cjs/packageManager/index.d.ts",
|
|
49
|
-
"default": "./dist/cjs/packageManager/index.js"
|
|
50
34
|
}
|
|
51
35
|
},
|
|
52
36
|
"./packageManager/exec": {
|
|
53
|
-
"
|
|
37
|
+
"default": {
|
|
54
38
|
"types": "./dist/packageManager/exec.d.ts",
|
|
55
39
|
"default": "./dist/packageManager/exec.js"
|
|
56
|
-
},
|
|
57
|
-
"default": {
|
|
58
|
-
"types": "./dist/cjs/packageManager/exec.d.ts",
|
|
59
|
-
"default": "./dist/cjs/packageManager/exec.js"
|
|
60
40
|
}
|
|
61
41
|
},
|
|
62
42
|
"./packageManager/packages": {
|
|
63
|
-
"
|
|
43
|
+
"default": {
|
|
64
44
|
"types": "./dist/packageManager/packages.d.ts",
|
|
65
45
|
"default": "./dist/packageManager/packages.js"
|
|
66
|
-
},
|
|
67
|
-
"default": {
|
|
68
|
-
"types": "./dist/cjs/packageManager/packages.d.ts",
|
|
69
|
-
"default": "./dist/cjs/packageManager/packages.js"
|
|
70
46
|
}
|
|
71
47
|
},
|
|
72
48
|
"./packageManager/display": {
|
|
73
|
-
"
|
|
49
|
+
"default": {
|
|
74
50
|
"types": "./dist/packageManager/display.d.ts",
|
|
75
51
|
"default": "./dist/packageManager/display.js"
|
|
76
|
-
},
|
|
77
|
-
"default": {
|
|
78
|
-
"types": "./dist/cjs/packageManager/display.d.ts",
|
|
79
|
-
"default": "./dist/cjs/packageManager/display.js"
|
|
80
52
|
}
|
|
81
53
|
},
|
|
82
54
|
"./packageManager/workspaces": {
|
|
83
|
-
"
|
|
55
|
+
"default": {
|
|
84
56
|
"types": "./dist/packageManager/workspaces.d.ts",
|
|
85
57
|
"default": "./dist/packageManager/workspaces.js"
|
|
86
|
-
},
|
|
87
|
-
"default": {
|
|
88
|
-
"types": "./dist/cjs/packageManager/workspaces.d.ts",
|
|
89
|
-
"default": "./dist/cjs/packageManager/workspaces.js"
|
|
90
58
|
}
|
|
91
59
|
}
|
|
92
60
|
},
|
|
@@ -95,9 +63,9 @@
|
|
|
95
63
|
"dist"
|
|
96
64
|
],
|
|
97
65
|
"scripts": {
|
|
98
|
-
"build": "node ./build.ts
|
|
66
|
+
"build": "node ./build.ts",
|
|
99
67
|
"build:pack": "yarn pack -o cedarjs-cli-helpers.tgz",
|
|
100
|
-
"build:types": "tsc --build --verbose ./tsconfig.build.json
|
|
68
|
+
"build:types": "tsc --build --verbose ./tsconfig.build.json",
|
|
101
69
|
"build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx\" --ignore dist --exec \"yarn build\"",
|
|
102
70
|
"prepublishOnly": "NODE_ENV=production yarn build",
|
|
103
71
|
"test": "vitest run",
|
|
@@ -105,8 +73,8 @@
|
|
|
105
73
|
},
|
|
106
74
|
"dependencies": {
|
|
107
75
|
"@babel/core": "^7.26.10",
|
|
108
|
-
"@cedarjs/project-config": "6.0.0-canary.
|
|
109
|
-
"@cedarjs/telemetry": "6.0.0-canary.
|
|
76
|
+
"@cedarjs/project-config": "6.0.0-canary.2773",
|
|
77
|
+
"@cedarjs/telemetry": "6.0.0-canary.2773",
|
|
110
78
|
"@listr2/prompt-adapter-enquirer": "4.3.0",
|
|
111
79
|
"@opentelemetry/api": "1.9.1",
|
|
112
80
|
"ansis": "4.3.1",
|
|
@@ -125,7 +93,7 @@
|
|
|
125
93
|
"yargs-parser": "21.1.1"
|
|
126
94
|
},
|
|
127
95
|
"devDependencies": {
|
|
128
|
-
"@cedarjs/framework-tools": "6.0.0-canary.
|
|
96
|
+
"@cedarjs/framework-tools": "6.0.0-canary.2773",
|
|
129
97
|
"@types/dotenv-defaults": "^5.0.0",
|
|
130
98
|
"@types/lodash": "4.17.24",
|
|
131
99
|
"@types/pascalcase": "1.0.3",
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
interface FilesArgs {
|
|
2
|
-
basedir: string;
|
|
3
|
-
webAuthn: boolean;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Get the api side file paths and file contents to write
|
|
7
|
-
*
|
|
8
|
-
* Example return value:
|
|
9
|
-
* ```json
|
|
10
|
-
* {
|
|
11
|
-
* "/Users/tobbe/dev/rw-app/api/src/lib/auth.ts": "<file content>",
|
|
12
|
-
* "/Users/tobbe/dev/rw-app/api/src/lib/helperFunctions.ts": "<file content>",
|
|
13
|
-
* "/Users/tobbe/dev/rw-app/api/src/functions/auth.ts": "<file content>"
|
|
14
|
-
* }
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
17
|
-
export declare const apiSideFiles: ({ basedir, webAuthn }: FilesArgs) => Promise<Record<string, string>>;
|
|
18
|
-
/**
|
|
19
|
-
* Loops through the keys in `filesRecord` and generates unique file paths if
|
|
20
|
-
* they conflict with existing files
|
|
21
|
-
*
|
|
22
|
-
* Given this input:
|
|
23
|
-
* ```json
|
|
24
|
-
* {
|
|
25
|
-
* "/Users/tobbe/dev/rw-app/api/src/lib/auth.ts": "<file content>",
|
|
26
|
-
* "/Users/tobbe/dev/rw-app/api/src/lib/helperFunctions.ts": "<file content>",
|
|
27
|
-
* "/Users/tobbe/dev/rw-app/api/src/lib/supertokens.ts": "<file content>",
|
|
28
|
-
* "/Users/tobbe/dev/rw-app/api/src/functions/auth.ts": "<file content>"
|
|
29
|
-
* }
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* You could get this output, depending on what existing files there are
|
|
33
|
-
* ```json
|
|
34
|
-
* {
|
|
35
|
-
* "/Users/tobbe/dev/rw-app/api/src/lib/supertokensAuth3.ts": "<file content>",
|
|
36
|
-
* "/Users/tobbe/dev/rw-app/api/src/lib/supertokensHelperFunctions.ts": "<file content>",
|
|
37
|
-
* "/Users/tobbe/dev/rw-app/api/src/lib/supertokens2.ts": "<file content>",
|
|
38
|
-
* "/Users/tobbe/dev/rw-app/api/src/functions/auth.ts": "<file content>"
|
|
39
|
-
* }
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
export declare function generateUniqueFileNames(filesRecord: Record<string, string>, provider: string): Record<string, string>;
|
|
43
|
-
export {};
|
|
44
|
-
//# sourceMappingURL=authFiles.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authFiles.d.ts","sourceRoot":"","sources":["../../../src/auth/authFiles.ts"],"names":[],"mappings":"AASA,UAAU,SAAS;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAU,uBAAuB,SAAS,oCAmElE,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,QAAQ,EAAE,MAAM,0BAwCjB"}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var authFiles_exports = {};
|
|
30
|
-
__export(authFiles_exports, {
|
|
31
|
-
apiSideFiles: () => apiSideFiles,
|
|
32
|
-
generateUniqueFileNames: () => generateUniqueFileNames
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(authFiles_exports);
|
|
35
|
-
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
36
|
-
var import_path = __toESM(require("path"), 1);
|
|
37
|
-
var import_pascalcase = __toESM(require("pascalcase"), 1);
|
|
38
|
-
var import_lib = require("../lib/index.js");
|
|
39
|
-
var import_paths = require("../lib/paths.js");
|
|
40
|
-
var import_project = require("../lib/project.js");
|
|
41
|
-
const apiSideFiles = async ({ basedir, webAuthn }) => {
|
|
42
|
-
const apiSrcPath = (0, import_paths.getPaths)().api.src;
|
|
43
|
-
const apiBaseTemplatePath = import_path.default.join(basedir, "templates", "api");
|
|
44
|
-
const templateDirectories = import_node_fs.default.readdirSync(apiBaseTemplatePath);
|
|
45
|
-
let filesRecord = {};
|
|
46
|
-
for (const dir of templateDirectories) {
|
|
47
|
-
const templateFiles = import_node_fs.default.readdirSync(import_path.default.join(apiBaseTemplatePath, dir));
|
|
48
|
-
const filePaths = templateFiles.filter((fileName) => {
|
|
49
|
-
const fileNameParts = fileName.split(".");
|
|
50
|
-
return fileNameParts.length <= 3 || fileNameParts.at(-3) !== "webAuthn";
|
|
51
|
-
}).map((fileName) => {
|
|
52
|
-
let outputFileName = fileName.replace(/\.template$/, "");
|
|
53
|
-
if (!(0, import_project.isTypeScriptProject)()) {
|
|
54
|
-
outputFileName = outputFileName.replace(/\.ts(x?)$/, ".js$1");
|
|
55
|
-
}
|
|
56
|
-
if (!webAuthn) {
|
|
57
|
-
return { templateFileName: fileName, outputFileName };
|
|
58
|
-
}
|
|
59
|
-
const webAuthnFileName = fileName.split(".").reverse().map((part, i) => i === 1 ? "webAuthn." + part : part).reverse().join(".");
|
|
60
|
-
if (templateFiles.includes(webAuthnFileName)) {
|
|
61
|
-
return { templateFileName: webAuthnFileName, outputFileName };
|
|
62
|
-
} else {
|
|
63
|
-
return { templateFileName: fileName, outputFileName };
|
|
64
|
-
}
|
|
65
|
-
}).map((f) => {
|
|
66
|
-
const templateFilePath = import_path.default.join(
|
|
67
|
-
apiBaseTemplatePath,
|
|
68
|
-
dir,
|
|
69
|
-
f.templateFileName
|
|
70
|
-
);
|
|
71
|
-
const outputFilePath = import_path.default.join(apiSrcPath, dir, f.outputFileName);
|
|
72
|
-
return { templateFilePath, outputFilePath };
|
|
73
|
-
});
|
|
74
|
-
for (const paths of filePaths) {
|
|
75
|
-
const content = import_node_fs.default.readFileSync(paths.templateFilePath, "utf8");
|
|
76
|
-
filesRecord = {
|
|
77
|
-
...filesRecord,
|
|
78
|
-
[paths.outputFilePath]: (0, import_project.isTypeScriptProject)() ? content : await (0, import_lib.transformTSToJS)(paths.outputFilePath, content)
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return filesRecord;
|
|
83
|
-
};
|
|
84
|
-
function generateUniqueFileNames(filesRecord, provider) {
|
|
85
|
-
const newFilesRecord = {};
|
|
86
|
-
Object.keys(filesRecord).forEach((fullPath) => {
|
|
87
|
-
let newFullPath = fullPath;
|
|
88
|
-
let i = 1;
|
|
89
|
-
while (import_node_fs.default.existsSync(newFullPath)) {
|
|
90
|
-
const nameParts = import_path.default.basename(fullPath).split(".");
|
|
91
|
-
if (nameParts[0] === provider) {
|
|
92
|
-
const newFileName = provider + (i + 1) + "." + nameParts.slice(1).join(".");
|
|
93
|
-
newFullPath = import_path.default.join(import_path.default.dirname(fullPath), newFileName);
|
|
94
|
-
} else {
|
|
95
|
-
const count = i > 1 ? i : "";
|
|
96
|
-
const newFileName = provider + (0, import_pascalcase.default)(nameParts[0]) + count + "." + nameParts.slice(1).join(".");
|
|
97
|
-
newFullPath = import_path.default.join(import_path.default.dirname(fullPath), newFileName);
|
|
98
|
-
}
|
|
99
|
-
i++;
|
|
100
|
-
}
|
|
101
|
-
newFilesRecord[newFullPath] = filesRecord[fullPath];
|
|
102
|
-
});
|
|
103
|
-
return newFilesRecord;
|
|
104
|
-
}
|
|
105
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
106
|
-
0 && (module.exports = {
|
|
107
|
-
apiSideFiles,
|
|
108
|
-
generateUniqueFileNames
|
|
109
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ListrRenderer, ListrTask, ListrTaskWrapper } from 'listr2';
|
|
2
|
-
export declare const getWebAppPath: () => string;
|
|
3
|
-
export declare const addApiConfig: ({ replaceExistingImport, authDecoderImport, }: {
|
|
4
|
-
replaceExistingImport: boolean;
|
|
5
|
-
authDecoderImport?: string;
|
|
6
|
-
}) => void;
|
|
7
|
-
export declare const hasAuthProvider: (content: string) => boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Removes <AuthProvider ...> and </AuthProvider> if they exist, and un-indents
|
|
10
|
-
* the content.
|
|
11
|
-
*
|
|
12
|
-
* Exported for testing
|
|
13
|
-
*/
|
|
14
|
-
export declare const removeAuthProvider: (content: string) => string;
|
|
15
|
-
/**
|
|
16
|
-
* Actually inserts the required config lines into App.{jsx,tsx}
|
|
17
|
-
* Exported for testing
|
|
18
|
-
*/
|
|
19
|
-
export declare const addConfigToWebApp: <Renderer extends typeof ListrRenderer>() => ListrTask<AuthGeneratorCtx, Renderer>;
|
|
20
|
-
export declare const createWebAuth: (basedir: string, webAuthn: boolean) => {
|
|
21
|
-
title: string;
|
|
22
|
-
task: (ctx: AuthGeneratorCtx) => Promise<void>;
|
|
23
|
-
};
|
|
24
|
-
export declare const addConfigToRoutes: () => {
|
|
25
|
-
title: string;
|
|
26
|
-
task: () => void;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Will find the templates inside `${basedir}/templates/api`,
|
|
30
|
-
* and write these files to disk with unique names if they are clashing.
|
|
31
|
-
*
|
|
32
|
-
* @returns Listr task
|
|
33
|
-
*/
|
|
34
|
-
export declare const generateAuthApiFiles: <Renderer extends typeof ListrRenderer>(basedir: string, webAuthn: boolean) => ListrTask<AuthGeneratorCtx, Renderer>;
|
|
35
|
-
export declare const addAuthConfigToGqlApi: <Renderer extends typeof ListrRenderer, FallbackRenderer extends typeof ListrRenderer>(authDecoderImport?: string) => {
|
|
36
|
-
title: string;
|
|
37
|
-
task: (ctx: AuthGeneratorCtx, _task: ListrTaskWrapper<AuthGeneratorCtx, Renderer, FallbackRenderer>) => void;
|
|
38
|
-
};
|
|
39
|
-
export type AuthSetupMode = 'FORCE' | 'REPLACE' | 'COMBINE' | 'UNKNOWN';
|
|
40
|
-
export interface AuthGeneratorCtx {
|
|
41
|
-
setupMode: AuthSetupMode;
|
|
42
|
-
provider: string;
|
|
43
|
-
force: boolean;
|
|
44
|
-
}
|
|
45
|
-
export declare const setAuthSetupMode: <Renderer extends typeof ListrRenderer, FallbackRenderer extends typeof ListrRenderer>(force: boolean) => {
|
|
46
|
-
title: string;
|
|
47
|
-
task: (ctx: AuthGeneratorCtx, task: ListrTaskWrapper<AuthGeneratorCtx, Renderer, FallbackRenderer>) => Promise<void>;
|
|
48
|
-
};
|
|
49
|
-
//# sourceMappingURL=authTasks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"authTasks.d.ts","sourceRoot":"","sources":["../../../src/auth/authTasks.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAA;AA2BxE,eAAO,MAAM,aAAa,cAA2B,CAAA;AAwDrD,eAAO,MAAM,YAAY,GAAI,+CAG1B;IACD,qBAAqB,EAAE,OAAO,CAAA;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,SAgDA,CAAA;AAmCD,eAAO,MAAM,eAAe,GAAI,SAAS,MAAM,YAE9C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,SAAS,MAAM,WA6CjD,CAAA;AAoED;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAC5B,QAAQ,SAAS,OAAO,aAAa,OAClC,SAAS,CAAC,gBAAgB,EAAE,QAAQ,CA8CxC,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,EAAE,UAAU,OAAO;;gBAgC1C,gBAAgB;CA0CrC,CAAA;AAED,eAAO,MAAM,iBAAiB;;;CAmB7B,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,SAAS,OAAO,aAAa,EACxE,SAAS,MAAM,EACf,UAAU,OAAO,KAChB,SAAS,CAAC,gBAAgB,EAAE,QAAQ,CAgDtC,CAAA;AASD,eAAO,MAAM,qBAAqB,GAChC,QAAQ,SAAS,OAAO,aAAa,EACrC,gBAAgB,SAAS,OAAO,aAAa,EAE7C,oBAAoB,MAAM;;gBAInB,gBAAgB,SACd,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,CAAC;CAcvE,CAAA;AAEF,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,SAAS,GACT,SAAS,GACT,SAAS,CAAA;AAEb,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,aAAa,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,OAAO,CAAA;CACf;AAED,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,SAAS,OAAO,aAAa,EACrC,gBAAgB,SAAS,OAAO,aAAa,EAE7C,OAAO,OAAO;;gBAKL,gBAAgB,QACf,gBAAgB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,CAAC;CA2CzE,CAAA"}
|