@tidecloak/create-nextjs 0.0.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.
Files changed (42) hide show
  1. package/dist/cjs/create.cjs +139 -0
  2. package/dist/cjs/create.js.map +1 -0
  3. package/dist/esm/create.js +134 -0
  4. package/dist/esm/create.js.map +1 -0
  5. package/dist/types/create.d.ts +3 -0
  6. package/dist/types/create.d.ts.map +1 -0
  7. package/init/.env.example +8 -0
  8. package/init/realm.json +162 -0
  9. package/init/tcinit.sh +261 -0
  10. package/package.json +40 -0
  11. package/template-js-app/.env.example +0 -0
  12. package/template-js-app/app/api/protected/route.js +40 -0
  13. package/template-js-app/app/auth/redirect/page.jsx +46 -0
  14. package/template-js-app/app/home/page.jsx +101 -0
  15. package/template-js-app/app/layout.jsx +18 -0
  16. package/template-js-app/app/page.jsx +64 -0
  17. package/template-js-app/app/provider.jsx +11 -0
  18. package/template-js-app/init/.env.example +8 -0
  19. package/template-js-app/init/realm.json +162 -0
  20. package/template-js-app/init/tcinit.sh +261 -0
  21. package/template-js-app/jsconfig.json +9 -0
  22. package/template-js-app/middleware.js +31 -0
  23. package/template-js-app/next.config.js +5 -0
  24. package/template-js-app/package.json +17 -0
  25. package/template-js-app/public/silent-check-sso.html +1 -0
  26. package/template-js-app/tidecloak.json +1 -0
  27. package/template-ts-app/.env.example +0 -0
  28. package/template-ts-app/app/api/protected/route.ts +38 -0
  29. package/template-ts-app/app/auth/redirect/page.tsx +46 -0
  30. package/template-ts-app/app/home/page.tsx +101 -0
  31. package/template-ts-app/app/layout.tsx +24 -0
  32. package/template-ts-app/app/page.tsx +65 -0
  33. package/template-ts-app/app/provider.tsx +23 -0
  34. package/template-ts-app/init/.env.example +8 -0
  35. package/template-ts-app/init/realm.json +162 -0
  36. package/template-ts-app/init/tcinit.sh +261 -0
  37. package/template-ts-app/middleware.ts +44 -0
  38. package/template-ts-app/next.config.js +0 -0
  39. package/template-ts-app/package.json +22 -0
  40. package/template-ts-app/public/silent-check-sso.html +1 -0
  41. package/template-ts-app/tidecloak.json +1 -0
  42. package/template-ts-app/tsconfig.json +42 -0
