@cedarjs/auth-dbauth-setup 2.2.0 → 2.2.1-next.21
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/setupHandler.js +4 -4
- package/package.json +3 -3
package/dist/setupHandler.js
CHANGED
|
@@ -10,7 +10,7 @@ exports.handler = handler;
|
|
|
10
10
|
var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/includes"));
|
|
11
11
|
require("core-js/modules/es.array.push.js");
|
|
12
12
|
require("core-js/modules/esnext.json.parse.js");
|
|
13
|
-
var
|
|
13
|
+
var _nodeFs = _interopRequireDefault(require("node:fs"));
|
|
14
14
|
var _path = _interopRequireDefault(require("path"));
|
|
15
15
|
var _prompts = _interopRequireDefault(require("prompts"));
|
|
16
16
|
var _cliHelpers = require("@cedarjs/cli-helpers");
|
|
@@ -25,7 +25,7 @@ async function handler({
|
|
|
25
25
|
}) {
|
|
26
26
|
const {
|
|
27
27
|
version
|
|
28
|
-
} = JSON.parse(
|
|
28
|
+
} = JSON.parse(_nodeFs.default.readFileSync(_path.default.resolve(__dirname, '../package.json'), 'utf-8'));
|
|
29
29
|
const webAuthn = await shouldIncludeWebAuthn(webauthn);
|
|
30
30
|
const createDbUserModel = await shouldCreateUserModel(createUserModel);
|
|
31
31
|
const generateDbAuthPages = await shouldGenerateDbAuthPages(generateAuthPages);
|
|
@@ -135,7 +135,7 @@ const createAuthDecoderFunction = exports.createAuthDecoderFunction = {
|
|
|
135
135
|
throw new Error('Could not find your graphql file path');
|
|
136
136
|
}
|
|
137
137
|
const authDecoderCreation = 'const authDecoder = createAuthDecoder(cookieName)';
|
|
138
|
-
const content =
|
|
138
|
+
const content = _nodeFs.default.readFileSync(graphqlPath, 'utf-8');
|
|
139
139
|
let newContent = content.replace('import { getCurrentUser } from', 'import { cookieName, getCurrentUser } from');
|
|
140
140
|
const authDecoderCreationRegexp = new RegExp('^' + escapeRegExp(authDecoderCreation), 'm');
|
|
141
141
|
if (!authDecoderCreationRegexp.test(newContent)) {
|
|
@@ -144,7 +144,7 @@ const createAuthDecoderFunction = exports.createAuthDecoderFunction = {
|
|
|
144
144
|
if (!(0, _includes.default)(newContent).call(newContent, 'import { cookieName')) {
|
|
145
145
|
throw new Error('Failed to import cookieName');
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
_nodeFs.default.writeFileSync(graphqlPath, newContent);
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
150
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/auth-dbauth-setup",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1-next.21+014660ad1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime-corejs3": "7.28.4",
|
|
28
|
-
"@cedarjs/cli-helpers": "2.2.
|
|
28
|
+
"@cedarjs/cli-helpers": "2.2.1-next.21+014660ad1",
|
|
29
29
|
"@prisma/internals": "6.19.1",
|
|
30
30
|
"@simplewebauthn/browser": "9.0.1",
|
|
31
31
|
"core-js": "3.47.0",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "014660ad1d93c58cd848e67a370bf4856cd64a11"
|
|
48
48
|
}
|