create-openfort 0.1.8 → 0.1.9
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/CHANGELOG.md +6 -0
- package/dist/index.js +7 -7
- package/package.json +1 -1
- package/template/backend/package.json +7 -1
- package/template/backend/pnpm-lock.yaml +186 -32
- package/template/backend/src/app.ts +1 -1
- package/template/openfort-templates/firebase/biome.json +3 -3
- package/template/openfort-templates/firebase/package.json +1 -1
- package/template/openfort-templates/firebase/src/App.tsx +10 -10
- package/template/openfort-templates/firebase/src/components/cards/head.tsx +157 -145
- package/template/openfort-templates/firebase/src/components/cards/main.tsx +63 -52
- package/template/openfort-templates/firebase/src/components/ui/Sheet.tsx +14 -16
- package/template/openfort-templates/firebase/src/components/ui/Tabs.tsx +46 -36
- package/template/openfort-templates/firebase/src/components/ui/TruncateData.tsx +14 -8
- package/template/openfort-templates/firebase/src/integrations/firebase/client.ts +6 -6
- package/template/openfort-templates/firebase/src/integrations/firebase/components/FirebaseAuthCard.tsx +74 -46
- package/template/openfort-templates/firebase/src/integrations/firebase/errors.ts +57 -37
- package/template/openfort-templates/firebase/src/integrations/firebase/index.ts +3 -3
- package/template/openfort-templates/firebase/src/integrations/openfort/index.ts +1 -1
- package/template/openfort-templates/firebase/src/integrations/openfort/providers.tsx +20 -11
- package/template/openfort-templates/firebase/src/ui/openfort/blockchain/ActionsCard.tsx +47 -35
- package/template/openfort-templates/firebase/src/ui/openfort/blockchain/SignCard.tsx +30 -28
- package/template/openfort-templates/firebase/src/ui/openfort/index.ts +4 -6
- package/template/openfort-templates/firebase/src/ui/openfort/profile/UserProfileCard.tsx +32 -20
- package/template/openfort-templates/firebase/src/ui/openfort/wallets/WalletCreation.tsx +51 -27
- package/template/openfort-templates/firebase/src/ui/openfort/wallets/WalletListCard.tsx +66 -40
- package/template/openfort-templates/firebase/src/ui/openfort/wallets/WalletPasswordSheets.tsx +65 -41
- package/template/openfort-templates/firebase/vite.config.ts +3 -3
- package/template/openfort-templates/headless/biome.json +3 -3
- package/template/openfort-templates/headless/package.json +1 -1
- package/template/openfort-templates/headless/src/components/cards/profile.tsx +1 -3
- package/template/openfort-templates/headless/src/index.css +10 -4
- package/template/openfort-templates/openfort-ui/biome.json +3 -3
- package/template/openfort-templates/openfort-ui/package.json +1 -1
- package/template/openfort-templates/openfort-ui/src/App.tsx +1 -3
- package/template/openfort-templates/openfort-ui/src/components/cards/auth.tsx +9 -11
- package/template/openfort-templates/openfort-ui/src/components/cards/head.tsx +157 -145
- package/template/openfort-templates/openfort-ui/src/components/cards/main.tsx +50 -41
- package/template/openfort-templates/openfort-ui/src/components/cards/profile.tsx +29 -35
- package/template/openfort-templates/openfort-ui/src/components/cards/sign.tsx +35 -49
- package/template/openfort-templates/openfort-ui/src/components/cards/wallets.tsx +51 -37
- package/template/openfort-templates/openfort-ui/src/components/createWallet.tsx +63 -30
- package/template/openfort-templates/openfort-ui/src/components/passwordRecovery.tsx +61 -56
- package/template/openfort-templates/openfort-ui/src/components/providers.tsx +11 -15
- package/template/openfort-templates/openfort-ui/src/components/ui/Sheet.tsx +14 -16
- package/template/openfort-templates/openfort-ui/src/components/ui/Tabs.tsx +46 -36
- package/template/openfort-templates/openfort-ui/src/components/ui/TruncateData.tsx +14 -8
- package/template/openfort-templates/openfort-ui/vite.config.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#159](https://github.com/openfort-xyz/openfort-react/pull/159) [`b21c4ee`](https://github.com/openfort-xyz/openfort-react/commit/b21c4ee4a08c84c92aa75d4d2a68c1e133afb2d2) Thanks [@jamalavedra](https://github.com/jamalavedra)! - update template
|
|
8
|
+
|
|
3
9
|
## 0.1.8
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import Oe from"
|
|
2
|
+
import Oe from"path";import G from"fs-extra";import*as p from"@clack/prompts";import De from"chalk";import{Command as Fe,Option as Ue}from"commander";import M from"path";import{fileURLToPath as Ie}from"url";var ve=Ie(import.meta.url),xe=M.dirname(ve),_=M.join(xe,"../"),z=` ___ ___ ___ _ _ ___ ___ ___ _____
|
|
3
3
|
/ _ \\| _ \\| __| \\| | __/ _ \\| _ \\_ _|
|
|
4
4
|
| (_) | _/| _|| | _| (_) | / | |
|
|
5
5
|
\\___/|_| |___|_|\\_|_| \\___/|_|_\\ |_|
|
|
6
|
-
`,b="openfort-project",L="create-openfort";var W=["openfort-ui","headless","firebase"],J=["auto","midnight","minimal","soft","web95","rounded","retro","nouns"];import Ne from"
|
|
6
|
+
`,b="openfort-project",L="create-openfort";var W=["openfort-ui","headless","firebase"],J=["auto","midnight","minimal","soft","web95","rounded","retro","nouns"];import Ne from"path";import ke from"fs-extra";var y=()=>{let e=Ne.join(_,"package.json");return ke.readJSONSync(e).version??"unknown"};var T=class extends Error{};var r={error:(...e)=>console.error(...e),warn:(...e)=>console.warn(...e),info:(...e)=>console.log(...e),success:(...e)=>console.log(...e),debug:(...e)=>console.log(...e)};import $e,{createHash as Z}from"crypto";import Ce from"https";import{hostname as Re,userInfo as Ae}from"os";var X="https://analytics.openfort.io",q="phc_HosujvcO5QzmU2MVvZo8AxWV0pplTZJLr3jEd8dRVPE",Le=()=>{let e=`${Re()}-${Ae().username}`;return Z("sha256").update(e).digest("hex").slice(0,16)},B=class{constructor(){this.enabled=!0;this.send=async({properties:o={},status:i})=>{if(r.debug("Sending telemetry...",{status:i,properties:o}),!this.enabled)return;if(!q||!X){r.warn("Telemetry is not configured properly. Please contact openfort developers at support@openfort.xyz.");return}let t={session_id:this.sessionId,cli_version:y(),node_version:process.version,platform:process.platform,cli_status:i,projectId:this.projectId,projectName:this.projectName,template:this.template,...o},n=JSON.stringify({api_key:q,event:"cli_tool_used",distinct_id:this.anonymousId,properties:t}),a=new URL(`${X}/capture/`),s={hostname:a.hostname,port:a.port||443,path:a.pathname,method:"POST",headers:{"Content-Type":"application/json","Content-Length":n.length}};return new Promise(c=>{let l=Ce.request(s,d=>{d.on("data",()=>{r.debug("Telemetry request response received",d.statusMessage)}),d.on("end",()=>{c()})});l.on("error",d=>{r.debug("Telemetry request error",d),c()}),l.write(n),l.end()})};this.anonymousId=Le(),this.sessionId=Z("sha256").update($e.randomBytes(16)).digest("hex").slice(0,15)}},g=new B;var x=e=>(e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e);var Be=/^(?:@[a-z0-9-*~][a-z0-9-*._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/,Q=e=>{let o=x(e),i=o.split("/"),t=i.findIndex(a=>a.startsWith("@")),n=i[i.length-1];if(i.findIndex(a=>a.startsWith("@"))!==-1&&(n=i.slice(t).join("/")),!(o==="."||Be.test(n??"")))return"App name must consist of only lowercase alphanumeric characters, '-', and '_'"};var ee="[\\da-f]{8}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{4}-[\\da-f]{12}",te=`(test|live)_${ee}`,Ke=new RegExp(`^sk_${te}$`),Ve=new RegExp(`^pk_${te}$`),He=new RegExp(`^${ee}$`),je=/^.{44}$/,P=({label:e,required:o=!0,regex:i,formatHint:t,customCheck:n})=>a=>{if(a!=="-"){if(o&&!a)return`${e} is required`;if(i&&a&&!i.test(a))return`${e} is invalid${t?` (${t})`:""}`;if(n)return n(a)}},ne=P({label:"Openfort Publishable Key",regex:Ve,formatHint:"expected format: pk_test_... or pk_live_..."}),oe=P({label:"Openfort Secret Key",regex:Ke,formatHint:"expected format: sk_test_... or sk_live_..."}),ie=P({label:"Shield Publishable Key",regex:He,formatHint:"expected UUID format"}),re=P({label:"Shield Secret",required:!0}),ae=P({label:"Shield Encryption Share",regex:je,formatHint:"expected 44 characters"}),se=P({label:"API endpoint",customCheck:e=>{try{new URL(e);return}catch{return"API endpoint must be a valid URL"}}}),le=async e=>{try{return!!(await(await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"}})).json()).session}catch{return!1}};var Ge={appName:b,template:"openfort-ui",createBackend:!0},pe=async()=>{let e=new Fe().name(L).description("A CLI for creating Openfort applications with embedded wallets").argument("[dir]","The name of the application, as well as the name of the directory to create").option("--noGit","Explicitly tell the CLI to not initialize a new git repo in the project",!1).option("--noInstall","Explicitly tell the CLI to not run the package manager's install command",!1).option("-y, --default","Bypass the CLI and use all default options to bootstrap a new Openfort app",!1).option("--CI","Boolean value if we're running in CI",!1).option("--template [string]","Specify the template to use").option("--theme [string]","Specify the theme to use (for openfort-ui template)").option("--noTelemetry","Disable sending anonymous usage data",!1).addOption(new Ue("--debug").hideHelp(!0)).version(y(),"-v, --version","Display the version number").addHelpText("afterAll",`
|
|
7
7
|
Learn more about Openfort at ${De.hex("#5B87F5").bold("https://www.openfort.xyz")}
|
|
8
8
|
`).parse(process.argv),o=e.args[0],i=e.opts();i.debug||(r.debug=()=>{}),g.enabled=!i.noTelemetry,r.debug("Telemetry enabled:",g.enabled),g.send({status:"started"});let t={...Ge,appName:o||b,flags:{noGit:i.noGit||!1,noInstall:i.noInstall||!1,default:i.default||!1,CI:i.CI||!1,template:i.template,theme:i.theme}};if(t.flags.CI)return t.template=i.template||"openfort-ui",t.theme=i.theme,t.createBackend=!1,t.openfortPublishableKey="pk_test_00000000-0000-0000-0000-000000000000",t.shieldPublishableKey="00000000-0000-0000-0000-000000000000",t;if(t.flags.default)return t.template="openfort-ui",t.createBackend=!1,t.openfortPublishableKey="",t.shieldPublishableKey="",t;try{if(process.env.TERM_PROGRAM?.toLowerCase().includes("mintty"))throw r.warn(` WARNING: It looks like you are using MinTTY, which is non-interactive. This is most likely because you are
|
|
9
9
|
using Git Bash. If that's that case, please use Git Bash from another terminal, such as Windows Terminal.`),new T("Non-interactive environment");let n=await p.group({...!o&&{name:()=>p.text({message:"What will your project be called?",defaultValue:b,validate:Q})},template:()=>p.select({message:"Select an Openfort template:",options:W.map(a=>({value:a,label:a==="openfort-ui"?"Openfort UI (default)":a,hint:Ye(a)})),initialValue:"openfort-ui"}),createBackend:()=>p.confirm({message:"Do you want to create a backend for automatic account recovery?",initialValue:!0}),apiEndpoint:async({results:a})=>{if(!a.createBackend){let s=await p.confirm({message:"Do you have an existing API endpoint for account recovery?",initialValue:!1});if(p.isCancel(s)&&process.exit(1),s){let c=!1,l="";for(;!c;){let d=await p.text({message:"Enter your API endpoint for creating encryption sessions:",placeholder:"http://localhost:3110/api/protected-create-encryption-session",validate:se});p.isCancel(d)&&process.exit(1),l=d;let u=p.spinner();if(u.start("Testing API endpoint..."),await le(l))u.stop("API endpoint validated!"),c=!0;else{u.stop("API endpoint validation failed"),r.error("The endpoint did not return a valid session response");let h=await p.confirm({message:"Would you like to try another endpoint?",initialValue:!0});(p.isCancel(h)||!h)&&process.exit(1)}}return l}}},theme:({results:a})=>{if(a.template==="openfort-ui")return p.select({message:"Select a theme:",options:J.map(s=>({value:s,label:s==="auto"?"Auto (default)":s})),initialValue:"auto"})},openfortPublishableKey:()=>p.text({message:"Enter your Project Publishable Key:",placeholder:"pk_test_...",validate:ne}),openfortSecretKey:({results:a})=>{if(a.createBackend)return p.text({message:"Enter your Project Secret Key:",placeholder:"sk_test_...",validate:oe})},shieldEncryptionShare:({results:a})=>{if(a.createBackend)return p.text({message:"Enter your Shield Encryption Share:",placeholder:"Your 44-character encryption share",validate:ae})},shieldPublishableKey:()=>p.text({message:"Enter your Shield Publishable Key:",placeholder:"00000000-0000-0000-0000-000000000000",validate:ie}),shieldSecretKey:({results:a})=>{if(a.createBackend)return p.text({message:"Enter your Shield Secret Key:",placeholder:"Your Shield Secret",validate:re})},...!t.flags.noGit&&{git:()=>p.confirm({message:"Should we initialize a Git repository and stage the changes?",initialValue:!0})}},{onCancel(){process.exit(1)}});return g.template=n.template,g.projectId=n.openfortPublishableKey,{appName:n.name||t.appName,template:n.template,theme:n.theme,createBackend:n.createBackend,apiEndpoint:n.apiEndpoint,openfortPublishableKey:n.openfortPublishableKey,openfortSecretKey:n.openfortSecretKey,shieldPublishableKey:n.shieldPublishableKey,shieldSecretKey:n.shieldSecretKey,shieldEncryptionShare:n.shieldEncryptionShare,flags:{...t.flags,noGit:!n.git||t.flags.noGit}}}catch(n){if(n instanceof T)return r.warn(`
|
|
10
|
-
${L} needs an interactive terminal to provide options`),await p.confirm({message:"Continue scaffolding a default Openfort app?",initialValue:!0})||(r.info("Exiting..."),process.exit(0)),r.info(`Bootstrapping a default Openfort app in ./${t.appName}`),{...t,template:"openfort-ui",createBackend:!1,openfortPublishableKey:"",shieldPublishableKey:""};throw n}};function Ye(e){switch(e){case"openfort-ui":return"Pre-built UI components";case"headless":return"Custom, unstyled components";case"firebase":return"With Firebase authentication";default:return""}}import ge from"
|
|
10
|
+
${L} needs an interactive terminal to provide options`),await p.confirm({message:"Continue scaffolding a default Openfort app?",initialValue:!0})||(r.info("Exiting..."),process.exit(0)),r.info(`Bootstrapping a default Openfort app in ./${t.appName}`),{...t,template:"openfort-ui",createBackend:!1,openfortPublishableKey:"",shieldPublishableKey:""};throw n}};function Ye(e){switch(e){case"openfort-ui":return"Pre-built UI components";case"headless":return"Custom, unstyled components";case"firebase":return"With Firebase authentication";default:return""}}import ge from"path";import N from"path";import k from"fs-extra";import Me from"ora";var ce=async({projectDir:e,openfortSecretKey:o,shieldSecretKey:i,shieldApiKey:t,shieldEncryptionShare:n,port:a=3110})=>{let s=Me("Creating backend...").start();try{let c=N.join(_,"template/backend"),l=N.join(e,"backend");k.copySync(c,l);let d=N.join(l,".env.example"),u=N.join(l,".env");if(k.existsSync(d)){let h=k.readFileSync(d,"utf-8").replace(/OPENFORT_SECRET_KEY=.*/g,`OPENFORT_SECRET_KEY=${o}`).replace(/SHIELD_SECRET_KEY=.*/g,`SHIELD_SECRET_KEY=${i}`).replace(/SHIELD_API_KEY=.*/g,`SHIELD_API_KEY=${t}`).replace(/SHIELD_ENCRYPTION_SHARE=.*/g,`SHIELD_ENCRYPTION_SHARE=${n}`).replace(/PORT=.*/g,`PORT=${a}`);k.writeFileSync(u,h)}await new Promise(m=>setTimeout(m,250)),s.succeed("Backend created successfully!")}catch(c){throw s.fail("Failed to create backend"),r.error(c instanceof Error?c.message:String(c)),c}};import de from"path";import*as E from"@clack/prompts";import S from"chalk";import w from"fs-extra";import ze from"ora";var fe=async({projectName:e,projectDir:o,template:i,createBackend:t})=>{r.info("");let n=ze(`Scaffolding in: ${o}...
|
|
11
11
|
`).start();if(w.existsSync(o))if(w.readdirSync(o).length===0)e!=="."&&n.info(`${S.cyan.bold(e)} exists but is empty, continuing...
|
|
12
12
|
`);else{n.stopAndPersist();let l=await E.select({message:`${S.redBright.bold("Warning:")} ${S.cyan.bold(e)} already exists and isn't empty. How would you like to proceed?`,options:[{label:"Abort installation (recommended)",value:"abort"},{label:"Clear the directory and continue installation",value:"clear"},{label:"Continue installation and overwrite conflicting files",value:"overwrite"}],initialValue:"abort"});(E.isCancel(l)||l==="abort")&&(n.fail("Aborting installation..."),process.exit(1));let d=await E.confirm({message:`Are you sure you want to ${l==="clear"?"clear the directory":"overwrite conflicting files"}?`,initialValue:!1});(E.isCancel(d)||!d)&&(n.fail("Aborting installation..."),process.exit(1)),l==="clear"&&(n.info(`Emptying ${S.cyan.bold(e)} and creating Openfort app..
|
|
13
13
|
`),w.emptyDirSync(o))}n.start(),w.mkdirSync(o,{recursive:!0});let a=de.join(_,"template/openfort-templates",i),s=t?de.join(o,"frontend"):o;w.copySync(a,s);let c=e==="."?"App":S.cyan.bold(e);await new Promise(l=>setTimeout(l,250)),n.succeed(`${c} ${S.green("scaffolded successfully!")}
|
|
14
|
-
`)};import me from"
|
|
14
|
+
`)};import me from"path";import $ from"fs-extra";var ue=({projectDir:e,openfortPublishableKey:o,shieldPublishableKey:i,apiEndpoint:t,theme:n})=>{let a=me.join(e,".env.example"),s=me.join(e,".env");if(!$.existsSync(a)){let d=We({openfortPublishableKey:o,shieldPublishableKey:i,apiEndpoint:t,theme:n});$.writeFileSync(s,d);return}let l=$.readFileSync(a,"utf-8");l=l.replace(/VITE_OPENFORT_PUBLISHABLE_KEY=.*/g,`VITE_OPENFORT_PUBLISHABLE_KEY=${o}`).replace(/NEXT_PUBLIC_OPENFORT_PUBLISHABLE_KEY=.*/g,`NEXT_PUBLIC_OPENFORT_PUBLISHABLE_KEY=${o}`).replace(/OPENFORT_PUBLISHABLE_KEY=.*/g,`OPENFORT_PUBLISHABLE_KEY=${o}`),l=l.replace(/VITE_SHIELD_PUBLISHABLE_KEY=.*/g,`VITE_SHIELD_PUBLISHABLE_KEY=${i}`).replace(/NEXT_PUBLIC_SHIELD_PUBLISHABLE_KEY=.*/g,`NEXT_PUBLIC_SHIELD_PUBLISHABLE_KEY=${i}`).replace(/SHIELD_PUBLISHABLE_KEY=.*/g,`SHIELD_PUBLISHABLE_KEY=${i}`),t&&(l=l.replace(/VITE_CREATE_ENCRYPTED_SESSION_ENDPOINT=.*/g,`VITE_CREATE_ENCRYPTED_SESSION_ENDPOINT=${t}`).replace(/NEXT_PUBLIC_CREATE_ENCRYPTED_SESSION_ENDPOINT=.*/g,`NEXT_PUBLIC_CREATE_ENCRYPTED_SESSION_ENDPOINT=${t}`).replace(/CREATE_ENCRYPTED_SESSION_ENDPOINT=.*/g,`CREATE_ENCRYPTED_SESSION_ENDPOINT=${t}`)),n&&(l=l.replace(/VITE_OPENFORT_THEME=.*/g,`VITE_OPENFORT_THEME=${n}`).replace(/NEXT_PUBLIC_OPENFORT_THEME=.*/g,`NEXT_PUBLIC_OPENFORT_THEME=${n}`).replace(/OPENFORT_THEME=.*/g,`OPENFORT_THEME=${n}`)),$.writeFileSync(s,l)},We=({openfortPublishableKey:e,shieldPublishableKey:o,apiEndpoint:i,theme:t})=>{let n=`# Openfort Configuration
|
|
15
15
|
VITE_OPENFORT_PUBLISHABLE_KEY=${e}
|
|
16
16
|
VITE_SHIELD_PUBLISHABLE_KEY=${o}
|
|
17
17
|
`;return i&&(n+=`VITE_CREATE_ENCRYPTED_SESSION_ENDPOINT=${i}
|
|
18
18
|
`),t&&(n+=`VITE_OPENFORT_THEME=${t}
|
|
19
|
-
`),n};var he=async({projectName:e,template:o,openfortPublishableKey:i,shieldPublishableKey:t,apiEndpoint:n,theme:a,createBackendOption:s,openfortSecretKey:c,shieldSecretKey:l,shieldApiKey:d,shieldEncryptionShare:u})=>{let m=ge.resolve(process.cwd(),e);await fe({projectName:e,projectDir:m,template:o,createBackend:s});let h=s?ge.join(m,"frontend"):m;return ue({projectDir:h,openfortPublishableKey:i,shieldPublishableKey:t,apiEndpoint:n,theme:a}),s&&c&&l&&d&&u&&await ce({projectDir:m,openfortSecretKey:c,shieldSecretKey:l,shieldApiKey:d,shieldEncryptionShare:u}),r.info("All done!"),m};import{execSync as H}from"
|
|
19
|
+
`),n};var he=async({projectName:e,template:o,openfortPublishableKey:i,shieldPublishableKey:t,apiEndpoint:n,theme:a,createBackendOption:s,openfortSecretKey:c,shieldSecretKey:l,shieldApiKey:d,shieldEncryptionShare:u})=>{let m=ge.resolve(process.cwd(),e);await fe({projectName:e,projectDir:m,template:o,createBackend:s});let h=s?ge.join(m,"frontend"):m;return ue({projectDir:h,openfortPublishableKey:i,shieldPublishableKey:t,apiEndpoint:n,theme:a}),s&&c&&l&&d&&u&&await ce({projectDir:m,openfortSecretKey:c,shieldSecretKey:l,shieldApiKey:d,shieldEncryptionShare:u}),r.info("All done!"),m};import{execSync as H}from"child_process";import K from"path";import*as V from"@clack/prompts";import O from"chalk";import{execa as I}from"execa";import ye from"fs-extra";import Je from"ora";var Xe=e=>{try{return H("git --version",{cwd:e}),!0}catch{return!1}},j=e=>ye.existsSync(K.join(e,".git")),D=async e=>{try{return await I("git",["rev-parse","--is-inside-work-tree"],{cwd:e,stdout:"ignore"}),!0}catch{return!1}},qe=()=>{let o=H("git --version").toString().trim().split(" ")[2],i=o?.split(".")[0],t=o?.split(".")[1];return{major:Number(i),minor:Number(t)}},Ze=()=>H("git config --global init.defaultBranch || echo main").toString().trim(),Ee=async e=>{if(r.info("Initializing Git..."),!Xe(e)){r.warn("Git is not installed. Skipping Git initialization.");return}let o=Je(`Creating a new git repo...
|
|
20
20
|
`).start(),i=j(e),t=await D(e),n=K.parse(e).name;if(t&&i){if(o.stop(),!await V.confirm({message:`${O.redBright.bold("Warning:")} Git is already initialized in "${n}". Initializing a new git repository would delete the previous history. Would you like to continue anyways?`,initialValue:!1})){o.info("Skipping Git initialization.");return}ye.removeSync(K.join(e,".git"))}else if(t&&!i&&(o.stop(),!await V.confirm({message:`${O.redBright.bold("Warning:")} "${n}" is already in a git worktree. Would you still like to initialize a new git repository in this directory?`,initialValue:!1}))){o.info("Skipping Git initialization.");return}try{let a=Ze(),{major:s,minor:c}=qe();s<2||s===2&&c<28?(await I("git",["init"],{cwd:e}),await I("git",["symbolic-ref","HEAD",`refs/heads/${a}`],{cwd:e})):await I("git",["init",`--initial-branch=${a}`],{cwd:e}),await I("git",["add","."],{cwd:e}),o.succeed(`${O.green("Successfully initialized and staged")} ${O.green.bold("git")}
|
|
21
21
|
`)}catch{o.fail(`${O.bold.red("Failed:")} could not initialize git. Update git to the latest version!
|
|
22
|
-
`)}};import F from"
|
|
22
|
+
`)}};import F from"path";import f from"chalk";import U from"fs-extra";var C=()=>{let e=process.env.npm_config_user_agent;return e?e.startsWith("yarn")?"yarn":e.startsWith("pnpm")?"pnpm":e.startsWith("bun")?"bun":"npm":"npm"};var _e=async({projectName:e=b,projectDir:o,createBackend:i})=>{let t=C();if(r.info(`
|
|
23
23
|
${f.green("Success! Your Openfort project is ready.")}`),r.info(`
|
|
24
24
|
Next steps:`),e!=="."&&r.info(` ${f.cyan(`cd ${e}`)}`),i){let n=F.join(o,"backend","node_modules"),a=F.join(o,"frontend","node_modules"),s=!U.existsSync(n)||!U.existsSync(a);r.info(`
|
|
25
25
|
${f.yellow("For the backend:")}`),r.info(` ${f.cyan("cd backend")}`),s&&(t==="yarn"?r.info(` ${f.cyan(t)}`):r.info(` ${f.cyan(`${t} install`)}`)),["npm","bun"].includes(t)?r.info(` ${f.cyan(`${t} run dev`)}`):r.info(` ${f.cyan(`${t} dev`)}`),r.info(`
|
|
26
26
|
${f.yellow("For the frontend (in a new terminal):")}`),r.info(` ${f.cyan("cd frontend")}`),s&&(t==="yarn"?r.info(` ${f.cyan(t)}`):r.info(` ${f.cyan(`${t} install`)}`)),["npm","bun"].includes(t)?r.info(` ${f.cyan(`${t} run dev`)}`):r.info(` ${f.cyan(`${t} dev`)}`)}else{let n=F.join(o,"node_modules");!U.existsSync(n)&&(t==="yarn"?r.info(` ${f.cyan(t)}`):r.info(` ${f.cyan(`${t} install`)}`)),["npm","bun"].includes(t)?r.info(` ${f.cyan(`${t} run dev`)}`):r.info(` ${f.cyan(`${t} dev`)}`)}!await D(o)&&!j(o)&&(r.info(`
|
|
27
27
|
${f.cyan("git init")}`),r.info(` ${f.cyan('git commit -m "initial commit"')}`)),r.info(`
|
|
28
|
-
${f.blue("Learn more at https://www.openfort.xyz/docs")}`)};import be from"
|
|
28
|
+
${f.blue("Learn more at https://www.openfort.xyz/docs")}`)};import be from"path";var Pe=e=>{let i=x(e).split("/"),t=i[i.length-1];if(t==="."){let s=be.resolve(process.cwd());t=be.basename(s)}let n=i.findIndex(s=>s.startsWith("@"));i.findIndex(s=>s.startsWith("@"))!==-1&&(t=i.slice(n).join("/"));let a=i.filter(s=>!s.startsWith("@")).join("/");return[t,a]};import Qe from"gradient-string";var et=["#c3c3c3ff","#ff3b30"],Se=async()=>{let e=Qe(et),o=C();(o==="yarn"||o==="pnpm")&&console.log(""),console.log(e.multiline(z))};import{execSync as tt}from"child_process";import nt from"https";var Te=e=>{let o=y();o.includes("beta")?(r.warn(" You are using a beta version of create-openfort."),r.warn(" Please report any bugs you encounter.")):o.includes("next")?(r.warn(" You are running create-openfort with the @next tag which is no longer maintained."),r.warn(" Please run the CLI with @latest instead.")):o!==e&&(r.warn(" You are using an outdated version of create-openfort."),r.warn(" Your version:",`${o}.`,"Latest version in the npm registry:",e),r.warn(" Please run the CLI with @latest to get the latest updates."))};function ot(){return new Promise((e,o)=>{nt.get("https://registry.npmjs.org/-/package/create-openfort/dist-tags",i=>{if(i.statusCode===200){let t="";i.on("data",n=>{t+=n}),i.on("end",()=>{e(JSON.parse(t).latest)})}else o()}).on("error",()=>{o()})})}var we=()=>ot().catch(()=>{try{return tt("npm view create-openfort version").toString().trim()}catch{return null}});var it=async()=>{let e=await we();await Se(),e&&Te(e);let{appName:o,template:i,theme:t,createBackend:n,apiEndpoint:a,openfortPublishableKey:s,openfortSecretKey:c,shieldPublishableKey:l,shieldSecretKey:d,shieldEncryptionShare:u,flags:{noGit:m}}=await pe(),[h,Y]=Pe(o);g.projectName=h;let v=await he({projectName:Y,template:i,openfortPublishableKey:s,shieldPublishableKey:l,apiEndpoint:a||(n?"http://localhost:3110/api/protected-create-encryption-session":void 0),theme:t,createBackendOption:n,openfortSecretKey:c,shieldSecretKey:d,shieldApiKey:l,shieldEncryptionShare:u}),R=n?Oe.join(v,"frontend","package.json"):Oe.join(v,"package.json");if(G.existsSync(R)){let A=G.readJSONSync(R);A.name=h,A.openfortMetadata={initVersion:y(),template:i},G.writeJSONSync(R,A,{spaces:2})}m||await Ee(v),await _e({projectName:Y,projectDir:v,createBackend:n}),g.send({status:"completed"}),process.exit(0)};it().catch(e=>{r.error("Aborting installation..."),e instanceof Error?r.error(e):r.error("An unknown error has occurred. Please open an issue on GitHub with the below:"),g.send({status:"error",properties:{error:e instanceof Error?e.message:String(e)}}),process.exit(1)});
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "auth-sample-backend",
|
|
3
3
|
"packageManager": "pnpm@9.15.4",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@openfort/openfort-node": "^0.
|
|
5
|
+
"@openfort/openfort-node": "^0.7.1",
|
|
6
6
|
"cors": "^2.8.5",
|
|
7
7
|
"express": "^4.21.2"
|
|
8
8
|
},
|
|
@@ -21,5 +21,11 @@
|
|
|
21
21
|
"format": "biome format --write .",
|
|
22
22
|
"lint": "biome lint .",
|
|
23
23
|
"check": "biome check --write ."
|
|
24
|
+
},
|
|
25
|
+
"pnpm": {
|
|
26
|
+
"overrides": {
|
|
27
|
+
"qs@<6.14.1": ">=6.14.1",
|
|
28
|
+
"diff@<8.0.3": ">=8.0.3"
|
|
29
|
+
}
|
|
24
30
|
}
|
|
25
31
|
}
|
|
@@ -4,13 +4,17 @@ settings:
|
|
|
4
4
|
autoInstallPeers: true
|
|
5
5
|
excludeLinksFromLockfile: false
|
|
6
6
|
|
|
7
|
+
overrides:
|
|
8
|
+
qs@<6.14.1: '>=6.14.1'
|
|
9
|
+
diff@<8.0.3: '>=8.0.3'
|
|
10
|
+
|
|
7
11
|
importers:
|
|
8
12
|
|
|
9
13
|
.:
|
|
10
14
|
dependencies:
|
|
11
15
|
'@openfort/openfort-node':
|
|
12
|
-
specifier: ^0.
|
|
13
|
-
version: 0.
|
|
16
|
+
specifier: ^0.7.1
|
|
17
|
+
version: 0.7.1(typescript@5.9.3)
|
|
14
18
|
cors:
|
|
15
19
|
specifier: ^2.8.5
|
|
16
20
|
version: 2.8.5
|
|
@@ -39,6 +43,9 @@ importers:
|
|
|
39
43
|
|
|
40
44
|
packages:
|
|
41
45
|
|
|
46
|
+
'@adraffy/ens-normalize@1.11.1':
|
|
47
|
+
resolution: {integrity: sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==}
|
|
48
|
+
|
|
42
49
|
'@biomejs/biome@1.9.4':
|
|
43
50
|
resolution: {integrity: sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==}
|
|
44
51
|
engines: {node: '>=14.21.3'}
|
|
@@ -106,11 +113,32 @@ packages:
|
|
|
106
113
|
'@jridgewell/trace-mapping@0.3.9':
|
|
107
114
|
resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
|
|
108
115
|
|
|
109
|
-
'@
|
|
110
|
-
resolution: {integrity: sha512-
|
|
116
|
+
'@noble/ciphers@1.3.0':
|
|
117
|
+
resolution: {integrity: sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==}
|
|
118
|
+
engines: {node: ^14.21.3 || >=16}
|
|
119
|
+
|
|
120
|
+
'@noble/curves@1.9.1':
|
|
121
|
+
resolution: {integrity: sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==}
|
|
122
|
+
engines: {node: ^14.21.3 || >=16}
|
|
123
|
+
|
|
124
|
+
'@noble/hashes@1.8.0':
|
|
125
|
+
resolution: {integrity: sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==}
|
|
126
|
+
engines: {node: ^14.21.3 || >=16}
|
|
127
|
+
|
|
128
|
+
'@openfort/openfort-node@0.7.1':
|
|
129
|
+
resolution: {integrity: sha512-kICE1mojqQxIiP3eLzJby90oC5SE/qgwNqy3mmvw9Uyyer8wmAB5XzUILloi4N9m30gJh1PDM2QYqjRpkSYq3Q==}
|
|
111
130
|
|
|
112
|
-
'@openfort/shield-js@0.1.
|
|
113
|
-
resolution: {integrity: sha512-
|
|
131
|
+
'@openfort/shield-js@0.1.33':
|
|
132
|
+
resolution: {integrity: sha512-fHMMwYlThcvhXyB4/EVGpSIWzLwbsxdnv81kRTphpnyzieCvV8t43od2NoAthpr8HrtpklLdQZAotGU6VYPBmg==}
|
|
133
|
+
|
|
134
|
+
'@scure/base@1.2.6':
|
|
135
|
+
resolution: {integrity: sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg==}
|
|
136
|
+
|
|
137
|
+
'@scure/bip32@1.7.0':
|
|
138
|
+
resolution: {integrity: sha512-E4FFX/N3f4B80AKWp5dP6ow+flD1LQZo/w8UnLGYZO674jS6YnYeepycOOksv+vLPSpgN35wgKgy+ybfTb2SMw==}
|
|
139
|
+
|
|
140
|
+
'@scure/bip39@1.6.0':
|
|
141
|
+
resolution: {integrity: sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==}
|
|
114
142
|
|
|
115
143
|
'@tsconfig/node10@1.0.11':
|
|
116
144
|
resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==}
|
|
@@ -172,6 +200,17 @@ packages:
|
|
|
172
200
|
'@types/strip-json-comments@0.0.30':
|
|
173
201
|
resolution: {integrity: sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==}
|
|
174
202
|
|
|
203
|
+
abitype@1.2.3:
|
|
204
|
+
resolution: {integrity: sha512-Ofer5QUnuUdTFsBRwARMoWKOH1ND5ehwYhJ3OJ/BQO+StkwQjHw0XyVh4vDttzHB7QOFhPHa/o413PJ82gU/Tg==}
|
|
205
|
+
peerDependencies:
|
|
206
|
+
typescript: '>=5.0.4'
|
|
207
|
+
zod: ^3.22.0 || ^4.0.0
|
|
208
|
+
peerDependenciesMeta:
|
|
209
|
+
typescript:
|
|
210
|
+
optional: true
|
|
211
|
+
zod:
|
|
212
|
+
optional: true
|
|
213
|
+
|
|
175
214
|
accepts@1.3.8:
|
|
176
215
|
resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==}
|
|
177
216
|
engines: {node: '>= 0.6'}
|
|
@@ -209,6 +248,9 @@ packages:
|
|
|
209
248
|
balanced-match@1.0.2:
|
|
210
249
|
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
|
|
211
250
|
|
|
251
|
+
base-x@5.0.1:
|
|
252
|
+
resolution: {integrity: sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==}
|
|
253
|
+
|
|
212
254
|
binary-extensions@2.3.0:
|
|
213
255
|
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
|
|
214
256
|
engines: {node: '>=8'}
|
|
@@ -224,6 +266,9 @@ packages:
|
|
|
224
266
|
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
|
|
225
267
|
engines: {node: '>=8'}
|
|
226
268
|
|
|
269
|
+
bs58@6.0.0:
|
|
270
|
+
resolution: {integrity: sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==}
|
|
271
|
+
|
|
227
272
|
buffer-from@1.1.2:
|
|
228
273
|
resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
|
|
229
274
|
|
|
@@ -292,8 +337,8 @@ packages:
|
|
|
292
337
|
resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==}
|
|
293
338
|
engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}
|
|
294
339
|
|
|
295
|
-
diff@
|
|
296
|
-
resolution: {integrity: sha512-
|
|
340
|
+
diff@8.0.3:
|
|
341
|
+
resolution: {integrity: sha512-qejHi7bcSD4hQAZE0tNAawRK1ZtafHDmMTMkrrIGgSLl7hTnQHmKCeB45xAcbfTqK2zowkM3j3bHt/4b/ARbYQ==}
|
|
297
342
|
engines: {node: '>=0.3.1'}
|
|
298
343
|
|
|
299
344
|
dunder-proto@1.0.1:
|
|
@@ -337,6 +382,9 @@ packages:
|
|
|
337
382
|
resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==}
|
|
338
383
|
engines: {node: '>= 0.6'}
|
|
339
384
|
|
|
385
|
+
eventemitter3@5.0.1:
|
|
386
|
+
resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==}
|
|
387
|
+
|
|
340
388
|
express@4.21.2:
|
|
341
389
|
resolution: {integrity: sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==}
|
|
342
390
|
engines: {node: '>= 0.10.0'}
|
|
@@ -358,10 +406,6 @@ packages:
|
|
|
358
406
|
debug:
|
|
359
407
|
optional: true
|
|
360
408
|
|
|
361
|
-
form-data@2.5.5:
|
|
362
|
-
resolution: {integrity: sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A==}
|
|
363
|
-
engines: {node: '>= 0.12'}
|
|
364
|
-
|
|
365
409
|
form-data@4.0.4:
|
|
366
410
|
resolution: {integrity: sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==}
|
|
367
411
|
engines: {node: '>= 6'}
|
|
@@ -460,6 +504,14 @@ packages:
|
|
|
460
504
|
resolution: {integrity: sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg==}
|
|
461
505
|
engines: {node: '>=10'}
|
|
462
506
|
|
|
507
|
+
isows@1.0.7:
|
|
508
|
+
resolution: {integrity: sha512-I1fSfDCZL5P0v33sVqeTDSpcstAg/N+wF5HS033mogOVIp4B+oHC7oOCsA3axAbBSGTJ8QubbNmnIRN/h8U7hg==}
|
|
509
|
+
peerDependencies:
|
|
510
|
+
ws: '*'
|
|
511
|
+
|
|
512
|
+
jose@5.10.0:
|
|
513
|
+
resolution: {integrity: sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==}
|
|
514
|
+
|
|
463
515
|
make-error@1.3.6:
|
|
464
516
|
resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==}
|
|
465
517
|
|
|
@@ -540,6 +592,14 @@ packages:
|
|
|
540
592
|
once@1.4.0:
|
|
541
593
|
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
|
|
542
594
|
|
|
595
|
+
ox@0.11.3:
|
|
596
|
+
resolution: {integrity: sha512-1bWYGk/xZel3xro3l8WGg6eq4YEKlaqvyMtVhfMFpbJzK2F6rj4EDRtqDCWVEJMkzcmEi9uW2QxsqELokOlarw==}
|
|
597
|
+
peerDependencies:
|
|
598
|
+
typescript: '>=5.4.0'
|
|
599
|
+
peerDependenciesMeta:
|
|
600
|
+
typescript:
|
|
601
|
+
optional: true
|
|
602
|
+
|
|
543
603
|
parseurl@1.3.3:
|
|
544
604
|
resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==}
|
|
545
605
|
engines: {node: '>= 0.8'}
|
|
@@ -565,8 +625,8 @@ packages:
|
|
|
565
625
|
proxy-from-env@1.1.0:
|
|
566
626
|
resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
|
|
567
627
|
|
|
568
|
-
qs@6.
|
|
569
|
-
resolution: {integrity: sha512
|
|
628
|
+
qs@6.14.1:
|
|
629
|
+
resolution: {integrity: sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==}
|
|
570
630
|
engines: {node: '>=0.6'}
|
|
571
631
|
|
|
572
632
|
range-parser@1.2.1:
|
|
@@ -717,6 +777,14 @@ packages:
|
|
|
717
777
|
resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}
|
|
718
778
|
engines: {node: '>= 0.8'}
|
|
719
779
|
|
|
780
|
+
viem@2.44.4:
|
|
781
|
+
resolution: {integrity: sha512-sJDLVl2EsS5Fo7GSWZME5CXEV7QRYkUJPeBw7ac+4XI3D4ydvMw/gjulTsT5pgqcpu70BploFnOAC6DLpan1Yg==}
|
|
782
|
+
peerDependencies:
|
|
783
|
+
typescript: '>=5.0.4'
|
|
784
|
+
peerDependenciesMeta:
|
|
785
|
+
typescript:
|
|
786
|
+
optional: true
|
|
787
|
+
|
|
720
788
|
webidl-conversions@3.0.1:
|
|
721
789
|
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
|
|
722
790
|
|
|
@@ -726,6 +794,18 @@ packages:
|
|
|
726
794
|
wrappy@1.0.2:
|
|
727
795
|
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
|
|
728
796
|
|
|
797
|
+
ws@8.18.3:
|
|
798
|
+
resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==}
|
|
799
|
+
engines: {node: '>=10.0.0'}
|
|
800
|
+
peerDependencies:
|
|
801
|
+
bufferutil: ^4.0.1
|
|
802
|
+
utf-8-validate: '>=5.0.2'
|
|
803
|
+
peerDependenciesMeta:
|
|
804
|
+
bufferutil:
|
|
805
|
+
optional: true
|
|
806
|
+
utf-8-validate:
|
|
807
|
+
optional: true
|
|
808
|
+
|
|
729
809
|
xtend@4.0.2:
|
|
730
810
|
resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==}
|
|
731
811
|
engines: {node: '>=0.4'}
|
|
@@ -736,6 +816,8 @@ packages:
|
|
|
736
816
|
|
|
737
817
|
snapshots:
|
|
738
818
|
|
|
819
|
+
'@adraffy/ens-normalize@1.11.1': {}
|
|
820
|
+
|
|
739
821
|
'@biomejs/biome@1.9.4':
|
|
740
822
|
optionalDependencies:
|
|
741
823
|
'@biomejs/cli-darwin-arm64': 1.9.4
|
|
@@ -784,24 +866,53 @@ snapshots:
|
|
|
784
866
|
'@jridgewell/resolve-uri': 3.1.2
|
|
785
867
|
'@jridgewell/sourcemap-codec': 1.5.5
|
|
786
868
|
|
|
787
|
-
'@
|
|
869
|
+
'@noble/ciphers@1.3.0': {}
|
|
870
|
+
|
|
871
|
+
'@noble/curves@1.9.1':
|
|
788
872
|
dependencies:
|
|
789
|
-
'@
|
|
873
|
+
'@noble/hashes': 1.8.0
|
|
874
|
+
|
|
875
|
+
'@noble/hashes@1.8.0': {}
|
|
876
|
+
|
|
877
|
+
'@openfort/openfort-node@0.7.1(typescript@5.9.3)':
|
|
878
|
+
dependencies:
|
|
879
|
+
'@openfort/shield-js': 0.1.33
|
|
790
880
|
'@types/node': 22.18.11
|
|
791
881
|
'@types/node-fetch': 2.6.13
|
|
792
|
-
|
|
882
|
+
axios: 1.12.2
|
|
883
|
+
axios-retry: 4.5.0(axios@1.12.2)
|
|
884
|
+
bs58: 6.0.0
|
|
885
|
+
jose: 5.10.0
|
|
793
886
|
node-fetch: 2.7.0
|
|
887
|
+
viem: 2.44.4(typescript@5.9.3)
|
|
794
888
|
transitivePeerDependencies:
|
|
889
|
+
- bufferutil
|
|
795
890
|
- debug
|
|
796
891
|
- encoding
|
|
892
|
+
- typescript
|
|
893
|
+
- utf-8-validate
|
|
894
|
+
- zod
|
|
797
895
|
|
|
798
|
-
'@openfort/shield-js@0.1.
|
|
896
|
+
'@openfort/shield-js@0.1.33':
|
|
799
897
|
dependencies:
|
|
800
898
|
axios: 1.12.2
|
|
801
899
|
axios-retry: 4.5.0(axios@1.12.2)
|
|
802
900
|
transitivePeerDependencies:
|
|
803
901
|
- debug
|
|
804
902
|
|
|
903
|
+
'@scure/base@1.2.6': {}
|
|
904
|
+
|
|
905
|
+
'@scure/bip32@1.7.0':
|
|
906
|
+
dependencies:
|
|
907
|
+
'@noble/curves': 1.9.1
|
|
908
|
+
'@noble/hashes': 1.8.0
|
|
909
|
+
'@scure/base': 1.2.6
|
|
910
|
+
|
|
911
|
+
'@scure/bip39@1.6.0':
|
|
912
|
+
dependencies:
|
|
913
|
+
'@noble/hashes': 1.8.0
|
|
914
|
+
'@scure/base': 1.2.6
|
|
915
|
+
|
|
805
916
|
'@tsconfig/node10@1.0.11': {}
|
|
806
917
|
|
|
807
918
|
'@tsconfig/node12@1.0.11': {}
|
|
@@ -872,6 +983,10 @@ snapshots:
|
|
|
872
983
|
|
|
873
984
|
'@types/strip-json-comments@0.0.30': {}
|
|
874
985
|
|
|
986
|
+
abitype@1.2.3(typescript@5.9.3):
|
|
987
|
+
optionalDependencies:
|
|
988
|
+
typescript: 5.9.3
|
|
989
|
+
|
|
875
990
|
accepts@1.3.8:
|
|
876
991
|
dependencies:
|
|
877
992
|
mime-types: 2.1.35
|
|
@@ -909,6 +1024,8 @@ snapshots:
|
|
|
909
1024
|
|
|
910
1025
|
balanced-match@1.0.2: {}
|
|
911
1026
|
|
|
1027
|
+
base-x@5.0.1: {}
|
|
1028
|
+
|
|
912
1029
|
binary-extensions@2.3.0: {}
|
|
913
1030
|
|
|
914
1031
|
body-parser@1.20.3:
|
|
@@ -921,7 +1038,7 @@ snapshots:
|
|
|
921
1038
|
http-errors: 2.0.0
|
|
922
1039
|
iconv-lite: 0.4.24
|
|
923
1040
|
on-finished: 2.4.1
|
|
924
|
-
qs: 6.
|
|
1041
|
+
qs: 6.14.1
|
|
925
1042
|
raw-body: 2.5.2
|
|
926
1043
|
type-is: 1.6.18
|
|
927
1044
|
unpipe: 1.0.0
|
|
@@ -937,6 +1054,10 @@ snapshots:
|
|
|
937
1054
|
dependencies:
|
|
938
1055
|
fill-range: 7.1.1
|
|
939
1056
|
|
|
1057
|
+
bs58@6.0.0:
|
|
1058
|
+
dependencies:
|
|
1059
|
+
base-x: 5.0.1
|
|
1060
|
+
|
|
940
1061
|
buffer-from@1.1.2: {}
|
|
941
1062
|
|
|
942
1063
|
bytes@3.1.2: {}
|
|
@@ -996,7 +1117,7 @@ snapshots:
|
|
|
996
1117
|
|
|
997
1118
|
destroy@1.2.0: {}
|
|
998
1119
|
|
|
999
|
-
diff@
|
|
1120
|
+
diff@8.0.3: {}
|
|
1000
1121
|
|
|
1001
1122
|
dunder-proto@1.0.1:
|
|
1002
1123
|
dependencies:
|
|
@@ -1033,6 +1154,8 @@ snapshots:
|
|
|
1033
1154
|
|
|
1034
1155
|
etag@1.8.1: {}
|
|
1035
1156
|
|
|
1157
|
+
eventemitter3@5.0.1: {}
|
|
1158
|
+
|
|
1036
1159
|
express@4.21.2:
|
|
1037
1160
|
dependencies:
|
|
1038
1161
|
accepts: 1.3.8
|
|
@@ -1056,7 +1179,7 @@ snapshots:
|
|
|
1056
1179
|
parseurl: 1.3.3
|
|
1057
1180
|
path-to-regexp: 0.1.12
|
|
1058
1181
|
proxy-addr: 2.0.7
|
|
1059
|
-
qs: 6.
|
|
1182
|
+
qs: 6.14.1
|
|
1060
1183
|
range-parser: 1.2.1
|
|
1061
1184
|
safe-buffer: 5.2.1
|
|
1062
1185
|
send: 0.19.0
|
|
@@ -1087,15 +1210,6 @@ snapshots:
|
|
|
1087
1210
|
|
|
1088
1211
|
follow-redirects@1.15.11: {}
|
|
1089
1212
|
|
|
1090
|
-
form-data@2.5.5:
|
|
1091
|
-
dependencies:
|
|
1092
|
-
asynckit: 0.4.0
|
|
1093
|
-
combined-stream: 1.0.8
|
|
1094
|
-
es-set-tostringtag: 2.1.0
|
|
1095
|
-
hasown: 2.0.2
|
|
1096
|
-
mime-types: 2.1.35
|
|
1097
|
-
safe-buffer: 5.2.1
|
|
1098
|
-
|
|
1099
1213
|
form-data@4.0.4:
|
|
1100
1214
|
dependencies:
|
|
1101
1215
|
asynckit: 0.4.0
|
|
@@ -1197,6 +1311,12 @@ snapshots:
|
|
|
1197
1311
|
|
|
1198
1312
|
is-retry-allowed@2.2.0: {}
|
|
1199
1313
|
|
|
1314
|
+
isows@1.0.7(ws@8.18.3):
|
|
1315
|
+
dependencies:
|
|
1316
|
+
ws: 8.18.3
|
|
1317
|
+
|
|
1318
|
+
jose@5.10.0: {}
|
|
1319
|
+
|
|
1200
1320
|
make-error@1.3.6: {}
|
|
1201
1321
|
|
|
1202
1322
|
math-intrinsics@1.1.0: {}
|
|
@@ -1247,6 +1367,21 @@ snapshots:
|
|
|
1247
1367
|
dependencies:
|
|
1248
1368
|
wrappy: 1.0.2
|
|
1249
1369
|
|
|
1370
|
+
ox@0.11.3(typescript@5.9.3):
|
|
1371
|
+
dependencies:
|
|
1372
|
+
'@adraffy/ens-normalize': 1.11.1
|
|
1373
|
+
'@noble/ciphers': 1.3.0
|
|
1374
|
+
'@noble/curves': 1.9.1
|
|
1375
|
+
'@noble/hashes': 1.8.0
|
|
1376
|
+
'@scure/bip32': 1.7.0
|
|
1377
|
+
'@scure/bip39': 1.6.0
|
|
1378
|
+
abitype: 1.2.3(typescript@5.9.3)
|
|
1379
|
+
eventemitter3: 5.0.1
|
|
1380
|
+
optionalDependencies:
|
|
1381
|
+
typescript: 5.9.3
|
|
1382
|
+
transitivePeerDependencies:
|
|
1383
|
+
- zod
|
|
1384
|
+
|
|
1250
1385
|
parseurl@1.3.3: {}
|
|
1251
1386
|
|
|
1252
1387
|
path-is-absolute@1.0.1: {}
|
|
@@ -1264,7 +1399,7 @@ snapshots:
|
|
|
1264
1399
|
|
|
1265
1400
|
proxy-from-env@1.1.0: {}
|
|
1266
1401
|
|
|
1267
|
-
qs@6.
|
|
1402
|
+
qs@6.14.1:
|
|
1268
1403
|
dependencies:
|
|
1269
1404
|
side-channel: 1.1.0
|
|
1270
1405
|
|
|
@@ -1407,7 +1542,7 @@ snapshots:
|
|
|
1407
1542
|
acorn-walk: 8.3.4
|
|
1408
1543
|
arg: 4.1.3
|
|
1409
1544
|
create-require: 1.1.1
|
|
1410
|
-
diff:
|
|
1545
|
+
diff: 8.0.3
|
|
1411
1546
|
make-error: 1.3.6
|
|
1412
1547
|
typescript: 5.9.3
|
|
1413
1548
|
v8-compile-cache-lib: 3.0.1
|
|
@@ -1437,6 +1572,23 @@ snapshots:
|
|
|
1437
1572
|
|
|
1438
1573
|
vary@1.1.2: {}
|
|
1439
1574
|
|
|
1575
|
+
viem@2.44.4(typescript@5.9.3):
|
|
1576
|
+
dependencies:
|
|
1577
|
+
'@noble/curves': 1.9.1
|
|
1578
|
+
'@noble/hashes': 1.8.0
|
|
1579
|
+
'@scure/bip32': 1.7.0
|
|
1580
|
+
'@scure/bip39': 1.6.0
|
|
1581
|
+
abitype: 1.2.3(typescript@5.9.3)
|
|
1582
|
+
isows: 1.0.7(ws@8.18.3)
|
|
1583
|
+
ox: 0.11.3(typescript@5.9.3)
|
|
1584
|
+
ws: 8.18.3
|
|
1585
|
+
optionalDependencies:
|
|
1586
|
+
typescript: 5.9.3
|
|
1587
|
+
transitivePeerDependencies:
|
|
1588
|
+
- bufferutil
|
|
1589
|
+
- utf-8-validate
|
|
1590
|
+
- zod
|
|
1591
|
+
|
|
1440
1592
|
webidl-conversions@3.0.1: {}
|
|
1441
1593
|
|
|
1442
1594
|
whatwg-url@5.0.0:
|
|
@@ -1446,6 +1598,8 @@ snapshots:
|
|
|
1446
1598
|
|
|
1447
1599
|
wrappy@1.0.2: {}
|
|
1448
1600
|
|
|
1601
|
+
ws@8.18.3: {}
|
|
1602
|
+
|
|
1449
1603
|
xtend@4.0.2: {}
|
|
1450
1604
|
|
|
1451
1605
|
yn@3.1.1: {}
|
|
@@ -32,7 +32,7 @@ async function createEncryptionSession(req: Request, res: Response) {
|
|
|
32
32
|
throw new Error('Shield environment variables are not set');
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
const session = await openfort.
|
|
35
|
+
const session = await openfort.createEncryptionSession(
|
|
36
36
|
shieldApiKey,
|
|
37
37
|
shieldSecretKey,
|
|
38
38
|
shieldEncryptionShare,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
|
|
3
3
|
"root": true,
|
|
4
4
|
"vcs": {
|
|
5
5
|
"enabled": true,
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
"useIgnoreFile": true
|
|
8
8
|
},
|
|
9
9
|
"files": {
|
|
10
|
-
"ignoreUnknown": true
|
|
10
|
+
"ignoreUnknown": true,
|
|
11
|
+
"includes": ["**/*.tsx", "**/*.ts", "**/*.jsx", "**/*.js"]
|
|
11
12
|
},
|
|
12
13
|
"formatter": {
|
|
13
14
|
"enabled": true,
|
|
@@ -49,7 +50,6 @@
|
|
|
49
50
|
},
|
|
50
51
|
"overrides": [
|
|
51
52
|
{
|
|
52
|
-
"includes": ["**/*.tsx", "**/*.ts", "**/*.jsx", "**/*.js"],
|
|
53
53
|
"linter": {
|
|
54
54
|
"rules": {
|
|
55
55
|
"correctness": {
|