Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrywithaz committed Jan 16, 2022
1 parent c7db599 commit 349acd7
Show file tree
Hide file tree
Showing 39 changed files with 1,051 additions and 322 deletions.
9 changes: 2 additions & 7 deletions bin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,14 @@ async function main() {

program
.version(packageJson.version)
.option('-i, --id <project>', 'The id of the google datastore project.', process.env.PROJECT_ID)
.option('-e, --emulator-host <host>', 'The url of the emulator', process.env.DATASTORE_EMULATOR_HOST)
.requiredOption('-i, --id <project>', 'The id of the google datastore project.', process.env.PROJECT_ID)
.requiredOption('-e, --emulator-host <host>', 'The url of the emulator', process.env.DATASTORE_EMULATOR_HOST)
.option('-p, --port <port>', 'The port to run the express server on', process.env.SERVER_PORT || '8002')
.option('-D, --dev', 'Run in dev mode', process.env.NODE_ENV === 'development')
.parse(process.argv);

const options = program.opts();

// Validate options

assert(options.id, 'Missing a project, run with -i <projectId>');
assert(options.emulatorHost, 'Missing a emulator host, run with -e <host>');

// Set consts

const DEV_MODE = Boolean(options.dev);
Expand Down
11 changes: 2 additions & 9 deletions lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "google-datastore-emulator-ui",
"version": "1.1.0",
"version": "1.2.0",
"description": "",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand All @@ -22,15 +22,16 @@
"gcloud:emulator:start": "node ./scripts/gcloud_datastore start",
"gcloud:emulator:stop": "node ./scripts/gcloud_datastore stop",
"gcloud:emulator:import": "node ./scripts/gcloud_datastore import",
"gcloud:emulator:download": "node ./scripts/gcloud_datastore download"
"gcloud:emulator:download": "node ./scripts/gcloud_datastore download",
"gcloud:emulator:export": "node ./scripts/gcloud_datastore export"
},
"author": "",
"license": "ISC",
"bin": "./lib/index.js",
"devDependencies": {
"@schemastore/package": "^0.0.6",
"@types/node": "^16.10.2",
"got": "^11.8.2",
"got": "^11.8.3",
"nodemon": "^2.0.13",
"ts-node": "^10.2.1",
"typescript": "^4.4.3"
Expand Down
35 changes: 19 additions & 16 deletions scripts/gcloud_datastore.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

require('dotenv').config();

const got = require('got');
const path = require('path');
const { mkdirSync } = require('fs');
const { spawn, execSync } = require('child_process');
Expand Down Expand Up @@ -74,7 +73,7 @@ async function stopEmulator() {
console.log(`Killing process with pid: ${pid}`);
try {
execSync(`kill -9 ${pid}`);
} catch (error) {}
} catch (error) { }
});
}

Expand Down Expand Up @@ -105,30 +104,34 @@ async function importEntities() {
process.cwd(),
`/${dir}/backups/${name}/${name}.overall_export_metadata`
);
const command = `curl -d '{"input_url": "${input_url}"}' -H 'Content-Type: application/json' -X POST ${url}:import`;

