|
1 | 1 | { |
2 | 2 | "name": "@centrifuge/api-v3", |
3 | 3 | "version": "2.1.0", |
4 | | - "private": true, |
| 4 | + "repository": "https://github.com/centrifuge/api-v3", |
| 5 | + "private": false, |
5 | 6 | "type": "module", |
6 | 7 | "scripts": { |
7 | 8 | "predev": "pnpm update-registry && docker compose up -d", |
|
23 | 24 | "prepare": "husky", |
24 | 25 | "update-registry": "node scripts/fetch-registry.mjs", |
25 | 26 | "evgrep": "scripts/evgrep.sh", |
| 27 | + "sync": "node scripts/cache.mjs", |
26 | 28 | "compare-schema": "graphql-inspector diff https://api.centrifuge.io generated/schema.graphql --rule safeUnreachable --rule ignoreDescriptionChanges | grep 'Field.*removed'", |
27 | | - "sync:export": "docker compose exec -T db sh -lc 'pg_dump --dbname=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB --schema=ponder_sync --no-owner --no-privileges --clean --if-exists' | gzip > $(date +%Y%m%d)_ponder_sync.sql.gz", |
28 | | - "sync:restore": "LATEST=$(ls -t *_ponder_sync.sql.gz 2>/dev/null | head -n 1) && [ -n \"$LATEST\" ] && gzip -dc \"$LATEST\" | docker compose exec -T db sh -lc 'psql --dbname=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB'" |
| 29 | + "sync:export": "mkdir -p .ponder && docker compose exec -T db sh -lc 'pg_dump --dbname=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@localhost:5432/$POSTGRES_DB --schema=ponder_sync --no-owner --no-privileges --clean --if-exists' | gzip > .ponder/$(date +%Y%m%d)_ponder_sync.sql.gz", |
| 30 | + "sync:push": "LATEST=$(ls -t .ponder/*_ponder_sync.sql.gz 2>/dev/null | head -n 1); TAG=$(basename \"$LATEST\" | sed 's/_ponder_sync.sql.gz$//'); cp \"$LATEST\" ponder_sync.sql.gz; REPO=$(node -p \"(() => { const repo=require('./package.json').repository; const url=typeof repo==='string'?repo:repo?.url; return new URL(url).pathname.replace(/^\\\\//,'').replace(/\\\\.git$/,''); })()\"); USER=$(gh api user -q .login); gh auth token | oras login ghcr.io -u \"$USER\" --password-stdin; oras push ghcr.io/$REPO/ponder-sync:$TAG ponder_sync.sql.gz:application/gzip; oras tag ghcr.io/$REPO/ponder-sync:$TAG latest; rm -f ponder_sync.sql.gz" |
29 | 31 | }, |
30 | 32 | "dependencies": { |
31 | 33 | "@ponder/utils": "^0.2.17", |
|
34 | 36 | "drizzle-orm": "~0.41.0", |
35 | 37 | "hono": "^4.9.12", |
36 | 38 | "node-fetch": "^3.3.2", |
| 39 | + "pg": "^8.11.3", |
| 40 | + "pg-copy-streams": "^6.0.6", |
37 | 41 | "picocolors": "^1.1.1", |
38 | 42 | "pino": "^8.21.0", |
39 | 43 | "pino-pretty": "^13.1.3", |
|
43 | 47 | "devDependencies": { |
44 | 48 | "@commitlint/cli": "^19.8.1", |
45 | 49 | "@commitlint/config-conventional": "^19.8.1", |
| 50 | + "@dfatwork-pkgs/oras-client": "^0.1.0", |
46 | 51 | "@graphql-inspector/cli": "^6.0.5", |
47 | 52 | "@types/bn.js": "^5.2.0", |
48 | 53 | "@types/node": "^22.19.2", |
| 54 | + "@types/pg": "^8.11.3", |
| 55 | + "@types/pg-copy-streams": "^1.2.5", |
49 | 56 | "@typescript-eslint/eslint-plugin": "^6.21.0", |
50 | 57 | "@typescript-eslint/parser": "^6.21.0", |
51 | 58 | "@typescript/native-preview": "7.0.0-dev.20251124.1", |
|
0 commit comments