@degenerate/endpoints 0.4.0 → 0.7.0

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.
@@ -1 +1 @@
1
- {"version":3,"file":"v1.routes.d.ts","sourceRoot":"","sources":["../../../src/routes/sharedata/v1.routes.ts"],"names":[],"mappings":"AAwRA,eAAO,MAAM,EAAE,4CAAS,CAAC"}
1
+ {"version":3,"file":"v1.routes.d.ts","sourceRoot":"","sources":["../../../src/routes/sharedata/v1.routes.ts"],"names":[],"mappings":"AAqSA,eAAO,MAAM,EAAE,4CAAS,CAAC"}
@@ -67,7 +67,7 @@ const getManager = (req) => {
67
67
  const getAllowedSigningKeys = (req) => {
68
68
  const raw = req.auth?.customClaims?.allowedSigningKeys;
69
69
  return Array.isArray(raw) && raw.every((k) => typeof k === 'string')
70
- ? raw
70
+ ? (raw)
71
71
  : undefined;
72
72
  };
73
73
  router.use(add_unique_tracking_1.addUniqueTracking); // add the unique tracking id to the request
@@ -153,6 +153,15 @@ router.post(// https://{hostname}/sharedata/v1
153
153
  successful: false,
154
154
  error: 'unsupported-block-type: GraceRepayment blocks are not created via this route',
155
155
  });
156
+ case generic_1.ShareBlockType.Settlement:
157
+ // Not creatable through this generic route: a Settlement block
158
+ // is a cross-block coordinator built by the orchestrator from a
159
+ // signed settlement plan, not from a wire create payload. It is
160
+ // a library primitive with no HTTP creation surface in v1.
161
+ return res.status(400).send({
162
+ successful: false,
163
+ error: 'unsupported-block-type: Settlement coordinators are not created via this route',
164
+ });
156
165
  default: {
157
166
  // Exhaustiveness check — schema validation should prevent
158
167
  // reaching this, but TS doesn't know that. A runtime fallback
@@ -189,6 +198,10 @@ const REQUIRED_PURPOSES_BY_BLOCK_TYPE = {
189
198
  // Listed for type-completeness and to document the real proof set, even
190
199
  // though the route currently rejects GraceRepayment creation above.
191
200
  [generic_1.ShareBlockType.GraceRepayment]: shareblock_1.GRACE_REPAYMENT_REQUIRED_PROOF_PURPOSES,
201
+ // Settlement coordinators have no generic-route creation path (rejected
202
+ // above), so there is no wire proof bundle to cover — empty for
203
+ // type-completeness only.
204
+ [generic_1.ShareBlockType.Settlement]: [],
192
205
  };
193
206
  /**
194
207
  * This gets the sharedata objects and their data.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@degenerate/endpoints",
3
- "version": "0.4.0",
3
+ "version": "0.7.0",
4
4
  "description": "This contains the ShareData Adaptive Framework Ecosystem (SAFE) network endpoint code",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -50,16 +50,16 @@
50
50
  "author": "Degenerate Inc.",
51
51
  "license": "ISC",
52
52
  "dependencies": {
53
- "@degenerate/generic": "^0.4.0",
54
- "@degenerate/realtime": "^0.4.0",
55
- "@degenerate/shareblock": "^0.4.0",
56
- "@degenerate/sharedata": "^0.4.0",
53
+ "@degenerate/generic": "^0.7.0",
54
+ "@degenerate/realtime": "^0.7.0",
55
+ "@degenerate/shareblock": "^0.7.0",
56
+ "@degenerate/sharedata": "^0.7.0",
57
57
  "@types/supertest": "^6.0.3",
58
58
  "express": "^5.2.1",
59
59
  "supertest": "^7.2.2",
60
60
  "zod": "^4.4.3"
61
61
  },
62
- "gitHead": "9453d9ab785e03fd01eb5b408ed0e3ca22baefd5",
62
+ "gitHead": "1f747e160c9022863c7b2d7b8a6a157f204be95b",
63
63
  "engines": {
64
64
  "node": ">=22"
65
65
  }