try {
await got.post(`${url}:import`, {
json: {
input_url: input_url
},
headers: {
'Content-Type': 'application/json'
}

return new Promise((resolve, reject) => {
const p = spawnProcess(command);

p.on('close', resolve);
p.on('exit', resolve);
p.on('reject', reject);
});
} catch (error) {
console.log('Unable to import entities, failed with error: ', error);
}
}

async function exportEntities() {
const output_url_prefix = `/${dir}/backups/${new Date().toISOString()}`;
const command = `curl -d '{"output_url_prefix": "${output_url_prefix}"}' -H 'Content-Type: application/json' -X POST ${url}:export`;

try {
await got.post(`${url}:export`, {
json: {
output_url_prefix: `/${dir}/backups/${new Date().toISOString()}`
},
headers: {
'Content-Type': 'application/json'
}

return new Promise((resolve, reject) => {
const p = spawnProcess(command);

p.on('close', resolve);
p.on('exit', resolve);
p.on('reject', reject);
});
} catch (error) {
console.log('Unable to export entities, failed with error: ', error);
Expand Down
16 changes: 8 additions & 8 deletions src/client/build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"files": {
"main.css": "/static/css/main.b9b2c731.chunk.css",
"main.js": "/static/js/main.40c1e5bf.chunk.js",
"runtime-main.js": "/static/js/runtime-main.14d8c866.js",
"static/js/2.dacab311.chunk.js": "/static/js/2.dacab311.chunk.js",
"static/js/3.831e55aa.chunk.js": "/static/js/3.831e55aa.chunk.js",
"main.js": "/static/js/main.ad465f2f.chunk.js",
"runtime-main.js": "/static/js/runtime-main.105cdb64.js",
"static/js/2.61f4962f.chunk.js": "/static/js/2.61f4962f.chunk.js",
"static/js/3.39c21e72.chunk.js": "/static/js/3.39c21e72.chunk.js",
"index.html": "/index.html",
"static/js/2.dacab311.chunk.js.LICENSE.txt": "/static/js/2.dacab311.chunk.js.LICENSE.txt"
"static/js/2.61f4962f.chunk.js.LICENSE.txt": "/static/js/2.61f4962f.chunk.js.LICENSE.txt"
},
"entrypoints": [
"static/js/runtime-main.14d8c866.js",
"static/js/2.dacab311.chunk.js",
"static/js/runtime-main.105cdb64.js",
"static/js/2.61f4962f.chunk.js",
"static/css/main.b9b2c731.chunk.css",
"static/js/main.40c1e5bf.chunk.js"
"static/js/main.ad465f2f.chunk.js"
]
}
2 changes: 1 addition & 1 deletion src/client/build/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><link href="/static/css/main.b9b2c731.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,i,a=t[0],c=t[1],l=t[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(t);p.length;)p.shift()();return u.push.apply(u,l||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,a=1;a<r.length;a++){var c=r[a];0!==o[c]&&(n=!1)}n&&(u.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={1:0},u=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"831e55aa"}[e]+".chunk.js"}(e);var c=new Error;u=function(t){a.onerror=a.onload=null,clearTimeout(l);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),u=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,r[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(t)},i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpclient=this.webpackJsonpclient||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var f=c;r()}([])</script><script src="/static/js/2.dacab311.chunk.js"></script><script src="/static/js/main.40c1e5bf.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><link href="/static/css/main.b9b2c731.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,i,a=t[0],c=t[1],l=t[2],s=0,p=[];s<a.length;s++)i=a[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(t);p.length;)p.shift()();return u.push.apply(u,l||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,a=1;a<r.length;a++){var c=r[a];0!==o[c]&&(n=!1)}n&&(u.splice(t--,1),e=i(i.s=r[0]))}return e}var n={},o={1:0},u=[];function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var u,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+"static/js/"+({}[e]||e)+"."+{3:"39c21e72"}[e]+".chunk.js"}(e);var c=new Error;u=function(t){a.onerror=a.onload=null,clearTimeout(l);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),u=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,r[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:a})}),12e4);a.onerror=a.onload=u,document.head.appendChild(a)}return Promise.all(t)},i.m=e,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)i.d(r,n,function(t){return e[t]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/",i.oe=function(e){throw console.error(e),e};var a=this.webpackJsonpclient=this.webpackJsonpclient||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var l=0;l<a.length;l++)t(a[l]);var f=c;r()}([])</script><script src="/static/js/2.61f4962f.chunk.js"></script><script src="/static/js/main.ad465f2f.chunk.js"></script></body></html>
2 changes: 2 additions & 0 deletions src/client/build/static/js/2.61f4962f.chunk.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/client/build/static/js/2.dacab311.chunk.js

This file was deleted.

Loading

0 comments on commit 349acd7

Please sign in to comment.