@@ -0,0 +1,139 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const fs_1 = __importDefault(require("fs"));
8
+ const path_1 = __importDefault(require("path"));
9
+ const child_process_1 = require("child_process");
10
+ const enquirer_1 = __importDefault(require("enquirer"));
11
+ const { prompt } = enquirer_1.default;
12
+ async function main() {
13
+ const [, , targetDir] = process.argv;
14
+ if (!targetDir) {
15
+ console.error('Usage: create-nextjs <project-name>');
16
+ process.exit(1);
17
+ }
18
+ // 1. Select language
19
+ const { language } = await prompt({
20
+ type: 'select',
21
+ name: 'language',
22
+ message: 'Which language would you like?',
23
+ choices: ['TypeScript', 'JavaScript']
24
+ });
25
+ // 2. Scaffold template
26
+ const packageRoot = path_1.default.resolve(__dirname, '..', '..');
27
+ const templateName = language === 'TypeScript'
28
+ ? 'template-ts-app'
29
+ : 'template-js-app';
30
+ const templateDir = path_1.default.resolve(packageRoot, templateName);
31
+ fs_1.default.cpSync(templateDir, targetDir, { recursive: true });
32
+ console.log(`Scaffolded ${language} template into "${targetDir}"`);
33
+ // 3. Prompt for initialization
34
+ const { initialize } = await prompt({
35
+ type: 'confirm',
36
+ name: 'initialize',
37
+ message: 'Run TideCloak initialization now? Ensure your server is running.',
38
+ initial: true
39
+ });
40
+ if (initialize) {
41
+ // 4. Collect config values
42
+ const { tideUrl } = await prompt({
43
+ type: 'input',
44
+ name: 'tideUrl',
45
+ message: 'TideCloak server URL:',
46
+ initial: 'http://localhost:8080',
47
+ validate: (input) => input.trim() === input || 'No trailing spaces'
48
+ });
49
+ const { realmName } = await prompt({
50
+ type: 'input',
51
+ name: 'realmName',
52
+ message: 'Realm name:',
53
+ initial: 'nextjs-test',
54
+ validate: (input) => input.trim().length > 0 || 'Please enter a realm name'
55
+ });
56
+ const { clientName } = await prompt({
57
+ type: 'input',
58
+ name: 'clientName',
59
+ message: 'Client name:',
60
+ initial: 'myclient',
61
+ validate: (input) => input.trim().length > 0 || 'Please enter a client name'
62
+ });
63
+ const { clientAppUrl } = await prompt({
64
+ type: 'input',
65
+ name: 'clientAppUrl',
66
+ message: 'Client App URL (e.g. http://localhost:3000):',
67
+ initial: 'http://localhost:3000',
68
+ validate: (input) => input.trim().length > 0 || 'Please enter your app URL'
69
+ });
70
+ const { kcUser } = await prompt({
71
+ type: 'input',
72
+ name: 'kcUser',
73
+ message: 'Master admin username:',
74
+ initial: 'admin',
75
+ validate: (input) => input.trim().length > 0 || 'Please enter a username'
76
+ });
77
+ const { kcPassword } = await prompt({
78
+ type: 'input',
79
+ name: 'kcPassword',
80
+ message: 'Master admin password:',
81
+ initial: 'password',
82
+ validate: (input) => input.trim().length > 0 || 'Please enter a password'
83
+ });
84
+ // 5. Run initialization script
85
+ const { runInit } = await prompt({
86
+ type: 'confirm',
87
+ name: 'runInit',
88
+ message: 'Continue with tidecloak initialization?',
89
+ initial: true
90
+ });
91
+ if (runInit) {
92
+ console.log('Running tcinit.sh...');
93
+ try {
94
+ (0, child_process_1.execSync)(`bash "${path_1.default.resolve(packageRoot, 'init', 'tcinit.sh')}"`, {
95
+ cwd: path_1.default.resolve(process.cwd(), targetDir),
96
+ stdio: 'inherit',
97
+ env: {
98
+ ...process.env,
99
+ TIDECLOAK_LOCAL_URL: tideUrl,
100
+ NEW_REALM_NAME: realmName,
101
+ CLIENT_NAME: clientName,
102
+ CLIENT_APP_URL: clientAppUrl,
103
+ KC_USER: kcUser,
104
+ KC_PASSWORD: kcPassword
105
+ }
106
+ });
107
+ console.log('Initialization script completed successfully.');
108
+ // Move generated adapter config if present
109
+ const srcConfig = path_1.default.resolve(packageRoot, 'tidecloak.json');
110
+ const destConfig = path_1.default.resolve(process.cwd(), targetDir, 'tidecloak.json');
111
+ if (fs_1.default.existsSync(srcConfig)) {
112
+ fs_1.default.copyFileSync(srcConfig, destConfig);
113
+ console.log(`Adapter config moved to "${targetDir}/tidecloak.json"`);
114
+ }
115
+ else {
116
+ console.warn(`Adapter config not found at ${srcConfig}`);
117
+ }
118
+ }
119
+ catch (err) {
120
+ console.error('Initialization script error:', err.message);
121
+ console.log(`To retry: cd ${targetDir} && bash init/tcinit.sh`);
122
+ }
123
+ }
124
+ else {
125
+ console.log(`To run init later: cd ${targetDir} && bash init/tcinit.sh`);
126
+ }
127
+ }
128
+ else {
129
+ console.log('Initialization skipped.');
130
+ }
131
+ // 6. Final instructions
132
+ console.log(`"${targetDir}" is ready!`);
133
+ console.log(`cd ${targetDir} && npm install && npm run dev`);
134
+ }
135
+ main().catch((err) => {
136
+ console.error('Fatal error:', err);
137
+ process.exit(1);
138
+ });
139
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../create.ts"],"names":[],"mappings":";;;;;;AACA,4CAAmB;AACnB,gDAAuB;AACvB,iDAAwC;AACxC,wDAA+B;AAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,kBAAQ,CAAA;AAE3B,KAAK,UAAU,IAAI;IACjB,MAAM,CAAC,EAAE,AAAD,EAAG,SAAS,CAAC,GAAG,OAAO,CAAC,IAAgB,CAAA;IAChD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAA;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;IAED,qBAAqB;IACrB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAA4C;QAC3E,IAAI,EAAK,QAAQ;QACjB,IAAI,EAAK,UAAU;QACnB,OAAO,EAAE,gCAAgC;QACzC,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;KACtC,CAAC,CAAA;IAEF,uBAAuB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,GAAQ,EAAE,CAAC;gBAClB,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;gBAC1D,OAAO,CAAC,GAAG,CAAC,gBAAgB,SAAS,yBAAyB,CAAC,CAAA;YACjE,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,yBAAyB,SAAS,yBAAyB,CAAC,CAAA;QAC1E,CAAC;IACH,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAA;IACxC,CAAC;IAED,wBAAwB;IACxB,OAAO,CAAC,GAAG,CAAC,IAAI,SAAS,aAAa,CAAC,CAAA;IACvC,OAAO,CAAC,GAAG,CAAC,MAAM,SAAS,gCAAgC,CAAC,CAAA;AAC9D,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAA;IAClC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
@@ -0,0 +1,134 @@
1
+ #!/usr/bin/env node
2
+ import fs from 'fs';
3
+ import path from 'path';
4
+ import { execSync } from 'child_process';
5
+ import Enquirer from 'enquirer';
6
+ const { prompt } = Enquirer;
7
+ async function main() {
8
+ const [, , targetDir] = process.argv;
9
+ if (!targetDir) {
10
+ console.error('Usage: create-nextjs <project-name>');
11
+ process.exit(1);
12
+ }
13
+ // 1. Select language
14
+ const { language } = await prompt({
15
+ type: 'select',
16
+ name: 'language',
17
+ message: 'Which language would you like?',
18
+ choices: ['TypeScript', 'JavaScript']
19
+ });
20
+ // 2. Scaffold template
21
+ const packageRoot = path.resolve(__dirname, '..', '..');
22
+ const templateName = language === 'TypeScript'
23
+ ? 'template-ts-app'
24
+ : 'template-js-app';
25
+ const templateDir = path.resolve(packageRoot, templateName);
26
+ fs.cpSync(templateDir, targetDir, { recursive: true });
27
+ console.log(`Scaffolded ${language} template into "${targetDir}"`);
28
+ // 3. Prompt for initialization
29
+ const { initialize } = await prompt({
30
+ type: 'confirm',
31
+ name: 'initialize',
32
+ message: 'Run TideCloak initialization now? Ensure your server is running.',
33
+ initial: true
34
+ });
35
+ if (initialize) {
36
+ // 4. Collect config values
37
+ const { tideUrl } = await prompt({
38
+ type: 'input',
39
+ name: 'tideUrl',
40
+ message: 'TideCloak server URL:',
41
+ initial: 'http://localhost:8080',
42
+ validate: (input) => input.trim() === input || 'No trailing spaces'
43
+ });
44
+ const { realmName } = await prompt({
45
+ type: 'input',
46
+ name: 'realmName',
47
+ message: 'Realm name:',
48
+ initial: 'nextjs-test',
49
+ validate: (input) => input.trim().length > 0 || 'Please enter a realm name'
50
+ });
51
+ const { clientName } = await prompt({
52
+ type: 'input',
53
+ name: 'clientName',
54
+ message: 'Client name:',
55
+ initial: 'myclient',
56
+ validate: (input) => input.trim().length > 0 || 'Please enter a client name'
57
+ });
58
+ const { clientAppUrl } = await prompt({
59
+ type: 'input',
60
+ name: 'clientAppUrl',
61
+ message: 'Client App URL (e.g. http://localhost:3000):',
62
+ initial: 'http://localhost:3000',
63
+ validate: (input) => input.trim().length > 0 || 'Please enter your app URL'
64
+ });
65
+ const { kcUser } = await prompt({
66
+ type: 'input',
67
+ name: 'kcUser',
68
+ message: 'Master admin username:',
69
+ initial: 'admin',
70
+ validate: (input) => input.trim().length > 0 || 'Please enter a username'
71
+ });
72
+ const { kcPassword } = await prompt({
73
+ type: 'input',
74
+ name: 'kcPassword',
75
+ message: 'Master admin password:',
76
+ initial: 'password',
77
+ validate: (input) => input.trim().length > 0 || 'Please enter a password'
78
+ });
79
+ // 5. Run initialization script
80
+ const { runInit } = await prompt({
81
+ type: 'confirm',
82
+ name: 'runInit',
83
+ message: 'Continue with tidecloak initialization?',
84
+ initial: true
85
+ });
86
+ if (runInit) {
87
+ console.log('Running tcinit.sh...');
88
+ try {
89
+ execSync(`bash "${path.resolve(packageRoot, 'init', 'tcinit.sh')}"`, {
90
+ cwd: path.resolve(process.cwd(), targetDir),
91
+ stdio: 'inherit',
92
+ env: {
93
+ ...process.env,
94
+ TIDECLOAK_LOCAL_URL: tideUrl,
95
+ NEW_REALM_NAME: realmName,
96
+ CLIENT_NAME: clientName,
97
+ CLIENT_APP_URL: clientAppUrl,
98
+ KC_USER: kcUser,
99
+ KC_PASSWORD: kcPassword
100
+ }
101
+ });
102
+ console.log('Initialization script completed successfully.');
103
+ // Move generated adapter config if present
104
+ const srcConfig = path.resolve(packageRoot, 'tidecloak.json');
105
+ const destConfig = path.resolve(process.cwd(), targetDir, 'tidecloak.json');
106
+ if (fs.existsSync(srcConfig)) {
107
+ fs.copyFileSync(srcConfig, destConfig);
108
+ console.log(`Adapter config moved to "${targetDir}/tidecloak.json"`);
109
+ }
110
+ else {
111
+ console.warn(`Adapter config not found at ${srcConfig}`);
112
+ }
113
+ }
114
+ catch (err) {
115
+ console.error('Initialization script error:', err.message);
116
+ console.log(`To retry: cd ${targetDir} && bash init/tcinit.sh`);
117
+ }
118
+ }
119
+ else {
120
+ console.log(`To run init later: cd ${targetDir} && bash init/tcinit.sh`);
121
+ }
122
+ }
123
+ else {
124
+ console.log('Initialization skipped.');
125
+ }
126
+ // 6. Final instructions
127
+ console.log(`"${targetDir}" is ready!`);
128
+ console.log(`cd ${targetDir} && npm install && npm run dev`);
129
+ }
130
+ main().catch((err) => {
131
+ console.error('Fatal error:', err);
132
+ process.exit(1);
133
+ });
134
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../create.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,QAAQ,MAAM,UAAU,CAAA;AAE/B,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,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# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../create.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ TIDECLOAK_LOCAL_URL="http://localhost:8080"
2
+ CLIENT_NAME="myclient"
3
+ CLIENT_APP_URL="http://localhost:3000"
4
+ REALM_JSON_PATH="./realm.json"
5
+ NEW_REALM_NAME="nextjs-test"
6
+ KC_USER="admin"
7
+ KC_PASSWORD="password"
8
+ # ADAPTER_OUTPUT_PATH=""
@@ -0,0 +1,162 @@
1
+ {
2
+ "realm": "nextjs-test",
3
+ "accessTokenLifespan": 600,
4
+ "enabled": true,
5
+ "sslRequired": "external",
6
+ "registrationAllowed": false,
7
+ "duplicateEmailsAllowed": true,
8
+ "roles": {
9
+ "realm": [
10
+ {
11
+ "name": "appUser",
12
+ "description": "Standard application user"
13
+ },
14
+ {
15
+ "name": "_tide_dob.selfencrypt",
16
+ "description": "Tide E2EE self-encrypt DoB data"
17
+ },
18
+ {
19
+ "name": "_tide_dob.selfdecrypt",
20
+ "description": "Tide E2EE self-decrypt DoB data"
21
+ },
22
+ {
23
+ "name": "default-roles-nextjs-test",
24
+ "description": "${role_default-roles}",
25
+ "composite": true,
26
+ "composites": {
27
+ "realm": [
28
+ "_tide_dob.selfencrypt",
29
+ "_tide_dob.selfdecrypt",
30
+ "appUser"
31
+ ]
32
+ }
33
+ }
34
+ ],
35
+ "client": {
36
+ "myclient": []
37
+ }
38
+ },
39
+ "defaultRole": {
40
+ "name": "default-roles-nextjs-test",
41
+ "description": "${role_default-roles}",
42
+ "composite": true,
43
+ "clientRole": false
44
+ },
45
+ "clients": [
46
+ {
47
+ "clientId": "myclient",
48
+ "enabled": true,
49
+ "redirectUris": [
50
+ "http://localhost:3000",
51
+ "http://localhost:3000/*",
52
+ "http://localhost:3000/silent-check-sso.html",
53
+ "http://localhost:3000/auth/redirect"
54
+ ],
55
+ "webOrigins": [
56
+ "http://localhost:3000"
57
+ ],
58
+ "standardFlowEnabled": true,
59
+ "implicitFlowEnabled": false,
60
+ "publicClient": true,
61
+ "fullScopeAllowed": true,
62
+ "protocolMappers": [
63
+ {
64
+ "name": "Tide User Key",
65
+ "protocol": "openid-connect",
66
+ "protocolMapper": "oidc-usermodel-attribute-mapper",
67
+ "consentRequired": false,
68
+ "config": {
69
+ "introspection.token.claim": "true",
70
+ "userinfo.token.claim": "true",
71
+ "user.attribute": "tideUserKey",
72
+ "lightweight.claim": "true",
73
+ "id.token.claim": "true",
74
+ "access.token.claim": "true",
75
+ "claim.name": "tideuserkey",
76
+ "jsonType.label": "String"
77
+ }
78
+ },
79
+ {
80
+ "name": "Tide IGA Role Mapper",
81
+ "protocol": "openid-connect",
82
+ "protocolMapper": "tide-roles-mapper",
83
+ "consentRequired": false,
84
+ "config": {
85
+ "lightweight.claim": "true",
86
+ "access.token.claim": "true"
87
+ }
88
+ },
89
+ {
90
+ "name": "Tide vuid",
91
+ "protocol": "openid-connect",
92
+ "protocolMapper": "oidc-usermodel-attribute-mapper",
93
+ "consentRequired": false,
94
+ "config": {
95
+ "introspection.token.claim": "true",
96
+ "userinfo.token.claim": "true",
97
+ "user.attribute": "vuid",
98
+ "lightweight.claim": "true",
99
+ "id.token.claim": "true",
100
+ "access.token.claim": "true",
101
+ "claim.name": "vuid",
102
+ "jsonType.label": "String"
103
+ }
104
+ }
105
+ ]
106
+ }
107
+ ],
108
+ "components": {
109
+ "org.keycloak.userprofile.UserProfileProvider": [
110
+ {
111
+ "providerId": "declarative-user-profile",
112
+ "config": {
113
+ "kc.user.profile.config": [
114
+ "{\"attributes\":[{\"name\":\"username\",\"displayName\":\"${username}\",\"validations\":{\"length\":{\"min\":3,\"max\":255},\"username-prohibited-characters\":{},\"up-username-not-idn-homograph\":{}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"email\",\"displayName\":\"${email}\",\"validations\":{\"email\":{},\"length\":{\"max\":255}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"firstName\",\"displayName\":\"${firstName}\",\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"lastName\",\"displayName\":\"${lastName}\",\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false}],\"groups\":[{\"name\":\"user-metadata\",\"displayHeader\":\"User metadata\",\"displayDescription\":\"Attributes, which refer to user metadata\"}]}"
115
+ ]
116
+ }
117
+ }
118
+ ]
119
+ },
120
+ "authenticationFlows": [
121
+ {
122
+ "alias": "tidebrowser",
123
+ "providerId": "basic-flow",
124
+ "topLevel": true,
125
+ "authenticationExecutions": [
126
+ {
127
+ "authenticator": "auth-cookie",
128
+ "authenticatorFlow": false,
129
+ "requirement": "ALTERNATIVE",
130
+ "priority": 10,
131
+ "userSetupAllowed": false
132
+ },
133
+ {
134
+ "authenticatorConfig": "tide browser",
135
+ "authenticator": "identity-provider-redirector",
136
+ "authenticatorFlow": false,
137
+ "requirement": "ALTERNATIVE",
138
+ "priority": 25,
139
+ "userSetupAllowed": false
140
+ }
141
+ ]
142
+ }
143
+ ],
144
+ "authenticatorConfig": [
145
+ {
146
+ "alias": "tide browser",
147
+ "config": {
148
+ "defaultProvider": "tide"
149
+ }
150
+ }
151
+ ],
152
+ "browserFlow": "tidebrowser",
153
+ "requiredActions": [
154
+ {
155
+ "alias": "link-tide-account-action",
156
+ "name": "Link Tide Account",
157
+ "providerId": "link-tide-account-action",
158
+ "enabled": true
159
+ }
160
+ ],
161
+ "keycloakVersion": "26.1.4"
162
+ }