stellate 2.10.0 → 2.10.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/dist/bin.js +3 -3
- package/package.json +3 -3
package/dist/bin.js
CHANGED
|
@@ -1094,7 +1094,7 @@ Try running "stellate pull" first if your service has been created already.`);le
|
|
|
1094
1094
|
|
|
1095
1095
|
-s, --service Name of the service
|
|
1096
1096
|
-b, --browser Automatically open the preview UI with the default browser
|
|
1097
|
-
`);var ms=Ae(sn());var vv=Ae(sn());var RD=class{async parse(e){return ji(e,{"--help":Boolean,"-h":"--help","--version":Boolean,"-v":"--version","--json":Boolean})["--help"]?this.help():"stellate@2.10.
|
|
1097
|
+
`);var ms=Ae(sn());var vv=Ae(sn());var RD=class{async parse(e){return ji(e,{"--help":Boolean,"-h":"--help","--version":Boolean,"-v":"--version","--json":Boolean})["--help"]?this.help():"stellate@2.10.1"}help(e){if(e)throw new pn(`
|
|
1098
1098
|
${vv.default.bold.red("!")} ${e}
|
|
1099
1099
|
${RD.help}`);return RD.help}},Py=RD;Py.help=Mi(`
|
|
1100
1100
|
Print current version of Stellate
|
|
@@ -1392,7 +1392,7 @@ Try running "stellate pull" first if your service has been created already.`);le
|
|
|
1392
1392
|
value
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
1395
|
-
`,u=await Cn();a=(await new Xi(u).query(l,{name:"serve-token-"+Date.now(),appName:e})).createAdminApiToken.value,this.writePurgeToken(e,a)}let o=(0,GJ.default)();o.use("/",(0,WJ.createProxyMiddleware)({target:s,changeOrigin:!0,logLevel:"silent",onProxyReq:l=>{l.path.endsWith("/")&&(l.path=l.path.slice(0,-1)),l.setHeader("stellate-cli-serve-port",r),l.setHeader("stellate-token",a)}})),o.listen(r)}setupApiProxy(e,r){let i=`https://${e}.stellate.${process.env.STELLATE_ENDPOINT==="staging"||process.env.STELLATE_ENDPOINT==="local"?"dev":"sh"}`,n=(0,GJ.default)();n.use("/",(0,WJ.createProxyMiddleware)({target:i,changeOrigin:!0,headers:{"stellate-cli-serve-port":""+r},logLevel:"silent"})),n.listen(r)}ensureConfig(){Wh.default.existsSync(lc)||Wh.default.mkdirSync(lc)}getCache(){try{this.ensureConfig();let e=Wh.default.readFileSync(BS,"utf-8");return JSON.parse(e)}catch{return{}}}getCacheEntry(e){try{this.ensureConfig();let r=Wh.default.readFileSync(BS,"utf-8"),i=JSON.parse(r);if(!e)throw new Error('You need a service-name in your "stellate" config or as the "--service" argument.');return i[e]||{checksum:"",envName:""}}catch{return{checksum:"",envName:""}}}getChecksum(e){return zdr(JSON.stringify(e)+"2.10.
|
|
1395
|
+
`,u=await Cn();a=(await new Xi(u).query(l,{name:"serve-token-"+Date.now(),appName:e})).createAdminApiToken.value,this.writePurgeToken(e,a)}let o=(0,GJ.default)();o.use("/",(0,WJ.createProxyMiddleware)({target:s,changeOrigin:!0,logLevel:"silent",onProxyReq:l=>{l.path.endsWith("/")&&(l.path=l.path.slice(0,-1)),l.setHeader("stellate-cli-serve-port",r),l.setHeader("stellate-token",a)}})),o.listen(r)}setupApiProxy(e,r){let i=`https://${e}.stellate.${process.env.STELLATE_ENDPOINT==="staging"||process.env.STELLATE_ENDPOINT==="local"?"dev":"sh"}`,n=(0,GJ.default)();n.use("/",(0,WJ.createProxyMiddleware)({target:i,changeOrigin:!0,headers:{"stellate-cli-serve-port":""+r},logLevel:"silent"})),n.listen(r)}ensureConfig(){Wh.default.existsSync(lc)||Wh.default.mkdirSync(lc)}getCache(){try{this.ensureConfig();let e=Wh.default.readFileSync(BS,"utf-8");return JSON.parse(e)}catch{return{}}}getCacheEntry(e){try{this.ensureConfig();let r=Wh.default.readFileSync(BS,"utf-8"),i=JSON.parse(r);if(!e)throw new Error('You need a service-name in your "stellate" config or as the "--service" argument.');return i[e]||{checksum:"",envName:""}}catch{return{checksum:"",envName:""}}}getChecksum(e){return zdr(JSON.stringify(e)+"2.10.1")}writePurgeToken(e,r){let i=this.getCache();i[e]={...i[e],purgeToken:r},Wh.default.writeFileSync(BS,JSON.stringify(i))}writeCache(e,r,i){let n=this.getCache();if(!e)throw new Error('You need a service-name in your "stellate" config or as the "--service" argument.');return n[e]={checksum:this.getChecksum(r),envName:i},Wh.default.writeFileSync(BS,JSON.stringify(n)),n[e]}},Tw=zJ;Tw.help=Mi(`
|
|
1396
1396
|
(BETA) - Use a local backend with Stellate\u2019s GraphQL Edge Cache.
|
|
1397
1397
|
|
|
1398
1398
|
${kv.default.bold("Usage")}
|
|
@@ -1467,7 +1467,7 @@ Try running "stellate pull" first if your service has been created already.`);if
|
|
|
1467
1467
|
`);var Kc=Ae(sn()),$De=Ae(zc()),KDe=Ae(require("fs/promises"));var jN=class{async parse(e){let r=ji(e,{"--service":String,"--env":String,"--org":String,"--help":Boolean,"--dry":Boolean,"-e":"--env","-o":"--org","-h":"--help","--app":"--service"},!1);if(r["--help"])return this.help();if(r["--env"]&&r["--service"])throw new Error("Please only specify --env or --service.");let i=r._[0];if(!i)throw new Error("Please specify an action.");if(i!=="push")throw new Error("The only supported action currently is push.");let n=r._[1];if(!n||!n.endsWith(".json"))throw new Error('Please specify a ".json" file with persisted operations.');let s=await Cn(),a=r["--env"],o=await ea(a),l=Sl(o,r["--service"]);if(a&&!o)throw new Error(`Could not find configuration for environment "${a}".
|
|
1468
1468
|
Either remove the --env (-e) flag or add configuration for this environment.`);if(!o)throw new Error(`Could not find stellate configuration file.
|
|
1469
1469
|
Try running "stellate pull" first if your service has been created already.`);let u=new Xi(s),c=await KDe.default.readFile(n,"utf-8").then(m=>{try{return JSON.parse(m)}catch{throw new Error(`The file at "${n}" is not a valid JSON file.`)}}),p;typeof c=="object"&&c.operations?p=c.operations.map(m=>({hash:m.id,query:m.body})):typeof c=="object"?p=Object.keys(c).map(m=>({hash:m,query:c[m]})):p=[],p.length===0&&(console.warn(`${Kc.default.yellow("!")} No persisted operations found in the provided file.`),process.exit(0));let d=(0,$De.default)(`Pushing ${p.length} operations to ${Kc.default.bold(o.name)}`).start(),{service:f}=await u.query(`
|
|
1470
|
-
query ServiceByNameCli($name: ServiceName) {
|
|
1470
|
+
query ServiceByNameCli($name: ServiceName!) {
|
|
1471
1471
|
service(name: $name) {
|
|
1472
1472
|
id
|
|
1473
1473
|
organization {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stellate",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.1",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=16"
|
|
6
6
|
},
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"vitest": "^0.29.7",
|
|
45
45
|
"ws": "8.11.0",
|
|
46
46
|
"yaml": "^1.10.2",
|
|
47
|
-
"@gcdn/configuration": "1.30.
|
|
47
|
+
"@gcdn/configuration": "1.30.2"
|
|
48
48
|
},
|
|
49
49
|
"bin": {
|
|
50
50
|
"stellate": "dist/bin.js",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"date-fns": "^3.2.0",
|
|
114
114
|
"esbuild": "^0.17.7",
|
|
115
115
|
"express": "^4.17.1",
|
|
116
|
-
"http-proxy-middleware": "^2.0.
|
|
116
|
+
"http-proxy-middleware": "^2.0.6",
|
|
117
117
|
"is-ci": "^3.0.1",
|
|
118
118
|
"lz-string": "1.5.0",
|
|
119
119
|
"random-words": "^1.1.1",
|