@bsv/create-dpp-app 0.1.0-beta.1 → 0.1.0-beta.2
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/NOTICE +2 -0
- package/PATENTS +12 -0
- package/README.md +26 -6
- package/dist/index.js +36 -8
- package/package.json +9 -5
- package/template/Dockerfile +4 -2
- package/template/README.md +297 -42
- package/template/_env.example +82 -13
- package/template/_github/workflows/ci.yml +3 -3
- package/template/apps/api/API.md +86 -16
- package/template/apps/api/package.json +9 -4
- package/template/apps/api/src/bound-profiles.ts +590 -0
- package/template/apps/api/src/claims.ts +175 -56
- package/template/apps/api/src/cli.ts +64 -7
- package/template/apps/api/src/config.ts +124 -10
- package/template/apps/api/src/custody.ts +241 -69
- package/template/apps/api/src/dev-index.ts +58 -9
- package/template/apps/api/src/env-file.ts +55 -0
- package/template/apps/api/src/epcis/exchange.ts +434 -0
- package/template/apps/api/src/epcis/mongo-storage.ts +381 -0
- package/template/apps/api/src/epcis/routes.ts +364 -0
- package/template/apps/api/src/epcis/sources.ts +142 -0
- package/template/apps/api/src/go-live.ts +226 -0
- package/template/apps/api/src/http-error.ts +15 -0
- package/template/apps/api/src/identifiers.ts +1 -1
- package/template/apps/api/src/index-client.ts +131 -6
- package/template/apps/api/src/index-projects.ts +53 -0
- package/template/apps/api/src/lifecycle-authority.ts +49 -0
- package/template/apps/api/src/lifecycle.ts +485 -0
- package/template/apps/api/src/main.ts +10 -2
- package/template/apps/api/src/parties.ts +2 -2
- package/template/apps/api/src/platform.ts +72 -17
- package/template/apps/api/src/portability/commands.ts +224 -0
- package/template/apps/api/src/portability/export.ts +708 -0
- package/template/apps/api/src/portability/package.ts +270 -0
- package/template/apps/api/src/portability/restore.ts +863 -0
- package/template/apps/api/src/profiles.ts +38 -13
- package/template/apps/api/src/reader.ts +172 -3
- package/template/apps/api/src/resolver.ts +159 -0
- package/template/apps/api/src/sector-examples.ts +390 -0
- package/template/apps/api/src/server.ts +253 -60
- package/template/apps/api/src/store.ts +198 -21
- package/template/apps/api/src/validation-engine.ts +172 -0
- package/template/apps/api/src/wallet.ts +30 -17
- package/template/apps/api/src/worker.ts +20 -13
- package/template/apps/api/src/writer.ts +383 -131
- package/template/apps/api/test/bound-http.test.ts +496 -0
- package/template/apps/api/test/bound-profiles.test.ts +547 -0
- package/template/apps/api/test/config.test.ts +148 -3
- package/template/apps/api/test/custody-journal.test.ts +415 -0
- package/template/apps/api/test/custody-recovery-profile.test.ts +224 -0
- package/template/apps/api/test/custom-profile.test.ts +167 -0
- package/template/apps/api/test/env-file.test.ts +53 -0
- package/template/apps/api/test/epcis-fixtures.ts +270 -0
- package/template/apps/api/test/epcis-http.test.ts +1179 -0
- package/template/apps/api/test/epcis-mongo-storage.test.ts +313 -0
- package/template/apps/api/test/epcis-separation.test.ts +253 -0
- package/template/apps/api/test/epcis-web.test.ts +230 -0
- package/template/apps/api/test/exit-exercise.test.ts +1038 -0
- package/template/apps/api/test/external-index.test.ts +3 -2
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/background.ttl +33 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/binding.json +141 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/context.jsonld +36 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/product.schema.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/shapes.ttl +112 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/conflicting-gtin.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/conflicting-serial.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/granularity-mismatch.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/item-gtin-13.json +43 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/item.json +42 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/missing-required-property.json +43 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/model-as-subject.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/no-passport-identifier.json +43 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/other-product.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/part-not-dishwasher-safe.json +45 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/altered-artefact.json +19 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/altered-background.ttl +33 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/conflicting-binding.json +141 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/conflicting-second-registration.json +19 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/registration/untrusted-binding.json +13 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/unlisted-context.json +47 -0
- package/template/apps/api/test/fixtures/custom-profile/example-bottle@1/vectors/wrong-binding-digest.json +44 -0
- package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/binding.json +88 -0
- package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/product.schema.json +25 -0
- package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/vectors/item.json +26 -0
- package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/vectors/missing-required-property.json +27 -0
- package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/vectors/no-passport-identifier.json +27 -0
- package/template/apps/api/test/fixtures/custom-profile/example-notebook@1/vectors/other-product.json +28 -0
- package/template/apps/api/test/go-live.test.ts +179 -0
- package/template/apps/api/test/gs1-global-setup.ts +33 -0
- package/template/apps/api/test/gs1-test-env.ts +5 -0
- package/template/apps/api/test/identifier-host.test.ts +256 -0
- package/template/apps/api/test/index-projects.test.ts +81 -0
- package/template/apps/api/test/lifecycle-claims.test.ts +546 -0
- package/template/apps/api/test/lifecycle-fixtures.ts +167 -0
- package/template/apps/api/test/lifecycle.test.ts +17 -6
- package/template/apps/api/test/manifest-notice.test.ts +36 -0
- package/template/apps/api/test/network-guard.ts +113 -0
- package/template/apps/api/test/portability.test.ts +655 -0
- package/template/apps/api/test/profile-bundle-resolver.test.ts +198 -0
- package/template/apps/api/test/retired-profiles.test.ts +216 -0
- package/template/apps/api/test/sector-cutover.test.ts +95 -0
- package/template/apps/api/test/sector-forms.test.ts +420 -0
- package/template/apps/api/test/unjoined-index.test.ts +62 -0
- package/template/apps/api/test/validation-engine.test.ts +328 -0
- package/template/apps/api/test/wallet-monitor.test.ts +38 -0
- package/template/apps/api/test/writer-journal.test.ts +327 -0
- package/template/apps/api/vitest.config.ts +3 -0
- package/template/apps/web/src/app.tsx +8 -4
- package/template/apps/web/src/components/bound/bound-passport-form.tsx +368 -0
- package/template/apps/web/src/components/bound/field-view.tsx +237 -0
- package/template/apps/web/src/components/bound/pieces.tsx +169 -0
- package/template/apps/web/src/components/bound/readings.tsx +152 -0
- package/template/apps/web/src/components/bound/structured-value.tsx +114 -0
- package/template/apps/web/src/components/claim-dialog.tsx +344 -0
- package/template/apps/web/src/components/epcis-events.tsx +119 -0
- package/template/apps/web/src/components/layout.tsx +17 -0
- package/template/apps/web/src/components/lifecycle-claims.tsx +199 -0
- package/template/apps/web/src/components/passport-form.tsx +2 -2
- package/template/apps/web/src/components/read-passport.tsx +4 -3
- package/template/apps/web/src/components/reading.tsx +32 -39
- package/template/apps/web/src/lib/api.ts +136 -26
- package/template/apps/web/src/lib/bound/battery-form.ts +269 -0
- package/template/apps/web/src/lib/bound/display.ts +122 -0
- package/template/apps/web/src/lib/bound/fields.ts +128 -0
- package/template/apps/web/src/lib/bound/form-model.ts +521 -0
- package/template/apps/web/src/lib/bound/forms.ts +15 -0
- package/template/apps/web/src/lib/bound/identity.ts +48 -0
- package/template/apps/web/src/lib/bound/textile-form.ts +236 -0
- package/template/apps/web/src/lib/bound/units.ts +37 -0
- package/template/apps/web/src/lib/epcis.ts +345 -0
- package/template/apps/web/src/lib/format.ts +27 -4
- package/template/apps/web/src/lib/lifecycle.ts +350 -0
- package/template/apps/web/src/pages/accept.tsx +8 -3
- package/template/apps/web/src/pages/events.tsx +388 -0
- package/template/apps/web/src/pages/new-passport.tsx +25 -2
- package/template/apps/web/src/pages/operations.tsx +22 -3
- package/template/apps/web/src/pages/passport.tsx +226 -162
- package/template/apps/web/src/pages/public-passport.tsx +50 -10
- package/template/apps/web/src/pages/wallet.tsx +1 -1
- package/template/apps/web/vite.config.ts +12 -4
- package/template/deploy/compose.yml +14 -2
- package/template/package.json +9 -3
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url'
|
|
2
2
|
import react from '@vitejs/plugin-react'
|
|
3
3
|
import tailwindcss from '@tailwindcss/vite'
|
|
4
|
-
import { defineConfig } from 'vite'
|
|
4
|
+
import { defineConfig, loadEnv } from 'vite'
|
|
5
|
+
|
|
6
|
+
// In development Vite serves the pages and proxies to the API what the API
|
|
7
|
+
// answers itself: /api, and the identifier host's paths, which are every path
|
|
8
|
+
// under /01, the resolver description and a compressed identifier
|
|
9
|
+
// (apps/api/src/resolver.ts). Vite answers an OPTIONS request itself, before
|
|
10
|
+
// its proxy. In production the API serves the built pages itself
|
|
11
|
+
// (apps/web/dist).
|
|
12
|
+
const projectRoot = fileURLToPath(new URL('../../', import.meta.url))
|
|
13
|
+
const { PORT } = loadEnv('development', projectRoot, 'PORT')
|
|
14
|
+
const api = { target: process.env.API_URL ?? `http://127.0.0.1:${PORT || '3000'}`, changeOrigin: false }
|
|
5
15
|
|
|
6
|
-
// In development Vite serves the pages and proxies /api to the API. In
|
|
7
|
-
// production the API serves the built pages itself (apps/web/dist).
|
|
8
16
|
export default defineConfig({
|
|
9
17
|
plugins: [react(), tailwindcss()],
|
|
10
18
|
resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } },
|
|
11
19
|
server: {
|
|
12
20
|
port: 5173,
|
|
13
|
-
proxy: { '/api':
|
|
21
|
+
proxy: { '/api': api, '^/01(/|\\?|$)': api, '^/\\.well-known/gs1resolver/?(\\?|$)': api, '^/e[hx][A-Za-z0-9_-]{16,}/?(\\?|$)': api },
|
|
14
22
|
},
|
|
15
23
|
})
|
|
@@ -3,13 +3,25 @@
|
|
|
3
3
|
# docker compose -f deploy/compose.yml --env-file .env up -d
|
|
4
4
|
#
|
|
5
5
|
# Connect the app to an existing index with INDEX_URL and its access tokens,
|
|
6
|
-
# or operate one
|
|
6
|
+
# or operate one separately with the DPP repository's operator preset (deploy/).
|
|
7
7
|
# This Compose file does not start an index. See README.md, Connect an index.
|
|
8
|
+
#
|
|
9
|
+
# It does not start a validator service either. By default the application
|
|
10
|
+
# validates in its own process. To use a service instead, set VALIDATOR_URL to
|
|
11
|
+
# one an operator runs, such as the validator of the DPP repository's operator
|
|
12
|
+
# preset, or start one beside the app with `npx dpp-validator`. See README.md,
|
|
13
|
+
# The validation engine.
|
|
14
|
+
#
|
|
15
|
+
# MongoDB is named by tag and digest: the tag says which version the digest
|
|
16
|
+
# was resolved from, and the digest is what is pulled, so two machines run the
|
|
17
|
+
# same image. It is the pin the DPP repository's operator preset uses. MongoDB
|
|
18
|
+
# Community Server is its publisher's program under the Server Side Public
|
|
19
|
+
# License, pulled from its publisher; it is not part of this project.
|
|
8
20
|
name: dpp-platform
|
|
9
21
|
|
|
10
22
|
services:
|
|
11
23
|
mongo:
|
|
12
|
-
image: mongo:7
|
|
24
|
+
image: mongo:7.0.48@sha256:9896df581dfd0718b7abe112f4c37598d0986c54060e4ec1384997e6503c8c71
|
|
13
25
|
restart: unless-stopped
|
|
14
26
|
command: ["mongod", "--bind_ip_all"]
|
|
15
27
|
ports:
|
package/template/package.json
CHANGED
|
@@ -19,10 +19,15 @@
|
|
|
19
19
|
"format": "prettier --write \"apps/**/*.{ts,tsx,css,json}\"",
|
|
20
20
|
"start": "node apps/api/dist/main.js",
|
|
21
21
|
"wallet": "tsx apps/api/src/cli.ts wallet",
|
|
22
|
-
"operations": "tsx apps/api/src/cli.ts operations"
|
|
22
|
+
"operations": "tsx apps/api/src/cli.ts operations",
|
|
23
|
+
"go-live": "tsx apps/api/src/cli.ts go-live",
|
|
24
|
+
"connect-index": "tsx apps/api/src/cli.ts connect-index",
|
|
25
|
+
"export": "tsx apps/api/src/cli.ts export",
|
|
26
|
+
"restore": "tsx apps/api/src/cli.ts restore",
|
|
27
|
+
"epcis-remap": "tsx apps/api/src/cli.ts epcis-remap"
|
|
23
28
|
},
|
|
24
29
|
"dpp": {
|
|
25
|
-
"releaseSet": "dpp-release-2026-
|
|
30
|
+
"releaseSet": "dpp-release-2026-11"
|
|
26
31
|
},
|
|
27
32
|
"overrides": {
|
|
28
33
|
"@bsv/overlay": {
|
|
@@ -37,6 +42,7 @@
|
|
|
37
42
|
},
|
|
38
43
|
"allowScripts": {
|
|
39
44
|
"better-sqlite3@13.0.3": true,
|
|
40
|
-
"esbuild@0.28.2": true
|
|
45
|
+
"esbuild@0.28.2": true,
|
|
46
|
+
"mongodb-memory-server@11.2.0": false
|
|
41
47
|
}
|
|
42
48
|
}
|