Merge branch 'spencer/update-cic-meta' into 'master'
Add changes from stand-alone cic-meta repo. See merge request grassrootseconomics/cic-internal-integration!41
This commit is contained in:
commit
6fe87652ce
1
apps/cic-meta/.gitignore
vendored
1
apps/cic-meta/.gitignore
vendored
@ -1,5 +1,6 @@
|
||||
node_modules
|
||||
dist
|
||||
dist-web
|
||||
dist-server
|
||||
scratch
|
||||
tests
|
||||
|
@ -101,6 +101,18 @@ function parseDigest(url) {
|
||||
|
||||
async function processRequest(req, res) {
|
||||
let digest = undefined;
|
||||
const headers = {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Access-Control-Allow-Methods": "OPTIONS, POST, GET, PUT",
|
||||
"Access-Control-Max-Age": 2592000, // 30 days
|
||||
"Access-Control-Allow-Headers": 'Access-Control-Allow-Origin, Content-Type, x-cic-automerge'
|
||||
};
|
||||
|
||||
if (req.method === "OPTIONS") {
|
||||
res.writeHead(200, headers);
|
||||
res.end();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!['PUT', 'GET', 'POST'].includes(req.method)) {
|
||||
res.writeHead(405, {"Content-Type": "text/plain"});
|
||||
@ -201,6 +213,7 @@ async function processRequest(req, res) {
|
||||
|
||||
const responseContentLength = (new TextEncoder().encode(content)).length;
|
||||
res.writeHead(200, {
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Content-Type": contentType,
|
||||
"Content-Length": responseContentLength,
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
export { PGPSigner, PGPKeyStore } from './auth';
|
||||
export { PGPSigner, PGPKeyStore, Signer } from './auth';
|
||||
export { Envelope, Syncable } from './sync';
|
||||
export { User } from './assets/user';
|
||||
export { Phone } from './assets/phone';
|
||||
|
@ -93,7 +93,7 @@ function orderDict(src) {
|
||||
return dst;
|
||||
}
|
||||
|
||||
class Syncable implements JSONSerializable, Authoritative {
|
||||
class Syncable implements JSONSerializable, Authoritative, Signable {
|
||||
|
||||
id: string
|
||||
timestamp: number
|
||||
|
Loading…
Reference in New Issue
Block a user