From d8456788cb6c23bd0a093648a77bde337a1d4c47 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Wed, 25 Sep 2024 09:01:49 -0600 Subject: [PATCH] send all info needed to create a Trustroots event --- .env.production | 1 + .eslintrc.js | 10 +++ README.md | 4 +- package-lock.json | 119 +++++++++++++++++++++++++++++++ package.json | 1 + src/constants/app.ts | 16 +++-- src/views/AccountViewView.vue | 10 ++- src/views/NewEditProjectView.vue | 60 ++++++++++++---- 8 files changed, 201 insertions(+), 20 deletions(-) diff --git a/.env.production b/.env.production index 0be1773..af02790 100644 --- a/.env.production +++ b/.env.production @@ -2,3 +2,4 @@ VITE_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01GXYPFF7FA03NXKPYY142PY4H VITE_DEFAULT_ENDORSER_API_SERVER=https://api.endorser.ch VITE_DEFAULT_IMAGE_API_SERVER=https://image-api.timesafari.app +VITE_DEFAULT_PARTNER_API_SERVER=https://partner-api.timesafari.app diff --git a/.eslintrc.js b/.eslintrc.js index 1c6cbdc..58c9c98 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -14,8 +14,18 @@ module.exports = { // ecmaVersion: 2020, // }, rules: { + "max-len": [ + "warn", + { + code: 100, + ignoreComments: true, + ignoreTemplateLiterals: true, + ignoreUrls: true, + }, + ], "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", + "prettier/prettier": ["warn", { printWidth: 100 }], "@typescript-eslint/no-unnecessary-type-constraint": "off", }, }; diff --git a/README.md b/README.md index 0f4c17d..4650c6c 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ npm install npm run dev ``` +See the test locations for "IMAGE_API_SERVER" or "PARTNER_API_SERVER" below, or use http://localhost:3000 for local endorser.ch + ### Build the test & production app ``` npm run serve @@ -49,7 +51,7 @@ npm run lint ``` # (Let's replace this with a .env.development or .env.staging file.) # The test BVC_MEETUPS_PROJECT_CLAIM_ID does not resolve as a URL because it's only in the test DB and the prod redirect won't redirect there. -TIME_SAFARI_APP_TITLE="TimeSafari_Test" VITE_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01HWE8FWHQ1YGP7GFZYYPS272F VITE_DEFAULT_ENDORSER_API_SERVER=https://test-api.endorser.ch VITE_DEFAULT_IMAGE_API_SERVER=https://test-image-api.timesafari.app VITE_PASSKEYS_ENABLED=true npm run build +TIME_SAFARI_APP_TITLE="TimeSafari_Test" VITE_BVC_MEETUPS_PROJECT_CLAIM_ID=https://endorser.ch/entity/01HWE8FWHQ1YGP7GFZYYPS272F VITE_DEFAULT_ENDORSER_API_SERVER=https://test-api.endorser.ch VITE_DEFAULT_IMAGE_API_SERVER=https://test-image-api.timesafari.app VITE_DEFAULT_PARTNER_API_SERVER=https://partner-api.endorser.ch VITE_PASSKEYS_ENABLED=true npm run build ``` * Production diff --git a/package-lock.json b/package-lock.json index 19c53cf..41fabde 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,6 +46,7 @@ "lru-cache": "^10.2.0", "luxon": "^3.4.4", "merkletreejs": "^0.3.11", + "nostr-tools": "^2.7.2", "notiwind": "^2.0.2", "papaparse": "^5.4.1", "pina": "^0.20.2204228", @@ -17367,6 +17368,124 @@ "node": ">=0.10.0" } }, + "node_modules/nostr-tools": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/nostr-tools/-/nostr-tools-2.7.2.tgz", + "integrity": "sha512-Bq3Ug0SZFtgtL1+0wCnAe8AJtI7yx/00/a2nUug9SkhfOwlKS92Tef12iCK9FdwXw+oFZWMtRnSwcLayQso+xA==", + "dependencies": { + "@noble/ciphers": "^0.5.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.1", + "@scure/base": "1.1.1", + "@scure/bip32": "1.3.1", + "@scure/bip39": "1.2.1" + }, + "optionalDependencies": { + "nostr-wasm": "v0.1.0" + }, + "peerDependencies": { + "typescript": ">=5.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/nostr-tools/node_modules/@noble/ciphers": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-0.5.3.tgz", + "integrity": "sha512-B0+6IIHiqEs3BPMT0hcRmHvEj2QHOLu+uwt+tqDDeVd0oyVzh7BPrDcPjRnV1PV/5LaknXJJQvOuRGR0zQJz+w==", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/nostr-tools/node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/nostr-tools/node_modules/@noble/curves/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/nostr-tools/node_modules/@noble/hashes": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.1.tgz", + "integrity": "sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/nostr-tools/node_modules/@scure/base": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.1.tgz", + "integrity": "sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA==", + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ] + }, + "node_modules/nostr-tools/node_modules/@scure/bip32": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.1.tgz", + "integrity": "sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A==", + "dependencies": { + "@noble/curves": "~1.1.0", + "@noble/hashes": "~1.3.1", + "@scure/base": "~1.1.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/nostr-tools/node_modules/@scure/bip32/node_modules/@noble/curves": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.1.0.tgz", + "integrity": "sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==", + "dependencies": { + "@noble/hashes": "1.3.1" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/nostr-tools/node_modules/@scure/bip39": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", + "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", + "dependencies": { + "@noble/hashes": "~1.3.0", + "@scure/base": "~1.1.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/nostr-wasm": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/nostr-wasm/-/nostr-wasm-0.1.0.tgz", + "integrity": "sha512-78BTryCLcLYv96ONU8Ws3Q1JzjlAt+43pWQhIl86xZmWeegYCNLPml7yQ+gG3vR6V5h4XGj+TxO+SS5dsThQIA==", + "optional": true + }, "node_modules/notiwind": { "version": "2.0.2", "license": "MIT", diff --git a/package.json b/package.json index af0c4dd..a711df8 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "lru-cache": "^10.2.0", "luxon": "^3.4.4", "merkletreejs": "^0.3.11", + "nostr-tools": "^2.7.2", "notiwind": "^2.0.2", "papaparse": "^5.4.1", "pina": "^0.20.2204228", diff --git a/src/constants/app.ts b/src/constants/app.ts index d936d4f..854e4b1 100644 --- a/src/constants/app.ts +++ b/src/constants/app.ts @@ -12,14 +12,18 @@ export enum AppString { TEST_ENDORSER_API_SERVER = "https://test-api.endorser.ch", LOCAL_ENDORSER_API_SERVER = "http://localhost:3000", - PROD_PUSH_SERVER = "https://timesafari.app", - TEST1_PUSH_SERVER = "https://test.timesafari.app", - TEST2_PUSH_SERVER = "https://timesafari-pwa.anomalistlabs.com", - PROD_IMAGE_API_SERVER = "https://image-api.timesafari.app", TEST_IMAGE_API_SERVER = "https://test-image-api.timesafari.app", LOCAL_IMAGE_API_SERVER = "http://localhost:3001", + PROD_PARTNER_API_SERVER = "https://endorser.ch", + TEST_PARTNER_API_SERVER = "https://test-partner.endorser.ch", + LOCAL_PARTNER_API_SERVER = LOCAL_ENDORSER_API_SERVER, + + PROD_PUSH_SERVER = "https://timesafari.app", + TEST1_PUSH_SERVER = "https://test.timesafari.app", + TEST2_PUSH_SERVER = "https://timesafari-pwa.anomalistlabs.com", + NO_CONTACT_NAME = "(no name)", } @@ -31,6 +35,10 @@ export const DEFAULT_IMAGE_API_SERVER = import.meta.env.VITE_DEFAULT_IMAGE_API_SERVER || AppString.TEST_IMAGE_API_SERVER; +export const DEFAULT_PARTNER_API_SERVER = + import.meta.env.VITE_DEFAULT_PARTNER_API_SERVER || + AppString.TEST_PARTNER_API_SERVER; + export const DEFAULT_PUSH_SERVER = window.location.protocol + "//" + window.location.host; diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 09679d1..feea0fa 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -588,11 +588,15 @@
- Image Server URL -   + Image Server URL  {{ DEFAULT_IMAGE_API_SERVER }}
+
+ Partner Server URL  + {{ DEFAULT_PARTNER_API_SERVER }} +
+